Oracle 12C 新特性之 sqlplus檢視History命令
12c裡,Oracle推出了 History 命令,這很像 Shell 中的 history ,減少了重敲 SQL ,帶來了很多便利。
1. 檢視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.
2. hist 語法
HIST[ORY] [N {RUN | EDIT | DEL[ETE]}] | [CLEAR]
3. hist 預設是關閉的,在每次會話斷開連線後會自動關閉,當hist關閉後,hist 列表會被清空。
SQL> history;
SP2-1650: History is off, use "SET HIST[ORY] ON" to enable History.
4. 開啟或者關閉hist
SQL> set hist on;
SQL> set hist off;
5.檢視hist狀態
SQL> show hist;
history is OFF
6.設定hist保留的記錄數 ,預設保留記錄數是 100
SQL>set history 3;
7. 檢視hist保留的記錄
SQL> hist list;
1 show con_name
2 show parameter version;
3 show hist;
說明:保留的記錄數 是按命令計算 而不是行數。
8. 執行指定記錄
SQL> hist;
1 select sysdate from dual;
2 show con_name
3 select date from dual;
SQL> hist 2 run;
CON_NAME
------------------------------
CDB$ROOT
9. 編輯之前的命令
hist 1 edit;
說明:可以像linux vi一樣操作,編輯保留後的記錄新增到記錄數末尾。
10. 刪除指定記錄數
hist 2 del
11.清空所有記錄數
SQL> hist clear;
1. 檢視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.
2. hist 語法
HIST[ORY] [N {RUN | EDIT | DEL[ETE]}] | [CLEAR]
3. hist 預設是關閉的,在每次會話斷開連線後會自動關閉,當hist關閉後,hist 列表會被清空。
SQL> history;
SP2-1650: History is off, use "SET HIST[ORY] ON" to enable History.
4. 開啟或者關閉hist
SQL> set hist on;
SQL> set hist off;
5.檢視hist狀態
SQL> show hist;
history is OFF
6.設定hist保留的記錄數 ,預設保留記錄數是 100
SQL>set history 3;
7. 檢視hist保留的記錄
SQL> hist list;
1 show con_name
2 show parameter version;
3 show hist;
說明:保留的記錄數 是按命令計算 而不是行數。
8. 執行指定記錄
SQL> hist;
1 select sysdate from dual;
2 show con_name
3 select date from dual;
SQL> hist 2 run;
CON_NAME
------------------------------
CDB$ROOT
9. 編輯之前的命令
hist 1 edit;
說明:可以像linux vi一樣操作,編輯保留後的記錄新增到記錄數末尾。
10. 刪除指定記錄數
hist 2 del
11.清空所有記錄數
SQL> hist clear;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31383567/viewspace-2139286/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 12C新特性-History命令Oracle
- Oracle 12C新特性In-MemoryOracle
- Oracle 12c 兩個新特性Oracle
- Oracle 12c新特性--ASMFD(ASM Filter Driver)特性OracleASMFilter
- Oracle 12c 新特性之臨時Undo--temp_undo_enabledOracle
- Oracle 12C新特性-RMAN恢復表Oracle
- Oracle 12c新特性---Rapid Home Provisioning (RHP)OracleAPI
- oracle系列(一)sqlplus命令OracleSQL
- Oracle 12C新特性-資料泵新引數(LOGTIME)Oracle
- 12c RMAN新特性之Recover Table
- oracle sqlplus 常用命令OracleSQL
- Oracle 12C新特性-資料泵新引數(VIEWS_AS_TABLES)OracleView
- Oracle常用檢視錶結構命令Oracle
- 【12c】12c RMAN新特性之recover table(表級別恢復)
- Oracle 12c 檢視CDB&PDBs資訊(SQL*PLUS)OracleSQL
- [20181014]12cR2 sqlplus新特性.txtSQL
- Oracle檢視執行計劃的命令Oracle
- Oracle 12C R2新特性-本地UNDO模式(LOCAL_UNDO_ENABLED)Oracle模式
- ORACLE 12C 優化器的一些新特性總結(二)Oracle優化
- ORACLE 12C 優化器的一些新特性總結(一)Oracle優化
- 如何在vsCode中檢視git historyVSCodeGit
- lockdown profile 12c之後的許可權控制新特性
- oracle 11g 新特性之動態繫結變數窺視(一)Oracle變數
- oracle 11g 新特性之動態繫結變數窺視(二)Oracle變數
- LightDB 22.4 新特性之相容Oracle sqluldr2OracleSQL
- V$ACTIVE_SESSION_HISTORY檢視的使用Session
- [20210119]sqlplus 12c LOBPREFETCH.txtSQL
- oracle SGA區基礎知識與檢視命令Oracle
- [20211214]檢視檢視V$ACTIVE_SESSION_HISTORY遇到奇怪問題.txtSession
- Oracle 12c新特性--LREG程式專門負責註冊例項服務Oracle
- Oracle 12C新特性-線上把非分割槽錶轉為分割槽表Oracle
- Oracle 18C新特性之PDB snapshot(快照) CarouselOracle
- oracle 21c 新特性之 CHECKSUM 分析函式Oracle函式
- LightDB 22.4 新特性之相容Oracle樹形查詢Oracle
- ORACLE 19c 新特性之混合分割槽表Oracle
- 【DBA】DBA_HIST_ACTIVE_SESS_HISTORY檢視用途
- 【12.2】Oracle 12C R2新特性-外部表支援分割槽了(Partitioning External Tables)Oracle
- [20181109]12c sqlplus rowprefetch引數5SQL
- [20190718]12c rman新特性 表恢復.txt