Solved

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

Posted on 2009-05-19
8
14,240 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 47

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 47

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
 
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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 47

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 47

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now