Database Administration

Hi i am working with Ministry of communication & IT (INDIA).My question is i hav install oracle 9i at my home.When i go to command prompt & tries to connect it with sysdba, it is not able to connect....its says following error...(tns:unable to find host or service name).i have connectin it with following syntax: (connect as sys/manager@orcl as sysdba) (connect as sys/change_on_instal@orcl as sysdba) but doesn't connect.i have checked the tnsnames file also....the host name/sid are correctly mention.please suggest.

Answer Wiki

Thanks. We'll let you know when a new response is added.

Check your TNSNAMES.ora. What are the settings for your service?
should be similar: (this is from my tnsnames.ora. Of course I changes the SID and HOST strings)

(ADDRESS = (PROTOCOL = TCP)(HOST = computername)(PORT = 1521))
(SERVICE_NAME = sidname)

See what your computer is named for the HOST setting.

in Windows:
goto Control Panel/System/Computer Name and use the full name shown on the screen.
Caution:DO NOT USE the IP Address in Windows unless you know for sure that the address is STATIC. Most IP addresses in the Windows environemts are Dynamic – in other words, they CHANGE, possibly every time you bootup. (see note about

in UNIX:
IP address of the server or the name as specified by the Admin

NOTE: I believe you can also use instead of the computer name for the HOST setting. This I.P. looking address signifies LOCAL.

That should do it. If the manual tnsnames entry doesn’t work for some reason, use the Net Configuration Assistant to set the SID, HOST and Protocol strings. Use the defaults at first.

To connect to the database, use the following syntax:

at a DOS or UNIX prompt:

DOS C: sqlplus system/manager@orcl
UNIX ?: sqlplus system/manager@orcl

(check for configuration of SQLPLUS:
DOS C: sqlplus
UNIX ?: which sqlplus
If you don’t get a response with a path or get an error (in DOS), you do not have SQLPLUS installed properly, usually not listed in your in your PATH statement)


The last entry will connect you as SYS if required.

It is not recommended to do anything in the database as SYS unless necessary. This user is very powerful and unless you really like to recover or reinstall Oracle, you can really mess things up if you are not careful. Do all you work as SYSTEM or even better, create a USER for yourself and give it the privileges/permissions that you need.

Always login as yourself and connect as other users after initiating the SQLPLUS session.

Most important – BE PATIENT! Oracle is not the easiest application to use if done improperly. It takes time and effort to efficiently use and a long time to master. Have fun.

Hope this helped,


Discuss This Question:  

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: