Info on Database Administration, CISCO Networking, Windows Microsoft word, excel, PowerPoint and ICT

Monday 14 November 2016

How to connect to SQL Plus in oracle database



Here, I am going to show you how to use sql plus to tap into your database n oracle database. Sql plus is one the user interface in oracle database which also include enterprise manager. One advantage of Sql plus is that it corresponds with every version of oracle database.



Sql plus is an executable file which we can get to by going to our command prompt (cmd) and typing sql plus which is under oracle home bin directory though you can lunch it  from anywhere.
It prompts for username. Here you will type in your username and password. For the purpose of this of this lesson I am going to use “scot” as the username. Scot is a built in username with tiger as password. Note that as you type the password, nothing will show up for security purposes.



You can have several database installed in a system, so when u type in sql plus how will it know which database to connect to. Its know by an eneviromental variable called oracle sid. To do do that you go back to the host and key in the following as in the picture below.


In case you are managing a hundreds of database and you forgot what database or sid you logged in to.  You can just type in define to bring out the details/ variables of the database you logged in to.


One can equally log in from one user to another simply by typing “connect sys as sysdba” then password to connect. “Sys is a username while sysdba is a special privilege attached to the user. This we shall treat in later posts. See the picture above
To also view the number of tables that user scot has, the following command is typed in. “select table_name from user_tables. The table below shows that scot owns  only four tables. To view the physical attributes of the table emp for instance you type in desc emp or describe emp. See the pix below

Share:

0 comments:

Post a Comment

Recent Posts

Sample Text

Definition List

Ordered List