Home >> FAQs/Tutorials >> Oracle DBA FAQ >> Index

Oracle DBA FAQ - Introduction to Command-Line SQL*Plus Client Tool

By: FYIcenter.com

Part:   1  2   3  4  5  6  7  8  9 

(Continued from previous part...)

How To Get Help at the SQL Prompt?

Once SQL*Plus is started, you will get a SQL prompt like this: SQL>. This where you can enter commands for SQL*Plus to run.

To get help information at the SQL prompt, you can use the HELP command as shown in the following tutorial example:

SQL> HELP INDEX

Enter Help [topic] for help.

 @             COPY         PAUSE       SHUTDOWN
 @@            DEFINE       PRINT       SPOOL
 /             DEL          PROMPT      SQLPLUS
 ACCEPT        DESCRIBE     QUIT        START
 APPEND        DISCONNECT   RECOVER     STARTUP
 ARCHIVE LOG   EDIT         REMARK      STORE
 ATTRIBUTE     EXECUTE      REPFOOTER   TIMING
 BREAK         EXIT         REPHEADER   TTITLE
...
 COMPUTE       LIST         SET         XQUERY
 CONNECT       PASSWORD     SHOW
 
SQL> HELP CONNECT

 CONNECT
 -------

 Connects a given username to the Oracle Database. When you 
 run a CONNECT command, the site profile, glogin.sql, and 
 the user profile, login.sql, are processed in that order. 
 CONNECT does not reprompt for username or password if the 
 initial connection does not succeed.

 CONN[ECT] [{logon|/|proxy} [AS {SYSOPER|SYSDBA}]]

 where logon has the following syntax:
     username[/password][@connect_identifier] 

What Information Is Needed to Connect SQL*Plus an Oracle Server?

If you want to connect your SQL*Plus session to an Oracle server, you need to know the following information about this server:

  • The network hostname, or IP address, of the Oracle server.
  • The network port number where the Oracle server is listening for incoming connections.
  • The name of the target database instance managed by the Oracle server.
  • The name of your user account predefined on in the target database instance.
  • The password of your user account predefined on in the target database instance.

What Is a Connect Identifier?

A "connect identifier" is an identification string of a single set of connection information to a specific target database instance on a specific Oracle server.

Connect identifiers are defined and stored in a file called tnsnames.ora located in $ORACLE_HOME/network/admin/ directory. Here is one example of a "connect identifier" definition:

FYI_XE =
  (DESCRIPTION =
    (ADDRESS = 
      (PROTOCOL = TCP)
      (HOST = dba.fyicenter.com)
      (PORT = 1521)
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)
    )
  )

The above "connect identifier" defines "TNS_XE" with the following connection information:

  • The network hostname: dba.fyicenter.com.
  • The network port number: 1521.
  • The name of the target database instance: XE.

(Continued on next part...)

Part:   1  2   3  4  5  6  7  8  9 


Selected Developer Jobs:

More...