SQL> grant create database link to schemauser ;
SQL> create or replace procedure schemauser.zcreatedblink as
begin
execute immediate 'create database link DBLINK_NAME connect to TARGET_USER identified by TARGET_PASSWORD using ''TARGET_TNS''';
end;
/
SQL> exec schemauser.zcreatedblink
SQL> revoke create database link from schemauser ;
SQL> drop procedure schemauser.createdblink;
Please inform if anybody has better idea.
I think if you create this procedure dynamically it will be more powerful as in that case when need to create dblink for other user, you just need to call that procedure not to create same type procedure manually every time.
ReplyDelete