相当于alias(别名),比如把user1.table1在user2中建一个同义词table1 create synonym table1 for user1.table1; 这样当你在user2中查select * from table1时就相当于查select * from user1.table1;
//批量生成创建同义词
select ‘create synonym ‘||object_name||‘ for jys.‘||object_name||‘;‘ from dba_objects where owner=‘JYS‘ and object_type=‘TABLE‘;
不然就是在表前加用户名
select * from user1.table1
时间: 2024-10-10 17:05:27