Starting SQL*Plus and Connecting to the Database

The section describes how to start SQL*Plus and connect to the database from both the command line and the Windows Start menu.

For a new installation, you connect to the database using either the SYS or SYSTEM database accounts. When you enter SYS or a slash (/) as the user name and provide the AS SYSDBA clause, your access is authenticated using operating system authentication. Operating system authentication uses your Windows, UNIX, or Linux host user account to authenticate you to Oracle Database. You must have logged in to the host computer with a user account that is a member of a special host user group. On UNIX and Linux, this user group is typically dba. This type of authentication enables you to connect to an Oracle database that is not yet started, so that you can start it up. See Oracle Database Administrator's Guide for more information.

The following procedures show how to log in to the database as user SYS using the SYSDBA privilege.

To start SQL*Plus and connect to the database from the command line:

  1. Open a command window.

  2. Configure the operating system environment variables, as described in "Configuring the Operating System Environment Variables ."

  3. Start SQL*Plus using a command in the following format:

    sqlplus {username | /} [as sysdba]
    

    An example of this command is:

    $ sqlplus / AS SYSDBA
    Enter password: password
    

    For username, you can use the SYS or SYSTEM administrative users. At the prompt, enter the password that you set up during installation. If you use the SYS user, you must include AS SYSDBA after the username.

    SQL*Plus connects you to the default database instance (Microsoft Windows) or the database instance specified by environment variables (Linux and UNIX).

To start SQL*Plus and connect to the database from the Windows Start menu:

  1. Configure the operating system environment variables, as described in "Configuring the Operating System Environment Variables ."
  2. 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 and password for the account to use to connect to the database.

    For the user name, you can use the SYS or SYSTEM administrative accounts, and you can use the password that you set up during installation.

    If you use SYS or / as the user name, follow them with a space and then the clause AS SYSDBA, as shown in the following examples:

    Enter user-name: SYS AS SYSDBA
    Enter password: password
    
    or
    
    Enter user-name: / AS SYSDBA
    

See Also: