Oracle 12.2 New Feature: SQL*Plus History

on 1:17 PM

SQL*Plus History is not enabled by default we need to enable it

Sql > set hist on


We can check the history is enable or not by using the below command :


Sql > show history

history is ON and set to "100"

Note :  The default length of the history is 100.


To change the length of the history we can use :


Sql > set hist 50


Check the History :


Sql > history

2 show history
3 select tablespace_name from dba_tablspaces;
4 select host_name from v$instance;


To run a command from the history use the history run command


Sql > hist 4 run

Host_Name

-----------------
mahameed

Help History :

SQL> help history
HISTORY
-------
Stores, lists, executes, edits of the commands
entered during the current SQL*Plus session.
 HIST[ORY] [N {RUN | EDIT | DEL[ETE]}] | [CLEAR]
N is the entry number listed in the history list.
Use this number to recall, edit or delete the command.
 Example:
HIST 3 RUN - will run the 3rd entry from the list.
HIST[ORY] without any option will list all entries in the list.

0 comments:

Post a Comment