Oracle Database 26ai will be available on generic Linux platforms in January and soon on AIX and Windows
CDB Warning
Thus script used to create the autotrace role can not be run in CDB$ROOT only within a PDB.
-- the fact that this role can not be created in CDB$ROOT is poor form by essentially any definition. I reported it during Beta 2 and it was not fixed.
Create PLUSTRACE Role
sqlplus sys@pdbdev as sysdba
SQL> @?/sqlplus/admin/plustrce.sql
SQL> drop role plustrace;
*
ORA-01919: role 'PLUSTRACE' does not exist
SQL> create role plustrace;
Role created.
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
Grant PLUSTRACE Role
GRANT plustrace TO <user_name>;
SQL> conn sys@pdbdev as sysdba -- connect as SYS to the pdbdev PDB
SQL> GRANT plustrace TO uwclass;
Syntax and Demos
Syntax
SET AUTOT[RACE] {OFF | ON | TRACE[ONLY]} [EXP[LAIN]] [STAT[ISTICS]]
Trace and Run
SQL> conn uwclass@pdbdev
Enter password:
set autotrace on
SELECT * FROM dual;
D
-
X
Execution Plan
----------------------------------------------------------
Plan hash value: 272002086