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 databaseDatabase
- 通過rman duplicate database!Database
- RMAN 6217 not connected to auxiliary database with a net service nameUXDatabase
- 【RMAN】RMAN-05001: auxiliary filename conflicts with the target databaseUXDatabase
- RMAN duplicate database到新主機Database
- 11g RMAN新特性active database duplicate 資料庫異構Database資料庫
- 使用RMAN DUPLICATE...FROM ACTIVE DATABASE命令來建立DataGuard物理備庫Database
- Oracle 11g Rman Active database duplicateOracleDatabase
- Duplicate Database from ASM to Non- ASM Database Using RMANDatabaseASM
- Oracle11g RMAN Duplicate from Active DatabaseOracleDatabase
- Duplicating Database using RMAN duplicate commandDatabase
- oracle實驗記錄Rman duplicate database(1)OracleDatabase
- oracle實驗記錄Rman duplicate database 2OracleDatabase
- RMAN DUPLICATE建立DataGuard物理備庫
- 使用RMAN建立Duplicate資料庫資料庫
- 【轉】RMAN建立duplicate資料庫資料庫
- 11g rman新特性 duplicate target database for standby from active databaseDatabase
- RMAN duplicate from active database 複製資料庫Database資料庫
- RMAN 'Duplicate Database' Feature in 11G [ID 452868.1]Database
- 使用 RMAN DUPLICATE...FROM ACTIVE DATABASE 建立物理備用資料庫的分步指南Database資料庫
- RMAN duplicate 建立standby RAC資料庫資料庫
- RMAN學習筆記_ Duplicate建立DataGuard筆記
- 使用oracle 11g rman新特性 duplicate target database for standby from active database 建立物理dataguard並開啟RealOracleDatabase
- duplicate databaseDatabase
- Performing duplicate database with ASM/OMF/RMAN (Doc ID 340848.1)ORMDatabaseASM
- RMAN Duplicate Database From RAC ASM To RAC ASM [ID 461479.1]DatabaseASM
- To use Rman to duplicate database be careful of db_file_name_convertDatabase
- RMAN-04006: error from auxiliary database: ORA-01034: ORACLE not availableErrorUXDatabaseOracleAI
- 11gR2中使用duplicate建立physical standby (從rman備份或從active database)Database
- rman duplicate target database RMAN-03002 RMAN-03015 RMAN-06136Database
- Creating a Physical Standby using RMAN DUPLICATE FROM ACTIVE DATABASEDatabase
- Oracle 11g Data Guard 使用 duplicate from active database 建立 standby databaseOracleDatabase
- Oracle 11g Data Guard 使用duplicate from active database 建立 standby databaseOracleDatabase
- 通過RMAN Duplicate建立Oracle物理standby備庫Oracle
- RMAN異地恢復實戰
- RMAN-04006: error from auxiliary database: ORA-01017: invalid username/password;ErrorUXDatabase
- 使用rman建立standby database的過程Database