NBU+Oracle+AIX安装配置手册- 副本 下载本文

二、NBU 7.0 AIX客户端脚本配置

1、 先创建相关目录和文件 [root@p550b:/]#cd /usr/openv

[root@p550b:/usr/openv]#mkdir controlfile [root@p550b:/usr/openv]#mkdir orascripts [root@p550b:/usr/openv]#cd controlfile

[root@p550b:/usr/openv/controlfile]#touch control.ora [root@p550b:/usr/openv/controlfile]#cd .. [root@p550b:/usr/openv]#cd orascripts

[root@p550b:/usr/openv/orascripts]#touch aix_ora_full.sh

2、 相关目录和文件赋予属主和权限 [root@p550b:/usr/openv/orascripts]#cd .. [root@p550b:/usr/openv]#ls -l total 72

drwxr-xr-x 2 root system 256 Feb 25 16:03 controlfile drwxr-xr-x 5 root bin 4096 Feb 25 15:40 java drwxr-xr-x 7 root bin 8192 Feb 25 15:37 lib drwxr-xr-x 5 root system 256 Feb 25 15:40 logs drwxr-xr-x 2 root bin 256 Jan 05 2010 msg

drwxr-xr-x 8 root bin 4096 Feb 25 15:40 netbackup drwxr-xr-x 2 root system 256 Feb 25 16:04 orascripts

-r--r--r-- 1 root bin 5435 Feb 25 regid.1992-11.com.symantec,Enterprise_netbackup-7.0.0.0_1.swidtag drwxr-xr-x 2 root bin 4096 Jan 05 2010 resources drwxr-xr-x 2 root bin 256 Jan 05 2010 share -r--r--r-- 1 root bin 5435 Jan 05 2010 swidtag.xml drwxr-xr-x 2 root bin 256 Feb 25 15:43 tmp drwxr-xr-x 5 root bin 256 Feb 25 15:37 var [root@p550b:/usr/openv]#chown -R oracle:dba controlfile [root@p550b:/usr/openv]#chmod -R 777 controlfile

[root@p550b:/usr/openv]#chown -R oracle:dba orascripts [root@p550b:/usr/openv]#chmod -R 777 orascripts [root@p550b:/usr/openv]#ls -l total 72

drwxrwxrwx 2 oracle dba 256 Feb 25 16:03 controlfile drwxr-xr-x 5 root bin 4096 Feb 25 15:40 java drwxr-xr-x 7 root bin 8192 Feb 25 15:37 lib drwxr-xr-x 5 root system 256 Feb 25 15:40 logs drwxr-xr-x 2 root bin 256 Jan 05 2010 msg

drwxr-xr-x 8 root bin 4096 Feb 25 15:40 netbackup drwxrwxrwx 2 oracle dba 256 Feb 25 16:04 orascripts

15:40 -r--r--r-- 1 root bin 5435 Feb 25 15:40 regid.1992-11.com.symantec,Enterprise_netbackup-7.0.0.0_1.swidtag drwxr-xr-x 2 root bin 4096 Jan 05 2010 resources drwxr-xr-x 2 root bin 256 Jan 05 2010 share -r--r--r-- 1 root bin 5435 Jan 05 2010 swidtag.xml drwxr-xr-x 2 root bin 256 Feb 25 15:43 tmp drwxr-xr-x 5 root bin 256 Feb 25 15:37 var

3、 编辑NBU备份数据库的Rman脚本aix_ora_full.sh [root@p550b:/usr/openv/orascripts]#vi aix_ora_full.sh

粘贴如下内容(完全备份oracle数据库和归档日志,并删除备份好的归档日志,注意修改实例名oracle_sid和oracle_home和实际环境一致)

================================================================= #!/bin/sh

# $Header: hot_database_backup.sh,v 1.9 2002/02/06 16:48:56 lstrub Stab $ #

#bcpyrght

#***************************************************************************

#* $VRTScprght: Copyright 1993 - 2002 VERITAS Software Corporation, All Rights Reserved $ *

#*************************************************************************** #ecpyrght #

# --------------------------------------------------------------------------- # hot_database_backup.sh # ---------------------------------------------------------------------------

# This script uses Recovery Manager to take a hot (inconsistent) database # backup. A hot backup is inconsistent because portions of the database are # being modified and written to the disk while the backup is progressing.

# You must run your database in ARCHIVELOG mode to make hot backups. It is # assumed that this script will be executed by user root. In order for RMAN # to work properly we switch user (su -) to the oracle dba account before # execution. If this script runs under a user account that has Oracle dba # privilege, it will be executed using this user's account. # ---------------------------------------------------------------------------

# --------------------------------------------------------------------------- # Determine the user which is executing this script.

# ---------------------------------------------------------------------------

CUSER=`id |cut -d\

# --------------------------------------------------------------------------- # Put output in .out. Change as desired. # Note: output directory requires write permission.

# ---------------------------------------------------------------------------

RMAN_LOG_FILE=${0}.`date +%Y%m%d%H%M%S`.out

# ---------------------------------------------------------------------------

# You may want to delete the output file so that backup information does # not accumulate. If not, delete the following lines.

# ---------------------------------------------------------------------------

if [ -f \then

rm -f \fi

# ----------------------------------------------------------------- # Initialize the log file.

# -----------------------------------------------------------------

echo >> $RMAN_LOG_FILE chmod 666 $RMAN_LOG_FILE

# --------------------------------------------------------------------------- # Log the start of this script.

# ---------------------------------------------------------------------------

echo Script $0 >> $RMAN_LOG_FILE

echo ==== started on `date` ==== >> $RMAN_LOG_FILE echo >> $RMAN_LOG_FILE

# ---------------------------------------------------------------------------

# Replace /db/oracle/product/ora81, below, with the Oracle home path. # ---------------------------------------------------------------------------

ORACLE_HOME=/oracle/product/10.2.0 export ORACLE_HOME

# ---------------------------------------------------------------------------

# Replace ora81, below, with the Oracle SID of the target database.

# ---------------------------------------------------------------------------

ORACLE_SID=orclyw export ORACLE_SID

# --------------------------------------------------------------------------- # Replace ora81, below, with the Oracle DBA user id (account). # ---------------------------------------------------------------------------

ORACLE_USER=oracle

# --------------------------------------------------------------------------- # Set the target connect string.

# Replace \# ---------------------------------------------------------------------------

TARGET_CONNECT_STR= /

# --------------------------------------------------------------------------- # Set the Oracle Recovery Manager name.

# ---------------------------------------------------------------------------

RMAN=$ORACLE_HOME/bin/rman

# --------------------------------------------------------------------------- # Print out the value of the variables set by this script. # ---------------------------------------------------------------------------

echo >> $RMAN_LOG_FILE

echo \

echo \echo \echo \

# --------------------------------------------------------------------------- # Print out the value of the variables set by bphdb.

# ---------------------------------------------------------------------------

echo >> $RMAN_LOG_FILE

echo \echo \echo \echo \echo \