Oracle Data Definition Language (DDL)
Version 18.1.0.0

General Information
Library Note Morgan's Library Page Header
"We don't live in a dictatorship or a monarchy. I swore an oath in the military and in the Senate to preserve, protect and defend the Constitution of the United States, not to mindlessly cater to the whims of Cadet Bone Spurs and clap when he demands I clap,"
~ Sen. Tammy Duckworth
DDL Statements
ALTER CREATE RENAME
ANALYZE DROP TRUNCATE
COMMENT    
 
DDL_LOCK_TIMEOUT
Lock Timeout DDL_LOCK_TIMEOUT(<number_of_seconds>);
conn / as sysdba

set linesize 121
col name format a30
col value format a30

SELECT name, value
FROM gv$parameter
WHERE name LIKE 'ddl_lock%';

-- range is 0 (the default) to 100,000
ALTER SYSTEM SET ddl_lock_timeout=20;
-- or
ALTER SESSION SET ddl_lock_timeout=20;
Lock Timeout Demo conn uwclass/uwclass@pdbdev

CREATE TABLE test1 AS
SELECT table_name, tablespace_name
FROM user_tables;

Step Session 1 Session 2
1 conn uwclass/uwclass@pdbdev conn uwclass/uwclass@pdbdev
2 desc test1

SELECT * FROM test1;
desc test1

SELECT * FROM test1;
3 LOCK TABLE test1
IN exclusive MODE nowait;
RENAME test1 TO test2;
4 COMMIT; RENAME test1 TO test2;
5   ALTER SYSTEM SET ddl_lock_timeout=60;

SELECT name, value
FROM gv$parameter
WHERE name LIKE 'ddl_lock%';
6 LOCK TABLE test2
IN exclusive MODE nowait;
RENAME test2 TO test3;
7 COMMIT;  

ALTER SYSTEM SET ddl_lock_timeout=0;

SELECT name, value
FROM gv$parameter
WHERE name LIKE 'ddl_lock%';

Related Topics
DCL Statements
DDL Event Triggers
DML Statements
What's New In 12cR2
What's New In 18cR1

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2017 Daniel A. Morgan All Rights Reserved