• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3538
  • Last Modified:

EMC CX700 snapview automation script


We have EMC CX700. Two LUNs from this storage are assigned to RedHat Linux AS4 server. We are using these two LUNs for Oracle 10g database. This is transactional database, constantly changing, once a transaction is complete it is deleted from this database.

As a backup solution for this database we are planning to setup to create snapshot on these two LUNs every one hour and keep upto 6 snapshots.

I am looking for script to create a snapshot from the host and delete old one. Also I believe it is possible to create this snapshot in consistency mode as these LUNs are used for database, we need snapshot of these two LUNs in consistency mode.

Or if you can provide any other method to automate this process that will be helpful.

Flarecode is version 19.x

We are using Brocade switch in this SAN configuration. All ports are open, we did not configure zoning on these switch.

  • 3
2 Solutions
Duncan MeyersCommented:
>We are using Brocade switch in this SAN configuration. All ports are open, we did not configure zoning on these switch.
You need to fix that. You are running an unsupported configuration and you will be expected to zone the switches by EMC support if you have host connectivity issues - and you *will* have connectivity issues. Note that EMC supports only soft zoning - that is; WWN based zoning.

I'd strongly recommend EMC Replication Manager - it automates all this. You can do it by scripting, but RM is the better way to go.
Duncan MeyersCommented:
Having said that, here's the basics of what you need to do:

Download and read the SnapView Admin guide from http://powerlink.emc.com
Download and read the SnapView CLI Reference guide from http://powerlink.emc.com

Create some snapshot cache LUNs and assign them to the snapshot cache pool. You'll need one cache LUN per snapshot that you want to create, and as a rule-of-thumb, you'll need around 10% of the space of the LUN you'll snapshot. Since you're planning on 6 snapshots, you'll need at least 12 LUNs (6 per SP).

For the script:

Test for the existence of the snapshot (easiest is to grep the output of mount)

If the snapshot exists, unmount it, then stop and deactivate it:

/usr/admsnap/admsnap deactivate -s snapshot-name
/opt/Navisphere/bin/navicli -h x.x.x.x snapview -stopsession snapshot-name -o

If you don't do this, your snapshot will contain stale data.

Start a SnapView session on the LUNs in Navisphere:

/opt/Navisphere/bin/navicli -h snapview -startsession snapshot-name -lun <lun number> -persistence
/usr/admsnap/admsnap activate -s snapshot-name
/mount /dev/emcpowerf1 /mnt/mount-point

Repeat as necessary.

Note that you MUST NOT mount a snapshot on the server that owns the source LUN.
shreeram44Author Commented:
Right now we are using snap shots by manually creating them from the Navisphere manager. What I am looking for is automation of this process. let me try commands you provided.


Duncan MeyersCommented:
I pulled those commands from a Linux script I wrote a while back. They'll need customization for your environment - I strongly recommend that you download and review the manuals listed above.

If you want to automate the process completely, use Replication Manager - there's a flavour of RM specifically for management of Oracle and snapshots and clones.
Expanding just a bit on meyersd's comment...

Prior to activating the snapshot be sure you have quiesed the database and flushed the server's I/O buffers to disk.  I can't address the database commands but flushing the disk cache can be accomplished by using "sync" or "admsnap flush".

The navicli startsession and stopsession commands are usually issued from the database server but could be done from any server with IP connectivity to the CLARiiON.  The buffer flush command (either version) must be run from the database server.

Once the startsession command has been issued you will have a valid point-in-time snapshot.  The mount, admsnap activate and admsnap deactivate commands are only useful if you intend to give a different server access to the snapshot such as a tape backup server.  The tape backup server would issue the mount, admsnap activate, admsnap deactivate commands and, potentially, the navicli stopsession command.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now