SQL*Plus Tutorial

Connect to SQL * Plus

After the user logs on to SQL * Plus, the system displays a prompt (SQL >) and awaits commands to the user.
The user can give:
- SQL commands for accessing database;
- Blocks PL/SQL to access database;
- SQL * Plus commands.



Connect to another database

Connect to another database, than its open initially, during a session work SQL * Plus:
CONNECT [username [/password]] [@ database_name]



Link between two database

Creating a link between local database and a remotely database:

CREATE [PUBLIC] DATABASE LINK link_name
CONNECT TO username
IDENTIFIED BY password
USING remotely_database

After the link was created, the query can be made on the appropriate tables by specifying the name of the database remote link in the FROM clause of the request. If the PUBLIC option is specified, the link is available to all users except those who have defined a private link with the same name.

Suppression of a link between two databases, one local and one remote:

DROP [PUBLIC] DATABASE LINK link_name.

Closing the session working of SQL * Plus is performed with QUIT or EXIT commands.