How to recreate public synonym “DUAL”?

后端 未结 1 1877
误落风尘
误落风尘 2021-01-22 03:08

Using SQLDeveloper 4.0.1.14 to create an export script (separate files & \"drops\" checked), it generated me those 4 lines among others in DROP.sql:



        
相关标签:
1条回答
  • 2021-01-22 03:21

    Try it as SYS but without the doauble quotes, i.e.:

    CREATE OR REPLACE PUBLIC SYNONYM DUAL FOR SYS.DUAL;
    

    not

    CREATE OR REPLACE PUBLIC SYNONYM "DUAL" FOR "SYS"."DUAL";
    

    As I understand it the double quotes make the object name case sensitive.

    Update - If you have access to metalink then you will find the answer in note 973260.1, something aboput a trigger firing :

    ALTER SYSTEM SET "_SYSTEM_TRIG_ENABLED"=FALSE SCOPE=MEMORY;
    CREATE OR REPLACE PUBLIC SYNONYM DUAL FOR SYS.DUAL;
    ALTER SYSTEM SET "_SYSTEM_TRIG_ENABLED"=true SCOPE=MEMORY;
    

    The note suggest that if this doesnt work, query DBA_TRIGGERS to find a BEFORE CREATE trigger enabled, and if found disable it and then re-issue create synonym statement, then re-enable the trigger.

    0 讨论(0)
提交回复
热议问题