SQL*Plus User's Guide and Reference

Contents Index Home Previous Next

Connecting to the Default Database

In order to access data in a given database, you must first connect to the database. When you start SQL*Plus, you normally connect to your default Oracle database under the username and password you enter while starting. Once you have logged in, you can connect under a different username with the SQL*Plus CONNECT command. The username and password must be valid for the database.

For example, to connect the username TODD to the default database using the password FOX, you could enter

SQL> CONNECT TODD/FOX

If you omit the username and password, SQL*Plus prompts you for them. You also have the option of typing only the username following CONNECT and omitting the password (SQL*Plus then prompts for the password). Because CONNECT first disconnects you from your current database, you will be left unconnected to any database if you use an invalid username and password in your CONNECT command.

You can disconnect the username currently connected to Oracle without leaving SQL*Plus by entering the SQL*Plus command DISCONNECT at the SQL*Plus command prompt.

The default database is configured at an operating system level by setting operating system environment variables, symbols or, possibly, by editing an Oracle specific configuration file. Refer to your Oracle documentation for your operating system for more information.


Contents Index Home Previous Next