日本免费全黄少妇一区二区三区-高清无码一区二区三区四区-欧美中文字幕日韩在线观看-国产福利诱惑在线网站-国产中文字幕一区在线-亚洲欧美精品日韩一区-久久国产精品国产精品国产-国产精久久久久久一区二区三区-欧美亚洲国产精品久久久久

oracle全庫備份恢復詳細步驟 oracle數(shù)據(jù)庫備份與恢復( 二 )


Oracle 數(shù)據(jù)庫的恢復需要在 oracle 用戶下執(zhí)行 , 恢復內容包括控制文件*.ctl , 重組日志文件*.log,數(shù)據(jù)庫文件*.dbf 。

oracle全庫備份恢復詳細步驟 oracle數(shù)據(jù)庫備份與恢復


一、恢復 dbf 文件
前提條件是 Oracle 數(shù)據(jù)庫的初始化 spfile 文件 , 控制文件、重組日志文件、歸檔日志、備份都可以正常使用 。
現(xiàn)在先刪除 dbf 文件 。

oracle全庫備份恢復詳細步驟 oracle數(shù)據(jù)庫備份與恢復


1、關閉數(shù)據(jù)庫 , 再重新數(shù)據(jù)庫 , 進入數(shù)據(jù)庫
1.1 $ sqlplul / as sysdba
SQL>shutdown immediate(無法正常關閉 , 原因是沒有數(shù)據(jù)庫文件)

oracle全庫備份恢復詳細步驟 oracle數(shù)據(jù)庫備份與恢復


SQL>shutdown abort(強制關閉)

oracle全庫備份恢復詳細步驟 oracle數(shù)據(jù)庫備份與恢復


1.2 SQL>startup(無法正常啟動 , 原因是沒有數(shù)據(jù)庫文件)

oracle全庫備份恢復詳細步驟 oracle數(shù)據(jù)庫備份與恢復


1.3 恢復
$ rman target/

oracle全庫備份恢復詳細步驟 oracle數(shù)據(jù)庫備份與恢復


Oracle 數(shù)據(jù)庫沒有處于 open 狀態(tài) , 這是因為數(shù)據(jù)庫找不到數(shù)據(jù)文件 , 所以目前的數(shù)據(jù)庫處于 mount 狀態(tài) 。
1.3.1 還原文件
RMAN> restore database;

oracle全庫備份恢復詳細步驟 oracle數(shù)據(jù)庫備份與恢復


1.3.2 驗證
進入存放 dbf 文件的目錄查看 , dfb 文件已經被恢復 。

oracle全庫備份恢復詳細步驟 oracle數(shù)據(jù)庫備份與恢復


1.3.3 繼續(xù)恢復數(shù)據(jù)
RMAN> recover database;

oracle全庫備份恢復詳細步驟 oracle數(shù)據(jù)庫備份與恢復


1.3.4 打開數(shù)據(jù)庫的 open 狀態(tài)
RMAN> sql ‘alter database open’;

oracle全庫備份恢復詳細步驟 oracle數(shù)據(jù)庫備份與恢復


恢復完成 , 下面退出 oracle 數(shù)據(jù)庫的 rman 環(huán)境 , 重新進入數(shù)據(jù)庫 。
[oracle@shell ~]$ sqlplus / as sysdba

oracle全庫備份恢復詳細步驟 oracle數(shù)據(jù)庫備份與恢復


SQL> select instance_name,status from v$instance;

oracle全庫備份恢復詳細步驟 oracle數(shù)據(jù)庫備份與恢復


【oracle全庫備份恢復詳細步驟 oracle數(shù)據(jù)庫備份與恢復】 查看重做日志文件是否為原來的重做日志文件
SQL> archive log list;

oracle全庫備份恢復詳細步驟 oracle數(shù)據(jù)庫備份與恢復


由上圖顯示 , 數(shù)據(jù)庫的重做日志的序號沒有從 1 開始 , 證明還是原來的重做日志 。數(shù)據(jù)庫進行了完全恢復 。
恢復成功后 , 最好立刻備份數(shù)據(jù) 。

oracle全庫備份恢復詳細步驟 oracle數(shù)據(jù)庫備份與恢復



oracle全庫備份恢復詳細步驟 oracle數(shù)據(jù)庫備份與恢復


二、重做日志文件損壞的恢復
2.1 確定數(shù)據(jù)庫的備份狀態(tài)
必須是 oracle 用戶 , 執(zhí)行 rman target/

oracle全庫備份恢復詳細步驟 oracle數(shù)據(jù)庫備份與恢復


查看數(shù)據(jù)庫備份信息

oracle全庫備份恢復詳細步驟 oracle數(shù)據(jù)庫備份與恢復



oracle全庫備份恢復詳細步驟 oracle數(shù)據(jù)庫備份與恢復


2.2 刪除重做日志文件

推薦閱讀