473,395 Members | 2,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Insert bulk data into table & temporarily disable log

Hi,

I am going to insert a large amount (200,000 records) of data into a table
Is there a way that I can temporarily disable the log? so that the insertion
run faster

Thanks in advance

Nov 12 '05 #1
6 10446
"Tuong Do" <tu*****@hotmail.com> wrote in message
news:d3**********@news-01.bur.connect.com.au...
Hi,

I am going to insert a large amount (200,000 records) of data into a table
Is there a way that I can temporarily disable the log? so that the
insertion
run faster

Thanks in advance

Create a script as follows:

alter table table-name not logged initially;
insert into table-name select * from table-name2;
commit:

Run the script as follows:

db2 +c -tvf script_name > script_results
Nov 12 '05 #2
For inserts, I think the solution is to use "alter table activate not
logged initially". Check the docs for the exact behavior.

Using the LOAD utility is probably the fastest way to load data, check
the "nonrecoverable" option, like in "load from myfile.txt of del
insert into mytable nonrecoverable".

Regards,
Ivan

Tuong Do wrote:
Hi,

I am going to insert a large amount (200,000 records) of data into a table Is there a way that I can temporarily disable the log? so that the insertion run faster

Thanks in advance


Nov 12 '05 #3
Thank Mark,

But how do go reverse the alter statement? (after your script end)

Will it only valid for the duration of the script / current unit of work?

"Mark A" <no****@nowhere.com> wrote in message
news:zI********************@comcast.com...
"Tuong Do" <tu*****@hotmail.com> wrote in message
news:d3**********@news-01.bur.connect.com.au...
Hi,

I am going to insert a large amount (200,000 records) of data into a
table
Is there a way that I can temporarily disable the log? so that the
insertion
run faster

Thanks in advance

Create a script as follows:

alter table table-name not logged initially;
insert into table-name select * from table-name2;
commit:

Run the script as follows:

db2 +c -tvf script_name > script_results

Nov 12 '05 #4
"Tuong Do" <tu*****@hotmail.com> wrote in message
news:d3**********@news-01.bur.connect.com.au...
Thank Mark,

But how do go reverse the alter statement? (after your script end)

Will it only valid for the duration of the script / current unit of work?

As soon as the commit is issued in the script, then logging is turned back
on. That is why the commit was included in the script I gave you.
Nov 12 '05 #5
Simple way:

LOAD FROM <FNM> OF DEL INSERT INTO <TBL_NM> NONRECOVERABLE

The NONRECOVERABLE option turns off the log for the load.
Nov 12 '05 #6
Ian
Zining Fu via DBMonster.com wrote:
Simple way:

LOAD FROM <FNM> OF DEL INSERT INTO <TBL_NM> NONRECOVERABLE

The NONRECOVERABLE option turns off the log for the load.


No, NONRECOVERABLE prevents DB2 from putting the tablespace into BACKUP
PENDING after a load if LOGRETAIN is turned on.

Loads are inherently not logged (other than a couple of control records).
Nov 12 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: yee young han | last post by:
I need a fast data structure and algorithm like below condition. (1) this data structure contain only 10,000 data entry. (2) data structure's one entry is like below typedef struct _DataEntry_...
11
by: Hi5 | last post by:
Hi, I am new to access I usedto work in Oracle and Mysql. I am after a way that enables me to populate a database I designed in access with lots of data which can be sorted in excel sheets, ...
4
by: Jon Slaughter | last post by:
Is there any method to temporarily disable focus changing?(I assume only method is tab or mouse?) This problem has been tieing me up for a while and nothing seems to work. The only thing that I...
37
by: Vince C. | last post by:
Hi all. I've installed Bloodshed Dev-C++ on a Windows 2000 SP4 machine. I'm using MinGW 3.4.2. I'd like to temporarily disable standard functions to write to stderr, i.e. for instance...
1
by: san1014 | last post by:
Hi........ I am Using Oracle 10g, I want to insert bulk amount of data into the database. How can i do this Using Sql * Loader? (Tell me individually for both sequntial data and Random Data) ...
2
Inbaraj
by: Inbaraj | last post by:
HI.. I want to perform Bulk Insert of data using C# and oracle can any one help me how to perform this operation.... Plz help me with sample code..... with reg Inba
3
hsriat
by: hsriat | last post by:
How can I temporarily disable vertical scrollbar? I have replaced confirmation boxes and alert boxes with inlay popup DIVs. But while they are on the screen, I need to disable scrollbar of the...
0
by: Amar Nath | last post by:
i am using this code..it shows the error as bulk insert CSVTest1 from 'D:\1_attlog.txt' with (FIELDTERMINATOR=' ') { FIELDTERMINATOR=' ' ROWTERMINATOR='\N'...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.