Solved

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

Posted on 2009-05-19
8
14,680 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

733 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