nbu备份恢复oracle.doc
文本预览下载声明
oracle备份脚本
1、# su - oracle
$ sqlplus ‘/as sysdba’
sqlplusshutdown immediate
sqlplusexit
以oracle用户的身份,执行oracle_link
$ /usr/openv/netbackup/bin/oracle_link
在数据库服务器的数据分区内创建数据库备份脚本目录
# mkdir /oracle/ora_bak_scripts
创建oracle备份的脚本
# cp –r /usr/openv/netbackup/ext/db_ext/oracle/samples/rman/* /orcdata/db_back_scripts
根据实际情况编辑oracle备份脚本
在我们拷贝到数据库备份脚本目录中的范本文件中,我们比较多使用的是hot_database_backup.sh(联机数据库备份脚本)。以下说明如何编辑数据库备份脚本。
#!/bin/sh
# $Header: hot_database_backup.sh,v 1.2 2002/08/06 23:51:42 $
#
#bcpyrght
#***************************************************************************
#* $VRTScprght: Copyright 1993 - 2003 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 users account.
# ---------------------------------------------------------------------------
# ---------------------------------------------------------------------------
# Determine the user which is executing this script.
# ---------------------------------------------------------------------------
CUSER=`id |cut -d( -f2 | cut -d ) -f1`
# ---------------------------------------------------------------------------
# Put output in this file name.out. Change as desired.
# N
显示全部