要求:本地已有生產(chǎn)數(shù)據(jù)庫(kù)prod,制定rman備份策略,將數(shù)據(jù)備份到制定目錄/oracle/rman_bk下?,F(xiàn)在需要做恢復(fù)測(cè)試,驗(yàn)證備份出來(lái)的數(shù)據(jù)是有效的。且不影響原有的生產(chǎn)數(shù)據(jù)庫(kù)prod。
創(chuàng)新互聯(lián)建站主營(yíng)鎮(zhèn)海網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營(yíng)網(wǎng)站建設(shè)方案,成都app軟件開(kāi)發(fā),鎮(zhèn)海h5成都小程序開(kāi)發(fā)搭建,鎮(zhèn)海網(wǎng)站營(yíng)銷(xiāo)推廣歡迎鎮(zhèn)海等地區(qū)企業(yè)咨詢
解決思路:在備份出來(lái)的數(shù)據(jù)中(控制文件),包含了數(shù)據(jù)庫(kù)名,數(shù)據(jù)文件,redo log等文件的存放路徑,如果在本地直接做恢復(fù),將和原有的數(shù)據(jù)庫(kù)****,因此,需要修改這些信息,將備份出來(lái)的數(shù)據(jù)恢復(fù)到另外一個(gè)數(shù)據(jù)庫(kù)中。具體步驟如下:
創(chuàng)建新數(shù)據(jù)庫(kù)數(shù)據(jù)文件及跟蹤文件存放目錄
-bash-2.05b$mkdir -p /oracle/oradata/test
-bash-2.05b$mkdir -p /oracle/admin/test/bdump
-bash-2.05b$mkdir -p /oracle/admin/test/udump
-bash-2.05b$mkdir -p /oracle/admin/test/cdump
2.登錄到生產(chǎn)數(shù)據(jù)庫(kù)。查看當(dāng)前數(shù)據(jù)文件信息:
-bash-2.05b$ sqlplus '/ as sysdba'
SQL select file#,name from v$datafile;
FILE# NAME
---------- --------------------------------------------------
1 /oracle/oradata/test/system01.dbf
2 /oracle/oradata/test/undo01.dbf
3 /oracle/oradata/test/users01.dbf
3.利用rman更改數(shù)據(jù)文件存放路徑并restore到新的路徑
run {
set newname for datafile 1 to ?'/oracle/oradata/test/system01.dbf';
set newname for datafile 2 to ?'/oracle/oradata/test/undo01.dbf';
set newname for datafile 3 to ?'/oracle/oradata/test/users01.dbf';
restore datafile 1;
restore datafile 2;
restore datafile 3;
}
4。重建控制文件
CREATE CONTROLFILE REUSE set DATABASE "test" RESETLOGS ?ARCHIVELOG
-- ?SET STANDBY TO MAXIMIZE PERFORMANCE
MAXLOGFILES 16
MAXLOGMEMBERS 2
MAXDATAFILES 30
MAXINSTANCES 1
MAXLOGHISTORY 453
LOGFILE
GROUP 1 '/oracle/oradata/test/redo01.log' ?SIZE 10M,
GROUP 2 '/oracle/oradata/test/redo02.log' ?SIZE 10M,
GROUP 3 '/oracle/oradata/test/redo03.log' ?SIZE 10M
-- STANDBY LOGFILE
DATAFILE
'/oracle/oradata/test/system01.dbf',
'/oracle/oradata/test/undo01.dbf',
'/oracle/oradata/test/users01.dbf'
CHARACTER SET ZHS16GBK
;
5.打開(kāi)數(shù)據(jù)庫(kù)
SQL alter database open resetlogs;
backup archivelog all delete input format '/rman/rman_%t_%s_%p.arc';
with a as
(select rownum p from dual connect by level=21)
select
7 + CEIL(
(7 + CEIL(
(7 + CEIL(p/3))
/3))
/3)
from a;
7+CEIL((7+CEIL((7+CEIL(p/3))/3))/3
本答案來(lái)自于互聯(lián)網(wǎng),僅供參考學(xué)習(xí)作用
如果您對(duì)我的回答有不滿意的地方,還請(qǐng)您繼續(xù)追問(wèn);
答題不易,互相理解,互相幫助!
備份方法如下:
1)取消Oracle DB的歸檔模式:
startup mount;
alter database noarchivelog;
archive log stop;
2)手動(dòng)添加數(shù)據(jù)庫(kù)名/SID 等, 或者從 $Ora_home\network\admin\tnsnames.ora中讀取.
3)System/sys 的密碼是你安裝數(shù)據(jù)庫(kù)時(shí)候的密碼,當(dāng)然也可以自己建一個(gè)User ;
另外可以使用ORACLE的策略通過(guò)RMAN將歸檔日志定期備份并刪除
veritas 沒(méi)用過(guò),不談。如果僅僅是想備份SAP系統(tǒng)的話,BRTOOLS足以,你想備的都可以。