--1. delete plan_table where statement_id='test'
--2. commit
--3. Select lpad(operation,length(operation)+ 2*(level-1)) ||decode(id,0,' Cost estimate:' || decode(position,'0','N/A',position),null) || ' ' ||options || decode(object_name,null,null,':') || rpad(object_owner, length(object_name)+1,',') || object_name || decode (object_type,'UNIQUE' ,'(U) ','NON_UNIQUE','(NU)',null) || decode(object_instance,null,null,'('||object_instance||')') as plans FROM PLAN_TABLE START WITH ID= 0 and STATEMENT_ID = 'test' CONNECT by prior ID=PARENT_ID and STATEMENT_ID='test'
--4.plan실행
explain plan set statement_id='test' for select
--5.table script
CREATE TABLE BILL.PLAN_TABLE
(
STATEMENT_ID VARCHAR2(30 BYTE),
TIMESTAMP DATE,
REMARKS VARCHAR2(80 BYTE),
OPERATION VARCHAR2(30 BYTE),
OPTIONS VARCHAR2(30 BYTE),
OBJECT_NODE VARCHAR2(128 BYTE),
OBJECT_OWNER VARCHAR2(30 BYTE),
OBJECT_NAME VARCHAR2(30 BYTE),
OBJECT_INSTANCE NUMBER(10),
OBJECT_TYPE VARCHAR2(30 BYTE),
OPTIMIZER VARCHAR2(255 BYTE),
SEARCH_COLUMNS NUMBER,
ID NUMBER(10),
PARENT_ID NUMBER(10),
POSITION NUMBER(10),
COST NUMBER(10),
CARDINALITY NUMBER(10),
BYTES NUMBER(10),
OTHER_TAG VARCHAR2(255 BYTE),
PARTITION_START VARCHAR2(255 BYTE),
PARTITION_STOP VARCHAR2(255 BYTE),
PARTITION_ID NUMBER(10),
OTHER LONG
)
TABLESPACE TEMP
LOGGING
NOCACHE
NOPARALLEL;
GRANT DELETE, INSERT, SELECT ON BILL.PLAN_TABLE TO BILCS1;
GRANT DELETE, INSERT, SELECT ON BILL.PLAN_TABLE TO BILCS2;
'ORACLE' 카테고리의 다른 글
grouping sets 사용법 (0) | 2008.12.08 |
---|---|
파티션 테이블 삭제하기. (0) | 2008.11.13 |
FREE LEC (0) | 2008.10.15 |
SQL*LOADER (0) | 2008.10.14 |
PK인덱스여부 조회 (0) | 2008.09.09 |