The LIST HISTORY command only returns history information for the database partition it is issued on. To list the history on multiple partitions, you can either issue the LIST HISTORY command from each individual database partition, or use the db2_all prefix to run the LIST HISTORY command on all database partitions
None
Instance. You must attach to any remote database in order to run this command against it. For a local database, an explicit attachment is not required.
>>-LIST HISTORY--+-------------------+--------------------------> +-BACKUP------------+ +-ROLLFORWARD-------+ +-DROPPED TABLE-----+ +-LOAD--------------+ +-CREATE TABLESPACE-+ +-ALTER TABLESPACE--+ +-RENAME TABLESPACE-+ +-REORG-------------+ '-ARCHIVE LOG-------' >--+-ALL--------------------------------+-----------------------> +-SINCE--timestamp-------------------+ '-CONTAINING--+-schema.object_name-+-' '-object_name--------' >--FOR--+----------+--database-alias--------------------------->< +-DATABASE-+ '-DB-------'
db2 list history since 19980201 for sample
db2 list history backup containing userspace1 for sample
db2 list history dropped table all for db sample
db2 list history all for SAMPLE
List History File for sample
Number of matching file entries = 2
Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID
-- --- ------------------ ---- --- ------------ ------------ --------------
L T 20100106133005001 R S S0000000.LOG S0000000.LOG
----------------------------------------------------------------------------
"USERNAME"."T1" resides in 1 tablespace(s):
00001 USERSPACE1
----------------------------------------------------------------------------
Comment: DB2
Start Time: 20100106133005
End Time: 20100106133006
Status: A
----------------------------------------------------------------------------
EID: 3 Location: /home/hotel19/username/mydatafile.del
----------------------------------------------------------------------------
SQLCA Information
sqlcaid : SQLCA sqlcabc: 136 sqlcode: 3107 sqlerrml: 0
sqlerrmc:
sqlerrp : SQLUVLD
sqlerrd : (1) -2146107283 (2) 0 (3) 0
(4) 0 (5) 0 (6) 0
sqlwarn : (1) W (2) (3) (4) (5) (6)
(7) (8) (9) (10) (11)
sqlstate:
Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID
-- --- ------------------ ---- --- ------------ ------------ --------------
B D 20100106135509001 F D S0000000.LOG S0000000.LOG
----------------------------------------------------------------------------
Contains 2 tablespace(s):
00001 SYSCATSPACE
00002 USERSPACE1
----------------------------------------------------------------------------
Comment: DB2 BACKUP SAMPLE OFFLINE
Start Time: 20100106135509
End Time: 20100106135512
Status: A
----------------------------------------------------------------------------
EID: 4 Location: /home/hotel19/username
db2 -v "list history reorg all for wsdb"
Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID
-- --- ------------------ ---- --- ------------ ------------ --------------
G T 20080924101408 N S0000000.LOG S0000000.LOG
----------------------------------------------------------------------------
Table: "ZHMFENG "."T1"
----------------------------------------------------------------------------
Comment: REORG RECLAIM
Start Time: 20080924101408
End Time: 20080924101409
Status: A
db2_all "db2 list history since 20010601 for sample"
The following is an example of DB history records in a DB2® pureScale® environment.
db2 list history since 20091020163200 for database sample
Op Obj Timestamp+Sequence Type Dev Backup ID
-- --- ------------------ ---- --- --------------
X D 20091020163218 1 D
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Log Stream ID Earliest Log Current Log
------------- ------------ ------------
3 S0000023.LOG C0000000
----------------------------------------------------------------------------
Comment:
Start Time: 20091020163218
End Time: 20091020163245
Status: A
----------------------------------------------------------------------------
EID: 28 Location: /notnfs/billings/arch_logs/billings/SAMPLE/NODE0000/LOGSTREAM0002/C0000000/S0000023.LOG
Op Obj Timestamp+Sequence Type Dev Backup ID
-- --- ------------------ ---- --- --------------
X D 20091020163219 1 D
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Log Stream ID Earliest Log Current Log
------------- ------------ ------------
0 S0000001.LOG C0000000
----------------------------------------------------------------------------
Comment:
Start Time: 20091020163219
End Time: 20091020163257
Status: A
----------------------------------------------------------------------------
EID: 29 Location: /notnfs/billings/arch_logs/billings/SAMPLE/NODE0000/LOGSTREAM0000/C0000000/S0000001.LOG
The following is an example of DB history records outside of a DB2 pureScale environment.
db2 list history since 20091020155300 for database sample
Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID
-- --- ------------------ ---- --- ------------ ------------ --------------
X D 20091020155341 1 D S0000004.LOG C0000000
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Comment:
Start Time: 20091020155341
End Time: 20091020155345
Status: A
----------------------------------------------------------------------------
EID: 9 Location: /notnfs/billings/arch_logs/billings/SAMPLE/NODE0000/LOGSTREAM0000/C0000000/S0000004.LOG
The SYSIBMADM.DB_HISTORY administrative view can be used to retrieve data from all database partitions.
In a DB2 pureScale instance, all DB history records for the database are global. The DB history records can be retrieved using the list history or administrative view interface connected to any member.
Operation
A - Create table space
B - Backup
C - Load copy
D - Drop table
F - Rollforward
G - Reorganize
L - Load
N - Rename table space
O - Drop table space
Q - Quiesce
R - Restore
T - Alter table space
U - Unload
X - Archive log
Object
D - Database
I - Index
P - Table space
T - Table
R - Partitioned table
Type
Alter table space operation types:
C - Add container
R - Rebalance
Archive log operation types:
F - Failover archive path
M - Secondary (mirror) log path
N - Archive log command
P - Primary log path
1 - Primary log archive method
2 - Secondary log archive method
Backup and restore operation types:
D - Delta offline
E - Delta online
F - Offline
I - Incremental offline
M - Merged
N - Online
O - Incremental online
R - Rebuild
Load operation types:
I - Insert
R - Replace
Rollforward operation types:
E - End of logs
P - Point-in-time
Quiesce operation types:
S - Quiesce share
U - Quiesce update
X - Quiesce exclusive
Z - Quiesce reset
History entry status flag:
A - Active
D - Deleted
E - Expired
I - Inactive
N - Not yet committed
P - Pending delete
X - Do not delete
a - Incomplete active
i - Incomplete inactive