1. ORA-12560: TNS:protocol adaptor error 2.ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

in command prompt type lsnrctl status and u saw ORACLE listener is not running and error like ORA-12560

1.open notepad in Run as Administrator and browse listener.ora file location like C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN

step-1:in that file see <Pc-name>

LISTENER =
 (DESCRIPTION_LIST =
 (DESCRIPTION =
 (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
 (ADDRESS = (PROTOCOL = TCP)(HOST = <PC-name>)(PORT = 1521))
 )
 )

step-2:change <Pc-name> as localhost and save it

LISTENER =
 (DESCRIPTION_LIST =
 (DESCRIPTION =
 (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
 (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
 )
 )

step-3:Open file tnsnames.ora in notepad with Run as Administrator same location

XE =
 (DESCRIPTION =
 (ADDRESS = (PROTOCOL = TCP)(HOST = <Pc-name>)(PORT = 1521))
 (CONNECT_DATA =
 (SERVER = DEDICATED)
 (SERVICE_NAME = XE)
 )
 )

step-4:change <Pc-name> as localhost and save it

XE =
 (DESCRIPTION =
 (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
 (CONNECT_DATA =
 (SERVER = DEDICATED)
 (SERVICE_NAME = XE)
 )
 )

step-5: command prompt Run as Administrator type lsnrctl start and u saw listener status

2. After starting listener trying to connect users in sqldeveloper or other tools .if u saw Error like this means ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

Since the listener is named LISTENER and is running on port 1521 every Oracle database on the server can ‘see’ that listener and auto-register with it. How can this auto-registration be prevented? The easiest method is to stop the listener; if no listener process exists then the databases have nothing to register with. This may not be the best solution, however, as other, active databases may also be on the same server and would require that a listener be running.

A different way of preventing auto-registration is to set local_listener to a non-existent port:

step-1:Run SQL comment line and connect database .After paste below

alter system set local_listener='(DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))))';

now system is altered.