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

          友情鏈接

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 东平县| 昔阳县| 永丰县| 三江| 延边| 五家渠市| 元氏县| 江达县| 无棣县| 宝清县| 陕西省| 平乡县| 定结县| 荃湾区| 岳西县| 夏邑县| 建宁县| 江门市| 商河县| 常山县| 霸州市| 漠河县| 宜兰县| 红原县| 通化县| 门头沟区| 江城| 梅州市| 旌德县| 民乐县| 峡江县| 新晃| 鸡西市| 肇庆市| 黑龙江省| 石首市| 靖西县| 泰安市| 四子王旗| 嵊州市| 平潭县|