易截截图软件、单文件、免安装、纯绿色、仅160KB

oracle 恢复表到以前的某个状态

 select * from sys.smon_scn_time;
--scn 与时间的对应关系
每隔5分钟,系统产生一次系统时间标记与scn的匹配并存入sys.smon_scn_time表。
select * from student as of scn 592258
就可以看到在这个检查点的表的历史情况。
然后我们恢复到这个检查点
insert into student  select * from student as of scn 592258  where id not in (select id from student) 
  select * from v$transaction ---没有提交的事务。
  select * from flashback_transaction_query; ---回滚事务。 他有一列是    undo_sql 得到他就可以回滚刚才提交的事务。
select * from FLASHBACK_TRANSACTION_QUERY a 
where a.start_timestamp between to_date('2008-12-7 14:40:56','yyyy-MM-dd HH24:mi:ss') and
to_date('2008-12-7 14:59:56','yyyy-MM-dd HH24:mi:ss');
  不论是insert  delete  update 都可以把committ 了的事务给回滚了。


相关文档:

ORACLE Top/Bottom N、First/Last、NTile

目录
==================================================================
1.带空值的排列
2.Top/Bottom N查询
3.First/Last排名查询
4.按层次查询
一、带空值的排列:
假如被排列的数据中含有空值呢?
SQL> select region_id, customer_id,
   2         ......

ORACLE 外键约束修改行为

Oracle的外键用来限制子表中参考的字段的值,必须在主表中存在。而且在主表的记录发生变化导致外键参考唯一约束值发生了变化时,定义了一系列的动作。
在SQL92标准中定义了几种外键改变后,如何处理子表记录的动作,其中包括:
限制Restrict:这种方式不允许对被参考的记录的键值执行更新或删除的操作;
置为空Set to nu ......

Oracle所有版本汇总

找到一个介绍oracle版本的文章。
http://wapedia.mobi/en/Oracle_Database#3. 
■1979: Larry Ellison and friends founded Software Development Laboratories. 
■1979: SDL changed its company-name to "Relational Software, Inc." (RSI) and introduced its product Oracle V2 as an early commercially ......

SQL语言基础考核(二)(oracle)

 2.根据Oracle 数据库scott 模式下的emp 表和dept 表,完成下列操作:
      (1) 查询20号部门的所有员工信息;
      (2) 查询所有工种为CLERK 的员工的员工号、员工名和部门号;
      (3) 查询奖金COMM 高于工资SAL 的员工信息;
  ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号