Problems with connecting to a remote Oracle 12c database

dataguardoraclepasswordrman

tl;dr
RMAN failing to connect to standby database with correct credentials.

RMAN-04006: error from auxiliary database: ORA-01017: invalid username/password; logon denied

Password file is correct, password is correct.

The long version.

I'm trying to set up a dataguard pair of servers at the moment and I'm running into problems with passwords.

I start with a fresh install of Oracle 12c. Global database name is orcl.domain and SID=orclprmy

I've checked the ORACLE_SID set in .bash_profile and it matches with orclprmy

I then go in and do all my settings to prepare it as my dataguard primary.

From that instance I create a password file using the following:-

rm $ORACLE_HOME/dbs/orapworclprmy
orapwd file=$ORACLE_HOME/dbs/orapworclprmy password=<password>

I've checked on on the primary REMOTE_LOGIN_PASSWORDFILE = 'EXCLUSIVE' so it should be using that password file.

I also sort out the TNSNAMES and LISTENER configuration files to recognise both servers.

I then install oracle in the same way on a separate standby server, the only difference being the database SID being set to orclstby. Again, I've check the ORACLE_SID on that server and it'a also correct.

I scp the password file over from primary to standby (orclstby) and rename it to orapworclstby. I also copy over the TNDNAMES and LISTENER files from primary to standby and edit them as required.

So far, so good. Everything appears to be running properly.

Then comes the part where I prepare the standby to be recovered with RMAN to be the standby database.

vi $ORACLE_HOME/dbs/initorclstby.ora
   db_name=orclstby
slqplus / as sysdba
   SHUTDOWN IMMEDIATE
   STARTUP NOMOUNT pfile='/u01/app/oracle/product/12.0.1/db_home1/dbs/initorclstby.ora'
   QUIT

That should put the standby database into a state where it's ready to take the rman connection.

I then go back to the primary server and start rman

rman
CONNECT TARGET sys/<password>@orclprmy
CONNECT TARGET sys/<password>@orclstby

And then I'm in trouble. RMAN comes back with

RMAN-04006: error from auxiliary database: ORA-01017: invalid username/password; logon denied

I've checked an on standby REMOTE_LOGIN_PASSWORD='EXCLUSIVE', so as far as I can tell it should be using the same password file as primary, and I'm using the same password for everything anyway (it's a proof of concept piece).

Trying sqlplus sys/password@orclstby from primary fails as well:-

ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86-64 Error: 2: No such file or directory

What's really annoying is that I did have this working a while ago, but I must have changed something and I can't work out what it is.

Where should I be looking to see why the standby isn't using the password file (or if it is, why I can't use the password from primary).

I've been working on this for a couple of days now, so it could be I'm missing something obvious.

Many thanks,

David

Best Answer

The problem was down to the TNSNAMES.ORA referring to the SERVICE rather than the SID.