Anda di halaman 1dari 5

Note 1129197 - Terminating BRARCHIVE, BRBACKUP and BRRESTORE

runs
Note Language: English Version: 2 Validity: Valid from 09.01.2008

Summary

Symptom
1. The current situation is as follows:
=====================
In some cases, it is necessary to terminate the current backup or the
current restore, for example, when:
- The backup or restore is stuck due to backup media problems,
- The backup takes much longer than expected and disrupts the online
operation.
You usually interrupt the backup with a signal (Control-C, Control-Quit,
Control-Break) or with a relevant termination command (Unix: kill
[<signal>] <process_id>, Windows: Task Manager -> End Task / End Process).
However, this procedure has the following downsides:
- When you use a termination command, the relevant process has to be
determined first.
- When you use Unix "kill -9 <process_id>" or "Windows Task Manager -> End
Process", BR*Tools do not carry out a clean up. In the case of BRBACKUP,
the database may be stopped (offline backup) or certain tablespaces remain
in backup mode (online backup), which, in the majority of cases, is not
what you require.
Caution:
As a general rule, we do not recommend that you use UNIX "kill -9
<process_id>" and, actually, you should not require it - "kill [15]
<process_id>" is usually sufficient. Using "Task Manager -> End Process"
in Windows is not recommended either, but cannot be avoided sometimes. For
example, if backup of DBA planning calendar or an external scheduler has
been started, the BR*Tools then run in the environment of the relevant
service and cannot be terminated with Control-C or Control-Break.

2. New option for terminating BRARCHIVE, BRBACKUP und BRRESTORE


===================================================================
There is now a new "-g|-abort" option that makes it easier to terminate
BRARCHIVE, BRBACKUP and BRRESTORE runs:
brarchive -g|-abort stop|term|kill
brbackup -g|-abort stop|term|kill
brrestore -g|-abort stop|term|kill
where: stop - smooth termination
term - normal termination
kill - hard termination
To trigger a termination, BRARCHIVE, BRBACKUP or BRRESTORE is called in a
separate command window (Unix Shell window/Windows command prompt window),
such as:
brbackup [-c] -g stop
When the "-c" option causes an unattended termination
The termination activities create only a short log file in the relevant log
directory:
BRARCHIVE: <saparch>/<kodierter_zeitstempel>.aab
BRBACKUP: <sapbackup>/<kodierter_zeitstempel>.bab
BRRESTORE: <sapbackup>/<kodierter_zeitstempel>.rab
On the other hand, the terminated backups or restores are always marked as
being incorrect. However, you may still be able to use them later (for
example, for a fill-up activity). This applies in particular to the smooth
termination with the "-g stop" option.

25.02.2008 Page 1 of 5
Note 1129197 - Terminating BRARCHIVE, BRBACKUP and BRRESTORE
runs
2.1. Smooth termination with "-g stop" option
-----------------------------------------
When there is a termination with the "-g stop" option, there is a wait
until all copy processes (such as cpio, dd, cp/copy) that are currently
active are completed. The backup or the restore is not ended early until
later (and the clean-up carried out) so that the database is in a clean
state afterwards. Active copy processes are not terminated. The files
currently processed are always copied in full. For this reason, the
termination process may take longer (several minutes).
This kind of termination is suitable for "native" backups or restores -
when cpio, dd, cp, copy, compress, uncompress, mkszip and SAP SBT (RMAN)
backup library are used.
When you use 3rd party backup tools such as BACKINT (backup_dev_type =
util_file|util_file_online) or 3rd party SBT backup libraries
(backup_dev_type = rman_util|rman_disk|rman_stage), this kind of
termination generally does not lead to the required result, because it is
not possible here to end an active BACKINT/backup library call early.
Since the backup/restore request is mainly processed in a call, it is
almost completely executed (except for profiles and logs) before it can be
terminated. Point 3.2 pinpoints a potential solution to this problem.

2.2. Normal termination with "-g term" option


------------------------------------------
When there is a termination with the "-g term" option, a "terminate" signal
is sent for the BRARCHIVE, BRBACKUP or BRRESTORE process that is running.
BRARCHIVE, BRBACKUP or BRRESTORE then try to terminate the copy processes
started or the BACKINT/RMAN calls right away. However, this is not always
possible - especially if the backup is not running in a separate process
group. In this case, there is a risk that external processes will be
terminated as well. For example, on Windows platforms the SAP processes
may be affected if the backup was started using the DBA planning calendar.
Or, on UNIX platforms, a "Not owner" error may occur if a CRON job is used
for the start. Point 3.3 discusses a potential solution for this problem,
otherwise, you may have to terminate the processes manually (UNIX: kill,
Windows: Task Manager).
It is normally BRARCHIVE, BRBACKUP or BRRESTORE that carries out the
clean-up here so that the database is in a clean state later on.

2.3. Hard termination with "-g kill" option


----------------------------------------
When there is a termination with the "-g kill" option, a "kill" signal is
sent for the BRARCHIVE, BRBACKUP or BRRESTORE process that is running.
BRARCHIVE, BRBACKUP or BRRESTORE is then terminated immediately, and the
clean-up is not carried out. The copy processes started or the BACKINT/RMAN
calls are not ended and may have to be terminated manually (UNIX: kill,
Windows: Task Manager). The state of the database remains the same as at
the time of the termination.
After an offline backup is terminated, you can use the following BRSPACE
call to restart the database:
brspace -c force -f dbstart -s open -f
After termination of an online backup, you can use the following BRSPACE
call to reset the backup status for the tablespaces:
brspace -c force -f tsalter -a endback -t all_ts
Caution:
Hard termination should be used in exceptional cases only, for example, if
the normal termination was not successful.

3. Further recommendations and additional information

25.02.2008 Page 2 of 5
Note 1129197 - Terminating BRARCHIVE, BRBACKUP and BRRESTORE
runs
===============================================

3.1. Handling BRARCHIVE "Fill" runs


-------------------------------------------
A permanent BRARCHIVE run started with the "-f|-fill" option should
normally be ended with the call "brarchive -f stop" - and not with the new
"-g|-abort" option. This run is then considered successful. However,
finishing may take longer because the run can be ended only once processing
(backup/deletion/importing into a standby database) of the offline redolog
file group is complete. You can only carry out a smooth, normal or (in
exceptional cases) hard termination when a faster finish is an absolute
must.

3.2. Splitting BACKINT/RMAN requests into several calls


------------------------------------------------------------
When you use 3rd party backup tools such as BACKINT (backup_dev_type =
util_file|util_file_online) or 3rd party SBT backup libraries
(backup_dev_type = rman_util|rman_disk|rman_stage), the backup/restore
request is processed mainly in one call and is therefore not really
suitable for a smooth termination that can take effect only once the call
has ended. However, by this point the request is almost finished (except
for profiles and logs) and there is no longer any real point in carrying
out a termination.
In BR*Tools 7.00 or higher, you have the opportunity of splitting the
BACKINT/RMAN requests into several calls by limiting the number of files
that are to be processed in one call. The following (undocumented)
init<DBSID>.sap parameters enable you to achieve this:
BACKINT: _util_grp_cnt = <count>
RMAN: _rman_grp_cnt = <count>
This is particularly useful for large databases with several hundred files.
For example, if the parameter "_util_grp_cnt = 100" for a database with 950
files, BRBACKUP calls BACKINT ten times to save all the database files.
Smooth termination is then possible for BRBACKUP once each partial call of
this type has ended.
Splitting BACKINT/RMAN requests into several calls could also be
advantageous elsewhere, namely when backups or restores are unsuccessful
(for example, as a result of backup media problems). The groups
successfully processed up to that point are then considered when you
restart the process using the "-f|-fill" option.

3.3. Complete, normal BRARCHIVE, BRBACKUP or BRRESTORE termination


-----------------------------------------------------------------------
The term "complete termination" refers to a termination during which
BRARCHIVE, BRBACKUP or BRRESTORE and all copy processes that have started
are terminated early and no external processes are affected by this. As
already mentioned above (see 2.2), for normal termination this is only the
case if BRARCHIVE, BRBACKUP or BRRESTORE runs in their own separate process
group.
In UNIX, BR*Tools automatically create a separate process group if
BRARCHIVE, BRBACKUP or BRRESTORE are started using the "-c force" option.
If BRBACKUP or BRARCHIVE are started by the DBA planning calendar, this
option is always used. When external schedulers (such as CRON) are used
for the start, the DBA must make sure that it is set in the command line.
In Windows, no separate process group is created (for technical reasons) if
BRBACKUP or BRARCHIVE are started using the DBA planning calendar. If the
need ever arises to carry out a complete, normal termination of BRARCHIVE
or BRBACKUP, the following changes to the relevant logical commands mean
you can still trigger creation of a separate process group for the backup

25.02.2008 Page 3 of 5
Note 1129197 - Terminating BRARCHIVE, BRBACKUP and BRRESTORE
runs
activities:
SQL> connect sap<sid>/<password>
SQL> update SXPGCOTABE set OPCOMMAND = 'cmd /c start /b
brbackup' where NAME = 'BRBACKUP';
SQL> update SXPGCOTABE set OPCOMMAND = 'cmd /c start /b
brarchive' where NAME = 'BRARCHIVE';
Caution: This change applies to Windows only and should be made in
exceptional cases only.

3.4. Termination of BRARCHIVE, BRBACKUP or BRRESTORE in the command window


----------------------------------------------------------------------
If BRARCHIVE, BRBACKUP or BRRESTORE have been started in a UNIX or Windows
command window, you can usually cancel the process directly using
Control-C, Control-Quit (UNIX) or Control-Break (Windows). However, if
you have no access to the command window, in which the programs were
started, you can use the new termination opportunities in another command
window under the relevant Oracle OS user (UNIX: ora<sid>, Windows:
<sid>adm) .
To ensure in this case a complete, normal termination of BRARCHIVE,
BRBACKUP or BRRESTORE (running with the "-c force" option) on Windows
platforms, start the programs using the START command as follows, for
example:
start /b brbackup -u / -c force -d disk -t online -m all

More Terms
BR*Tools, BRARCHIVE, BRBACKUP, BRRESTORE

Cause and Prerequisites


This is an advance development.

Solution
The enhancement is included in BR*Tools 6.40 patch 47,
BR*Tools 7.00 patch 31,
and BR*Tools 7.10 patch 7.
For more information about downloading patches, see Notes 12741 and 19466.

Header Data
Release Status: Released for Customer
Released on: 09.01.2008 15:27:59
Priority: Recommendations/additional info
Category: Advance development

Main Component BC-DB-ORA-DBA Database Administration with Oracle

Valid Releases
Software Component Release From To Release and Following
Release
SAP_BASIS 60 640 640
SAP_BASIS 70 700 700
SAP_BASIS 71 710 710

Related Notes

25.02.2008 Page 4 of 5
Note 1129197 - Terminating BRARCHIVE, BRBACKUP and BRRESTORE
runs
Number Short Text
1060305 Corrections in BR*Tools Version 7.10
849483 Corrections for BR*Tools Version 7.00
680046 Corrections in BR*Tools Version 6.40

25.02.2008 Page 5 of 5

Anda mungkin juga menyukai