Oracle Autotrace
Version 19.3

General Information
Library Note Morgan's Library Page Header
Which has the higher priority in your organization: Deploying a new database or securing the ones you already have? Looking for a website, and resources, dedicated solely to securing Oracle databases? Check out DBSecWorx.
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 SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jul 15 10:44:24 2019
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle. All rights reserved.

Enter user-name: sys@pdbdev as sysdba

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> @?/sqlplus/admin/plustrce.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> 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> 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> uwclass/uwclass@pdbdev

SQL> set autotrace on

SQL> SELECT * FROM dual;
Trace Only SQL> uwclass/uwclass@pdbdev

SQL> set autotrace traceonly

SQL> SELECT * FROM dual;
Trace and Explain SQL> uwclass/uwclass@pdbdev

SQL> set autotrace traceonly explain

SQL> SELECT * FROM dual;
Trace and Statistics SQL> uwclass/uwclass@pdbdev

SQL> set autotrace traceonly statistics

SQL> SELECT * FROM dual;
Stop Tracing SET AUTOTRACE OFF
SQL> uwclass/uwclass@pdbdev

SQL> set autotrace off

Related Topics
Built-in Functions
Built-in Packages
Class Setup
DBMS_XPLAN
Explain Plan
Roles
Trace and TKPROF
What's New In 18c
What's New In 19c

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2019 Daniel A. Morgan All Rights Reserved
  DBSecWorx