天天看点

NETAPP FlexClone FlexClone volumes 初体验

前情提要:

        某数据中心需要将一个单oracle实例每天产生的新增数据往同台机器的另外一个实例(用作DW的数据源)做大量的数据传输,但是通过dblink的方式发现速度远远满足不了第二天第二个实例正常访问的需要,且由于开启高并行插入之后,占用系统资源太大,故咨询netapp 存储厂商后(系统基于netapp存储的,这理所当然对否?),厂商提出了一个通过存储本身自带的FlexClone Volumes功能来瞬间完成库数据文件的复制的方案(当然此段时间生产库要停20秒--算上停止和启动时间)。

故事人物介绍之 FlexClone volumes :

       FlexClone volumes是基于lun 复制的方式直接在存储级别将你需要的lun及里面所有的文件复制成另外一份新的lun,体验速度也非常给力,1-3秒左右。

NETAPP FlexClone FlexClone volumes 初体验

      对本剧主人公有兴趣的童鞋,可以参考如下文章:https://communities.netapp.com/docs/DOC-10323。

故事发展线索之 图形界面clone:

NETAPP FlexClone FlexClone volumes 初体验

故事发展线索之命令行clone:

vol clone create clone_name [-s {volume|file|none}] -b parent_name [parent_snap] 
           

clone_name     is the name of the FlexClone volume that you want to create. -s {volume | file | none}

specifies the space guarantee setting for the new FlexClone volume. If no value is specified, the FlexClone volume is given the same space guarantee setting as its parent. 

 parent_name  is the name of the FlexVol volume that you intend to clone. 

 parent_snap   is the name of the base Snapshot copy of the parent FlexVol volume. 

If no name is specified, Data ONTAP creates a base Snapshot copy with the nameclone_cl_name_prefix.id,

where cl_name_prefix is the up to 16 characters of the name of the new FlexClone volume andid is a unique digit identifier (for example 1,2, and so on).

Note: The base Snapshot copy cannot be deleted as long as any clones based on that Snapshot copy exist. 

 The FlexClone volume is created and, if NFS is in use, an entry is added to the /etc/exports file for every entry found for the parent volume. 

 The base Snapshot copy becomes a shared Snapshot copy between the FlexClone volume and its parent.  

Example :

--To create a FlexClone volume named newclone from the parent FlexVol volume flexvol1, you would enter the following command:

vol clone create newclone -b flexvol1 
           

Note: The Snapshot copy created by Data ONTAP is named clone_newclone.1. 

场景1:克隆前数据库配置

1.   创建新的.ora文件,将克隆库的路径等信息加入.(db_name不能修改)

2.   建立对应的日志.跟踪等文件的路径

3.   获取源库的控制文件,生成trace文件,根据trace文件生成用于创建控制文件的sql脚本,生成的脚本存储在服务器端

4.   orapwd密码文件建立

5.   配置监听文件,修改service_name(可选)

场景2:克隆步骤:

1.   在业务空闲阶段,将u01上业务数据库执行关闭

2.   克隆u01数据库(详情请咨询NetApp 厂商)

a)    通过存储端的FlexClone功能对u01业务数据库的LUN进行克隆(卷克隆名Clone2),不执行克隆分离动作.

b)    将u02 umount

c)    在存储端对u02的LUN(克隆名Clone1)执行Offline,并将其删除

d)    重命名新创建的Clone2卷为Clone1

e)    将新生成的克隆LUNonline(LUN ID与原克隆LUN保持一致),mount新克隆LUN至u02

3.   Oracle 参数修改

a)    Export ORACLE_SID=POCCLONE

b)    通过预置在服务器端的sql脚本在u02端生成新的control文件

c)    Recovery database

d)    Alter system set db_unique_name=POCClonescope=spfile

e)    Alter database open(打开u02的克隆数据库)

4.   打开u01生产数据库

拍摄花絮:clone 数据库的方法其实很多,其中一种通过RMAN 的replicate方法见我的另一篇文章:http://space.itpub.net/22907091/viewspace-691959