当前位置:主页 > 行业新闻 >

Oracle的Data Guard CPUPSU补丁介绍及安装教程

发布时间:19-12-06 阅读:713

非Data Guard的补丁安装教程可参考《http://www.fengfly.com/plus/view-214275-3.html》,Data Guard必要Primary和Standby同时打上补丁,以是步骤更繁杂一些,其主要步骤如下:

在Primary竣事日志传输办事;

关闭Standby数据库,在Standby的软件上打补丁(留意:不必要为Standby数据库打补丁),启动standby为mount状态,不启用managed recovery;

关闭Primary,在Primary的软件和数据库本身都打上补丁;

启动Primary数据库,从新开启日志传输办事;

在Standby启动Redo Apply,这样Primary上补丁脚本就会自动同步至Standby;

反省Primary和Standby是否都已安装补丁。

下面是一个具编制子:

1. 在Primary竣事日志传输办事

sys@EPAY>select database_role from v$database;

DATABASE_ROLE

----------------PRIMARY

sys@EPAY>show parameter log_archive_dest_3

NAMETYPEVALUE

------------------------------------ ----------- ------------------------------log_archive_dest_3stringSERVICE=sta ASYNC VALID_FOR=(O

NLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=epaybk

log_archive_dest_30stringlog_archive_dest_31string

sys@EPAY>alter system set log_archive_dest_state_3=defer scope=both;

System altered.

2.在Standby的Oracle软件打上补丁

2.1 关闭数据库实例,listener,ASM实例等

2.2 查看opatch的版本,假如不敷,就去下载最新的版本

2.3 在Standby的Oracle软件上打补丁

2.4 启动Standby到mount状态,启动listener

(留意:Standby不必要对数据库本身打补丁)

3. 在Primary上打补丁

3.1 关闭数据库实例,listener,ASM实例等

3.2 查看opatch的版本,假如不敷,就去下载最新的版本

3.3 在Primary的Oracle软件上打补丁

3.4 为Primary数据库本身打补丁

cd $ORACLE_HOME/rdbms/admin

sqlplus /nologSQL> CONNECT / AS SYSDBA

SQL> STARTUPSQL> @catbundle.sql psu apply

SQL> QUIT

4. 在Primary启动日志传输办事

4.1 启动Primary listener,数据库实例等

4.2 强制注册services到listener

sys@EPAY>alter system register;

System altered.

4.3 从新启动日志传输办事

sys@EPAY>alter system set log_archive_dest_state_3=enable scope=both;

System altered.

留意:启动日志传输,在alert里有可能呈现如下差错:

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

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

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

根据差错信息的提示,应该是主库在做CPU补丁的时刻把sys密码改动了,用主库的密码文件调换备库的密码文件即可办理该差错。

5. Standby启动Redo Apply

5.1 open Standby 数据库

5.2 启用Redo Apply

sys@EPAY>alter database recover managed standby database disconnect from session;

Database altered.

5.3 验证Primary和Standby是否同步

在primary端查询当前最大年夜的归档日志序号:

sys@EPAY>select max(sequence#) from v$archived_log;

MAX(SEQUENCE#)

--------------159

在standby端查询已传过来的归档日志:

sys@EPAY>select sequence#, applied from v$archived_log;

5.4 从alert.log可用看出同步了3个日志文件(即把在primary打的补丁同步到了standby)

alter database recover managed standby database disconnect from session

Attempt to start background Managed Standby Recovery process (epay)Wed Jul 10 06:03:48 2013

MRP0 started with pid=29, OS id=15030MRP0: Background Managed Standby Recovery process started (epay)

started logmerger processWed Jul 10 06:03:53 2013

Managed Standby Recovery not using Real Time ApplyWed Jul 10 06:04:01 2013

Parallel Media Recovery started with 32 slavesWaiting for all non-current ORLs to be archived...

All non-current ORLs have been archived.Wed Jul 10 06:04:01 2013

Completed: alter database recover managed standby database disconnect from sessionMedia Recovery Log /data/oradata/epay/archivelog/1_157_814716635.dbf

Media Recovery Log /data/oradata/epay/archivelog/1_158_814716635.dbfMedia Recovery Log /data/oradata/epay/archivelog/1_159_814716635.dbf

Media Recovery Waiting for thread 1 sequence 160 (in transit)

6. 后期反省补丁是否安装成功

6.1 在primary, standby分手指向opatch lsinventory

6.2 在数据库里反省补丁是否安装成功

参考文档:《How do you apply a Patchset,PSU or CPU in a Data Guard Physical Standby configuration [ID 278641.1]》

6)安装补丁(数据库部分)

涉猎Readme文档



上一篇:猪价还会涨吗?供求上不支持生猪高价位持续运
下一篇:雷军投资小鹏汽车成股东 小鹏汽车创始人继续跟