一次dg資料檔案及archive log遷移

peng163fj發表於2015-04-13

參考:http://blog.itpub.net/27181165/viewspace-775863/

主庫

檢視資料檔案所在位置及狀態
select d.name,t.name,d.status from v$datafile d,v$tablespace t where d.ts#=t.ts#;

將位置記下,進行cp操作

將表空間離線

alter tablespace oooxxx offline;

遷移

cp 舊 新

alter database rename file '/u01/old.dbf' to '/u02/new.dbf';

將表空間上線

備庫

切換為手工模式

recover managed standby database cancel

同上操作

重新切換回自動模式

alter database open read only

recover managed standby database

alter system set standby_file_management=AUTO

archilog 位置切換

主庫

alter system set log_archive_dest_1= 'location=/home/arch/ valid_for=(all_logfiles,all_roles)  db_unique_name=prod' scope=both;

備庫

alter system set log_archive_dest_1= 'location=/home/arch/ valid_for=(all_logfiles,all_roles)  db_unique_name=standby' scope=both;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/21302630/viewspace-1571530/,如需轉載,請註明出處,否則將追究法律責任。

相關文章