INSTANCE_NAME
Purpose
Use the parameter INSTANCE_NAME to identify the database instance to access. Set the value to the value specified by the INSTANCE_NAME parameter in the initialization parameter file.
Note: When "SELECT ANY DICTIONARY" system privs granted to user.
SQL> conn system/oracle
Connected.
SQL> select PRIVILEGE from session_privs
where PRIVILEGE like 'SELECT ANY DICTIONARY';
PRIVILEGE
----------------------------------------
SELECT ANY DICTIONARY
SQL> show parameter instance_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
instance_name string orcl
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
orcl
Note: when 'SELECT ANY DICTIONARY' system privs is NOT granted to user.
SQL> conn scott/tiger
Connected.
SQL> select PRIVILEGE from session_privs
where PRIVILEGE like 'SELECT ANY DICTIONARY';
no rows selected
SQL> select * from global_name;
GLOBAL_NAME
--------------------------------------------------------------------------------
ORCL
SQL> select SYS_CONTEXT('USERENV','INSTANCE_NAME') instance_name from dual;
INSTANCE_NAME
--------------------------------------------------------------------------------
orcl
No comments:
Post a Comment