Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Db2 quickly creates tens of millions of level simulation data

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Use python to generate import file

#! / usr/bin/env python

#-*-coding: utf-8-*-

Import random

Path = r "F:\ alien_invasion\ DATA_BLKLISTS01A.del"

List = open (path,'w')

Count1 = 1

Print ("start execution!" )

For i in range (10000000):

I = iFig 1

Count1 + = 1

Randomcount = random.randint (0pc9)

Print (""% s, "8613%sd", 1randomcount 1, "remarks", ""% (iGrainstr (randomcount), count1)

List.writelines (""% s, "8613%sd", 1randomcount 1, "remarks",\ n "% (iForce str (randomcount), count1)

The # function writelines (list) function writelines can write list to a file, but does not add a newline character after each element of the list, so you need to add it yourself if you want every line to have a newline character.

Print ("execution is over!")

List.close ()

Using db2 load tool to import data

Db2 connect to database name

Create a 500w data table

Db2 "CREATE TABLE XIFENFEI_LOAD (col1 INT NOT NULL primary key

Col2 CHAR (100) NOT NULL

Col3 VARCHAR (20) NOT NULL

Col4 VARCHAR (20) NOT NULL

Col5 VARCHAR (20) NOT NULL) "

Import 5 million data

Db2 load from / tmp/DATA_BLKLISTS01.del of del insert into XIFENFEI_LOAD1 nonrecoverable

Create a 1000w data table

Db2 "CREATE TABLE XIFENFEI_LOAD4 (col1 BIGINT NOT NULL primary key

Col2 CHAR (100) NOT NULL

Col3 VARCHAR (20) NOT NULL

Col4 VARCHAR (20) NOT NULL

Col5 VARCHAR (20) NOT NULL) "

Import 10 million data

Db2 load from / tmp/DATA_BLKLISTS01A.del of del insert into XIFENFEI_LOAD4 nonrecoverable

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report