导出系统表中的存储过程和函数

  • --以下语句将HIS系统中用到的存储过程的名称全部导出到文本文件中,然后运行生成相应的同义词

  • -------------------------------------------------------------------------------------------------------------------

  • select
  • 'CREATE OR REPLACE PUBLIC SYNONYM '||'"'||object_name||'"'||' FOR '||
  • '"'||owner||'"'||'.'||'"'||object_name||'"'||' ;'
  • from dba_procedures
  • where owner in(select username from dba_users where account_status = 'OPEN' and default_tablespace like 'TSP%')
  • and object_type = 'PROCEDURE';

  • -------------------------------------------------------------------------------------------------------------------

  • --以下语句将HIS系统中用到的函数的名称全部导出到文本文件中,然后运行生成相应的同义词

  • select
  • 'CREATE OR REPLACE PUBLIC SYNONYM '||'"'||object_name||'"'||' FOR '||
  • '"'||owner||'"'||'.'||'"'||object_name||'"'||' ;'
  • from dba_procedures
  • where owner in(select username from dba_users where account_status = 'OPEN' and default_tablespace like 'TSP%')
  • and object_type = 'FUNCTION';

  • -------------------------------------------------------------------------------------------------------------------

  • --以下语句将HIS系统中用到的表的名称全部导出到文本文件中,然后运行生成相应的同义词
  • select
  • 'CREATE OR REPLACE PUBLIC SYNONYM '||'"'||SYNONYM_NAME||'"'||' FOR '||
  • '"'||TABLE_OWNER||'"'||'.'||'"'||TABLE_NAME||'"'||' ;'
  • from dba_synonyms
  • where TABLE_OWNER in(select username from dba_users where account_status = 'OPEN' and default_tablespace like 'TSP%');


  • 文章题目:导出系统表中的存储过程和函数
    链接分享:http://ybzwz.com/article/gjiogc.html