Home » Server Options » Replication » dbms_scheduler ORA-12560: TNS:protocol adapter error (Oracle 12.1.0.2 Windows 64bit)
dbms_scheduler ORA-12560: TNS:protocol adapter error [message #666070] Wed, 11 October 2017 08:56 Go to previous message
philipebe
Messages: 19
Registered: September 2017
Junior Member
Hi,
I trying to setup a scheduler job on my windows 64bit Oracle database version 12C
Below is the script i used where i created OS authentication and create a scheduler to run the backup_script.

-- Create a credential so script is run as the correct OS user on the windows database server.
--And the below credentials worked when i used this
BEGIN
DBMS_CREDENTIAL.create_credential(
credential_name => 'oracle_OS',
username => '<username>',
password => '<pwd>'
);
END;
/

-- Create a job with an RMAN script defined in-line, including an explicit connect.
SET SERVEROUTPUT ON
DECLARE
l_job_name VARCHAR2(30);
l_script VARCHAR2(32767);
BEGIN
l_job_name := DBMS_SCHEDULER.generate_job_name;
DBMS_OUTPUT.put_line('JOB_NAME=' || l_job_name);

-- Define the backup script.
l_script := 'connect target /
run {
backup archivelog all delete all input;
}';

DBMS_SCHEDULER.create_job(
job_name => l_job_name,
job_type => 'BACKUP_SCRIPT',
job_action => l_script,
credential_name => 'oracle_OS',
enabled => TRUE
);
END;
/


But when i run the above plsql with the scheduler job, i am getting "ORA-12560: TNS:protocol adapter error".
I do have environment variable set at the OS with the correct SID.
But i am not able to figure out where this error is coming from.
My guess the OS authentication is not working right....but i was able to test the OS credential scheduler job to run a simple dir listing and it worked fine...but the same OS credential is not working for the rman backup script.
Would appreciate your help.

Thanks.
Philip.
 
Read Message
Read Message
Previous Topic: DML operations not applying on target database
Next Topic: Replicate process is abended and getting integrity constraint error - ORA-02291
Goto Forum:
  


Current Time: Fri Mar 29 06:34:51 CDT 2024