Creating private database links without user credentials

The following process can be followed to create private database link for an user whose login credentials are unknown,

Here in this example the user “6543” password is unknown,

In order to create a private database link for “6543” we have to first create a procedure for him as SYS user and grant create database link privilege to the “6543” user and execute the procedure. This would create a database link. After that revoke the grant given to “6543” user.

CREATE PROCEDURE “6543”.cre_db_lnk AS
            ||’CONNECT TO username IDENTIFIED BY password ‘
            ||’USING ”HOST”’;
END cre_db_lnk;

GRANT create database link TO “6543”;

execute “6543”.cre_db_lnk;

revoke create database link from “6543”;

DROP PROCEDURE “6543”.cre_db_lnk;

select * from dba_db_links where db_link=’DATABASELINKNAME’ and owner =’6543′;

  • October 16, 2014 | 37 views
  • Comments