Millions of record using shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Millions of record using shell script
# 1  
Old 01-21-2013
Millions of record using shell script

I wanna create a millions of record using shell scripts..
the scenario is somehow like this,,,i want to create the record for these fields in my database..id,name,addrs,sales.
So can you please give a overall idea for how to achieve it?
# 2  
Old 01-21-2013
How about using a PL/SQL instead?

If field ID is primary key in your table, then use a PL/SQL for loop to generate and insert 1M IDs:-
Code:
for i in 1..1000000 loop
    insert into your_table values (i,'name','addrs','sales');
end loop;
commit;

# 3  
Old 01-21-2013
bipin: Aren't the name and other details suppose to change?? Smilie
# 4  
Old 01-21-2013
If you want to use file as external table then below one is also can be good option :

i=1; while [ $i -lt 10 ]; do echo "$i , $i name ,$i address , $i sales , "; ((i=$i+1)) done >> E_your_table

You will get below result
1 , 1 name ,1 address , 1 sales ,
2 , 2 name ,2 address , 2 sales ,
3 , 3 name ,3 address , 3 sales ,
4 , 4 name ,4 address , 4 sales ,
5 , 5 name ,5 address , 5 sales ,
6 , 6 name ,6 address , 6 sales ,
7 , 7 name ,7 address , 7 sales ,
8 , 8 name ,8 address , 8 sales ,
9 , 9 name ,9 address , 9 sales ,

Hope you find this useful .

Last edited by kailas.girase; 01-21-2013 at 03:14 AM..
This User Gave Thanks to kailas.girase For This Post:
# 5  
Old 01-21-2013
Quote:
Originally Posted by PikK45
bipin: Aren't the name and other details suppose to change?? Smilie
I guess the user want this to conduct a performance test, in that case user just need a million records with unique ids. So what difference will it make having other details changed?
# 6  
Old 01-21-2013
Thanks bipin and all for revert back to this post.Not only id's but i wanna create million record for every fields.First i wanna save that into a csv file den i will export.Is that possible to create those number of record with unique id.
# 7  
Old 01-21-2013
You can use the solution provided by kailas.girase
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need code for updating second record to first record in shell scripting

Hi,, I have requirement that i need to get DISTINCT values from a table and if there are two records i need to update it to one record and then need to submit INSERT statements by using the updated value as a parameter. Here is the example follows.. SELECT DISTINCT ID FROM OFFER_GROUP WHERE... (1 Reply)
Discussion started by: Samah
1 Replies

2. Shell Programming and Scripting

Shell script for field wise record count for different Files .csv files

Hi, Very good wishes to all! Please help to provide the shell script for generating the record counts in filed wise from the .csv file My question: Source file: Field1 Field2 Field3 abc 12f sLm 1234 hjd 12d Hyd 34 Chn My target file should generate the .csv file with the... (14 Replies)
Discussion started by: Kirands
14 Replies

3. Shell Programming and Scripting

Print record count of a file using shell script

HI, I need to print the record count of a file using shell script. If the record count of a file excluding header and trailer record if greater than zero then print 'Record count of a file is xxxx records'. If the record count is zero print 'zero records' Thanks Mahendra (1 Reply)
Discussion started by: mmeda
1 Replies

4. Shell Programming and Scripting

Extract record in shell script,so far using awk without success

hello, I require help in the following. There is a report similar to the ones shown here. I need to do couple of things 10/07 12:47 0003210042 R TENN ANVISER0 DELF96A.V1.O.TENRREG 120710 124657 U 00000 DELFOR 1 4331 10/07 12:47 0003210043 S TENN... (2 Replies)
Discussion started by: rakeshv
2 Replies

5. Shell Programming and Scripting

Need script to remove millions of tmp files in /html/cache/ directory

Hello, I just saw that on my vps (centOS) my oscommerce with a seo script has created millions of tmp files inside the /html/cache/ directory. I would need to remove all those files (millions), I tried via shell but the vps loads goes to very high and it hangs, is there some way to do a... (7 Replies)
Discussion started by: andymc1
7 Replies

6. UNIX for Advanced & Expert Users

How to zip/tar millions of files?

Hi guys, I have an issue processing a large amount of files. I have around 5 million files (some of them are actually directories) in a server. I am unable to find out the exact number of files since it's taking "forever" to finish (See this thread for more on the issue). Anyway, now I... (6 Replies)
Discussion started by: verdepollo
6 Replies

7. Shell Programming and Scripting

Shell script for searching a record,copy to a file and then delete it

Hi, I have a requirement in hand: I have a file with millions of records say file 1.I have another file, say file 2 which has 2000 records in it. The requirement is to read file2 , and remove the read record from file 1 and move i to a seperate file, file 3. For eg: Read file 2, get the... (5 Replies)
Discussion started by: kumara2010
5 Replies

8. Shell Programming and Scripting

Generating millions of record using shell script

Hi All, My requirement is like this. I want to generate records of 1 million lines. If I say lines it means one line will contain some string or numbers like AA,3,4,45,+223424234,Tets,Ghdj,+33434,345453434,........................ upto length lets say 41. ( 41 comma sepearted aplha numneric... (2 Replies)
Discussion started by: Rahil2k9
2 Replies

9. Shell Programming and Scripting

Parsing record into multiple records in Shell Script

Hi, I am trying to parse a very long record in a text file into multiple records by checking ADD, DELETE, or MODIFY field value in a shell script. Input # File name xyz.txt ADD|N000|8015662|DELETE|N001|9915662|MODIFY|N999|85678 Output ADD|N000|8015662| DELETE|N001|9915662|... (8 Replies)
Discussion started by: naveed
8 Replies

10. UNIX for Advanced & Expert Users

Shell script failing to read large Xml record-urgent critical help

Hi All, I have shell script running on AIX 5.3 box. It has 7 to 8 "sed" commands piped(|) together. It has a an Xml file as its input which has many records internally. There are certain record which which have more than hundered tags.The script is taking a huge amount of time more than 1.5 hrs... (10 Replies)
Discussion started by: aixjadoo
10 Replies
Login or Register to Ask a Question