日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

oracle 11g Dataguard 之 Remote_Transport_user

發(fā)布時(shí)間:2024/1/8 编程问答 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 oracle 11g Dataguard 之 Remote_Transport_user 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

1)背景:

當(dāng)配置Dataguard SYS密碼會(huì)一直變化的時(shí)候如何保證Dataguard主庫(kù)到備庫(kù)的日志傳輸和通信?

因?yàn)橛行┙鹑诠镜腟ecurity 要求比較高,對(duì)數(shù)據(jù)庫(kù)用戶的密碼權(quán)限回收,若果在配置11g active dataguard如果使用了sys賬號(hào)用作redo傳輸?shù)挠脩?#xff0c;默認(rèn)數(shù)據(jù)庫(kù)的redo transport user 為空表示該用戶為SYS。

SQL> show parameter redo_transport_user NAME TYPE VALUE ------------------- ------------- ----------------- redo_transport_user string

如果sys密碼一直在變那會(huì)出現(xiàn)如下錯(cuò)誤:

Error 1017 received logging on to the standby------------------------------------------------------------Check that the primary and standby are using a password fileand remote_login_passwordfile is set to SHARED or EXCLUSIVE, and that the SYS password is same in the password files.????? returning error ORA-16191------------------------------------------------------------FAL[client, ARC0]: Error 16191 connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=1521))(CONNECT_DATA=

(SERVICE_NAME=dg_std)(SERVER=DEDICATED))) for fetching gap sequence


2)解決:

更改redo transport user 為密碼不變用戶(有些公司的賬號(hào)管理對(duì)于密碼保持不變的,需要通過設(shè)置service id來實(shí)現(xiàn)密碼固定策略)


3)測(cè)試:
以下Demo只為記錄,轉(zhuǎn)載自網(wǎng)絡(luò),方便大家有個(gè)整體過程的體驗(yàn)。

1. In this case transport service running on Primary database, Standby database opened Read Only With Apply (Active Data Guard is running).REDO_TRANSPORT_USER parameter is not set on both side.

SQL> show parameter redo_transport_user NAME TYPE VALUE ------------------- ------------- ----------------- redo_transport_user string


On primary side:

SQL> alter system switch logfile; System altered. SQL> select max(sequence#) from v$archived_log; MAX(SEQUENCE#) -------------- 307?SQL> select process, status from v$managed_standby; PROCESS STATUS --------- ------------ ARCH CLOSING ARCH CLOSING ARCH CONNECTED ARCH CLOSING LNS WRITING


Alter log of primary database:

****************************************************************** LGWR: Setting 'active' archival for destination LOG_ARCHIVE_DEST_2 ****************************************************************** Wed May 01 12:06:51 2013 Archived Log entry 611 added for thread 1 sequence 307 ID 0xf23a6e3f dest 1: LNS: Standby redo logfile selected for thread 1 sequence 308 for destination LOG_ARCHIVE_DEST_2


On standby side :

SQL> select max(sequence#) from v$archived_log;MAX(SEQUENCE#) -------------- 307


Alert log of standby database:

Media Recovery Waiting for thread 1 sequence 308 Wed May 01 12:06:51 2013 Archived Log entry 308 added for thread 1 sequence 307 ID 0xf23a6e3f dest 1: Wed May 01 12:06:51 2013

Primary database is in MAXIMUM PERFORMANCE mode ASYNC transport going normally. Now I'm changing SYS password of primary.

SQL> alter user SYS identified by SYSPass1;User altered.SQL> alter system switch logfile;System altered.SQL> select process, status from v$managed_standby; PROCESS STATUS --------- ------------ ARCH OPENING ARCH CLOSING ARCH CONNECTED ARCH CLOSING LNS OPENING


Alert log of primary database:

****************************************************************** LGWR: Setting 'active' archival for destination LOG_ARCHIVE_DEST_2 ****************************************************************** Error 1031 received logging on to the standby Error 1031 for archive log file 3 to 'stldb' Wed May 01 12:15:15 2013 Archived Log entry 613 added for thread 1 sequence 308 ID 0xf23a6e3f dest 1: Errors in file /u01/app/oracle/diag/rdbms/admdb/admdb/trace/admdb_nsa2_2698.trc: ORA-01031: insufficient privileges Wed May 01 12:16:01 2013 Error 1031 received logging on to the standby PING[ARC2]: Heartbeat failed to connect to standby 'stldb'. Error is 1031.


Yes, we are getting error when changed SYS password. I coping primary password for standby with Linux copy command (cp)

[oracle@oel62-x64 dbs]$ cp orapwadmdb orapwstldb


Trying again.

SQL> alter system switch logfile;

?? System altered.

SQL> /

? System altered.??

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

? MAX(SEQUENCE#)

? --------------

????????? 310??


Alert log of primary database:

******************************************************************

LGWR: Setting 'active' archival for destination LOG_ARCHIVE_DEST_2 ******************************************************************

Wed May 01 12:19:06 2013 Archived Log entry 614 added for thread 1 sequence 309 ID 0xf23a6e3f dest 1: LNS: Standby redo logfile selected for thread 1 sequence 310 for destination LOG_ARCHIVE_DEST_2 Wed May 01 12:19:07 2013 ARC3: Standby redo logfile selected for thread 1 sequence 309 for destination LOG_ARCHIVE_DEST_2 Thread 1 cannot allocate new log, sequence 311 Checkpoint not complete Current log# 1 seq# 310 mem# 0: /u01/app/oracle/oradata/admdb/redo01.log Thread 1 advanced to log sequence 311 (LGWR switch) Current log# 2 seq# 311 mem# 0: /u01/app/oracle/oradata/admdb/redo02.log


On Standby:

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

? MAX(SEQUENCE#)

? --------------

?????? 310


Alert log of standby database:

RFS[18]: Assigned to RFS process 5039 RFS[18]: Selected log 4 for thread 1 sequence 308 dbid -231090113 branch 813174214 Recovery of Online Redo Log: Thread 1 Group 4 Seq 308 Reading mem 0 Mem# 0: /u01/app/oracle/oradata/stldb/sredo01.log Wed May 01 12:15:14 2013 Media Recovery Waiting for thread 1 sequence 309 Wed May 01 12:15:14 2013 Archived Log entry 309 added for thread 1 sequence 308 ID 0xf23a6e3f dest 1: Wed May 01 12:19:05 2013 Primary database is in MAXIMUM PERFORMANCE mode RFS[19]: Assigned to RFS process 5184 RFS[19]: Selected log 4 for thread 1 sequence 310 dbid -231090113 branch 813174214 Wed May 01 12:19:07 2013 RFS[20]: Assigned to RFS process 5186 RFS[20]: Selected log 5 for thread 1 sequence 309 dbid -231090113 branch 813174214 Wed May 01 12:19:08 2013 Recovery of Online Redo Log: Thread 1 Group 5 Seq 309 Reading mem 0 Mem# 0: /u01/app/oracle/oradata/stldb/sredo02.log Wed May 01 12:19:08 2013 Archived Log entry 310 added for thread 1 sequence 309 ID 0xf23a6e3f dest 1: Media Recovery Waiting for thread 1 sequence 310 (in transit) Recovery of Online Redo Log: Thread 1 Group 4 Seq 310 Reading mem 0


Transport continue normally after copy password file of primary database to standby side.

2. In this case I create a user and granting SYSOPER and setting REDO_TRANSPORT_USER to this user.

On primary side :

SQL> create user RTU identified by rtu; User created.?

SQL> grant SYSOPER to RTU;

Grant succeeded.

SQL> select * from v$PWFILE_USERS;

USERNAME SYSDB SYSOP SYSAS

------------------------------ ----- ----- -----

SYS TRUE TRUE FALSE RTU FALSE TRUE FALSE

SQL> alter system set REDO_TRANSPORT_USER='RTU';

System altered.

SQL> show parameter REDO_TRANSPORT_USER NAME TYPE VALUE

------------------ --------- ---------------

redo_transport_user string RTU


Alert log of primary database:

Wed May 01 12:29:10 2013 redo_transport_user changed to RTU


On Standby side :

SQL> select username from all_users??where username ='RTU';

USERNAME

------------------------------

RTU

SQL> select * from v$pwfile_users;

USERNAME SYSDB SYSOP SYSAS

------------------------------ ----- ----- -----

SYS TRUE TRUE FALSE

SQL> grant SYSOPER to RTU;

Grant succeeded.

SQL> alter system set REDO_TRANSPORT_USER=RTU;

System altered.


Now we can check, transport process.

On primary:

SQL> alter system switch logfile;

System altered.

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

MAX(SEQUENCE#)

--------------

??? 314

On standby side :

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

MAX(SEQUENCE#)

--------------

??? 314


Redo transport service using RTU user for transport redo from primary to standby database. I changing
SYS user password on primary again.

SQL> alter user sys identified by SYSPass2;

User altered.


On primary :

SQL> alter system switch logfile; System altered.

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

MAX(SEQUENCE#)

--------------

??? 315

On Standby side :

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

MAX(SEQUENCE#)

--------------

??? 315

It means transport is not stopped. If we change RTU user’s password then Redo Transport will stop, Because RTU user is privileged SYSOPER and this password change must be on password file. It means, if we change RTU user’s password we must copy password file from primary to standby side, again.ConclusionPassword files must be same for Data Guard Configuration databases. In a Data Guard configuration, all physical and snapshot standby databases must use a copy of the password file from the primary database, and that copy must be refreshed whenever the SYSOPER or SYSDBA privilege is granted or revoked, and after the password of any user with these privileges is changed.


Regards

Mahir M. Quluzade


總結(jié)

以上是生活随笔為你收集整理的oracle 11g Dataguard 之 Remote_Transport_user的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。