随着全球时代的到来,信息数据越来越成为企业关注的焦点,即在各种自然灾害或者人为破坏的情况下,如何保证生产数据的和关键业务的不中断运行。传统的保护方法离线备份、备份介质异地保存在一定程度上可以解决上述问题,但为了能够对业务系统提供更高的实时性和可靠性,保证关键业务7x24不中断,应对激烈的市场竞争和提高客户满意度,企业必须在IT系统围绕“连续”(BC)主题进行构建,实施业务连续/容灾备份计划,包括业务连续性、高可用性管理、容灾、数据复制和恢复方案、安全等,下面就对数据复制技术做一个简单的介绍。
根据数据复制运行的位置,可以将数据复制方式分为以下四种:
基于(Storage-Based):代表厂商有EMC SRDF、IBM PPRC/GDPS 、HP BusinessCopy、HDS TrueCopy等,特点对主机透明,对应用系统的影响较小,技术成熟,有较多的成功案例,但是投资较大,对连接的要求也较高。
基于(Host-based):代表厂商主要是Symantec公司的Veritas Volume Replicator (VVR),是存储卷的复制技术。需要占用主机一定的系统资源。
基于存储交换机(SAN-Based):运行于挂接在存储网络上的专用设备中,代表厂商有CISCO的SANTap,FalconStor IPStor,Topio SANsafe,DataCore SANsymphony, Asynchronous Internet Mirroring (AIM)等。
基于数据库/应用 :代表厂商有Oracle DataGuard,Quest SharePlex,IBM-DB2的远程Q复制,SYBASE的复制(Replication Server) 等,这些技术都是对数据逻辑操作的复制,属于逻辑数据复制,而其它3种复制的是数据卷中的数据变化,属于物理数据复制。典型的逻辑数据复制是通过数据库日志实现的,优点是硬件投资小,对生产系统的影响比较小,对主、备用系统的硬件平台没有选择性;可以在广域网范围内使用。但它对数据库系统有严格的要求,并且主、备用系统必须使用相同的数据库版本。
上面介绍的主要的各厂商方案和产品可以参见下图:
本文主要介绍基于主机和逻辑卷的数据复制VVR。
VERITAS的VVR(Veritas Volume Replicator)是用于有效的灾难恢复的数据复制,可以连续对应用数据进行一个或者多个的拷贝保护。具有的优点主要有:高性能,距离不限,支持异构的和,对数据的连续保护,支持同步和异步复制。
VVR系统架构如下图:
VVR具有的系统特性如下:
(1) 最高支持32个远程节点,可以通过基于IP的LAN或者WAN;
(2) 通过对逻辑卷的同步和异步复制模式,保证数据的完整性和一致性;
(3) 确保备用节点和主节点的数据具有相同的写入顺序;
(4) 支持对网络带宽的管理和定义,支持多链路的连接;
(5) 支持对备用节点的脱机操作,以便在备用节点进行查询(例如DSS决策支持系统)或者数据备份;
(6) 易管理:同时支持命令行和图形界面(VEA);
(7) 主备节点之间支持多种异构存储;
(8) 支持不同操作系统平台之间的复制;(注:在本文中,因为设计到Oracle数据库的复制,所以主备操作系统必须同一类型,比如必须都是Solaris平台,版本完全相同的Oracle版本)
(9) 支持主流关系数据库系统,包括Oracle,DB2,Sybase和Informix,数据文件的存放格式包括逻辑卷(裸设备)或者文件系统;
(10) 支持共享的集群环境中的逻辑卷复制,比如Oracle RAC (Real Application Clusters) (注:本文中采用的是单节点Oracle复制);
(11) 支持Veritas volume set;
(12) 支持PDC (Portable Data Container)环境的数据复制;
VVR数据复制系统主要由下面五个组件组成:
■ Replicated Volume Group (RVG) 复制卷组
RVG是位于VxVM 磁盘组(DG)内的一组逻辑卷,RVG隶属于磁盘组的一部分,通过定义这些逻辑卷,
应用对逻辑卷的写操作都可以保持以主节点上同样的顺序,来写到备用节点上。
对于多数数据库系统来说,都是由一些特定的进程完成对磁盘的写操作,比如Oracle系统中的LOWR
和DBWR进程,而这些写操作总是依照着一定顺序,从而来保证实例恢复中数据的一致和完整。比如
数据库变化通常在写入日志文件后才会写入数据文件,所以当日志文件和数据文件属于要复制的不同
逻辑卷的时候,它们必须被定义到同一组RVG中。
每组RVG最多可以包括2048个数据卷。
下面介绍SRL和RLINK,它们也包括在RVG中。
■ Storage Replicator Log (SRL)
SRL用于记录RVG中数据写操作的日志,并循环被使用。每个RVG包括一个SRL。数据在写入RVG中的卷之前,首先要写到主节点的SRL中。
从VxVM的角度来看,SRL是一个单独的卷,因为所有的写操作首先要写到SRL中,这个卷需要有较好的写性能,所以多数情况下需要对这个卷进行条带化,并且在不同的盘上mirror以保护数据,同时数据卷和SRL卷最好分布在不同的物理磁盘上以得到更好的性能。
不允许人工直接对SRL进行访问。
■ Replication Link—RLINK
用于连接主RVG和备用RVG之间的一个“链接”,一个主的RVG最多可以有32个RLINK。可以定义RLINK
的多个属性来调整数据复制的参数,比如指定复制的网络。
■ Data Change Map (DCM)
■ Replicated Data Set (RDS)
一个RDS包括了所有的主节点和备用节点的复制卷组(RVG)。RDS不是一个具体存在的对象,而是一个VVR复制技术中的一个概念。
在异步模式下VVR的数据复制和数据流向
在同步模式下VVR的数据复制和数据流向
另外,VVR是Veritas Volume Manager (VxVM)的一个单独的option,需要单独的license。
Veritas Volume Replicator 的安装
主备节点硬件和配置和版本如下:
主节点 机器名:lxsfrac01
Sun Microsystems Sun Fire X4100 Server
solaris10u4 x86_64
VVR版本: Veritas Volume Replicator 5.0 GA
Oracle 版本: Oracle 10gR2 Enterprise Edition
:SAN/ HDS AMS 1000
Public:e1000g0 私有(复制)网卡:e1000g1
备用节点机器名:lxsfrac02
软硬件环境与主节点相同
两个节点分别安装VVR和vxfs,安装方法相同,以lxsfrac02为例:
放入安装介质,一般Solaris都由vold进程自动mount CD,
如果需要手工mount:mount –F hsfs –o ro /dev/dsk/c0t6d0s2 /cdrom
root@lxsfrac02 # cd ./volume_replicator/
root@lxsfrac02 # ls
copyright docs installvvr pkgs release_notes scripts tools uninstallvvr
root@lxsfrac02 # ls -l
total 24
-rw-r--r-- 1 root root 476 Dec 15 2006 copyright
drwxrwxr-x 2 root root 512 Jun 21 10:13 docs
-rwxr-xr-x 1 root root 2283 Apr 14 2007 installvvr
drwxrwxr-x 3 root root 1024 Jun 21 10:13 pkgs
drwxrwxr-x 2 root root 512 Jun 21 10:13 release_notes
drwxrwxr-x 3 root root 512 Jun 21 10:13 scripts
drwxrwxr-x 3 root root 512 Jun 21 10:13 tools
-rwxr-xr-x 1 root root 2283 Apr 14 2007 uninstallvvr
root@lxsfrac02 # ./installvvr lxsfrac02
Veritas Volume Replicator 5.0 Installation Program
Copyright (c) 2007 Symantec Corporation. All rights reserved. Symantec, the Symantec Logo are trademarks or registered trademarks of Symantec Corporation or its affiliates in the U.S. and other countries. Other names may be trademarks of their respective owners.
The Licensed Software and Documentation are deemed to be "commercial computer software" and "commercial computer software documentation" as defined in FAR Sections 12.212 and DFARS Section 227.7202.
Logs for installvvr are being created in /var/tmp/installvvr-mrk46Y.
Initial system check:
Checking VVR installation on lxsfrac02 ............................................ not installed
Checking architecture on lxsfrac02 ................................................ i386
Veritas Volume Replicator 5.0 Installation Program
Checking system licensing
Installing licensing packages
VVR is not licensed on lxsfrac02
Enter a VVR license key for lxsfrac02: ******************
****************** successfully registered on lxsfrac02
Permanent VVR license registered on lxsfrac02
Do you want to enter another license key for lxsfrac02? [y,n,q] (n)
Veritas Volume Replicator 5.0 Installation Program
Checking installed packages on lxsfrac02
Veritas Volume Replicator 5.0 Installation Program
VVR can be installed without optional packages to conserve disk space.
Additional packages are typically installed to simplify future upgrades.
1) Required Veritas Volume Replicator packages - 855 MB required
2) All Veritas Volume Replicator packages - 861 MB required
3) Storage Foundation Enterprise packages - 911 MB required
Select the packages to be installed on all systems? [1-3,q,?] (3) 2
Veritas Volume Replicator 5.0 Installation Program
The following VVR packages will be installed:
VRTSperl Veritas Perl 5.8.8 Redistribution
VRTSvlic Veritas Licensing
VRTSicsco Symantec Common Infrastructure
VRTSpbx Symantec Private Branch Exchange
VRTSsmf Symantec Service Management Framework
VRTSat Symantec Product Authentication Service
VRTSobc33 Veritas Enterprise Administrator Core Service
VRTSob Veritas Enterprise Administrator Service
VRTSobgui Veritas Enterprise Administrator
VRTSccg Veritas Enterprise Administrator Central Control Grid
VRTSmh Veritas Storage Foundation Managed Host by Symantec
VRTSaa Veritas Enterprise Administrator Action Agent
VRTSspt Veritas Software Support Tools
SYMClma Symantec License Inventory Agent
VRTSvxvm Veritas Volume Manager Binaries
VRTSdsa Veritas Datacenter Storage Agent
VRTSfspro Veritas File System Management Services Provider
VRTSvmman Veritas Volume Manager Manual Pages
VRTSvmdoc Veritas Volume Manager Documentation
Press [Return] to continue:
...continued:
VRTSdcli Veritas Distributed Command Line Interface
VRTSalloc Veritas Volume Manager Intelligent Storage Provisioning
VRTSvmpro Veritas Volume Manager Management Services Provider
VRTSddlpr Veritas Device Discovery Layer Services Provider
VRTSvrpro Veritas Volume Replicator Client Extension and Provider for
Veritas Enterprise Administrator
VRTSvcsvr Veritas Cluster Server Agents for VVR
VRTSjre Veritas Java Runtime Environment Redistribution
VRTSjre15 Veritas Java Runtime Environment Redistribution
VRTSweb Veritas Java Web Server
VRTSvrw Veritas Volume Replicator Web Console
VRTSvrdoc Veritas Volume Replicator Documentation
Press [Return] to continue:
Checking for any AP driver issues on lxsfrac02 ................................... None
A copy of a previous VxVM configuration is present on the system lxsfrac02.
Do you want to restore and reuse the previous VxVM configuration of system lxsfrac02 [y,n,q,?] (y) n
Veritas Volume Replicator 5.0 Installation Program
Installing VVR: 100% ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
Installation completed successfully on all systems
It is optional to configure VVR now. If you choose to configure VVR later, you can either do so manually, or run the installvvr -configure command. The product installation scripts can be found in /opt/VRTS/install directory
Are you ready to configure VVR? [y,n,q] (y)
The enclosure-based naming scheme is a feature of Veritas Volume Manager. It allows one to reference disks using a symbolic name that is more meaningful than the operating system's normal device access name. This symbolic name is typically derived from the array name.
Do you want to set up the enclosure-based naming scheme? [y,n,q,?] (n) y
Veritas Volume Replicator 5.0 Installation Program
Veritas Volume Manager default disk group name configuration:
Many Veritas Volume Manager commands affect the contents or configuration of a disk group. Such commands require that the user specify a disk group. This is accomplished by using the -g option of a command or setting the VXVM_DEFAULTDG environment variable. An alternative to these two methods for some commands is to configure the name of the default disk group of a system.
Note: The default disk group feature is not available with the DCLI vxadm(1M) and vxquery(1M) commands. When using these commands, a required disk group must be explicitly identified using the -g option.
Do you want to set up a default disk group for each system? [y,n,q,?] (y) n
Veritas Volume Replicator 5.0 Installation Program
Following are the default ports that will be used by VVR on lxsfrac02 :
Port for VVR heartbeat communication: 4145
Port for vradmind daemon: 8199
Port for vxrsyncd daemon: 8989
Ports for data replication: Anonymous-Ports
The ports indicated for VVR heartbeats and vradmind are IANA assigned.
The port settings should be identical for systems that will be part of the same Replicated Data Set. They should also be identical for all the systems in a cluster.
Do you want to change any of the VVR ports on lxsfrac02? [y,n,q] (n)
Veritas Volume Replicator 5.0 Installation Program
VVR Statistics Collection Tool
The VVR administrative daemon vradmind can collect and maintain various
statistics which are helpful in solving VVR performance issues. This
collection can be tuned using a few tunables like the frequency for
gathering the statistics and the number of days for which the collected
statistics should be preserved, after which the earlier statistics are
automatically deleted.
The frequency of VVR statistics collection on lxsfrac02 is set to per 10 seconds.
Do you want to change the frequency of VVR statistics collection on lxsfrac02 ? [y,n,q] (n)
The maximum number of days for which VVR statistics can be retained is set to 3 on lxsfrac02
Do you want to change the maximum number of days for retaining VVR statistics on lxsfrac02 ? [y,n,q] (n)
Veritas Volume Replicator 5.0 Installation Program
Configuration of VVR tunables (For the advanced user)
Do you want to view or modify VVR tunables on lxsfrac02 ? [y,n,q,?] (n)
Veritas Volume Replicator 5.0 Installation Program
Verify the install systems Fully Qualified Hostnames.
Querying fully qualified domain name of host "lxsfrac02" ............................. fail
Press [Return] to continue:
Unable to find FQHN for lxsfrac02!
Enter the fully qualified hostname of "lxsfrac02" or 'QUIT' to quit install.
Enter the fully qualified host name: lxsfrac02
Veritas Volume Replicator 5.0 Installation Program
Choose how this install will be managed.
This product can configured one of the two following ways:
* Storage Foundation Management Server managed host (Recommended)
* Standalone host
Pre-requisites for Storage Foundation Management Server managed host:
* A Storage Foundation Management Server (SFMS) is configured
* SFMS should be currently running and fully operational.
* Authentication Broker that is used by SFMS should be running.
The following information would be requested during configuration:
* The host name of the SFMS
* Previously set SFMS agent account password
There are no pre-requisites for deploying as a standalone host.
Enabling Storage Foundation Management Server management simplifies and improves management of the complex data center
resources, reducing planned and unplanned down time.
Enable Storage Foundation Management Server Management? [y,n,q] (y) n
Veritas Volume Replicator 5.0 Installation Program
Verify the install systems Fully Qualified Hostnames.
Configuring VEA in STANDALONE mode on "lxsfrac02" ..................................... ok
Configuring gridnode on "lxsfrac02" ................................................... ok
Registering gridnode on "lxsfrac02" ................................................... ok
Configuring actionagent on "lxsfrac02" ................................................ ok
Registering actionagent on "lxsfrac02" ................................................ ok
Registering StorageAgent on "lxsfrac02" ............................................... ok
Do you want to start Veritas Volume Replicator processes now? [y,n,q] (y)
Veritas Volume Replicator 5.0 Installation Program
Starting VVR: 100% ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
Startup completed successfully on all systems
You declined to set up the name of the default disk group for lxsfrac02.
Installation log files, summary file, and response file are saved at:
/opt/VRTS/install/logs/installvvr-mrk46Y
To enable Dynamic Multi-Pathing (DMP), MPxIO must be disabled. Refer to the Storage Foundation Release Notes for further details on disabling MPxIO.
检查vradmin deamon:
root@lxsfrac02 # ps -ef|grep vrad|grep -v grep
root 9808 1 0 16:24:47 ? 0:00 /usr/sbin/vradmind
安装Veritas File System:安装过程略
root@lxsfrac02 # cd file_system/
root@lxsfrac02 # ls -l
total 22
-rw-r--r-- 1 root root 476 Dec 15 2006 copyright
drwxrwxr-x 2 root root 512 Jun 21 10:12 docs
-rwxr-xr-x 1 root root 2283 Apr 14 2007 installfs
drwxrwxr-x 3 root root 1024 Jun 21 10:12 pkgs
drwxrwxr-x 2 root root 512 Jun 21 10:12 release_notes
drwxrwxr-x 3 root root 512 Jun 21 10:12 scripts
-rwxr-xr-x 1 root root 2283 Apr 14 2007 uninstallfs
root@lxsfrac02 # ./installfs lxsfrac02
Veritas Volume Replicator VVR的配置
1. 两个节点上都需要做:
修改两个节点的/etc/hosts
10.198.90.122 lxsfrac01
10.198.90.139 lxsfrac02
192.168.0.122 lxsfrac01-priv
192.168.0.139 lxsfrac02-priv
分别创建私有(专有),建议数据复制使用专用网络。
root@lxsfrac01 # ifconfig e1000g1 plumb 192.168.0.122 netmask 255.255.255.0 up
root@lxsfrac02 # ifconfig e1000g1 plumb 192.168.0.139 netmask 255.255.255.0 up
root@lxsfrac01 # ping 192.168.0.139
192.168.0.139 is alive
创建相同名称的磁盘组(含有最少两个磁盘),相同名称数据卷oravol,创建复制日志卷(SRL),
分别在本地安装Oracle 10gR2.(安装Oracle过程略。)
root@lxsfrac01 # vxdg init oradg AMS_WMS0_2 AMS_WMS0_3
root@lxsfrac01 # vxassist -g oradg make oravol 10g
root@lxsfrac01 # vxedit -g oradg set user=oracle group=dba mode=644 oravol
root@lxsfrac01 # vxassist -g oradg make srl 800m
2.在备用节点上修改配置文件/etc/vx/vras/.rdg,让其包含主节点上的disk group ID
(这里是1193985774.38.lxsfrac01)。当创建备用RVG时,这个文件用来对主节点的授权。
可以通过vxprint –l来得到disk group ID
root@lxsfrac02 # vi /etc/vx/vras/.rdg
………
1193985774.38.lxsfrac01
"/etc/vx/vras/.rdg" 43 lines, 1544 characters
3.在主节点上:
创建vxfs文件系统
mount -F vxfs -o largefiles /dev/vx/dsk/oradg/oravol /oracle
chown oracle:dba /oracle
切换到oracle用户使用dbca建库,并且所有数据文件选择/oracle目录
创建Primary RVG:
root@lxsfrac01 # vradmin -g oradg createpri ora_rvg oravol srl
其中的oravol是要复制的数据卷列表,当多于一个时,用逗号隔开。
创建Secondary RVG:
root@lxsfrac01 # vradmin -g oradg addsec ora_rvg lxsfrac01-priv lxsfrac02-priv
设置复制方式为异步:
root@lxsfrac01 # vradmin -g oradg set ora_rvg lxsfrac02-priv synchronous=off
开始复制:
root@lxsfrac01 # vradmin -g oradg -a startrep ora_rvg
Message from Primary:
VxVM VVR vxrlink WARNING V-5-1-3359 Attaching rlink to non-empty rvg. Autosync will be performed.
VxVM VVR vxrlink INFO V-5-1-3614 Secondary data volumes detected with rvg ora_rvg as parent:
VxVM VVR vxrlink INFO V-5-1-6183 oravol: len=20971520 primary_datavol=oravol
VxVM VVR vxrlink INFO V-5-1-3365 Autosync operation has started
root@lxsfrac01 #
root@lxsfrac01 # vradmin -g oradg -f startrep ora_rvg
VxVM VVR vradmin INFO V-5-52-1203 Replication to Secondary host lxsfrac02-priv already started.
检查相关信息和状态,显示数据复制过程,可以通过使用-i参数指定interval
root@lxsfrac01 # vxrvg -g oradg getrlinks ora_rvg
rlk_lxsfrac02-priv_ora_rvg
root@lxsfrac01 # vxrlink -g oradg status rlk_lxsfrac02-priv_ora_rvg
Fri Nov 02 17:01:22 2007
VxVM VVR vxrlink INFO V-5-1-4464 Rlink rlk_lxsfrac02-priv_ora_rvg is in AUTOSYNC. 9888256 Kbytes remaining.
root@lxsfrac01 # vxrlink -g oradg status rlk_lxsfrac02-priv_ora_rvg
Fri Nov 02 17:02:08 2007
VxVM VVR vxrlink INFO V-5-1-4464 Rlink rlk_lxsfrac02-priv_ora_rvg is in AUTOSYNC. 9375488 Kbytes remaining.
root@lxsfrac01 # vxrlink -g oradg status rlk_lxsfrac02-priv_ora_rvg
Fri Nov 02 17:13:26 2007
VxVM VVR vxrlink INFO V-5-1-4464 Rlink rlk_lxsfrac02-priv_ora_rvg is in AUTOSYNC. 1901824 Kbytes remaining.
root@lxsfrac01 # vxrlink -g oradg status rlk_lxsfrac02-priv_ora_rvg
Fri Nov 02 17:19:16 2007
VxVM VVR vxrlink INFO V-5-1-4467 Rlink rlk_lxsfrac02-priv_ora_rvg is up to date
可以手工进行gracefully切换
root@lxsfrac01 # umount /oracle
root@lxsfrac01 # vradmin -g oradg migrate ora_rvg lxsfrac02-priv
VxVM VVR vradmin WARNING V-5-52-93 Make sure applications using Primary data volumes are stopped.
vradmin: Continue with migrate (y/n)? y
root@lxsfrac01 #
下面我们就在上面搭建好的VVR环境中对容灾数据进行切换测试:
注:在下面测试中,主节点为lxsfrac02,备用节点为lxsfrac01
====================================== 显示主备节点状态 =================================
root@lxsfrac02 # vradmin -g oradg -l repstatus ora_rvg
Replicated Data Set: ora_rvg
Primary:
Host name: lxsfrac02-priv
RVG name: ora_rvg
DG name: oradg
RVG state: enabled for I/O
Data volumes: 1
VSets: 0
SRL name: srl
SRL size: 800.00 M
Total secondaries: 1
Secondary:
Host name: lxsfrac01-priv
RVG name: ora_rvg
DG name: oradg
Rlink from Primary: rlk_lxsfrac01-priv_ora_rvg
Rlink to Primary: rlk_lxsfrac02-priv_ora_rvg
Configured mode: asynchronous
Latency protection: off
SRL protection: autodcm
Data status: inconsistent
Replication status: resync in progress (autosync)
Current mode: asynchronous
Logging to: DCM (contains 5181696 Kbytes) (autosync)
Timestamp Information: N/A
Bandwidth Limit: N/A
==================================== 显示replication link状态 =================================
root@lxsfrac02 # vxrlink -g oradg status rlk_lxsfrac01-priv_ora_rvg
Mon Nov 05 16:52:51 2007
VxVM VVR vxrlink INFO V-5-1-4467 Rlink rlk_lxsfrac01-priv_ora_rvg is up to date
==================================== 在主节点插入试验数据 16:55 ================================
oracle@lxsfrac02 $ sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Nov 5 16:55:12 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> create table test (a varchar(20) ) tablespace users ;
Table created.
SQL> insert into test values ('1') ;
1 row created.
SQL> commit ;
Commit complete.
SQL> insert into test values ('2' ) ;
1 row created.
SQL>
SQL>
SQL> commit ;
Commit complete.
====================================== 立即异常关闭oracle 和 ============================
root@lxsfrac02 # ps -ef|egrep "ora_|asm_"|grep -v grep |grep -v crs|awk '{print $2}' |xargs kill -9
root@lxsfrac02 #
root@lxsfrac02 # ps -ef|grep ora
root 1930 1 0 16:08:13 ? 0:02 /opt/VRTSobc/pal33/bin/vxpal -a StorageAgent -x
oracle 19420 19419 0 16:55:12 ? 0:00 oracleracg1 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 19414 19410 0 16:55:11 pts/3 0:00 -bash
oracle 19419 19414 0 16:55:12 pts/3 0:00 sqlplus /as sysdba
root 19872 3725 0 16:56:49 pts/2 0:00 grep ora
root@lxsfrac02 #
root@lxsfrac02 # poweroff
从系统日志/var/tmp/messages可以查看到相关信息:
Nov 5 16:57:26 lxsfrac02 poweroff: [ID 662345 auth.crit] poweroffed by root
======================================= 在备用节点进行接管 =======================================
root@lxsfrac01 # vradmin -g oradg migrate ora_rvg lxsfrac01-priv
VxVM VVR vradmin WARNING V-5-52-93 Make sure applications using Primary data volumes are stopped.
vradmin: Continue with migrate (y/n)? y
Message from Host lxsfrac01-priv:
VxVM VVR vradmin ERROR V-5-52-449 Secondary ora_rvg does not have an active Primary.
root@lxsfrac01 #
root@lxsfrac01 # vradmin -g oradg takeover ora_rvg
root@lxsfrac01 # date
Mon Nov 5 17:05:13 CST 2007
root@lxsfrac01 # vxprint -htqg oradg
dg oradg default default 10000 1193985774.38.lxsfrac01
dm AMS_WMS0_2 AMS_WMS0_2 auto 65536 4116224 -
dm AMS_WMS0_3 AMS_WMS0_3 auto 65536 146687968 -
rv ora_rvg 1 ENABLED ACTIVE primary 1 srl
rl rlk_lxsfrac02-priv_ora_rvg ora_rvg ENABLED ACTIVE lxsfrac02-priv oradg rlk_lxsfrac01-priv_ora_rvg
v oravol ora_rvg ENABLED ACTIVE 20971520 SELECT - fsgen
pl oravol-01 oravol ENABLED ACTIVE 20971520 CONCAT - RW
sd AMS_WMS0_3-01 oravol-01 AMS_WMS0_3 0 20971520 0 AMS_WMS0_3 ENA
pl oravol-02 oravol ENABLED ACTIVE LOGONLY CONCAT - RW
sd AMS_WMS0_2-01 oravol-02 AMS_WMS0_2 0 352 LOG AMS_WMS0_2 ENA
pl oravol-03 oravol ENABLED ACTIVE LOGONLY CONCAT - RW
sd AMS_WMS0_3-03 oravol-03 AMS_WMS0_3 22609920 352 LOG AMS_WMS0_3 ENA
v srl ora_rvg ENABLED ACTIVE 1638400 SELECT - SRL
pl srl-01 srl ENABLED ACTIVE 1638400 CONCAT - RW
sd AMS_WMS0_3-02 srl-01 AMS_WMS0_3 20971520 1638400 0 AMS_WMS0_3 ENA
root@lxsfrac01 #
================================ 启动备用节点Oracle数据库,并检查数据完整 ========================
root@lxsfrac01 # mount -F vxfs /dev/vx/dsk/oradg/oravol /oracle
root@lxsfrac01 #
root@lxsfrac01 # su - oracle
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
oracle@lxsfrac01 $ sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Nov 5 17:05:37 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 2147483648 bytes
Fixed Size 2120448 bytes
Variable Size 496870656 bytes
Database Buffers 1644167168 bytes
Redo Buffers 4325376 bytes
Database mounted.
Database opened.
SQL> select * from test ;
A
--------------------
1
2
================================ 显示数据正常 ===========================
SQL> !date
Mon Nov 5 17:06:58 CST 2007
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
附:创建配置VVR过程中部分错误诊断
1.错误V-5-1-3370,备份异常中断,复制不能继续
root@lxsfrac01 # vxrlink -g oradg recover rlk_lxsfrac02-priv_ora_rvg
VxVM VVR vxrlink ERROR V-5-1-3370 Can not recover rlk_lxsfrac02-priv_ora_rvg until ora_rvg is recovered
root@lxsfrac01 # vxrecover -g oradg -s
root@lxsfrac01 # vxprint
………………显示正常
2.错误V-5-52-449,需要检查主、备节点磁盘组状态为import,并且volume/rlink/srl状态为enabled和active
root@lxsfrac01 # vradmin -g oradg -a startrep ora_rvg
Message from Host lxsfrac01-priv:
VxVM VVR vradmin ERROR V-5-52-449 Secondary ora_rvg does not have an active Primary.
在第二个节点vxdg import oradg
然后recover
直到两个节点vxprint -htqg oradg都正常:ENABLED/ACTIVE
3.错误V-5-1-434,我遇到了两次,一次是在createpri,一次在addsec,原因是主备的DCM默认都需要mirror,所以所在的磁盘组都最少包括两块磁盘(或LUN),通过vxdg -g oradg adddisk another_disk解决。
root@lxsfrac01 # vradmin -g oradg createpri ora_rvg \
> system,sysaux,temp,users,example,ctlfile1,ctlfile2,ctlfile3,redo101,redo102,redo103,undo11,spfile \
> srl
Message from Primary:
VxVM vxassist ERROR V-5-1-434 Cannot allocate space for 32 block log
root@lxsfrac01 # vradmin -g oradg addsec ora_rvg lxsfrac01-priv lxsfrac02-priv
Message from Host lxsfrac02-priv:
VxVM vxassist ERROR V-5-1-434 Cannot allocate space for 352 block log
4.检查vvr后台进程
root@lxsfrac02 # ps -ef|grep vrad|grep -v grep
root 9808 1 0 16:24:47 ? 0:00 /usr/sbin/vradmind
如果进程状态不对,使用下面语句来手工启动:
/etc/init.d/vras-vradmind.sh start
可以看到vradmin是随系统自启动的:
root@lxsfrac02 # find /etc/rc* -name '*vr*' -print
/etc/rc0.d/K01vras-vradmind
/etc/rc1.d/K01vras-vradmind
/etc/rc2.d/S96vradmind
/etc/rcS.d/K01vras-vradmind
阅读(1848) | 评论(0) | 转发(0) |