[Lone solitary Nine swords] Oracle Knowledge Point Grooming (ii) connection of databases

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.