Posted on 2010-03-23 22:28
Prayer 阅读(257)
评论(0) 编辑 收藏 引用 所属分类:
DB2
LIST HISTORY Command
Lists entries in the history file. The history file contains a record of recovery and administrative events. Recovery events include full database and table space level backup, incremental backup, restore, and rollforward operations. Additional logged events include create, alter, drop, or rename table space, reorganize table, drop table, and load.
Required connection
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.
Command syntax
>>-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-------'
Command parameters
- HISTORY
- Lists all events that are currently logged in the history file.
- BACKUP
- Lists backup and restore operations.
- ROLLFORWARD
- Lists rollforward operations. 1 1
- DROPPED TABLE 1
- Lists dropped table records. A dropped table record is created only when the 1 table is dropped and the table space containing it has the DROPPED TABLE RECOVERY 1 option enabled. 1
- LOAD
- Lists load operations.
- CREATE TABLESPACE
- Lists table space create and drop operations.
- RENAME TABLESPACE
- Lists table space renaming operations.
- REORG
- Lists reorganization operations.
- ALTER TABLESPACE
- Lists alter table space operations.
- ARCHIVE LOG
- Lists archive log operations and the archived logs.
- ALL
- Lists all entries of the specified type in the history file.
- SINCE timestamp
- A complete time stamp (format yyyymmddhhmmss), or an initial prefix (minimum yyyy) can be specified. All entries with time stamps equal to or greater than the time stamp provided are listed.
- CONTAINING schema.object_name
- This qualified name uniquely identifies a table.
- CONTAINING object_name
- This unqualified name uniquely identifies a table space.
- FOR DATABASE database-alias
- Used to identify the database whose recovery history file is to be listed.
Examples
db2 list history since 19980201 for sample
db2 list history backup containing userspace1 for sample
db2 list history dropped table all for db sample
Usage notes
The report generated by this command contains the following symbols:
Operation
A - Create table space
B - Backup
C - Load copy
D - Dropped table
F - Roll forward
G - Reorganize table
L - Load
N - Rename table space
O - Drop table space
Q - Quiesce
R - Restore
T - Alter table space
U - Unload
X - Archive log
Type
Archive Log types:
P - Primary log path
M - Secondary (mirror) log path
F - Failover archive path
1 - Primary log archive method
2 - Secondary log archive method
Backup types:
F - Offline
N - Online
I - Incremental offline
O - Incremental online
D - Delta offline
E - Delta online
Rollforward types:
E - End of logs
P - Point in time
Load types:
I - Insert
R - Replace
Alter table space types:
C - Add containers
R - Rebalance
Quiesce types:
S - Quiesce share
U - Quiesce update
X - Quiesce exclusive
Z - Quiesce reset