20200318-Oracle 12C新特性-History命令

在这里插入图片描述

在12c里,推出了History命令,类似Shell中的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.

过程如下:

[oracle@cjcos ~]$ sqlplus / as sysdba
SQL> hist
SP2-1650: History is off, use "SET HIST[ORY] ON" to enable History.

SQL> set hist on
SQL> show pdbs
SQL> select * from v$version;
SQL> select tablespace_name from dba_tablespaces;
SQL> alter session set container=cjcpdb01;
SQL> select * from tab;

SQL> hist
  1  show pdbs
  2  select * from v$version;
  3  select tablespace_name from dba_tablespaces;
  4  alter session set container=cjcpdb01;
  5  select * from tab;

重新执行第二条

SQL> hist 2 run

编辑第二条

SQL> hist 2 edit

欢迎关注我的微信公众号"IT小Chen"

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值