원문 : http://www.ischo.net -- 조인상 //시스템 엔지니어

+++++++++++++++++++++++++++++++++++++++++++++++++++++++

Symantec Netbackup 7.5 에서 스크립트 처리방법

 

설치위치 : /usr/openv/netbackup

 

 

전처리 스크립트 : 설치위치/bin/bpstart_notify_<policy이름>

후처리 스크립트 : 설치위치/bin/bpend_notify_<policy이름>

 

 

위와 같이 설정하면 전처리스크립트 실행 -> 본 백업 실행 -> 후처리스크립트실행   순으로 처리가 될 것이다.

 

이를 이용하여 오라클 온라인백업을 구현한다.

 

 

 

1. 먼저 policy 구성

예) policy name : ORA

ORA policy 안의 schedule에 user backup type으로 (예:online) 이라는 이름의 스케줄을 생성한다.

 

policy 안에 오라클 백업에 필요한   datafile, controlfile, redolog file, oracle 엔진 디렉토리 등을 백업하도록 지정해준다.

 

 

2. 다음의 전/후처리 스크립트를 생성

설치위치/bin/bpstart_notify_ORA  내용 ------------

su - oracle -c /usr/openv/netbackup/script/ora_online_start.sh

 

설치위치/bin/bpend_notify_ORA 내용 ---------------

su - oracle -c /usr/openv/netbackup/script/ora_online_end.sh

 

 

 

3. 전/후처리 스크립트가 불러올 스크립트를 생성

 

 

=====================================================================================

#!/usr/bin/ksh

 

# /usr/openv/netbackup/script/ora_online_start.sh

#####################################################################################
########################   ENVIRONMENT VALUE   ######################################
#####################################################################################
ORACLE_HOME=/oracle/app/product/11.2.0
#####################################################################################


$ORACLE_HOME/bin/sqlplus "/as sysdba" << !

alter system switch logfile;
alter database begin backup;
!

 

=====================================================================================

 

#!/usr/bin/ksh

 

# /usr/openv/netbackup/script/ora_online_end.sh

#####################################################################################
########################   ENVIRONMENT VALUE   ######################################
#####################################################################################
ORACLE_HOME=/oracle/app/product/11.2.0
#####################################################################################


$ORACLE_HOME/bin/sqlplus "/as sysdba" << !
alter database end backup;

alter system switch logfile;
!

=====================================================================================

 

 

 

3. 백업테스트

policy 에서 manual backup 을 이용하여 백업이 잘 되는지 테스트 한다.

 

# tail -f alert*.log

를 이용하여 begin~end backup 이 잘 찍히는지 모니터링 하는것이 좋다.

 

 

 

 

 

참고 URL : http://www.symantec.com/business/support/index?page=content&id=TECH162973

 

Problem



This is a basic how to on the use of bpstart and bpend notify scripts.


 

Environment



Windows 2003 R2 client.

NetBackup 7.1


 

Solution



Symantec NetBackup (tm) comes packaged with a number of script files that provide information on the different stages of backup jobs and other aspects of its functionality.
The bulk of the .cmd\.bat script files can be found on the NetBackup master server in the <install_path>\VERITAS\NetBackup\bin directory.

Additional .cmd\.bat files can be found in the <install_path>\VERITAS\NetBackup\bin\goodies directory.

For these files to work, they must reside in the <install_path>\VERITAS\NetBackup\bin directory. For the files in the \goodies directory, the original files should be copied to the \bin directory.

Note: Symantec does not support any scripts that are modified from the default NetBackup script provided. The scripts listed can be adapted to provide an added service to the NetBackup program, however, these modifications will not be supported, and a default copy of the script must be available at all times to aid troubleshooting problems.

Scripts:

\netbackup\bin\goodies\bpstart_notify.bat

- This script is called when bpbkar is started for a client backup.
- This script receives six parameters:

%1 = CLIENT_NAME
%2 = POLICY_NAME
%3 = SCHEDULE_NAME
%4 = SCHEDULE_TYPE, one of the following: FULL, INCR, CINC, UBAK, UARC
%5 = STATUS, always 0
%6 = RESULT_FILE

\netbackup\bin\goodies\bpend_notify.bat

- This script is called when bpbkar is finished with a backup job.
- During an archive this script is called after the backup is complete and before the files are deleted.
- This script receives six parameters:

%1 = CLIENT_NAME
%2 = POLICY_NAME
%3 = SCHEDULE_NAME
%4 = SCHEDULE_TYPE, one of the following: FULL, INCR, CINC, UBAK, UARC
%5 = Status of backup
%6 = RESULT_FILE

The following are examples of bpstart_notify script names:

* The following script applies only to a policy named days:

\install_path\netbackup\bin\bpstart_notify.days.bat

* The following script applies only to a schedule that is named fulls in a policy named days:

\install_path\netbackup\bin\bpstart_notify.days.fulls.bat

The bpstart_notify script also runs for NetBackup catalog backups if a .policyname[.schedule] is not specified.


The first script affects all scheduled backups in the policy named days.
The second script affects scheduled backups in the policy named days only when the schedule is named fulls.

For a given backup, NetBackup calls only one bpstart_notify script and checks for them in the following order:

bpstart_notify.policy.schedule.bat
bpstart_notify.policy.bat
bpstart_notify.bat
 

The following are examples of bpstart_notify script names:

* The following script applies only to a policy named days:

\install_path\netbackup\bin\bpend_notify.days.bat

* The following script applies only to a schedule that is named fulls in a policy named days:

\install_path\netbackup\bin\bpend_notify.days.fulls.bat

Note: The bpend_notify script also runs for NetBackup catalog backups if a .policyname[.schedule] is not specified.

The first script affects all scheduled backups in the policy named days.
The second script affects scheduled backups in the policy named days only when the schedule is named fulls.

For a given backup, NetBackup calls only one bpend_notify script and checks for them in the following order:

bpend_notify.policy.schedule.bat
bpend_notify.policy.bat
bpend_notify.bat

For example, if there are both bpend_notify.policy.bat and bpend_notify.policy.schedule.bat scripts, NetBackup uses only bpend_notify.policy.schedule.bat.

Please refer to the NetBackup Administration Guide Volume I and Volume II for complete details.


 



 


 

Article URL http://www.symantec.com/docs/TECH162973


 

Terms of use for this information are found in Legal Notices

 

 

 

 

(*.118.235.214)