免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5000 | 回复: 6
打印 上一主题 下一主题

[数据库] 一条flashback,闪回不了。 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-04-17 09:51 |只看该作者 |倒序浏览
我有一个表,是用bankuser 建立的,

SQL> select * from Item;

    ITEMNO ITEMNAME
---------- --------------------
         1 Beijing
         2 Shenzhen
         3 Shanghai

然后删除了第二行(Shenzhen 那行):

SQL> delete from Item where ITEMNO='2';

1 row deleted.

SQL> select * from Item;

    ITEMNO ITEMNAME
---------- --------------------
         1 Beijing
         3 Shanghai

SQL> commit;

Commit complete.

然后再开一个终端,用sysdba登录,想查询下闪回的语句:

SQL> show user
USER is "SYS"
SQL> select t.start_timestamp,
  2  t.commit_timestamp,
  3  t.logon_user,
  4  t.operation,
  5  t.table_name,
  6  t.table_owner,
  7  t.undo_sql
  8  from flashback_transaction_query   t  
  9  where table_name = 'item';

no rows selected


错误出现了, 为什么是no rows selected 啊?跟书上写的对不上啊?

请大师们指点

论坛徽章:
459
亥猪
日期:2014-05-31 12:08:03亥猪
日期:2014-05-31 12:07:38亥猪
日期:2014-05-31 12:08:04亥猪
日期:2014-05-31 12:07:43亥猪
日期:2014-05-31 12:07:52亥猪
日期:2014-05-31 12:08:09亥猪
日期:2014-05-31 12:07:51亥猪
日期:2014-05-31 12:08:02亥猪
日期:2014-05-31 12:07:59亥猪
日期:2014-05-31 12:07:37亥猪
日期:2014-05-31 12:07:50亥猪
日期:2014-05-31 12:07:39
2 [报告]
发表于 2014-04-17 14:42 |只看该作者
OK,please change the table name to 'ITEM'

论坛徽章:
459
亥猪
日期:2014-05-31 12:08:03亥猪
日期:2014-05-31 12:07:38亥猪
日期:2014-05-31 12:08:04亥猪
日期:2014-05-31 12:07:43亥猪
日期:2014-05-31 12:07:52亥猪
日期:2014-05-31 12:08:09亥猪
日期:2014-05-31 12:07:51亥猪
日期:2014-05-31 12:08:02亥猪
日期:2014-05-31 12:07:59亥猪
日期:2014-05-31 12:07:37亥猪
日期:2014-05-31 12:07:50亥猪
日期:2014-05-31 12:07:39
3 [报告]
发表于 2014-04-17 14:43 |只看该作者
then,query SQL as fellows:
SQL> select t.start_timestamp,
  2  t.commit_timestamp,
  3  t.logon_user,
  4  t.operation,
  5  t.table_name,
  6  t.table_owner,
  7  t.undo_sql
  8  from flashback_transaction_query   t  
  9  where table_name = 'ITEM';

论坛徽章:
7
天蝎座
日期:2013-08-16 23:19:32丑牛
日期:2014-01-08 09:20:14寅虎
日期:2014-01-11 11:03:44午马
日期:2014-04-28 11:02:40天秤座
日期:2014-05-16 23:24:24摩羯座
日期:2014-07-20 10:46:04卯兔
日期:2014-08-08 15:21:41
4 [报告]
发表于 2014-04-17 22:25 |只看该作者
语法不对

论坛徽章:
0
5 [报告]
发表于 2014-04-18 10:47 |只看该作者
回复 3# 2009532140


我改成了ITEM (大写) , 还是no rows selected, 改成 Item 也是不行,都是no rows selected

SQL> select t.start_timestamp,
  2  t.commit_timestamp,
  3  t.logon_user,
  4  t.table_name,
  5  t.table_owner,
  6  t.undo_sql
  7  from flashback_transaction_query   t
  8  where table_name = 'ITEM';

no rows selected

SQL> select t.start_timestamp,
  2  t.commit_timestamp,
  3  t.logon_user,
  4  t.table_name,
  5  t.table_owner,
  6  t.undo_sql
  7  from flashback_transaction_query   t
  8  where table_name = 'Item';

no rows selected

   

论坛徽章:
0
6 [报告]
发表于 2014-04-18 11:17 |只看该作者
这个好像是格式的问题, Item表(其中I是大写),不知道是不是影响了查询语句的结果,我重新在另一个表EMP上测试,

SQL>  select t.start_timestamp,
  2  t.undo_sql
  3  from flashback_transaction_query   t
  4  where table_name = 'EMP';

START_TIM
---------
UNDO_SQL
--------------------------------------------------------------------------------
18-APR-14

可以有值返回,但是UNDO_SQL怎么是空啊? 。。。 请大师们指点。

论坛徽章:
0
7 [报告]
发表于 2014-04-23 13:44 |只看该作者
table_name = 'item';  明显是需要大写ITEM,oracle字典中存放的都是大写
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP