RMAN-04006: error from auxiliary database: ORA-01017: invalid username/password; logon denied
Cause:
While try to connect to auxiliary instance for rman duplication , i cant connec standby database due to credential issue. As the standby database is new and there is no user ,we should use the password file of primary database on the standby
[oracle@orcl ~]$ rman target sys/password auxiliary sys/password@orcldgp
Recovery Manager: Release 12.1.0.2.0 - Production on Fri Jun 18 18:39:18 2021
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1559282684)
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-04006: error from auxiliary database: ORA-01017: invalid username/password; logon denied
Workaround:
Password file issue:
Make sure if you copy the right password file to destination from source
Set the password for sys account in source and copy the password file of primary to standby database $ORACLE_HOME/dbs location
SQL> alter user sys identified by password;
User altered.
[oracle@orcl ~]$ echo $ORACLE_HOME
/oracle/base/product/12.1.0/dbhome_1
[oracle@orcl ~]$ scp /oracle/base/product/12.1.0/dbhome_1/dbs/orapworcl oracle@192.168.56.123:/oracle/base/product/12.1.0/dbhome_1/dbs/
oracle@192.168.56.123's password:
orapworcl 100% 7680 7.5KB/s 00:00
Modify the file name with standby database name
[oracle@orcldg dbs]$ mv orapworcl orapworcldgp
[oracle@orcldg dbs]$ pwd
/oracle/base/product/12.1.0/dbhome_1/dbs
Verify the password file content from both source and destination if the user which you use to connect is present in the results of query. If the user doesnot exist in the below query, then you have to add the user to the password file to connect.
Source:
SQL> select * from v$pwfile_users;
USERNAME SYSDB SYSOP SYSAS SYSBA SYSDG SYSKM CON_ID
------------------------------ ----- ----- ----- ----- ----- ----- ----------
SYS TRUE TRUE FALSE FALSE FALSE FALSE 0
SYSDG FALSE FALSE FALSE FALSE TRUE FALSE 1
SYSBACKUP FALSE FALSE FALSE TRUE FALSE FALSE 1
SYSKM FALSE FALSE FALSE FALSE FALSE TRUE 1
SQL> select * from v$pwfile_users;
Destination:
SQL> select * from v$pwfile_users;
USERNAME SYSDB SYSOP SYSAS SYSBA SYSDG SYSKM CON_ID
------------------------------ ----- ----- ----- ----- ----- ----- ----------
SYS TRUE TRUE FALSE FALSE FALSE FALSE 0
Post that i can able to connect with sys user on auxiliary instance
[oracle@orcl ~]$ rman target sys/password auxiliary sys/password@orcldgp
Recovery Manager: Release 12.1.0.2.0 - Production on Fri Jun 18 18:42:04 2021
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1559282684)
connected to auxiliary database: ORCLDGP (not mounted)
RMAN>
You can also verify the connection using sqlplus
[oracle@dc01x01 ~]$ sqlplus system/password@dbx01
SQL*Plus: Release 12.1.0.2.0 Production on Mon Sep 20 01:59:47 2021
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Last Successful login time: Mon Sep 20 2021 01:57:34 +05:30
Case sensitive characters in passwords:
Check for case sensitive characters in password like ‘@’ symbols which can be misunderstood by rman
Passwords like password@ should be avoided when you try to connect like below example
RMAN> connect auxiliary system/password@dbx01
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-04006: error from auxiliary database: ORA-01017: invalid username/password; logon denied
Enter password separately after specifying only username like this
[oracle@dc01x01 ~]$ rman target / auxiliary system@dbx01
Recovery Manager: Release 12.1.0.2.0 - Production on Mon Sep 20 02:08:09 2021
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: DBX00 (DBID=2195240283)
auxiliary database Password:
Validate network files:
Check for the listener parameters with respect to SID and GLOBAL_DBNAME and configure a static entry
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl19x1)
(ORACLE_HOME = /data01/product/19.0.0)
(SID_NAME = orcl19x1)
)
(SID_DESC =
(GLOBAL_DBNAME = dbx01)
(ORACLE_HOME = /apps01/product/12.1.0/dbhome_1)
(SID_NAME = dbx01)
)
)
Check for valid tns entries with (UR = A) specified for standby database
DBX00_1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.112)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dbx00_1)
)
)
DBX01 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.123)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dbx01)(UR = A)
)
)
Post all the actions, database connects properly
[oracle@dc01x02 dbs]$ rman target / auxiliary sys/password@dbx01
Recovery Manager: Release 12.1.0.2.0 - Production on Tue Sep 21 01:49:42 2021
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: DBX00 (DBID=2195240283)
connected to auxiliary database: DBX00 (DBID=2195240283)