[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2009-05-19
8
Medium Priority
?
15,326 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 2000 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 2000 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

How much do you know about the future of data centers? If you're like 50% of organizations, then it's probably not enough. Read on to get up to speed on this emerging field.
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
Suggested Courses

834 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