FW: NSR + Oracle = oil + water

From: Dwight Walker <Dwight_Walker_at_pacstar.com.au>
Date: Wed, 20 Aug 1997 10:07:18 +1000

----------
From: Dwight Walker
Sent: Wednesday, 20 August 1997 9:44
To: alpha-osf-managers_at_ornl.gov; 'WOODT_at_ORAU.GOV'
Subject: RE: NSR + Oracle = oil + water

Sounds like you have the same problem as everyone else - to much to do
in a night, not enough time, and can never get a consistent set of
parameters.

What I do is turn off the internal scheduler via the groups window,
 write a script that does:

        Do all the exports, and whatever else needs to be done
        Shut down the databases
        CLONE the filesystems ( takes about 5 minutes )
        Restart the databases
        Then backup the cloned filesystems.
        Unclone the filesystems
        System cleanups / disk defrags etc.

This works reallly well and as long as your filesystems are under 95%
full and there are less than 40,000 extents in a file domain ( use the
advfs command defragment for this ). It is really important this is
done else the clones will fail or be corrupt!!!

I also strongly suggest that you get the Networker 4.2B and associated
patches. 4.2A had several nasties, and 4.2B unpatches would drop save
sets after a month or 2 regardless of your browse and retention
policies.

Here is an example of the clone / unclone scripts I use, the rest
you can write easily I'm sure. Let me know if you want the my full
script to work from. It is varily big as I have a whole bunch of
stuff in there as well as defrags etc.

Oh, if you've got the bucks there is an add on you can get ( from
oracle I think ) that supposedly makes life easy as it integrates NSR
straight into Oracle. It really helps with hot backups archive log
backups etc. I believe. I've never been able to convince the cheque
signers that its worth the bucks, so I've never used it.

Good Luck

Dwight Walker

#!/bin/sh

#
# _at_(#)clone 1.2
#
# clone [ directory ]
#
# Clone all the mounted advfs type file-systems and mount them on
/clone
#

clonedir=/clone
clone=_clone
advfs=advfs

PATH=/sbin:/usr/sbin:/usr/bin export PATH

umask 022

myname=`basename "$0"`

case $# in
0)
        ;;

1)
        clonedir="$1"
        ;;

*)
        echo "usage: $myname [ directory ]" 1>&2
        exit 1
        ;;
esac

#
# Search for all mounted advfs file-systems
#
mount | while read fs on dir as type opts
do
        #
        # Ignore non advfs file-systems
        #
        case "$type" in
        "$advfs")
                ;;

        *)
                continue
                ;;
        esac

        #
        # Split file-system into domain and fileset
        #
        case "$fs" in
        *#*"$clone")
                # Ignore existing clones
                continue
                ;;

        *#*)
                ;;

        *)
                echo "$myname: Unknown file-system specification \"$fs\"." 1>&2
                e=1
                continue
                ;;
        esac

        dom=`expr "$fs" : '\(.*\)#.*'`
        fset=`expr "$fs" : '.*#\(.*\)'`

        #
        # If the clonefset fails we'll pick up the problem on the mount
        #
        clonefset "$dom" "$fset" "$fset$clone" 2> /dev/null

        #
        # Create the directory to mount it on
        #
        mountdir="$clonedir/$dom/$fset"

        if [ ! -d "$mountdir" ]
        then
                if mkdir -p "$mountdir"
                then
                        :
                else
                        e=1
                        continue
                fi
        fi

        #
        # Mount it
        #
        if mount -t "$advfs" -o ro "$dom#$fset$clone" "$mountdir"
        then
                continue
        fi
done

exit $e

#!/bin/sh

#
# _at_(#)unclone 1.2
#
# unclone [ directory ]
#
# Unmount and remove all the cloned advfs type file-systems from
/clone
#

clonedir=/clone
advfs=advfs

PATH=/sbin:/usr/sbin:/usr/bin export PATH

umask 022

myname=`basename "$0"`

case $# in
0)
        ;;

1)
        clonedir="$1"
        ;;

*)
        echo "usage: $myname [ directory ]" 1>&2
        exit 1
        ;;
esac

#
# Search for all mounted advfs file-systems
#
mount | while read fs on dir as type opts
do
        #
        # Ignore non advfs file-systems
        #
        case "$type" in
        "$advfs")
                ;;

        *)
                continue
                ;;
        esac

        #
        # Ignore stuff not mounted in $clonedir
        #
        case "$dir" in
        "$clonedir"/*)
                ;;

        *)
                continue
                ;;
        esac

        #
        # Split file-system into domain and fileset
        #
        case "$fs" in
        *#*"$clone")
                ;;

        *#*)
                # Ignore non clones
                continue
                ;;

        *)
                echo "$myname: Unknown file-system specification \"$fs\"." 1>&2
                e=1
                continue
                ;;
        esac

        dom=`expr "$fs" : '\(.*\)#.*'`
        fset=`expr "$fs" : '.*#\(.*\)'`

        #
        # Delete it
        #
        if umount "$dir" && rmfset "$dom" "$fset" && rmdir "$dir"
        then
                #
                # Ignore failure when $clonedir/$dom is non empty
                #
                rmdir "$clonedir/$dom" 2> /dev/null
                continue
        fi

        e=1
done

if rmdir "$clonedir"
then
        :
else
        e=1
fi

exit $e




----------
From: WOODT_at_ORAU.GOV[SMTP:WOODT_at_ORAU.GOV]
Sent: Wednesday, 20 August 1997 4:19
To: alpha-osf-managers_at_ornl.gov
Subject: NSR + Oracle = oil + water

Greetings!

I've got an AS4000 5/300 running DU 4.0B, AdvFS file systems, and
Networker 4.2A
(SingleServer - bundled version). What I need is the ability to
sequence a
Networker backup with other commands, such as shutting down and
exporting an
Oracle database, backing up the system, and cleaning up Oracle log
files and
other database droppings before restarting the database. I can't use
Networker's
internal scheduler, as it is time-based, and each step of the process
before the
backup takes place takes a widely varying amount of time, dependent
upon the
database activity of any given day. The whole process takes just
about as much
time as we can have the database down and still provide the users what
they need
in terms of uptime. Hot database backups are not a good option for
us. While
what I need could be accomplished easily with vdump/vrestore and a
script, I like
the backup logs that Networker maintains as well as the GUI for
managing the
various pieces.

My questions are (1) is this possible by scripting some form of the
"save" command
in the Networker suite?; (2) how do I disable the Networker's internal
scheduler
so that I can control the backup from cron instead?; (3) can I fire
off my pre-
and post-backup needs from within Networker itself?

TIA!

Tom Wood
Oak Ridge Associated Universities
Oak Ridge, TN
woodt_at_orau.gov




Received on Wed Aug 20 1997 - 02:16:32 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:36 NZDT