Here you can find couple of ways to create database link in another schema: using dbms_ijob and dbms_sys_sql
DECLARE
l_link_owner VARCHAR2(30) := 'TEST_USER';
l_query VARCHAR2(32767) := q'[
begin
execute immediate 'CREATE DATABASE LINK test_link4
connect to "test_user"
identified by "test_user"
using ''localhost:1521/orcl''';
END;
]';
BEGIN
sys.dbms_isched.create_job(job_name => 'CREATE_DBLINK',
job_style => 'REGULAR',
program_type => 'PLSQL_BLOCK',
program_action => l_query,
number_of_arguments => 0,
schedule_type => 'NOW', -- ONCE, NOW, EVENT
schedule_expr => NULL,
queue_spec => NULL,
start_date => NULL,
end_date => NULL,
job_class => 'DEFAULT_JOB_CLASS', -- SELECT * FROM dba_scheduler_job_classes
comments => NULL,
enabled => TRUE,
auto_drop => TRUE,
invoker => l_link_owner,
sys_privs => 1, -- sys.dbms_scheduler.check_sys_privs()
aq_job => FALSE);
COMMIT;
dbms_isched.run_job('CREATE_DBLINK',
asynchronous => TRUE,
invoker => l_link_owner,
sys_privs => 1/*sys.dbms_scheduler.check_sys_privs()*/);
END;
/