大家可能已经知道,在Oracle的DATAGUARD(这里指的是PHYSICAL STANDBY)环境中,Primary端会把生成的REDO传到Standby端,然后由Standby端的MRP进程应用该Redo,以达到同期效果。

首先,REDO_TRANSPORT_USER参数的意义如下:

http://docs.oracle.com/database/122/REFRN/REDO_TRANSPORT_USER.htm#REFRN10269

REDO_TRANSPORT_USER specifies the name of the user whose password verifier is used when a remote login password file is used for redo transport authentication.

This user must have the SYSDBA or SYSOPER privilege。。。

翻译过来就是,Standby端使用密码认证来保证REDO传输认证的话,利用指定的REDO_TRANSPORT_USER来进行认证。

手册上写着,REDO_TRANSPORT_USER用户需要有SYSDBA 或者 SYSOPER权限。

但是通过实际测试来看,只有SYSDBA是不行的,必须有SYSOPEN权限才行。

测试的时候使用的是12.2的DATAGUARD环境。

关于REDO_TRANSPORT_USER这个参数,也可以看看这个Mos 文档

 Troubleshooting ORA-16191 and ORA-1017/ORA-1031 in Data Guard Log Transport Services or Data Guard Broker (Doc ID 1368170.1)

=============
6. If you have setup the 'REDO_TRANSPORT_USER'-Initialization  Parameter to a certain User,
this User must be granted the  'SYSOPER'-Role and the Setting for this Parameter must be the same on  the Primary and all Standby Databases.
=============

简单的测试如下:

Test Case
------------------
▼Primary:ORCL
--create password file(12.2)
cd $ORACLE_HOME/dbs
orapwd file=orapworcl format=12.2 password=ora_1234 force=y

--create user
create user ORASYS identified by ora_1234;
create user ORAOPER identified by ora_1234;
grant CONNECT,SYSDBA to ORASYS;
grant CONNECT,SYSOPER to ORAOPER;

--check if the user created can connect to database.
sqlplus SYS/"ora_1234@orcl as SYSDBA"
sqlplus ORASYS/"ora_1234@orcl as SYSDBA"
sqlplus ORAOPER/"ora_1234@orcl as SYSOPER"

--check V$PWFILE_USERS
col USERNAME format a7
select USERNAME,SYSDBA,SYSOPER from V$PWFILE_USERS where USERNAME like 'ORA%';

USERNAM SYSDB SYSOP
------- ----- -----
ORASYS  TRUE  FALSE  <<<<<ORASYS user does not have SYSOPER Role
ORAOPER FALSE TRUE   <<<<<ORAOPER user have SYSOPER Role

■create dataguard

▼Standby:ORCLST
--check V$PWFILE_USERS
col USERNAME format a7
select USERNAME,SYSDBA,SYSOPER from V$PWFILE_USERS where USERNAME like 'ORA%';

USERNAM SYSDB SYSOP
------- ----- -----
ORASYS  TRUE  FALSE
ORAOPER FALSE TRUE

--check if the user created can connect to database
sqlplus SYS/"ora_1234@orclst as SYSDBA"
sqlplus ORASYS/"ora_1234@orclst as SYSDBA"
sqlplus ORAOPER/"ora_1234@orclst as SYSOPER"

--SYS(default) REDO transportation
▼Primary:ORCL
create table scott.test(id number);
insert into scott.test values(1);
commit;
alter system archive log current;

▼Standby:ORCLST
select count(*) from scott.test;
=> REDO transportation was fine.

--SYSDBA[ORASYS] REDO transportation
▼Primary:ORCL
alter system set REDO_TRANSPORT_USER=ORASYS scope=spfile;
shutdown immediate

▼Standby:ORCLST
alter system set REDO_TRANSPORT_USER=ORASYS;

▼Primary:ORCL
startup
insert into scott.test values(1);
commit;
alter system archive log current;

▼Standby:ORCLST
select count(*) from scott.test;
-- REDO transportation failed on ORA-16191
-- You can see ORA-16191 from alert log of Primary.

--SYSOPER[ORAOPER] REDO transportation
▼Primary:ORCL
alter system set REDO_TRANSPORT_USER=ORAOPER scope=spfile;
shutdown immediate

▼Standby:ORCLST
alter system set REDO_TRANSPORT_USER=ORAOPER;

▼Primary:ORCL
startup

▼Standby:ORCLST
select count(*) from scott.test;
=> REDO transportation was fine.

▼Primary:ORCL
insert into scott.test values(1);
commit;
alter system archive log current;

▼Standby:ORCLST
select count(*) from scott.test;
=> REDO transportation was fine.

[Oracle][DATAGUARD]关于REDO_TRANSPORT_USER参数的更多相关文章

  1. Oracle Dataguard之switchover

    Oracle Dataguard的角色转换包含两类:Switchover和Failover.Switchover指主备之间角色转换,主库降为备库,备库升级为主库.而failover则是指主库出现问题时 ...

  2. Oracle Dataguard之Real-Time Apply

    Oracle Dataguard一共支持三种模式:最大可用模式(Maximum Availability),最大性能模式(Maximum Performance),最大保护模式(Maximum Pro ...

  3. Oracle Dataguard之物理standby的基本配置

    尽管网上有很多Oracle Dataguard的配置教程,但不难发现,很多采用的是rman duplicate这种方法,尽管此种方法较为简便.但在某种程度上,却也误导了初学者,虽说也能配置成功,但只知 ...

  4. Oracle DataGuard 物理Standby 搭建(上)

    物理standby database 环境搭建 Arch asysnc Oracle Dataguard host IP Oracle_sid DB_unique_name FAL_server FA ...

  5. Oracle DataGuard搭建(一)

    第一次搭建oracle dataguard.学oracle很长时间,却没有完整的搭过dg,说起来让人笑.总得有第一次,而且第一次总是很痛苦的. 数据库版本: Oracle Database 11g E ...

  6. Oracle DataGuard数据备份方案详解

    Oracle DataGuard是一种数据库级别的HA方案,最主要功能是冗灾.数据保护.故障恢复等. 在生产数据库的"事务一致性"时,使用生产库的物理全备份(或物理COPY)创建备 ...

  7. Oracle DataGuard 升级 [11.2.0.1 -> 11.2.0.4]

    Oracle DataGuard 升级 [11.2.0.1 -> 11.2.0.4] Primary: 11.2.0.1 单机,Site A. Standby: 11.2.0.1 单机,Site ...

  8. 9. Oracle DataGuard的介绍

    一. Oracle DataGuard简介 Oracle DataGuard:简称DG.是由一个Primary Database(主库)和一个或者多个Standby Database(备库)组成.对O ...

  9. oracle DataGuard 主从 踩过坑的

    一.主机描述 dbprimary: 192.168.1.57 主机名称db1    dbstandby: 192.168.1.58 主机名成db2    SID: orcl 二.配置tns,配置好的文 ...

随机推荐

  1. java如何编写多线程

    1.如何实现多线程 1.1实现Runnable接口,实现run()方法. public class Main4 implements Runnable { public static void mai ...

  2. tomcat 监控脚本

    ps -ef |grep tomcat |grep -w 'atlassian'|grep -v 'grep'|awk '{print $2}' curl -s -o /dev/null -m 10 ...

  3. Easy to Remember Color Guide for Non-Designers

    Notes: I'm not a designer. This is what i've self-learnt over the years because i couldn't afford go ...

  4. luoguP1919 A*B Problem升级版 ntt

    luoguP1919 A*B Problem升级版 链接 luogu 思路 ntt模板题 代码 #include <bits/stdc++.h> #define ll long long ...

  5. [524.A]2019-05-02(星期四)登顶梧桐山邀请

    *** 看房活动召集 ***五一期间天气炎热, 除了登山活动, 还将组织看房活动.拥有一套自己的住房是很多深圳人的梦想.政府十三五期间计划供应人才住房和保障性住房35万套, 与需求相比仍很少, 排队的 ...

  6. idea工具和激活码获取

    1.下载最新的idea https://blog.csdn.net/mashuai720/article/details/79389314 2.获取激活码 最后一个有效,亲测 https://blog ...

  7. springboot整合ActiveMQ,配置问题

    1.ActiveMQ的安装和相关配置修改 去官网下载安装包解压至文件夹 双击打开 打开浏览器输入 http://127.0.0.1:8161 到此activeMQ就安装好了 2.springboot工 ...

  8. Database operation expected to affect 1 row(s) but actually affected 0 row(s). Data may have been modified or deleted since entities were loaded

    asp.net  更新数据时报错:Database operation expected to affect 1 row(s) but actually affected 0 row(s). Data ...

  9. Wannafly挑战赛1 C MMSet2 虚树

    题目链接:https://www.nowcoder.com/acm/contest/15/C 思路:虚树,取两点间的lca,构造成一颗新的树:求(直径+1)/2即可 #pragma comment(l ...

  10. day23

    ## 复习 4.类与对象的语法class 类名: 代码块(一堆属性与方法)对象名 = 类名() 变量 | 函数 => 属性 | 方法:前者直接使用,通过所属者.语法调用 类会随所属文件加载而加载 ...