读书人

Oracle Grid control 11g及Active Dat

发布时间: 2012-09-09 09:27:54 作者: rapoo

Oracle Grid control 11g及Active DataGuard 11g安装部署(二)
安装主库各种补丁

setup new op

[oracle@gc op]$ ll

总计 29688

drwxrwxr-x 8 oracle oinstall 4096 03-23 19:24 OPatch

-rw-r--r-- 1 oracle oinstall 30358026 04-12 17:57 p6880880_112000_Linux-x86-64.zip

[root@gc ~]# cd /u01/app/ora11g/product/11.2.0/ db_1/OPatch

[root@gc OPatch]# cd ..

[root@gc grid]# pwd

/u01/app/ora11g/product/11.2.0/db_1

[root@gc db_1]# mv OPatch OPatch.b

[oracle@gc op]$ pwd

/112db/psu/op

[oracle@gc op]$ mv OPatch /u01/app/ora11g/product/11.2.0/db_1/

[oracle@gc op]$

[oracle@ptest OPatch]$ export ORACLE_HOME=/u01/app/ora11g/product/11.2.0/ db_1/

[root@gc OPatch]# ./opatch version

Invoking OPatch 11.2.0.1.5

OPatch Version: 11.2.0.1.5

OPatch succeeded.

安装 oracle software PSUPatch 12419331(11724916)

[oracle@gc 2419331]$ pwd

/112db/psu/db/2419331

[oracle@gc 2419331]$ /u01/app/ora11g/product/11.2.0/grid/OPatch/./opatch apply

Invoking OPatch 11.2.0.1.5

check Patch 12419331(11724916)

[oracle@gc OPatch]$ ./opatch lsinventory

Invoking OPatch 11.2.0.1.5

安装GIPSU (Grid Infrastructure Patch Set Update)

ready for setup

[oracle@gc bin]$ ./crs_stop -all

[oracle@gc bin]$ ./crs_stat -t

名称类型目标状态主机

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

ora.DATA.dg ora....up.type OFFLINE OFFLINE

ora....ER.lsnr ora....er.type OFFLINE OFFLINE

ora.asm ora.asm.type OFFLINE OFFLINE

ora.cssd ora.cssd.type OFFLINE OFFLINE

ora.diskmon ora....on.type OFFLINE OFFLINE

ora.evmd ora.evm.type OFFLINE OFFLINE

ora.ons ora.ons.type OFFLINE OFFLINE

0216: 无法停止资源 'ora.ons'。

[oracle@gc bin]$ ./crsctl stop has

CRS-4133: Oracle High Availability Services已停止。

[oracle@gc bin]$ ./crs_stat -t

CRS-0184: 无法与 CRS守护程序通信。

Set GI psu start

[oracle@hotel01 gi]$ pwd

/112db/psu/gi

[oracle@ hotel01 gi]$ ll

drwxrwxr-x 4 oracle oinstall 4096 04-06 00:14 11724916

drwxr-xr-x 5 oracle oinstall 4096 04-06 00:13 12311357

-rw-r--r-- 1 oracle oinstall 422 04-06 00:14 bundle.xml

-rw-r--r-- 1 oracle oinstall 242833091 04-20 11:19 p12311357_112020_Linux-x86-64.zip

-rw-rw-r-- 1 oracle oinstall 103211 04-19 12:24 README.html

-rw-r--r-- 1 oracle oinstall 21 04-06 00:14 README.txt

[oracle@hotel01 gi]$

Root user:

[root@hotel01 ~]cd /u01/app/ora11g/product/11.2.0/

[root@hotel01 11.2.0]# ll

drwxrwxr-x 2 oracle oinstall 4096 06-03 09:53 db_1

drwxr-x--- 67 root oinstall 4096 06-03 11:42 grid

[root@hotel01 11.2.0]# chown -R oracle:oinstall grid

oracle user:

[oracle@hotel01~]export ORACLE_HOME=/u01/app/ora11g/product/11.2.0/grid

[oracle@hotel01 OPatch]$ pwd

/u01/app/ora11g/product/11.2.0/db_1/OPatch

Patch 12419353(12311357)

[oracle@hotel01 OPatch]$ ./opatch napply -oh /u01/app/ora11g/product/11.2.0/grid -local /112db/psu/gi/12419353

Invoking OPatch 11.2.0.1.5

Oracle 中间补丁程序安装程序版本 11.2.0.1.5

版权所有 (c) 2010, Oracle Corporation。保留所有权利。

UTIL session

Oracle 主目录 : /u01/app/ora11g/product/11.2.0/grid

主产品清单: /u01/app/oraInventory

从 : /etc/oraInst.loc

OPatch 版本 : 11.2.0.1.5

OUI 版本 : 11.2.0.2.0

OUI 位置 : /u01/app/ora11g/product/11.2.0/grid/oui

日志文件位置 : /u01/app/ora11g/product/11.2.0/grid/cfgtoollogs/opatch/opatch2011-06-03_11-51-04上午.log

Patch history file: /u01/app/ora11g/product/11.2.0/grid/cfgtoollogs/opatch/opatch_history.txt

Invoking utility "napply"

Checking conflict among patches...

Checking if Oracle Home has components required by patches...

Checking conflicts against Oracle Home...

OPatch continues with these patches: 12419353

是否继续? [y|n]

y

User Responded with: Y

Running prerequisite checks...

提供电子邮件地址以用于接收有关安全问题的通知,安装 Oracle Configuration Manager并启动它。如果您使用 My Oracle

Support 电子邮件地址/用户名,操作将更简单。

有关详细信息, 请访问 http://www.oracle.com/support/policies.html。

电子邮件地址/用户名:

尚未提供电子邮件地址以接收有关安全问题的通知。

是否不希望收到有关安全问题 (是 [Y],否 [N]) [N]的通知: Y

您选择了 -local 选项, 因此 OPatch将仅对本地系统打补丁。

请关闭本地系统上在此 ORACLE_HOME之外运行的 Oracle实例。

(Oracle 主目录 = '/u01/app/ora11g/product/11.2.0/grid')

本地系统是否已准备打补丁? [y|n]

y

User Responded with: Y

正在备份受补丁程序 'NApply'影响的文件以用于还原。此操作将需要一些时间...

Applying patch 12311357...

ApplySession 将中间补丁程序 '12311357'应用到 OH '/u01/app/ora11g/product/11.2.0/grid'

正在备份受补丁程序 '12311357'影响的文件以用于回退。此操作将需要一些时间...

正在为组件 oracle.crs, 11.2.0.2.0打补丁...

将文件复制到 "/u01/app/ora11g/product/11.2.0/grid/bin/appagent.bin"

将文件复制到 "/u01/app/ora11g/product/11.2.0/grid/bin/appvipcfg"

将文件复制到 "/u01/app/ora11g/product/11.2.0/grid/bin/appvipcfg.pl"

check Patch 12419353(12311357)

[oracle@hotel01 OPatch]$ ./opatch lsinventory

Invoking OPatch 11.2.0.1.5

Oracle 中间补丁程序安装程序版本 11.2.0.1.5

版权所有 (c) 2010, Oracle Corporation。保留所有权利。

Oracle 主目录 : /u01/app/ora11g/product/11.2.0/grid

主产品清单: /u01/app/oraInventory

从 : /etc/oraInst.loc

OPatch 版本 : 11.2.0.1.5

OUI 版本 : 11.2.0.2.0

OUI 位置 : /u01/app/ora11g/product/11.2.0/grid/oui

日志文件位置 : /u01/app/ora11g/product/11.2.0/grid/cfgtoollogs/opatch/opatch2011-08-07_19-42-23下午.log

Patch history file: /u01/app/ora11g/product/11.2.0/grid/cfgtoollogs/opatch/opatch_history.txt

Lsinventory Output file location : /u01/app/ora11g/product/11.2.0/grid/cfgtoollogs/opatch/lsinv/lsinventory2011-08-07_19-42-23下午.txt

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

已安装的顶级产品 (1):

Oracle Grid Infrastructure 11.2.0.2.0

此 Oracle 主目录中已安装 1 个产品。

中间补丁程序 (1) :

Patch 12419353 : applied on Sun Aug 07 19:41:15 CST 2011

Unique Patch ID: 13846303

Created on 17 Jul 2011, 08:05:53 hrs PST8PDT

Bugs fixed:

12419353, 10157506, 10178670, 10425672, 12311357, 9959110, 10272615

10314123, 10014392, 10089120, 10057296, 9864003, 11775080, 9916145

10044622, 12399977, 12421404, 12340700, 10056713, 10637741, 9939306

9902536, 10007185, 10376847, 10038791, 11741224, 11655840, 10048487

10322157, 10260251, 10052721, 10028235, 10027079, 10357258, 10045436

10231906, 10622973, 9891341, 10072474, 10036834, 10029900, 9974223

10016083, 9918485, 11781515, 10040647, 10069541, 10029119, 10233159

12332919, 9812956, 10036193, 10015210, 12340501, 10621175, 11877079

8906163, 10111010, 10115514, 10104377, 10057680, 10280665, 10078086

9944948, 10146768, 10052529, 10011084, 10012319, 10073075, 10233811

10299006, 10248739, 10236074, 10128191, 11071429, 10019726, 9975837

10253630, 9949676, 11936945, 10637483, 10157622, 11698552, 10385838

10053985, 10425674, 9812970, 11828633, 11899801, 10083789, 9876201

10073372, 9963327, 11077756, 10375649, 9336825, 11682409, 10062301

10018215, 10105195, 10419987, 10071992, 10634513, 9926027, 10103954

10028343, 11866171, 10065216, 9907089, 9897335, 10190153, 11744313

10175855, 10284828, 10028637, 10361177, 9979706, 10324594, 10015460

9971646, 11782423, 11654726, 9978765, 10398810, 11904778, 10397652

9915329, 10107380, 10110969, 10305361, 10331452, 10083009, 10631693

10008467, 10048027, 10040109, 9944978, 10033106, 9978195, 11840629

10042143, 10284693, 10638381, 9679401, 11663339, 10075643, 10205290

10124517, 11069614, 9593552, 10168006, 12677816, 11807012, 11846686

9867867, 10228079, 10015603, 10241696, 9942881, 10252497, 10283058

10157625, 10283167, 9906432, 10216878, 10045316, 10425675, 10061534

11789566, 10283549, 10311856, 10150020, 12421420, 12378675, 10113899

10069698, 9861790, 10087118, 10056808, 10146744, 10326548, 10019796

9975343, 9936659, 10244210, 10029794, 10266447, 10193581, 12318560

11804097, 10070563, 10268642, 10283596

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

OPatch succeeded.

Patch 12419331(11724916)

[oracle@gc OPatch]$ ./opatch napply -oh /u01/app/ora11g/product/11.2.0/grid -local /112db/psu/gi/12419331

check Patch 12419331(11724916)

[oracle@hotel01 OPatch]$ ./opatch lsinventory

Invoking OPatch 11.2.0.1.5

Oracle 中间补丁程序安装程序版本 11.2.0.1.5

版权所有 (c) 2010, Oracle Corporation。保留所有权利。

Oracle 主目录 : /u01/app/ora11g/product/11.2.0/grid

主产品清单: /u01/app/oraInventory

从 : /etc/oraInst.loc

OPatch 版本 : 11.2.0.1.5

OUI 版本 : 11.2.0.2.0

OUI 位置 : /u01/app/ora11g/product/11.2.0/grid/oui

日志文件位置 : /u01/app/ora11g/product/11.2.0/grid/cfgtoollogs/opatch/opatch2011-08-07_20-04-17下午.log

Patch history file: /u01/app/ora11g/product/11.2.0/grid/cfgtoollogs/opatch/opatch_history.txt

Lsinventory Output file location : /u01/app/ora11g/product/11.2.0/grid/cfgtoollogs/opatch/lsinv/lsinventory2011-08-07_20-04-17下午.txt

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

已安装的顶级产品 (1):

Oracle Grid Infrastructure 11.2.0.2.0

此 Oracle 主目录中已安装 1 个产品。

中间补丁程序 (2) :

Patch 12419331 : applied on Sun Aug 07 19:53:19 CST 2011

Unique Patch ID: 13846303

Created on 11 Jul 2011, 07:34:02 hrs PST8PDT

Bugs fixed:

10151017, 10158965, 11724916, 10190642, 12586486, 12586487, 10129643

12586488, 12586489, 10018789, 9744252, 10248523, 9956713, 10356513

9715581, 9770451, 10378005, 10170431, 10425676, 10222719, 10126094

9591812, 10127360, 10132870, 10094201, 9443361, 10193846, 11664046

11069199, 10324294, 10245086, 12586490, 10205230, 12586491, 10052141

12586492, 12586493, 12586494, 10142788, 11818335, 11830776, 12586495

9905049, 11830777, 12586496, 11830778, 6892311, 10040921, 10077191

10358019, 12431716, 10219576, 10258337, 11707699, 10264680, 10209232

11651810, 10102506, 11067567, 9881076, 10278372, 10040531, 10621169

10155605, 10082277, 10356782, 10218814, 9078442, 9788588, 10157249

9735237, 10317487, 12326246, 11707302, 10310299, 10636231, 10230571

11065646, 12419321, 10368698, 10079168, 10013431, 10228151, 10233732

10324526, 8223165, 10238786, 10217802, 10061015, 9953542, 9572787

10052956, 10080579, 11699057, 12620422, 10332111, 10227288, 10329146

10332589, 10110863, 10073683, 9869401, 10019218, 10229719, 11664719

9539440, 10373381, 9735282, 9748749, 11724984, 10022980, 10411618

11800854, 12419331, 11674485, 10187168, 6523037, 10648873, 9724970

10053725, 10084145, 10367188, 11800170, 11695285, 10157402, 9651350, 10299224

Patch 12419353 : applied on Sun Aug 07 19:41:15 CST 2011

Unique Patch ID: 13846303

Created on 17 Jul 2011, 08:05:53 hrs PST8PDT

Bugs fixed:

12419353, 10157506, 10178670, 10425672, 12311357, 9959110, 10272615

10314123, 10014392, 10089120, 10057296, 9864003, 11775080, 9916145

10044622, 12399977, 12421404, 12340700, 10056713, 10637741, 9939306

9902536, 10007185, 10376847, 10038791, 11741224, 11655840, 10048487

10322157, 10260251, 10052721, 10028235, 10027079, 10357258, 10045436

10231906, 10622973, 9891341, 10072474, 10036834, 10029900, 9974223

10016083, 9918485, 11781515, 10040647, 10069541, 10029119, 10233159

12332919, 9812956, 10036193, 10015210, 12340501, 10621175, 11877079

8906163, 10111010, 10115514, 10104377, 10057680, 10280665, 10078086

9944948, 10146768, 10052529, 10011084, 10012319, 10073075, 10233811

10299006, 10248739, 10236074, 10128191, 11071429, 10019726, 9975837

10253630, 9949676, 11936945, 10637483, 10157622, 11698552, 10385838

10053985, 10425674, 9812970, 11828633, 11899801, 10083789, 9876201

10073372, 9963327, 11077756, 10375649, 9336825, 11682409, 10062301

10018215, 10105195, 10419987, 10071992, 10634513, 9926027, 10103954

10028343, 11866171, 10065216, 9907089, 9897335, 10190153, 11744313

10175855, 10284828, 10028637, 10361177, 9979706, 10324594, 10015460

9971646, 11782423, 11654726, 9978765, 10398810, 11904778, 10397652

9915329, 10107380, 10110969, 10305361, 10331452, 10083009, 10631693

10008467, 10048027, 10040109, 9944978, 10033106, 9978195, 11840629

10042143, 10284693, 10638381, 9679401, 11663339, 10075643, 10205290

10124517, 11069614, 9593552, 10168006, 12677816, 11807012, 11846686

9867867, 10228079, 10015603, 10241696, 9942881, 10252497, 10283058

10157625, 10283167, 9906432, 10216878, 10045316, 10425675, 10061534

11789566, 10283549, 10311856, 10150020, 12421420, 12378675, 10113899

10069698, 9861790, 10087118, 10056808, 10146744, 10326548, 10019796

9975343, 9936659, 10244210, 10029794, 10266447, 10193581, 12318560

11804097, 10070563, 10268642, 10283596

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

OPatch succeeded.

[oracle@hotel01 bin]$ ./crsctl start has

CRS-4123: Oracle High Availability Services已启动

安装agent PSU按上GC agent PUS安装方法。创建数据库

先安装GIASM 那么监听会自动创建

然后再创建数据库不要单独创建监听

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

ASM

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

参考如下图:

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

三.配置第一个DG

10.1.5.242

hotel02首先安装数据库软件不建库不创建监听,然后安装GI的时候会自动创建监听并启动,一定要用GIRD的监听,不然ASM注册不到监听。最后安装AGENT

1、 数据库软件,升级Opatch

2、 GI

3、 Agent

4、打db,gi,agent各种补丁

打软件补丁(2419331)、GI补丁(12419353、12419331)、agent补丁(9345913)

注意:在安装主备库时,一定要按照上面的安装软件的顺序,否则可能会遇到在安装完db,gi后不能在grid control发现home安装目标,所以要先安装完种软件,最后打补丁。

Vi /etc/hosts

10.1.5.241 hotel01

10.1.5.242 hotel02

10.1.5.243 hotel03

10.1.5.245 gc.localdomain gc

~

[oracle@OEL02 ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 10-3月 -2011 10:28:57

Copyright (c) 1991, 2010, Oracle. All rights reserved.

正在连接到 (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

LISTENER 的 STATUS

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

别名 LISTENER

版本 TNSLSNR for Linux: Version 11.2.0.2.0 - Production

启动日期 09-3月 -2011 21:15:42

正常运行时间 0天 13小时 13分 14秒

跟踪级别 off

安全性 ON: Local OS Authentication

SNMP OFF

监听程序参数文件 /u01/app/ora11g/product/11.2.0/grid/network/admin/listener.ora

监听程序日志文件 /u01/app/ora11g/diag/tnslsnr/OEL02/listener/alert/log.xml

监听端点概要...

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=OEL02)(PORT=1521)))

服务摘要..

服务 "+ASM" 包含 1 个实例。

实例 "+ASM", 状态 READY, 包含此服务的 1个处理程序...

命令执行成功

开始配置DG

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

[root@hotel02 ~]# cat /etc/oratab

#Backup file is /u01/app/ora11g/product/11.2.0/db_1/srvm/admin/oratab.bak.oel02 line added by Agent

#

# This file is used by ORACLE utilities. It is created by root.sh

# and updated by the Database Configuration Assistant when creating

# a database.

# A colon, ':', is used as the field terminator. A new line terminates

# the entry. Lines beginning with a pound sign, '#', are comments.

#

# Entries are of the form:

# $ORACLE_SID:$ORACLE_HOME:<N|Y>:

#

# The first and second fields are the system identifier and home

# directory of the database respectively. The third filed indicates

# to the dbstart utility that the database should , "Y", or should not,

# "N", be brought up at system boot time.

#

# Multiple entries with the same $ORACLE_SID are not allowed.

#

#

+ASM:/u01/app/ora11g/product/11.2.0/grid:N

# *:/u01/app/agent11g:N

# *:/u01/app/agent11g:N

*:/u01/app/agent11g:N

pridb1:/u01/app/ora11g/product/11.2.0/db_1:N

pridb:/u01/app/ora11g/product/11.2.0/db_1:N # line added by Agent

[root@hotel02 ~]#

新添加第二个DG

10.1.5.243

OEL03首先安装数据库软件不建库不创建监听,然后安装GI的时候会自动创建监听并启动,一定要用GIRD的监听,不然ASM注册不到监听。最后安装AGENT

1、 数据库软件

2、 GI

3、 Agent

4、 安装db,gi,agent的各种补丁

Vi /etc/hosts

10.1.5.241 hotel01

10.1.5.242 hotel02

10.1.5.243 hotel03

10.1.5.245 gc.localdomain gc

[oracle@OEL03 ~]$ wget https://gc:4900/agent_download/11.1.0.1.0/linux_x64/agentDownload.linux_x64 --no-check-certificate

[oracle@OEL03 ~]$ chmod u+x agentDownload.linux_x64

./agentDownload.linux_x64 -b /u01/app/ -m gc -r 4900 y

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

用GC添加DG的第二个节点

打开只读并且恢复

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

开始实时复制

备库状态

SQL> select status ,instance_name from v$instance;

STATUS INSTANCE_NAME

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

MOUNTED pridb1

SQL>

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)


Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

Open readonly 之后

SQL>select status ,instance_name from v$instance;

STATUS INSTANCE_NAME

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

OPEN pridb1

SQL> select open_mode from v$database;

OPEN_MODE

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

READ ONLY WITH APPLY

sqlplus system/oracle

Pridb 主库

SQL> create table t1 as select * from dba_objects where rownum<1000;

表已创建。

SQL>

Pridb1 pridb2

SQL> select count(*) from t1;

COUNT(*)

----------

999

备注:安装包括主库和备库,都不需要用netca创建监听,安装GI的时候会自动创建监听并启动

目录/u01/app/ora11g/product/11.2.0/grid/network/admin/listener.ora

四.后期配置管理数据库备份策略

(1)在gc服务器配置recovery catalog管理各节点的数据库备份

建catalog用户及表空间

[oracle@gc sh]$ !sql

sqlplus "/as sysdba"

SQL> create tablespace rman_tbs datafile '/u01/app/ora11g/oradata/gcdb/rman_tbs01.dbf' size 200m;

SQL> create user rman identified by rman default tablespace rman_tbs;

用户已创建。

SQL> grant connect,resource,recovery_catalog_owner to rman;

授权成功。

SQL> exit

修改tnsnames.ora如下:

GCDB =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = gc.localdomain)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = gcdb)

)

)

htdb1_241 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.5.241)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = htdb1)

)

)

htdb2_242 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.5.242)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = htdb2)

)

)

htdb3_243 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.5.243)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = htdb3)

)

)

创建recovery catalog:

[oracle@gc admin]$ rman catalog rman/rman@gcdb

RMAN> create catalog;

恢复目录已创建

(2)注册目标主数据库:

[oracle@gc ~]$ rman catalog rman/rman@gcdb target sys/oracle123@htdb1_241

RMAN> register database;

注册在恢复目录中的数据库

正在启动全部恢复目录的 resync

完成全部 resync

RMAN> report schema;

RMAN>CONFIGURE RETENTION POLICY TO REDUNDANCY 2;

RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY;

(3)配置RMAN的主备库DB_UNIQUE_NAM参数(此步可选)。

当使用下面的命令时所用到RESYNC CATALOG FROM DB_UNIQUE_NAME。配置方法如下:

CONFIGURE DB_UNIQUE_NAME BOSTON CONNECT IDENTIFIER 'boston_conn_str';

注意:主备库密码文件的sysdba密码必需相同,'boston_conn_str'是在主库配置备库的的tns连接服务别名。

RMAN> CONFIGURE DB_UNIQUE_NAME 'HTDB2' CONNECT IDENTIFIER 'htdb2_242';

RMAN> CONFIGURE DB_UNIQUE_NAME 'HTDB3' CONNECT IDENTIFIER 'htdb3_243';

RMAN> LIST DB_UNIQUE_NAME OF DATABASE;

数据库列表

数据库关键字 数据库名称 数据库 ID 数据库角色 Db_unique_name

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

1 HTDB2 1139129460 PRIMARY HTDB1

1 HTDB2 1139129460 STANDBY HTDB3

1 HTDB2 1139129460 STANDBY HTDB2

RMAN> RESYNC CATALOG FROM DB_UNIQUE_NAME 'HTDB2';

从 DB_UNIQUE_NAME为 HTDB2的数据库进行重新同步

在执行完上面的resync语句后,主库的CONFIGURE就会同步到备。可以分别用show all查看主备库配置。

(4)创建数据库备份和归档删除脚本

主库备份脚本:

[oracle@gc sh]$ cat rmanback241.sh

#!/bin/bash

. /home/oracle/.bash_profile

rman catalog rman/rman@gcdb target sys/oracle123@htdb1_241 msglog /home/oracle/log/rmanbak241.log <<EOF

run {

allocate channel c1 type disk ;

allocate channel c2 type disk ;

allocate channel c3 type disk ;

allocate channel c4 type disk ;

backup as compressed BACKUPSET database include current controlfile;

backup as compressed BACKUPSET archivelog all not backed up delete all input;

delete noprompt obsolete device type disk;

release channel c1;

release channel c2;

release channel c3;

release channel c4;

}

exit

EOF

Exit

备库归档删除脚本:

[oracle@gc sh]$ cat delarchive_242.sh

. /home/oracle/.bash_profile

rman catalog rman/rman@gcdb target sys/oracle123@htdb2_242 msglog /home/oracle/log/delarchive242.log <<EOF

run {

delete noprompt archivelog all;

}

exit

EOF

Exit

创建作业执行:

[oracle@gc sh]$ crontab -l

0 1 * * * /home/oracle/sh/rmanbak241.sh

0 2 * * * /home/oracle/sh/delarchive_242.sh

0 2 * * * /home/oracle/sh/delarchive_243.sh

注意:如果在备库配置了下面的参数,备库会根据FRA的存储空间自动删除归档日志

CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY;

下面是alert日志删除归档的记录:

Sun Sep 04 20:24:47 2011

Deleted Oracle managed file +FRA/htdb3/archivelog/2011_08_23/thread_1_seq_74.285.759929211

Archived Log entry 188 added for thread 1 sequence 170 ID 0x31d23a74 dest 1:

Sun Sep 04 22:14:10 2011

Standby controlfile consistent with primary

RFS[3]: Selected log 6 for thread 1 sequence 172 dbid 835029032 branch 759004266

Sun Sep 04 22:14:10 2011

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

Recovery of Online Redo Log: Thread 1 Group 6 Seq 172 Reading mem 0

Mem# 0: +DATA/htdb3/onlinelog/group_6.279.759061067

Mem# 1: +FRA/htdb3/onlinelog/group_6.275.759061067

Sun Sep 04 22:14:11 2011

Deleted Oracle managed file +FRA/htdb3/archivelog/2011_08_23/thread_1_seq_75.284.759929221

Archived Log entry 189 added for thread 1 sequence 171 ID 0x31d23a74 dest 1:

Mon Sep 05 01:16:38 2011

Standby controlfile consistent with primary

RFS[3]: Selected log 7 for thread 1 sequence 173 dbid 835029032 branch 759004266

Mon Sep 05 01:16:38 2011

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

Recovery of Online Redo Log: Thread 1 Group 7 Seq 173 Reading mem 0

Mem# 0: +DATA/htdb3/onlinelog/group_7.280.759061069

Mem# 1: +FRA/htdb3/onlinelog/group_7.276.759061069

打开闪回功能

主库:

SQL> startup mount

ORACLE例程已经启动。

Total System Global Area 2438529024 bytes

Fixed Size 2228920 bytes

Variable Size 1375735112 bytes

Database Buffers 1040187392 bytes

Redo Buffers 20377600 bytes

数据库装载完毕。

SQL> alter database flashback on;

SQL> alter database open;

SQL> select flashback_on from v$database;

FLASHBACK_ON

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

YES

备库:

SQL> shutdown immediate

SQL> startup mount

SQL> alter database flashback on;

alter database flashback on

第 1行出现错误:

ORA-01153:激活了不兼容的介质恢复

SQL> alter database recover managed standby database cancel;

SQL> alter database flashback on;

SQL> alter database open;

五.安装过程中的问题

问题1:未找到文件W FMLRSVCApp.ear

1.数据库安装包的第二个包没有解压缩:10098816_112020_Linux-x86-64_2of7.zip,出现下面的错误:

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

问题2:ORACLE_MIDDLEWARE_HOME_LOCATION子目录已经存在

在安装grid control时,可能会由于在安装过程中异常中断,比如网络中断、机器突然重启、磁盘空间不够的情况。都会导致gc安装失败。

再次安装时会出现下面的问题:

Oracle Grid control 11g及Active DataGuard 11g装配部署(二)

解决办法:

这时就需要把安装grid control先卸载,下面就是卸载gc的方法:

try this:

/etc/oratab

and also you have to remove following four entries from each of directories that stores inventory information:

Locate your central inventory directory from /etc/oraInst.loc

inventory_loc=/u00/app/oraInventory

ls -l

backup

ContentsXML

cd ContentsXML

vi inventory.xml

delete all the entries for

#<HOME NAME="oms11g1" LOC="/u00/app/oracle/product/11.2.0/Middleware/oms11g" TYPE="O" IDX="3"/>

#<HOME NAME="agent11g1" LOC="/u00/app/oracle/product/11.2.0/Middleware/agent11g" TYPE="O" IDX="4"/>

#<HOME NAME="common11g1" LOC="/u00/app/oracle/product/11.2.0/Middleware/oracle_common" TYPE="O" IDX="5"/>

#<HOME NAME="webtier11g1" LOC="/u00/app/oracle/product/11.2.0/Middleware/Oracle_WT" TYPE="O" IDX="6"/>

Also note that under directory Backups, there are further directories and you need to remove these entries from each and every inventory.xml.

cd backup

grep -i inventory */*/in*

once you remove all the entries.

Go to your location where you have installed Middleware.

in my case

cd /u00/app/oracle/product/11.2.0/Middleware.

rm -rf oms11g agent11g oracle_common Oracle_WT.

注意:如果在执行完上面的操作后,再返回安装界面后点击下一步仍然出现上面的问题,这时可能需要正在安装的界面关掉,然后再重新启动安装界面,在到这步一时就可过去。

问题3:patch 12423703 后续操作报错

在打完patch 12423703后,执行下面的后续操作时报错。

[oracle@gc 12423703]$ $ORACLE_HOME/bin/rcuJDBCEngine sysman/oracle123@gc.ums.com:1521:gcdb JDBC_SCRIPT apply.sql $PWD $ORACLE_HOME

…..

>>>A SQL Error occurred!: java.sql.SQLException: ORA-20110: Unexpected error executing MGMT_SET_JOB_Q_PROC. Check if patch of Bug#12620174 has been applied. Error:ORA-06576:不是有效的函数或过程名.Refer to My Oracle Support note 1326515.1 for additional information.

ORA-06512:在 line 480

oracle.sysman.assistants.common.dbutil.SQLFatalErrorException: java.sql.SQLException: ORA-20110: Unexpected error executing MGMT_SET_JOB_Q_PROC. Check if patch of Bug#12620174 has been applied. Error:ORA-06576:不是有效的函数或过程名. Refer to My Oracle Support note 1326515.1 for additional information.

ORA-06512:在 line 480

at oracle.sysman.assistants.common.dbutil.jdbc.JDBCEngine.onException(JDBCEngine.java:673)

at oracle.sysman.assistants.common.dbutil.jdbc.JDBCEngine.executeSql(JDBCEngine.java:637)

at oracle.sysman.assistants.common.dbutil.jdbc.JDBCEngine.executeSql(JDBCEngine.java:581)

at oracle.sysman.assistants.common.dbutil.jdbc.OracleDMLStatement.execute(ANSISQLStatementType.java:769)

at oracle.sysman.assistants.common.dbutil.jdbc.JDBCEngine.executeNextSQLStatement(JDBCEngine.java:1193)

at oracle.sysman.assistants.common.dbutil.jdbc.JDBCEngine.parseNexecuteScript(JDBCEngine.java:1097)

at oracle.sysman.assistants.common.dbutil.jdbc.JDBCEngine.main(JDBCEngine.java:1992)

Caused by: java.sql.SQLException: ORA-20110: Unexpected error executing MGMT_SET_JOB_Q_PROC. Check if patch of Bug#12620174 has been applied. Error:ORA-06576:不是有效的函数或过程名. Refer to My Oracle Support note 1326515.1 for additional information.

ORA-06512:在 line 480

at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)

at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)

at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1035)

at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)

at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:953)

at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1223)

at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3386)

at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3487)

at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)

at oracle.sysman.assistants.common.dbutil.jdbc.JDBCEngine.runSqlStatement(JDBCEngine.java:853)

at oracle.sysman.assistants.common.dbutil.jdbc.JDBCEngine.callRunSqlStatement(JDBCEngine.java:587)

at oracle.sysman.assistants.common.dbutil.jdbc.JDBCEngine.executeSql(JDBCEngine.java:602)

... 5 more

解决办法:安装Patch 12620174

参考matalink的文档1326515.1

修改时间 14-JUL-2011 类型 BULLETIN 状态 PUBLISHED

In this Document
Purpose
Scope and Application
Troubleshooting the Improved Patching Solution for Grid Control 11.1GC Management Server
Wrong SYSMAN Password
SYSMAN account is locked
Non-SYSMAN account is used
Invalid objects in SYSMAN schema
Parameter job_queue_processes is set to 0
DBMS Jobs are still running
PrerequisitePatch 12620174 is missing
FAQ
References


Applies to:

Enterprise Manager Grid Control - Version: 11.1.0.1 to 11.1.0.1 - Release: 11.1 to 11.1
Enterprise Manager Grid Control - Version: 11.1.0.1 to 11.1.0.1 [Release: 11.1 to 11.1]
Information in this document applies to any platform.

Purpose

Grid Control patches for the Oracle Management Server containing SQL changes are gradually delivered in a new fashion to address security, ease of use and troubleshooting concerns.

This document explains the different errors and their resolution, and contains as well a FAQ section.

OMS-sidePatch 12620174 is a prerequisite for this solution. Please refer to Note 1330489.1 for more details about it.

Scope and Application

The audience for this document is Grid Control administrators.

Troubleshooting the Improved Patching Solution for Grid Control 11.1GC Management ServerWrong SYSMAN Password

In case the wrong SYSMAN password is entered, the output is pretty much self-explanatory:

$ORACLE_HOME/bin/rcuJDBCEngine sysman@host:port:sid JDBC_SCRIPT apply.sql $PWD $ORACLE_HOME

Please enter database password:
A SQL Error occurred!
Invalid username/password.
Please enter valid username/password

Remedy: Enter the appropriate SYSMAN password at the prompt. If necessary, contact your DBA to get it reset.

SYSMAN account is locked

In case the SYSMAN account is locked, the output is pretty much self-explanatory:

$ORACLE_HOME/bin/rcuJDBCEngine sysman@host:port:sid JDBC_SCRIPT apply.sql $PWD $ORACLE_HOME

Please enter database password:
A SQL Error occurred!
ORA-28000: the account is locked

Remedy: Contact your DBA to unlock the SYSMAN account

Non-SYSMAN account is used

In case one mistakenly uses a non-SYSMAN account to apply the patch, the output is:

$ORACLE_HOME/bin/rcuJDBCEngine sysman@host:port:sid JDBC_SCRIPT apply.sql $PWD $ORACLE_HOME

Please enter database password:
###### SQL Patching operation has started. The Pre-requisites check ######
###### may take upto 3 minutes. Please do not cancel the operation. ######
###### Refer to My Oracle Support note 1326515.1 for more information ######


##### Start Patch Pre-requisites Check ######
Error encountered. Cleaning up in prereq-check exception block
###### Patch Pre-requisites check FAILED. Exiting Patching process. ######


>>>A SQL Error occurred!
java.sql.SQLException: ORA-20101: Current User is SYS, not SYSMAN. Retry the same command connecting as SYSMAN user. Refer to My Oracle Support note 1326515.1 for additional information.
ORA-06512: at line 480

Remedy: Use the appropriate account (generally SYSMAN) as described in the patch README.txt

Invalid objects in SYSMAN schema

In case there are invalid objects in SYSMAN schema while applying the patch, the output is:


$ORACLE_HOME/bin/rcuJDBCEngine sysman@host:port:sid JDBC_SCRIPT apply.sql $PWD $ORACLE_HOME

Please enter database password:
###### SQL Patching operation has started. The Pre-requisites check ######
###### may take upto 3 minutes. Please do not cancel the operation. ######
###### Refer to My Oracle Support note 1326515.1 for more information ######


##### Start Patch Pre-requisites Check ######
job_queue_processes value before patching
---------------- ---------------
SID Job Queue value
---------------- ---------------
repos 10
--------------------------------

Value of job_queue_processes is set to 0
###### Patch Pre-requisites Check SUCCESSFUL ######


###### Execution of the SQL files in the patch was SUCCESSFUL ######


###### Start Patch Post Validation ######
job_queue_processes value after patching
---------------- ---------------
SID Job Queue value
---------------- ---------------
repos 10
--------------------------------

Invalid Objects count is: 1
----------------------------------

##### Patch Post Validation SUCCESSFUL ######
###### SQL Patching operation SUCCESSFUL ######

------------------------- INFORMATION --------------------------------
Use the following Query to know the invalid objects in SYSMAN schema:
SELECT object_name, object_type, subobject_name
FROM all_objects WHERE
status != 'VALID'
AND owner = 'SYSMAN'
ORDER BY 1, 2, 3;
Refer to My Oracle Support note 1326515.1 for additional information.
---------------------------------

Completed SQL script execution normally.
<n> scripts were processed

Remedy: Work with your DBA to recompile invalid objects from the SYSMAN schema

Parameter job_queue_processes is set to 0The database parameter job_queue_processes is temporarily set to 0 during the SQL patching operation. However, this parameter should generally be set to 10 for Grid Control to work properly. This is why the patching utility displays a warning in case the job_queue_processes parameter is set to 0 prior to starting the patching operation, as shown in the snippet below:

--------------------------- INFORMATION ---------------------------
Value of job_queue_processes is 0. Please set it to a positive
value for normal functioning of Enterprise Manager.
Use one of the below commands as applicable:
- Set the value of job_queue_processes to N on ALL instances:
- "exec sys.mgmt_set_job_q_proc(<N>);"
- Set the value of job_queue_processes to N on instance 'SID':
- "exec sys.mgmt_set_job_q_proc(<N>, '<SID>');"
Refer to My Oracle Support note 1326515.1 for additional information.
--------------------------------

Remedy: Ask your DBA to set the job_queue_processes parameter to an appropriate value

DBMS Jobs are still runningThe Grid Control product relies on a couple of DBMS jobs to operate normally. These jobs needs to be stopped prior to starting the patching operation. The patching utility initially checks if such jobs are running and if some are running, it would wait for 3 minutes for them to complete before starting the patching exercise.

This is why we see the following snippet at the beginning of the patching operation:

###### SQL Patching operation has started. The Pre-requisites check ######
###### may take upto 3 minutes. Please do not cancel the operation. ######
###### Refer to My Oracle Support note 1326515.1 for more information ######


In case one or multiple DBMS jobs are still running after 3 minutes, the patching utility fails and displays the following output:

$ORACLE_HOME/bin/rcuJDBCEngine sysman@host:port:sid JDBC_SCRIPT apply.sql $PWD $ORACLE_HOME

Please enter database password:
###### SQL Patching operation has started. The Pre-requisites check ######
###### may take upto 3 minutes. Please do not cancel the operation. ######
###### Refer to My Oracle Support note 1326515.1 for more information ######


##### Start Patch Pre-requisites Check ######
job_queue_processes value before patching
---------------- ---------------
SID Job Queue value
---------------- ---------------
repos 10
--------------------------------

Value of job_queue_processes is set to 0
Error encountered. Cleaning up in prereq-check exception block
Reverting back to the original value of job_queue_processes
job_queue_process values after restoring due to errors in prereq-check
---------------- ---------------
SID Job Queue value
---------------- ---------------
repos 10
--------------------------------

###### Patch Pre-requisites check FAILED. Exiting Patching process. ######


>>>A SQL Error occurred!
java.sql.SQLException: ORA-20106: Exiting the script since some DBMS jobs are still running in the Repository. Please re-run the script after this query returns zero rows. SELECT l.id2 job, l.sid, to_char(last_date, 'DD-MON-YYYY:HH24.MI.SS') last_date, to_char(this_date, 'DD-MON-YYYY:HH24.MI.SS') this_date, l.inst_id instance FROM sys.job$ j, gv$lock l WHERE l.type = 'JQ' AND j.job (+) = l.id2 ORDER BY 5, 4;. Refer to My Oracle Support note 1326515.1 for additional information.
ORA-06512: at line 480

Remedy: Follow the instructions given in the error message to check when all DBMS jobs are stopped, then re-run the patching operation. If needed, contact your DBA to figure out why these jobs are still running.

PrerequisitePatch 12620174 is missingThis is the case where one attempts to apply a patch built with the new patching solution but forgot to install the prerequisitePatch 12620174.
读书人网 >其他数据库

热点推荐