begin for arr in ( select 'create or replace synonym ' || b.OBJECT_NAME || ' for ' || B.OWNER || '.' || B.OBJECT_NAME row_i from dba_objects B where OWNER = 'APPS' AND object_type = 'TABLE' ) loop begin execute immediate (arr.row_i); EXCEPTION WHEN OTHERS THEN dbms_output.put_line(arr.row_i); end; end loop; end; 原文链接:https://www.f2er.com/oracle/211638.html