Posted on 2009-08-04 14:58
sailor 閱讀(186)
評論(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