gdufo

 

rman 增量备份

rem run rman

rman target / cmdfile=G:\oracle\ msglog= e:/orabackup/full_rmanlog%date:~4,10%.log


run{
allocate channel c1 type disk;
backup
incremental level=0
format 'G:\inc0_%u_%T'
tag sun_inc0
database
plus archivelog delete input;
release channel c1;
}

run{
allocate channel c1 type disk;
backup
incremental level=2
format 'G:\inc2_%u_%T'
tag mon_inc2
database
plus archivelog delete input;
release channel c1;
}

run{
allocate channel c1 type disk;
backup
incremental level=2
format 'G:\inc2_%u_%T'
tag tue_inc2
database
plus archivelog delete input;
release channel c1;
}

run{
allocate channel c1 type disk;
backup
incremental level=1
format 'G:\inc1_%u_%T'
tag wed_inc1
database
plus archivelog delete input;
release channel c1;
}

run{
allocate channel c1 type disk;
backup
incremental level=2
format 'G:\inc2_%u_%T'
tag thu_inc2
database
plus archivelog delete input;
release channel c1;
}

run{
allocate channel c1 type disk;
backup
incremental level=2
format 'G:\inc2_%u_%T'
tag fri_inc2
database
plus archivelog delete input;
release channel c1;
}

run{
allocate channel c1 type disk;
backup
incremental level=2
format 'G:\inc2_%u_%T'
tag sat_inc2
database
plus archivelog delete input;
release channel c1;
}

run {
set archivelog destination to 'g:\';
restore archivelog sequence 16;
}

startup mount;

--如果是控制文件丢失
sql>startup nomount;
sql>
DECLARE
DEVTYPE VARCHAR2(256);
DONE BOOLEAN;
BEGIN
DEVTYPE:=DBMS_BACKUP_RESTORE.DEVICEALLOCATE(NULL);
DBMS_BACKUP_RESTORE.RESTORESETDATAFILE;
DBMS_BACKUP_RESTORE.RESTORECONTROLFILETO('G:\oracle\oradata\orcl\CONTROL01.CTL');
DBMS_BACKUP_RESTORE.RESTOREBACKUPPIECE('G:\CTRL_C-1231731297-20091202-03',DONE=>done);
DBMS_BACKUP_RESTORE.RESTORESETDATAFILE; DBMS_BACKUP_RESTORE.RESTORECONTROLFILETO('G:\oracle\oradata\orcl\CONTROL02.CTL');
DBMS_BACKUP_RESTORE.RESTOREBACKUPPIECE('G:\CTRL_C-1231731297-20091202-03',DONE=>done);
DBMS_BACKUP_RESTORE.RESTORESETDATAFILE; DBMS_BACKUP_RESTORE.RESTORECONTROLFILETO('G:\oracle\oradata\orcl\CONTROL03.CTL');
DBMS_BACKUP_RESTORE.RESTOREBACKUPPIECE('G:\CTRL_C-1231731297-20091202-03',DONE=>done);
DBMS_BACKUP_RESTORE.DEVICEDEALLOCATE(NULL);
END;
/
sql>alter database mount;

restore database;

posted on 2009-12-02 17:31 gdufo 阅读(512) 评论(0)  编辑  收藏 所属分类: Database (oracle, sqlser,MYSQL)

导航

统计

常用链接

留言簿(6)

随笔分类

随笔档案

文章分类

文章档案

收藏夹

Hibernate

友情链接

搜索

最新评论

阅读排行榜

评论排行榜