Oracle安装配置过程中,是与操作系统、存储、网络密切相关的。特别是在Linux、AIX环境中,配置过程相对复杂,一个环节错误可能就会引起后续一系列的问题故障。
此外,随着Oracle版本的变化,相同安装项目执行的步骤方法有很大变化。比如Data Guard,发展到11g有三种安装方法,每种方法的配置都有所差异不同。我们很多朋友在安装过程中,往往不在意版本差异,只是简单从网络上搜索一些文章就去实验使用。网络资源的确丰富了我们解决问题的思路和广度,但是网络中一些只言片语、张冠李戴的说法做法,也的确会给我们造成麻烦。
本篇记录了笔者安装Data Guard过程中遇到的两个小问题解决方法,记录下来留待需要的朋友不时之需。
相关参考:
Oracle Data Guard 重要配置参数
基于同一主机配置 Oracle 11g Data Guard
探索Oracle之11g DataGuard
Oracle Data Guard (RAC+DG) 归档删除策略及脚本
Oracle Data Guard 的角色转换
Oracle Data Guard的日志FAL gap问题
Oracle 11g Data Guard Error 16143 Heartbeat failed to connect to standby 处理方法
1、环境背景介绍
使用Oracle 11.2.0.4进行实验,项目是进行Active Data Guard搭建过程。由于环境条件所限,笔者实现在一台物理机上实现Primary和Standby。
SQL> select * from v$version;
BANNER
--------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
2、/dev/shm过小引起故障
其他配置过程和官方推荐安装Active Dataguard方法相同。进行参数配置、密码文件创建、Oracle Net文件配置和Standby端参数文件创建后,使用RMAN进行duplicate过程,脚本如下:
run {
duplicat target database for standby from active database
spfile
parameter_value_convert 'ora11g','ora11gsy'
set db_unique_name='ora11gsy'
set log_archive_max_processes='5'
set fal_client='ora11gsy'
set fal_server='ora11g'
set standby_file_management='AUTO'
set log_archive_config='dg_config=(ora11g,ora11gsy)'
set log_archive_dest_2='service=ora11g async valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=ora11g';
}
此时primary和standby实例都在启动状态,运行RMAN连接并执行脚本。
[oracle@SimpleLinux dbs]$ rman nocatalog
Recovery Manager: Release 11.2.0.4.0 - Production on Thu Apr 10 11:21:49 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
RMAN> connect target sys/oracle@ora11g
connected to target database: ORA11G (DBID=4239941846)
using target database control file instead of recovery catalog
RMAN> connect auxiliary sys/oracle@ora11gsy
connected to auxiliary database: ORA11GSY (not mounted)
执行脚本:
RMAN> @cr_phy_standby
RMAN> run {
2> duplicate target database for standby from active database
3> spfile
4> parameter_value_convert 'ora11g','ora11gsy'
5> set db_unique_name='ora11gsy'
(篇幅原因,有省略……)
sql statement: alter system set log_archive_config = ''dg_config=(ora11g,ora11gsy)'' comment= '''' scope=spfile
sql statement: alter system set log_archive_dest_2 = ''service=ora11g async valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=ora11g'' comment= '''' scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 04/10/2014 11:51:19
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-04014: startup failed: ORA-00845: MEMORY_TARGET not supported on this system
duplicate过程报错,执行失败。
从分析看,应该是Oracle运行和内部共享内存分配有关。Linux中的/dev/shm对应tmpfs,也就是临时共享内存结构。当前大小为:
[root@SimpleLinux ~]# df -lh
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 48G 13G 33G 28% /
tmpfs 448M 160M 288M 36% /dev/shm
当前系统中包括两个实例对象,消耗的共享内存要超过一个实力的情况。所以需要调节增大这部分大小。
[root@SimpleLinux ~]# vi /etc/fstab
#
# /etc/fstab
# Created by anaconda on Wed Mar 12 08:33:33 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=19248f54-250c-46a0-8e5d-ec26a6a08342 / ext4 defaults 1 1
UUID=5ce24d42-a713-4b6c-8d9b-0d780346e093 swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults,size=2G 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
~
在存储空间允许的情况下,调节tmpfs方法就是在fstab中增加size参数,直接指定大小。
[root@SimpleLinux ~]# mount /dev/shm
[root@SimpleLinux ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 48G 13G 33G 28% /
tmpfs 2.0G 0 2.0G 0% /dev/shm
再次执行脚本,依然报错,但是故障提示变化。
startup clone nomount;
}
executing Memory Script
sql statement: alter system set control_files = ''/u01/app/oradata/ORA11G/controlfile/o1_mf_9mnjwpko_.ctl'', ''/u01/app/fast_recovery_area/ORA11G/controlfile/o1_mf_9mnjwpw2_.ctl'' comment= ''Set by RMAN'' scope=spfile
Starting backup at 10-APR-14
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: =========================================
RMAN-03002: failure of Duplicate Db command at 04/10/2014 12:18:19
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 04/10/2014 12:18:19
ORA-17628: Oracle error 19505 returned by remote Oracle server
RMAN> **end-of-file**
更多详情见请继续阅读下一页的精彩内容: