DBMS_UTILITY.GET_TIME
함수를 사용할 수 있다.SQL> col cur_hsec new_value cur_hsec
SQL> select dbms_utility.get_time as cur_hsec from dual;
-- 작업 진행
SQL> select trunc((dbms_utility.get_time - &cur_hsec)/100, 2) as elapsed from dual;
ORACLE@CX3WAS1 >col cur_hsec new_value cur_hsec
ORACLE@CX3WAS1 >select dbms_utility.get_time as cur_hsec from dual;
CUR_HSEC
----------
-1.488E+09
ORACLE@CX3WAS1 >select count(*) from all_objects;
COUNT(*)
----------
6974
ORACLE@CX3WAS1 >select trunc((dbms_utility.get_time - &cur_hsec)/100, 2) as elapsed from dual;
old 1: select trunc((dbms_utility.get_time - &cur_hsec)/100, 2) as elapsed from dual
new 1: select trunc((dbms_utility.get_time - -1.488E+09)/100, 2) as elapsed from dual
ELAPSED
----------
-1755.34
DBMS_UTILITY.GET_TIME
과 같은 일을 할 수 있다.ORACLE@CX3WAS1 >select hsecs from V$TIMER;
select hsecs from V$TIMER
*
ERROR at line 1:
ORA-00942: table or view does not exist
ORACLE@CX3WAS1 >desc V$TIMER;
ERROR:
ORA-04043: object "SYS"."V_$TIMER" does not exist
SYS@CX3WAS1 >desc V$TIMER;
Name Null? Type
----------------------------------------------------------------- -------- --------------------------------------------
HSECS NUMBER
SYS@CX3WAS1 >select hsecs from V$TIMER;
HSECS
----------
2806856002
DBMS_UTILITY
의 DATA_BLOCK_ADDRESS_FILE
함수와 DATA_BLOCK_ADDRESS_BLOCK
함수를 사용한다.ORACLE@CX3WAS1 >create table t1 as select level as c1 from dual connect by level <= 100;
Table created.
ORACLE@CX3WAS1 >create index t1_n1 on t1(c1);
Index created.
SYS@CX3WAS1 >col data_object_id new_value obj_id
SYS@CX3WAS1 >select data_object_id from dba_objects
where owner = 'ORACLE' and object_name = 'T1_N1'; 2
DATA_OBJECT_ID
--------------
65268
SYS@CX3WAS1 >alter session set events 'immediate trace name treedump level &obj_id';
old 1: alter session set events 'immediate trace name treedump level &obj_id'
new 1: alter session set events 'immediate trace name treedump level 65268'
----- begin tree dump
leaf: 0x1c0004b 29360203 (0: nrow: 100 rrow: 100)
----- end tree dump
REGEXP_REPLACE
함수를 사용하면 위이 정보로 10진수의 DBA값을 추출할 수 있다.SQL> col dba new_value dba
SQL> select regexp_replace(column_value,
'leaf: 0x[[:xdigit:]]+ ([[:digit:]]+) [[:print:]]+', '\1') as dba
from table(tpack.get_tracefile_contents(tpack.get_tracefile_name))
where column_value like 'leaf:%'
and rownum = 1;
DBMS_UTILITY
패키지를 이용해서 변환 할 수 있다.
SQL> col file_no new_value file_no
SQL> col block_no new_value block_no
SQL> select dbms_utility.data_block_address_file(&dba) as file_no,
dbms_utility.data_block_address_block(&dba) as block_no
from dual;
SQL> alter system dump datafile &file_no block &block_no;
SYS@CX3WAS1 >col file_no new_value file_no
SYS@CX3WAS1 >col block_no new_value block_no
SYS@CX3WAS1 >select dbms_utility.data_block_address_file(29360203) as file_no,
2 dbms_utility.data_block_address_block(29360203) as block_no
3 from dual;
FILE_NO BLOCK_NO
---------- ----------
7 75
SYS@CX3WAS1 >alter system dump datafile &file_no block &block_no;
old 1: alter system dump datafile &file_no block &block_no
new 1: alter system dump datafile 7 block 75
System altered.
- 강좌 URL : http://www.gurubee.net/lecture/4271
- 구루비 강좌는 개인의 학습용으로만 사용 할 수 있으며, 다른 웹 페이지에 게재할 경우에는 출처를 꼭 밝혀 주시면 고맙겠습니다.~^^
- 구루비 강좌는 서비스 제공을 위한 목적이나, 학원 홍보, 수익을 얻기 위한 용도로 사용 할 수 없습니다.