Oracle EBS 複製之資料庫複製

來源:互聯網
上載者:User

目標:從生產資料庫PROD複製資料庫到測試資料庫TEST
 
環境:PROD/TEST資料庫已存在,PROD資料檔案在磁帶中;
 
一、編輯TEST資料庫pfile檔案;
 
刪除TEST資料庫所有資料檔案
 
su - oratest
 
cd /t02/oratest/testdata
 
rm *
 
編輯TEST資料庫啟動參數檔案
 
cd $Oracle_HOME/dbs
 
vi initTEST.ora
 
將db_name=TEST修改為db_name=PROD
 
新增一下設定
 
log_archive_format=PROD_%T%TS%S.arc(歸檔檔案,預設路徑為$ORACLE/HOME/dbs/arch)
 
 
 
二、建立資料庫檔案link
 
TEST環境和PROD環境的資料庫檔案地點不一致,使用RMAN恢複資料庫時需要繁瑣的把每個檔案都制定到新地點。簡化操作步驟,建立一個目錄連結,讓RMAN認為恢複到原來的PORD目錄;
 
su - oratest
 
mkdir /u01/oraprod
 
cd /u01/oraprod
 
ln -s /t02/oratest/testdata prodata (testdata連結到prodata)
 
ls -al 查看連結
 
 
 
三、恢複controlfile
 
將PROC資料庫controlfile檔案拷至/tmp目錄
 
cd /tmp
 
ftp -i 172.16.*.*
 
cd /u01/oraprod/prodata
 
get cntrl01.dbf
 
啟動資料庫到nomount狀態
 
export ORACLE_SID=TEST
 
sqlplus /nolog
 
conn / as sysdba
 
startup nomount
 
複製控制檔案(RMAN DB恢複工具)
 
rman target / nocatalog
 
RMAN>run{
 
        allocate channel t1 type disk;
 
        replicate controlfile from '/tmp/cntrl01.dbf';
 
        release channel t1;
 
        }
 
此時會在pfile指引的目錄和名字下建立三個controlfile檔案;
 
 
 
四、啟動資料庫到mount狀態
 
su - oratest
 
export ORACLE_SID=TEST
 
sqlplus /nolog
 
conn / as sysdba
 
alter database mount 

  • 1
  • 2
  • 下一頁

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.