enable_fk.sql
来自「oracle dba 常用的管理脚本, 覆盖日常的系统管理.」· SQL 代码 · 共 26 行
SQL
26 行
--* File Name : enable_fk.sql
--* Author : DR Timothy S Hall
--* Description : Enables all Foreign Keys belonging to the specified table, or all tables.
--* Call Syntax : @enable_fk (table-name or all) (schema-name)
--* Last Modified: 28/01/2001
SET PAGESIZE 0
SET FEEDBACK OFF
SET VERIFY OFF
SPOOL temp.sql
SELECT 'ALTER TABLE ' || a.table_name || ' ENABLE CONSTRAINT ' || a.constraint_name || ';'
FROM all_constraints a
WHERE a.constraint_type = 'R'
AND a.table_name = DECODE(Upper('&1'),'ALL',a.table_name,Upper('&1'))
AND a.owner = Upper('&2');
SPOOL OFF
-- Comment out following line to prevent immediate run
@temp.sql
SET PAGESIZE 14
SET FEEDBACK ON
SET VERIFY ON
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?