1.停主庫的數據傳輸
DGMGRL> show configuration;
Configuration - my_dg_cfg
Protection Mode: MaxAvailability
Databases:
mppay1 - Primary database
mppay2 - Physical standby database
edit configuration set protection mode as MaxPerformance;
edit database 'mppay1' set state='TRANSPORT-OFF';
edit database 'mppay1' set property LogXptMode ='ASYNC';
edit database 'mppay2' set property LogXptMode ='ASYNC';
show database 'mppay1'
2.檢查老機器DB情況
[oracle@mppay2 ~]$ sqlplus / as sysdba
SQL> select log_mode,open_mode,flashback_on from v$database;
LOG_MODE OPEN_MODE FLASHBACK_ON
------------ -------------------- ------------------
ARCHIVELOG READ ONLY WITH APPLY YES
SQL>
select substr(t.FILE_NAME,1,INSTR(t.FILE_NAME,'/',-1,1)) as file_path,count(1) as icount
from dba_data_files t group by substr(t.FILE_NAME,1,INSTR(t.FILE_NAME,'/',-1,1));
FILE_PATH ICOUNT
--------------------------------------------------------------------------------
/u02/oradata/MPPAYUAT/ 118
/u01/app/oracle/oradata/MPPAYUAT/ 5
SQL> show parameter recovery;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /u03/fra
db_recovery_file_dest_size big integer 400G
recovery_parallelism integer 0
#關閉DB
SQL> shutdown immediate;
3.清理老機器的歷史文件
#關閉DB前清理
RMAN> delete noprompt archivelog until time 'sysdate-1';
RMAN> delete backupset;
find /u01/app/oracle/admin/MPPAYUAT/adump/ -mtime +15 -name "*.*" -exec rm -Rf {} \;
find /u01/app/oracle/diag/rdbms/mppay2/MPPAYUAT/trace/ -mtime +15 -name "*.*" -exec rm -Rf {} \;
find /u01/app/oracle/diag/tnslsnr/mppay2/listener/alert/ -mtime +15 -name "*.*" -exec rm -Rf {} \;
echo "" > /u01/app/oracle/diag/tnslsnr/mppay2/listener/trace/listener.log
4.scp 從老機器複製到 新機器上
參考 scp -r /home/oracle/testscpdir oracle@10.0.102.177:/home/oracle/
scp -r /u02/oradata/MPPAYUAT oracle@10.0.102.177:/u02/oradata/
scp -r /u01/app/oracle/oradata/MPPAYUAT oracle@10.0.102.177:/u01/app/oracle/oradata/
scp -r /u03/fra/MPPAY2 oracle@10.0.102.177:/u03/fra/
scp -r /u01/app/oracle/product/11.2.0.4/dbhome_1/network/admin oracle@10.0.102.177:/u01/app/oracle/product/11.2.0.4/dbhome_1/network/
scp -r /u01/app/oracle/product/11.2.0.4/dbhome_1/dbs oracle@10.0.102.177:/u01/app/oracle/product/11.2.0.4/dbhome_1/
scp -r /u01/app/oracle/product/11.2.0/dbhome_1/shell oracle@10.0.102.177:/u01/app/oracle/product/11.2.0.4/dbhome_1/
scp -r /u01/app/oracle/diag oracle@10.0.102.177:/u01/app/oracle/
scp -r /u01/app/oracle/admin oracle@10.0.102.177:/u01/app/oracle/
新機器OS版本檢查
[oracle@mppay2 MPPAYUAT]$ cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
5.新機器上啟動數據庫
6.恢復數據傳輸
edit database 'mppay1' set state='TRANSPORT-ON';
edit database 'mppay2' set property LogXptMode ='SYNC';
edit database 'mppay1' set property LogXptMode ='SYNC';
edit configuration set protection mode as MaxAvailability;
show database 'mppay1';
show database 'mppay2';
show configuration;
网友评论