1.查詢操作表的歷史紀錄
select
*from v$sqlarea a
where a.sql_text like
'%表名稱%'
order
by first_load_time desc
;
2.從上面的記錄中找到update語句對應的sql_id
select
*from v$sqltext a,v$sqlarea b
where a.sql_id=b.sql_id and b.sql_id in
('23bpngg54gf2j'
)order
by b.last_active_time desc
;
3.從上面的記錄中找到最新的sql操作記錄,然後找到使用者名稱和主機
select
osuser as 客戶端作業系統的使用者名稱,
terminal as 客戶端執行的終端名,
machine as 客戶端的機器名,
program as 客戶端執行的程式名,
username,
last_active_time,
logon_time
from sys.v_$session l,sys.v_$sql s
where s.sql_id=
'b5sgbqgwjh39g'
and l.username is
notnull
order
by logon_time desc
oracle 查詢表的操作記錄
1,檢視某一時間的執行過的所有sql select t.sql text,t.first load time from v sqlarea t where t.first load time like 2019 01 28 order by t.first load time desc 2019 0...
ORACLE操作 查詢表
獲取表字段 select from user tab columns where table name 使用者表 order by column name 獲取表注釋 select from user tab comments where table name 使用者表 order by table...
Oracle查詢歷史操作記錄
1.以sysdba身份進入 2.show parameter audit 3.alter system set audit sys operations true scope spfile 4.alter system set audit trail db,extended scope spfile...