文章详情页
导出oracle数据库对象---同义词,系列,视图
脚本可分两部分:同义词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客户机程序的一般过程4. Mysql入门系列:MYSQL客户机程序2—增加错误检查5. Mysql入门系列:对MYSQL查询中有疑问的数据进行编码6. Mysql入门系列:MYSQL服务器内部安全性-安全数据目录访问7. MySQL系列之二 多实例配置8. Oracle Optimizer:迁移到使用基于成本的优化器-----系列1.29. Mysql入门系列:MYSQL表达式求值和MYSQL类型转换10. Mysql入门系列:需要避免的MYSQL客户机程序设计错误
排行榜