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

          導(dǎo)航

          統(tǒng)計(jì)

          常用鏈接

          留言簿(6)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          收藏夾

          Hibernate

          友情鏈接

          搜索

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 澄迈县| 花垣县| 浦县| 沅江市| 华亭县| 蕉岭县| 桐梓县| 弥渡县| 阜南县| 赫章县| 安龙县| 高雄市| 太仓市| 曲水县| 遂川县| 桑植县| 五莲县| 芦溪县| 尤溪县| 汝州市| 武穴市| 渝中区| 普陀区| 交城县| 新乡县| 民乐县| 东光县| 乡城县| 池州市| 阜宁县| 镇赉县| 遂川县| 惠安县| 东方市| 大悟县| 尉犁县| 德化县| 喀喇| 陈巴尔虎旗| 新昌县| 东安县|