I have this tnsnames:
JUPITER =
(DESCRIPTION =
(ADDRESS_LIST =
(LOAD_BALANCE = OFF)
(FAILOVER = ON)
(ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan.mercurio.sp)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.85)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = jupiter)
)
)
)
rac-scan.mercurio.sp
is the scan for prod test db and 192.168.0.85
is the standby.
When I stop the prod db and try connect, it still direct me to prod db rac-scan.mercurio.sp
My steps:
Testing connection with prod database using tns alias:
C:\Users\Danilo>sqlplus sys/xxxxxx@jupiter as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Feb 9 10:55:09 2022
Version 19.6.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> select database_role from v$database;
DATABASE_ROLE
----------------
PRIMARY
Everything ok, now I will stop this database:
Stopping the primary database
(rac1)(oracle@jupiter1):~> srvctl stop database -d jupiter -o immediate
Now I try to connect again using the same tns alias
C:\Users\Danilo>sqlplus sys/xxxxxx@jupiter as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Feb 9 10:58:47 2022
Version 19.6.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to an idle instance.
using a non-sysdba account
C:\Users\Danilo>sqlplus user_test/xxxxx@jupiter
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Feb 9 11:12:27 2022
Version 19.6.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3701
Additional information: -1145261241
Process ID: 0
Session ID: 0 Serial number: 0
Why tns don't try 192.168.0.85
?
NOTE: I have a static listener, could be it? how to resolve?