[oracle@ora12c1~]$ sqlplus / as sysdba
SQL*Plus:Release 12.2.0.1.0 Production on Fri Mar 23 16:03:38 2018
Copyright(c) 1982, 2016, Oracle. All rightsreserved.
Connectedto:
OracleDatabase 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> history
SP2-1650: History is off, use "SET HIST[ORY] ON" to enableHistory.
SQL> set hist on
SQL>select 1+1 from dual;
1+1
----------
2
SQL>select 2+2 from dual;
2+2
----------
4
SQL>commit;
Commitcomplete.
SQL>rollback;
Rollbackcomplete.
SQL>select * from dual;
D
-
X
SQL> history
1 select 1+1 from dual;
2 select 2+2 from dual;
3 commit;
4 rollback;
5 select * from dual;
SQL> set hist off
SQL> history
SP2-1650: History is off, use"SET HIST[ORY] ON" to enable History.
SQL>