Senario Preview:
Solution
[oracle@srv1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Tue Aug 20 19:06:24 2019
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
SQL> grant plustrace to soe;
grant plustrace to soe
*
ERROR at line 1:
ORA-01919: role 'PLUSTRACE' does not exist
SQL> sho user
USER is "SYS"
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
CON_ID
----------
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
0
PL/SQL Release 12.1.0.2.0 - Production
0
CORE 12.1.0.2.0 Production
0
BANNER
--------------------------------------------------------------------------------
CON_ID
----------
TNS for Linux: Version 12.1.0.2.0 - Production
0
NLSRTL Version 12.1.0.2.0 - Production
0
SQL> exit
[oracle@srv1 admin]$ pwd
/u01/app/oracle/product/12.1.0/dbhome_2/sqlplus/admin
[oracle@srv1 admin]$
SQL> @/u01/app/oracle/product/12.1.0/dbhome_2/sqlplus/admin/plustrce.sql
SQL>
SQL> drop role plustrace;
drop role plustrace
*
ERROR at line 1:
ORA-01919: role 'PLUSTRACE' does not exist
SQL> create role plustrace;
Role created.
SQL>
SQL> grant select on v_$sesstat to plustrace;
Grant succeeded.
SQL> grant select on v_$statname to plustrace;
Grant succeeded.
SQL> grant select on v_$mystat to plustrace;
Grant succeeded.
SQL> grant plustrace to dba with admin option;
Grant succeeded.
SQL>
SQL> set echo off
SQL> grant plustrace to soe;
Grant succeeded.
SQL>
- We are granting plus trace to particular schema we got error(ORA-01919: role 'PLUSTRACE' does not exist) and finding way to solve it.
Solution
- Go to database binary location /u01/app/oracle/product/12.1.0/dbhome_2/sqlplus/admin execute plustrce.sql
- Grant plustrace permission to schema
[oracle@srv1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Tue Aug 20 19:06:24 2019
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
SQL> grant plustrace to soe;
grant plustrace to soe
*
ERROR at line 1:
ORA-01919: role 'PLUSTRACE' does not exist
SQL> sho user
USER is "SYS"
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
CON_ID
----------
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
0
PL/SQL Release 12.1.0.2.0 - Production
0
CORE 12.1.0.2.0 Production
0
BANNER
--------------------------------------------------------------------------------
CON_ID
----------
TNS for Linux: Version 12.1.0.2.0 - Production
0
NLSRTL Version 12.1.0.2.0 - Production
0
SQL> exit
[oracle@srv1 admin]$ pwd
/u01/app/oracle/product/12.1.0/dbhome_2/sqlplus/admin
[oracle@srv1 admin]$
SQL> @/u01/app/oracle/product/12.1.0/dbhome_2/sqlplus/admin/plustrce.sql
SQL>
SQL> drop role plustrace;
drop role plustrace
*
ERROR at line 1:
ORA-01919: role 'PLUSTRACE' does not exist
SQL> create role plustrace;
Role created.
SQL>
SQL> grant select on v_$sesstat to plustrace;
Grant succeeded.
SQL> grant select on v_$statname to plustrace;
Grant succeeded.
SQL> grant select on v_$mystat to plustrace;
Grant succeeded.
SQL> grant plustrace to dba with admin option;
Grant succeeded.
SQL>
SQL> set echo off
SQL> grant plustrace to soe;
Grant succeeded.
SQL>
No comments:
Post a Comment