Begin
Commit;
DDL-STATEMENT
Commit;
Exception
When others then rollback;
End;
SQL> Alter table t add new_column date;
Table altered.
SQL> create index t_idx on t(x) ONLINE;
Index created.
SQL> create table t as select * from all_objects;
Table created.
SQL> select object_id from user_objects where object_name = 'T';
OBJECT_ID
---------
89791
SQL> create index t_idx on t(owner, object_type, object_name) ONLINE;
Index created.
SQL> select (select username
2 from v$session
3 where sid = v$lock.sid) username,
4 sid, id1, id2, lmode, request, block, v$lock, type
5 from v$lock
6 where id1 = 89791
7 /
USERNAME SID ID1 ID2 LOME REQUEST BLOCK TY
----------- ---- ----- ------ ------- --------- ------ --
OPS$TKYTE 702 89791 0 3 0 0 DL
OPS$TKYTE 702 89791 0 3 0 0 DL
OPS$TKYTE 702 89791 0 4 0 0 OD
OPS$TKYTE 702 89791 0 2 0 0 TM
SQL> Create view MyView
2 as
3 select emp.*
4 from emp, dept
5 where emp.deptno = dept.deptno;
View created.
SQL> select session_id sid, owner, name, type,
2 mode_held held, mode_requested request
3 from dba_ddl_locks;
SID OWNER NAME TYPE HELD REQUES
---- ------ ------------------ -------------------- ---- ------
1012 EXBACK EXBACK 18 Null None
1088 SYS DBMS_CRYPTO Body Null None
1063 SYS SCN_TO_TIMESTAMP Table/Procedure/Type Null None
1088 SYS SCN_TO_TIMESTAMP Table/Procedure/Type Null None
1096 SYS DBMS_PRVT_TRACE Body Null None
1088 SYS UTL_RAW Body Null None
SQL> create or replace procedure p as begin null; end;
2 /
Procedure created.
SQL> exec p;
PL/SQL procedure successfully completed.
SQL> select session_id sid, owner, name, type,
2 mode_held held, mode_requested request
3 from dba_ddl_locks;
SID OWNER NAME TYPE HELD REQUES
---- ------ ------------------ -------------------- ---- ------
1012 EXBACK EXBACK 18 Null None
1088 SYS DBMS_CRYPTO Body Null None
1063 SYS SCN_TO_TIMESTAMP Table/Procedure/Type Null None
1088 SYS SCN_TO_TIMESTAMP Table/Procedure/Type Null None
1096 SYS DBMS_PRVT_TRACE Body Null None
1088 SYS UTL_RAW Body Null None
1088 UBACK P Table/Procedure/Type Null None
SQL> alter procedure p compile;
Procedure altered.
SQL> select session_id sid, owner, name, type,
2 mode_held held, mode_requested request
3 from dba_ddl_locks;
SID OWNER NAME TYPE HELD REQUES
---- ------ ------------------ -------------------- ---- ------
1012 EXBACK EXBACK 18 Null None
1088 SYS DBMS_CRYPTO Body Null None
1063 SYS SCN_TO_TIMESTAMP Table/Procedure/Type Null None
1088 SYS SCN_TO_TIMESTAMP Table/Procedure/Type Null None
1096 SYS DBMS_PRVT_TRACE Body Null None
1088 SYS UTL_RAW Body Null None
- 강좌 URL : http://www.gurubee.net/lecture/4408
- 구루비 강좌는 개인의 학습용으로만 사용 할 수 있으며, 다른 웹 페이지에 게재할 경우에는 출처를 꼭 밝혀 주시면 고맙겠습니다.~^^
- 구루비 강좌는 서비스 제공을 위한 목적이나, 학원 홍보, 수익을 얻기 위한 용도로 사용 할 수 없습니다.