您好,登錄后才能下訂單哦!
如果要導出DD用戶下的所有定義,那么在SQL*Plus中代碼如下所示:
SET PAGESIZE 0
SET TRIMSPOOL ON
SET LINESIZE 10000
SET LONG 90000
SET FEEDBACK OFF
SET FEED OFF
SET ECHO OFF
SPOOL /tmp/schema_dd.sql
SELECT CASE
WHEN U.OBJECT_TYPE IN
('PROCEDURE', 'FUNCTION','PACKAGE', 'TRIGGER') THEN
DBMS_METADATA.GET_DDL(U.OBJECT_TYPE, U.OBJECT_NAME, 'DD') ||
CHR(10) || '/'
ELSE
DBMS_METADATA.GET_DDL(U.OBJECT_TYPE, U.OBJECT_NAME, 'DD')||
CHR(10) || ';'
END AS SCOTT_DDL
FROM USER_OBJECTS U
WHERE U.OBJECT_TYPE IN
('PROCEDURE','FUNCTION','PACKAGE','TRIGGER')
AND U.OBJECT_NAME not like 'BIN%';
SPOOL OFF;
則可以導出DD用戶下所有的DDL語句到/tmp/schema_dd.sql文件中。
找DDL中的關鍵字
fgrep 999 * | grep -v 999999
fgrep 9999 * | grep -v 999999
fgrep CN30006 * | grep -v CN300006
fgrep CN3000006 * | grep -v CN300006
另外一個更簡單的找關鍵字的方法
select * from dba_source t where OWNER='DD' and upper(text) like '%999%' and upper(text) not like '%999999%';
select * from dba_source t where OWNER='DD' and upper(text) like '%CN30006%' and upper(text) not like '%CN300006%';
select * from dba_source t where OWNER='DD' and upper(text) like '%CN3000006%' and upper(text) not like '%CN300006%';
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。