11g rman新特性 duplicate target database for standby from active database
Oracle版本:11.1.0.6 for Linux x86_64
首先dcba建立了2個庫,一個prdb,一個pstdb,這樣省去建立standby資料庫資料夾和密碼檔案的步驟。這當中還碰到個小問題,建立完資料庫遲遲看不到監聽註冊2個例項。於是一看listener.log,只發現了一些Subscription for node down event still pending資訊,這個是老毛病了,在listener.ora里加上SUBSCRIBE_FOR_NODE_DOWN_EVENT_
接下來開始修改主庫歸檔模式和一些引數,發現了11g中STANDBY_ARCHIVE_DEST引數已經被廢棄。其實10g的時候隨著unique_db_name和log_config等引數加入就覺得這個引數估計活不長了- -果然現在被拿掉了。
alter system set log_archive_dest_1='location=/u02/arch/prdb valid_for=(all_logfiles,all_roles) db_unique_name=prdb' scope=both;
alter system set fal_client='prdb' scope=both;
alter system set fal_server='pstdb' scope=both;
alter system set db_file_name_convert='pstdb','prdb' scope=spfile;
alter system set log_file_name_convert='pstdb','prdb' scope=spfile;
alter system set standby_file_management=auto scope=both;
alter system set db_unique_name='prdb' scope=spfile;
alter system set log_archive_dest_2='service=pstdb reopen=120 lgwr async valid_for=(online_logfiles,primary_role) db_unique_name=prdb' scope=both;
修改完重啟主庫
備庫麼直接startup nomount就可以了
這裡有一個問題:duplicate target database for standby from active database是需要使用net service name連線的,如果使用SID連線會報下面的錯誤:
ORACLE_SID=pstdb
rman target auxiliary /
RMAN-06217: not connected to auxiliary database with a net service name
但問題是,instance在mount/nomount階段,net service name是blocked的,直接使用net service name連線又會發生別的錯誤:
rman target auxiliary
RMAN-04006: error from auxiliary database
ORA-12528: TNS:listener: all appropriate instances are blocking new connections
那麼如何解決呢,其實只要修改監聽的配置檔案listener.ora,加一個靜態註冊就可以了:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = pstdb)
(ORACLE_HOME = /u01/app/product/11g/db_1)
(SID_NAME = pstdb)
)
)
另外tnsname.ora裡修改成:
pstdb =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = pstdb)(UR=A)
)
)
也可以連線mount狀態的instance,包括ASM的例項哦
做好這些工作以後,接下來的工作很方便了
在standby端:
rman target auxiliary
連線後執行下面的指令碼,RMAN會自動完成建立控制檔案,引數檔案,複製資料檔案的工作。
run {
allocate channel prmy1 type disk;
allocate auxiliary channel stby type disk;
duplicate target database for standby from active database
spfile
parameter_value_convert 'prdb','pstdb'
set db_unique_name='pstdb'
set db_file_name_convert='/prdb/','/pstdb/'
set log_file_name_convert='/prdb/','/pstdb/'
set control_files='/u02/oradata/pstdb/control01.ctl'
set fal_client='pstdb'
set fal_server='prdb'
set standby_file_management='AUTO'
set log_archive_dest_1='location=/u02/arch/pstdb valid_for=(all_logfiles,all_roles) db_unique_name=prdb'
set log_archive_dest_2='service=prdb ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=prdb'
;
}
執行完畢後,新增Real-time query需要的standby redo log:
alter database add standby logfile '/u02/oradata/pstdb/stdbyredo01.log' size 50m;
alter database add standby logfile '/u02/oradata/pstdb/stdbyredo02.log' size 50m;
alter database add standby logfile '/u02/oradata/pstdb/stdbyredo03.log' size 50m;
alter database recover managed standby database disconnect from session;
alter database recover managed standby database cancel;
ALTER DATABASE OPEN;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
dataguard就開始Real-time Apply了,驗證資料就自己來吧
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35489/viewspace-672521/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Convert a Physical Standby Database into a Snapshot Standby DatabaseDatabase
- 使用RMAN複製資料庫 active database資料庫Database
- Converting Oracle Database from Linux to Windows using RMANOracleDatabaseLinuxWindows
- 透過RMAN備份standby database成功恢復還原Database
- Oracle 12.2 使用Database Link優化Standby Database WorkloadOracleDatabase優化
- Performing a Failover to a Physical Standby DatabaseORMAIDatabase
- The database owner SID recorded in the master database differs from the database owner SID recorded in database 'DB_NAME'DatabaseAST
- Setup Standby Database on One PC(轉)Database
- Oracle DG Standby Database型別OracleDatabase型別
- Oracle DG建立Physical Standby DatabaseOracleDatabase
- Oracle DG建立Logical Standby DatabaseOracleDatabase
- rman duplicate建立異地auxiliary Database oracle_11g oracle_sid不同UXDatabaseOracle
- rman duplicate建立異地auxiliary Database oracle_11g oracle_sid相同UXDatabaseOracle
- Oracle 19c透過recover standby database from service修復GAP案例OracleDatabase
- ORA-16649: possible failover to another database prevents this database from beiAIDatabase
- 1 Oracle Database 19c 新特性OracleDatabase
- [20230110]sql profile run standby database.txtSQLDatabase
- RMAN restore validate database報ORA-19693RESTDatabase
- 4 Creating a Logical Standby Database 建立邏輯備庫Database
- Oracle database 升級(文件)to 10.2.0.4 from 10.2.0.1OracleDatabase
- 在Oracle DG Standby庫上啟用flashback database功能OracleDatabase
- HowTo Restore RMAN Disk backups of RAC Database to Single Instance On Another NoRESTDatabase
- 理解RMAN backup database plus archivelog delete all input命令DatabaseHivedelete
- Incorrect MEMORY_MAX_TARGET (> Available RAM) Can Lead To Database HangsAIDatabase
- PL/SQL package SYS.DBMS_BACKUP_RESTORE version 19.16.00.00 in TARGET database isSQLPackageRESTDatabase
- oracle12.2 adg ORA-46952: standby database format mismatch for password fileOracleDatabaseORM
- 【kingsql分享】Oracle Database 19c的各種新特性介紹SQLOracleDatabase
- Oracle Database 23c Beta 釋出,增加 300 多個新特性OracleDatabase
- Automatic Diagnostic Repository (ADR) in Oracle Database 11g Release 1 (ADRCI)OracleDatabase
- Oracle Database Cloud - Database as a Service Quick StartOracleDatabaseCloudUI
- Error querying database. XXXXXXXXXXXXX, No database selected。ErrorDatabase
- 【kingsql分享】Oracle Database 20c 十大新特性介紹SQLOracleDatabase
- Database TimeoutDatabase
- Database OverallDatabase
- database no shardingDatabase
- Oracle 12c DG備庫啟動報錯standby database requires recoveryOracleDatabaseUI
- RMAN Duplicate RAC to Single Instance
- ORACLE database vaultOracleDatabase
- Relationship Database DesignDatabase