Oracle rman duplicate遷移測試
說明
資料庫為 12.2.0.1.0RAC 環境,目標升級為 12.2.0.1.11 環境,作業系統為 RHEL6.6 ,
原環境:
資料庫模式 |
RAC |
IP 地址分配 |
|
32BIT/64BIT |
64 bit |
作業系統版本 |
RHEL5.3 |
ORACLE 版本 |
12.2.0.1 |
ORACLE_SID |
|
目標環境:
資料庫模式 |
RAC |
IP 地址分配 |
|
32BIT/64BIT |
64 bit |
作業系統版本 |
RHEL6.6 |
ORACLE 版本 |
12.2.0.1 |
ORACLE_SID |
|
前期輔助例項安裝
前提:裝好資料庫軟體,不建立資料庫,且有 oracle 使用者,首先建立輔助例項
為輔助例項建立密碼檔案
直接從原生產複製密碼檔案至複製庫端
建立必要的目錄
[oracle@node2 admin]$ mkdir -p /oracle/app/admin/ora11g/adump
[oracle@node2 admin]$ mkdir -p /oracle/app/oradata/ora11g/
配置靜態監聽
[oracle@node2 admin]$ vi listener.ora
(GLOBAL_DBNAME = woo.com)
# listener.ora Network Configuration File: /oracle/app/product/11.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = jason)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = orcl)
(ORACLE_HOME = /oracle/app/product/12.2.0/db_1)
(GLOBAL_DBNAME = orcl)
)
)
配置所有節點 tnsname 資訊如下 :
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.210.69)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
orcldg =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.210.96)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
建立輔助例項的初始化引數檔案
將在原生產上建立的 pfile 複製到複製庫,引數和原生產庫保持一致,並啟動到 nomount 狀態
生產端產生 pfile
SQL> create pfile='/tmp/upgrade/initora11g.ora' from spfile;
File created.
將引數檔案複製到複製庫相應位置
啟動資料庫到 nomount 狀態
[oracle@node2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Fri Mar 24 11:29:05 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 839282688 bytes
Fixed Size 2257880 bytes
Variable Size 545262632 bytes
Database Buffers 289406976 bytes
Redo Buffers 2355200 bytes
SQL> create spfile from pfile;
File created.
複製資料庫
同時連線到目標庫和複製庫
[oracle@node2 ~]$ rman target sys/oracle@orcl auxiliary sys/oracle@orcldg
Recovery Manager: Release 11.2.0.4.0 - Production on Fri Mar 24 11:40:58 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
PL/SQL package SYS.DBMS_BACKUP_RESTORE version 11.02.00.02 in TARGET database is not current
PL/SQL package SYS.DBMS_RCVMAN version 11.02.00.02 in TARGET database is not current
connected to target database: ORA11G (DBID=40693715)
connected to auxiliary database: ORA11G (not mounted)
RMAN>
複製資料庫
RMAN> duplicate target database for standby from active database nofilenamecheck;
Starting Duplicate Db at 24-MAR-17
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=20 device type=DISK
contents of Memory Script:
{
backup as copy reuse
targetfile '/oracle/app/product/11.2.0/db_1/dbs/orapwora11g' auxiliary format
'/oracle/app/product/11.2.0/db_1/dbs/orapwora11g' ;
}
executing Memory Script
Starting backup at 24-MAR-17
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=33 device type=DISK
Finished backup at 24-MAR-17
contents of Memory Script:
{
backup as copy current controlfile for standby auxiliary format '/oracle/app/oradata/ora11g/control01.ctl';
restore clone controlfile to '/oracle/app/oradata/ora11g/control02.ctl' from
'/oracle/app/oradata/ora11g/control01.ctl';
}
executing Memory Script
Starting backup at 24-MAR-17
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=/oracle/app/product/11.2.0/db_1/dbs/snapcf_ora11g.f tag=TAG20170324T150456 RECID=6 STAMP=939481497
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 24-MAR-17
Starting restore at 24-MAR-17
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 24-MAR-17
contents of Memory Script:
{
sql clone 'alter database mount standby database';
}
executing Memory Script
sql statement: alter database mount standby database
contents of Memory Script:
{
set newname for tempfile 1 to
"/oracle/app/oradata/ora11g/temp01.dbf";
switch clone tempfile all;
set newname for datafile 1 to
"/oracle/app/oradata/ora11g/system01.dbf";
set newname for datafile 2 to
"/oracle/app/oradata/ora11g/sysaux01.dbf";
set newname for datafile 3 to
"/oracle/app/oradata/ora11g/undotbs01.dbf";
set newname for datafile 4 to
"/oracle/app/oradata/ora11g/users01.dbf";
backup as copy reuse
datafile 1 auxiliary format
"/oracle/app/oradata/ora11g/system01.dbf" datafile
2 auxiliary format
"/oracle/app/oradata/ora11g/sysaux01.dbf" datafile
3 auxiliary format
"/oracle/app/oradata/ora11g/undotbs01.dbf" datafile
4 auxiliary format
"/oracle/app/oradata/ora11g/users01.dbf" ;
sql 'alter system archive log current';
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /oracle/app/oradata/ora11g/temp01.dbf in control file
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting backup at 24-MAR-17
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/oracle/app/oradata/ora11g/system01.dbf
output file name=/oracle/app/oradata/ora11g/system01.dbf tag=TAG20170324T150504
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/oracle/app/oradata/ora11g/sysaux01.dbf
output file name=/oracle/app/oradata/ora11g/sysaux01.dbf tag=TAG20170324T150504
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:19
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/oracle/app/oradata/ora11g/undotbs01.dbf
output file name=/oracle/app/oradata/ora11g/undotbs01.dbf tag=TAG20170324T150504
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/oracle/app/oradata/ora11g/users01.dbf
output file name=/oracle/app/oradata/ora11g/users01.dbf tag=TAG20170324T150504
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 24-MAR-17
sql statement: alter system archive log current
contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy RECID=6 STAMP=939481171 file name=/oracle/app/oradata/ora11g/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=7 STAMP=939481171 file name=/oracle/app/oradata/ora11g/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=8 STAMP=939481171 file name=/oracle/app/oradata/ora11g/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=9 STAMP=939481171 file name=/oracle/app/oradata/ora11g/users01.dbf
Finished Duplicate Db at 24-MAR-17
至此,資料庫已經複製到新環境
複製期間的歸檔日誌
SQL> recover standby database;
auto
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23732248/viewspace-2887303/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle使用RMAN從Windows遷移資料到LinuxOracleWindowsLinux
- Oracle RMAN恢復測試Oracle
- 用rman遷移資料庫資料庫
- RMAN Duplicate RAC to Single Instance
- rman duplicate建立異地auxiliary Database oracle_11g oracle_sid不同UXDatabaseOracle
- rman duplicate建立異地auxiliary Database oracle_11g oracle_sid相同UXDatabaseOracle
- PostMan newman測試介面遷移Postman
- rman duplicate操作手冊
- 【Oracle19c】Oracle19c rman使用簡單測試Oracle
- 【RMAN】Oracle使用rman將11.2.0.4資料庫遷移至Oracle12c命令參考Oracle資料庫
- oracle遷移OCR盤Oracle
- Oracle遷移文件大全Oracle
- Oracle遷移文章大全Oracle
- 資料遷移的時候出現RMAN-03002,RMAN-06026
- oracle xtts遷移 AIX to LinuxOracleTTSAILinux
- Oracle 行遷移 & 行連結的檢測與消除Oracle
- Oracle Rman多通道故障轉移問題分析Oracle
- oracle 19c pdb遷移Oracle
- AWS RDS Oracle資料遷移Oracle
- 【資料遷移1】Oracle 10gR2 rman異機恢復實驗(FS->RAW)(1)Oracle 10g
- 【資料遷移1】Oracle 10gR2 rman異機恢復實驗(FS->RAW)(2)Oracle 10g
- RMAN備份恢復典型案例——跨平臺遷移pdb
- Oracle RAC 遷移替換 OCR 盤Oracle
- 遷移oracle使用者密碼Oracle密碼
- 連載一:Oracle遷移文件大全Oracle
- 連載二:Oracle遷移文章大全Oracle
- 使用GoldenGate 遷移Oracle到PostgreSQL/LightDBGoOracleSQL
- 【XTTS】Oracle XTTS V4--Oracle11.2.0.4+ 遷移升級TTSOracle
- ORACLE rman與RMAN-00054&ORA-09945Oracle
- RMAN備份與恢復測試
- 無外網Oracle資料庫遷移Oracle資料庫
- Oracle資料庫(DataGuard)遷移方案(上)Oracle資料庫
- Oracle資料庫(DataGuard)遷移方案(中)Oracle資料庫
- Oracle資料庫(DataGuard)遷移方案(下)Oracle資料庫
- Oracle中表空間、表、索引的遷移Oracle索引
- 【STATS】Oracle遷移表統計資訊Oracle
- Oracle RMAN還原測試錯誤ORA-19571 ORA-19600 ORA-19601Oracle
- 記錄一次餘額遷移的坑(測試角度)