Home » RDBMS Server » Server Administration » change default database (oracle 10g)
icon5.gif  change default database [message #351749] Thu, 02 October 2008 16:48 Go to next message
sawsan
Messages: 15
Registered: October 2004
Junior Member
Hello

I installed oracle 10g on win xp, then I created two databases

Now I want to change the default database that launches when I start sqlplus...

how I can change the database ,that I am working on it, to another existed database
thanks a lot
Re: change default database [message #351751 is a reply to message #351749] Thu, 02 October 2008 18:38 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
If you actually want to change the default ORACLE_SID for the box you can change it in the registry and/or system environment variables. If you want to change it within the command prompt temporarily, then you can issue:

set oracle_sid=<new_sid_name>
icon2.gif  Re: change default database [message #351900 is a reply to message #351749] Fri, 03 October 2008 12:16 Go to previous messageGo to next message
sawsan
Messages: 15
Registered: October 2004
Junior Member
thanks

but can I ask you how can I know what database I am working on...
Re: change default database [message #351903 is a reply to message #351900] Fri, 03 October 2008 12:25 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
SQL> select * from global_name;
GLOBAL_NAME
--------------------------------------------------------
MIKA.XXXXXXX

1 row selected.

SQL> select sys_context('userenv','db_name') from dual;
SYS_CONTEXT('USERENV','DB_NAME')
--------------------------------------------------------
MIKA

1 row selected.

Regards
Michel

[Updated on: Fri, 03 October 2008 12:26]

Report message to a moderator

Re: change default database [message #351936 is a reply to message #351749] Fri, 03 October 2008 15:24 Go to previous messageGo to next message
sawsan
Messages: 15
Registered: October 2004
Junior Member
thank you very much...
Re: change default database [message #351937 is a reply to message #351749] Fri, 03 October 2008 15:25 Go to previous messageGo to next message
sawsan
Messages: 15
Registered: October 2004
Junior Member
so what is the sql to konw how many databases I have ..
Re: change default database [message #351942 is a reply to message #351937] Fri, 03 October 2008 15:40 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
There is none.
Search for all OracleService* Windows services.

Regards
Michel

[Updated on: Fri, 03 October 2008 15:41]

Report message to a moderator

Re: change default database [message #351945 is a reply to message #351749] Fri, 03 October 2008 15:45 Go to previous message
sawsan
Messages: 15
Registered: October 2004
Junior Member
ok.
thanks a lot.
Previous Topic: ORA-00600 Error in Alert Log
Next Topic: Dropped child partition retains fk constraint with parent partition after row movement
Goto Forum:
  


Current Time: Fri Nov 29 17:46:00 CST 2024