2, the database connection
Using Sqlpluse to connect to the database, the tnsping Test command detects whether the database test can be connected
2.1, the database in the local
1 sqlplus userName/password@orcl--ORCL for Oracle database SID2 Sqlplus userName/password@orclas-- Connect as Administrator
2.2, the database on the server
1 sqlplus userName/password@pc01--PC01 is a connection instance created from Oracle's net manage 2 sqlplus userName/password@192. 168.1. Ten /ORCL --
--this way you need to add the Ezconnect parameter to the Sqlnet.ora file
Sqlnet.ora file parameter Add location:
Find NAMES. Directory_path= (tnsnames) is modified to Names.directory_path= (tnsnames,ezconnect).
If the server's connection is set up with a dedicated port number, you need to use the Ip:port format in the IP section.
At development time, the second method is strongly recommended in CONFIG.
2.3, link string (. Net)
1Data Source=ORCL;UserId=MyUserName; Password=MyPassword;--Connect Locally2Data Source=TORCL;UserId=MyUserName; Password=MyPassword;--connecting to a remote server, configuring a connection instance in net Manage3Data Source=192.168.1.10/ORCL;UserId=MyUserName; Password=MyPassword;--connect to a remote server using the Ip/sid method4Data Source=(DESCRIPTION=
(address_list=
(ADDRESS=(PROTOCOL=TCP) (HOST={0}) (PORT= 1521)))
(Connect_data=(SID={1}) (SERVER=(dedicated)));UserId={2}; Password={3};
--{0} server Ip,{1} server database sid,{2} user name, {3} password, this method is completely written, is to take out the contents of Tnsnames.ora for setting data Source, this way is more insurance, sometimes the top three for a variety of reasons not connected , that's the way it was, and the reason didn't go into it.
[Lone solitary Nine swords] Oracle Knowledge Point Grooming (ii) connection of databases