Oracle Autotrace
Version 12.1.0.2

General Information
Library Note Morgan's Library Page Footer
The Library is currently in the process of being upgraded from Oracle Database Version 11.2.0.3 to 12.1.0.1. Demos are being upgraded to reflect the new Container paradigm as well as EBR (Edition Based Redefinition) and may contain references to CDBs, PDBs, and other objects you may not be familiar with such as CDB_OBJECTS_AE: Welcome to 12c.
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 conn sys@pdborcl as SYSDBA

SQL> @?/sqlplus/admin/plustrce.sql
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
Class Setup
DBMS_XPLAN
Explain Plan
Roles
Trace and TKPROF

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-2014 Daniel A. Morgan All Rights Reserved