Method: 1. Use "select * from v$sqlarea t where t.SQL_table name like'...' order by..." statement to query the historical sql of the specified table; 2. Use " select * from v$sqlarea t where t.PARSING_SCHEMA_NAME in ('user name') AND SQL_table name like'...'" statement queries the user's historical sql for the table.
The operating environment of this tutorial: Windows 10 system, Oracle version 12c, Dell G3 computer.
oracle monitoring, you can view the executed SQL statements
SELECT SQL_TEXT, LAST_ACTIVE_TIME,SQL_FULLTEXT FROM v$sql ORDER BY LAST_ACTIVE_TIME DESCsql
In addition, Ctrl E in PL/SQL Developer can re-call historical SQL records. The history file is saved in AppData\Roaming\PLSQL Developer\PLSRecall.dat by default. If you clear the PLSRecall.dat file and press ctrl e, the following window interface will be brought up.
The example is as follows:
Example 1: Query the historical sql query for the TEST table
Example 2: Query the user TRUI pair Historical sql for updating the TEST table
##Extension
Query user TRUI for TEST after 2021/6/28 Historical sql for table deletion Recommended tutorial: "Oracle Video Tutorial"
The above is the detailed content of How to query historical sql in oracle. For more information, please follow other related articles on the PHP Chinese website!