pa***************@yahoo.co.in wrote:
Hi,
I need some clearance on the following questions:
1) Does LOAD command updates indexes defined for a table?
LOAD has to maintain indexes, of course. How else would you ensure the
consistency of indexes and the data in the table?
2) Is REPLACE option in the LOAD command a logged operation?
DB2 needs to write a log record for the truncation, and it truly does so:
http://publib.boulder.ibm.com/infoce...n/r0001910.htm
I just loaded an empty file into a table using the REPLACE option. This
caused the table to be truncated, and it generated the following log
records. The 8th log record is probably the one you're interested in.
Database name : test
Start of LSN Range : 0.187.35944
End of LSN Range : 0.312.32780
================================================== =========================
Log record LSN : 0.187.35944
Next log record LSN : 0.187.36420
Previous log record in transaction : (null)
Transaction identifier : 0.0.287
Length of log record : 476 bytes
Type log record : [0x004A] Table load start
General flags : Propagatable
Written by : Utility Manager
Tablespace identifier : [2] USERSPACE1
Table identifier : [2] DB2I00.X
Table flags : [0x00000000]
Load identifier : LD01
---------------------------------------------------------------------------
Log record LSN : 0.187.36420
Next log record LSN : 0.187.36456
Previous log record in transaction : 0.187.35944
Transaction identifier : 0.0.287
Length of log record : 36 bytes
Type log record : [0x004E] Normal
General flags : Redo always
Written by : Data Management System (DMS)
Function identifier : [124] Alter table attributes
Tablespace identifier : [2] USERSPACE1
Table identifier : [2] DB2I00.X
Table attribute change : [0x00000008] Set table in LOAD state
---------------------------------------------------------------------------
Log record LSN : 0.187.36456
Next log record LSN : 0.187.36664
Previous log record in transaction : 0.187.36420
Transaction identifier : 0.0.287
Length of log record : 208 bytes
Type log record : [0x004E] Normal
General flags : None
Written by : Data Management System (DMS)
Function identifier : [120] Update record
Tablespace identifier : [2] USERSPACE1
Table identifier : [2] DB2I00.X
Page number : 0
Slot number of record/entry on page : 2
Old length of record on page : 76 bytes
Length of record (group) on page : 76 bytes
Free space on page : 2876 bytes
Type of record header : [0x00] (normal)
Storage type of record data : Internal control
Offset of record on page : 2916
---------------------------------------------------------------------------
Log record LSN : 0.187.36664
Next log record LSN : 0.187.36688
Previous log record in transaction : 0.187.36456
Transaction identifier : 0.0.287
Length of log record : 24 bytes
Type log record : [0x006B] Table load locator create
General flags : None
Written by : Utility Manager
Tablespace identifier : [2] USERSPACE1
Table identifier : [2] DB2I00.X
---------------------------------------------------------------------------
Log record LSN : 0.187.36688
Next log record LSN : 0.187.36726
Previous log record in transaction : 0.187.36664
Transaction identifier : 0.0.287
Length of log record : 38 bytes
Type log record : [0x0084] Normal commit
General flags : Propagatable
Written by : Transaction Manager
Authorization : DB2I00
Commit timestamp : Mon Oct 24 13:52:55 2005
---------------------------------------------------------------------------
Log record LSN : 0.187.36726
Next log record LSN : 0.187.37218
Previous log record in transaction : (null)
Transaction identifier : 0.0.288
Length of log record : 476 bytes
Type log record : [0x004A] Table load start
General flags : None
Written by : Utility Manager
Tablespace identifier : [2] USERSPACE1
Table identifier : [2] DB2I00.X
Table flags : [0x00000000]
Load identifier : LD02
---------------------------------------------------------------------------
Log record LSN : 0.187.37218
Next log record LSN : 0.187.37262
Previous log record in transaction : 0.187.36726
Transaction identifier : 0.0.288
Length of log record : 44 bytes
Type log record : [0x0052] Redo
General flags : Redo always
Written by : Data Object Manager (DOM)
Function identifier : [10] Change life Lsn
Tablespace identifier : [2] USERSPACE1
Table identifier : [2] DB2I00.X
Object tablespace : [2] USERSPACE1
Object identifier : [2] DB2I00.X (Table)
Object flags : 0x00000000
Old life LSN : 0.187.33188
Life LSN : 0.187.37218
---------------------------------------------------------------------------
Log record LSN : 0.187.37262
Next log record LSN : 0.187.37402
Previous log record in transaction : 0.187.36726
Transaction identifier : 0.0.288
Length of log record : 140 bytes
Type log record : [0x004E] Normal
General flags : None
Written by : Data Object Manager (DOM)
Truncate timestamp : Mon Oct 24 13:52:56 2005
Function identifier : [11] Truncate table
Tablespace identifier : [2] USERSPACE1
Table identifier : [2] DB2I00.X
Object tablespace : [2] USERSPACE1
Object identifier : [2] DB2I00.X (Table)
Object flags : 0x00000000
Long/LOB data tablespace : [2] USERSPACE1
Long data object identifier : [0]
LOB data object identifier : [0]
Index data tablespace : [2] USERSPACE1
Index data object identifier : [0]
Life LSN : 0.187.36726
---------------------------------------------------------------------------
Log record LSN : 0.187.37402
Next log record LSN : 0.187.37446
Previous log record in transaction : 0.187.37262
Transaction identifier : 0.0.288
Length of log record : 44 bytes
Type log record : [0x0052] Redo
General flags : Redo always
Written by : Data Object Manager (DOM)
Function identifier : [10] Change life Lsn
Tablespace identifier : [2] USERSPACE1
Table identifier : [2] DB2I00.X
Object tablespace : [2] USERSPACE1
Object identifier : [2] DB2I00.X (Table)
Object flags : 0x00000000
Old life LSN : 0.187.37218
Life LSN : 0.187.37402
---------------------------------------------------------------------------
Log record LSN : 0.187.37446
Next log record LSN : 0.250.12
Previous log record in transaction : 0.187.37262
Transaction identifier : 0.0.288
Length of log record : 7336 bytes
Type log record : [0x008A] Local pending list
General flags : None
Written by : Transaction Manager
Commit timestamp : Mon Oct 24 13:52:56 2005
---------------------------------------------------------------------------
Log record LSN : 0.250.12
Next log record LSN : 0.250.94
Previous log record in transaction : (null)
Transaction identifier : 0.0.429
Length of log record : 82 bytes
Type log record : [0x004E] Normal
General flags : None
Written by : Data Management System (DMS)
Function identifier : [118] Insert record
Tablespace identifier : [0] SYSCATSPACE
Table identifier : [13] SYSIBM.SYSDBAUTH
Page number : 0
Slot number of record/entry on page : 6
Length of record (group) on page : 44 bytes
Free space on page : 2650 bytes
Type of record header : [0x00] (normal)
Storage type of record data : Data without VALUE COMPRESSION
Offset of record on page : 2664
Length of fixed data of record : 20 bytes
---------------------------------------------------------------------------
Log record LSN : 0.250.94
Next log record LSN : 0.250.173
Previous log record in transaction : 0.250.12
Transaction identifier : 0.0.429
Length of log record : 79 bytes
Type log record : [0x004E] Normal
General flags : None
Written by : Index Manager
Function identifier : [101] Add key to index
Tablespace identifier : [0] SYSCATSPACE
Table identifier : [13] SYSIBM.SYSDBAUTH
Object tablespace : [0] SYSCATSPACE
Object identifier : [13] (Index)
Root page of index : 2
Page number : 2
Slot number of record/entry on page : 2
Offset of key data in index entry : 0
---------------------------------------------------------------------------
Log record LSN : 0.250.173
Next log record LSN : 0.312.32780
Previous log record in transaction : 0.250.94
Transaction identifier : 0.0.429
Length of log record : 28 bytes
Type log record : [0x0084] Normal commit
General flags : None
Written by : Transaction Manager
Commit timestamp : Mon Oct 24 14:08:04 2005
================================================== =========================
read log records : 13 records
read log bytes : 9011 bytes
worktime : 0.02 seconds
--
Knut Stolze
DB2 Information Integration Development
IBM Germany