Command line login Oracle (including remote login)

Source: Internet
Author: User

This method is useful for logging in to native or remote Oracle under CMD command-line windows and PL/SQL landing Oracle. 1, first guarantee on the current host set up Oracle_homeEnvironment variables: For example: oracle_home=d:\oracle\product\10.2.0\db_2, typically set automatically when an ORACLE client is installed. 2, edit%oracle_home%\network\admin under the Tnsnames.oraFile, examples are as follows:
MYORCL =  (DESCRIPTION = (    address_list = (      ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.130.100) (PORT = 1521)) 
    
     )    (Connect_data =      (service_name = ORCL)    )  ) localhost=  (DESCRIPTION =    (address_list =      (ADDRESS = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521    )) (Connect_data =      (service_name = ORCL)    ) )
    

The purpose of the file is to resolve the access address when the command line is logged on, and PL/SQL will also read the file by default to connect. MYORCL is an alias, which is used in the command line, and can be defined more than once.

3, the command line landing two ways, (landing this machine and landing remote are the same):

A, the first way:
Sqlplus Username/[email Protected][tnsnames.ora The alias that is already defined in the file]--  do not add a semicolon after
Note that the above format, in addition to sqlplus behind a space, other places do not add spaces.            Sqlplus User01/[email protected]--can be landed successfully. Sqlplus User01/[email Protected] Another example of B, the second way:
①sqlplus/nolog--has not landed at this time.   do not add semicolons to the back
②conn Username/[email Protected][tnsnames.ora The alias that is already defined in the file]--  do not add a semicolon after
Example: Sqlplus/nolog conn User01/[email protected]

Command line login Oracle (including remote login)

Related Article

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.