SQLPlus Tool
What is SQLPlus?
●
SQLPlus is a command line oracle utility used to view and/or
modify the database specifications by using sql in the form of
admin tables.
●
Two such admin tables are, for example:
●
v$instance
●
v$database
●
SQLPlus can also be used to create,edit or view regular data
tables.
SQLPlus ADMIN FUNCTIONS
●
With SQLPlus you can do the following administrative
functions:
●
Start or shutdown the database
●
View the database status
●
Obtain the instance name being used by the Database.
●
Find the location of the data, log and control files to
make backups.
SQLPlus CONNECTION FORMAT
In its most general form, to connect to the SQLPlus utility you
can login via the sys or system user using the database listener
and database name as follows:
General Format:
sqlplus username/userpassword@hostip:portlistener/dbname
Example:
sqlplus system/bmcc@[Link]:1111/apple
NOTE: Listener and Instance must be active or online
SQLPlus Connection Sample2
●
Connecting to SQLPlus can also be done without the ip address and
listener port as follows:
sqlplus userid/password@dbname
●
See screenshot below:
When connecting
mongoimport --db recipe_db --collection contacts --file [Link] to SYS
must use SYSDBA role.
Collection Name The SQL prompt means
Successful connection.
SQLPlus Connection
To connect to SQLPlus follow the following format
When connecting to SYS
must use SYSDBA role.
mongoimport
More Connection Samples
●
Connecting to SQLPlus may also use the short version of omitting the
dbname but in such case the oracle_sid must be set to point to the
oracle service instance. See example below:
set oracle_sid=orange
sqlplus sys/bmcc as sysdba
●
In this shortest connection example the userid and password are also
omitted:
set oracle_sid=orange
sqlplus / as sysdba
SQLPlus Review
●
SQLPlus is a command-line tool that allows you to enter SQL statements.
●
With SQLPlus, you can get administrative information about an oracle
database.
●
With SQLPlus you can, of course, enter SQL statements to create users and
tables as well.
●
To connect to SQLPlus the database service instance must atleast be
running.
●
When successfully conntected to SQLPLus you will get an SQL prompt(SQL>).
●
To exit from SQLPlus you can just enter the exit command.
●
Lastly, all SQL statements entered must terminate with the ;
EXERCISE FOLLOWS