<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Decode360's Blog

    業(yè)精于勤而荒于嬉 QQ:150355677 MSN:decode360@hotmail.com

      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 ::  :: 管理 ::
      302 隨筆 :: 26 文章 :: 82 評論 :: 0 Trackbacks
    RMAN常用設置
    ?
    ?
    1、打開和關閉數(shù)據(jù)庫:
    ?
    基礎知識回顧:
    Oracle的啟動過程分為三個階段:
    啟動數(shù)據(jù)庫實例:讀取定義啟動參數(shù)的文件、分配SGA區(qū)、啟動后臺進程
    加載數(shù)據(jù)庫文件:讀取參數(shù)文件指定的控制文件、將數(shù)據(jù)庫文件與已啟動實例關聯(lián)
    打開數(shù)據(jù)庫:打開聯(lián)機數(shù)據(jù)文件、日志文件
    數(shù)據(jù)庫啟動可分為:
    startup:正常方式啟動實例、加載數(shù)據(jù)庫文件、打開數(shù)據(jù)庫
    startup force:強制打開數(shù)據(jù)庫
    startup mount:只啟動實例,不打開數(shù)據(jù)庫(用于切換模式、恢復數(shù)據(jù)等)
    alter database open:startup mount后打開數(shù)據(jù)庫
    數(shù)據(jù)庫關閉可分為:
    shutdown normal:正常關閉,必須等所有用戶退出后才關閉
    shutdown immediate:立即關閉,所有正在處理的事務回退
    shutdown abort:異常關閉,馬上關閉數(shù)據(jù)庫,但不對事務進行處理
    ?
    ?
    由于備份一般需要在關閉數(shù)據(jù)庫的情況下操作,所以RMAN具有直接打開和關閉數(shù)據(jù)庫的功能。
    所有操作指令與sqlplus下的命令完全相同。
    ?
    ?
    ?
    2、常用命令
    ?
    要使用操作系統(tǒng)命令:
    ?
    RMAN> host;
    ?
    Microsoft Windows XP [版本 5.1.2600]
    (C) 版權所有 1985-2001 Microsoft Corp.
    ?
    C:\Documents and Settings\wangxiaoqi>
    ?
    與SqlPlus中不同的是,RMAN中host后面必須加“;”
    ?
    ② 使用SQL命令:
    ?
    RMAN> SQL 'ALTER SYSTEM ARCHIVE LOG ALL';
    ?
    但是使用SQL命令的限制比較多,主要是針對數(shù)據(jù)庫級的操作,很多的SQL語句都是無法使用的
    因此最好的方法是:
    ?
    RMAN> host;
    ?
    Microsoft Windows XP [版本 5.1.2600]
    (C) 版權所有 1985-2001 Microsoft Corp.
    ?
    C:\Documents and Settings\wangxiaoqi>sqlplus wangxiaoqi/wangxiaoqi
    ?
    SQL*Plus: Release 9.2.0.1.0 - Production on Thu Sep 18 14:30:03 2008
    ?
    Copyright (c) 1982, 2002, Oracle Corporation.? All rights reserved.
    ?

    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - Production
    ?
    SQL>
    ?
    ?
    3、 首先列出所有指標:
    ?
    RMAN> show all;
    using target database controlfile instead of recovery catalog
    RMAN configuration parameters are:
    CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
    CONFIGURE BACKUP OPTIMIZATION OFF; # default
    CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
    CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
    CONFIGURE DEVICE TYPE DISK PARALLELISM 1; # default
    CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE MAXSETSIZE TO UNLIMITED; # default
    CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\ORACLE\ORA92\DATABASE\SNCFDODO.ORA';# default
    ?
    ?
    4、 配置自動通道數(shù):
    ?
    RMAN> show device type;
    ?
    RMAN configuration parameters are:
    CONFIGURE DEVICE TYPE DISK PARALLELISM 1; # default

    RMAN> configure device type disk parallelism 2;
    ?
    new RMAN configuration parameters:
    CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
    new RMAN configuration parameters are successfully stored
    starting full resync of recovery catalog
    full resync complete
    ?
    RMAN>?show device type;
    ?
    RMAN configuration parameters are:
    CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
    ?
    若要清除對通道數(shù)的設置:
    ?
    RMAN> configure device type disk clear;
    ?
    old RMAN configuration parameters:
    CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
    RMAN configuration parameters are successfully reset to default value
    starting full resync of recovery catalog
    full resync complete
    ?
    5、制定自動通道默認設備:
    ?
    RMAN> show default device type;
    ?
    RMAN configuration parameters are:
    CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
    ?
    RMAN> configure default device type to sbt; --磁帶備份
    ?
    new RMAN configuration parameters:
    CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
    new RMAN configuration parameters are successfully stored
    starting full resync of recovery catalog
    full resync complete
    ?
    RMAN> configure default device type clear;? --還原默認設置
    ?
    old RMAN configuration parameters:
    CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
    RMAN configuration parameters are successfully reset to default value
    starting full resync of recovery catalog
    full resync complete
    ?
    6、配置磁盤:
    ?
    RMAN> show channel;
    ?
    RMAN configuration parameters are:
    RMAN configuration has no stored or default parameters
    ?
    RMAN> configure channel device type disk format 'D:\oracle\oradata\dodo\rmanback\ora_%t_%s_%p';
    ?
    new RMAN configuration parameters:
    CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT?? 'D:\oracle\oradata\dodo\rmanback\ora_%t_%s_%p';
    new RMAN configuration parameters are successfully stored
    starting full resync of recovery catalog
    full resync complete
    ?
    RMAN>? configure channel 2 device type disk format 'D:\oracle\oradata\dodo\rmanback\ora_%t_%s_%p';
    ?
    new RMAN configuration parameters:
    CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT?? 'D:\oracle\oradata\dodo\rmanback\ora_%t_%s_%p';
    new RMAN configuration parameters are successfully stored
    starting full resync of recovery catalog
    full resync complete
    ?
    RMAN> show channel;
    ?
    RMAN configuration parameters are:
    CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT?? 'D:\oracle\oradata\dodo\rmanback\ora_%t_%s_%p';
    CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT?? 'D:\oracle\oradata\dodo\rmanback\ora_%t_%s_%p';
    ?
    注:%t代替時間戳;%s代替?zhèn)浞萁M號;%p代替?zhèn)浞萜?/font>
    ?
    取消:
    RMAN> configure channel 2 device type disk clear;
    ?
    old RMAN configuration parameters:
    CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT?? 'D:\oracle\oradata\dodo\rmanback\ora_%t_%s_%p';
    old RMAN configuration parameters are successfully deleted
    starting full resync of recovery catalog
    full resync complete
    ?
    7、控制文件配置:
    ?
    啟動控制文件的自動備份:
    ?
    RMAN> configure controlfile autobackup on;
    ?
    new RMAN configuration parameters:
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    new RMAN configuration parameters are successfully stored
    starting full resync of recovery catalog
    full resync complete
    ?
    RMAN> show controlfile autobackup;
    ?
    RMAN configuration parameters are:
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    ?
    設置控制文件、服務器參數(shù)文件備份文件格式路徑:
    ?
    RMAN> configure controlfile autobackup format for device type disk to 'D:\oracle
    \oradata\dodo\rmanback\ctl_%F';? --F必須大寫
    ?
    new RMAN configuration parameters:
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'D:\oracle\orada
    ta\dodo\rmanback\ctl_%F';
    new RMAN configuration parameters are successfully stored
    starting full resync of recovery catalog
    full resync complete
    ?
    ?
    ?
    8、保存策略:
    ?
    保存策略分兩種
    ?
    時間策略:決定至少有一個備份能恢復到指定的日期
    ?
    RMAN> configure retention policy to recovery window of 3 days;
    ?
    new RMAN configuration parameters:
    CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 3 DAYS;
    new RMAN configuration parameters are successfully stored
    starting full resync of recovery catalog
    full resync complete
    注:保證至少有一個備份能恢復到3天前的時間點上,之前備份標注為obsolete
    ?
    冗余策略:決定至少有幾個冗余的備份:
    RMAN> configure retention policy to redundancy 3;
    ?
    old RMAN configuration parameters:
    CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 3 DAYS;
    new RMAN configuration parameters:
    CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
    new RMAN configuration parameters are successfully stored
    starting full resync of recovery catalog
    full resync complete
    注:至少需要有3個冗余備份,若多于3個,則以前備份標記為obsolete
    ?
    RMAN> show retention policy
    ?
    RMAN configuration parameters are:
    CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
    ?
    ?




    -The End-

    posted on 2008-09-12 20:26 decode360-3 閱讀(246) 評論(0)  編輯  收藏 所屬分類: Oracle
    主站蜘蛛池模板: 亚洲午夜精品国产电影在线观看| 99久久99热精品免费观看国产| 亚洲另类精品xxxx人妖| 亚洲精品无码激情AV| 成年在线观看免费人视频草莓| 免费无码作爱视频| 色屁屁www影院免费观看视频| 亚洲人精品亚洲人成在线| 亚洲人成在线观看| 亚洲精品蜜桃久久久久久| 伊在人亚洲香蕉精品区麻豆| 妞干网免费观看视频| 国内精品免费麻豆网站91麻豆 | 毛片免费全部播放无码| 国产伦精品一区二区免费| 久久亚洲精品无码av| 国产亚洲福利在线视频| 亚洲丝袜中文字幕| 亚洲男人电影天堂| 亚洲三级电影网站| 久久久久久亚洲精品成人| 久久亚洲精品成人| 亚洲第一AAAAA片| 亚洲国产精品乱码一区二区| 国产亚洲精久久久久久无码AV| 亚洲午夜成人精品电影在线观看| 国产免费av片在线无码免费看| 国产成人精品免费直播| 日韩在线视频免费看| 永久免费bbbbbb视频| 国产精品高清全国免费观看| 日本牲交大片免费观看| 国产极品粉嫩泬免费观看| 国产午夜无码视频免费网站| 国产免费啪嗒啪嗒视频看看| 国产精品国产免费无码专区不卡 | 亚洲成人中文字幕| 亚洲综合婷婷久久| 亚洲精品在线视频观看| 亚洲精品中文字幕无乱码麻豆| 亚洲AV无码精品蜜桃|