I am trying to automate the cloning process for our RAC one node databases, but I am having a bit of trouble.
Here is the relevant part of my script (I think):
rman log='singleracclone.log' target sys/$PASSWORD@"(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=$TARGET_HOST)(PORT=$TARGET_PORT))
(CONNECT_DATA=(SERVICE_NAME=$TARGET_SID)))" AUXILIARY sys/$PASSWORD@"(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)
allocate channel ch1 type disk;
allocate channel ch2 type disk;
allocate channel ch3 type disk;
allocate channel ch4 type disk;
allocate channel ch5 type disk;
allocate auxiliary channel ch6 type disk;
allocate auxiliary channel ch7 type disk;
allocate auxiliary channel ch8 type disk;
allocate auxiliary channel ch9 type disk;
allocate auxiliary channel ch10 type disk;
DUPLICATE TARGET DATABASE TO $AUX_DB_NAME
FROM ACTIVE DATABASE
Which yields the following error:
contents of Memory Script:
shutdown clone immediate;
startup clone nomount;
executing Memory Script
Oracle instance shut down
released channel: ch1
released channel: ch2
released channel: ch3
released channel: ch4
released channel: ch5
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-03002: failure of Duplicate Db command at 07/16/2014 00:11:04
RMAN-06174: not connected to auxiliary database
RMAN-03015: error occurred in stored script Memory Script
RMAN-04006: error from auxiliary database: ORA-12514: TNS:listener does not currently know of serv
ice requested in connect descriptor
As you can see I am trying to just use the connection strings in my RMAN command in order to avoid fussing around with the tnsnames.ora.
As part of the script I spin up a custom listener running on a pre-arranged port with a SID_LIST_LISTENER entry that points to the auxiliary database.
I can see the service when I do an lsnrctl status LISTENER_CUSTOM.
I can connect to both the target and auxiliary on both servers using the connection strings. In fact my RMAN command above connects just fine w/the connection strings initially. It is after the memory script has been executed and the Oracle instance shut down.
Any thoughts as to what I am missing?
Thanks in advance.