楼主: zh_mi

数据表中数据被删了,我怎么查谁干的?

[复制链接]
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
11#
发表于 2010-3-12 03:34 | 只看该作者
> 我就随口一说,黄版还真当会事
> 学习了

I also 学习了!

> 10g 貌似 不启动日志追加模式 是挖掘不到dml的  以前是这样理解的  看了黄版的test    明白了

I already posted the easiest, simplest, minimalist test case. If you all can test, I'd be glad to see what happens. There's one factor in my case that is not deterministic: IMU could be flushed at an unknown time. So more tests help.

Yong Huang

使用道具 举报

回复
论坛徽章:
5
ITPUB9周年纪念徽章
日期:2010-10-08 09:31:212011新春纪念徽章
日期:2011-02-18 11:43:36ITPUB十周年纪念徽章
日期:2011-11-01 16:25:51鲜花蛋
日期:2012-04-10 16:30:142013年新春福章
日期:2013-02-25 14:51:24
12#
发表于 2010-3-12 12:31 | 只看该作者
如果在10G里面使用ALTER DATABASE ADD SUPPLEMENTAL LOG DATA的话,那么归档日志的大小就要变大很多,能不能这么理解?

使用道具 举报

回复
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
13#
发表于 2010-3-13 03:25 | 只看该作者
原帖由 bigacer 于 2010-3-11 22:31 发表
如果在10G里面使用ALTER DATABASE ADD SUPPLEMENTAL LOG DATA的话,那么归档日志的大小就要变大很多,能不能这么理解?


I didn't measure it. Can you test? We'd love to have some test results. If you do, remember to tell us the exact Oracle version. Thanks.

Yong huang

使用道具 举报

回复
论坛徽章:
22
2010新春纪念徽章
日期:2010-03-01 11:08:33马上有对象
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有车
日期:2014-02-19 11:55:142012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:09
14#
发表于 2010-3-13 14:35 | 只看该作者
IMU 只会降低undo 文件的写频率以及写的内容大小,不会降低redo日志相关的的大小.

打开Supplemental log以后,,日志文件确实会增大,,我们这边对9i/10g的处理都会带来这个结果..

大概地解释如下:
打开supplemental log以后,,对应表的每条记录的变更,,都会包含其打开的相应字段(eg: primary key),而这对于那些没有打开supplement log的应用是不需要记录.. 我自己对此的理解就是打开Supplemental log以后, Oracle相当于帮你实现了一个完全基于redo的内部trigger. 并且这个Trigger并不会判断这变更如何处理的,,处理了多少字段,,也就是它的逻辑很简单,,就是多记录这几个打开Supplemental log的字段的内容到日志中..

[ 本帖最后由 jametong 于 2010-3-13 14:36 编辑 ]

使用道具 举报

回复
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
15#
发表于 2010-3-14 05:53 | 只看该作者
原帖由 jametong 于 2010-3-13 00:35 发表
IMU 只会降低undo 文件的写频率以及写的内容大小


It lowers the frequency of undo writes. But does it lower the amount of undo, in terms of bytes written? My test in 10.2.0.4 shows that it does not:

delete from test;
rollback;
select a.name, b.value from v$statname a, v$mystat b
where a.statistic#=b.statistic# and (name like '%undo%' or name like '%rollback%') and value>0
order by 1;

It's better to run the above twice and take the second set of values. Then
alter session set "_in_memory_undo" = false;
and run the above again.

My test shows that "rollback changes - undo records applied" increased by the same amount in the two runs. So did "undo change vector size".

Yong Huang

[ 本帖最后由 Yong Huang 于 2010-3-13 16:10 编辑 ]

使用道具 举报

回复
论坛徽章:
1
ITPUB十周年纪念徽章
日期:2011-11-01 16:21:15
16#
发表于 2010-3-14 10:26 | 只看该作者
Another place is listener log file, if someone choose to do some illegal things , he/she may choose off-peak hour ,  like weekend.  Based the timestamp, machine, os id , then can question he/she why logon at that moment.
This can not tell exact command executed, but can be a factor for a police case.
This did happen in my company.

使用道具 举报

回复
论坛徽章:
27
授权会员
日期:2005-10-30 17:05:33管理团队成员
日期:2011-05-07 01:45:082012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:36优秀写手
日期:2013-12-18 09:29:13马上有车
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14
17#
发表于 2010-3-15 23:42 | 只看该作者
Is it possible to dump the archive logs and find the client info?

使用道具 举报

回复
论坛徽章:
22
2010新春纪念徽章
日期:2010-03-01 11:08:33马上有对象
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有车
日期:2014-02-19 11:55:142012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:09
18#
发表于 2010-3-16 10:25 | 只看该作者
原帖由 eagle_fan 于 2010-3-15 23:42 发表
Is it possible to dump the archive logs and find the client info?


logmnr 或者dump log的时候,,有时有session_info,,,有时没有session_info,,client_info(dbms_application_info.set_client_info设置的那个)不会出现在日志中..

我自己也在工作中遇到过类似的需求,,实在没有其它办法的情况,,我会尝试使用Logmnr来分析log看是否能够找到蛛丝马迹.. 结论如上所述,,有时欢喜有时悲.

[ 本帖最后由 jametong 于 2010-3-16 10:26 编辑 ]

使用道具 举报

回复
论坛徽章:
27
授权会员
日期:2005-10-30 17:05:33管理团队成员
日期:2011-05-07 01:45:082012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:36优秀写手
日期:2013-12-18 09:29:13马上有车
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14
19#
发表于 2010-3-16 11:27 | 只看该作者
很早之前做过此类事情,因为没有记下来,原来的例子已经找不到了。记得当时是用的dump logfile

一点印象是是如果redo log中已经记录过某session number, serial  number的详细client information(包括username,machine name,client info,program name等等),下一次再记录时,只会记录session number, serial number

所以如果是长连接的话,可能除了sid, serial#外看不到其他的信息,不过可以到v$session中碰碰运气,也许该session还在
如果是短连接的话,看不到其他的信息,可以试着向前dump几个archive log,也许就可以找到client information

使用道具 举报

回复
论坛徽章:
27
授权会员
日期:2005-10-30 17:05:33管理团队成员
日期:2011-05-07 01:45:082012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:36优秀写手
日期:2013-12-18 09:29:13马上有车
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14
20#
发表于 2010-3-16 11:43 | 只看该作者
原帖由 jametong 于 2010-3-16 10:25 发表


logmnr 或者dump log的时候,,有时有session_info,,,有时没有session_info,,client_info(dbms_application_info.set_client_info设置的那个)不会出现在日志中..

我自己也在工作中遇到过类似的需求,,实在没有其它办法的情况,,我会尝试使用Logmnr来分析log看是否能够找到蛛丝马迹.. 结论如上所述,,有时欢喜有时悲.


记得看到有client info这一列,具体会不会记录倒没注意

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表