您好,登錄后才能下訂單哦!
如果要導(dǎo)出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;
則可以導(dǎo)出DD用戶下所有的DDL語(yǔ)句到/tmp/schema_dd.sql文件中。
找DDL中的關(guān)鍵字
fgrep 999 * | grep -v 999999
fgrep 9999 * | grep -v 999999
fgrep CN30006 * | grep -v CN300006
fgrep CN3000006 * | grep -v CN300006
另外一個(gè)更簡(jiǎn)單的找關(guān)鍵字的方法
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%';
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。