Home » SQL & PL/SQL » SQL & PL/SQL » Service name
Service name [message #270028] Tue, 25 September 2007 08:24 Go to next message
jeannezhang
Messages: 21
Registered: May 2005
Junior Member
Any one could answer my simple question:

I would like to see which database I am in by using a SQL on SQL*Plus. We will update Oracle 9i to 10g and do no want to change the name (9i will be no long used). So the same db name will point to new database service name.

Thanks a lot for any help!

Jeanne
Re: Service name [message #270032 is a reply to message #270028] Tue, 25 September 2007 08:38 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
select name from v$database;
select instance_name from v$instance;
select * from global_name;

Regards
Michel
Re: Service name [message #270040 is a reply to message #270028] Tue, 25 September 2007 08:48 Go to previous messageGo to next message
jeannezhang
Messages: 21
Registered: May 2005
Junior Member
Thanks a lot for your answering my question. It is very very help!
Re: Service name [message #270146 is a reply to message #270028] Tue, 25 September 2007 22:40 Go to previous messageGo to next message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

In Addition,

If you look for service name,

select name from v$services;
or,
select service_name from V$SERVICE_STATS;

If you look for instance name,

select instance from v$thread;

There are also many ways to get it.
Re: Service name [message #272842 is a reply to message #270028] Mon, 08 October 2007 00:34 Go to previous messageGo to next message
muzahid
Messages: 281
Registered: September 2004
Location: Dhaka, Bangladesh
Senior Member
Another ways

SELECT ora_database_name FROM dual;


select sys_context('USERENV','DB_NAME')
from dual;
Re: Service name [message #272843 is a reply to message #270028] Mon, 08 October 2007 00:37 Go to previous message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

Quote:

SELECT ora_database_name FROM dual;

For global_name not for service_name.
Previous Topic: problem with image (merged)
Next Topic: Top - N queries in oracle
Goto Forum:
  


Current Time: Thu Dec 08 16:34:09 CST 2016

Total time taken to generate the page: 0.12971 seconds