rman備份常用命令

2021-09-20 20:39:43 字數 1318 閱讀 9804

rman  target  /  catalog  rman/rman;

使用恢復管理器執行backup、copy、restore或者switch命令時,恢復目錄自動進行更新,但是有關日誌與歸檔日誌資訊沒有自動記入恢復目錄。需要進行目錄同步。使用resync catalog命令進行同步。

rman>resync catalog;

建立恢復目錄

第一步,在目錄資料庫中建立恢復目錄所用表空間:

sql> create tablespace rman_ts datafile 'd:\oracle\oradata\rman\rman_ts.dbf' size 20m;

表空間已建立。

第二步,在目錄資料庫中建立rman 使用者並授權:

sql> create user rman identified by rman default tablespace rman_ts temporary tablespace temp quota unlimited on rman_ts;

使用者已建立。

sql> grant recovery_catalog_owner to rman ;

授權成功。

sql> grant connect, resource to rman ;

授權成功。

第三步,在目錄資料庫中建立恢復目錄

c:\>rman catalog rman/rman

恢復管理器:版本8.1.6.0.0 - production

rman-06008:連線到恢復目錄資料庫

rman-06428:未安裝恢復目錄

rman>create catalog tablespace rman_ts;

rman-06431:恢復目錄已建立

注意:雖然使用rman不一定必需恢復目錄,但是推薦使用。因為恢復目錄記載的資訊大部分可以通過控制檔案來記載,rman在恢復資料庫時使用這些資訊。不使用恢復目錄將會對備份恢復操作有限制。

建立或者取代指令碼:

rman> create script alloc_disk

rman> replace script rel_disk

rman> replace script backup_db_full

前兩個指令碼分別用來分配和**通道。

alloc_disk 指令碼還額外指定了備份片的最大兆位元組數,備份時可以同時開啟的輸入檔案的最大數目,以及每秒鐘讀每個輸入檔案的資料緩衝區的最大數目。

第三個指令碼呼叫先前儲存的兩個指令碼進行資料庫備份。

執行儲存指令碼的示範:

rman> run

注意:儲存的指令碼必須在命令中呼叫。

RMAN常用命令

連線到目標資料庫 不使用恢復目錄資料庫 rman target nocatalog 顯示rman配置 rman show all 報告目標資料庫的物理結構 rman report schema 報告陳舊備份 rman report obsolete 報告不可恢復的資料檔案 rman report u...

常用命令備份

1,rar e解壓縮命令.2,通過修改 etc gdm gdm.conf檔案來允許root直接登陸,在該檔案中,修改其中的allowroot false變成allowroot true重啟就可以了 3,軟體包管理器 sudo synaptic 4,更改源 sudo gedit etc apt sou...

Oracle RMAN 備份常用命令

1 show all 檢視所有設定項 configure retention policy to redundancy 1 default 備份保留策略為1份冗餘,default表示預設值 configure default device type to disk 備份介質是disk configu...