NetbackupforOracle备份实施手册

上传人:ren****ao 文档编号:162568742 上传时间:2022-10-18 格式:DOCX 页数:11 大小:16.62KB
返回 下载 相关 举报
NetbackupforOracle备份实施手册_第1页
第1页 / 共11页
NetbackupforOracle备份实施手册_第2页
第2页 / 共11页
NetbackupforOracle备份实施手册_第3页
第3页 / 共11页
点击查看更多>>
资源描述
通过rman 从NBU备份恢复ORACLE环境:redhat 4 as update 7Oracle ORACLE SID=LJY1. 安装database设置oracle用户及安装目录/usr/sbin/groupadd oinstall/usr/sbin/groupadd dba/usr/sbin/useradd -m -g oinstall -G dba oraclemkdir -p /u01/app/oraclemkdir -p /u02/oradatachown -R oracle:oinstall /u01/app/oracle /u02/oradatachmod -R 775 /u01/app/oracle /u02/oradata更改主机配置文件i. Root用户vi /etc/sysctl.confkernel.shmall = 2097152kernel.shmmax = 2147483648kernel.shmmni = 4096kernel.sem = 250 32000 100 128fs.file-max = 65536net.ipv4.ip_local_port_range = 1024 65000net.core.rmem_default = 1048576net.core.rmem_max = 1048576net.core.wmem_default = 262144net.core.wmem_max = 262144vi /etc/security/limits.conforacle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536vi /etc/pam.d/loginsession required /lib/security/pam_limits.sosession required pam_limits.sovi /etc/profileif $USER = oracle ; thenif $SHELL = /bin/ksh ; thenulimit -p 16384ulimit -n 65536elseulimit -u 16384 -n 65536fifiii. oracle用户su - oraclevi ./.bash_profileORACLE_BASE=/u01/app/oracleORACLE_SID=LJYexport ORACLE_HOME ORACLE_BASE ORACLE_SIDPATH=$PATH:$HOME/bin:$ORACLE_HOME/bin安装 libaio 在第4张光盘。否则安装oracle检测出错。 安装oracle应用并创建数据库su - oracle安装oracle应用程序创建数据库配置归档模式shutdown immediate;startup mount;ALTER DATABASE ARCHIVELOG;alter database open;2. 安装NBU Clientsu - root安装ICS bpx安装NBU Client安装Database Agent for oraclesu - oracle运行 oracle_link 脚本:/usr/openv/netbackup/bin/oracle_link3. 配置rman脚本配置策略配置rman 脚本send NB_ORA_SERV=ljy_nbu7,NB_ORA_CLIENT=oracle10a;BACKUP FORMAT cntrl_%I_%s_%p_%t4. 完成创建、配置、启动监听器lsnrctl start5. 附录1:nbu oracle备份脚本#!/bin/sh# $Header: hot_database_backup.sh,v 1.2 2002/08/06 23:51:42 $#bcpyrght#*#* $VRTScprght: Copyright 1993 - 2007 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 users 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_FILEfi# -# Initialize the log file.# -echo $RMAN_LOG_FILEchmod 666 $RMAN_LOG_FILE# -# Log the start of this script.# -echo Script $0 $RMAN_LOG_FILEecho = started on date = $RMAN_LOG_FILEecho $RMAN_LOG_FILE# -# Replace /db/oracle/product/ora81, below, with the Oracle home path.# -export ORACLE_HOME# -# Replace ora81, below, with the Oracle SID of the target database.# -ORACLE_SID=LJYexport ORACLE_SID# -# Replace ora81, below, with the Oracle DBA user id (account).# -ORACLE_USER=oracle# -# Set the target connect string.# Replace sys/manager, below, with the target connect string.# -TARGET_CONNECT_STR=sys/sys# -# 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_FILEecho RMAN: $RMAN $RMAN_LOG_FILEecho ORACLE_SID: $ORACLE_SID $RMAN_LOG_FILEecho ORACLE_USER: $ORACLE_USER $RMAN_LOG_FILEecho ORACLE_HOME: $ORACLE_HOME $RMAN_LOG_FILE# -# Print out the value of the variables set by bphdb.# -echo $RMAN_LOG_FILEecho NB_ORA_FULL: $NB_ORA_FULL $RMAN_LOG_FILEecho NB_ORA_INCR: $NB_ORA_INCR $RMAN_LOG_FILEecho NB_ORA_CINC: $NB_ORA_CINC $RMAN_LOG_FILEecho NB_ORA_SERV: $NB_ORA_SERV $RMAN_LOG_FILEecho NB_ORA_POLICY: $NB_ORA_POLICY $RMAN_LOG_FILE# -# NOTE: This script assumes that the database is properly opened. If desired,# this would be the place to verify that.# -echo $RMAN_LOG_FILE# -# If this script is executed from a NetBackup schedule, NetBackup# sets an NB_ORA environment variable based on the schedule type.# The NB_ORA variable is then used to dynamically set BACKUP_TYPE# For example, when:# schedule type is BACKUP_TYPE is# - -# Automatic Full INCREMENTAL LEVEL=0# Automatic Differential Incremental INCREMENTAL LEVEL=1# Automatic Cumulative Incremental INCREMENTAL LEVEL=1 CUMULATIVE# For user initiated backups, BACKUP_TYPE defaults to incremental# level 0 (full). To change the default for a user initiated# backup to incremental or incremental cumulative, uncomment# one of the following two lines.# BACKUP_TYPE=INCREMENTAL LEVEL=1# BACKUP_TYPE=INCREMENTAL LEVEL=1 CUMULATIVE# Note that we use incremental level 0 to specify full backups.# That is because, although they are identical in content, only# the incremental level 0 backup can have incremental backups of# level 0 applied to it.# -if $NB_ORA_FULL = 1 then echo Full backup requested $RMAN_LOG_FILE BACKUP_TYPE=INCREMENTAL LEVEL=0elif $NB_ORA_INCR = 1 then echo Differential incremental backup requested $RMAN_LOG_FILE BACKUP_TYPE=INCREMENTAL LEVEL=1elif $NB_ORA_CINC = 1 then echo Cumulative incremental backup requested $RMAN_LOG_FILE BACKUP_TYPE=INCREMENTAL LEVEL=1 CUMULATIVEelif $BACKUP_TYPE = then echo Default - Full backup requested $RMAN_LOG_FILE BACKUP_TYPE=INCREMENTAL LEVEL=0fi# -# Call Recovery Manager to initiate the backup. This example does not use a# Recovery Catalog. If you choose to use one, replace the option nocatalog# from the rman command line below with the# rcvcat / statement.# Note: Any environment variables needed at run time by RMAN# must be set and exported within the switch user (su) command.# -# Backs up the whole database. This backup is part of the incremental# strategy (this means it can have incremental backups of levels 0# applied to it).# We do not need to explicitly request the control file to be included# in this backup, as it is automatically included each time file 1 of# the system tablespace is backed up (the inference: as it is a whole# database backup, file 1 of the system tablespace will be backed up,# hence the controlfile will also be included automatically).# Typically, a level 0 backup would be done at least once a week.# The scenario assumes:# o you are backing your database up to two tape drives# o you want each backup set to include a maximum of 5 files# o you wish to include offline datafiles, and read-only tablespaces,# in the backup# o you want the backup to continue if any files are inaccessible.# o you are not using a Recovery Catalog# o you are explicitly backing up the control file. Since you are# specifying nocatalog, the controlfile backup that occurs# automatically as the result of backing up the system file is# not sufficient; it will not contain records for the backup that# is currently in progress.# o you want to archive the current log, back up all the# archive logs using two channels, putting a maximum of 20 logs# in a backup set, and deleting them once the backup is complete.# Note that the format string is constructed to guarantee uniqueness and# to enhance NetBackup for Oracle backup and restore performance.# NOTE WHEN USING TNS ALIAS: When connecting to a database# using a TNS alias, you must use a send command or a parms operand to# specify environment variables. In other words, when accessing a database# through a listener, the environment variables set at the system level are not# visible when RMAN is running. For more information on the environment# variables, please refer to the NetBackup for Oracle Admin. Guide.# -CMD_STR=ORACLE_HOME=$ORACLE_HOMEexport ORACLE_HOMEORACLE_SID=$ORACLE_SIDexport ORACLE_SID$RMAN target $TARGET_CONNECT_STR nocatalog msglog $RMAN_LOG_FILE append $RMAN_LOG_FILE RSTAT=$?else /usr/bin/sh -c $CMD_STR $RMAN_LOG_FILE RSTAT=$?fi# -# Log the completion of this script.# -if $RSTAT = 0 then LOGMSG=ended successfullyelse LOGMSG=ended in errorfiecho $RMAN_LOG_FILEecho Script $0 $RMAN_LOG_FILEecho = $LOGMSG on date = $RMAN_LOG_FILEecho $RMAN_LOG_FILEexit $RSTAT6. 附录2:oracle管理oracle的常用启动与关闭1, 启动isqlplus服务 端口:5560 isqlplusctl start /启动 isqlplusctl stop /停止2, 启动数据库 dbstart dbshut3, 开启企业管理器 端口:1158 emctl start dbconsole emctl stop dbconsole 4, 启动监听 lsnrctl start lsnrctl stop5, 开启代理 emctl start agent emctl stop agent6, 启动实例 sqlplus /nolog conn / as sysdba startup /启动实例 shutdown immediate /关闭实例7, tnsping 192.168.111.210 /测试Oracle数据库是否通8, http:/192.168.111.210:5560/isqlplus/dba /isQL*Plus DBA URL9, http:/192.168.111.210:1158/em /Enterprise Manager 10g Database Control每次启动时都会报错Failed to auto-start Oracle Net Listene using /ade/vikrkuma_new/oracle/bin/tnslsnr编辑dbstart文件vi dbstar将该行改为export ORACLE_HOME_LISTNER=$ORACLE_HOME想系统启动是自动启动数据库可以通过修改/etc/rc.d/rc.local文件一开始我写的命令是su oracle -lc ora_App/product/10.2.0/db_1/bin/lsnrctl startsu oracle -lc ora_App/product/10.2.0/db_1/bin/dbstart
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 图纸专区 > 中学资料


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!