Windows Registry - ORACLE_SID

articles: 

Hi All,

I would like to share something about ORACLE_SID registry parameter.

I had a chance to restore (RMAN) a database on a new Windows server. The restoration/recovery was completed and there was no issue in logging to the database from the server.

The only thing I had to do was to set the ORACLE_SID variable everytime using the statement "set ORACLE_SID=abcd". I will encounter the error "ORA-12560: TNS:protocol adapter error".

This was the only database running on the server. Hence, I wanted the DB to be connected directly from the server without setting the parameter everytime.

After doing some research, I was able to find that there is a registry parameter "ORACLE_SID" to be set in the Windows Registry. I did the same and now I am able to login to the DB directly from the server without explicitly setting the ORACLE_SID parameter everytime.

Note: Implement this change when you have only one database running on the server.

Go to command prompt:
=====================
1. Type "regedit". The registry editor will open.
2. To be on the safer side, do an export of the registry before making changes.
3. Navigate to:
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_
4. Click on KEY_ on the left pane. On the right pane you will be able to see the list of string values.
5. Place the mouse pointer on the space and right click. Click on "New">>"String Value".
6. Type the name "ORACLE_SID" and hit enter. Now double-click on the parameter "ORACLE_SID". Enter the name of ORACLE_SID and click "OK".
7. Close the registry editor.
8. You will be able to connect to the database directly from the command prompt without explicitly setting the ORACLE_SID parameter.

Hope this would be useful.