If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Logging off question during update

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-12-04, 13:30
rvsc36 rvsc36 is offline
Registered User
 
Join Date: Jan 2004
Location: Phoenix, AZ
Posts: 42
Logging off question during update

Hi,

I want to update a large number of rows in a table and I keep filling up the logs. Rather than increase the log size (space unavailable), I have decided that I want to turn logging off on the table(s) that I am running the updates in while the table is being updated.

I understand that when logging is turned off that there will be no way to get back the data if needed unless the table is backed up prior. That will be covered either with a table export or full db backup.

Is this the correct syntax to turn logging off temporarily while updates are performed? Can this be done when you are not creating the table initially?

"Alter table lawson.actrans activate not logged initially;"
"Update lawson.actrans set xxxxx = xxxx where ......"
commit;

What is the syntax to turn logging back on for the table afterwards?

Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 10-12-04, 14:23
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
The syntax looks OK ... On committing, the logging will start ...

If you are on Version 8, you do not have to create the table with NLI option for ALTER TABLE to work ... In Version 7, you will have to

Cheers
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 10-12-04, 14:24
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
The first commit (either explicit or due to AUTOCOMMIT being ON) will re-enable logging.
Reply With Quote
  #4 (permalink)  
Old 10-12-04, 14:31
rvsc36 rvsc36 is offline
Registered User
 
Join Date: Jan 2004
Location: Phoenix, AZ
Posts: 42
Great, Thanks! I will be sure not to issue a commit statement.

So, will the syntax to re-enable logging for that table be:

"Alter table lawson.actrans activate logged initially;" ???

Thx
Reply With Quote
  #5 (permalink)  
Old 10-12-04, 14:54
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
You will want to use a commit after you update statement. You will also need to turn off auto-commit in your CLI interface by using the -c option (-c -tvf ...)
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On