Method One: You can configure it by opening the Tnsnames.ora in the Oracle installation directory as follows:
Specific path such as: F:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN\tnsnames.ora
# Tnsnames.ora Network Configuration File:f:\app\administrator\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
ORCLYZC = #注释一 Here is the Network service name used to plsql the database name when remote connect to the Oracle database
(DESCRIPTION =
(Address_list =
(address = (PROTOCOL = TCP) (HOST = 192.168.0.221) (PORT = 1521))
)
(Connect_data =
(service_name = ORCL) #注释二 service name (SID) repeatable
)
)
ORCL_STJWT =
(DESCRIPTION =
(Address_list =
(address = (PROTOCOL = TCP) (HOST = 192.168.0.221) (PORT = 1521))
)
(Connect_data =
(service_name = ORCL)
)
)
TEST =
(DESCRIPTION =
(address = (PROTOCOL = TCP) (HOST = user-20160418ll) (PORT = 1521))
(Connect_data =
(SERVER = dedicated)
(service_name = test)
)
)
ORCL =
(DESCRIPTION =
(Address_list =
(address = (PROTOCOL = TCP) (HOST = 127.0.0.1) (PORT = 1521))
)
(Connect_data =
(service_name = ORCL)
)
)
Method Two:
Configured with the Oracle NET Configuration Assistant tool:
1, local network service name-"Next-" Add-"service name (SID)-" Configure host name and port number
-"Test-" Change user password-"Test success-" Configure Network Service Name-"Add success."