Register Login

PLS-00352: Unable to Access another Database 'DB_LINK_NAME'

Updated May 18, 2018

Hello all,

Please check procedure and suggest how to resolve it?

Procedure:
create or REPLACE PROCEDURE hostname (host_name in varchar2,user_name in VARCHAR2, pass_word in VARCHAR2,table_space in varchar2,pro_file in varchar2)
as
db_link_name varchar2(30);
begin
select db_link into db_link_name from user_db_links where host='''||host_name||''';
dbms_utility.exec_ddl_statement@db_link_name('CREATE USER '||user_name||' IDENTIFIED BY '||pass_word||' DEFAULT TABLESPACE ' ||table_space|| ' PROFILE '|| pro_file|| ' ACCOUNT UNLOCK');
end;
/

Error:

Error(7,1): PLS-00352: Unable to access another database 'DB_LINK_NAME'
Error(7,1): PL/SQL: Statement ignored
Error(7,1): PLS-00201: identifier 'DBMS_UTILITY@DB_LINK_NAME' must be declared


Thanks in advance.


Comments

  • 10 Jul 2015 3:36 pm Mishan Amithab Kasiparsad

    The Database link either does not exist, is pointing to a database that is invalid, or it exists, just not while the procedure is being executed.

    i.o.w: Login to the database as the USER that runs the procedure, and see whether the db link you are trying to connect to does exist.. more specifically, is its HOST property correct


×