11g DataGuad正确修改sys密码的方法

简介:

一、环境描述

    database version:11.2.0.4

    单实例DataGuard

    rhel 6.6


二、实验过程

  1. 主库修改sys密码

SQL> alter user sys identified by oracle321;

User altered.

SQL> alter system switch logfile;

System altered.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /arch
Oldest online log sequence     125
Next log sequence to archive   127
Current log sequence           127
SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /arch
Oldest online log sequence     127
Next log sequence to archive   129
Current log sequence           129


2.备库查看是否正常同步数据

SQL> select applied,sequence# from v$archived_log order by 2;

APPLIED    SEQUENCE#
--------- ----------
YES              106
YES              107
YES              108
YES              109
YES              110
YES              111
YES              112
YES              113
YES              114
YES              115
YES              116

APPLIED    SEQUENCE#
--------- ----------
YES              117
YES              118
YES              119
YES              120
YES              121
YES              122
YES              123
YES              124
YES              125
YES              126
YES              127

APPLIED    SEQUENCE#
--------- ----------
IN-MEMORY        128


3.备库取消应用后,再启用mrp进程查看

SQL> alter database recover managed standby database cancel;

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


SQL> select applied,sequence# from v$archived_log order by 2;

APPLIED    SEQUENCE#
--------- ----------
YES              107
YES              108
YES              109
YES              110
YES              111
YES              112
YES              113
YES              114
YES              115
YES              116
YES              117

APPLIED    SEQUENCE#
--------- ----------
YES              118
YES              119
YES              120
YES              121
YES              122
YES              123
YES              124
YES              125
YES              126
YES              127
YES              128

APPLIED    SEQUENCE#
--------- ----------
YES              129
IN-MEMORY        130


4.重启备库,然后启用mrp进程,再观察

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 1653518336 bytes
Fixed Size                  2253784 bytes
Variable Size            1526729768 bytes
Database Buffers          117440512 bytes
Redo Buffers                7094272 bytes
Database mounted.
Database opened.
SQL> alter database recover managed standby database using current logfile disconnect from session;

Database altered.


SQL> select message from v$dataguard_status;

MESSAGE
--------------------------------------------------------------------------------
ARC0: Archival started
ARC1: Archival started
ARC2: Archival started
ARC3: Archival started
ARC1: Becoming the 'no FAL' ARCH
ARC2: Becoming the heartbeat ARCH
ARC2: Becoming the active heartbeat ARCH
Error 1017 received logging on to the standby
FAL[client, ARC3]: Error 16191 connecting to orcl for fetching gap sequence  --报错
ARC4: Archival started
Attempt to start background Managed Standby Recovery process

MESSAGE
--------------------------------------------------------------------------------
MRP0: Background Managed Standby Recovery process started
Managed Standby Recovery starting Real Time Apply

13 rows selected.


5.主库同步密码文件

<roidb01:orcl:/u01/app/oracle/product/11.2.0/dbhome_1/dbs>$scp orapworcl roidb02:/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapworcldg
oracle@roidb02's password: 
orapworcl                                                                                          100% 1536     1.5KB/s   00:00    
<roidb01:orcl:/u01/app/oracle/product/11.2.0/dbhome_1/dbs>$


SQL> select message from v$dataguard_status;

MESSAGE
--------------------------------------------------------------------------------
ARC0: Archival started
ARC1: Archival started
ARC2: Archival started
ARC3: Archival started
ARC1: Becoming the 'no FAL' ARCH
ARC2: Becoming the heartbeat ARCH
ARC2: Becoming the active heartbeat ARCH
Error 1017 received logging on to the standby
FAL[client, ARC3]: Error 16191 connecting to orcl for fetching gap sequence
ARC4: Archival started
Attempt to start background Managed Standby Recovery process

MESSAGE
--------------------------------------------------------------------------------
MRP0: Background Managed Standby Recovery process started
Managed Standby Recovery starting Real Time Apply
RFS[1]: Assigned to RFS process 2723
RFS[2]: Assigned to RFS process 2725
RFS[3]: Assigned to RFS process 2727
RFS[4]: Assigned to RFS process 2729
ARC4: Beginning to archive thread 1 sequence 131 (1137893-1138457)
ARC4: Completed archiving thread 1 sequence 131 (0-0)
Media Recovery Log /arch/1_132_955700418.dbf
Media Recovery Log /arch/1_133_955700418.dbf
Media Recovery Log /arch/1_134_955700418.dbf

MESSAGE
--------------------------------------------------------------------------------
Media Recovery Waiting for thread 1 sequence 135
Primary database is in MAXIMUM PERFORMANCE mode
RFS[5]: Assigned to RFS process 2731
ARC1: Beginning to archive thread 1 sequence 135 (1139616-1140903)
ARC1: Completed archiving thread 1 sequence 135 (0-0)
Media Recovery Log /arch/1_135_955700418.dbf
Media Recovery Waiting for thread 1 sequence 136 (in transit)
ARC4: Beginning to archive thread 1 sequence 136 (1140903-1141035)
ARC4: Completed archiving thread 1 sequence 136 (0-0)
Media Recovery Waiting for thread 1 sequence 137 (in transit)

32 rows selected.


二、小结

  1. DataGuard 是通过sys用户进行验证的。

  2. 修改sys密码需要同步密码文件即可。










本文转自 roidba 51CTO博客,原文链接:http://blog.51cto.com/roidba/1971847,如需转载请自行联系原作者
目录
相关文章
|
关系型数据库 Linux 数据库
修改postgres密码
修改postgres密码
|
5月前
|
SQL 关系型数据库 MySQL
mysql密码的初始化,修改与重置
【8月更文挑战第16天】在 MySQL 中,可通过特定步骤初始化、修改或重置密码: 1. **初始化密码**:适合首次安装或遗忘 root 密码。需先停用 MySQL 服务,以特殊模式启动(跳过权限表),登录后更新 root 用户密码,并重启服务。 2. **修改密码**:直接使用 `ALTER USER` SQL 语句或通过客户端工具如 MySQL Workbench 修改现有用户的密码。 3. **重置密码**:若遗忘密码且初始化方法不可行,则需停用服务、修改配置文件以允许无密码启动 MySQL,登录后更改密码,并恢复正常配置重启服务。
1532 2
|
固态存储 Windows
Windows10 如何禁用或删除大的Hiberfil.sys和Pagefile.sys文件
如果您的电脑在运行时内存不充足,并且这时候又需要有更多的内存来保证系统运行的效率,那么Windows就会用硬盘空间来模拟系统的内存。这就叫做虚拟内存,通常称为页面文件。也就是由于虚拟内存的设定在对应的系统目录下产生了pagefile.sys文件。如果是SSD ,建议大家还是保留虚拟内存
436 0
|
Oracle 关系型数据库
解决sys用户不能登录ORA-01017 orapwd
在oracle的配置文件…/network/admin/sqlnet.ora 从增加了一行 sqlnet.authentication_services=() 后,sys用户就不能登录了。
105 0
|
SQL Oracle 安全
Oracle 修改SYS、system用户密码
Oracle 修改SYS、system用户密码
1954 0
|
Linux Shell 数据安全/隐私保护
Linux修改用户名及相关信息(包括root)
由于某种原因,需要修改用户名,有的小伙伴可能就犯难了。其实,Linux系统也能像windows那样随心所欲地修改用户名的,但有一点不同的是,Linux修改用户名需要root权限。
1399 0