[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register 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,189 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 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
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

650 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