Operating System - HP-UX
1752565 Members
5658 Online
108788 Solutions
New Discussion юеВ

Something about the basical usage of Oracle

 
Wang,MinJie
Super Advisor

Something about the basical usage of Oracle

Hey everyone,
I'm a freshman of Oracle,so maybe my questions is very idiot.
Excuse me.
My question is:
I've installed an Oracle 10g server on HP-UX and
I log on as oracle and press sqlplus /nolog then
SQL>conn / as sysdba
SQL>
Then I was confused.
how could I know where am I(I mean what database I'm in)and How could I create a user
Help me,please
8 REPLIES 8
Peter Godron
Honored Contributor

Re: Something about the basical usage of Oracle

Hi,
select instance_name from v$instance;
will show yout he instance name.
or !echo $ORACLE_SID at the SQl prompt.

create user x identified by y;

Peter Godron
Honored Contributor

Re: Something about the basical usage of Oracle

Hi,
no points for this second mail please.
you also have to, at least :
grant connect to x;

before user x can log on.
Sorry for the second positng.
Christian Marquardt_1
Regular Advisor

Re: Something about the basical usage of Oracle

Hello,
before you login with / as sysdba you can check what environment is set with the env command. Try this:
env | grep ORACLE
If you use connect / as sysdba you connect to the database instance named in ORACLE_SID.
If you are in sql*plus use this:
select * from v$instance; or
select * from v$database;
to find some informations about the instance/db.

regards
Christian
Wang,MinJie
Super Advisor

Re: Something about the basical usage of Oracle

Thank you guys
Now I'm much more clear at Oracle
then I get a new question
is there only one database running on one system simultaneously because ORALCE_SID only can have one value?
Peter Godron
Honored Contributor

Re: Something about the basical usage of Oracle

Hi,
ps -ef | grep smon
should give you list of databases running.
You can also check the /etc/oratab file.
Set your ORACLE_SID to the db you want to access and enter sqlplus.

export ORACLE_SID=dbname
Wang,MinJie
Super Advisor

Re: Something about the basical usage of Oracle

So it means you can run several databases simultaneously and when you press sqlplus and
then conn / as sysdba it will defaultly connect to the database presented by ORACLE_SID.
Am I right?
Peter Godron
Honored Contributor

Re: Something about the basical usage of Oracle

Hi,
yes.
you set the db you want to connect to by setting ORACLE_SID, when you then use sqlplus it will log you onto the chosen database.
You can test this by setting the ORACLE_SID you a invalid value, and then trying to log on. You should receive an error message
Wang,MinJie
Super Advisor

Re: Something about the basical usage of Oracle

OK
Now I think I've made a great step in the comprehension of Oracle
Thank you