Starting With Oracle SQL

Here in this post I am going to show you how to connect and start SQL using your command prompt. Actually you can use Run SQL Command Line from start menu but problem is that it do not support copy and paste commands which are generally required by most of the developers like you and me. So let’s see how to connect to SQL database using command prompt.

But of-course for doing this you will need Oracle SQL to be installed on your PC. If you are not having it, you can download from the following link.

Download Oracle SQL Express Edition 11g

Oracle SQL is a free to use software but while downloading you might need to login to your Oracle account. If  you are not having an Oracle account, then you can create it for free using sign up option.

The download is nearly 350MB in size. Once downloaded you need to extract to content of zipped file and then launch setup.exe. The setup options are quite similar to other setups. So you are familiar with them or else you can simply go on clicking Next Next ….

While setting it up, you might come across a screen shown below.

On this screen you are suppose to enter password for SYS and SYSTEM user. In oracle database this two are the users with administrative privilege. If you are going to use this installation for development purpose then you can choose ‘admin’ as password. Because admin is very simple to remember and also very simple to enter. You can use your own password also. Once you have chosen password click on next.

As soon as you click on next, the setup will begin to install Oracle SQL on your PC. Wait until setup complete.

Once installed, open up command prompt from Start Menu. Alternatively, you can use cmd at run option in Start Menu. After that command prompt will appear on your screen.

Here you have to type

sqlplus /nolog

and then press enter. This will start SQL prompt in command prompt.

Once you hit enter then you will see something like shown above. Your command prompt will be changed to SQL prompt. Now you can see SQL> in window.

Then you have to fire a query to connect database. The query is quite simple

connect [username]/[password]@[server]

here user name is your username (here in this post consider ‘SYSTEM’) , password, whatever you chosen at time of setup ( here I have chosen ‘admin’), and server will be this ip or name of pc where Oracle SQL is installed (here since we have installed it on our own PC, it will be ‘localhost’ or ‘127.0.0.1’).

So considering you are having password as ‘admin’, you will fire a query. (Do not put semicolon)

connect SYSTEM/admin@localhost

(Replace admin if you have chosen a different password)

Once you have fired this query you will see Connected As message on your screen. Now you are ready to work with Oracle SQL.

You will need to deal with command prompt every time whenever you want to use SQL. That just two steps sqlplus /nolog and connect query.

That’s All.

If you are getting any error or looking for help, you are always free to start discussion by leaving comment here.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.