Originally posted by: jdsdavis
Fosteria,
I saw your post on unix.com too, which had more details.
Basically, if you freeze your filesystems, you shouldn't have filesystem issues. I'm pasting in text for both JFS2 and DS4k snapshotting. I haven't tested for syntax errors, and some of the commands are adapted from yours.
[b]Example 1: AIX JFS2 snapshotting
################################[/b]
code ### Prepare for snapshotting
mkdir /snapshots
mkdir /snapshots/u01
mkdir /snapshots/u02
mkdir /snapshots/u03
mkdir /snapshots/u04
mklv -y snapu01 datavg 4
mklv -y snapu02 datavg 4
mklv -y snapu03 datavg 4
mklv -y snapu04 datavg 4
### quiesce oracle
echo "alter system set resource_manager_plan='SYSPLAN' scope=both;
connect / as sysdba
alter system quiesce restricted;
select active_state from v$instance;" | sqlplus
### Quiesce the filesystems
sync;sync;sync;sleep 5
chfs -a freeze=30 /u01
chfs -a freeze=29 /u02
chfs -a freeze=28 /u03
chfs -a freeze=27 /u04
### Snapshot the filesystems
snapshot -o snapfrom=/u01 /dev/snapu01
snapshot -o snapfrom=/u02 /dev/snapu02
snapshot -o snapfrom=/u03 /dev/snapu03
snapshot -o snapfrom=/u04 /dev/snapu04
### Resume I/O
chfs -a freeze=0 /u01
chfs -a freeze=0 /u02
chfs -a freeze=0 /u03
chfs -a freeze=0 /u04
echo "connect / as sysdba
alter system unquiesce;
select active_state from v$instance;" | sqlplus
### Mount the snapshots
mount -v jfs2 -o snapshot /dev/snapu01 /snapshots/u01
mount -v jfs2 -o snapshot /dev/snapu02 /snapshots/u02
mount -v jfs2 -o snapshot /dev/snapu03 /snapshots/u03
mount -v jfs2 -o snapshot /dev/snapu04 /snapshots/u04
### Back up the snapshots
dsmc s /snapshots/
### Release the snapshots
umount /snapshots/u01
umount /snapshots/u02
umount /snapshots/u03
umount /snapshots/u04
snapshot -d /dev/snapu01
snapshot -d /dev/snapu02
snapshot -d /dev/snapu03
snapshot -d /dev/snapu04
rmdir /snapshots/*
rmdir /snapshots
[/code]
[b]Example 2: DS4000 flash copy
############################[/b]
code ### NOTE: Much of this could be SSHed over from the TSM server
### Preparation
mkdir /snapshots
mkdir /snapshots/u01
mkdir /snapshots/u02
mkdir /snapshots/u03
mkdir /snapshots/u04
### quiesce oracle
echo "alter system set resource_manager_plan='SYSPLAN' scope=both;
connect / as sysdba
alter system quiesce restricted;
select active_state from v$instance;" | sqlplus
### Quiesce the filesystems
sync;sync;sync;sleep 5
chfs -a freeze=30 /u01
chfs -a freeze=29 /u02
chfs -a freeze=28 /u03
chfs -a freeze=27 /u04
### Snapshot the filesystems
SMcli -n "DS4700" -c 'recreateFlashcopy logicalDrive ;'
### Resume I/O
chfs -a freeze=0 /u01
chfs -a freeze=0 /u02
chfs -a freeze=0 /u03
chfs -a freeze=0 /u04
echo "connect / as sysdba
alter system unquiesce;
select active_state from v$instance;" | sqlplus
### Mount the snapshots
### NOTE: This portion could be done on the TSM server if zoned.
### The benefit would be no processing overhead on DBPROD.
SMcli -n "DS4700" -c 'create mapping logicalDrive="DBPROD_1"
logicalUnitNumber=30 host="DBPROD";'
hot_add
recreatevg -y fcdatavg hdisk2
mount -v jfs2 -oro /dev/??? /snapshots/u01
mount -v jfs2 -oro /dev/??? /snapshots/u02
mount -v jfs2 -oro /dev/??? /snapshots/u03
mount -v jfs2 -oro /dev/??? /snapshots/u04
### Back up the snapshots
dsmc s /snapshots/
### Release the snapshots
umount /snapshots/u01
umount /snapshots/u02
umount /snapshots/u03
umount /snapshots/u04
varyoffvg fcdatavg
export fcdatavg
rmdev -l hdisk2
Smcli -n "DS4700" -c 'delete mapping logicalDrive="DBPROD_1"
host ="DBPROD";'
SMcli -n "DS4700" -c 'disableFlashCopy logicalDrive
;'
rmdir /snapshots/*
rmdir /snapshots
[/code]