rman duplicate建立異地auxiliary Database oracle_11g oracle_sid不同
rman duplicate
環境
oracle11g redhat6.5
主庫10.8.98.103 oratest001
從庫10.8.98.104 oratest002
主庫oracle_id test103
從庫只安裝了資料庫軟體,oracle_sid 為test104
主庫環境變數
[oracle@oratest001 ~]$ cat .bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH # Oracle Settings oracle TMP=/tmp; export TMP TMPDIR=$TMP; export TMPDIR export ORACLE_BASE=/oracle/app/oracle; export ORACLE_BASE ORACLE_HOME=$ORACLE_BASE/product/11.2.0; export ORACLE_HOME ORACLE_SID=test103; export ORACLE_SID ORACLE_TERM=xterm; export ORACLE_TERM alias sqlplus='rlwrap sqlplus' alias rman='rlwrap rman' PATH=/usr/sbin:$PATH; export PATH PATH=$ORACLE_HOME/bin:$PATH; export PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export NLS_LANG if [ $USER = "oracle" ] || [ $USER = "grid" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi umask 022 fi [oracle@oratest001 ~]$
備庫環境變數
[oracle@oratest002 ~]$ cat .bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH # Oracle Settings oracle TMP=/tmp; export TMP TMPDIR=$TMP; export TMPDIR export ORACLE_BASE=/oracle/app/oracle; export ORACLE_BASE ORACLE_HOME=$ORACLE_BASE/product/11.2.0; export ORACLE_HOME ORACLE_SID=test104; export ORACLE_SID ORACLE_TERM=xterm; export ORACLE_TERM PATH=/usr/sbin:$PATH; export PATH PATH=$ORACLE_HOME/bin:$PATH; export PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export NLS_LANG if [ $USER = "oracle" ] || [ $USER = "grid" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi umask 022 fi [oracle@oratest002 ~]$
一、主庫修改為靜態監聽,並配置tnsnames.ora
[oracle@oratest001 admin]$ cat listener.ora # listener.ora Network Configuration File: /oracle/app/oracle/product/11.2.0/network/admin/listener.ora # Generated by Oracle configuration tools. SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = test103) (ORACLE_HOME = /oracle/app/oracle/product/11.2.0) (SID_NAME = test103)) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.98.103)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) ) ADR_BASE_LISTENER = /oracle/app/oracle [oracle@oratest001 admin]$ [oracle@oratest001 admin]$ cat tnsnames.ora # tnsnames.ora Network Configuration File: /oracle/app/oracle/product/11.2.0/network/admin/tnsnames.ora # Generated by Oracle configuration tools. TEST103 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.98.103)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = test103) ) ) TEST104 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.98.104)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = test103) ) ) [oracle@oratest001 admin]$
二、備庫修改為靜態監聽,並配置tnsnames.ora
[oracle@oratest002 admin]$ cat listener.ora # listener.ora Network Configuration File: /oracle/app/oracle/product/11.2.0/network/admin/listener.ora # Generated by Oracle configuration tools. SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = test103) (ORACLE_HOME = /oracle/app/oracle/product/11.2.0) (SID_NAME = test104)) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.98.104)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) ) ADR_BASE_LISTENER = /oracle/app/oracle [oracle@oratest002 admin]$ [oracle@oratest002 admin]$ cat tnsnames.ora # tnsnames.ora Network Configuration File: /oracle/app/oracle/product/11.2.0/network/admin/tnsnames.ora # Generated by Oracle configuration tools. TEST103 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.98.103)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = test103) ) ) TEST104 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.98.104)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = test103) ) ) [oracle@oratest002 admin]$
四、主庫往備庫copy引數檔案和密碼檔案,並在備庫上修改檔名稱
[oracle@oratest001 dbs]$ pwd /oracle/app/oracle/product/11.2.0/dbs [oracle@oratest001 dbs]$ scp inittest103.ora orapwtest103 10.8.98.104:/oracle/app/oracle/product/11.2.0/dbs [oracle@oratest002 dbs]$ pwd /oracle/app/oracle/product/11.2.0/dbs [oracle@oratest002 dbs]$ mv inittest103.ora inittest104.ora [oracle@oratest002 dbs]$ mv orapwtest103 orapwtest104
備庫引數檔案修改
[oracle@gacoratest002 dbs]$ cat inittest104.ora *.audit_file_dest='/oracle/app/oracle/admin/test103/adump' *.audit_trail='db' *.compatible='11.2.0.4.0' *.control_files='/oracle/app/oracle/oradata/test103/control01.ctl','/oracle/app/oracle/oradata/test103/control02.ctl' *.db_block_size=8192 *.db_domain='' *.db_name='test103' *.diagnostic_dest='/oracle/app/oracle' *.dispatchers='(PROTOCOL=TCP) (SERVICE=test103XDB)' *.memory_target=4120903680 *.open_cursors=300 *.processes=150 *.remote_login_passwordfile='EXCLUSIVE' *.undo_tablespace='UNDOTBS1'
並在備庫上建立相應的目錄
mkdir -p /oracle/app/oracle/admin/test103/adump mkdir -p /oracle/app/oracle/oradata/test103/
五、備庫啟動到nomount狀態,主庫open並且需要是歸檔模式
六、重啟監聽,並在主備庫測試tnsping。
主庫
[oracle@oratest001 admin]$ lsnrctl stop [oracle@oratest001 admin]$ lsnrctl start [oracle@oratest001 admin]$ tnsping test103 [oracle@oratest001 admin]$ tnsping test104
備庫同樣的操作,確保tnsping正確
七、在主庫上操作rman duplicate
[oracle@gacoratest001 dbs]$ rman target sys/oracle@test103 auxiliary sys/oracle@test104 Recovery Manager: Release 11.2.0.4.0 - Production on Sat Aug 21 12:17:32 2021 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. connected to target database: TEST103 (DBID=333915497) connected to auxiliary database: TEST103 (not mounted) RMAN> duplicate target database to test103 from active database nofilenamecheck;
此處備庫就會開啟了
contents of Memory Script: { Alter clone database open resetlogs; } executing Memory Script database opened Finished Duplicate Db at 2021-08-21 12:18:55 RMAN>
八、最後檢視備機狀態
[oracle@oratest002 dbs]$ lsnrctl status LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 22-AUG-2021 12:44:05 Copyright (c) 1991, 2013, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.8.98.104)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production Start Date 22-AUG-2021 12:33:50 Uptime 0 days 0 hr. 10 min. 15 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /oracle/app/oracle/product/11.2.0/network/admin/listener.ora Listener Log File /oracle/app/oracle/diag/tnslsnr/gacoratest002/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.8.98.104)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Services Summary... Service "test103" has 2 instance(s). Instance "test104", status UNKNOWN, has 1 handler(s) for this service... Instance "test104", status READY, has 1 handler(s) for this service... Service "test103XDB" has 1 instance(s). Instance "test104", status READY, has 1 handler(s) for this service... The command completed successfully [oracle@oratest002 dbs]$
即成功,例項名為test104,資料庫db_name依然為test103
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70004783/viewspace-2788176/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- rman duplicate建立異地auxiliary Database oracle_11g oracle_sid相同UXDatabaseOracle
- RMAN Duplicate RAC to Single Instance
- rman duplicate操作手冊
- Oracle rman duplicate遷移測試Oracle
- Converting Oracle Database from Linux to Windows using RMANOracleDatabaseLinuxWindows
- RMAN restore validate database報ORA-19693RESTDatabase
- dataguard 搭建 oracle_sid不同 2節點 primary+standbyOracle
- 使用RMAN複製資料庫 active database資料庫Database
- duplicate遇到RMAN-05535: warning: All redo log files were not defined
- HowTo Restore RMAN Disk backups of RAC Database to Single Instance On Another NoRESTDatabase
- 理解RMAN backup database plus archivelog delete all input命令DatabaseHivedelete
- Rman_異地、跨平臺、跨版本的恢復總結及案例
- 【DG】備庫RMAN還原方式搭建DG(不使用duplicate命令)
- 透過搭建恢復目錄實現RMAN異地備份和恢復
- RMAN備份異機恢復
- 透過RMAN備份standby database成功恢復還原Database
- Oracle DG建立Physical Standby DatabaseOracleDatabase
- Oracle DG建立Logical Standby DatabaseOracleDatabase
- rman備份異機恢復(原創)
- 【RMAN】同時建立多個備份(建立多重備份)
- hibernate不同實體不同填充建立人
- 4.3.3 使用CREATE DATABASE語句建立CDBDatabase
- 2.4.1 使用 CREATE DATABASE 子句建立資料庫Database資料庫
- 【PDB】Oracle 建立pdb說明(create pluggable database)OracleDatabase
- mssql資料庫異地進行異地備份的方法SQL資料庫
- 2.4 使用 CREATE DATABASE 語句建立資料庫Database資料庫
- 4 Creating a Logical Standby Database 建立邏輯備庫Database
- 4、MySQL建立資料庫(CREATE DATABASE語句)MySql資料庫Database
- Oracle Rman Catalog的建立方法和備份原理Oracle
- ORACLE 11.2.0.4 RAC RMAN異機恢復之ORA-15001Oracle
- 4.3.4 使用CREATE DATABASE語句建立一個CDB:示例Database
- 建立 SAP Fiori Catalog 時遇到的 duplicate 記錄的問題分析
- RMAN備份恢復典型案例——異機恢復未知DBID
- RMAN資料庫恢復異常報錯ORA-01180資料庫
- 不同資料庫SQL語法差異資料庫SQL
- 幾種在不同的位置開啟 SAP HANA Database explorer 的辦法Database
- 【RMAN】RMAN備份至ASMASM
- 【DG】Oracle11g異構平臺之Linux To Windows DataGuard安裝配置--duplicateOracleLinuxWindows