Wednesday, July 2, 2014

Using Oracle PL/SQL how do I know to which database instance I am currently connected

Below query will give you the name of the instance you are currently connected with

SELECT sys_context('USERENV','DB_NAME') AS Instance FROM dual;

 Also we can use the below query to use the database name


select name from v$database

No comments:

Post a Comment