Home » Server Options » Replication » dbms_scheduler ORA-12560: TNS:protocol adapter error (Oracle Windows 64bit)
dbms_scheduler ORA-12560: TNS:protocol adapter error [message #666070] Wed, 11 October 2017 08:56 Go to next message
Messages: 19
Registered: September 2017
Junior Member
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
credential_name => 'oracle_OS',
username => '<username>',
password => '<pwd>'

-- Create a job with an RMAN script defined in-line, including an explicit connect.
l_job_name VARCHAR2(30);
l_script VARCHAR2(32767);
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;

job_name => l_job_name,
job_type => 'BACKUP_SCRIPT',
job_action => l_script,
credential_name => 'oracle_OS',
enabled => TRUE

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.

Re: dbms_scheduler ORA-12560: TNS:protocol adapter error [message #666071 is a reply to message #666070] Wed, 11 October 2017 14:44 Go to previous message
John Watson
Messages: 8938
Registered: January 2010
Location: Global Village
Senior Member
There is no reason why a shell launched for the OS user in your credential would know the ORACLE_SID to which you wish to connect. I'm not very good with Windows, but I have found inconsistencies with setting environment variables: the priority of settings in the registry and in the shell is not always clear to me. To be certain, I would use a job of type EXECUTABLE and have it run cmd.exe passing it a batch file name as an argument. Have the batch file do everything, setting all your variables before running rman.exe
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 Jun 21 09:33:25 CDT 2024