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 閱讀(516) 評論(0)  編輯  收藏 所屬分類: Database (oracle, sqlser,MYSQL)

          導航

          統計

          常用鏈接

          留言簿(6)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          收藏夾

          Hibernate

          友情鏈接

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 页游| 江油市| 栖霞市| 农安县| 盐源县| 平原县| 城口县| 宝山区| 栖霞市| 廉江市| 五峰| 八宿县| 阿合奇县| 盐城市| 华亭县| 改则县| 图们市| 象州县| 珠海市| 淳安县| 昔阳县| 清原| 神农架林区| 镇巴县| 东平县| 德令哈市| 韶山市| 勃利县| 青川县| 乌拉特前旗| 洛川县| 勐海县| 新巴尔虎左旗| 密山市| 资源县| 称多县| 南皮县| 嘉定区| 鄂托克旗| 禹城市| 新建县|