ALTER SESSION SET optimizer_dynamic_sampling : Session Variables « SQL PLUS Session Environment « Oracle PL/SQL Tutorial






SQL>
SQL> ALTER SESSION SET optimizer_dynamic_sampling = 0;

Session altered.

SQL>
SQL>
SQL> CREATE TABLE myTable AS SELECT * FROM all_objects;

Table created.

SQL>
SQL>
SQL> CREATE TABLE myTable2 AS SELECT object_id, object_name FROM myTable;

Table created.

SQL>
SQL> ALTER TABLE myTable2 ADD object_application VARCHAR2(12);

Table altered.

SQL>
SQL> UPDATE myTable2 SET object_application = 'WORKSHOP';

12597 rows updated.

SQL>
SQL> COMMIT;

Commit complete.

SQL>
SQL> SET AUTOTRACE TRACEONLY EXPLAIN;
SQL>
SQL>
SQL> ALTER SESSION SET optimizer_dynamic_sampling = 1;

Session altered.

SQL>
SQL>
SQL> SET AUTOTRACE OFF;
SQL>
SQL> DROP TABLE myTable2;

Table dropped.

SQL>
SQL> DROP TABLE myTable;

Table dropped.

SQL>








29.62.Session Variables
29.62.1.ALTER SESSION SET SQL_TRACE = TRUE
29.62.2.ALTER SESSION SET optimizer_dynamic_sampling
29.62.3.alter session set NLS_DATE_FORMAT='DD-MM-YYYY'
29.62.4.alter session set hash_area_size
29.62.5.alter session set sort_area_size = 102400000
29.62.6.alter session set workarea_size_policy=manual
29.62.7.alter system flush shared_pool
29.62.8.alter system quiesce restricted
29.62.9.alter system resume
29.62.10.alter system suspend