Oracle12C--DG Far Sync部署

Oracle12C–DG Far Sync 部署(前提为搭建好12C的DG)

一,理解同步异步模式

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实例,起到备用的作用

四,配置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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
[oracle@node12c01 admin]$ cat listener.ora   --- 主库与备库DG状态,这个是不需要更改的
# listener.ora Network Configuration File: /orcl/app/oracle/product/12.1.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /orcl/app/oracle/product/12.1.0/db_1/)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = NODE12C01)
(ORACLE_HOME = /orcl/app/oracle/product/12.1.0/db_1)
(SID_NAME = orcl)
)
(SID_DESC =
(GLOBAL_DBNAME = NODE12C01_DGMGRL)
(ORACLE_HOME = /orcl/app/oracle/product/12.1.0/db_1)
(SID_NAME = orcl)
)
(SID_DESC =
(GLOBAL_DBNAME = node12c)
(ORACLE_HOME = /orcl/app/oracle/product/12.1.0/db_1)
(SID_NAME = ORCL)
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = node12c01)(PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)

ADR_BASE_LISTENER = /orcl/app/oracle/
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# tnsnames.ora Network Configuration File: /orcl/app/oracle/product/12.1.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.31)(PORT = 1521))

ORCL = //---DG配置的
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.31)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = NODE12C01)
(UR=A)
)
)
node12c01 = //--需要tnsping 互通的节点都写上
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.31)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = NODE12C01) 这个对应着服务的名字DB_unique_name的
(UR=A)
)
)
node12c02 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.32)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = NODE12C02)
(UR=A)
)
)
node12c03 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.33)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = NODE12C03)
(UR=A)
)
)
node12c04 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.34)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = NODE12C04)
(UR=A)
)
)

备库监听:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
[oracle@node12c02 admin]$ cat listener.ora
# listener.ora Network Configuration File: /orcl/app/oracle/product/12.1.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /orcl/app/oracle/product/12.1.0/db_1/)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = NODE12C02)
(ORACLE_HOME = /orcl/app/oracle/product/12.1.0/db_1)
(SID_NAME = orcl)
)
(SID_DESC =
(GLOBAL_DBNAME = NODE12C02_DGMGRL)
(ORACLE_HOME = /orcl/app/oracle/product/12.1.0/db_1)
(SID_NAME = orcl)
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.32)(PORT = 1521))
)
)

ADR_BASE_LISTENER = /orcl/app/oracle

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
[oracle@node12c02 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /orcl/app/oracle/product/12.1.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.32)(PORT = 1521))

node12c01 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.31)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = NODE12C01)
(UR=A)
)
)
node12c02 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.32)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = NODE12C02)
(UR=A)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.32)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = NODE12C02)
(UR=A)
)
)
node12c03 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.33)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = NODE12C03)
(UR=A)
)
)
node12c04 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.34)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = NODE12C04)
(UR=A)
)
)

FS节点一监听:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
[oracle@node12c03 admin]$ cat listener.ora
# listener.ora Network Configuration File: /orcl/app/oracle/product/12.1.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /orcl/app/oracle/product/12.1.0/db_1/)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = NODE12C03)
(ORACLE_HOME = /orcl/app/oracle/product/12.1.0/db_1)
(SID_NAME = orcl)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.33)(PORT = 1521))
)
)

ADR_BASE_LISTENER = /orcl/app/oracle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
[oracle@node12c03 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /orcl/app/oracle/product/12.1.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.33)(PORT = 1521))
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.31)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = NODE12C01)
(UR=A)
)
)
node12c01 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.31)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = NODE12C01)
(UR=A)
)
)
node12c02 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.32)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = NODE12C02)
(UR=A)
)
)
node12c03 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.33)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = NODE12C03)
(UR=A)
)
)
node12c04 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.34)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = NODE12C04)
(UR=A)
)
)

FS节点二监听:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
[oracle@node12c04 admin]$ cat listener.ora
# listener.ora Network Configuration File: /orcl/app/oracle/product/12.1.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /orcl/app/oracle/product/12.1.0/db_1/)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = NODE12C04)
(ORACLE_HOME = /orcl/app/oracle/product/12.1.0/db_1)
(SID_NAME = orcl)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.34)(PORT = 1521))
)
)

ADR_BASE_LISTENER = /orcl/app/oracle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
[oracle@node12c04 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /orcl/app/oracle/product/12.1.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.31)(PORT = 1521))

node12c01 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.31)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = NODE12C01)
(UR=A)
)
)
node12c02 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.32)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = NODE12C02)
(UR=A)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.32)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = NODE12C02)
(UR=A)
)
)
node12c03 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.33)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = NODE12C03)
(UR=A)
)
)
node12c04 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.34)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = NODE12C04)
(UR=A)
)
)

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

02,环境框架部署

001,必须搭建好12C的DG为基础, 搭设Oracle12C参考这篇文章>>>

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/
--拷贝密码文件

004,FAR SRNC节点一

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

005,FAR SRNC节点二

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

03,主库部署

配置参数项:

成功后的配置项

展开看详情 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 NODE12C01

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
de12c01/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 NODE12C01

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/dr1NODE12C01.dat
dg_broker_config_file2 string /orcl/app/oracle/product/12.1.
0/db_1/dbs/dr2NODE12C01.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 node12c02,node12c03,node12c04

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=
(online_logfile,primary_role)
db_unique_name=NODE12C01

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=NODE12C03 sync affirm

NAME TYPE VALUE


                     max_failure=1 alternate=log_ar
                     chive_dest_3 valid_for=(online
                     _logfiles,primary_role) db_uni
                     que_name=node12c03

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

NAME TYPE VALUE


log_archive_dest_27 string
log_archive_dest_28 string
log_archive_dest_29 string
log_archive_dest_3 string service=NODE12C04 async altern
ate=log_archive_dest_2 valid_f
or=(online_logfiles,primary_ro
le) db_unique_name=NODE12C04
log_archive_dest_30 string
log_archive_dest_31 string
log_archive_dest_4 string
log_archive_dest_5 string

NAME TYPE VALUE


log_archive_dest_6 string
log_archive_dest_7 string
log_archive_dest_8 string
log_archive_dest_9 string
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

NAME TYPE VALUE


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
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

NAME TYPE VALUE


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
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

NAME TYPE VALUE


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
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

NAME TYPE VALUE


log_checkpoints_to_alert boolean FALSE
log_file_name_convert string
long_module_action boolean TRUE
max_datapump_jobs_per_pdb integer 100
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

NAME TYPE VALUE


max_string_size string STANDARD
memory_max_target big integer 0
memory_target big integer 0
nls_calendar string
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

NAME TYPE VALUE


nls_length_semantics string BYTE
nls_nchar_conv_excp string FALSE
nls_numeric_characters string
nls_sort string
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

NAME TYPE VALUE


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
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

NAME TYPE VALUE


optimizer_dynamic_sampling integer 2
optimizer_features_enable string 12.2.0.1
optimizer_index_caching integer 0
optimizer_index_cost_adj integer 100
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$

NAME TYPE VALUE


os_roles boolean FALSE
outbound_dblink_protocols string ALL
parallel_adaptive_multi_user boolean FALSE
parallel_degree_limit string CPU
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

NAME TYPE VALUE


parallel_min_time_threshold string AUTO
parallel_servers_target integer 32
parallel_threads_per_cpu integer 2
pdb_file_name_convert string
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

NAME TYPE VALUE


plsql_code_type string INTERPRETED
plsql_debug boolean FALSE
plsql_optimize_level integer 2
plsql_v2_compatibility boolean FALSE
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

NAME TYPE VALUE


read_only_open_delayed boolean FALSE
recovery_parallelism integer 0
recyclebin string on
redo_transport_user string
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

NAME TYPE VALUE


resource_limit boolean TRUE
resource_manage_goldengate boolean FALSE
resource_manager_cpu_allocation integer 2
resource_manager_plan string
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

NAME TYPE VALUE


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
serial_reuse string disable
service_names string NODE12C01
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

NAME TYPE VALUE


sga_target big integer 2400M
shadow_core_dump string partial
shared_memory_address integer 0
shared_pool_reserved_size big integer 24M
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

NAME TYPE VALUE


sort_area_size integer 65536
spatial_vector_acceleration boolean FALSE
spfile string /orcl/app/oracle/product/12.1.
0/db_1/dbs/spfileorcl.ora
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

NAME TYPE VALUE


statistics_level string TYPICAL
streams_pool_size big integer 0
tape_asynch_io boolean TRUE
target_pdbs integer 4
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

NAME TYPE VALUE


transactions integer 519
transactions_per_rollback_segment integer 5
undo_management string AUTO
undo_retention integer 900
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

NAME TYPE VALUE


utl_file_dir string
workarea_size_policy string AUTO
xml_db_events string enable

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,备库配置

所有配置:

展开看详情 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 OS
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 NODE12C02

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
de12c02/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 NODE12C02

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/dr1NODE12C02.dat
dg_broker_config_file2 string /orcl/app/oracle/product/12.1.
0/db_1/dbs/dr2NODE12C02.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,node12c03,node12c04

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,node12c03
,node12c04,node12c02)
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=NODE12C02

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=node12c01 ASYNC valid_

NAME TYPE VALUE


                     for=(online_logfiles,primary_r
                     ole) db_unique_name=node12c01

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
log_archive_dest_28 string

NAME TYPE VALUE


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
log_archive_dest_state_1 string enable

NAME TYPE VALUE


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
log_archive_dest_state_2 string ENABLE

NAME TYPE VALUE


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
log_archive_dest_state_3 string enable

NAME TYPE VALUE


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
log_archive_max_processes integer 4

NAME TYPE VALUE


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
max_dispatchers integer

NAME TYPE VALUE


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
nls_comp string BINARY

NAME TYPE VALUE


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
nls_territory string AMERICA

NAME TYPE VALUE


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
open_cursors integer 300

NAME TYPE VALUE


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
optimizer_inmemory_aware boolean TRUE

NAME TYPE VALUE


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
parallel_degree_policy string MANUAL

NAME TYPE VALUE


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
pdb_lockdown string

NAME TYPE VALUE


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
plsql_warnings string DISABLE:ALL

NAME TYPE VALUE


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
remote_dependencies_mode string TIMESTAMP

NAME TYPE VALUE


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
result_cache_max_result integer 5

NAME TYPE VALUE


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
serial_reuse string disable

NAME TYPE VALUE


service_names string NODE12C02
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
shared_pool_size big integer 0

NAME TYPE VALUE


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
sql92_security boolean TRUE

NAME TYPE VALUE


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
temp_undo_enabled boolean FALSE

NAME TYPE VALUE


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
undo_tablespace string UNDOTBS1

NAME TYPE VALUE


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

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>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
[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节点二配置

总配置:

展开看更多详情 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 NODE12C04

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
de12c04/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 NODE12C04

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/dr1NODE12C04.dat
dg_broker_config_file2 string /orcl/app/oracle/product/12.1.
0/db_1/dbs/dr2NODE12C04.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=node12c04

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" , vali
                     d_for=(standby_logfiles,standb
                     y_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 NODE12C04
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>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
[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'

恢复控制文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
启动数据库到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

设置参数

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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,开始启动

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
关闭所有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日志

查看alter日志

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