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 為test103
即主庫和備庫環境變數一樣
[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=test103; 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
一、主庫修改為靜態監聽,並配置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]$ 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) ) )
二、備庫修改為靜態監聽,並配置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 = test103)) ) 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]$ 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) ) )
四、主庫往備庫copy引數檔案和密碼檔案
[oracle@oratest001 dbs]$ pwd /oracle/app/oracle/product/11.2.0/dbs [oracle@gacoratest001 dbs]$ scp tnsnames.ora listener.ora 10.8.98.104:/oracle/app/oracle/product/11.2.0/network/admin
在備庫上修改引數檔案
[oracle@oratest002 dbs]$ cat inittest103.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>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70004783/viewspace-2788060/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- rman duplicate建立異地auxiliary Database oracle_11g oracle_sid不同UXDatabaseOracle
- RMAN Duplicate RAC to Single Instance
- rman duplicate操作手冊
- Oracle rman duplicate遷移測試Oracle
- dataguard 搭建 oracle_sid相同 2節點 primary+standbyOracle
- Converting Oracle Database from Linux to Windows using RMANOracleDatabaseLinuxWindows
- RMAN restore validate database報ORA-19693RESTDatabase
- 使用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】同時建立多個備份(建立多重備份)
- 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
- [譯] 用 React 和 Vue 建立了兩個完全相同的應用後,發現了這些差異ReactVue
- 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資料庫
- 【RMAN】RMAN備份至ASMASM
- 【DG】Oracle11g異構平臺之Linux To Windows DataGuard安裝配置--duplicateOracleLinuxWindows
- 異地多活和同城容災
- Oracle 11G RAC複製備庫RMAN-03002 RMAN-05501 RMAN-03015 RMAN-03009 RMAN-10038Oracle