3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

テーブルの更新履歴を確認する方法

Last updated at Posted at 2018-11-07

〇更新履歴を見る方法
select * from all_tab_modifications where table_owner = '※スキーマ名'
例)
image.png
TABLE_OWNER TABLE_NAME PARTITION_NAME SUBPARTITION_NAME INSERTS UPDATES DELETES TIMESTAMP TRUNCATED DROP_SEGMENTS
TRPG TEST_TABLE 3 2 0 18-11-08 NO 0

〇更新されたレコードを確認する
SELECT SCN_TO_TIMESTAMP(ora_rowscn),A.* from test_table A order by SCN_TO_TIMESTAMP(ora_rowscn) desc
SCN_TO_TIMESTAMP(ORA_ROWSCN) ID NAME VALUE
image.png
18-11-08 06:26:34.000000000 0000000004 岩手 4
18-11-08 06:20:39.000000000 0000000002 青森 2
18-11-08 06:20:39.000000000 0000000003 秋田 4
18-11-08 06:20:39.000000000 0000000001 北海道 1

〇更新履歴をリセットする方法
--監視情報をリセットするSQLのためリスクあり
--DBシャットダウンしないとリセットされない模様
exec dbms_stats.flush_database_monitoring_info

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?