Resolving ORA-12537: TNS:connection closed in Oracle Data Guard After Server Reboot

Resolving ORA-12537: TNS:connection closed in Oracle Data Guard After Server Reboot

Introduction

Recently, I encountered an issue while working with Oracle Database 19c in a Data Guard environment. After a server reboot, I was unable to log in to the database as SYSDBA using SQL*Plus. The error message displayed was:

sqlplus / as sysdba
ORA-12537: TNS:connection closed


This issue prevented database access, which could lead to serious downtime in a production environment. Fortunately, I found a simple yet effective solution to resolve this problem.

Root Cause Analysis

After investigating, I discovered that the issue was related to the permissions of the oracle binary located in $ORACLE_HOME/bin. The server reboot had modified or reset these permissions, preventing the database processes from running correctly.

Solution Steps

To resolve the ORA-12537 error, I performed the following steps:

Step 1: Verify the oracle Binary Permissions

Navigate to the $ORACLE_HOME/bin directory and check the permissions of the oracle binary using the following commands:

cd $ORACLE_HOME/bin
ls -lrt oracle

Output:

-rwxr-x--x. 1 oracle oinstall 242993632 Feb 13 25:20 oracle

Step 2: Modify the oracle Binary Permissions

To correct the permissions, I executed the following command:

chmod 6751 oracle

Step 3: Verify the Updated Permissions

After modifying the permissions, I verified the changes by running:

ls -lrt oracle

Updated Output:

-rwsr-s--x. 1 oracle oinstall 242993632 Feb 13 25:20 oracle

Now Try to login to the database using TNS Alias  entry 

sqlplus sys/password@server1_dr as sysdba

after login now shutdown database and then start again  after restarting database i was able to login into the
database normally . 

SQL> shu immediate ;
Database closed.
Database dismounted.
ORACLE instance shut down.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor

Warning: You are no longer connected to ORACLE.
SQL> exit

sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 – Production on Thu Feb 13 15:03:35 2025
Version 19.16.2.0.0

Copyright (c) 1982, 2022, Oracle. All rights reserved.

Connected to an idle instance.

SQL> startup mount ;
ORACLE instance started.

Total System Global Area 2.2549E+10 bytes
Fixed Size 18345808 bytes
Variable Size 2617245696 bytes
Database Buffers 1.9864E+10 bytes
Redo Buffers 48762880 bytes
Database mounted.

Conclusion

After applying the correct permissions, I was able to log in to the database successfully using:

sqlplus / as sysdba

This resolved the ORA-12537 error and restored normal database operations. If you encounter a similar issue, ensure that the oracle binary has the correct setuid and setgid permissions to allow the database processes to function properly.

By following these simple steps, you can quickly troubleshoot and resolve login issues in Oracle Data Guard after a server reboot. Hope this helps!

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *