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 > Logs

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-13-07, 12:12
d_mohan81 d_mohan81 is offline
Registered User
 
Join Date: Feb 2007
Posts: 31
Arrow Logs

Hi,
I used "alter table <tablename> activate not logged initially ".
When I tired to delete some of the recordes in that table, the logs are get updated. But I think the logs should not get updated because i have alterted the table to NOT LOGGED mode.
Eg:

par:/db2t_logs/dbs8140$db2 "select * from bmc.test" bmc.test"

T1 T2
---------- -------
qwertqS 12.
qwertqS 12.
qwertqS 12.
qwertqS 12.

4 record(s) selected.

par:/db2t_logs/dbs8140$ls -ltr
total 24056
-rw------- 1 db2t udbadmin 512 Mar 19 2003 SQLLPATH.TAG
-rw------- 1 db2t udbadmin 4104192 Mar 09 16:57 S0000389.LOG
-rw------- 1 db2t udbadmin 4104192 Mar 13 15:38 S0000390.LOG
-rw------- 1 db2t udbadmin 4104192 Mar 13 16:14 S0000388.LOG


par:/db2t7_logs/dbs8140$db2 "alter table bmc.test activate not logged initially"
DB20000I The SQL command completed successfully.


part:/db2t_logs/dbs8140$db2 "select * from bmc.test"
T1 T2
---------- -------
qwertqS 12.
qwertqS 12.
qwertqS 12.
qwertqS 12.

4 record(s) selected.

par:/db2t_logs/dbs8140$db2 "delete from bmc.test where t2=12"
DB20000I The SQL command completed successfully.

par:/db2t_logs/dbs8140$ls -ltr
total 24056
-rw------- 1 db2t udbadmin 512 Mar 19 2003 SQLLPATH.TAG
-rw------- 1 db2t udbadmin 4104192 Mar 09 16:57 S0000389.LOG
-rw------- 1 db2t udbadmin 4104192 Mar 13 15:38 S0000390.LOG
-rw------- 1 db2t udbadmin 4104192 Mar 13 16:19 S0000388.LOG

par:/db2t_logs/dbs8140$db2 "select * from bmc.test"
T1 T2
---------- -------

0 record(s) selected.
--------------------------------------------------------------------------

Regards
Mohan
__________________
Regards
Mohan
Reply With Quote
  #2 (permalink)  
Old 03-13-07, 12:53
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
You have to do the "ALTER TABLE..." statement and all other statements (DELETE, UPDATE, INSERT) in the same Unit of Work (UOW). A UOW is, in DB2, basically from one commit/rollback to the next. It looks like you are executing you commands from the CLP. This has autocommit ON by default, which commits each statement. You need to turn autocommit off using:
UPDATE COMMAND OPTIONS using C OFF
You will also have to manually issue the COMMIT statement when you are done.

Andy
Reply With Quote
  #3 (permalink)  
Old 03-13-07, 13:28
d_mohan81 d_mohan81 is offline
Registered User
 
Join Date: Feb 2007
Posts: 31
Hi,
Thanks for your prompt reply..
db2 "alter table bmc.test activate not logged initially" ,transcation should not be logged in Logs files though if autocommit is on. Is this correct statment..?
__________________
Regards
Mohan
Reply With Quote
  #4 (permalink)  
Old 03-13-07, 13:31
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Quote:
Originally Posted by d_mohan81
Hi,
Thanks for your prompt reply..
db2 "alter table bmc.test activate not logged initially" ,transcation should not be logged in Logs files though if autocommit is on. Is this correct statment..?
No. If autocommit is on, then when you issue the ALTER TABLE command a commit is automatically sent (hence "autocommit") thus ending your UOW. The next statement will begin a second UOW and will be logged.

Andy
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