-
--以下语句将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%');
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/28878983/viewspace-2133894/
,如需转载,请注明出处,否则将追究法律责任。