I am working in a project which has huge amounts of DATA, hence we are using two DBs. Now my question is, how will i know to which DB my system is currently connected to?
Asked
Active
Viewed 245 times
0
-
You mean which instance? Or tablespace? – Patrick Hofman Sep 19 '14 at 10:21
-
If usernames are diffferent then you can use `select user from dual;` – vishad Sep 19 '14 at 10:22
-
Hi Patrick, I am looking for the instance. – user3928739 Sep 19 '14 at 10:22
-
1"hence we are using two DBs" - bad idea detected – Erich Kitzmueller Sep 19 '14 at 10:26
-
2possible duplicate of [Checking oracle sid and database name](http://stackoverflow.com/questions/6288122/checking-oracle-sid-and-database-name) – yamny Sep 19 '14 at 10:29
1 Answers
1
You can get the variable instance_name
from the context:
select sys_context
( 'userenv'
, 'instance_name'
)
from dual

Patrick Hofman
- 153,850
- 22
- 249
- 325