对oracle datafile header进行转储
环境:
rhel5.5,x64,oracle 10.2.0.5.12
转储命令:
alter session set events 'immediate trace name file_hdrs level 10';
该命令摘自:
How to Find DATE and TIME of Creation of Datafile? (Doc ID 1039747.6)
[oracle@jjtest udump]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.5.0 - Production on Fri May 15 12:08:02 2015 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> alter session set events 'immediate trace name file_hdrs level 10'; Session altered. SQL> exit 生成在udump目录下 [oracle@jjtest udump]$ ls -lrt total 172 -rw-r----- 1 oracle oinstall 672 May 13 08:08 orcl_ora_5696.trc -rw-r----- 1 oracle oinstall 1107 May 13 08:12 orcl_ora_5743.trc -rw-r----- 1 oracle oinstall 672 May 13 08:12 orcl_ora_5745.trc -rw-r----- 1 oracle oinstall 3032 May 13 08:14 orcl_ora_5771.trc -rw-r----- 1 oracle oinstall 1007 May 13 08:15 orcl_ora_5811.trc -rw-r----- 1 oracle oinstall 672 May 13 08:15 orcl_ora_5813.trc -rw-r----- 1 oracle oinstall 916 May 13 08:15 orcl_ora_5843.trc -rw-r----- 1 oracle oinstall 1007 May 13 09:42 orcl_ora_6322.trc -rw-r----- 1 oracle oinstall 674 May 13 09:57 orcl_ora_14465.trc -rw-r----- 1 oracle oinstall 918 May 13 09:57 orcl_ora_14493.trc -rw-r----- 1 oracle oinstall 858 May 13 10:17 orcl_ora_14595.trc -rw-r----- 1 oracle oinstall 700 May 14 05:38 orcl_ora_4833.trc -rw-r----- 1 oracle oinstall 2369 May 14 05:39 orcl_ora_4863.trc -rw-r----- 1 oracle oinstall 704 May 14 05:54 orcl_ora_5074.trc -rw-r----- 1 oracle oinstall 700 May 15 08:24 orcl_ora_4319.trc -rw-r----- 1 oracle oinstall 3910 May 15 08:42 orcl_ora_4347_10046.trc -rw-r----- 1 oracle oinstall 820 May 15 09:12 orcl_ora_4393_controlfile.trc -rw-r----- 1 oracle oinstall 820 May 15 09:18 orcl_ora_4463.trc -rw-r----- 1 oracle oinstall 45745 May 15 09:28 orcl_ora_4484.trc -rw-r----- 1 oracle oinstall 811 May 15 12:03 orcl_ora_4855.trc -rw-r----- 1 oracle oinstall 48376 May 15 12:08 orcl_ora_4956.trc --->此文件就是datafile header进行转储得到的文件 [oracle@jjtest udump]$ date Fri May 15 12:08:10 CST 2015
以下全文引用'orcl_ora_4956.trc'文件的内容:
/u01/app/oracle/admin/orcl/udump/orcl_ora_4956.trc Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1 System name: Linux Node name: jjtest Release: 2.6.18-348.el5 Version: #1 SMP Wed Nov 28 21:22:00 EST 2012 Machine: x86_64 Instance name: orcl Redo thread mounted by this instance: 1 Oracle process number: 15 Unix process pid: 4956, image: oracle@jjtest (TNS V1-V3) *** ACTION NAME:() 2015-05-15 12:08:06.136 *** MODULE NAME:(sqlplus@jjtest (TNS V1-V3)) 2015-05-15 12:08:06.136 *** SERVICE NAME:() 2015-05-15 12:08:06.136 *** SESSION ID:(654.17) 2015-05-15 12:08:06.136 DUMP OF DATA FILES: 7 files in database DATA FILE #1: (name #7) /u01/app/oracle/oradata/orcl/system01.dbf creation size=0 block size=8192 status=0xe head=7 tail=7 dup=1 tablespace 0, index=1 krfil=1 prev_file=0 unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00 Checkpoint cnt:58 scn: 0x0000.0006b6fe 05/14/2015 05:39:06 Stop scn: 0xffff.ff