Oracle Dataguard之Real-Time Apply

      7> 假若没有standby redo logs,是不可能开发银行real time apply的

四、 测试

          SQL> commit;

           SQL> alter database recover managed standby database using
current logfile disconnect from session;
           alter database recover managed standby database using current
logfile disconnect from session
           *
           ERROR at line 1:
           ORA-38500: USING CURRENT LOGFILE option not available without
standby redo logs

          SQL> alter database recover managed standby database using
current logfile disconnect from session;

         SQL> alter database add standby logfile
‘/u01/standby/standby02.log’ size 50M;

            图片 1

      5> 删除日志  

         
在数据库中,开首换参数log_archive_dest和log_archive_duplex_dest与log_archive_dest_n只可以使用一组来设置归档目标地,无法同时使用

③ 、 在备库上启用Real-提姆e
Apply
 –>> node2 上操作

      3> 在主库中付出业务

Transactions do not commit until all redo data needed to recover those
transactions has been written to the online redo log and to the standby
redo log on at least one synchronized standby database.If the primary
database cannot write its redo stream to at least one synchronized
standby         database,it operates as if it were in maximum
performance mode to preserve primary database availability until it is
again able to write its redo stream to a synchronized standby database.

         SQL> select group#,bytes/1024/1024 “size” from v$log;

            ORA-16032: parameter STANDBY_ARCHIVE_DEST destination
string cannot be translated

         关闭Redo Apply,

This is accomplished by allowing transactions to commit as soon as all
redo data generated by those transactions has been written to the online
log. Redo data is also written to one of more standby databases,but this
is done asynchronously with respect to transaction commitment,so primary
      database performance is unaffected by delays in writing redo data
to the standby databases.

     2>
备库log_archive_dest_1如若没有显性钦赐,默许的存档目录将是$ORACLE_HOME/dbs.如若显性钦赐,但valid_for不是

         SQL> alter database add standby logfile
‘/u01/standby/standby03.log’ size 50M;

      10> Real-Time Apply的规律图

                SQL> alter database recover managed standby database
cancel;

      1> 在主库上新建2个测试表

      这么些总括回顾物理standby的主干配备和本文中的Real-Time Apply

   
 1> 假若只设置主/次三个地面归档指标地,能够使用伊始化参数log_archive_dest钦命主归档目标地,使用早先化参数log_archive_duplex_dest钦点次归档指标地。

         SQL> alter database add standby logfile
‘/u01/standby/standby04.log’ size 50M;

      2> 在备库中检查和测试

图片 2

            归档目录将继续为$ORACLE_HOME/dbs

          SQL> alter system set
log_archive_dest_2=’service=to_victor lgwr affirm sync
valid_for=(online_logfiles,primary_role) db_unique_name=victor’;

      4> 在备库中检查和测试

           中华VFS(Remote file server)仍继续工作

         SQL> alter database add standby logfile
‘/u01/standby/standby01.log’ size 50M;

二种方式对于日记传输的渴求如下:

      6> 若是发生了alter database recover managed standby database
cancel;那些命令,MKugaP(Media Recovery process)将终止工作,但

     
 除了用前篇小说中,查看归档日志的利用意况来验证dataguard的计划以外,本文将应用实际案例开始展览测试。 

          no rows selected

          SQL> select * from test;

Maximum Performance

Maximum Protection

           SQL> alter database drop logfile group 7;

      3> 在本文中,log_archive_dest_1=’location=/u01/archivelog
valid_for=(standby_logfiles,standby_role)
db_unique_name=victor’,假设再显性钦定

Maximum Availability

      8> standby数据库startup后,没有产生alter database recover
managed standby database disconnect from
session这些命令,TiguanFS还是工作,只要监听

                 alter database add standby logfile
‘/u01/standby/standby01.log’ size 50M
                 *
                 ERROR at line 1:
                 ORA-01156: recovery or flashback in progress may need
access to files

总结:

      4>
最大品质方式下,若是是async,即异步,则需求主库切三遍日志,备库接纳选择。而一旦启用Real-Time
Apply,则只需求主库事务commit, 备库就能选取

         GROUP#  size
         ——     ———-
         1             50
         2             50
         3             50

Oracle Dataguard一共补助二种格局:最大可用格局(马克西姆um
Availability),最大品质形式(马克西姆um
Performance),最大爱戴方式(马克西姆um
Protection)。默许创造的是最大品质方式(马克西姆um
Performance)。关于三者的分别,大家来看官方的概念。

           SQL> create table test(id number);

           都ok

            归档日志产生,没有供给,只要求两个log_archive_dest_1即可

          SQL> select * from test;

在前篇小说中-《Oracle
Dataguard之物理standby的为主配备
》,咱们最终布置出来的是Physical
Standby Database
最大质量格局下的异步传输,今后我们配备该形式下的Real-提姆e
Apply。启用Real-Time Apply供给配置standby redo
log,而那也是其它三种形式的底子。

          SQL> alter system switch logfile;

      9> disconnect from session代表这一个命令后台运行。

            log_archive_dest_3=’location=/u01/standbyarchive
valid_for=(standby_logfiles,standby_role)
db_unique_name=victor’,将会有两份standby的

                 SQL> alter database add standby logfile
‘/u01/standby/standby01.log’ size 50M;

贰 、修改主库的布置参数  –>> node1 上操作

         注意:请保管已关闭Redo
Apply,否则会报以下错误

         
(standby_logfiles,standby_role)或者(all_logfiles,all_roles),则该装置无效,报告警方日志上校报以下错误:

      2> 在备库上添加standby redo log   –>> group比主库多一组,大小和主库一样,node2上操作

          ID
          ———-
          1

      1> 查询主库上online redo log的组数和大小   –>> node1
上操作

         [oracle@node2 ~]$ mkdir /u01/standby

一、 创建standby redo log

           SQL> insert into test values(1);

This protection mode ensures that no data loss will occur if the primary
database fails.To provide this level of protection,the redo data needed
to      recover a transaction must be written to both the online redo
log and to the standby redo on at least one synchronized standby
database before the transaction commits.To ensure that data loss cannot
occur,the primary database will shut down,rather than continue
processing transactions,if it     cannot write its redo stream to at
least one synchronized standby database.

相关文章