1. Oracle client installation:
The installation of Oracle is not detailed here, and the online installation diagram is also very detailed. After oracle is installed, the Oracle client will be installed. The first choice is to download the client from the official Oracle website, the size is about mb. Here the oracle11g version is used. The decompressed directory structure is as follows:
Click the “setup.exe file to start the installer. For details about the installation configuration, see:
Http://www.cnblogs.com/jiguixin/archive/2011/09/09/2172672.html
2. Start the client tool, sqldeveloper
An error message "ORA-12505, TNS: Listener does not currently know of SID given in connect descriptor" was reported during connect.
The content of the "tnsnames. ora" file is as follows:
XE = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE) ) )EXTPROC_CONNECTION_DATA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) ) (CONNECT_DATA = (SID = PLSExtProc) (PRESENTATION = RO) ) )ORACLR_CONNECTION_DATA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) ) (CONNECT_DATA = (SID = CLRExtProc) (PRESENTATION = RO) ) )
The content of "listener. ora" is as follows:
SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server) (PROGRAM = extproc) ) (SID_DESC = (SID_NAME = CLRExtProc) (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server) (PROGRAM = extproc) ) )LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) ) )DEFAULT_SERVICE_LISTENER = (XE)
3. solution:
I found a lot on the internet, tried a lot, and finally found the corresponding solution:
Modify the content of the "listener. ora" file:
Sid_list_listener =
(Sid_list =
(Sid_desc =
(Sid_name = plsextproc)
(ORACLE_HOME = c: \ oraclexe \ app \ oracle \ product \ 11.2.0 \ Server)
(Program = EXTPROC)
)
(Sid_desc =
(Sid_name = clrextproc)
(ORACLE_HOME = c: \ oraclexe \ app \ oracle \ product \ 11.2.0 \ Server)
(Program = EXTPROC)
)
(Sid_desc =
(Sid_name = Xe)
(ORACLE_HOME = c: \ oraclexe \ app \ oracle \ product \ 11.2.0 \ Server)
(Global_dbname = Xe)
)
)
Listener =
(Description_list =
(Description =
(Address = (Protocol = IPC) (Key = extproc1 ))
(Address = (Protocol = TCP) (host = localhost) (Port = 1521 ))
)
)
Default_service_listener = (xe)
The red part is the newly added content. After the Oracle service is restarted, sqldeveloper can successfully connect to the database instance.
References:
Http://samfeng.blog.51cto.com/52272/774543
Http://www.cnblogs.com/simie/archive/2007/06/03/769312.html