1. Sqlplus
Sqlnet.ora file Format names.directory_path= (tnsnames,hostname). The client will first find the ORCL record in the Tnsnames.ora file. If there is no corresponding record then try to ORCL as a hostname, through the network to resolve its IP address and then go to connect this IP GLOBAL_DBNAME=ORCL this instance.
2. Client. Tnsnames.ora
This file is similar to the UNIX hosts file, providing tnsname to hostname or IP, only if Sqlnet.ora is similar to names.directory_path= (TNSNames), That is, the client will attempt to use this file if it has tnsnames in the order in which it resolves the connection string.
#你所要连接的时候输入得TNSNAME if the listner fails to attempt to change the IP address
ORA10GCSDL1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 127.0.0.1) (PORT = 1521))
(Connect_data =
(SERVER = dedicated)
(service_name = ORA10GCSDL1)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = ibm-66336dafe8f.cn.ibm.com) (PORT = 1521))
(Connect_data =
(SERVER = dedicated)
(service_name = ORCL)
)
)
3. Server side. Listener.ora
Listener the configuration file of the listener process, accepting requests for remote access to the database and transferring the server process to Oracle. So if you are not using a remote connection, the listener process is not required, as is the case if shutting down the listener process does not affect the database connection that already exists.
#下面定义LISTENER进程为哪个实例提供服务
Sid_list_listener =
(Sid_list =
(Sid_desc =
(Sid_name = Plsextproc)
(Oracle_home = C:\oracle\product\10.1.0\Db_1)
(program = Extproc)
)
(Sid_desc =
(Sid_name = ORA10GCSDL1)
(Oracle_home = C:\oracle\product\10.1.0\Db_1)
)
(Sid_desc =
(Sid_name = Ora10gcs)
(Oracle_home = C:\oracle\product\10.1.0\Db_1)
)
)
#监听器的名字, a single database can have more than one listener
LISTENER =
(Description_list =
(DESCRIPTION =
(Address_list =
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC))
)
(Address_list =
(ADDRESS = (PROTOCOL = TCP) (HOST = 127.0.0.1) (PORT = 1521))
)
)
)
4. Instructions used for troubleshooting:
Lsnrctl > Help
Tnsping ora10gcsdl
Oracle Code
OrCL =
(DESCRIPTION =
(Address_list =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.xx.xx) (PORT = 1521))
)
(Connect_data =
(service_name = ORCL)
)
)
The main parameters are host, PORT, service_name
Oracle Remote Connection Database