标签云
asm恢复 bbed bootstrap$ dul In Memory kcbzib_kcrsds_1 kccpb_sanity_check_2 kfed MySQL恢复 ORA-00312 ORA-00607 ORA-00704 ORA-01110 ORA-01555 ORA-01578 ORA-08103 ORA-600 2131 ORA-600 2662 ORA-600 2663 ORA-600 3020 ORA-600 4000 ORA-600 4137 ORA-600 4193 ORA-600 4194 ORA-600 16703 ORA-600 kcbzib_kcrsds_1 ORA-600 KCLCHKBLK_4 ORA-15042 ORA-15196 ORACLE 12C oracle dul ORACLE PATCH Oracle Recovery Tools oracle加密恢复 oracle勒索 oracle勒索恢复 oracle异常恢复 Oracle 恢复 ORACLE恢复 ORACLE数据库恢复 oracle 比特币 OSD-04016 YOUR FILES ARE ENCRYPTED 勒索恢复 比特币加密文章分类
- Others (2)
- 中间件 (2)
- WebLogic (2)
- 操作系统 (102)
- 数据库 (1,682)
- DB2 (22)
- MySQL (73)
- Oracle (1,544)
- Data Guard (52)
- EXADATA (8)
- GoldenGate (24)
- ORA-xxxxx (159)
- ORACLE 12C (72)
- ORACLE 18C (6)
- ORACLE 19C (15)
- ORACLE 21C (3)
- Oracle 23ai (7)
- Oracle ASM (67)
- Oracle Bug (8)
- Oracle RAC (53)
- Oracle 安全 (6)
- Oracle 开发 (28)
- Oracle 监听 (28)
- Oracle备份恢复 (565)
- Oracle安装升级 (92)
- Oracle性能优化 (62)
- 专题索引 (5)
- 勒索恢复 (79)
- PostgreSQL (18)
- PostgreSQL恢复 (6)
- SQL Server (27)
- SQL Server恢复 (8)
- TimesTen (7)
- 达梦数据库 (2)
- 生活娱乐 (2)
- 至理名言 (11)
- 虚拟化 (2)
- VMware (2)
- 软件开发 (37)
- Asp.Net (9)
- JavaScript (12)
- PHP (2)
- 小工具 (20)
-
最近发表
- 断电引起的ORA-08102: 未找到索引关键字, 对象号 39故障处理
- ORA-00227: corrupt block detected in control file
- 手工删除19c rac
- 解决oracle数据文件路径有回车故障
- .wstop扩展名勒索数据库恢复
- Oracle Recovery Tools工具一键解决ORA-00376 ORA-01110故障(文件offline)
- OGG-02771 Input trail file format RELEASE 19.1 is different from previous trail file form at RELEASE 11.2.
- OGG-02246 Source redo compatibility level 19.0.0 requires trail FORMAT 12.2 or higher
- GoldenGate 19安装和打patch
- dd破坏asm磁盘头恢复
- 删除asmlib磁盘导致磁盘组故障恢复
- Kylin Linux 安装19c
- ORA-600 krse_arc_complete.4
- Oracle 19c 202410补丁(RUs+OJVM)
- ntfs MFT损坏(ntfs文件系统故障)导致oracle异常恢复
- .mkp扩展名oracle数据文件加密恢复
- 清空redo,导致ORA-27048: skgfifi: file header information is invalid
- A_H_README_TO_RECOVER勒索恢复
- 通过alert日志分析客户自行对一个数据库恢复的来龙去脉和点评
- ORA-12514: TNS: 监听进程不能解析在连接描述符中给出的SERVICE_NAME
标签归档:Far Sync
Oracle 12C Active Data Guard Far Sync 配置
Active Data Guard Far Sync是Oracle 12c的新功能(也称为Far Sync Standby),Far Sync功能的实现是通过在距离主库(Primary Database)相对较近的地点配置Far Sync实例,主库(Primary Database) 同步(synchronous)传输redo到Far Sync实例,然后Far Sync实例再将redo异步(asynchronous)传输到终端备库(Standby Database)。这样既可以保证零数据丢失又可以降低主库压力。Far Sync实例只有密码文件,init参数文件和控制文件,而没有数据文件。 如果redo 传输采用Maximum Availability模式,我们可以在距离生产中心(Primary Database)相对较近的地点配置Far Sync实例,主库(Primary Database)同步(synchronous)传输redo到Far Sync实例,保证零数据丢失(zero data loss),同时主库和Far Sync距离较近,网络延时很小,因此对主库性能影响很小。然后Far Sync实例再将redo异步(asynchronous)发送到终端备库(Standby Database)。 如果redo 传输采用Maximum Performance模式,我们可以在距离生产中心(Primary Database)相对较近的地点配置Far Sync实例,主库(Primary Database) 异步传输redo到Far Sync实例,然后Far Sync实例再负责传输redo到其他多个终端备库(Standby Database)。这样可以减少主库向多个终端备库(Standby Database)传输redo的压力(offload)。 Far Sync配置对于Data Guard 角色转换(role transitions)是透明的,即switchover/failover命令方式与12c之前相同。
1.主库配置fra
SQL> alter system set DB_RECOVERY_FILE_DEST_SIZE=200G; System altered. SQL> alter system set db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'; System altered.
2.启用归档模式和强制日志
SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> startup mount ORACLE instance started. Total System Global Area 2516582400 bytes Fixed Size 4585912 bytes Variable Size 671090248 bytes Database Buffers 1828716544 bytes Redo Buffers 12189696 bytes Database mounted. SQL> alter database archivelog; Database altered. SQL> alter database force logging; Database altered. SQL> alter database open; Database altered.
3.主机规划
192.168.137.121 ora1221 --->主库(ORCL12C) 192.168.137.122 ora1222 --->Far Sync实例(ORCL12CFS) 192.168.137.123 ora1223 --->备库(ORCL12CDG)
4.tns配置
ORCL12C = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = ora1221)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl12c) ) ) ORCL12CDG = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = ora1223)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl12c) ) ) ORCL12CFS = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = ora1222)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl12c) ) )
5.参数文件配置
--主库 db_unique_name='orcl12c' service_names='orcl12c' log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST valid_for=(all_logfiles,all_roles) db_unique_name=orcl12c' log_archive_dest_2='service=orcl12cfs lgwr sync AFFIRM MAX_FAILURE=1 ALTERNATE=LOG_ARCHIVE_DEST_3 valid_for=(online_logfiles,primary_role) db_unique_name=orcl12cfs' LOG_ARCHIVE_DEST_3='SERVICE=orcl12cdg lgwr ASYNC ALTERNATE=LOG_ARCHIVE_DEST_2 VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orcl12cdg' LOG_ARCHIVE_DEST_STATE_3=ALTERNATE log_archive_config='dg_config=(orcl12c,orcl12cdg,orcl12cfs)' standby_file_management=auto db_file_name_convert='/u01/app/oracle/oradata/orcl12c/','/u01/app/oracle/oradata/orcl12c/' log_file_name_convert='/u01/app/oracle/oradata/orcl12c/','/u01/app/oracle/oradata/orcl12c/' fal_server='orcl12cdg','orcl12cfs' --Far Sync实例 db_unique_name='orcl12cfs' service_names='orcl12c' log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST valid_for=(all_logfiles,all_roles) db_unique_name=orcl12cfs' log_archive_dest_2='service=orcl12cdg lgwr async valid_for=(STANDBY_LOGFILES,STANDBY_ROLE) db_unique_name=orcl12cdg' log_archive_config='dg_config=(orcl12c,orcl12cdg,orcl12cfs)' standby_file_management=manual fal_server='orcl12c' --备库 db_unique_name='orcl12cdg' service_names='orcl12c' log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST valid_for=(all_logfiles,all_roles) db_unique_name=orcl12cdg' log_archive_dest_2='service=orcl12c lgwr async valid_for=(online_logfiles,primary_role) db_unique_name=orcl12c' log_archive_config='dg_config=(orcl12c,orcl12cdg,orcl12cfs)' standby_file_management=auto db_file_name_convert='/u01/app/oracle/oradata/orcl12c/','/u01/app/oracle/oradata/orcl12c/' log_file_name_convert='/u01/app/oracle/oradata/orcl12c/','/u01/app/oracle/oradata/orcl12c/' fal_server='orcl12c','orcl12cfs'
6.密码文件
拷贝主库的密码文件到Far Sync实例和备库$ORACLE_HOME/dbs下(如果是win在%ORACLE_HOME%/database中)
7.创建Far Sync实例
创建和参数文件匹配的fra,adump目录
--主库 ALTER DATABASE CREATE FAR SYNC INSTANCE CONTROLFILE AS '/tmp/controlfs01.ctl'; 拷贝到Far Sync实例对应的控制文件位置 --Far Sync实例 startup pfile='/tmp/pfile' mount ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP 10 '/u01/app/oracle/oradata/orcl12c/std_redo10.log' size 50m reuse; ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP 11 '/u01/app/oracle/oradata/orcl12c/std_redo11.log' size 50m reuse; ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP 12 '/u01/app/oracle/oradata/orcl12c/std_redo12.log' size 50m reuse; ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP 13 '/u01/app/oracle/oradata/orcl12c/std_redo13.log' size 50m reuse; ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
8.创建备库
创建和参数文件匹配的fra,adump目录
--主库备份(传输至备库) backup database format '/tmp/ora12c_%U'; --主库创建standby ctl(传输至备库和备库参数文件路径一致) alter database create standby controlfile as '/tmp/controlst.ctl'; --启动备库至mount startup pfile='/tmp/pfile' mount; --备库注册备份 catalog start with '/tmp/xifenfei/'; --备库还原数据文件并恢复 restore database; recover database; --增加standby redo ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP 10 '/u01/app/oracle/oradata/orcl12c/std_redo10.log' size 50m reuse; ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP 11 '/u01/app/oracle/oradata/orcl12c/std_redo11.log' size 50m reuse; ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP 12 '/u01/app/oracle/oradata/orcl12c/std_redo12.log' size 50m reuse; ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP 13 '/u01/app/oracle/oradata/orcl12c/std_redo13.log' size 50m reuse; --备库开启mrp进程 ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION; --主库增加standby redo ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP 10 '/u01/app/oracle/oradata/orcl12c/std_redo10.log' size 50m reuse; ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP 11 '/u01/app/oracle/oradata/orcl12c/std_redo11.log' size 50m reuse; ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP 12 '/u01/app/oracle/oradata/orcl12c/std_redo12.log' size 50m reuse; ALTER DATABASE ADD STANDBY LOGFILE thread 1 GROUP 13 '/u01/app/oracle/oradata/orcl12c/std_redo13.log' size 50m reuse;
9.配置结果
SQL> select * from V$DATAGUARD_CONFIG; DB_UNIQUE_NAME PARENT_DBUN DEST_ROLE CURRENT_SCN CON_ID ------------------------------ ------------------------------ ----------------- ----------- ---------- orcl12c NONE PRIMARY DATABASE 1950551 0 orcl12cfs orcl12c FAR SYNC INSTANCE 1950390 0 orcl12cdg orcl12cfs PHYSICAL STANDBY 1950390 0 SQL> select group#, status, thread#, sequence#, first_change#, next_change# from v$standby_log; GROUP# STATUS THREAD# SEQUENCE# FIRST_CHANGE# NEXT_CHANGE# ---------- ---------- ---------- ---------- ------------- ------------ 10 ACTIVE 1 27 1863140 11 UNASSIGNED 1 0 12 UNASSIGNED 1 0 13 UNASSIGNED 1 0 SQL> select PROTECTION_MODE,PROTECTION_LEVEL from v$database; PROTECTION_MODE PROTECTION_LEVEL -------------------- -------------------- MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE
10.调整保护级别
从MAXIMUM PERFORMANCE调整为MAXIMUM AVAILABILITY
--主库 SQL> startup mount; ORACLE instance started. Total System Global Area 2516582400 bytes Fixed Size 4585912 bytes Variable Size 671090248 bytes Database Buffers 1828716544 bytes Redo Buffers 12189696 bytes Database mounted. SQL> alter database set standby database to maximize availability; Database altered. SQL> select PROTECTION_MODE,PROTECTION_LEVEL from v$database; PROTECTION_MODE PROTECTION_LEVEL -------------------- -------------------- MAXIMUM AVAILABILITY UNPROTECTED SQL> alter database open; Database altered. SQL> select PROTECTION_MODE,PROTECTION_LEVEL from v$database; PROTECTION_MODE PROTECTION_LEVEL -------------------- -------------------- MAXIMUM AVAILABILITY MAXIMUM AVAILABILITY --Far Sync实例 SQL> select PROTECTION_MODE,PROTECTION_LEVEL from v$database; PROTECTION_MODE PROTECTION_LEVEL -------------------- -------------------- MAXIMUM AVAILABILITY MAXIMUM AVAILABILITY --备库 SQL> select PROTECTION_MODE,PROTECTION_LEVEL from v$database; PROTECTION_MODE PROTECTION_LEVEL -------------------- -------------------- MAXIMUM AVAILABILITY RESYNCHRONIZATION