Showing posts with label BRTOOLS. Show all posts
Showing posts with label BRTOOLS. Show all posts

How to Use BR*Tools

Purpose

You can start BR*Tools in the following ways:

· Interactively from the BRGUI graphical interface or the BRTOOLS character interface

· Directly from the command line using the relevant BR*Tools options

For BRSPACE you can also use “quick mode” from the BRGUI or BRTOOLS interface or the command line. For more information, see “Quick Mode for BRSPACE” below.

There is also an unattended or “batch” mode, but this is only relevant when you have completed your input and started execution to perform some action on the database.

With the option –c|-confirm, you can specify that the BR*Tool runs without operator input in unattended mode, only stopping when absolutely necessary, that is in menus and “yes / no” choices (message BR0676I). All other confirmation prompts and so on are skipped.

With the option –c|–confirm force, you can specify that BR*Tool runs in fully unattended mode, so that an error is generated if input is required and has not already been given.

Whichever start method you use, at the end a functional tool – BRBACKUP, BRARCHIVE, BRRESTORE, BRRECOVER, BRSPACE, or BRCONNECT – directly performs some action on the database.

Process Flow

Interactive Start

You start BRGUI or BRTOOLS from the command line and then choose the menu options required:

· Database Instance Management with BR*Tools

· Space Management with BR*Tools

· Segment Management with BR*Tools

· Backup and Database Copy with BR*Tools

· Restore and Recovery with BR*Tools

· Check and Verification with BR*Tools

· Database Statistics with BR*Tools

· Additional Functions with BR*Tools

When you are ready to execute the functional tool, BRGUI or BRTOOLS normally shows you the command that is to be executed. Then BRGUI or BRTOOLS normally calls the correct functional tool to perform the function that you have specified in the menus.

You can enter manually enter the command. For more information, see “Command Line Mode” below. However, you might get errors if you change the command.


BRSPACE and BRRECOVER differ in that they also have an interactive mode separate from BRGUI or BRTOOLS. Therefore, BRTOOLS passes control to BRSPACE or BRRECOVER , which themselves gather further input using menus, before starting to perform an action on the database.

In addition, there is a “quick mode” for BRSPACE. If you specify an object name in BRGUI or BRTOOLS, you enter BRSPACE in “quick mode.” For more information, see below.

There are the following reasons for this:

· To enable full logging of BRSPACE actions – as soon as BRGUI or BRTOOLS calls BRSPACE, a log is created immediately, even though you are still in interactive mode

· To enable unattended mode without operator input, since you can specify all necessary input before the function is executed

Command Line Start

You enter the command options required directly from the command line:

· Command Options for BRBACKUP

· Command Options for BRARCHIVE

· Command Options for BRRESTORE

· Command Options for BRRECOVER

· Command options for BRSPACE

· Command Options for BRCONNECT

If the command options are correct and complete, the SAP tool is executed immediately to perform a function on the database.

Calling BRSPACE and BRRECOVER from the Command Line

BRSPACE and BRRECOVER have an interactive component to collect option input. If you do not specify a function, the tool is called with the default function when you start it from the command line:

· Complete Database Recovery for BRRECOVER

· Show Database Instance Information for BRSPACE

Otherwise, the appropriate menus are shown for the function you select.

You can force the tool to run in batch mode without any interactive component by entering the option –c force. For more information, see:

· -c|-confirm for BRRECOVER

· -c|-confirm for BRSPACE


Be very careful with –c force because it forces default selection of all unspecified options, which might lead to unexpected results.

If you call BRSPACE from the command line with a function name (for example, extend tablespace) and an object name (for example, tablespace name SYSTEM), you go straight into quick mode, as described below.

Quick Mode for BRSPACE

You can use quick mode to skip the higher-level menus in BRSPACE, including the menu to select the object of your chosen function.

You use quick mode from:

· BRGUI or BRTOOLS menus with the title BRSPACE options for

· The command line at operating system level

For quick mode, you must specify at least the function and the object name. The object – for example, a tablespace name if you want to extend a tablespace – varies according to the function that you choose. You can also enter additional options in quick mode.


The alternative to quick mode is main menu mode, in which you only use the menus in BRSPACE to enter the options required to perform a function. Unless you know the object name, we recommend you to use main menu mode.

In quick mode, BRSPACE skips the menus in which you normally specify the function and the object name. They jump directly to the final input menu to let you enter the remaining required parameters and execute the function immediately.

The following graphic illustrates in outline how quick mode works:

This graphic is explained in the accompanying text

Exceptions to quick mode

There are the following exceptions to quick mode:

· Function dbshow to show database information.

If you do not enter the class of the information to be displayed, you see a menu displaying the different categories of information class:

Show database instance information

Show database space information

Show database object information

Choose the category and then the class that you require.

BRSPACE displays the requested information.

· Alter functions:

¡ dbalter to alter the database instance

¡ dbparam to alter database parameters

¡ tsalter to alter tablespaces

¡ dfalter to alter data files

¡ tbalter to alter tables

¡ idalter to alter indexes

With these functions you should also enter an action to specify what kind of alter function you require. If you do not enter an action in quick mode, BRSPACE prompts you to select an action before you can continue.

· Multiple Objects

If you select multiple objects in quick mode, BRSPACE displays a list of objects for confirmation. If the list is not what you require, you can go back and make a new selection.


· The following example shows quick mode from the command line:

brspace –f tsextend –t psapprd

BRSPACE starts by displaying the input menu for the function Extend tablespace. The field for the object name is filled with your entry.

You can now enter all required options and execute the function immediately.

· The following example shows a command line entry for an alter function where the object (here, the database parameter) is specified, but not the action:

brspace –f dbalter –p audit_trail

BRSPACE starts by displaying the function main menu for the function that you entered, which is Alter database parameter in this example.

You must first select the action before BRSPACE can display the input menu to let you execute the function.


When you have finished executing a function and you choose back after starting BRSPACE in quick mode, the quick mode is deactivated and you can choose a new object to execute the function again. If you choose reset program status, BRSPACE restores your original object selection.

The exception to this is for the functions in segment management, where it makes no sense to display all tables or indexes, because the list would be too long.

End of Content Area

Initialization Profile init.sap

Definition

The initialization profile init.sap contains parameters that influence how the SAP tools perform various functions. It is usually stored in directory /dbs (UNIX) or \database (Windows).

Use

To configure the SAP tools BRBACKUP, BRARCHIVE, BRRESTORE, BRRECOVER, BRCONNECT, and BRSPACE, you must use the initialization profile init.sap. You can edit the file with a text editor. If you do not make any changes, the SAP tools use the default values for the parameters.

Before you use one of the SAP tools, find out exactly which parameters you have to configure. Pay particular attention to parameters without default values and parameters that have device-specific information or require special platform-specific commands.

Structure

The parameters and values in profile init.sap look as follows:

= |()

where value_list = ,

You separate the individual values in a value list by commas, and enclose the entire list in parentheses. You can use blanks between any symbols of such commands. If necessary, you can continue the parameter values can be continued on the next line (the line break is then treated as a blank). If a parameter value contains special characters such as space or $, you must enclose the value in double quotes, as in the following example:

rewind = "mt -f $ rewind"

If you are unsure, compare your input format with the format in the sample profile, /usr/sap//SYS/exe/run/initSID.sap, or the initialization profile, /dbs/init.ora.

Integration

You can override many of the parameters in init .sap by using a command option when you call BRBACKUP, BRARCHIVE, BRCONNECT, or BRRESTORE. For more information, see:

· Effects of the Command Options

· Command Options for BRBACKUP

· Command Options for BRARCHIVE

· Command Options for BRCONNECT

· Command Options for BRRESTORE

Changes to parameter values do not take effect until you call the corresponding tool.

BR*Tools User Interface

The user interface to BR*Tools provides you with menus to perform a wide range of database administration functions for your Oracle database. The menus are controlled by BRTOOLS, which in turn calls one of the functional BR programs.

You can use BR*Tools with a:

· Character-based interface, as in the following example, which shows the main menu:

BR0280I Time stamp 2003-03-06 11.30.57

BR0656I Choice menu 1 - please make a selection

----------------------------------------------------------------

BR*Tools main menu

1 = Instance management

2 - Space management

3 - Segment management

4 - Backup and database copy

5 - Restore and recovery

6 - Check and verification

7 - Database statistics

8 - Additional functions

9 - Exit program

Standard keys: c - cont, b - back, s - stop, r - refr, h - help

----------------------------------------------------------------

BR0662I Enter your choice:

· GUI, as in the following example, which shows the main menu:

This graphic is explained in the accompanying text


BRGUI is the graphical interface for BR*Tools. It displays output and gathers user input for BR*Tools.

Features

You see the following types of menus when using BRTOOLS:

· Control

This type of menu leads you from step to step in a pre-defined sequence. You can repeat steps in the correct sequence. Here is an example:

BR0655I Control menu 101 - please decide how to proceed

---------------------------------------------------------------

Complete database recovery main menu

1 = Check the status of database files

2 * Select database backup

3 * Restore data files

4 * Restore and apply incremental backup

5 * Restore and apply archivelog files

6 * Open database and post-processing

7 - Exit program

8 - Reset program status

Standard keys: c - cont, b - back, s - stop, r - refr, h - help

---------------------------------------------------------------


It is normally possible for you to repeat steps from a control menu but this is not always a sensible thing to do. Only repeat steps when you understand what the effects will be.

· Choice

This type of menu lets you make an independent choice from the menu in any sequence. You can repeat the choice as often as required. Here is an example:

BR0656I Choice menu 120 - please decide how to proceed

---------------------------------------------------------------

Restore of individual backup files main menu

1 = Restore files from BRBACKUP backup

2 - Restore individual files from tape

3 - Restore individual files from disk

4 - Restore individual files from backup utility

5 – Restore and apply incremental backup

6 - Exit program

7 - Reset program status

Standard keys: c - cont, b - back, s - stop, r - refr, h - help

---------------------------------------------------------------

· Input

This type of menu lets you enter required parameters or options. Here is an example:

BR0657I Input menu 123 - please check/enter input values

---------------------------------------------------------------

BRRESTORE main options for restore from BRBACKUP backup

1 - BRRESTORE profile (profile) ........ [initGC2.sap]

2 - BRBACKUP backup run (backup) ....... [bdjwgvvh.fnf]

3 - Fill-up previous restores (fillup) . [no]

4 - Restore device type (device) ....... [util_file]

5 - BACKINT/Mount profile (parfile) .... [initGC2.utl]

6 # Database user/password (user) ...... [system/*******]

7 ~ Restore destination (rest_dest) .... []

8 - Files for restore (mode) ........... [2,11-12]

Standard keys: c - cont, b - back, s - stop, r - refr, h - help

---------------------------------------------------------------

· List

This type of menu displays a list of items from which you select one entry. Here is an example:

BR0658I List menu 121 - please select one entry

---------------------------------------------------------------

BRBACKUP database backups for restore

Pos. Log Start Type Files Device Rc

1 = bdjwhckx.ffd 2003-01-29 17.30.51 offline 110/0 disk 0

2 - bdjwhadu.fft 2003-01-29 17.05.14 offline 112/0 tape 1

3 - bdjwgyrq.fff 2003-01-29 16.48.42 offline 112/0 util_onl 0

4 - bdjwgwtj.fnt 2003-01-29 16.26.55 onl_cons 115/0 tape 0

5 - bdjwgvvh.fnf 2003-01-29 16.16.29 onl_cons 115/0 util_onl 0

BR0280I Time stamp 2003-01-29 19.05.29

There are a number of sub-types for the list menu:

¡ List menu with optional single selection

BR0658I List menu 365 – you can select one entry

---------------------------------------------------------------

List of BRSPACE export runs

Pos. Run Date Tables Dumps Size[KB]

1 - sdlmvogy.tbe 2003-09-11 20.28.36 1 1 2

2 - sdlmqobv.tbe 2003-09-10 20.01.43 2 1 14

3 - sdlmqimk.tbe 2003-09-10 18.58.42 2 1 5

4 - sdlmqgin.tbe 2003-09-10 18.34.29 2 1 18

5 - sdlmqfmw.tbe 2003-09-10 18.25.06 2 1 12

...

Press to scroll, to select, 'c' to continue, 's' to stop scrolling..

¡ List menu with multiple selection

BR0659I List menu 312 + please select one or more entries

---------------------------------------------------------------

List of tablespaces for alter

Pos. Tablespace Files/AuExt. Type Status SegMan. ExtMan. Backup

1 - DRSYS 1/1 DATA ONLINE AUTO LOCAL NO

2 - EXAMPLE 1/0 DATA ONLINE AUTO LOCAL NO

3 - INDX 1/1 DATA ONLINE AUTO LOCAL NO

4 - PSAP1111D 1/1 DATA ONLINE AUTO LOCAL NO

5 - PSAP1111I 1/1 DATA ONLINE AUTO LOCAL NO

...

Standard keys: c - cont, b - back, s - stop, r - refr, h - help

---------------------------------------------------------------

¡ List menu with optional multiple selection

BR0659I List menu 259 + you can select one or more entries

---------------------------------------------------------------

List of database tablespaces

Pos. Tablespace Type Status ExtMan. SegMan. Backup Files/AuExt.

Total[KB] Used[%] Free[KB] ExtSize[KB] FreeExt. Largest[KB]

1 - DRSYS DATA ONLINE LOCAL AUTO NO 1/1

10240 47.50 5376 1038336 2 1038336+:5312:64

:0:0

2 - EXAMPLE DATA ONLINE LOCAL AUTO NO 1/0

123520 8.29 113280 0 5 93056:16128:22

40:1728:128

3 - INDX DATA ONLINE LOCAL AUTO NO 1/1

5120 1.25 5056 1043456 1 1043456+:5056:0:

0:0

...

Standard keys: c - cont, b - back, s - stop, r - refr, h - help

---------------------------------------------------------------

¡ List display without selection

BR0660I List display 352 - no selection possible

---------------------------------------------------------------

List of tables for reorganization

Pos. Owner Table Part. Rows Space[KB] Data[KB:%]

1 - SAPR3 DBABARL NO 429 64 42:65

2 - SAPR3 DBABD NO 1068 320 253:79

3 - SAPR3 DBABL NO 763 256 189:74

4 - SAPR3 DBADFL NO 0 64 0:0

5 - SAPR3 DBAERR NO 0 64 0:0

...

Standard keys: c - cont, b - back, s - stop, r - refr, h - help

---------------------------------------------------------------

· Display in form of input menu, but no input possible

BR0692I Display menu 260 # no input possible

---------------------------------------------------------------

Information about tablespace DRSYS

1 - Tablespace type (type) ................... DATA

2 - Tablespace status (status) ............... ONLINE

3 - Extent management (extent) ............... LOCAL

4 - Segment space managenent (space) ......... AUTO

5 - Backup status (backup) ................... NO

6 - Number of files in tablespace (files) .... 1

7 - Number of autoextensible files (autoext) . 1

8 - Total tablespace size in KB (total) ...... 10240

9 - Used space in tablespace in % (used) ..... 47.50

10 - Free space in tablespace in KB (free) .... 5376

11 - Maximal extension size in KB (extsize) ... 1038336

12 - Number of free extents (freext) .......... 2

13 - Largest free extents (largest) ........... 1038336+:5312:64:0:0

Standard keys: c - cont, b - back, s - stop, r - refr, h - help

Note on SAP DB Backup

A sample backup schedule might look like:
1. Hourly - brarchive backup of archive logs
2. Daily - brbackup backup of full database
3. Monthly - file system backup of /sapmnt/, including SAP executables and profile data, and /oracle/SID/_/dbs & network ---making sure you get Oracle/SAP init files and network files (tnsnames.ora, listener.ora,\nnames.ora, etc., though you might have relocated these files elsewhere), & /usr/sap/trans directory.
4. Quarterly - Oracle export performed to tape.

This schedule is good enough for a small system landscape with an orgnanization. If the landscape is huge, then you need to re-think about how backup is done. An integration with Oracle RMAN is good for running incremental backup. This will reduce the number of media needed for running daily full online backup - storage optimization.

Brtools for managing Oracle

Following tools are availabe for managing oracle database:

  • BRBACKUP
  • BRARCHIVE
  • BRRESTORE
  • BBRECOVER

BRBACKUP and BRARCHIVE is a command line program. So, it can be easily schedule on your unix command line. The backup are based on the following programs:

  • cpio, dd in a UNIX enviroment
  • MKS-cpio, MKS-dd in Microsoft enviroment
  • External backup program that can be accessed using BACKINT interface program (Networker, TSM etc.)
  • Oracle Recovery Manager (RMAN) on both UNIX & Microsoft platform



All action are logged in the filesystem (sapbackup & saparch folder) and some related tables. Backup logs and profiles are always included in backups performed by BRBACKUP & BRARCHIVE.

BRBACKUP and BRARCHIVE allow extensive volume management. To use the functions provided, the volumes need to be initialized with BRBACKUP and BRARCHIVE to ensure that they include an SAP-specific label. Volumes that have not been released for use cannot be overwritten, if the retention period has not expired.

FYI, brtools is not only can be use in SAP. You can also this tools to manage any other oracle/DB that are not connected to SAP.

BRBACKUP

The BRBACKUP tool allows an online or offline backup of the control file, of data files in individual orall tablespaces and, if necessary, of the online redo log files, as shown in the graphic. BRBACKUP also saves the profiles and logs relevant for the backup.


In addition to the actual backup, BRBACKUP also:

  • changes the state of the database automatically, depending on the type of backup wanted (that is,online or offline)
  • Checks the status of files
  • Optimizes the data distribution on the backup media. The algorithm for distribution is specially adapted to the requirements of a database backup, that is, to backing up a small number of large files. The distribution of data depends on whether you carry out a serial or parallel backup
  • Performs software compression, if the option is selected
  • Saves to hardware compressing tape stations, taking previously determined compression rates into account

The BRCONNECT program makes sure that the database status required for the online or offline backup remains unchanged during the backup. The saving rates largely depend on the number of tape stations in use and the CPU load (particularly when software compression is used).

You can also back up any files or directories you want. However, the backup of a directory is restricted to the files it contains. This enables backups of all SAP objects that do not belong to the database (for example, programs, SAP start profiles, selected logs, and so on).

You can also perform database backups on several disks or remotely connected tape stations.
BRBACKUP also supports Oracle databases on raw devices and Oracle Real Application Cluster
(RAC) configurations.

BRARCHIVE

You can use the BRARCHIVE tool to archive the offline redo log files, that is, the online redo log files saved to the archiving directory by Oracle. For more information, see the graphic. BRARCHIVE also saves all the logs and profiles of the archiving process.

  • Reasons for archiving offline redo log files include the following:
    In the event of a failure, a consistent database status can only be recovered, if all relevant redo log files are available.

  • The database system of a production SAP System has to be operated in the ARCHIVELOG mode to prevent overwriting of unsaved online redo log files. To protect the archive directory against overflowing, it has to be emptied regularly.

  • An online backup of data files is useless if the related redo log files are missing. Therefore, you must archive the offline redo log files generated during the online backup immediately after running BRBACKUP.

For security reasons, BRARCHIVE offers duplicate archiving of offline redo log files (redundant serial or parallel archiving is possible). On the basis of the logs, BRARCHIVE can make sure that redo log files are not deleted before they have been archived and that the same files are archived once or twice.

BRARCHIVE allows the database administrator to continually archive offline redo log files. This means that the archiving directory, where Oracle places the offline redo log files, can be kept free by continually archiving and then deleting saved redo log files.

You can save offline redo log files on local or remote tape or on local or remote disk. Backup on disk is used particularly in the standby database environment.

Initializing tape for BRBACKUP and BRARCHIVE

Initializing Tapes
Tape "initialization" refers to the writing of a label (file with the name .tape.hdr0) to the tape concerned.This label file is read when the tape is checked. If this label file does not exist, the check fails and the tape is rejected.

You have to initialize only new tapes or tapes that were not used by BRBACKUP/BRARCHIVE. Tapes used by older versions of BRBACKUP/BRARCHIVE programs are accepted.You should initialize all your tapes only once according to your backup strategy before the first backup. However, you have to reinitialize a tape if you want to change its name. You cannot change tape names during a backup.

Your tapes should also have paper labels in order to make the tape name immediately visible.

Initialization Procedure
Tapes are initialized using the programs BRBACKUP and BRARCHIVE.All tapes to be used by BRBACKUP/BRARCHIVE for the first time must be initialized.

The following options can be used for initializing tapes:
i = initialize (initialize tape and check expiration period)
i force = initialize force (no check of expiration period)
v = volume (tape name)
n = number (number of tapes to be initialized)

Extract from SAP Note:
Note 13550 - Using BRBACKUP and BRARCHIVE