生产库是建在ASM上的两节点RAC,测试库是单节点的安装了Oracle restart,版本和生产一样同为11.2.0.3
现使用存储级的复制软件将生产库的所有DG拷贝到测试库所在的磁阵,以快速构建出一个测试环境
以下记录了存储复制完成后,测试库搭建的全过程:
如果我们安装Oracle Restart环境时选择的是"Install Oracle Grid Infrastructure for a Standalone software only",那么安装完后还要进行如下配置,如果已经配置好了ASM那么直接进入"2、启动ASM实例,Mount磁盘组"
/////////////////
// 1、oracle restart安装后的配置
/////////////////
###root用户执行,其中ORACLE_HOME是grid用户下的变量
export DISPLAY=10.10.176.140:0.0
export ORACLE_HOME=/oracle/app/grid
$ORACLE_HOME/perl/bin/perl -I $ORACLE_HOME/perl/lib -I $ORACLE_HOME/crs/install $ORACLE_HOME/crs/install/roothas.pl
Using configuration parameter file: /oracle/app/grid/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
LOCAL ADD MODE
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'system'..
Operation successful.
CRS-4664: Node qc26702a successfully pinned.
Adding Clusterware entries to inittab
qc26702a 2015/07/22 16:35:26 /oracle/app/grid/cdata/qc26702a/backup_20150722_163526.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
###可以看到基础资源已经注册到了oracle restart环境
grid@qc26702a:/home/grid>crsctl status res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ons
OFFLINE OFFLINE qc26702a
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
1 OFFLINE OFFLINE
ora.diskmon
1 OFFLINE OFFLINE
ora.evmd
1 ONLINE ONLINE qc26702a
###继续进行配置,这步主要是更新oracle Inventory,以Grid用户执行
su - grid
export DISPLAY=10.10.176.140:0.0
$ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME -defaultHomeName CLUSTER_NODES= CRS=TRUE
Starting Oracle Universal Installer...
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 16384 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /oracle/app/oraInventory
'UpdateNodeList' was successful.
###使用asmca配置ASM实例,并启动ASM instance
创建过程中必须指定一块盘创建dg用于存放spfile,注意这块磁盘不能是BCV的目标磁盘,否则下次同步时信息会丢失
###ASM实例创建后检查ora.SPDG.dg(包含spfile的diskgroup)、ora.asm、ora.cssd、ora.evmd四个资源应该处于online
grid@qc26702a:/home/grid>crsctl status res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.SPDG.dg
ONLINE ONLINE qc26702a
ora.asm
ONLINE ONLINE qc26702a Started
ora.ons
OFFLINE OFFLINE qc26702a
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
1 ONLINE ONLINE qc26702a
ora.diskmon
1 OFFLINE OFFLINE
ora.evmd
1 ONLINE ONLINE qc26702a
/////////////////
// 2、启动ASM实例,Mount磁盘组
/////////////////
###连接ASM实例,使用asmcmd的lsdg命令能看到刚才创建的存放spfile的DG
grid@qc26702a:/home/grid>export ORACLE_SID=+ASM
grid@qc26702a:/home/grid>asmcmd
ASMCMD> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 46477 46418 0 46418 0 N SPDG/
###调整ASM初始化参数重启ASM instance
alter system set asm_diskstring='/dev/rhdiskpower*' scope=both;