Solved

What is Host String? Why Username is Set to Scott? SQL Plus - Oracle Enterprise Edition

Posted on 2009-05-19
8
14,594 Views
Last Modified: 2013-11-11
I have just installed Oracle Enterprise Edition, i tried to run SQL Plus. I requested username and password. I googled and by chance i found username should be scott and password is tiger which did not make sense to me. In the other hand, our instructor's gave us a username, password and host string to logon SQL*Plus in the institution lab as the following:

SQL> conn username/pass@hoststring;

I do not even think we had to insert username and password to use SQL*Plus

When i installed Enterprise Edition 11g to my pc, i thought the username, passowrd, and host string that i got my instructor's would work in my PC! It didn't so i had to go and search for a solution and i found that the username should scott and password is tiger! How an earth i would have known that? I'm not given this information after installation. Who is scott? Who is tiger? Why scott and tiger! Anyway, i inserted it and i have been requested to re-new the password and then i logged in. It did not ask me for a host string at all. Thus, here are my questions:

1. Why i could not logon SQL*Plus in my PC by using the instructor's username and password?

2. Doesn't SQL*Plus connects remotely to a server?

3. Why am i asked to insert username and password before using SQL*Plus! Because SQL> is useless accept i try to connect remotely as following conn username/pass@hostring;

4. Just curious to know! Is SQL*Plus allows you to insert a remote username and password, instead of my local "scott" username and password?

5. "Host string is your System Identifier (SID), which you would have specified while installation. Host string is an alias to the server/database. If you are running Developer on the same machine as the database server, leave host string empty." Is this true definition of Host String? If not, what is it? Please explain in a simple way.

6. Based on the quote above: " Host string is an alias to the server/database." what does this mean? Is it like a hint word?

7. Why SQL*Plus in Lab asks me to insert host string, while my SQL*Plus in my PC does not? Note: i know my SID, i set it when i first installed the application.

I'm new to all these database thing, so bear with me. Expect many questions on the way!
0
Comment
Question by:F-J-K
  • 4
  • 4
8 Comments
 
LVL 48

Accepted Solution

by:
schwertner earned 500 total points
ID: 24425534
Installing Oracle 11g you have choosen a SID name for your instance.
The connection string is an alias for 4 components without which the client can not understand where the server is:
Host (Computer) name
Port (1521)
Service Name (SID)
Protocol (TCP)

Now go the the file tnsname.ora (...\network\admin directory)
You will find some rows in front of which stays the alias (here it is QSYS):

QSYS =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = developqsysdb.dev.intercomponentware.com)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = qsys)
    )



So the connection will be:

SQL>connect sys/password@QSYS as sysdba

QSYS stands for the 4important entries that direct the client where to find the instance.

But there are 2 surprises that you have to overcome.
0
 
LVL 48

Assisted Solution

by:schwertner
schwertner earned 500 total points
ID: 24425571
1. If the listener answers that he can not find the instance
check if the listener is up and has registered the listener:

lsnrctl status
lsnrctl services

Static registration is the fix, if you do not see the instance

2. SCOTT/TIGER account is locked by default. To unlock:

SQL> alter user scot identified by tiger account unlock;

Now you will enjoy the Oracle world!
0
 
LVL 1

Author Comment

by:F-J-K
ID: 24426601
Thanks...

Note: i'm running Vista. CLI does not have this command lsnrctl ... Anyway, i will try to figure it out
0
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 
LVL 1

Author Comment

by:F-J-K
ID: 24428292
When i write the command i get number 2 as following:

SQL> select * from employees
  2
SQL>

What does 2 represent?
0
 
LVL 1

Author Comment

by:F-J-K
ID: 24428359
I tried to unlock tiger, but i get this message:

SQL> alter user scot indentified by tiger account unblock;
SP2-0640: Not connected


Moreover, i did

SQL> connect username/pass@hoststring;
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified

I tried to use the remote username, pass and hoststring that i have been given by institution. As you see, i get TNS error. Can you explain what does it mean! Is the remote server down?

Further more, i did

SQL> connect username/password@hoststring;
ERROR:
ORA-01017: invalid username/password; logon denied

I used my local details that i set in my pc when installed Oracle application. I know how to get hoststring. However, the only username and password i set and i know is
username: scott
password: tiger (i re-set it to my own password)

Yet did not work!

I got the file tnsname.ora, i checked its details, everything looks fine as i expected.

Can anybody advice please...
0
 
LVL 48

Expert Comment

by:schwertner
ID: 24429475
Hello,
you put a pure Oracle question in

Databases Miscellaneous, SQL Query Syntax,

zones.

I do not accept to comment misszoned questions.

Yes, it is possible step by step to solve your problems,
but please address your question correctly.
0
 
LVL 48

Expert Comment

by:schwertner
ID: 24429490
the correct zone is Oracle11 or Oracle
In the OS you should work as the user who has installed Oracle (administrator).
The PATH should point to ORACLE_HOME/bin directory
where you can fint the LSNRCTL.EXE.
0
 
LVL 1

Author Closing Comment

by:F-J-K
ID: 31583067
Yea, i posted in the wrong section. I  wanted to delete this question and re-post in Oracle 11. However, i will just give credit since it helped me in *someway*.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question