The listener. ora and tnsnames. ora files are often difficult to use due to format issues. I have configured and kept a backup, and I will copy it and modify it later! Hey ~~~
Because Linux is usually used in many cases, sometimes you may encounter a problem with the sqlnet. ora file. Simply delete it ~~
Upload the file and run it directly. Do not close the pop-up window.
Oracle Server listener. ora file (an instance ):
Listener =
(Description_list =
(Description =
(Address_list =
(Address = (Protocol = TCP) (host = hostname) (Port = 1521) // host name or IP address and port settings
)
)
)
Sid_list_listener =
(Sid_list =
(Sid_desc =
(Sid_name = database1) // database1 indicates the database instance name.
(ORACLE_HOME =/opt/Oracle/product/10.1.0) // Oracle Installation Directory, which is changed according to the installation conditions
(Program = EXTPROC)
)
)
Oracle Server listener. ora file (two instances ):
Listener =
(Description_list =
(Description =
(Address_list =
(Address = (Protocol = TCP) (host = hostname) (Port = 1521 ))
)
)
)
Sid_list_listener =
(Sid_list =
(Sid_desc =
(Sid_name = database1) // database1 is the database instance1
(ORACLE_HOME =/opt/Oracle/product/10.1.0)
(Program = EXTPROC)
)
(Sid_desc =
(Sid_name = database2) // database2 is the database instance2
(ORACLE_HOME =/opt/Oracle/product/10.1.0)
(Program = EXTPROC)
)
)
Oracle Server listener start, stop, and view the status command:
$ LSNRCTL start
$ LSNRCTL stop
$ LSNRCTL status
Oracle client tnsnames. ora file:
Oralocal = // alias oralocal
(Description =
(Address_list =
(Address = (Protocol = TCP) (host = hostname) (Port = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = database1) // database1 is the SID Name.
)
)
Run the following command on the Oracle client to check the listener connection status:
$ Tnsping alias
Example: Execute the command $ tnsping oralocal with an oracle user