4.4 Connecting to an Oracle Database from a Client Computer

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 requiring you to configure Oracle Net Services.

You can use the instructions in this section to test your network configuration.

To connect to an Oracle database from a client computer using easy connect naming:

  1. Complete the steps in "Configuring the Operating System Environment Variables ".
  2. Do one of the following to start SQL*Plus:
    • (UNIX, Linux, or Windows systems) Open a command window and enter the following command:

    • (Windows systems only) Click Start, select Programs (or All Programs), then Oracle - HOME_NAME, then Application Development, and then SQL*Plus.

  3. When prompted, enter the user name followed by an at sign (@) and a connect identifier, where the connect identifier has the following format:

    The place holders used in the connect identifier format represent:

    • host — the name or IP address of the Oracle database host computer.

      Both IPv4 and IPv6 addresses are supported. IPv6 addresses must be enclosed in square brackets. See Oracle Database Net Services Administrator's Guide for information about IPv6 addressing.

    • port (optional) — the TCP port number on which the Oracle Net listener listens for connections.

      If port is excluded, then the standard port number 1521 is assumed.

    • service_name — a database service name.

      If no database service names are defined, then you can use the name of the default service that is created for the database. This service name consists of the global database name, which is made up of the DB_NAME and DB_DOMAIN initialization parameters as follows:


      If DB_DOMAIN is null, then the standard service name is just DB_NAME.

    • server — the type of service handler. Acceptable values are dedicated, shared, and pooled. If omitted, then the default type of server is chosen by the listener: shared server if configured, otherwise dedicated server.

    • instance_name — the instance to which to connect. When you specify only instance name, you connect to the default database service. If there is no default service configured in the listener.ora file, then an error is generated.You can obtain the instance name from the INSTANCE_NAME initialization parameter.

    For example, to connect as user NICK to the database service orcl.example.com on the host dbhost.example.com, enter the following at the user name prompt:


    The following examples substitute IPv4 and IPv6 addresses for the host name:

  4. When prompted, enter the user password.

See Also: