Posted on 2009-08-04 14:58
sailor 阅读(188)
评论(0) 编辑 收藏 所属分类:
oracle
1、恢复表里被删除的数据
今天不小心删除了oracle里的数据,且commit了。在网上查了下,可以把数据恢复到以前某个时间点。
insert into cd_access_right
select *
from (select *
from cd_access_right as of timestamp to_timestamp('2009-8-2 16:42:50', 'yyyy-mm-dd hh24:mi:ss'));
2、一次性插入多条SQL语句
1
insert into cd_access_right_role
2
(access_right_role_id,
3
create_user,
4
create_user_name,
5
create_time,
6
last_update_user,
7
last_update_user_name,
8
last_update_time,
9
org_id,
10
system_status,
11
record_version,
12
access_right_code)
13
select
14
cd_access_right_role_seq.nextval,
15
'admin',
16
'管理员',
17
to_date('2009-8-3 16:42:50', 'yyyy-mm-dd hh24:mi:ss'),
18
'admin',
19
'管理员',
20
to_date('2009-8-3 16:42:50', 'yyyy-mm-dd hh24:mi:ss'),
21
'001',
22
'0',
23
1,
24
access_right_code
25
from (
26
select
27
'M1' as access_right_code
28
from
29
dual
30
union
31
select
32
'M2' as access_right_code
33
from
34
dual
35
)
第14-23 要插入的常量;
第26-34 插入的动态变量
3、恢复被删除的表
FLASHBACK TABLE CD_USER TO BEFORE DROP