文章詳情頁
導出oracle數據庫對象---同義詞,系列,視圖
瀏覽:5日期:2023-11-14 16:57:17
腳本可分兩部分:同義詞1:synonym.cmd:sqlplus dxsq/teledoone@jnnew @synonym.sql2.synonym.sql: create table tmp_user_synonym as select 'create synonym 'synonym_namechr(13)'for'chr(13)TABLE_OWNER'.'TABLE_NAMEchr(13)'/' text from user_synonyms;set heading off feedback off termout offset pagesize 0set linesize 100set long 100000col tt format aspool d:bat ynonym.log;select text tt from tmp_user_synonym;spool off;drop table tmp_user_synonym;exit;大家可以以一反三,系列的寫法可以參考下面:drop table tmp_user_sequence;create table tmp_user_sequence (text varchar2(4000));declarebegin for tt in (select * from user_sequences) loop insert into tmp_user_sequence values('prompt'); insert into tmp_user_sequence values('prompt create sequence 'tt.SEQUENCE_NAME); insert into tmp_user_sequence values('prompt'); insert into tmp_user_sequence values('create sequence' ' ' tt.SEQUENCE_NAME); insert into tmp_user_sequence values('minvalue' ' ' tt.MIN_VALUE ); insert into tmp_user_sequence values('MAXVALUE' ' ' tt.MAX_VALUE); insert into tmp_user_sequence values('start with ' ' 'tt.LAST_NUMBER); insert into tmp_user_sequence values('increment by' ' ' tt.INCREMENT_BY); insert into tmp_user_sequence values('cache' ' ' to_char(tt.CACHE_SIZE)); if tt.CYCLE_FLAG='Y' then insert into tmp_user_sequence values('cycle'); end if; if tt.ORDER_FLAG='Y' then insert into tmp_user_sequence values('order'); end if; insert into tmp_user_sequence values('/'); insert into tmp_user_sequence values(''); end loop; commit;end;/set heading off feedback off termout off;column text format A100;spool d:batuser_sequences.logselect text from tmp_user_sequence;spool off;exit;
上一條:Oracle培訓教材下一條:都是防火墻惹的禍--Oracle連接老斷!
相關文章:
1. Mysql入門系列:MYSQL創建、刪除、索引和更改表2. Mysql入門系列:建立MYSQL客戶機程序的一般過程3. Mysql入門系列:MYSQL客戶機程序2—增加錯誤檢查4. Mysql入門系列:安排預防性的維護MYSQL數據庫服務器5. Mysql入門系列:MYSQL表達式求值和MYSQL類型轉換6. Mysql入門系列:需要避免的MYSQL客戶機程序設計錯誤7. Mysql入門系列:MYSQL創建、刪除和選擇數據庫8. Mysql入門系列:MYSQL列類型選擇與MYSQL查詢效率9. MySQL系列之redo log、undo log和binlog詳解10. Mysql入門系列:MYSQL服務器內部安全性-安全數據目錄訪問
排行榜
