Oracle® Database 2 Day DBA 11g Release 1 (11.1) Part Number B28301-03 |
|
|
View PDF |
This section describes how to use SQL*Plus and the easy connect naming method to connect to an Oracle database from a client computer. SQL*Plus is typically installed when you install Oracle Database client software. The easy connect naming method provides TCP/IP connectivity to databases without the need to first configure Oracle Net Services.
To connect to an Oracle database from a client computer using easy connect naming:
(UNIX and Linux only) Ensure that the required environment variables are set. At a minimum, PATH
and ORACLE_HOME
, must be set.
Do one of the following to start SQL*Plus:
On UNIX, Linux, or Windows, open a command window and enter the following command:
sqlplus
On Windows, Click Start, select Programs (or All Programs), then Oracle - HOME_NAME, then Application Development, and then SQL*Plus.
When prompted, enter the user name followed by an at sign (@) and a connect identifier, where the connect identifier has the following format:
"[//]host[:port]/service_name"
where:
host
is the name or IP address of the Oracle database host computer.
port
(optional) is the TCP port number on which the Oracle Net listener listens for connections.
If port
is excluded, the standard port number 1521 is assumed.
service_name
is one of the services defined by the database.
If there are no service names specifically defined, then you can use the name of the service that the database creates by default. This service name defaults to the global database name, which consists of the database name (DB_NAME
parameter) and domain name (DB_DOMAIN
parameter).
For example, to connect as user NICK
to the database service orcl.us.example.com
on the host db.us.example.com
, enter the following at the user name prompt:
nick@"db.us.example.com/orcl.us.example.com"
When prompted, enter the user password.
See Also:
Oracle Database Administrator's Guide for more examples of connecting with SQL*Plus and for a discussion of environment variables
Oracle Database Net Services Administrator's Guide for information on easy connect, connect identifiers, and other naming methods.