设为首页 加入收藏

TOP

OraclePolicyForNBU(一)
2015-07-24 09:42:41 来源: 作者: 【 】 浏览:4
Tags:OraclePolicyForNBU
Theory:NBU use a automatic script to connect RMAN and backup database

Steps:
First,make a automatic script.
Second,build a oracle policy

First:
Make a automatic script.NBU has provide some scripts on it's client directory
You can find it in /usr/openv/netbackup/ext/db_ext/oracle/samples/rman/

I choose a hot backup way to do this test:hot_database_backup.sh

You should change some variable which is be marked.

[root@nbuserver rman]# cat hot_database_backup.sh
#!/bin/sh
# $Header: hot_database_backup.sh,v 1.3 2010/08/04 17:56:02 $
#
#bcpyrght
#***************************************************************************
#* $VRTScprght: Copyright 1993 ? 2012 Symantec 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"(" -f2 | cut -d ")" -f1`

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

RMAN_LOG_FILE=${0}.out

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

if [ -f "$RMAN_LOG_FILE" ]
then
        rm -f "$RMAN_LOG_FILE"
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/ora102, below, with the Oracle home path.
# ―――――――――――――――――――――――――

ORACLE_HOME=/db/oracle/product/ora102
export ORACLE_HOME

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

ORACLE_SID=ora102
export ORACLE_SID

# ―――――――――――――――――――――――――
# Replace ora102, below, with the Oracle DBA user id (account).
# ―――――――――――――――――――――――――

ORACLE_USER=ora102

# ―――――――――――――――――――――――――
# Set the target connect string.
# Replace "sys/manager", below, with the target connect string.
# ―――――――――――――――――――――――――

TARGET_CONNECT_STR=sys/manager

# ―――――――――――――――――――――――――
# 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   "RMAN: $R
首页 上一页 1 2 3 下一页 尾页 1/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Oracle基础(一):oracle实例与s.. 下一篇64位win7安装Oracle11gR2数据库

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·如何从内核协议栈到 (2025-12-27 03:19:09)
·什么是网络协议?有哪 (2025-12-27 03:19:06)
·TCP/ IP协议有哪些 (2025-12-27 03:19:03)
·怎样用 Python 写一 (2025-12-27 02:49:19)
·如何学习python数据 (2025-12-27 02:49:16)