alter session set tracefile_identifier = 'alter_session';
execute dbms_system.ksdwrt(1, 'Example using alter session'); -- 주석 입력
-- 첫 번째 파리미터 1:트레이스 파일내에, 2: alert log, 3:양쪽, 두 번째 파라미터는 주석.
alter session set events 'immediate trace name buffers level 1';
alter system dump datafile {File no} block {Block no};
alter system dump datafile 4 block 129;
alter system dump datafile {File no} block min {Block min} block max {Block max};
alter system dump datafile 4 block min 129 block max 133;
-- 파일 이름으로도 가능
alter system dump datafile '{name}' block {Block no};
alter system dump datafile '{name}' block min {Block min} block max {Block max};
-- 언두 세그먼트 헤더 블록 덤프
alter system dump undo header '{segment name}';
alter system dump undo header ' _SYSSMU3$';
alter system dump logfile '{filename}';
alter system dump logfile 'C:\ORACLE\ORADATA\D10G\REDO01.LOG'
alter system dump logfile '{filename}'
scn min {first SCN to dump}
scn max {last SCN to dump}
time min {seconds since an oddly arbitrary point in time}
time max {ditto}
layer {integer}
opcode {integer}
xid {usn} {slot} {sequence} -- 10g and later but breaks on IMU redo
Objno {object id} -- 10g and later but breaks on IMU redo
dba min {datafile no} . {blockno} -- remove the dot for 10g and later
dba max {datafile no} . {blockno} -- remove the dot for 10g and later
rba min {log file seq#} . {blockno} -- remove the dot for 10g and later
rba max {log file seq#} . {blockno} -- remove the dot for 10g and later
*주어진 database block과 관련된 모든 리두 덤프
(파일 번호는 relative 파일 번호가 아닌, absolute 파일 번호)
-- 9i
alter system
dump logfile 'C:\ORACLE\ORADATA\D920\REDO02.LOG'
dba min 11 . 10 dba max 11 . 10
;
-- 10g
alter system
dump logfile 'C:\ORACLE\ORADATA\D10G\REDO02.LOG'
dba min 5 10 dba max 5 10
;
*10분전부터 5분 동안 발생한 리두를 덤프
select
(
(sysdate - 10/(24*60)) -
to_date('25/7/1987 00:00:00','dd/mm/yyyy hh24:mi:ss')
) * 86400 start_time,
(
(sysdate - 5/(24*60)) -
to_date('25/7/1987 00:00:00','dd/mm/yyyy hh24:mi:ss')
) * 86400 end_time
from
dual
;
alter system
dump logfile 'C:\ORACLE\ORADATA\D10G\REDO02.LOG'
time min 760100786
time max 760101086
DUMP OF REDO FROM FILE 'C:\ORACLE\ORADATA\D10G\REDO02.LOG'
Opcodes *.*
RBAs: 0x000000.00000000.0000 thru 0xffffffff.ffffffff.ffff
SCNs: scn: 0x0000.00000000 thru scn: 0xffff.ffffffff
Times: 08/25/2011 11:06:26 thru 08/25/2011 11:11:26
alter system dump logfile 'C:\ORACLE\ORADATA\D10G\REDO01.LOG'
layer 10 opcode 11 ;
---------- C:\ORACLE\ADMIN\D10G\UDUMP\D10G_ORA_3028.TRC
CHG #2 TYP:0 CLS: 1 AFN:5 DBA:0x01800c1b OBJ:88098 SCN:0x0.04a9ab0a SEQ: 1 OP:10.11
CHG #2 TYP:0 CLS: 1 AFN:5 DBA:0x01800c1c OBJ:88098 SCN:0x0.04a9ab13 SEQ: 1 OP:10.11
CHG #2 TYP:0 CLS: 1 AFN:5 DBA:0x01800c1d OBJ:88098 SCN:0x0.04a9ab19 SEQ: 1 OP:10.11
CHG #2 TYP:0 CLS: 1 AFN:5 DBA:0x01800c1e OBJ:88098 SCN:0x0.04a9ab20 SEQ: 1 OP:10.11
CHG #2 TYP:0 CLS: 1 AFN:5 DBA:0x01800c1f OBJ:88098 SCN:0x0.04a9ab26 SEQ: 1 OP:10.11
CHG #2 TYP:0 CLS: 1 AFN:5 DBA:0x01800c20 OBJ:88098 SCN:0x0.04a9ab2d SEQ: 1 OP:10.11