Never underestimate the power of Passion!

Monday, 6 February 2017

On 01:22 by Vardan Kumar in ,    1 comment
ORA-12505 Error


There are a few things that can cause this problem, but before we get started,you need to be sure that you can connect to the database using SQL*Plus. SQL*Plus, it's a command-line tool for connecting to Oracle databases that has been a standard part of Oracle for a long time and it is included with Oracle XE.
When connecting to an Oracle database using database connectivity API, we don't connect to the DB directly. Instead, we connect to a TNS listener, which then connects you to the database. The error means that the listener was up and you could connect to it, but it couldn't connect you to the database because it doesn't know that that database is up. There are two reasons for this:
  • The DB has not been started up,
  • The DB has not registered with the listener, e.g. because the database was started before the listener. 
  • When the DB starts, it registers itself with a listener if it is already running. If the listener isn't running, the DB doesn't register itself, and if the listener starts, it doesn't go looking for databases that might register with it.
ORA-12505 means that the listener knows about that database, but the listener hasn't received an acknowledgement from the DB that it is up.


  1. Start oracle database.

Start oracle database
Start database









   2. Connect to system.


Connect System
Connect System


3.     

   3. Try out command “LSNRCTL STAT”;


Oracle Listner
Ora-Listener

  
44.  Execute command
Alter system set local_listener = '(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))' scope = both;

Alter local listener
Alter System Listener






       5. Execute command

Alter system register;

Alter System Register
Alter System Register


6  6.Execute command
Exit;

Exit
Exit

7.       
    7.Execute command
lsnrctl stat

lsnrctl stat
lsnrctl stat









Now you should probably be able to connect.

1 comment: