Pages

Download SAP Certification Material for FREE @ http://sap-ebooks-den.blogspot.com

Thursday, April 3, 2008

Database Backups

Database and Offline Redo Log File Backups

 Each database management system stores data in suitable structures on disk and writes data modifications to the database log. For the Oracle RDBMS:
 The data is stored in the data files of the tablespaces.
 The log information is recorded in the currently active online redo log file.
 Administration data is stored in the parameter and control files.
 The data files, the online redo log files, profiles, and a control file are backed up during a database backup.
 When the currently active online redo log file is full, Oracle automatically writes to the next online redo log file. The Oracle Archiver copies the completed online redo log file to the archive directory. The copy is called the offline redo log file. The offline redo log files are backed up during an offline redo log file
backup.
 In the event of data loss, you need to recover the database to a point in time as close as possible to the moment of loss. To ensure that you can do this, you need both database and offline redo log file backups.
To perform a restore, use a backup of the data files (or a part of the backup) for the starting point.
 The log information that was generated during and after the database backup is used to recover all modifications that were made to the data. Usually, this log information is retrieved from the offline redo log file backups.

Offline Backups

When an offline backup is performed, the database is shut down and remains unavailable while the backup is running. The work processes receive a return code of class "reconnect" from the database.
 Set the R/3 parameters:
 rsdb/reco_trials = n, where n = no. of times the work processes attempt to connect to the database.
 rsdb/reco_sleep_time = m, where m = no. of seconds the work processes sleeps between attempts.
 Although the R/3 System is set up to remain online throughout the backup, the R/3 System is not available to users. The R/3 System remains online to preserve the R/3 buffer contents, for performance reasons.
 Because the Oracle data files remain unchanged, a full offline backup is Consistent.
 The following files are backed up when an offline backup is performed:
 The data files of all tablespaces belonging to the database
 The online redo log files
 The control file
 The profiles init.ora, init.sap, and init.dba
 When the offline backup is finished, you must back up the offline redo log files.



Online Backups

 During an online backup, the Oracle database and the R/3 System remain available. Online backups cause a small reduction in system performance.
 The following files are backed up when an online backup is performed:
 The data files of all tablespaces belonging to the Oracle database
 The control file
 The profiles init.ora, init.sap, and init.dba
 Caution: Because the data files are updated concurrently, online backups are not consistent. An online backup can only be consistent and usable in conjunction with the log information written during the online backup.
 After an online backup is finished, the SAP tool BRBACKUP switches to a new online redo log file and the Oracle archiver copies the previously active online redo log file to the directory saparch. The entire log information generated during the online backup is contained in the offline redo log files.
Back up the offline redo log files when the online backup has finished.
 When you perform an online backup, you do not need to back up the online redo log files.



Offline Redo Log File Backups

Offline redo log files are copies of online redo log files which have been saved by the Oracle archiver to directory saparch. Online redo log files are cyclically overwritten.
 Log information is constantly generated when database data is modified. Therefore, disk space in the archive directory must be continuously released for new log files. When the archiver is unable to write to the directory specified by the parameter log_archive_dest, Oracle reports error 257: Archiver is stuck or
error 255: Error archiving log, and the database becomes stuck. An error message is then written to the Oracle trace files.
 In the case of a restore, if any of the required offline redo log files do not have a valid backup, data loss occurs. You must back up the the offline redo log files before you delete them from the archive directory. For security reasons, back up 2 copies of each offline redo log file on separate tapes.
 If there are database changes that are not contained in the latest redo log file backup, then, in the case of a database failure, you may be unable to recover all the changes.
 An online backup is useless without the log information that was generated during the database backup.


SAP BACKUP TOOLS

Database backups are performed by the SAP tool BRBACKUP.
 Offline redo log file backups are performed by the SAP tool BRARCHIVE.
 There are three ways to call these tools:
 Using the DBA Planning Calendar (transaction DB13)
 Using the SAP database administration tool SAPDBA at operating system level
 Directly, at the operating system level
 SAP recommends the following procedure:
 Schedule all regular backups with the DBA Planning Calendar (transaction DB13)
 Perform additional backups with SAPDBA
 All the steps of a backup are logged to operating system files and in database tables.


Backup Profile Parameters for Tape Initialization

 The profile init.sap is used to set the following parameters:
 tape_use_count defines how often a tape can be reused.
 expir_period defines the length of the backup cycle. To allow the tape to be reused after 28 days, set this parameter to 28.
 backup_dev_type defines the type of backup device used. To perform backups to a local tape device,enter tape. Other options include pipe (remote), tape_auto (auto loader), util_file (backint interface),and disk.
 volume_backup defines the tape pool for the database backups
 volume_archive defines the tape pool for the offline redo log file backups


Profile Parameters for Database Backup
 Use the following init.sap parameters to set up program BRBACKUP:
 Set parameter backup_mode to all in order to perform a complete database backup
 backup_type defines whether the backup is online or offline
 tape_size defines the physical tape size for tapes used by BRBACKUP. Specify the size of the smallest tape in your tape pool (in MB). For example, specify 32000M for a 70 GB tape. The valuespecified for this parameter must be equal to the amount of uncompressed data the tape can hold.
 When data is backed up sequentially to several tapes and only one tape device is available, BRBACKUP requests the tapes in the order defined by the parameter volume_backup.
 Both rewind and no-rewind tape drivers are required by the SAP backup tools. A no-rewind driver must be assigned to parameter tape_address, and a rewind driver to parameter tape_address_rew.


Profile Parameters for Offline Redo Log Backup
Use the following init.sap parameters to set up program BRARCHIVE:
 Set parameter archive_function to - cds (copy_delete_save). This ensures that two copies of one offline redo log file are backed up to different tapes.
Option -cds (copy_delete_save):
- Creates a second backup of the oldest offline redo log files already backed up once
- Deletes the offline redo log files that have been backed up twice from the archive directory, in order to free disk space
- Backs up all new offline redo log files for the first time
 tape_size_arch defines the physical tape size for tapes used by BRARCHIVE. Specify the size of the smallest tape in your tape pool (in MB). For example, specify 6000M for a 6 GB tape.
 tape_address_arch and tape_address_rew_arch specify the drivers of the tape devices to be used by BRARCHIVE to perform the offline redo log file backup. If they are not defined, BRARCHIVE uses parameters tape_address and tape_address_rew to determine the drivers.

REFERENCE : BC505 Oracle Database Administration

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...