DOYENSYS Knowledge Portal




We Welcome you to visit our DOYENSYS KNOWLEDGE PORTAL : Doyensys Knowledge Portal




Tuesday, April 25, 2017

Oracle database 12cR2 New Feature - SQLPlus enhancement


History
********

SQL*Plus can keep the history of the commands executed. You can enable or disable the HISTORY command

SQL> show history
history is OFF

SQL> set history on

SQL> select name from v$database;

NAME
---------
ORCL

SQL> select host_name from v$instance;

HOST_NAME
----------------------------------------------------------------
oracle12r2

SQL> history
  1  select name from v$database;
  2  select host_name from v$instance;

SQL> SHOW HIST
history is ON and set to "100"

SQL> HIST CLEAR

SQL> show history
history is ON and set to "100"

SQL> history
  1  show history

SQL> set history off


*********************************************************************************

Feedback
********


SQL> show feedback
FEEDBACK ON for 6 or more rows

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/orcl/orclpdb/system01.dbf
/u01/app/oracle/oradata/orcl/orclpdb/sysaux01.dbf
/u01/app/oracle/oradata/orcl/orclpdb/undotbs01.dbf
/u01/app/oracle/oradata/orcl/orclpdb/users01.dbf

SQL> set feedback only

SQL> select name from v$datafile;

4 rows selected.

****************************************************************************
Arraysize
********

SQL> set feedback only
SQL> select *  from emp1;

28672 rows selected.

SQL> show arraysize
arraysize 15

SQL> set timing on

SQL> select *  from emp1;

28672 rows selected.

Elapsed: 00:00:00.77

After increase the arraysize from 15 to 200


SQL> set arraysize 200

SQL> select *  from emp1;

28672 rows selected.

Elapsed: 00:00:00.41



No comments: