Home » SQL & PL/SQL » SQL & PL/SQL » to find oracle database name
to find oracle database name [message #305952] Wed, 12 March 2008 06:55 Go to next message
sruthi_ks
Messages: 2
Registered: March 2008
Junior Member
hI
I have two databases-->production Database and dEvelopment database
Production DB="CADB1.PROD"
Development DB="CADB1.DEV"

i used two queries to find the database name:
1. select ora_database_name from dual
2. select sys_context('USERENV','DB_NAME') x from dual


But result of both the queries is -->CADB1

i want to find whether the database is CADB1.DEV or CADB1.PROD.
pLease help me by providing a suitable query.
Re: to find oracle database name [message #305959 is a reply to message #305952] Wed, 12 March 2008 07:27 Go to previous messageGo to next message
Michel Cadot
Messages: 64130
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
select global_name from global_name;

Regards
Michel
Re: to find oracle database name [message #305973 is a reply to message #305952] Wed, 12 March 2008 08:06 Go to previous messageGo to next message
sruthi_ks
Messages: 2
Registered: March 2008
Junior Member
i am still getting the result as --> "CADB1"


I need to know whether the database is CADB1.PROD or CADB1.DEV
Re: to find oracle database name [message #305981 is a reply to message #305973] Wed, 12 March 2008 08:24 Go to previous message
Michel Cadot
Messages: 64130
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
If global name does not have a domain name, either set it or add it with:
alter database rename global_name to cadb1.dev;

Regards
Michel
Previous Topic: sql query
Next Topic: Scheduled Job doesn't start
Goto Forum:
  


Current Time: Wed Dec 07 08:31:42 CST 2016

Total time taken to generate the page: 0.11293 seconds