zoukankan      html  css  js  c++  java
  • oracle12C--DG FAR SYNC 部署(前提为搭建好12C的DG)

    <<往期12CDG搭建>>

    一,理解同步异步模式

    01, 使用LGWR 进程的SYNC 方式

    1)Primary Database 产生的Redo 日志要同时写到日志文件和网络。也就是说LGWR进程把日志写到本地日志文件的同时还要发送给本地的LNSn进程(Network Server Process),再由LNSn(LGWR Network Server process)进程把日志通过网络发送给远程的目的地,每个远程目的地对应一个LNS进程,多个LNS进程能够并行工作。

    2)LGWR 必须等待写入本地日志文件操作和通过LNSn进程的网络传送都成功,Primary Database 上的事务才能提交,这也是SYNC的含义所在。

    3)Standby Database的RFS进程把接收到的日志写入到Standby Redo Log日志中。

    4)Primary Database的日志切换也会触发Standby Database 上的日志切换,即Standby Database 对Standby Redo Log的归档,然后触发Standby Database 的MRP或者LSP 进程恢复归档日志。


    因为Primary Database 的Redo 是实时传递的,于是Standby Database 端可以使用两种恢复方法: 

    实时恢复(Real-Time Apply): 只要RFS把日志写入Standby Redo Log 就会立即进行恢复;

    归档恢复: 在完成对Standby Redo Log 归档才触发恢复。


      Primary Database默认使用ARCH进程,如果使用LGWR进程必须明确指定。使用LGWR SYNC方式时,可以同时使用NET_TIMEOUT参数,这个参数单位是秒,代表如果多长时间内网络发送没有响应,LGWR 进程会抛出错误。 示例如下:

    alter system set log_archive_dest_2 = 'SERVICE=ST  LGWR  SYNC  NET_TIMEOUT=30' scope=both;

     

    02, 使用LGWR进程的ASYNC 方式

    使用LGWR SYNC方法的可能问题在于,如果日志发送给Standby Database过程失败,LGWR进程就会报错。也就是说Primary Database的LGWR 进程依赖于网络状况,有时这种要求可能过于苛刻,这时就可以使用LGWR ASYNC方式。 它的工作机制如下:

    1) Primary Database 一端产生Redo 日志后,LGWR 把日志同时提交给日志文件和本地LNS 进程,但是LGWR进程只需成功写入日志文件就可以,不必等待LNSn进程的网络传送成功。

    2) LNSn进程异步地把日志内容发送到Standby Database。多个LNSn进程可以并发发送。

    3) Primary Database的Online Redo Log 写满后发生Log Switch,触发归档操作,也触发Standby Database对Standby Database对Standby Redo Log 的归档;然后触发MRP或者LSP 进程恢复归档日志。


    因为LGWR进程不会等待LNSn进程的响应结果,所以配置LGWR ASYNC方式时不需要NET_TIMEOUT参数。示例如下:

    alter system set log_archive_dest_2 = 'SERVICE=ST  LGWR  ASYNC ' scope=both; 

     二,理解DG三大保护模式

    Maximum Availability Maximum Performance Maximum Protection
    AFFIRM NOAFFIRM AFFIRM
    SYNC ASYNC SYNC

    1.最大可用性模式(Maximum Availability)

      1)该模式提供了仅次于“最大保护模式”的数据保护能力;

      2)要求至少一个物理备库收到重做日志后,主库的事务才能够提交;

      3)主库找不到合适的备库写入时,主库不会关闭,而是临时降低到“最大性能模式”模式,直到问题得到处理;

      4)优点:该模式可以在没有问题出现的情况下,保证备库没有数据丢失,是一种折中的方法;

      5)缺点:在正常运行的过程中缺点是主库的性能受到诸多因素的影响。

    2.最大性能模式(Maximum Performance)

      1)该模式是默认模式,可以保证主数据库的最高可用性;

      2)保证主库运行过程中不受备库的影响,主库事务正常提交,不因备库的任何问题影响到主库的运行;

      3)优点:避免了备库对主数据库的性能和可用性影响;

      4)缺点:如果与主库提交的事务相关的恢复数据没有发送到备库,这些事务数据将被丢失,不能保证数据无损失。

    3.最大保护模式(Maximum Protection)

      1)这种模式提供了最高级别的数据保护能力;

      2)要求至少一个物理备库收到重做日志后,主库的事务才能够提交;

      3)主库找不到合适的备库写入时,主库会自动关闭,防止未受保护的数据出现;

      4)优点:该模式可以保证备库没有数据丢失;

      5)缺点:主库的自动关闭会影响到主库的可用性,同时需要备库恢复后才能提交,对网络等客观条件要求非常的高,主库的性能会因此受到非常大的冲击。

     三,了解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之前相同。
    考虑到可能发生Data Guard 角色转换,即switchover/failover,可以在距离备库较近的地方也配置Far Sync实例,这个Far Sync实例只有在当前的备库切换为主库后才启用。
    考虑到Far Sync实例的单点故障,可以在距离主库较近的地点配置2个Far Sync实例,起到备用的作用

    理论图:主传给FS1 节点再由FS1节点传给备库然后备库写到磁盘,F1宕机后由F2接管,完成一个高可用架构

    图:

    四,配置FAR SYNC

       01, 系统描述

    角色 主库 备库 far sync节点一 far sync节点二
    IP地址 192.168.0.31 192.168.0.32 192.168.0.33 192.168.0.34
    hostsname node12c01 node12c02 node12c03 node12c04
    DB_unique_name node12c01 node12c02 node12c03 node12c04
    实例名 orcl orcl orcl orcl
    监听服务 见下 见下 见下 见下
    控制文件

    /orcl/app/oracle/oradata/orcl/control01.ctl,

    /orcl/app/oracle/fast_recovery_area/

    orcl/control02.ctl

    见左 见左

    见左

    主库监听:

     1 [oracle@node12c01 admin]$ cat listener.ora   --- 主库与备库DG状态,这个是不需要更改的
     2 # listener.ora Network Configuration File: /orcl/app/oracle/product/12.1.0/db_1/network/admin/listener.ora
     3 # Generated by Oracle configuration tools.
     4 
     5 SID_LIST_LISTENER =
     6   (SID_LIST =
     7     (SID_DESC =
     8       (SID_NAME = PLSExtProc)
     9       (ORACLE_HOME = /orcl/app/oracle/product/12.1.0/db_1/)
    10       (PROGRAM = extproc)
    11     )
    12     (SID_DESC =
    13       (GLOBAL_DBNAME = NODE12C01)
    14       (ORACLE_HOME = /orcl/app/oracle/product/12.1.0/db_1)
    15       (SID_NAME = orcl)
    16     )
    17     (SID_DESC =
    18       (GLOBAL_DBNAME = NODE12C01_DGMGRL)
    19       (ORACLE_HOME = /orcl/app/oracle/product/12.1.0/db_1)
    20       (SID_NAME = orcl)
    21     )
    22     (SID_DESC =
    23       (GLOBAL_DBNAME = node12c)
    24       (ORACLE_HOME = /orcl/app/oracle/product/12.1.0/db_1)
    25       (SID_NAME = ORCL)
    26     )
    27   )
    28 
    29 LISTENER =
    30   (DESCRIPTION_LIST =
    31     (DESCRIPTION =
    32       (ADDRESS = (PROTOCOL = TCP)(HOST = node12c01)(PORT = 1521))
    33     )
    34     (DESCRIPTION =
    35       (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    36     )
    37   )
    38 
    39 ADR_BASE_LISTENER = /orcl/app/oracle/
    View Code
     1 # tnsnames.ora Network Configuration File: /orcl/app/oracle/product/12.1.0/db_1/network/admin/tnsnames.ora
     2 # Generated by Oracle configuration tools.
     3 
     4 LISTENER_ORCL =
     5   (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.31)(PORT = 1521))
     6 
     7 ORCL =              //---DG配置的
     8   (DESCRIPTION =
     9     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.31)(PORT = 1521))
    10     (CONNECT_DATA =
    11       (SERVER = DEDICATED)
    12       (SERVICE_NAME = NODE12C01)
    13       (UR=A)
    14     )
    15   )
    16 node12c01 =   //--需要tnsping 互通的节点都写上
    17   (DESCRIPTION =
    18     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.31)(PORT = 1521))
    19     (CONNECT_DATA =
    20       (SERVER = DEDICATED)
    21       (SERVICE_NAME = NODE12C01)   这个对应着服务的名字DB_unique_name的
    22       (UR=A)
    23     )
    24   )
    25 node12c02 =
    26   (DESCRIPTION =
    27     (ADDRESS_LIST =
    28       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.32)(PORT = 1521))
    29     )
    30     (CONNECT_DATA =
    31       (SERVICE_NAME = NODE12C02)
    32       (UR=A)
    33     )
    34   )
    35 node12c03 =
    36   (DESCRIPTION =
    37     (ADDRESS_LIST =
    38       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.33)(PORT = 1521))
    39     )
    40     (CONNECT_DATA =
    41       (SERVICE_NAME = NODE12C03)
    42       (UR=A)
    43     )
    44   )
    45 node12c04 =
    46   (DESCRIPTION =
    47     (ADDRESS_LIST =
    48       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.34)(PORT = 1521))
    49     )
    50     (CONNECT_DATA =
    51       (SERVICE_NAME = NODE12C04)
    52       (UR=A)
    53     )
    54   )
    View Code

    备库监听:

     1 [oracle@node12c02 admin]$ cat listener.ora
     2 # listener.ora Network Configuration File: /orcl/app/oracle/product/12.1.0/db_1/network/admin/listener.ora
     3 # Generated by Oracle configuration tools.
     4 
     5 SID_LIST_LISTENER =
     6   (SID_LIST =
     7     (SID_DESC =
     8       (SID_NAME = PLSExtProc)
     9       (ORACLE_HOME = /orcl/app/oracle/product/12.1.0/db_1/)
    10       (PROGRAM = extproc)
    11     )
    12     (SID_DESC =
    13       (GLOBAL_DBNAME = NODE12C02)
    14       (ORACLE_HOME = /orcl/app/oracle/product/12.1.0/db_1)
    15       (SID_NAME = orcl)
    16     )
    17     (SID_DESC =
    18       (GLOBAL_DBNAME = NODE12C02_DGMGRL)
    19       (ORACLE_HOME = /orcl/app/oracle/product/12.1.0/db_1)
    20       (SID_NAME = orcl)
    21     )
    22   )
    23 
    24 LISTENER =
    25   (DESCRIPTION_LIST =
    26     (DESCRIPTION =
    27       (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    28     )
    29     (DESCRIPTION =
    30       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.32)(PORT = 1521))
    31     )
    32   )
    33 
    34 ADR_BASE_LISTENER = /orcl/app/oracle
    View Code
     1 [oracle@node12c02 admin]$ cat tnsnames.ora
     2 # tnsnames.ora Network Configuration File: /orcl/app/oracle/product/12.1.0/db_1/network/admin/tnsnames.ora
     3 # Generated by Oracle configuration tools.
     4 
     5 LISTENER_ORCL =
     6   (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.32)(PORT = 1521))
     7 
     8 node12c01 =
     9   (DESCRIPTION =
    10     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.31)(PORT = 1521))
    11     (CONNECT_DATA =
    12       (SERVER = DEDICATED)
    13       (SERVICE_NAME = NODE12C01)
    14       (UR=A)
    15     )
    16   )
    17 node12c02 =
    18   (DESCRIPTION =
    19     (ADDRESS_LIST =
    20       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.32)(PORT = 1521))
    21     )
    22     (CONNECT_DATA =
    23       (SERVICE_NAME = NODE12C02)
    24       (UR=A)
    25     )
    26   )
    27 ORCL =
    28   (DESCRIPTION =
    29     (ADDRESS_LIST =
    30       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.32)(PORT = 1521))
    31     )
    32     (CONNECT_DATA =
    33       (SERVICE_NAME = NODE12C02)
    34       (UR=A)
    35     )
    36   )
    37 node12c03 =
    38   (DESCRIPTION =
    39     (ADDRESS_LIST =
    40       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.33)(PORT = 1521))
    41     )
    42     (CONNECT_DATA =
    43       (SERVICE_NAME = NODE12C03)
    44       (UR=A)
    45     )
    46   )
    47 node12c04 =
    48   (DESCRIPTION =
    49     (ADDRESS_LIST =
    50       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.34)(PORT = 1521))
    51     )
    52     (CONNECT_DATA =
    53       (SERVICE_NAME = NODE12C04)
    54       (UR=A)
    55     )
    56   )
    View Code

    FS节点一监听:

     1 [oracle@node12c03 admin]$ cat listener.ora
     2 # listener.ora Network Configuration File: /orcl/app/oracle/product/12.1.0/db_1/network/admin/listener.ora
     3 # Generated by Oracle configuration tools.
     4 
     5 SID_LIST_LISTENER =
     6   (SID_LIST =
     7     (SID_DESC =
     8       (SID_NAME = PLSExtProc)
     9       (ORACLE_HOME = /orcl/app/oracle/product/12.1.0/db_1/)
    10       (PROGRAM = extproc)
    11     )
    12     (SID_DESC =
    13       (GLOBAL_DBNAME = NODE12C03)
    14       (ORACLE_HOME = /orcl/app/oracle/product/12.1.0/db_1)
    15       (SID_NAME = orcl)
    16     )
    17   )
    18 LISTENER =
    19   (DESCRIPTION_LIST =
    20     (DESCRIPTION =
    21       (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    22     )
    23     (DESCRIPTION =
    24       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.33)(PORT = 1521))
    25     )
    26   )
    27 
    28 ADR_BASE_LISTENER = /orcl/app/oracle
    View Code
     1 [oracle@node12c03 admin]$ cat tnsnames.ora
     2 # tnsnames.ora Network Configuration File: /orcl/app/oracle/product/12.1.0/db_1/network/admin/tnsnames.ora
     3 # Generated by Oracle configuration tools.
     4 
     5 LISTENER_ORCL =
     6   (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.33)(PORT = 1521))
     7 ORCL =
     8   (DESCRIPTION =
     9     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.31)(PORT = 1521))
    10     (CONNECT_DATA =
    11       (SERVER = DEDICATED)
    12       (SERVICE_NAME = NODE12C01)
    13       (UR=A)
    14     )
    15   )
    16 node12c01 =
    17   (DESCRIPTION =
    18     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.31)(PORT = 1521))
    19     (CONNECT_DATA =
    20       (SERVER = DEDICATED)
    21       (SERVICE_NAME = NODE12C01)
    22       (UR=A)
    23     )
    24   )
    25 node12c02 =
    26   (DESCRIPTION =
    27     (ADDRESS_LIST =
    28       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.32)(PORT = 1521))
    29     )
    30     (CONNECT_DATA =
    31       (SERVICE_NAME = NODE12C02)
    32       (UR=A)
    33     )
    34   )
    35 node12c03 =
    36   (DESCRIPTION =
    37     (ADDRESS_LIST =
    38       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.33)(PORT = 1521))
    39     )
    40     (CONNECT_DATA =
    41       (SERVICE_NAME = NODE12C03)
    42       (UR=A)
    43     )
    44   )
    45 node12c04 =
    46   (DESCRIPTION =
    47     (ADDRESS_LIST =
    48       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.34)(PORT = 1521))
    49     )
    50     (CONNECT_DATA =
    51       (SERVICE_NAME = NODE12C04)
    52       (UR=A)
    53     )
    54   )
    View Code

    FS节点二监听:

     1 [oracle@node12c04 admin]$ cat listener.ora
     2 # listener.ora Network Configuration File: /orcl/app/oracle/product/12.1.0/db_1/network/admin/listener.ora
     3 # Generated by Oracle configuration tools.
     4 
     5 SID_LIST_LISTENER =
     6   (SID_LIST =
     7     (SID_DESC =
     8       (SID_NAME = PLSExtProc)
     9       (ORACLE_HOME = /orcl/app/oracle/product/12.1.0/db_1/)
    10       (PROGRAM = extproc)
    11     )
    12     (SID_DESC =
    13       (GLOBAL_DBNAME = NODE12C04)
    14       (ORACLE_HOME = /orcl/app/oracle/product/12.1.0/db_1)
    15       (SID_NAME = orcl)
    16     )
    17   )
    18 LISTENER =
    19   (DESCRIPTION_LIST =
    20     (DESCRIPTION =
    21       (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    22     )
    23     (DESCRIPTION =
    24       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.34)(PORT = 1521))
    25     )
    26   )
    27 
    28 ADR_BASE_LISTENER = /orcl/app/oracle
    View Code
     1 [oracle@node12c04 admin]$ cat tnsnames.ora
     2 # tnsnames.ora Network Configuration File: /orcl/app/oracle/product/12.1.0/db_1/network/admin/tnsnames.ora
     3 # Generated by Oracle configuration tools.
     4 
     5 LISTENER_ORCL =
     6   (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.31)(PORT = 1521))
     7 
     8 node12c01 =
     9   (DESCRIPTION =
    10     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.31)(PORT = 1521))
    11     (CONNECT_DATA =
    12       (SERVER = DEDICATED)
    13       (SERVICE_NAME = NODE12C01)
    14       (UR=A)
    15     )
    16   )
    17 node12c02 =
    18   (DESCRIPTION =
    19     (ADDRESS_LIST =
    20       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.32)(PORT = 1521))
    21     )
    22     (CONNECT_DATA =
    23       (SERVICE_NAME = NODE12C02)
    24       (UR=A)
    25     )
    26   )
    27 ORCL =
    28   (DESCRIPTION =
    29     (ADDRESS_LIST =
    30       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.32)(PORT = 1521))
    31     )
    32     (CONNECT_DATA =
    33       (SERVICE_NAME = NODE12C02)
    34       (UR=A)
    35     )
    36   )
    37 node12c03 =
    38   (DESCRIPTION =
    39     (ADDRESS_LIST =
    40       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.33)(PORT = 1521))
    41     )
    42     (CONNECT_DATA =
    43       (SERVICE_NAME = NODE12C03)
    44       (UR=A)
    45     )
    46   )
    47 node12c04 =
    48   (DESCRIPTION =
    49     (ADDRESS_LIST =
    50       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.34)(PORT = 1521))
    51     )
    52     (CONNECT_DATA =
    53       (SERVICE_NAME = NODE12C04)
    54       (UR=A)
    55     )
    56   )
    View Code

    每个节点配置好后tnsping 能互通

      02,环境框架部署

        001,必须搭建好12C的DG为基础,详情请看>>>

         FAR SYNC的两台服务器的话直接克隆的备库主机,克隆后删除数据文件即可,

         重新搭建的话只需要ORACLE软件,不需要建立数据库

        002,(主)创建文件

    SQL > alter database create far sync instance controlfile as '/orcl/app/fs01.ctl'; --创建控制文件
    SQL >  create pfile='/orcl/app/initorcl.ora' from spfile; --创建pfile文件
    SQL >exit
    [oracle@node12c01 admin]$ ll /orcl/app/
    total 18388
    -rw-r-----  1 oracle oinstall 18825216 Apr  8 03:15 fs01.ctl
    -rw-r--r--  1 oracle oinstall     1888 Apr  8 03:16 initorcl.ora
    drwxrwxr-x 11 oracle oinstall      173 Apr  2 05:28 oracle
    drwxrwx---  5 oracle oinstall       89 Apr  2 02:54 oraInventory

        003,(主)传输文件

    scp /orcl/app/fs01.ctl 192.168.0.33:/orcl/app/oracle/product/12.1.0/db_1/dbs/
    scp /orcl/app/initorcl.ora 192.168.0.33:/orcl/app/oracle/product/12.1.0/db_1/dbs/
    scp /orcl/app/oracle/product/12.1.0/db_1/dbs/orapworcl 192.168.0.33:/orcl/app/oracle/product/12.1.0/db_1/dbs/
    --拷贝密码文件
    
    
    scp /orcl/app/fs01.ctl 192.168.0.34:/orcl/app/oracle/product/12.1.0/db_1/dbs/
    scp /orcl/app/initorcl.ora192.168.0.34:/orcl/app/oracle/product/12.1.0/db_1/dbs/
    scp /orcl/app/oracle/product/12.1.0/db_1/dbs/orapworcl 192.168.0.34:/orcl/app/oracle/product/12.1.0/db_1/dbs/
    --拷贝密码文件
    View Code     

        004,FAR SRNC节点一

    配置listener.ora和tnsnames.ora
    配置内容见上文表格内容配置
    同配置可直接拷贝,不同的话,更改对应名字IP即可

        004,FAR SRNC节点二

    配置listener.ora和tnsnames.ora
    配置内容见上文表格内容配置
    同配置可直接拷贝,不同的话,更改对应名字IP即

      03,主库部署

    配置参数项:

    成功后的配置项

      1 SQL> show parameter
      2 
      3 NAME                     TYPE     VALUE
      4 ------------------------------------ ----------- ------------------------------
      5 DBFIPS_140                 boolean     FALSE
      6 O7_DICTIONARY_ACCESSIBILITY         boolean     FALSE
      7 active_instance_count             integer
      8 allow_global_dblinks             boolean     FALSE
      9 allow_group_access_to_sga         boolean     FALSE
     10 approx_for_aggregation             boolean     FALSE
     11 approx_for_count_distinct         boolean     FALSE
     12 approx_for_percentile             string     none
     13 aq_tm_processes              integer     1
     14 archive_lag_target             integer     0
     15 asm_diskgroups                 string
     16 
     17 NAME                     TYPE     VALUE
     18 ------------------------------------ ----------- ------------------------------
     19 asm_diskstring                 string
     20 asm_io_processes             integer     20
     21 asm_power_limit              integer     1
     22 asm_preferred_read_failure_groups    string
     23 audit_file_dest              string     /orcl/app/oracle/admin/orcl/ad
     24                          ump
     25 audit_sys_operations             boolean     TRUE
     26 audit_syslog_level             string
     27 audit_trail                 string     DB
     28 autotask_max_active_pdbs         integer     2
     29 awr_pdb_autoflush_enabled         boolean     FALSE
     30 
     31 NAME                     TYPE     VALUE
     32 ------------------------------------ ----------- ------------------------------
     33 awr_snapshot_time_offset         integer     0
     34 background_core_dump             string     partial
     35 background_dump_dest             string     /orcl/app/oracle/product/12.1.
     36                          0/db_1/rdbms/log
     37 backup_tape_io_slaves             boolean     FALSE
     38 bitmap_merge_area_size             integer     1048576
     39 blank_trimming                 boolean     FALSE
     40 buffer_pool_keep             string
     41 buffer_pool_recycle             string
     42 cdb_cluster                 boolean     FALSE
     43 cdb_cluster_name             string     NODE12C01
     44 
     45 NAME                     TYPE     VALUE
     46 ------------------------------------ ----------- ------------------------------
     47 cell_offload_compaction          string     ADAPTIVE
     48 cell_offload_decryption          boolean     TRUE
     49 cell_offload_parameters          string
     50 cell_offload_plan_display         string     AUTO
     51 cell_offload_processing          boolean     TRUE
     52 cell_offloadgroup_name             string
     53 circuits                 integer
     54 client_result_cache_lag          big integer 3000
     55 client_result_cache_size         big integer 0
     56 clonedb                  boolean     FALSE
     57 clonedb_dir                 string
     58 
     59 NAME                     TYPE     VALUE
     60 ------------------------------------ ----------- ------------------------------
     61 cluster_database             boolean     FALSE
     62 cluster_database_instances         integer     1
     63 cluster_interconnects             string
     64 commit_logging                 string
     65 commit_point_strength             integer     1
     66 commit_wait                 string
     67 commit_write                 string
     68 common_user_prefix             string     C##
     69 compatible                 string     12.2.0
     70 connection_brokers             string     ((TYPE=DEDICATED)(BROKERS=1)),
     71                           ((TYPE=EMON)(BROKERS=1))
     72 
     73 NAME                     TYPE     VALUE
     74 ------------------------------------ ----------- ------------------------------
     75 containers_parallel_degree         integer     65535
     76 control_file_record_keep_time         integer     7
     77 control_files                 string     /orcl/app/oracle/oradata/orcl/
     78                          control01.ctl, /orcl/app/oracl
     79                          e/fast_recovery_area/orcl/cont
     80                          rol02.ctl
     81 control_management_pack_access         string     DIAGNOSTIC+TUNING
     82 core_dump_dest                 string     /orcl/app/oracle/diag/rdbms/no
     83                          de12c01/orcl/cdump
     84 cpu_count                 integer     2
     85 create_bitmap_area_size          integer     8388608
     86 
     87 NAME                     TYPE     VALUE
     88 ------------------------------------ ----------- ------------------------------
     89 create_stored_outlines             string
     90 cursor_bind_capture_destination      string     memory+disk
     91 cursor_invalidation             string     IMMEDIATE
     92 cursor_sharing                 string     EXACT
     93 cursor_space_for_time             boolean     FALSE
     94 data_guard_sync_latency          integer     0
     95 data_transfer_cache_size         big integer 0
     96 db_16k_cache_size             big integer 0
     97 db_2k_cache_size             big integer 0
     98 db_32k_cache_size             big integer 0
     99 db_4k_cache_size             big integer 0
    100 
    101 NAME                     TYPE     VALUE
    102 ------------------------------------ ----------- ------------------------------
    103 db_8k_cache_size             big integer 0
    104 db_big_table_cache_percent_target    string     0
    105 db_block_buffers             integer     0
    106 db_block_checking             string     FALSE
    107 db_block_checksum             string     TYPICAL
    108 db_block_size                 integer     8192
    109 db_cache_advice              string     ON
    110 db_cache_size                 big integer 0
    111 db_create_file_dest             string
    112 db_create_online_log_dest_1         string
    113 db_create_online_log_dest_2         string
    114 
    115 NAME                     TYPE     VALUE
    116 ------------------------------------ ----------- ------------------------------
    117 db_create_online_log_dest_3         string
    118 db_create_online_log_dest_4         string
    119 db_create_online_log_dest_5         string
    120 db_domain                 string
    121 db_file_multiblock_read_count         integer     128
    122 db_file_name_convert             string
    123 db_files                 integer     200
    124 db_flash_cache_file             string
    125 db_flash_cache_size             big integer 0
    126 db_flashback_retention_target         integer     1440
    127 db_index_compression_inheritance     string     NONE
    128 
    129 NAME                     TYPE     VALUE
    130 ------------------------------------ ----------- ------------------------------
    131 db_keep_cache_size             big integer 0
    132 db_lost_write_protect             string     NONE
    133 db_name                  string     orcl
    134 db_performance_profile             string
    135 db_recovery_file_dest             string     /orcl/app/oracle/fast_recovery
    136                          _area/orcl
    137 db_recovery_file_dest_size         big integer 1G
    138 db_recycle_cache_size             big integer 0
    139 db_securefile                 string     PREFERRED
    140 db_ultra_safe                 string     OFF
    141 db_unique_name                 string     NODE12C01
    142 
    143 NAME                     TYPE     VALUE
    144 ------------------------------------ ----------- ------------------------------
    145 db_unrecoverable_scn_tracking         boolean     TRUE
    146 db_writer_processes             integer     1
    147 dbwr_io_slaves                 integer     0
    148 ddl_lock_timeout             integer     0
    149 default_sharing              string     metadata
    150 deferred_segment_creation         boolean     TRUE
    151 dg_broker_config_file1             string     /orcl/app/oracle/product/12.1.
    152                          0/db_1/dbs/dr1NODE12C01.dat
    153 dg_broker_config_file2             string     /orcl/app/oracle/product/12.1.
    154                          0/db_1/dbs/dr2NODE12C01.dat
    155 dg_broker_start              boolean     TRUE
    156 
    157 NAME                     TYPE     VALUE
    158 ------------------------------------ ----------- ------------------------------
    159 diagnostic_dest              string     /orcl/app/oracle
    160 disable_pdb_feature             big integer 0
    161 disk_asynch_io                 boolean     TRUE
    162 dispatchers                 string     (PROTOCOL=TCP) (SERVICE=orclXD
    163                          B)
    164 distributed_lock_timeout         integer     60
    165 dml_locks                 integer     2076
    166 dnfs_batch_size              integer     4096
    167 dst_upgrade_insert_conv          boolean     TRUE
    168 enable_automatic_maintenance_pdb     boolean     TRUE
    169 enable_ddl_logging             boolean     FALSE
    170 
    171 NAME                     TYPE     VALUE
    172 ------------------------------------ ----------- ------------------------------
    173 enable_dnfs_dispatcher             boolean     FALSE
    174 enable_goldengate_replication         boolean     FALSE
    175 enable_pluggable_database         boolean     TRUE
    176 enabled_PDBs_on_standby          string     *
    177 encrypt_new_tablespaces          string     CLOUD_ONLY
    178 event                     string
    179 exafusion_enabled             integer     1
    180 external_keystore_credential_locatio string
    181 n
    182 fal_client                 string
    183 fal_server                 string     node12c02,node12c03,node12c04
    184 
    185 NAME                     TYPE     VALUE
    186 ------------------------------------ ----------- ------------------------------
    187 fast_start_io_target             integer     0
    188 fast_start_mttr_target             integer     0
    189 fast_start_parallel_rollback         string     LOW
    190 file_mapping                 boolean     FALSE
    191 fileio_network_adapters          string
    192 filesystemio_options             string     none
    193 fixed_date                 string
    194 gcs_server_processes             integer     0
    195 global_names                 boolean     FALSE
    196 global_txn_processes             integer     1
    197 hash_area_size                 integer     131072
    198 
    199 NAME                     TYPE     VALUE
    200 ------------------------------------ ----------- ------------------------------
    201 heat_map                 string     OFF
    202 hi_shared_memory_address         integer     0
    203 hs_autoregister              boolean     TRUE
    204 ifile                     file
    205 inmemory_adg_enabled             boolean     TRUE
    206 inmemory_clause_default          string
    207 inmemory_expressions_usage         string     ENABLE
    208 inmemory_force                 string     DEFAULT
    209 inmemory_max_populate_servers         integer     0
    210 inmemory_query                 string     ENABLE
    211 inmemory_size                 big integer 0
    212 
    213 NAME                     TYPE     VALUE
    214 ------------------------------------ ----------- ------------------------------
    215 inmemory_trickle_repopulate_servers_ integer     1
    216 percent
    217 inmemory_virtual_columns         string     MANUAL
    218 instance_abort_delay_time         integer     0
    219 instance_groups              string
    220 instance_mode                 string     READ-WRITE
    221 instance_name                 string     orcl
    222 instance_number              integer     0
    223 instance_type                 string     RDBMS
    224 instant_restore              boolean     FALSE
    225 java_jit_enabled             boolean     TRUE
    226 
    227 NAME                     TYPE     VALUE
    228 ------------------------------------ ----------- ------------------------------
    229 java_max_sessionspace_size         integer     0
    230 java_pool_size                 big integer 0
    231 java_restrict                 string     none
    232 java_soft_sessionspace_limit         integer     0
    233 job_queue_processes             integer     10
    234 large_pool_size              big integer 0
    235 ldap_directory_access             string     NONE
    236 ldap_directory_sysauth             string     no
    237 license_max_sessions             integer     0
    238 license_max_users             integer     0
    239 license_sessions_warning         integer     0
    240 
    241 NAME                     TYPE     VALUE
    242 ------------------------------------ ----------- ------------------------------
    243 listener_networks             string
    244 local_listener                 string     LISTENER_ORCL
    245 lock_name_space              string
    246 lock_sga                 boolean     FALSE
    247 log_archive_config             string     dg_config=(NODE12C01,NODE12C02
    248                          ,NODE12C03,NODE12C04)
    249 log_archive_dest             string
    250 log_archive_dest_1             string     location=/orcl/app/oracle/orad
    251                          ata/orcl/archivelog valid_for=
    252                          (online_logfile,primary_role)
    253                          db_unique_name=NODE12C01
    254 
    255 NAME                     TYPE     VALUE
    256 ------------------------------------ ----------- ------------------------------
    257 log_archive_dest_10             string
    258 log_archive_dest_11             string
    259 log_archive_dest_12             string
    260 log_archive_dest_13             string
    261 log_archive_dest_14             string
    262 log_archive_dest_15             string
    263 log_archive_dest_16             string
    264 log_archive_dest_17             string
    265 log_archive_dest_18             string
    266 log_archive_dest_19             string
    267 log_archive_dest_2             string     service=NODE12C03 sync affirm
    268 
    269 NAME                     TYPE     VALUE
    270 ------------------------------------ ----------- ------------------------------
    271                          max_failure=1 alternate=log_ar
    272                          chive_dest_3 valid_for=(online
    273                          _logfiles,primary_role) db_uni
    274                          que_name=node12c03
    275 log_archive_dest_20             string
    276 log_archive_dest_21             string
    277 log_archive_dest_22             string
    278 log_archive_dest_23             string
    279 log_archive_dest_24             string
    280 log_archive_dest_25             string
    281 log_archive_dest_26             string
    282 
    283 NAME                     TYPE     VALUE
    284 ------------------------------------ ----------- ------------------------------
    285 log_archive_dest_27             string
    286 log_archive_dest_28             string
    287 log_archive_dest_29             string
    288 log_archive_dest_3             string     service=NODE12C04 async altern
    289                          ate=log_archive_dest_2 valid_f
    290                          or=(online_logfiles,primary_ro
    291                          le) db_unique_name=NODE12C04
    292 log_archive_dest_30             string
    293 log_archive_dest_31             string
    294 log_archive_dest_4             string
    295 log_archive_dest_5             string
    296 
    297 NAME                     TYPE     VALUE
    298 ------------------------------------ ----------- ------------------------------
    299 log_archive_dest_6             string
    300 log_archive_dest_7             string
    301 log_archive_dest_8             string
    302 log_archive_dest_9             string
    303 log_archive_dest_state_1         string     ENABLE
    304 log_archive_dest_state_10         string     enable
    305 log_archive_dest_state_11         string     enable
    306 log_archive_dest_state_12         string     enable
    307 log_archive_dest_state_13         string     enable
    308 log_archive_dest_state_14         string     enable
    309 log_archive_dest_state_15         string     enable
    310 
    311 NAME                     TYPE     VALUE
    312 ------------------------------------ ----------- ------------------------------
    313 log_archive_dest_state_16         string     enable
    314 log_archive_dest_state_17         string     enable
    315 log_archive_dest_state_18         string     enable
    316 log_archive_dest_state_19         string     enable
    317 log_archive_dest_state_2         string     ENABLE
    318 log_archive_dest_state_20         string     enable
    319 log_archive_dest_state_21         string     enable
    320 log_archive_dest_state_22         string     enable
    321 log_archive_dest_state_23         string     enable
    322 log_archive_dest_state_24         string     enable
    323 log_archive_dest_state_25         string     enable
    324 
    325 NAME                     TYPE     VALUE
    326 ------------------------------------ ----------- ------------------------------
    327 log_archive_dest_state_26         string     enable
    328 log_archive_dest_state_27         string     enable
    329 log_archive_dest_state_28         string     enable
    330 log_archive_dest_state_29         string     enable
    331 log_archive_dest_state_3         string     ENABLE
    332 log_archive_dest_state_30         string     enable
    333 log_archive_dest_state_31         string     enable
    334 log_archive_dest_state_4         string     ENABLE
    335 log_archive_dest_state_5         string     enable
    336 log_archive_dest_state_6         string     enable
    337 log_archive_dest_state_7         string     enable
    338 
    339 NAME                     TYPE     VALUE
    340 ------------------------------------ ----------- ------------------------------
    341 log_archive_dest_state_8         string     enable
    342 log_archive_dest_state_9         string     enable
    343 log_archive_duplex_dest          string
    344 log_archive_format             string     %t_%s_%r.dbf
    345 log_archive_max_processes         integer     4
    346 log_archive_min_succeed_dest         integer     1
    347 log_archive_start             boolean     FALSE
    348 log_archive_trace             integer     0
    349 log_buffer                 big integer 7456K
    350 log_checkpoint_interval          integer     0
    351 log_checkpoint_timeout             integer     1800
    352 
    353 NAME                     TYPE     VALUE
    354 ------------------------------------ ----------- ------------------------------
    355 log_checkpoints_to_alert         boolean     FALSE
    356 log_file_name_convert             string
    357 long_module_action             boolean     TRUE
    358 max_datapump_jobs_per_pdb         integer     100
    359 max_dispatchers              integer
    360 max_dump_file_size             string     unlimited
    361 max_idle_time                 integer     0
    362 max_iops                 integer     0
    363 max_mbps                 integer     0
    364 max_pdbs                 integer     4098
    365 max_shared_servers             integer
    366 
    367 NAME                     TYPE     VALUE
    368 ------------------------------------ ----------- ------------------------------
    369 max_string_size              string     STANDARD
    370 memory_max_target             big integer 0
    371 memory_target                 big integer 0
    372 nls_calendar                 string
    373 nls_comp                 string     BINARY
    374 nls_currency                 string
    375 nls_date_format              string
    376 nls_date_language             string
    377 nls_dual_currency             string
    378 nls_iso_currency             string
    379 nls_language                 string     AMERICAN
    380 
    381 NAME                     TYPE     VALUE
    382 ------------------------------------ ----------- ------------------------------
    383 nls_length_semantics             string     BYTE
    384 nls_nchar_conv_excp             string     FALSE
    385 nls_numeric_characters             string
    386 nls_sort                 string
    387 nls_territory                 string     AMERICA
    388 nls_time_format              string
    389 nls_time_tz_format             string
    390 nls_timestamp_format             string
    391 nls_timestamp_tz_format          string
    392 noncdb_compatible             boolean     FALSE
    393 object_cache_max_size_percent         integer     10
    394 
    395 NAME                     TYPE     VALUE
    396 ------------------------------------ ----------- ------------------------------
    397 object_cache_optimal_size         integer     10240000
    398 ofs_threads                 integer     4
    399 olap_page_pool_size             big integer 0
    400 one_step_plugin_for_pdb_with_tde     boolean     FALSE
    401 open_cursors                 integer     300
    402 open_links                 integer     4
    403 open_links_per_instance          integer     4
    404 optimizer_adaptive_plans         boolean     TRUE
    405 optimizer_adaptive_reporting_only    boolean     FALSE
    406 optimizer_adaptive_statistics         boolean     FALSE
    407 optimizer_capture_sql_plan_baselines boolean     FALSE
    408 
    409 NAME                     TYPE     VALUE
    410 ------------------------------------ ----------- ------------------------------
    411 optimizer_dynamic_sampling         integer     2
    412 optimizer_features_enable         string     12.2.0.1
    413 optimizer_index_caching          integer     0
    414 optimizer_index_cost_adj         integer     100
    415 optimizer_inmemory_aware         boolean     TRUE
    416 optimizer_mode                 string     ALL_ROWS
    417 optimizer_secure_view_merging         boolean     TRUE
    418 optimizer_use_invisible_indexes      boolean     FALSE
    419 optimizer_use_pending_statistics     boolean     FALSE
    420 optimizer_use_sql_plan_baselines     boolean     TRUE
    421 os_authent_prefix             string     ops$
    422 
    423 NAME                     TYPE     VALUE
    424 ------------------------------------ ----------- ------------------------------
    425 os_roles                 boolean     FALSE
    426 outbound_dblink_protocols         string     ALL
    427 parallel_adaptive_multi_user         boolean     FALSE
    428 parallel_degree_limit             string     CPU
    429 parallel_degree_policy             string     MANUAL
    430 parallel_execution_message_size      integer     16384
    431 parallel_force_local             boolean     FALSE
    432 parallel_instance_group          string
    433 parallel_max_servers             integer     80
    434 parallel_min_percent             integer     0
    435 parallel_min_servers             integer     8
    436 
    437 NAME                     TYPE     VALUE
    438 ------------------------------------ ----------- ------------------------------
    439 parallel_min_time_threshold         string     AUTO
    440 parallel_servers_target          integer     32
    441 parallel_threads_per_cpu         integer     2
    442 pdb_file_name_convert             string
    443 pdb_lockdown                 string
    444 pdb_os_credential             string
    445 permit_92_wrap_format             boolean     TRUE
    446 pga_aggregate_limit             big integer 2G
    447 pga_aggregate_target             big integer 799M
    448 plscope_settings             string     IDENTIFIERS:NONE
    449 plsql_ccflags                 string
    450 
    451 NAME                     TYPE     VALUE
    452 ------------------------------------ ----------- ------------------------------
    453 plsql_code_type              string     INTERPRETED
    454 plsql_debug                 boolean     FALSE
    455 plsql_optimize_level             integer     2
    456 plsql_v2_compatibility             boolean     FALSE
    457 plsql_warnings                 string     DISABLE:ALL
    458 pre_page_sga                 boolean     TRUE
    459 processes                 integer     300
    460 processor_group_name             string
    461 query_rewrite_enabled             string     TRUE
    462 query_rewrite_integrity          string     enforced
    463 rdbms_server_dn              string
    464 
    465 NAME                     TYPE     VALUE
    466 ------------------------------------ ----------- ------------------------------
    467 read_only_open_delayed             boolean     FALSE
    468 recovery_parallelism             integer     0
    469 recyclebin                 string     on
    470 redo_transport_user             string
    471 remote_dependencies_mode         string     TIMESTAMP
    472 remote_listener              string
    473 remote_login_passwordfile         string     EXCLUSIVE
    474 remote_os_authent             boolean     FALSE
    475 remote_os_roles              boolean     FALSE
    476 remote_recovery_file_dest         string
    477 replication_dependency_tracking      boolean     TRUE
    478 
    479 NAME                     TYPE     VALUE
    480 ------------------------------------ ----------- ------------------------------
    481 resource_limit                 boolean     TRUE
    482 resource_manage_goldengate         boolean     FALSE
    483 resource_manager_cpu_allocation      integer     2
    484 resource_manager_plan             string
    485 result_cache_max_result          integer     5
    486 result_cache_max_size             big integer 12M
    487 result_cache_mode             string     MANUAL
    488 result_cache_remote_expiration         integer     0
    489 resumable_timeout             integer     0
    490 rollback_segments             string
    491 sec_case_sensitive_logon         boolean     TRUE
    492 
    493 NAME                     TYPE     VALUE
    494 ------------------------------------ ----------- ------------------------------
    495 sec_max_failed_login_attempts         integer     3
    496 sec_protocol_error_further_action    string     (DROP,3)
    497 sec_protocol_error_trace_action      string     TRACE
    498 sec_return_server_release_banner     boolean     FALSE
    499 serial_reuse                 string     disable
    500 service_names                 string     NODE12C01
    501 session_cached_cursors             integer     50
    502 session_max_open_files             integer     10
    503 sessions                 integer     472
    504 sga_max_size                 big integer 2400M
    505 sga_min_size                 big integer 0
    506 
    507 NAME                     TYPE     VALUE
    508 ------------------------------------ ----------- ------------------------------
    509 sga_target                 big integer 2400M
    510 shadow_core_dump             string     partial
    511 shared_memory_address             integer     0
    512 shared_pool_reserved_size         big integer 24M
    513 shared_pool_size             big integer 0
    514 shared_server_sessions             integer
    515 shared_servers                 integer     1
    516 shrd_dupl_table_refresh_rate         integer     60
    517 skip_unusable_indexes             boolean     TRUE
    518 smtp_out_server              string
    519 sort_area_retained_size          integer     0
    520 
    521 NAME                     TYPE     VALUE
    522 ------------------------------------ ----------- ------------------------------
    523 sort_area_size                 integer     65536
    524 spatial_vector_acceleration         boolean     FALSE
    525 spfile                     string     /orcl/app/oracle/product/12.1.
    526                          0/db_1/dbs/spfileorcl.ora
    527 sql92_security                 boolean     TRUE
    528 sql_trace                 boolean     FALSE
    529 sqltune_category             string     DEFAULT
    530 standby_archive_dest             string     ?#/dbs/arch
    531 standby_db_preserve_states         string     NONE
    532 standby_file_management          string     MANUAL
    533 star_transformation_enabled         string     FALSE
    534 
    535 NAME                     TYPE     VALUE
    536 ------------------------------------ ----------- ------------------------------
    537 statistics_level             string     TYPICAL
    538 streams_pool_size             big integer 0
    539 tape_asynch_io                 boolean     TRUE
    540 target_pdbs                 integer     4
    541 temp_undo_enabled             boolean     FALSE
    542 thread                     integer     0
    543 threaded_execution             boolean     FALSE
    544 timed_os_statistics             integer     0
    545 timed_statistics             boolean     TRUE
    546 trace_enabled                 boolean     TRUE
    547 tracefile_identifier             string
    548 
    549 NAME                     TYPE     VALUE
    550 ------------------------------------ ----------- ------------------------------
    551 transactions                 integer     519
    552 transactions_per_rollback_segment    integer     5
    553 undo_management              string     AUTO
    554 undo_retention                 integer     900
    555 undo_tablespace              string     UNDOTBS1
    556 unified_audit_sga_queue_size         integer     1048576
    557 uniform_log_timestamp_format         boolean     TRUE
    558 use_dedicated_broker             boolean     FALSE
    559 use_large_pages              string     TRUE
    560 user_dump_dest                 string     /orcl/app/oracle/product/12.1.
    561                          0/db_1/rdbms/log
    562 
    563 NAME                     TYPE     VALUE
    564 ------------------------------------ ----------- ------------------------------
    565 utl_file_dir                 string
    566 workarea_size_policy             string     AUTO
    567 xml_db_events                 string     enable
    View Code

        001,DB_UNIQUE_NAME配置

    alter system set db_unique_name='NODE12C01';

        002,FAL_SERVER配置

    alter system set fal_server='node12c02,node12c03,node12c04';
      fal_server的值写的是tnsname中的服务名,这里主库上设置的fs的服务名是小写的就小写

        003,LOG_ARCHIVE_CONFIG配置

    dg_config是写db_unique_name的值。
    alter system set log_archive_config='dg_config=(node12c01,node12c02,node12c03,node12c04)';

        004,log_archive_dest 配置

    dest_1还是指向本地归档路径
    
    alter system set log_archive_dest_1='location=/orcl/app/oracle/oradata/orcl/archivelog valid_for=(online_logfile,primary_role) db_unique_name=node12c01';
    
    dest_2原来是指向备库的,现在指向fs机器,使用sync
    
     alter system set log_archive_dest_2='service=node12c03 sync affirm max_failure=1 alternate=log_archive_dest_3 valid_for=(online_logfiles,primary_role) db_unique_name=node12c03';
    
    dest_3这个就设置成指向FS2服务器的,使用async
    
    alter system set log_archive_dest_3='service=node12c04 async alternate=log_archive_dest_2 valid_for=(online_logfiles,primary_role) db_unique_name=node12c04';
    
    
    本步骤的意思就是先归档到自己本地,然后传输归档给fs,dest3是备用的,当dest2正常使用的时候,dest3不启用
    当dest2挂了,dest3才会自动启用,dest2好了,dest3会自动关闭。主到fs是sync,fs到备库是使用async同步模式来传输归档给备库。

        005, log_archive_dest_state配置

    alter system set log_archive_dest_state_3='alternate' scope=spfile;
    这里要把dest3,改成备用的模式。

      04,备库配置

    所有配置:

      1 SQL> show parameter
      2 
      3 NAME                     TYPE     VALUE
      4 ------------------------------------ ----------- ------------------------------
      5 DBFIPS_140                 boolean     FALSE
      6 O7_DICTIONARY_ACCESSIBILITY         boolean     FALSE
      7 active_instance_count             integer
      8 allow_global_dblinks             boolean     FALSE
      9 allow_group_access_to_sga         boolean     FALSE
     10 approx_for_aggregation             boolean     FALSE
     11 approx_for_count_distinct         boolean     FALSE
     12 approx_for_percentile             string     none
     13 aq_tm_processes              integer     1
     14 archive_lag_target             integer     0
     15 asm_diskgroups                 string
     16 
     17 NAME                     TYPE     VALUE
     18 ------------------------------------ ----------- ------------------------------
     19 asm_diskstring                 string
     20 asm_io_processes             integer     20
     21 asm_power_limit              integer     1
     22 asm_preferred_read_failure_groups    string
     23 audit_file_dest              string     /orcl/app/oracle/admin/orcl/ad
     24                          ump
     25 audit_sys_operations             boolean     TRUE
     26 audit_syslog_level             string
     27 audit_trail                 string     OS
     28 autotask_max_active_pdbs         integer     2
     29 awr_pdb_autoflush_enabled         boolean     FALSE
     30 
     31 NAME                     TYPE     VALUE
     32 ------------------------------------ ----------- ------------------------------
     33 awr_snapshot_time_offset         integer     0
     34 background_core_dump             string     partial
     35 background_dump_dest             string     /orcl/app/oracle/product/12.1.
     36                          0/db_1/rdbms/log
     37 backup_tape_io_slaves             boolean     FALSE
     38 bitmap_merge_area_size             integer     1048576
     39 blank_trimming                 boolean     FALSE
     40 buffer_pool_keep             string
     41 buffer_pool_recycle             string
     42 cdb_cluster                 boolean     FALSE
     43 cdb_cluster_name             string     NODE12C02
     44 
     45 NAME                     TYPE     VALUE
     46 ------------------------------------ ----------- ------------------------------
     47 cell_offload_compaction          string     ADAPTIVE
     48 cell_offload_decryption          boolean     TRUE
     49 cell_offload_parameters          string
     50 cell_offload_plan_display         string     AUTO
     51 cell_offload_processing          boolean     TRUE
     52 cell_offloadgroup_name             string
     53 circuits                 integer
     54 client_result_cache_lag          big integer 3000
     55 client_result_cache_size         big integer 0
     56 clonedb                  boolean     FALSE
     57 clonedb_dir                 string
     58 
     59 NAME                     TYPE     VALUE
     60 ------------------------------------ ----------- ------------------------------
     61 cluster_database             boolean     FALSE
     62 cluster_database_instances         integer     1
     63 cluster_interconnects             string
     64 commit_logging                 string
     65 commit_point_strength             integer     1
     66 commit_wait                 string
     67 commit_write                 string
     68 common_user_prefix             string     C##
     69 compatible                 string     12.2.0
     70 connection_brokers             string     ((TYPE=DEDICATED)(BROKERS=1)),
     71                           ((TYPE=EMON)(BROKERS=1))
     72 
     73 NAME                     TYPE     VALUE
     74 ------------------------------------ ----------- ------------------------------
     75 containers_parallel_degree         integer     65535
     76 control_file_record_keep_time         integer     7
     77 control_files                 string     /orcl/app/oracle/oradata/orcl/
     78                          control01.ctl, /orcl/app/oracl
     79                          e/fast_recovery_area/orcl/cont
     80                          rol02.ctl
     81 control_management_pack_access         string     DIAGNOSTIC+TUNING
     82 core_dump_dest                 string     /orcl/app/oracle/diag/rdbms/no
     83                          de12c02/orcl/cdump
     84 cpu_count                 integer     2
     85 create_bitmap_area_size          integer     8388608
     86 
     87 NAME                     TYPE     VALUE
     88 ------------------------------------ ----------- ------------------------------
     89 create_stored_outlines             string
     90 cursor_bind_capture_destination      string     memory+disk
     91 cursor_invalidation             string     IMMEDIATE
     92 cursor_sharing                 string     EXACT
     93 cursor_space_for_time             boolean     FALSE
     94 data_guard_sync_latency          integer     0
     95 data_transfer_cache_size         big integer 0
     96 db_16k_cache_size             big integer 0
     97 db_2k_cache_size             big integer 0
     98 db_32k_cache_size             big integer 0
     99 db_4k_cache_size             big integer 0
    100 
    101 NAME                     TYPE     VALUE
    102 ------------------------------------ ----------- ------------------------------
    103 db_8k_cache_size             big integer 0
    104 db_big_table_cache_percent_target    string     0
    105 db_block_buffers             integer     0
    106 db_block_checking             string     FALSE
    107 db_block_checksum             string     TYPICAL
    108 db_block_size                 integer     8192
    109 db_cache_advice              string     ON
    110 db_cache_size                 big integer 0
    111 db_create_file_dest             string
    112 db_create_online_log_dest_1         string
    113 db_create_online_log_dest_2         string
    114 
    115 NAME                     TYPE     VALUE
    116 ------------------------------------ ----------- ------------------------------
    117 db_create_online_log_dest_3         string
    118 db_create_online_log_dest_4         string
    119 db_create_online_log_dest_5         string
    120 db_domain                 string
    121 db_file_multiblock_read_count         integer     128
    122 db_file_name_convert             string
    123 db_files                 integer     200
    124 db_flash_cache_file             string
    125 db_flash_cache_size             big integer 0
    126 db_flashback_retention_target         integer     1440
    127 db_index_compression_inheritance     string     NONE
    128 
    129 NAME                     TYPE     VALUE
    130 ------------------------------------ ----------- ------------------------------
    131 db_keep_cache_size             big integer 0
    132 db_lost_write_protect             string     NONE
    133 db_name                  string     orcl
    134 db_performance_profile             string
    135 db_recovery_file_dest             string     /orcl/app/oracle/fast_recovery
    136                          _area/orcl
    137 db_recovery_file_dest_size         big integer 1G
    138 db_recycle_cache_size             big integer 0
    139 db_securefile                 string     PREFERRED
    140 db_ultra_safe                 string     OFF
    141 db_unique_name                 string     NODE12C02
    142 
    143 NAME                     TYPE     VALUE
    144 ------------------------------------ ----------- ------------------------------
    145 db_unrecoverable_scn_tracking         boolean     TRUE
    146 db_writer_processes             integer     1
    147 dbwr_io_slaves                 integer     0
    148 ddl_lock_timeout             integer     0
    149 default_sharing              string     metadata
    150 deferred_segment_creation         boolean     TRUE
    151 dg_broker_config_file1             string     /orcl/app/oracle/product/12.1.
    152                          0/db_1/dbs/dr1NODE12C02.dat
    153 dg_broker_config_file2             string     /orcl/app/oracle/product/12.1.
    154                          0/db_1/dbs/dr2NODE12C02.dat
    155 dg_broker_start              boolean     TRUE
    156 
    157 NAME                     TYPE     VALUE
    158 ------------------------------------ ----------- ------------------------------
    159 diagnostic_dest              string     /orcl/app/oracle
    160 disable_pdb_feature             big integer 0
    161 disk_asynch_io                 boolean     TRUE
    162 dispatchers                 string     (PROTOCOL=TCP) (SERVICE=orclXD
    163                          B)
    164 distributed_lock_timeout         integer     60
    165 dml_locks                 integer     2076
    166 dnfs_batch_size              integer     4096
    167 dst_upgrade_insert_conv          boolean     TRUE
    168 enable_automatic_maintenance_pdb     boolean     TRUE
    169 enable_ddl_logging             boolean     FALSE
    170 
    171 NAME                     TYPE     VALUE
    172 ------------------------------------ ----------- ------------------------------
    173 enable_dnfs_dispatcher             boolean     FALSE
    174 enable_goldengate_replication         boolean     FALSE
    175 enable_pluggable_database         boolean     TRUE
    176 enabled_PDBs_on_standby          string     *
    177 encrypt_new_tablespaces          string     CLOUD_ONLY
    178 event                     string
    179 exafusion_enabled             integer     1
    180 external_keystore_credential_locatio string
    181 n
    182 fal_client                 string
    183 fal_server                 string     node12c01,node12c03,node12c04
    184 
    185 NAME                     TYPE     VALUE
    186 ------------------------------------ ----------- ------------------------------
    187 fast_start_io_target             integer     0
    188 fast_start_mttr_target             integer     0
    189 fast_start_parallel_rollback         string     LOW
    190 file_mapping                 boolean     FALSE
    191 fileio_network_adapters          string
    192 filesystemio_options             string     none
    193 fixed_date                 string
    194 gcs_server_processes             integer     0
    195 global_names                 boolean     FALSE
    196 global_txn_processes             integer     1
    197 hash_area_size                 integer     131072
    198 
    199 NAME                     TYPE     VALUE
    200 ------------------------------------ ----------- ------------------------------
    201 heat_map                 string     OFF
    202 hi_shared_memory_address         integer     0
    203 hs_autoregister              boolean     TRUE
    204 ifile                     file
    205 inmemory_adg_enabled             boolean     TRUE
    206 inmemory_clause_default          string
    207 inmemory_expressions_usage         string     ENABLE
    208 inmemory_force                 string     DEFAULT
    209 inmemory_max_populate_servers         integer     0
    210 inmemory_query                 string     ENABLE
    211 inmemory_size                 big integer 0
    212 
    213 NAME                     TYPE     VALUE
    214 ------------------------------------ ----------- ------------------------------
    215 inmemory_trickle_repopulate_servers_ integer     1
    216 percent
    217 inmemory_virtual_columns         string     MANUAL
    218 instance_abort_delay_time         integer     0
    219 instance_groups              string
    220 instance_mode                 string     READ-WRITE
    221 instance_name                 string     orcl
    222 instance_number              integer     0
    223 instance_type                 string     RDBMS
    224 instant_restore              boolean     FALSE
    225 java_jit_enabled             boolean     TRUE
    226 
    227 NAME                     TYPE     VALUE
    228 ------------------------------------ ----------- ------------------------------
    229 java_max_sessionspace_size         integer     0
    230 java_pool_size                 big integer 0
    231 java_restrict                 string     none
    232 java_soft_sessionspace_limit         integer     0
    233 job_queue_processes             integer     10
    234 large_pool_size              big integer 0
    235 ldap_directory_access             string     NONE
    236 ldap_directory_sysauth             string     no
    237 license_max_sessions             integer     0
    238 license_max_users             integer     0
    239 license_sessions_warning         integer     0
    240 
    241 NAME                     TYPE     VALUE
    242 ------------------------------------ ----------- ------------------------------
    243 listener_networks             string
    244 local_listener                 string     LISTENER_ORCL
    245 lock_name_space              string
    246 lock_sga                 boolean     FALSE
    247 log_archive_config             string     dg_config=(node12c01,node12c03
    248                          ,node12c04,node12c02)
    249 log_archive_dest             string
    250 log_archive_dest_1             string     location=/orcl/app/oracle/orad
    251                          ata/orcl/archivelog VALID_FOR=
    252                          (ALL_LOGFILES,ALL_ROLES) DB_UN
    253                          IQUE_NAME=NODE12C02
    254 
    255 NAME                     TYPE     VALUE
    256 ------------------------------------ ----------- ------------------------------
    257 log_archive_dest_10             string
    258 log_archive_dest_11             string
    259 log_archive_dest_12             string
    260 log_archive_dest_13             string
    261 log_archive_dest_14             string
    262 log_archive_dest_15             string
    263 log_archive_dest_16             string
    264 log_archive_dest_17             string
    265 log_archive_dest_18             string
    266 log_archive_dest_19             string
    267 log_archive_dest_2             string     service=node12c01 ASYNC valid_
    268 
    269 NAME                     TYPE     VALUE
    270 ------------------------------------ ----------- ------------------------------
    271                          for=(online_logfiles,primary_r
    272                          ole) db_unique_name=node12c01
    273 log_archive_dest_20             string
    274 log_archive_dest_21             string
    275 log_archive_dest_22             string
    276 log_archive_dest_23             string
    277 log_archive_dest_24             string
    278 log_archive_dest_25             string
    279 log_archive_dest_26             string
    280 log_archive_dest_27             string
    281 log_archive_dest_28             string
    282 
    283 NAME                     TYPE     VALUE
    284 ------------------------------------ ----------- ------------------------------
    285 log_archive_dest_29             string
    286 log_archive_dest_3             string
    287 log_archive_dest_30             string
    288 log_archive_dest_31             string
    289 log_archive_dest_4             string
    290 log_archive_dest_5             string
    291 log_archive_dest_6             string
    292 log_archive_dest_7             string
    293 log_archive_dest_8             string
    294 log_archive_dest_9             string
    295 log_archive_dest_state_1         string     enable
    296 
    297 NAME                     TYPE     VALUE
    298 ------------------------------------ ----------- ------------------------------
    299 log_archive_dest_state_10         string     enable
    300 log_archive_dest_state_11         string     enable
    301 log_archive_dest_state_12         string     enable
    302 log_archive_dest_state_13         string     enable
    303 log_archive_dest_state_14         string     enable
    304 log_archive_dest_state_15         string     enable
    305 log_archive_dest_state_16         string     enable
    306 log_archive_dest_state_17         string     enable
    307 log_archive_dest_state_18         string     enable
    308 log_archive_dest_state_19         string     enable
    309 log_archive_dest_state_2         string     ENABLE
    310 
    311 NAME                     TYPE     VALUE
    312 ------------------------------------ ----------- ------------------------------
    313 log_archive_dest_state_20         string     enable
    314 log_archive_dest_state_21         string     enable
    315 log_archive_dest_state_22         string     enable
    316 log_archive_dest_state_23         string     enable
    317 log_archive_dest_state_24         string     enable
    318 log_archive_dest_state_25         string     enable
    319 log_archive_dest_state_26         string     enable
    320 log_archive_dest_state_27         string     enable
    321 log_archive_dest_state_28         string     enable
    322 log_archive_dest_state_29         string     enable
    323 log_archive_dest_state_3         string     enable
    324 
    325 NAME                     TYPE     VALUE
    326 ------------------------------------ ----------- ------------------------------
    327 log_archive_dest_state_30         string     enable
    328 log_archive_dest_state_31         string     enable
    329 log_archive_dest_state_4         string     enable
    330 log_archive_dest_state_5         string     enable
    331 log_archive_dest_state_6         string     enable
    332 log_archive_dest_state_7         string     enable
    333 log_archive_dest_state_8         string     enable
    334 log_archive_dest_state_9         string     enable
    335 log_archive_duplex_dest          string
    336 log_archive_format             string     %t_%s_%r.dbf
    337 log_archive_max_processes         integer     4
    338 
    339 NAME                     TYPE     VALUE
    340 ------------------------------------ ----------- ------------------------------
    341 log_archive_min_succeed_dest         integer     1
    342 log_archive_start             boolean     FALSE
    343 log_archive_trace             integer     0
    344 log_buffer                 big integer 7456K
    345 log_checkpoint_interval          integer     0
    346 log_checkpoint_timeout             integer     1800
    347 log_checkpoints_to_alert         boolean     FALSE
    348 log_file_name_convert             string
    349 long_module_action             boolean     TRUE
    350 max_datapump_jobs_per_pdb         integer     100
    351 max_dispatchers              integer
    352 
    353 NAME                     TYPE     VALUE
    354 ------------------------------------ ----------- ------------------------------
    355 max_dump_file_size             string     unlimited
    356 max_idle_time                 integer     0
    357 max_iops                 integer     0
    358 max_mbps                 integer     0
    359 max_pdbs                 integer     4098
    360 max_shared_servers             integer
    361 max_string_size              string     STANDARD
    362 memory_max_target             big integer 0
    363 memory_target                 big integer 0
    364 nls_calendar                 string
    365 nls_comp                 string     BINARY
    366 
    367 NAME                     TYPE     VALUE
    368 ------------------------------------ ----------- ------------------------------
    369 nls_currency                 string
    370 nls_date_format              string
    371 nls_date_language             string
    372 nls_dual_currency             string
    373 nls_iso_currency             string
    374 nls_language                 string     AMERICAN
    375 nls_length_semantics             string     BYTE
    376 nls_nchar_conv_excp             string     FALSE
    377 nls_numeric_characters             string
    378 nls_sort                 string
    379 nls_territory                 string     AMERICA
    380 
    381 NAME                     TYPE     VALUE
    382 ------------------------------------ ----------- ------------------------------
    383 nls_time_format              string
    384 nls_time_tz_format             string
    385 nls_timestamp_format             string
    386 nls_timestamp_tz_format          string
    387 noncdb_compatible             boolean     FALSE
    388 object_cache_max_size_percent         integer     10
    389 object_cache_optimal_size         integer     10240000
    390 ofs_threads                 integer     4
    391 olap_page_pool_size             big integer 0
    392 one_step_plugin_for_pdb_with_tde     boolean     FALSE
    393 open_cursors                 integer     300
    394 
    395 NAME                     TYPE     VALUE
    396 ------------------------------------ ----------- ------------------------------
    397 open_links                 integer     4
    398 open_links_per_instance          integer     4
    399 optimizer_adaptive_plans         boolean     TRUE
    400 optimizer_adaptive_reporting_only    boolean     FALSE
    401 optimizer_adaptive_statistics         boolean     FALSE
    402 optimizer_capture_sql_plan_baselines boolean     FALSE
    403 optimizer_dynamic_sampling         integer     2
    404 optimizer_features_enable         string     12.2.0.1
    405 optimizer_index_caching          integer     0
    406 optimizer_index_cost_adj         integer     100
    407 optimizer_inmemory_aware         boolean     TRUE
    408 
    409 NAME                     TYPE     VALUE
    410 ------------------------------------ ----------- ------------------------------
    411 optimizer_mode                 string     ALL_ROWS
    412 optimizer_secure_view_merging         boolean     TRUE
    413 optimizer_use_invisible_indexes      boolean     FALSE
    414 optimizer_use_pending_statistics     boolean     FALSE
    415 optimizer_use_sql_plan_baselines     boolean     TRUE
    416 os_authent_prefix             string     ops$
    417 os_roles                 boolean     FALSE
    418 outbound_dblink_protocols         string     ALL
    419 parallel_adaptive_multi_user         boolean     FALSE
    420 parallel_degree_limit             string     CPU
    421 parallel_degree_policy             string     MANUAL
    422 
    423 NAME                     TYPE     VALUE
    424 ------------------------------------ ----------- ------------------------------
    425 parallel_execution_message_size      integer     16384
    426 parallel_force_local             boolean     FALSE
    427 parallel_instance_group          string
    428 parallel_max_servers             integer     80
    429 parallel_min_percent             integer     0
    430 parallel_min_servers             integer     8
    431 parallel_min_time_threshold         string     AUTO
    432 parallel_servers_target          integer     32
    433 parallel_threads_per_cpu         integer     2
    434 pdb_file_name_convert             string
    435 pdb_lockdown                 string
    436 
    437 NAME                     TYPE     VALUE
    438 ------------------------------------ ----------- ------------------------------
    439 pdb_os_credential             string
    440 permit_92_wrap_format             boolean     TRUE
    441 pga_aggregate_limit             big integer 2G
    442 pga_aggregate_target             big integer 799M
    443 plscope_settings             string     IDENTIFIERS:NONE
    444 plsql_ccflags                 string
    445 plsql_code_type              string     INTERPRETED
    446 plsql_debug                 boolean     FALSE
    447 plsql_optimize_level             integer     2
    448 plsql_v2_compatibility             boolean     FALSE
    449 plsql_warnings                 string     DISABLE:ALL
    450 
    451 NAME                     TYPE     VALUE
    452 ------------------------------------ ----------- ------------------------------
    453 pre_page_sga                 boolean     TRUE
    454 processes                 integer     300
    455 processor_group_name             string
    456 query_rewrite_enabled             string     TRUE
    457 query_rewrite_integrity          string     enforced
    458 rdbms_server_dn              string
    459 read_only_open_delayed             boolean     FALSE
    460 recovery_parallelism             integer     0
    461 recyclebin                 string     on
    462 redo_transport_user             string
    463 remote_dependencies_mode         string     TIMESTAMP
    464 
    465 NAME                     TYPE     VALUE
    466 ------------------------------------ ----------- ------------------------------
    467 remote_listener              string
    468 remote_login_passwordfile         string     EXCLUSIVE
    469 remote_os_authent             boolean     FALSE
    470 remote_os_roles              boolean     FALSE
    471 remote_recovery_file_dest         string
    472 replication_dependency_tracking      boolean     TRUE
    473 resource_limit                 boolean     TRUE
    474 resource_manage_goldengate         boolean     FALSE
    475 resource_manager_cpu_allocation      integer     2
    476 resource_manager_plan             string
    477 result_cache_max_result          integer     5
    478 
    479 NAME                     TYPE     VALUE
    480 ------------------------------------ ----------- ------------------------------
    481 result_cache_max_size             big integer 12M
    482 result_cache_mode             string     MANUAL
    483 result_cache_remote_expiration         integer     0
    484 resumable_timeout             integer     0
    485 rollback_segments             string
    486 sec_case_sensitive_logon         boolean     TRUE
    487 sec_max_failed_login_attempts         integer     3
    488 sec_protocol_error_further_action    string     (DROP,3)
    489 sec_protocol_error_trace_action      string     TRACE
    490 sec_return_server_release_banner     boolean     FALSE
    491 serial_reuse                 string     disable
    492 
    493 NAME                     TYPE     VALUE
    494 ------------------------------------ ----------- ------------------------------
    495 service_names                 string     NODE12C02
    496 session_cached_cursors             integer     50
    497 session_max_open_files             integer     10
    498 sessions                 integer     472
    499 sga_max_size                 big integer 2400M
    500 sga_min_size                 big integer 0
    501 sga_target                 big integer 2400M
    502 shadow_core_dump             string     partial
    503 shared_memory_address             integer     0
    504 shared_pool_reserved_size         big integer 24M
    505 shared_pool_size             big integer 0
    506 
    507 NAME                     TYPE     VALUE
    508 ------------------------------------ ----------- ------------------------------
    509 shared_server_sessions             integer
    510 shared_servers                 integer     1
    511 shrd_dupl_table_refresh_rate         integer     60
    512 skip_unusable_indexes             boolean     TRUE
    513 smtp_out_server              string
    514 sort_area_retained_size          integer     0
    515 sort_area_size                 integer     65536
    516 spatial_vector_acceleration         boolean     FALSE
    517 spfile                     string     /orcl/app/oracle/product/12.1.
    518                          0/db_1/dbs/spfileorcl.ora
    519 sql92_security                 boolean     TRUE
    520 
    521 NAME                     TYPE     VALUE
    522 ------------------------------------ ----------- ------------------------------
    523 sql_trace                 boolean     FALSE
    524 sqltune_category             string     DEFAULT
    525 standby_archive_dest             string     ?#/dbs/arch
    526 standby_db_preserve_states         string     NONE
    527 standby_file_management          string     MANUAL
    528 star_transformation_enabled         string     FALSE
    529 statistics_level             string     TYPICAL
    530 streams_pool_size             big integer 0
    531 tape_asynch_io                 boolean     TRUE
    532 target_pdbs                 integer     4
    533 temp_undo_enabled             boolean     FALSE
    534 
    535 NAME                     TYPE     VALUE
    536 ------------------------------------ ----------- ------------------------------
    537 thread                     integer     0
    538 threaded_execution             boolean     FALSE
    539 timed_os_statistics             integer     0
    540 timed_statistics             boolean     TRUE
    541 trace_enabled                 boolean     TRUE
    542 tracefile_identifier             string
    543 transactions                 integer     519
    544 transactions_per_rollback_segment    integer     5
    545 undo_management              string     AUTO
    546 undo_retention                 integer     900
    547 undo_tablespace              string     UNDOTBS1
    548 
    549 NAME                     TYPE     VALUE
    550 ------------------------------------ ----------- ------------------------------
    551 unified_audit_sga_queue_size         integer     1048576
    552 uniform_log_timestamp_format         boolean     TRUE
    553 use_dedicated_broker             boolean     FALSE
    554 use_large_pages              string     TRUE
    555 user_dump_dest                 string     /orcl/app/oracle/product/12.1.
    556                          0/db_1/rdbms/log
    557 utl_file_dir                 string
    558 workarea_size_policy             string     AUTO
    559 xml_db_events                 string     enable
    View Code

        001,DB_UNIQUE_NAME配置

    alter system set db_unique_name='NODE12C02';

        002,FAL_SERVER配置

    alter system set fal_server='node12c01,node12c03,node12c04';

        003,LOG_ARCHIVE_CONFIG配置

    dg_config是写db_unique_name的值。
    alter system set log_archive_config='dg_config=(node12c01,node12c02,node12c03,node12c04)';

        004,log_archive_dest 配置

    log_archive_dest_1   这里指向本地
    alter system set log_archive_dest_1='location=/orcl/app/oracle/oradata/orcl/archivelog valid_for=(all_logfiles,all_roles) db_unique_name=node12c02';
    log_archive_dest_2   这里指向主库
    alter system set log_archive_dest_2='service=node12c01 async valid_for=(online_logfiles,primary_role) db_unique_name=node12c01';

       05,FAR SYNC节点一配置

    总配置:

    SQL> show parameter
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    DBFIPS_140                 boolean     FALSE
    O7_DICTIONARY_ACCESSIBILITY         boolean     FALSE
    active_instance_count             integer
    allow_global_dblinks             boolean     FALSE
    allow_group_access_to_sga         boolean     FALSE
    approx_for_aggregation             boolean     FALSE
    approx_for_count_distinct         boolean     FALSE
    approx_for_percentile             string     none
    aq_tm_processes              integer     1
    archive_lag_target             integer     0
    asm_diskgroups                 string
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    asm_diskstring                 string
    asm_io_processes             integer     20
    asm_power_limit              integer     1
    asm_preferred_read_failure_groups    string
    audit_file_dest              string     /orcl/app/oracle/admin/orcl/ad
                             ump
    audit_sys_operations             boolean     TRUE
    audit_syslog_level             string
    audit_trail                 string     DB
    autotask_max_active_pdbs         integer     2
    awr_pdb_autoflush_enabled         boolean     FALSE
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    awr_snapshot_time_offset         integer     0
    background_core_dump             string     partial
    background_dump_dest             string     /orcl/app/oracle/product/12.1.
                             0/db_1/rdbms/log
    backup_tape_io_slaves             boolean     FALSE
    bitmap_merge_area_size             integer     1048576
    blank_trimming                 boolean     FALSE
    buffer_pool_keep             string
    buffer_pool_recycle             string
    cdb_cluster                 boolean     FALSE
    cdb_cluster_name             string     NODE12C03
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    cell_offload_compaction          string     ADAPTIVE
    cell_offload_decryption          boolean     TRUE
    cell_offload_parameters          string
    cell_offload_plan_display         string     AUTO
    cell_offload_processing          boolean     TRUE
    cell_offloadgroup_name             string
    circuits                 integer
    client_result_cache_lag          big integer 3000
    client_result_cache_size         big integer 0
    clonedb                  boolean     FALSE
    clonedb_dir                 string
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    cluster_database             boolean     FALSE
    cluster_database_instances         integer     1
    cluster_interconnects             string
    commit_logging                 string
    commit_point_strength             integer     1
    commit_wait                 string
    commit_write                 string
    common_user_prefix             string     C##
    compatible                 string     12.2.0
    connection_brokers             string     ((TYPE=DEDICATED)(BROKERS=1)),
                              ((TYPE=EMON)(BROKERS=1))
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    containers_parallel_degree         integer     65535
    control_file_record_keep_time         integer     7
    control_files                 string     /orcl/app/oracle/oradata/orcl/
                             control01.ctl, /orcl/app/oracl
                             e/fast_recovery_area/orcl/cont
                             rol02.ctl
    control_management_pack_access         string     DIAGNOSTIC+TUNING
    core_dump_dest                 string     /orcl/app/oracle/diag/rdbms/no
                             de12c03/orcl/cdump
    cpu_count                 integer     2
    create_bitmap_area_size          integer     8388608
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    create_stored_outlines             string
    cursor_bind_capture_destination      string     memory+disk
    cursor_invalidation             string     IMMEDIATE
    cursor_sharing                 string     EXACT
    cursor_space_for_time             boolean     FALSE
    data_guard_sync_latency          integer     0
    data_transfer_cache_size         big integer 0
    db_16k_cache_size             big integer 0
    db_2k_cache_size             big integer 0
    db_32k_cache_size             big integer 0
    db_4k_cache_size             big integer 0
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    db_8k_cache_size             big integer 0
    db_big_table_cache_percent_target    string     0
    db_block_buffers             integer     0
    db_block_checking             string     FALSE
    db_block_checksum             string     TYPICAL
    db_block_size                 integer     8192
    db_cache_advice              string     ON
    db_cache_size                 big integer 0
    db_create_file_dest             string
    db_create_online_log_dest_1         string
    db_create_online_log_dest_2         string
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    db_create_online_log_dest_3         string
    db_create_online_log_dest_4         string
    db_create_online_log_dest_5         string
    db_domain                 string
    db_file_multiblock_read_count         integer     128
    db_file_name_convert             string
    db_files                 integer     200
    db_flash_cache_file             string
    db_flash_cache_size             big integer 0
    db_flashback_retention_target         integer     1440
    db_index_compression_inheritance     string     NONE
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    db_keep_cache_size             big integer 0
    db_lost_write_protect             string     NONE
    db_name                  string     orcl
    db_performance_profile             string
    db_recovery_file_dest             string     /orcl/app/oracle/fast_recovery
                             _area/orcl
    db_recovery_file_dest_size         big integer 1G
    db_recycle_cache_size             big integer 0
    db_securefile                 string     PREFERRED
    db_ultra_safe                 string     OFF
    db_unique_name                 string     NODE12C03
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    db_unrecoverable_scn_tracking         boolean     TRUE
    db_writer_processes             integer     1
    dbwr_io_slaves                 integer     0
    ddl_lock_timeout             integer     0
    default_sharing              string     metadata
    deferred_segment_creation         boolean     TRUE
    dg_broker_config_file1             string     /orcl/app/oracle/product/12.1.
                             0/db_1/dbs/dr1NODE12C03.dat
    dg_broker_config_file2             string     /orcl/app/oracle/product/12.1.
                             0/db_1/dbs/dr2NODE12C03.dat
    dg_broker_start              boolean     TRUE
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    diagnostic_dest              string     /orcl/app/oracle
    disable_pdb_feature             big integer 0
    disk_asynch_io                 boolean     TRUE
    dispatchers                 string     (PROTOCOL=TCP) (SERVICE=orclXD
                             B)
    distributed_lock_timeout         integer     60
    dml_locks                 integer     2076
    dnfs_batch_size              integer     4096
    dst_upgrade_insert_conv          boolean     TRUE
    enable_automatic_maintenance_pdb     boolean     TRUE
    enable_ddl_logging             boolean     FALSE
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    enable_dnfs_dispatcher             boolean     FALSE
    enable_goldengate_replication         boolean     FALSE
    enable_pluggable_database         boolean     TRUE
    enabled_PDBs_on_standby          string     *
    encrypt_new_tablespaces          string     CLOUD_ONLY
    event                     string
    exafusion_enabled             integer     1
    external_keystore_credential_locatio string
    n
    fal_client                 string
    fal_server                 string     node12c01
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    fast_start_io_target             integer     0
    fast_start_mttr_target             integer     0
    fast_start_parallel_rollback         string     LOW
    file_mapping                 boolean     FALSE
    fileio_network_adapters          string
    filesystemio_options             string     none
    fixed_date                 string
    gcs_server_processes             integer     0
    global_names                 boolean     FALSE
    global_txn_processes             integer     1
    hash_area_size                 integer     131072
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    heat_map                 string     OFF
    hi_shared_memory_address         integer     0
    hs_autoregister              boolean     TRUE
    ifile                     file
    inmemory_adg_enabled             boolean     TRUE
    inmemory_clause_default          string
    inmemory_expressions_usage         string     ENABLE
    inmemory_force                 string     DEFAULT
    inmemory_max_populate_servers         integer     0
    inmemory_query                 string     ENABLE
    inmemory_size                 big integer 0
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    inmemory_trickle_repopulate_servers_ integer     1
    percent
    inmemory_virtual_columns         string     MANUAL
    instance_abort_delay_time         integer     0
    instance_groups              string
    instance_mode                 string     READ-WRITE
    instance_name                 string     orcl
    instance_number              integer     0
    instance_type                 string     RDBMS
    instant_restore              boolean     FALSE
    java_jit_enabled             boolean     TRUE
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    java_max_sessionspace_size         integer     0
    java_pool_size                 big integer 0
    java_restrict                 string     none
    java_soft_sessionspace_limit         integer     0
    job_queue_processes             integer     10
    large_pool_size              big integer 0
    ldap_directory_access             string     NONE
    ldap_directory_sysauth             string     no
    license_max_sessions             integer     0
    license_max_users             integer     0
    license_sessions_warning         integer     0
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    listener_networks             string
    local_listener                 string     LISTENER_ORCL
    lock_name_space              string
    lock_sga                 boolean     FALSE
    log_archive_config             string     dg_config=(NODE12C01,NODE12C02
                             ,NODE12C03,NODE12C04)
    log_archive_dest             string
    log_archive_dest_1             string     location=/orcl/app/oracle/orad
                             ata/orcl/archivelog VALID_FOR=
                             (ALL_LOGFILES,ALL_ROLES) DB_UN
                             IQUE_NAME=node12c03
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    log_archive_dest_10             string
    log_archive_dest_11             string
    log_archive_dest_12             string
    log_archive_dest_13             string
    log_archive_dest_14             string
    log_archive_dest_15             string
    log_archive_dest_16             string
    log_archive_dest_17             string
    log_archive_dest_18             string
    log_archive_dest_19             string
    log_archive_dest_2             string     service="NODE12C02", ASYNC  db
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
                             _unique_name="node12c02" net_t
                             imeout=30, valid_for=(standby_
                             logfiles,standby_role)
    log_archive_dest_20             string
    log_archive_dest_21             string
    log_archive_dest_22             string
    log_archive_dest_23             string
    log_archive_dest_24             string
    log_archive_dest_25             string
    log_archive_dest_26             string
    log_archive_dest_27             string
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    log_archive_dest_28             string
    log_archive_dest_29             string
    log_archive_dest_3             string
    log_archive_dest_30             string
    log_archive_dest_31             string
    log_archive_dest_4             string
    log_archive_dest_5             string
    log_archive_dest_6             string
    log_archive_dest_7             string
    log_archive_dest_8             string
    log_archive_dest_9             string
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    log_archive_dest_state_1         string     enable
    log_archive_dest_state_10         string     enable
    log_archive_dest_state_11         string     enable
    log_archive_dest_state_12         string     enable
    log_archive_dest_state_13         string     enable
    log_archive_dest_state_14         string     enable
    log_archive_dest_state_15         string     enable
    log_archive_dest_state_16         string     enable
    log_archive_dest_state_17         string     enable
    log_archive_dest_state_18         string     enable
    log_archive_dest_state_19         string     enable
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    log_archive_dest_state_2         string     ENABLE
    log_archive_dest_state_20         string     enable
    log_archive_dest_state_21         string     enable
    log_archive_dest_state_22         string     enable
    log_archive_dest_state_23         string     enable
    log_archive_dest_state_24         string     enable
    log_archive_dest_state_25         string     enable
    log_archive_dest_state_26         string     enable
    log_archive_dest_state_27         string     enable
    log_archive_dest_state_28         string     enable
    log_archive_dest_state_29         string     enable
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    log_archive_dest_state_3         string     enable
    log_archive_dest_state_30         string     enable
    log_archive_dest_state_31         string     enable
    log_archive_dest_state_4         string     enable
    log_archive_dest_state_5         string     enable
    log_archive_dest_state_6         string     enable
    log_archive_dest_state_7         string     enable
    log_archive_dest_state_8         string     enable
    log_archive_dest_state_9         string     enable
    log_archive_duplex_dest          string
    log_archive_format             string     %t_%s_%r.dbf
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    log_archive_max_processes         integer     4
    log_archive_min_succeed_dest         integer     1
    log_archive_start             boolean     FALSE
    log_archive_trace             integer     0
    log_buffer                 big integer 7456K
    log_checkpoint_interval          integer     0
    log_checkpoint_timeout             integer     1800
    log_checkpoints_to_alert         boolean     FALSE
    log_file_name_convert             string
    long_module_action             boolean     TRUE
    max_datapump_jobs_per_pdb         integer     100
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    max_dispatchers              integer
    max_dump_file_size             string     unlimited
    max_idle_time                 integer     0
    max_iops                 integer     0
    max_mbps                 integer     0
    max_pdbs                 integer     4098
    max_shared_servers             integer
    max_string_size              string     STANDARD
    memory_max_target             big integer 0
    memory_target                 big integer 0
    nls_calendar                 string
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    nls_comp                 string     BINARY
    nls_currency                 string
    nls_date_format              string
    nls_date_language             string
    nls_dual_currency             string
    nls_iso_currency             string
    nls_language                 string     AMERICAN
    nls_length_semantics             string     BYTE
    nls_nchar_conv_excp             string     FALSE
    nls_numeric_characters             string
    nls_sort                 string
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    nls_territory                 string     AMERICA
    nls_time_format              string
    nls_time_tz_format             string
    nls_timestamp_format             string
    nls_timestamp_tz_format          string
    noncdb_compatible             boolean     FALSE
    object_cache_max_size_percent         integer     10
    object_cache_optimal_size         integer     10240000
    ofs_threads                 integer     4
    olap_page_pool_size             big integer 0
    one_step_plugin_for_pdb_with_tde     boolean     FALSE
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    open_cursors                 integer     300
    open_links                 integer     4
    open_links_per_instance          integer     4
    optimizer_adaptive_plans         boolean     TRUE
    optimizer_adaptive_reporting_only    boolean     FALSE
    optimizer_adaptive_statistics         boolean     FALSE
    optimizer_capture_sql_plan_baselines boolean     FALSE
    optimizer_dynamic_sampling         integer     2
    optimizer_features_enable         string     12.2.0.1
    optimizer_index_caching          integer     0
    optimizer_index_cost_adj         integer     100
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    optimizer_inmemory_aware         boolean     TRUE
    optimizer_mode                 string     ALL_ROWS
    optimizer_secure_view_merging         boolean     TRUE
    optimizer_use_invisible_indexes      boolean     FALSE
    optimizer_use_pending_statistics     boolean     FALSE
    optimizer_use_sql_plan_baselines     boolean     TRUE
    os_authent_prefix             string     ops$
    os_roles                 boolean     FALSE
    outbound_dblink_protocols         string     ALL
    parallel_adaptive_multi_user         boolean     FALSE
    parallel_degree_limit             string     CPU
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    parallel_degree_policy             string     MANUAL
    parallel_execution_message_size      integer     16384
    parallel_force_local             boolean     FALSE
    parallel_instance_group          string
    parallel_max_servers             integer     80
    parallel_min_percent             integer     0
    parallel_min_servers             integer     8
    parallel_min_time_threshold         string     AUTO
    parallel_servers_target          integer     32
    parallel_threads_per_cpu         integer     2
    pdb_file_name_convert             string
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    pdb_lockdown                 string
    pdb_os_credential             string
    permit_92_wrap_format             boolean     TRUE
    pga_aggregate_limit             big integer 2G
    pga_aggregate_target             big integer 799M
    plscope_settings             string     IDENTIFIERS:NONE
    plsql_ccflags                 string
    plsql_code_type              string     INTERPRETED
    plsql_debug                 boolean     FALSE
    plsql_optimize_level             integer     2
    plsql_v2_compatibility             boolean     FALSE
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    plsql_warnings                 string     DISABLE:ALL
    pre_page_sga                 boolean     TRUE
    processes                 integer     300
    processor_group_name             string
    query_rewrite_enabled             string     TRUE
    query_rewrite_integrity          string     enforced
    rdbms_server_dn              string
    read_only_open_delayed             boolean     FALSE
    recovery_parallelism             integer     0
    recyclebin                 string     on
    redo_transport_user             string
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    remote_dependencies_mode         string     TIMESTAMP
    remote_listener              string
    remote_login_passwordfile         string     EXCLUSIVE
    remote_os_authent             boolean     FALSE
    remote_os_roles              boolean     FALSE
    remote_recovery_file_dest         string
    replication_dependency_tracking      boolean     TRUE
    resource_limit                 boolean     TRUE
    resource_manage_goldengate         boolean     FALSE
    resource_manager_cpu_allocation      integer     2
    resource_manager_plan             string
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    result_cache_max_result          integer     5
    result_cache_max_size             big integer 12M
    result_cache_mode             string     MANUAL
    result_cache_remote_expiration         integer     0
    resumable_timeout             integer     0
    rollback_segments             string
    sec_case_sensitive_logon         boolean     TRUE
    sec_max_failed_login_attempts         integer     3
    sec_protocol_error_further_action    string     (DROP,3)
    sec_protocol_error_trace_action      string     TRACE
    sec_return_server_release_banner     boolean     FALSE
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    serial_reuse                 string     disable
    service_names                 string     NODE12C03
    session_cached_cursors             integer     50
    session_max_open_files             integer     10
    sessions                 integer     472
    sga_max_size                 big integer 2400M
    sga_min_size                 big integer 0
    sga_target                 big integer 2400M
    shadow_core_dump             string     partial
    shared_memory_address             integer     0
    shared_pool_reserved_size         big integer 24M
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    shared_pool_size             big integer 0
    shared_server_sessions             integer
    shared_servers                 integer     1
    shrd_dupl_table_refresh_rate         integer     60
    skip_unusable_indexes             boolean     TRUE
    smtp_out_server              string
    sort_area_retained_size          integer     0
    sort_area_size                 integer     65536
    spatial_vector_acceleration         boolean     FALSE
    spfile                     string     /orcl/app/oracle/product/12.1.
                             0/db_1/dbs/spfileorcl.ora
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    sql92_security                 boolean     TRUE
    sql_trace                 boolean     FALSE
    sqltune_category             string     DEFAULT
    standby_archive_dest             string     ?#/dbs/arch
    standby_db_preserve_states         string     NONE
    standby_file_management          string     MANUAL
    star_transformation_enabled         string     FALSE
    statistics_level             string     TYPICAL
    streams_pool_size             big integer 0
    tape_asynch_io                 boolean     TRUE
    target_pdbs                 integer     4
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    temp_undo_enabled             boolean     FALSE
    thread                     integer     0
    threaded_execution             boolean     FALSE
    timed_os_statistics             integer     0
    timed_statistics             boolean     TRUE
    trace_enabled                 boolean     TRUE
    tracefile_identifier             string
    transactions                 integer     519
    transactions_per_rollback_segment    integer     5
    undo_management              string     AUTO
    undo_retention                 integer     900
    
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    undo_tablespace              string     UNDOTBS1
    unified_audit_sga_queue_size         integer     1048576
    uniform_log_timestamp_format         boolean     TRUE
    use_dedicated_broker             boolean     FALSE
    use_large_pages              string     TRUE
    user_dump_dest                 string     /orcl/app/oracle/product/12.1.
                             0/db_1/rdbms/log
    utl_file_dir                 string
    workarea_size_policy             string     AUTO
    xml_db_events                 string     enable
    SQL>
    View Code
    [oracle@node12c03 admin]$ cd $ORACLE_HOME/dbs  --文件存放处[oracle@node12c03 dbs]$ pwd
    /orcl/app/oracle/product/12.1.0/db_1/dbs
    更改pfile文件见下
    [oracle@node12c03 dbs]$ pwd
    /orcl/app/oracle/product/12.1.0/db_1/dbs
    [oracle@node12c03 dbs]$ cat initorcl.ora
    *.audit_file_dest='/orcl/app/oracle/admin/orcl/adump'
    *.audit_trail='db'
    *.compatible='12.2.0'
    *.control_files='/orcl/app/oracle/oradata/orcl/control01.ctl','/orcl/app/oracle/fast_recovery_area/orcl/control02.ctl'
    *.data_guard_sync_latency=0
    *.db_block_size=8192
    *.db_name='orcl'     ---实例名字这里写的是主库的实力名字
    *.db_recovery_file_dest='/orcl/app/oracle/fast_recovery_area/orcl'
    *.db_recovery_file_dest_size=1073741824
    *.db_unique_name='NODE12C03'  ----改为自己的db_unique_name,不能与其他同集群db_unique_name 一致
    *.dg_broker_start=TRUE
    *.diagnostic_dest='/orcl/app/oracle'
    *.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
    *.enable_pluggable_database=true
    *.fal_server='node12c01'  --目标服务器
    *.job_queue_processes=10
    *.local_listener='LISTENER_ORCL'
    *.log_archive_config='dg_config=(NODE12C01,NODE12C02,NODE12C03,NODE12C04)'
    *.log_archive_dest_1='location=/orcl/app/oracle/oradata/orcl/archivelog VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=node12c03'
    *.log_archive_dest_2='service="NODE12C02"','ASYNC  db_unique_name="node12c02"','valid_for=(standby_logfiles,standby_role)'
    ---dest可以先这个配置成我这样,也可以稍等会oracle 命令配置
    *.log_archive_dest_state_2='ENABLE' orcl.log_archive_format='%t_%s_%r.dbf' *.log_archive_max_processes=4 *.log_archive_min_succeed_dest=1 orcl.log_archive_trace=0 *.nls_language='AMERICAN' *.nls_territory='AMERICA' *.open_cursors=300 *.pga_aggregate_target=799m *.processes=300 *.remote_login_passwordfile='EXCLUSIVE' *.sga_target=2394m *.standby_file_management='MANUAL' *.undo_tablespace='UNDOTBS1'

      恢复控制文件

    启动数据库到nomount状态--由于启动弄mount需要pfile, 假如pfile位置更改或者识别不到可以使用指定pfile启动
    
    SQL> startup nomount
    
    或者
    
    SQL> startup nomount file='/orcl/app/oracle/product/12.1.0/db_1/dbs/initorcl.ora'
    
    
    
    SQL> exit
    
    进入rman 恢复控制文件
    
    rman target /
    
    
    RMAN> restore controlfile from '/orcl/app/oracle/product/12.1.0/db_1/dbs/fs01.ctl';
    RMAN> exit
    
    启动到mount
    SQL> startup mount
    
    --- 恢复后再后续的启动中就只需要启动到mount状态即可

    设置启动为spfile
    SQL> create spfile from pfile;
    SQL> shutdown immediate
    
    
    SQL> startup

      设置参数

    db_unique_name 参数配置
    
    alter system set db_unique_name='node12c03';
    
    fal_server配置
    
    alter system set fal_server='node12c01';
    这个为主数据库 
    
    配置log_archive_config
    
    alter system set log_archive_config='dg_config=(node12c01,node12c02,node12c03,node12c04)';
    写所有集群机器
    
    配置dest
    log_archive_dest_1,写归档到本地归档路径
    alter system set log_archive_dest_1='location=/orcl/app/oracle/oradata/orcl/archivelog valid_for=(all_logfile,all_roles) db_unique_name=node12c03' scope=spfile;
    
    log_archive_dest_2,写归档到备库,用async的方式,因为主到fs是sync,fs到备库是async。
    alter system set log_archive_dest_2='service=node12c02 async valid_for=(standby_logfiles,standby_role) db_unique_name=node12c02';
    log_archive_dest_3, 
    不用写dest3。

       05,FAR SYNC节点二配置

    总配置:

      1 SQL> show parameter
      2 
      3 NAME                     TYPE     VALUE
      4 ------------------------------------ ----------- ------------------------------
      5 DBFIPS_140                 boolean     FALSE
      6 O7_DICTIONARY_ACCESSIBILITY         boolean     FALSE
      7 active_instance_count             integer
      8 allow_global_dblinks             boolean     FALSE
      9 allow_group_access_to_sga         boolean     FALSE
     10 approx_for_aggregation             boolean     FALSE
     11 approx_for_count_distinct         boolean     FALSE
     12 approx_for_percentile             string     none
     13 aq_tm_processes              integer     1
     14 archive_lag_target             integer     0
     15 asm_diskgroups                 string
     16 
     17 NAME                     TYPE     VALUE
     18 ------------------------------------ ----------- ------------------------------
     19 asm_diskstring                 string
     20 asm_io_processes             integer     20
     21 asm_power_limit              integer     1
     22 asm_preferred_read_failure_groups    string
     23 audit_file_dest              string     /orcl/app/oracle/admin/orcl/ad
     24                          ump
     25 audit_sys_operations             boolean     TRUE
     26 audit_syslog_level             string
     27 audit_trail                 string     DB
     28 autotask_max_active_pdbs         integer     2
     29 awr_pdb_autoflush_enabled         boolean     FALSE
     30 
     31 NAME                     TYPE     VALUE
     32 ------------------------------------ ----------- ------------------------------
     33 awr_snapshot_time_offset         integer     0
     34 background_core_dump             string     partial
     35 background_dump_dest             string     /orcl/app/oracle/product/12.1.
     36                          0/db_1/rdbms/log
     37 backup_tape_io_slaves             boolean     FALSE
     38 bitmap_merge_area_size             integer     1048576
     39 blank_trimming                 boolean     FALSE
     40 buffer_pool_keep             string
     41 buffer_pool_recycle             string
     42 cdb_cluster                 boolean     FALSE
     43 cdb_cluster_name             string     NODE12C04
     44 
     45 NAME                     TYPE     VALUE
     46 ------------------------------------ ----------- ------------------------------
     47 cell_offload_compaction          string     ADAPTIVE
     48 cell_offload_decryption          boolean     TRUE
     49 cell_offload_parameters          string
     50 cell_offload_plan_display         string     AUTO
     51 cell_offload_processing          boolean     TRUE
     52 cell_offloadgroup_name             string
     53 circuits                 integer
     54 client_result_cache_lag          big integer 3000
     55 client_result_cache_size         big integer 0
     56 clonedb                  boolean     FALSE
     57 clonedb_dir                 string
     58 
     59 NAME                     TYPE     VALUE
     60 ------------------------------------ ----------- ------------------------------
     61 cluster_database             boolean     FALSE
     62 cluster_database_instances         integer     1
     63 cluster_interconnects             string
     64 commit_logging                 string
     65 commit_point_strength             integer     1
     66 commit_wait                 string
     67 commit_write                 string
     68 common_user_prefix             string     C##
     69 compatible                 string     12.2.0
     70 connection_brokers             string     ((TYPE=DEDICATED)(BROKERS=1)),
     71                           ((TYPE=EMON)(BROKERS=1))
     72 
     73 NAME                     TYPE     VALUE
     74 ------------------------------------ ----------- ------------------------------
     75 containers_parallel_degree         integer     65535
     76 control_file_record_keep_time         integer     7
     77 control_files                 string     /orcl/app/oracle/oradata/orcl/
     78                          control01.ctl, /orcl/app/oracl
     79                          e/fast_recovery_area/orcl/cont
     80                          rol02.ctl
     81 control_management_pack_access         string     DIAGNOSTIC+TUNING
     82 core_dump_dest                 string     /orcl/app/oracle/diag/rdbms/no
     83                          de12c04/orcl/cdump
     84 cpu_count                 integer     2
     85 create_bitmap_area_size          integer     8388608
     86 
     87 NAME                     TYPE     VALUE
     88 ------------------------------------ ----------- ------------------------------
     89 create_stored_outlines             string
     90 cursor_bind_capture_destination      string     memory+disk
     91 cursor_invalidation             string     IMMEDIATE
     92 cursor_sharing                 string     EXACT
     93 cursor_space_for_time             boolean     FALSE
     94 data_guard_sync_latency          integer     0
     95 data_transfer_cache_size         big integer 0
     96 db_16k_cache_size             big integer 0
     97 db_2k_cache_size             big integer 0
     98 db_32k_cache_size             big integer 0
     99 db_4k_cache_size             big integer 0
    100 
    101 NAME                     TYPE     VALUE
    102 ------------------------------------ ----------- ------------------------------
    103 db_8k_cache_size             big integer 0
    104 db_big_table_cache_percent_target    string     0
    105 db_block_buffers             integer     0
    106 db_block_checking             string     FALSE
    107 db_block_checksum             string     TYPICAL
    108 db_block_size                 integer     8192
    109 db_cache_advice              string     ON
    110 db_cache_size                 big integer 0
    111 db_create_file_dest             string
    112 db_create_online_log_dest_1         string
    113 db_create_online_log_dest_2         string
    114 
    115 NAME                     TYPE     VALUE
    116 ------------------------------------ ----------- ------------------------------
    117 db_create_online_log_dest_3         string
    118 db_create_online_log_dest_4         string
    119 db_create_online_log_dest_5         string
    120 db_domain                 string
    121 db_file_multiblock_read_count         integer     128
    122 db_file_name_convert             string
    123 db_files                 integer     200
    124 db_flash_cache_file             string
    125 db_flash_cache_size             big integer 0
    126 db_flashback_retention_target         integer     1440
    127 db_index_compression_inheritance     string     NONE
    128 
    129 NAME                     TYPE     VALUE
    130 ------------------------------------ ----------- ------------------------------
    131 db_keep_cache_size             big integer 0
    132 db_lost_write_protect             string     NONE
    133 db_name                  string     orcl
    134 db_performance_profile             string
    135 db_recovery_file_dest             string     /orcl/app/oracle/fast_recovery
    136                          _area/orcl
    137 db_recovery_file_dest_size         big integer 1G
    138 db_recycle_cache_size             big integer 0
    139 db_securefile                 string     PREFERRED
    140 db_ultra_safe                 string     OFF
    141 db_unique_name                 string     NODE12C04
    142 
    143 NAME                     TYPE     VALUE
    144 ------------------------------------ ----------- ------------------------------
    145 db_unrecoverable_scn_tracking         boolean     TRUE
    146 db_writer_processes             integer     1
    147 dbwr_io_slaves                 integer     0
    148 ddl_lock_timeout             integer     0
    149 default_sharing              string     metadata
    150 deferred_segment_creation         boolean     TRUE
    151 dg_broker_config_file1             string     /orcl/app/oracle/product/12.1.
    152                          0/db_1/dbs/dr1NODE12C04.dat
    153 dg_broker_config_file2             string     /orcl/app/oracle/product/12.1.
    154                          0/db_1/dbs/dr2NODE12C04.dat
    155 dg_broker_start              boolean     TRUE
    156 
    157 NAME                     TYPE     VALUE
    158 ------------------------------------ ----------- ------------------------------
    159 diagnostic_dest              string     /orcl/app/oracle
    160 disable_pdb_feature             big integer 0
    161 disk_asynch_io                 boolean     TRUE
    162 dispatchers                 string     (PROTOCOL=TCP) (SERVICE=orclXD
    163                          B)
    164 distributed_lock_timeout         integer     60
    165 dml_locks                 integer     2076
    166 dnfs_batch_size              integer     4096
    167 dst_upgrade_insert_conv          boolean     TRUE
    168 enable_automatic_maintenance_pdb     boolean     TRUE
    169 enable_ddl_logging             boolean     FALSE
    170 
    171 NAME                     TYPE     VALUE
    172 ------------------------------------ ----------- ------------------------------
    173 enable_dnfs_dispatcher             boolean     FALSE
    174 enable_goldengate_replication         boolean     FALSE
    175 enable_pluggable_database         boolean     TRUE
    176 enabled_PDBs_on_standby          string     *
    177 encrypt_new_tablespaces          string     CLOUD_ONLY
    178 event                     string
    179 exafusion_enabled             integer     1
    180 external_keystore_credential_locatio string
    181 n
    182 fal_client                 string
    183 fal_server                 string     node12c01
    184 
    185 NAME                     TYPE     VALUE
    186 ------------------------------------ ----------- ------------------------------
    187 fast_start_io_target             integer     0
    188 fast_start_mttr_target             integer     0
    189 fast_start_parallel_rollback         string     LOW
    190 file_mapping                 boolean     FALSE
    191 fileio_network_adapters          string
    192 filesystemio_options             string     none
    193 fixed_date                 string
    194 gcs_server_processes             integer     0
    195 global_names                 boolean     FALSE
    196 global_txn_processes             integer     1
    197 hash_area_size                 integer     131072
    198 
    199 NAME                     TYPE     VALUE
    200 ------------------------------------ ----------- ------------------------------
    201 heat_map                 string     OFF
    202 hi_shared_memory_address         integer     0
    203 hs_autoregister              boolean     TRUE
    204 ifile                     file
    205 inmemory_adg_enabled             boolean     TRUE
    206 inmemory_clause_default          string
    207 inmemory_expressions_usage         string     ENABLE
    208 inmemory_force                 string     DEFAULT
    209 inmemory_max_populate_servers         integer     0
    210 inmemory_query                 string     ENABLE
    211 inmemory_size                 big integer 0
    212 
    213 NAME                     TYPE     VALUE
    214 ------------------------------------ ----------- ------------------------------
    215 inmemory_trickle_repopulate_servers_ integer     1
    216 percent
    217 inmemory_virtual_columns         string     MANUAL
    218 instance_abort_delay_time         integer     0
    219 instance_groups              string
    220 instance_mode                 string     READ-WRITE
    221 instance_name                 string     orcl
    222 instance_number              integer     0
    223 instance_type                 string     RDBMS
    224 instant_restore              boolean     FALSE
    225 java_jit_enabled             boolean     TRUE
    226 
    227 NAME                     TYPE     VALUE
    228 ------------------------------------ ----------- ------------------------------
    229 java_max_sessionspace_size         integer     0
    230 java_pool_size                 big integer 0
    231 java_restrict                 string     none
    232 java_soft_sessionspace_limit         integer     0
    233 job_queue_processes             integer     10
    234 large_pool_size              big integer 0
    235 ldap_directory_access             string     NONE
    236 ldap_directory_sysauth             string     no
    237 license_max_sessions             integer     0
    238 license_max_users             integer     0
    239 license_sessions_warning         integer     0
    240 
    241 NAME                     TYPE     VALUE
    242 ------------------------------------ ----------- ------------------------------
    243 listener_networks             string
    244 local_listener                 string     LISTENER_ORCL
    245 lock_name_space              string
    246 lock_sga                 boolean     FALSE
    247 log_archive_config             string     dg_config=(NODE12C01,NODE12C02
    248                          ,NODE12C03,NODE12C04)
    249 log_archive_dest             string
    250 log_archive_dest_1             string     location=/orcl/app/oracle/orad
    251                          ata/orcl/archivelog VALID_FOR=
    252                          (ALL_LOGFILES,ALL_ROLES) DB_UN
    253                          IQUE_NAME=node12c04
    254 
    255 NAME                     TYPE     VALUE
    256 ------------------------------------ ----------- ------------------------------
    257 log_archive_dest_10             string
    258 log_archive_dest_11             string
    259 log_archive_dest_12             string
    260 log_archive_dest_13             string
    261 log_archive_dest_14             string
    262 log_archive_dest_15             string
    263 log_archive_dest_16             string
    264 log_archive_dest_17             string
    265 log_archive_dest_18             string
    266 log_archive_dest_19             string
    267 log_archive_dest_2             string     service="NODE12C02", ASYNC db_
    268 
    269 NAME                     TYPE     VALUE
    270 ------------------------------------ ----------- ------------------------------
    271                          unique_name="node12c02" , vali
    272                          d_for=(standby_logfiles,standb
    273                          y_role)
    274 log_archive_dest_20             string
    275 log_archive_dest_21             string
    276 log_archive_dest_22             string
    277 log_archive_dest_23             string
    278 log_archive_dest_24             string
    279 log_archive_dest_25             string
    280 log_archive_dest_26             string
    281 log_archive_dest_27             string
    282 
    283 NAME                     TYPE     VALUE
    284 ------------------------------------ ----------- ------------------------------
    285 log_archive_dest_28             string
    286 log_archive_dest_29             string
    287 log_archive_dest_3             string
    288 log_archive_dest_30             string
    289 log_archive_dest_31             string
    290 log_archive_dest_4             string
    291 log_archive_dest_5             string
    292 log_archive_dest_6             string
    293 log_archive_dest_7             string
    294 log_archive_dest_8             string
    295 log_archive_dest_9             string
    296 
    297 NAME                     TYPE     VALUE
    298 ------------------------------------ ----------- ------------------------------
    299 log_archive_dest_state_1         string     enable
    300 log_archive_dest_state_10         string     enable
    301 log_archive_dest_state_11         string     enable
    302 log_archive_dest_state_12         string     enable
    303 log_archive_dest_state_13         string     enable
    304 log_archive_dest_state_14         string     enable
    305 log_archive_dest_state_15         string     enable
    306 log_archive_dest_state_16         string     enable
    307 log_archive_dest_state_17         string     enable
    308 log_archive_dest_state_18         string     enable
    309 log_archive_dest_state_19         string     enable
    310 
    311 NAME                     TYPE     VALUE
    312 ------------------------------------ ----------- ------------------------------
    313 log_archive_dest_state_2         string     ENABLE
    314 log_archive_dest_state_20         string     enable
    315 log_archive_dest_state_21         string     enable
    316 log_archive_dest_state_22         string     enable
    317 log_archive_dest_state_23         string     enable
    318 log_archive_dest_state_24         string     enable
    319 log_archive_dest_state_25         string     enable
    320 log_archive_dest_state_26         string     enable
    321 log_archive_dest_state_27         string     enable
    322 log_archive_dest_state_28         string     enable
    323 log_archive_dest_state_29         string     enable
    324 
    325 NAME                     TYPE     VALUE
    326 ------------------------------------ ----------- ------------------------------
    327 log_archive_dest_state_3         string     enable
    328 log_archive_dest_state_30         string     enable
    329 log_archive_dest_state_31         string     enable
    330 log_archive_dest_state_4         string     enable
    331 log_archive_dest_state_5         string     enable
    332 log_archive_dest_state_6         string     enable
    333 log_archive_dest_state_7         string     enable
    334 log_archive_dest_state_8         string     enable
    335 log_archive_dest_state_9         string     enable
    336 log_archive_duplex_dest          string
    337 log_archive_format             string     %t_%s_%r.dbf
    338 
    339 NAME                     TYPE     VALUE
    340 ------------------------------------ ----------- ------------------------------
    341 log_archive_max_processes         integer     4
    342 log_archive_min_succeed_dest         integer     1
    343 log_archive_start             boolean     FALSE
    344 log_archive_trace             integer     0
    345 log_buffer                 big integer 7456K
    346 log_checkpoint_interval          integer     0
    347 log_checkpoint_timeout             integer     1800
    348 log_checkpoints_to_alert         boolean     FALSE
    349 log_file_name_convert             string
    350 long_module_action             boolean     TRUE
    351 max_datapump_jobs_per_pdb         integer     100
    352 
    353 NAME                     TYPE     VALUE
    354 ------------------------------------ ----------- ------------------------------
    355 max_dispatchers              integer
    356 max_dump_file_size             string     unlimited
    357 max_idle_time                 integer     0
    358 max_iops                 integer     0
    359 max_mbps                 integer     0
    360 max_pdbs                 integer     4098
    361 max_shared_servers             integer
    362 max_string_size              string     STANDARD
    363 memory_max_target             big integer 0
    364 memory_target                 big integer 0
    365 nls_calendar                 string
    366 
    367 NAME                     TYPE     VALUE
    368 ------------------------------------ ----------- ------------------------------
    369 nls_comp                 string     BINARY
    370 nls_currency                 string
    371 nls_date_format              string
    372 nls_date_language             string
    373 nls_dual_currency             string
    374 nls_iso_currency             string
    375 nls_language                 string     AMERICAN
    376 nls_length_semantics             string     BYTE
    377 nls_nchar_conv_excp             string     FALSE
    378 nls_numeric_characters             string
    379 nls_sort                 string
    380 
    381 NAME                     TYPE     VALUE
    382 ------------------------------------ ----------- ------------------------------
    383 nls_territory                 string     AMERICA
    384 nls_time_format              string
    385 nls_time_tz_format             string
    386 nls_timestamp_format             string
    387 nls_timestamp_tz_format          string
    388 noncdb_compatible             boolean     FALSE
    389 object_cache_max_size_percent         integer     10
    390 object_cache_optimal_size         integer     10240000
    391 ofs_threads                 integer     4
    392 olap_page_pool_size             big integer 0
    393 one_step_plugin_for_pdb_with_tde     boolean     FALSE
    394 
    395 NAME                     TYPE     VALUE
    396 ------------------------------------ ----------- ------------------------------
    397 open_cursors                 integer     300
    398 open_links                 integer     4
    399 open_links_per_instance          integer     4
    400 optimizer_adaptive_plans         boolean     TRUE
    401 optimizer_adaptive_reporting_only    boolean     FALSE
    402 optimizer_adaptive_statistics         boolean     FALSE
    403 optimizer_capture_sql_plan_baselines boolean     FALSE
    404 optimizer_dynamic_sampling         integer     2
    405 optimizer_features_enable         string     12.2.0.1
    406 optimizer_index_caching          integer     0
    407 optimizer_index_cost_adj         integer     100
    408 
    409 NAME                     TYPE     VALUE
    410 ------------------------------------ ----------- ------------------------------
    411 optimizer_inmemory_aware         boolean     TRUE
    412 optimizer_mode                 string     ALL_ROWS
    413 optimizer_secure_view_merging         boolean     TRUE
    414 optimizer_use_invisible_indexes      boolean     FALSE
    415 optimizer_use_pending_statistics     boolean     FALSE
    416 optimizer_use_sql_plan_baselines     boolean     TRUE
    417 os_authent_prefix             string     ops$
    418 os_roles                 boolean     FALSE
    419 outbound_dblink_protocols         string     ALL
    420 parallel_adaptive_multi_user         boolean     FALSE
    421 parallel_degree_limit             string     CPU
    422 
    423 NAME                     TYPE     VALUE
    424 ------------------------------------ ----------- ------------------------------
    425 parallel_degree_policy             string     MANUAL
    426 parallel_execution_message_size      integer     16384
    427 parallel_force_local             boolean     FALSE
    428 parallel_instance_group          string
    429 parallel_max_servers             integer     80
    430 parallel_min_percent             integer     0
    431 parallel_min_servers             integer     8
    432 parallel_min_time_threshold         string     AUTO
    433 parallel_servers_target          integer     32
    434 parallel_threads_per_cpu         integer     2
    435 pdb_file_name_convert             string
    436 
    437 NAME                     TYPE     VALUE
    438 ------------------------------------ ----------- ------------------------------
    439 pdb_lockdown                 string
    440 pdb_os_credential             string
    441 permit_92_wrap_format             boolean     TRUE
    442 pga_aggregate_limit             big integer 2G
    443 pga_aggregate_target             big integer 799M
    444 plscope_settings             string     IDENTIFIERS:NONE
    445 plsql_ccflags                 string
    446 plsql_code_type              string     INTERPRETED
    447 plsql_debug                 boolean     FALSE
    448 plsql_optimize_level             integer     2
    449 plsql_v2_compatibility             boolean     FALSE
    450 
    451 NAME                     TYPE     VALUE
    452 ------------------------------------ ----------- ------------------------------
    453 plsql_warnings                 string     DISABLE:ALL
    454 pre_page_sga                 boolean     TRUE
    455 processes                 integer     300
    456 processor_group_name             string
    457 query_rewrite_enabled             string     TRUE
    458 query_rewrite_integrity          string     enforced
    459 rdbms_server_dn              string
    460 read_only_open_delayed             boolean     FALSE
    461 recovery_parallelism             integer     0
    462 recyclebin                 string     on
    463 redo_transport_user             string
    464 
    465 NAME                     TYPE     VALUE
    466 ------------------------------------ ----------- ------------------------------
    467 remote_dependencies_mode         string     TIMESTAMP
    468 remote_listener              string
    469 remote_login_passwordfile         string     EXCLUSIVE
    470 remote_os_authent             boolean     FALSE
    471 remote_os_roles              boolean     FALSE
    472 remote_recovery_file_dest         string
    473 replication_dependency_tracking      boolean     TRUE
    474 resource_limit                 boolean     TRUE
    475 resource_manage_goldengate         boolean     FALSE
    476 resource_manager_cpu_allocation      integer     2
    477 resource_manager_plan             string
    478 
    479 NAME                     TYPE     VALUE
    480 ------------------------------------ ----------- ------------------------------
    481 result_cache_max_result          integer     5
    482 result_cache_max_size             big integer 12M
    483 result_cache_mode             string     MANUAL
    484 result_cache_remote_expiration         integer     0
    485 resumable_timeout             integer     0
    486 rollback_segments             string
    487 sec_case_sensitive_logon         boolean     TRUE
    488 sec_max_failed_login_attempts         integer     3
    489 sec_protocol_error_further_action    string     (DROP,3)
    490 sec_protocol_error_trace_action      string     TRACE
    491 sec_return_server_release_banner     boolean     FALSE
    492 
    493 NAME                     TYPE     VALUE
    494 ------------------------------------ ----------- ------------------------------
    495 serial_reuse                 string     disable
    496 service_names                 string     NODE12C04
    497 session_cached_cursors             integer     50
    498 session_max_open_files             integer     10
    499 sessions                 integer     472
    500 sga_max_size                 big integer 2400M
    501 sga_min_size                 big integer 0
    502 sga_target                 big integer 2400M
    503 shadow_core_dump             string     partial
    504 shared_memory_address             integer     0
    505 shared_pool_reserved_size         big integer 24M
    506 
    507 NAME                     TYPE     VALUE
    508 ------------------------------------ ----------- ------------------------------
    509 shared_pool_size             big integer 0
    510 shared_server_sessions             integer
    511 shared_servers                 integer     1
    512 shrd_dupl_table_refresh_rate         integer     60
    513 skip_unusable_indexes             boolean     TRUE
    514 smtp_out_server              string
    515 sort_area_retained_size          integer     0
    516 sort_area_size                 integer     65536
    517 spatial_vector_acceleration         boolean     FALSE
    518 spfile                     string     /orcl/app/oracle/product/12.1.
    519                          0/db_1/dbs/spfileorcl.ora
    520 
    521 NAME                     TYPE     VALUE
    522 ------------------------------------ ----------- ------------------------------
    523 sql92_security                 boolean     TRUE
    524 sql_trace                 boolean     FALSE
    525 sqltune_category             string     DEFAULT
    526 standby_archive_dest             string     ?#/dbs/arch
    527 standby_db_preserve_states         string     NONE
    528 standby_file_management          string     MANUAL
    529 star_transformation_enabled         string     FALSE
    530 statistics_level             string     TYPICAL
    531 streams_pool_size             big integer 0
    532 tape_asynch_io                 boolean     TRUE
    533 target_pdbs                 integer     4
    534 
    535 NAME                     TYPE     VALUE
    536 ------------------------------------ ----------- ------------------------------
    537 temp_undo_enabled             boolean     FALSE
    538 thread                     integer     0
    539 threaded_execution             boolean     FALSE
    540 timed_os_statistics             integer     0
    541 timed_statistics             boolean     TRUE
    542 trace_enabled                 boolean     TRUE
    543 tracefile_identifier             string
    544 transactions                 integer     519
    545 transactions_per_rollback_segment    integer     5
    546 undo_management              string     AUTO
    547 undo_retention                 integer     900
    548 
    549 NAME                     TYPE     VALUE
    550 ------------------------------------ ----------- ------------------------------
    551 undo_tablespace              string     UNDOTBS1
    552 unified_audit_sga_queue_size         integer     1048576
    553 uniform_log_timestamp_format         boolean     TRUE
    554 use_dedicated_broker             boolean     FALSE
    555 use_large_pages              string     TRUE
    556 user_dump_dest                 string     /orcl/app/oracle/product/12.1.
    557                          0/db_1/rdbms/log
    558 utl_file_dir                 string
    559 workarea_size_policy             string     AUTO
    560 xml_db_events                 string     enable
    561 SQL>
    View Code
    [oracle@node12c04 admin]$ cd $ORACLE_HOME/dbs  --文件存放处
    [oracle@node12c04 dbs]$ pwd /orcl/app/oracle/product/12.1.0/db_1/dbs 更改pfile文件见下 [oracle@node12c04 dbs]$ pwd /orcl/app/oracle/product/12.1.0/db_1/dbs [oracle@node12c04 dbs]$ cat initorcl.ora --这个备用FAR SYNC的话和节点一的配置差不多,都是要传归档到备库,只是充当临时效果 *.audit_file_dest='/orcl/app/oracle/admin/orcl/adump' *.audit_trail='db' *.compatible='12.2.0' *.control_files='/orcl/app/oracle/oradata/orcl/control01.ctl','/orcl/app/oracle/fast_recovery_area/orcl/control02.ctl' *.data_guard_sync_latency=0 *.db_block_size=8192 *.db_name='orcl' ---实例名字这里写的是主库的实力名字 *.db_recovery_file_dest='/orcl/app/oracle/fast_recovery_area/orcl' *.db_recovery_file_dest_size=1073741824 *.db_unique_name='NODE12C04' ----改为自己的db_unique_name,不能与其他同集群db_unique_name 一致 *.dg_broker_start=TRUE *.diagnostic_dest='/orcl/app/oracle' *.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)' *.enable_pluggable_database=true *.fal_server='node12c01' --目标服务器 *.job_queue_processes=10 *.local_listener='LISTENER_ORCL' *.log_archive_config='dg_config=(NODE12C01,NODE12C02,NODE12C03,NODE12C04)' *.log_archive_dest_1='location=/orcl/app/oracle/oradata/orcl/archivelog VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=node12c03' *.log_archive_dest_2='service="NODE12C02"','ASYNC db_unique_name="node12c02" net_timeout=30','valid_for=(standby_logfiles,standby_role)' ---dest可以先这个配置成我这样,也可以稍等会oracle 命令配置
    *.log_archive_dest_state_2='ENABLE' orcl.log_archive_format='%t_%s_%r.dbf' *.log_archive_max_processes=4 *.log_archive_min_succeed_dest=1 orcl.log_archive_trace=0 *.nls_language='AMERICAN' *.nls_territory='AMERICA' *.open_cursors=300 *.pga_aggregate_target=799m *.processes=300 *.remote_login_passwordfile='EXCLUSIVE' *.sga_target=2394m *.standby_file_management='MANUAL' *.undo_tablespace='UNDOTBS1'

      恢复控制文件

    启动数据库到nomount状态--由于启动弄mount需要pfile, 假如pfile位置更改或者识别不到可以使用指定pfile启动
    
    SQL> startup nomount
    
    或者
    
    SQL> startup nomount file='/orcl/app/oracle/product/12.1.0/db_1/dbs/initorcl.ora'
    
    
    SQL> exit
    
    进入rman 恢复控制文件
    
    rman target /
    
    
    RMAN> restore controlfile from '/orcl/app/oracle/product/12.1.0/db_1/dbs/fs01.ctl';
    RMAN> exit
    
    启动到mount
    SQL> startup mount
    
    --- 恢复后再后续的启动中就只需要启动到mount状态即可

    设置启动为spfile
    SQL> create spfile from pfile;
    SQL> shutdown immediate
    
    
    SQL> startup

      设置参数

    db_unique_name 参数配置
    
    alter system set db_unique_name='node12c04';
    
    fal_server配置
    
    alter system set fal_server='node12c01';
    这个为主数据库 
    
    配置log_archive_config
    
    alter system set log_archive_config='dg_config=(node12c01,node12c02,node12c03,node12c04)';
    写所有集群机器
    
    配置dest
    log_archive_dest_1,写归档到本地归档路径
    alter system set log_archive_dest_1='location=/orcl/app/oracle/oradata/orcl/archivelog valid_for=(all_logfile,all_roles) db_unique_name=node12c03' scope=spfile;
    
    log_archive_dest_2,写归档到备库,用async的方式,因为主到fs是sync,fs到备库是async。
    alter system set log_archive_dest_2='service=node12c02 async valid_for=(standby_logfiles,standby_role) db_unique_name=node12c02';
    log_archive_dest_3, 
    不用写dest3。

     06,开始启动

    关闭所有FAR 服务的数据库!!
    
    
    重启主库 ---这里FS两个节点是并未启动的状态
    
    主库所有pdb都要启动
    SQL >  shutdown immediate
    SQL > startup 
    read write 配置为读写模式
    SQL > alter pluggable database all open read write;
    
    
    
    重启备库 --- ---这里FS两个节点是并未启动的状态
    
    SQL > shutdown immediate
    SQL >startup
    SQL > alter pluggable database all open read only;  --启动到只读模式
    SQL > alter database recover managed standby database using current logfile disconnect from session;
    
    
    
    
    启动FAR Sync 节点一
    
    SQL > startup mount
    
    启动FAR Sync 节点二
    
    SQL > startup mount

    主库查看保护级别,

    SQL> select open_mode,protection_mode,protection_level,switchover_status from v$database;

    OPEN_MODE         PROTECTION_MODE      PROTECTION_LEVEL     SWITCHOVER_STATUS
    -------------------- -------------------- -------------------- --------------------
    READ WRITE         MAXIMUM PERFORMANCE  MAXIMUM PERFORMANCE  TO STANDBY

    发现并不是最大可用模式,我们进行调整,语法:

      SQL> alter database set standby database to maximize availability;

    Database altered.

      SQL> select open_mode,protection_mode,protection_level,switchover_status from v$database;

    OPEN_MODE         PROTECTION_MODE      PROTECTION_LEVEL     SWITCHOVER_STATUS
    -------------------- -------------------- -------------------- --------------------
    READ WRITE         MAXIMUM AVAILABILITY MAXIMUM AVAILABILITY TO STANDBY

    一个 Far Sync 实例的话,如果出现问题,虽然能够保证 redo 直接传输到 standby 库,但是 primary 库保护模式从最大可用模式(MaximumAvailability)降为最大性能模式(Maximum Performance)。 因此我们可以在距离主库较近的地点设置 2 个 FarSync 实例保证高可用性。当一个 Far Sync实例不可用, primary 库自动使用备用 FarSync 库,并且 primary 库保护模式保持最大可用模式(Maximum Availability) 不变,零数据丢失。

    07,节点启动状态

      主库查看命令:

    set linesize 160
    select * from v$dataguard_config;

    理论上是未应用的那个unknown !!  状态的话主库认识到状态未FAR就会发送日志过去

      查看Far Sync实例状态

    select protection_mode,database_role,protection_level,open_mode from v$database;

      查看日志有没有问题

    手工切换日志,可在下方命令查询后切换此命令,再次查询,看是否由改变

    alter system archive log current;

    主库:

    SQL> select max(sequence#) from v$archived_log;

    MAX(SEQUENCE#)
    --------------
           279


    far sync:

    SQL> select max(sequence#) from v$archived_log;

    MAX(SEQUENCE#)
    --------------
           279

    备库:

    SQL> select max(sequence#) from v$archived_log;

    MAX(SEQUENCE#)
    --------------
           279

    FARsync2:

    SQL> select max(sequence#) from v$archived_log;

    MAX(SEQUENCE#)
    --------------
           276   ---这个日志没有与他们一样是因为没有应用,FAR1 宕机后就会通过这个来应用

    08,FAR SYNC 测试

    查看alter日志

    配置listener.ora和tnsnames.ora 配置内容见上 同配置可直接拷贝,不同的话,更改对应名字IP即
    [Pèizhì listener.Ora hé tnsnames.Ora pèizhì nèiróng jiàn shàng tóng pèizhì kě zhíjiē kǎobèi, bùtóng dehuà, gēnggǎi duìyìng míngzì IP jí]
    Configure listener.ora and tnsnames.ora
    See the configuration content
    The same configuration can be copied directly. If not, change the corresponding name IP.
    FARsYNC2
    FARsYNC2
  • 相关阅读:
    缓冲流
    properties类
    io流
    异常处理
    file的概述和作用
    map集合和set集合
    js 判断是否是undefined null NaN
    java instanceof 判断是否是String
    ajax获取数据中文乱码问题最简单的完美解决方案
    if else if else if else 的用法
  • 原文地址:https://www.cnblogs.com/kingle-study/p/10675650.html
Copyright © 2011-2022 走看看