When getting an ORA-12560 for an Oracle database on windows, there are a couple of things we should check before doing anything else. The error is telling us that we are trying to connect to the wrong ORACLE_SID or to a database that isn’t running. The below are the two most common things that should be checked first when seeing this error in an Oracle environment on windows.
- Make sure the ORACLE_SID parameter is set correctly before trying to connect
To do this while using a command prompt you would use the command
This is assuming your database SID is ‘oracontain’
If this error was coming from an application you would need to check the configuration/connection string for the application and make sure it’s pointing to the right ORACLE_SID. If you only have one database on your windows server you can even set this environment variable at the windows level for all users.
- We also need to check the windows Oracle service and make sure it’s running for the database you’re trying to connect to. You can see below from the screenshot that the service name will be named ‘OracleService<OracleSID>’.
If the service isn’t running or a typo was made when setting the ORACLE_SID then you will get the ORA-12560 error. You can see this demonstrated in the screenshot below for this 12c database, however this error will happen for 8i, 9i, 10g, 11g, 12c, 18c, or 19c.