userenv('ISDBA') : To check the Current Oracle Session has DBA Privilege

advertisements

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World
USERENV provides the current oracle session details. Userenv(‘ISDBA’) will give you true or false information whether your session has SYSDBA privilege through operating system or a password file.

Please find some example on the same.


  1. Connected as normal user
SQL>  CONNECT APPINSTALL@PROD
Enter password:
Connected.
SQL> SELECT userenv('ISDBA'),  SYS_CONTEXT( 'USERENV', 'AUTHENTICATION_METHOD' ) AUTHENTICATION FROM DUAL;

USEREN AUTHENTICA
------ ----------
FALSE  PASSWORD
  1. Connected as sysdba user
SQL> CONNECT APPINSTALL@PROD as sysdba
Enter password:
Connected.
SQL> SELECT userenv('ISDBA'),  SYS_CONTEXT( 'USERENV', 'AUTHENTICATION_METHOD' ) AUTHENTICATION FROM DUAL;

USEREN AUTHENTICA
------ ----------
TRUE   PASSWORD

SQL> connect / as sysdba
Connected.
SQL> SELECT userenv('ISDBA'),  SYS_CONTEXT( 'USERENV', 'AUTHENTICATION_METHOD' ) AUTHENTICATION FROM DUAL;

USEREN AUTHENTICA
------ ----------
TRUE   OS

_____________________________________________________________________________________________________________________

A visitor from Central viewed 'MLB The Show 23 Update 10: Patch Notes and Excitin' 3 hrs 41 mins ago
A visitor from Kaduna viewed 'Silent Installation of OEM 12c agent: manually usi' 8 hrs ago
A visitor from Zapopan viewed 'Fix DGMGRL Error: ORA-16698: LOG_ARCHIVE_DEST_n pa' 9 hrs 4 mins ago
A visitor from Central viewed 'Oracle SQL Script for Index Usage and Performance:' 10 hrs 37 mins ago
A visitor from Santa ana viewed 'RMAN Restore Failed RMAN-06100: no channel to rest' 12 hrs 36 mins ago

0 comments:

Post a Comment

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-25 All Rights Reserved | Site Map | Contact | Disclaimer