轉儲指定的資料塊並檢視TRC資訊

還不算暈發表於2013-10-10

1.轉儲指定的塊:需要兩個資訊:檔案號和塊號

BYS@bys1>alter system dump datafile 1 block 100;
System altered.


2.定位找出user tracefile的位置:

BYS@bys1>show parameter user_dump_dest;
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
user_dump_dest                       string      /u01/diag/rdbms/bys1/bys1/trac
就是用使用dump命令時,檔案轉儲的位置:


3.進一步定位是哪個檔案

由於trace檔案的名字和OS的程式有很大的關聯,所以必須得找出
OS的程式號:關聯3個檢視(V$process,v$mystat,v$session)
select spid from v$process
 where addr=(select paddr from v$session
 where sid=(select distinct sid from v$mystat));

4.定位到檔案

[oracle@bys001 ~]$ cd /u01/diag/rdbms/bys1/bys1/trace/

[oracle@bys001 trace]$ ls *4641*
bys1_ora_4641.trc  bys1_ora_4641.trm
[oracle@bys001 trace]$ ls -al bys1_ora_4641*
-rw-r----- 1 oracle oinstall 18859 Oct 10 15:49 bys1_ora_4641.trc
-rw-r----- 1 oracle oinstall   120 Oct 10 15:49 bys1_ora_4641.trm
[oracle@bys001 trace]$ date
Thu Oct 10 15:52:59 CST 2013

5.檢視檔案--只擷取前三十行

[oracle@bys001 trace]$ head -n 30 bys1_ora_4641.trc


Trace file /u01/diag/rdbms/bys1/bys1/trace/bys1_ora_4641.trc
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1
System name:    Linux
Node name:      bys001.oel.com
Release:        2.6.32-200.13.1.el5uek
Version:        #1 SMP Wed Jul 27 20:21:26 EDT 2011
Machine:        i686
Instance name: bys1

Redo thread mounted by this instance: 1
Oracle process number: 31
Unix process pid: 4641, image: oracle@bys001.oel.com (TNS V1-V3)



*** 2013-10-10 15:49:50.862
*** SESSION ID:(37.3002) 2013-10-10 15:49:50.862
*** CLIENT ID:() 2013-10-10 15:49:50.862
*** SERVICE NAME:(SYS$USERS) 2013-10-10 15:49:50.862
*** MODULE NAME:(SQL*Plus) 2013-10-10 15:49:50.862
*** ACTION NAME:() 2013-10-10 15:49:50.862
 
Start dump data blocks tsn: 0 file#:1 minblk 100 maxblk 100
Block dump from cache:
Dump of buffer cache at level 4 for tsn=0, rdba=4194404
Block dump from disk:
buffer tsn: 0 rdba: 0x00400064 (1/100)
scn: 0x0000.000000cd seq: 0x01 flg: 0x04 tail: 0x00cd1e01
frmt: 0x02 chkval: 0x8254 type: 0x1e=KTFB Bitmapped File Space Bitmap
Hex dump of block: st=0, typ_found=1


相關文章