首先需要给用户创建同义词权限:
SQL> grant create synonym to jhchen;
Grant succeeded.
创建同义词语法:
create synonym 名字 for 所有者.对象名
需要给用jhchen登陆
SQL> create synonym eos_kpi_usersalary for kpi.eos_kpi_usersalary;
Synonym created
批量更改同义词需要先在所有者那里查询:
SELECT ‘ create synonym ‘ || OBJECT_NAME || ‘ for kpi.‘ || OBJECT_NAME || ‘;‘
FROM USER_OBJECTS
WHERE OBJECT_TYPE IN
(‘TABLE‘, ‘VIEW‘, ‘PROCEDURE‘, ‘TRIGGER‘, ‘FUNCTION‘, ‘PACKAGE‘);
本文出自 “一凡” 博客,请务必保留此出处http://1336014.blog.51cto.com/1326014/1655185
原文地址:http://1336014.blog.51cto.com/1326014/1655185