Questions and Answers

Backup and Recovery

?

Both hot and cold backups

6 June 1999

Is there any value in performing both hot and cold backups, rather than just hot backups?
 
? My preference is to make all routine backups hot, even if a large window is available in which to do cold backups as well. There is no recovery advantage in having cold backups as well, and increased risk of an inexperienced DBA getting confused between the two.

In my opinion, cold backups are useful for taking a baseline before and after database changes, and that is about all.

 
 
?

Using dd versus cp for raw backups

15 June 1999

My understanding is that the dd command must be used for backups when working with raw devices on Unix (AIX in this case).

A colleague of mine tried cp (not dd), restored a raw device file, and then successfully brought up the database. Of course, we all insist that he use the dd command, but I admit that I don't know the exact reason for that requirement.

Can you shed some light on this, and why he was able to succeed?

 
? Maybe your colleague used the cp command in recursive mode (-R). In this mode cp just copies the specification of device files by performing a mknod(). It does NOT read or write the contents of the devices. This would give the appearance of a valid backup and restore, but in truth nothing has been done to the datafiles whatsoever.

The cp command can be used to copy the contents of a raw device onto a file within a file system, but it cannot be used to copy back the other way. It is a one way operation. However, beware that on some Unix brands, datafiles copied from raw to file system in this way cannot be used to open the database, because the alignment of the first block will be wrong.

The dd command is the only native Unix facility that can be used to both backup and restore the contents of raw devices. However, there are many third party backup and restore products, such as ADSM, Alexandria, Omniback, and so on, that can do the job too. In my opinion, these solutions are preferable to in-house scripts based on dd.

 
 
?

Spilt blocks during hot backups

6 September 1999

Can you explain about split blocks and the impact of _log_blocks_during_backup = FALSE in online backups?
 
? A "split block" is one that was being written by Oracle at the same time that it was being read for the backup. Say the first SCN on the block was 100, and the write was for SCN 200. Then the backup may contain the first half of the block as at SCN 100, but the second half as at SCN 200.

By default, whole blocks are logged to the redo stream before the first change to any block during backups to allow for the recovery of split blocks. For example, in this case the change would log the entire block as at SCN 100 into the redo stream, followed by the change vectors for the change. Then during recovery roll forward, the whole block can be over-written with the correct image before applying the change vectors.

The flags field in the buffer header for each buffer contains an indication of whether the block has been logged. If the flag is set, the block is not logged for subsequent changes. However, if a buffer is reused, and the block is then read back into the cache for further modification, the whole block will be logged once again prior to such modification.

See the last two paragraphs of the tip Why a Large Database Block Size for comments on the _log_blocks_during_backup parameter.

 
 
?

Can NOLOGGING be disabled?

27 October 1999

Is there any undocumented way of disabling the use of the NOLOGGING feature? We are setting up a Hot Standby system, and want to make sure that NOLOGGING cannot be used.
 
? So far as I am aware, there is no way to do this. But there is an enhancement request already open for it (#651582).
 
 
?

Archiving over NFS

5 November 1999

Is archiving over NFS safe?
 
? Files written and then closed over NFS are not guaranteed to be synced. Therefore, it would be possible for Oracle to complete archiving, close the archived log file, begin to reuse the online log file and then for the NFS server to crash before the final blocks written to that file had been synced. This would leave a hole in your redo stream, which is bad news for any recovery.

Also, beware of using NFS for a secondary archival destination. Under most NFS implementations, if the remote NFS server crashes, ARCn will hang at the next log switch, and eventually so will LGWR and everything else.

 
 
?

Backup and recovery internals

21 December 1999

Have you written anything about the internals of Oracle backup and recovery?
 
? The Oracle Press Backup and Recovery Handbook by Rama Velpuri is the best treatment of Backup and Recovery internals available.
 
 
?

EMC BCVs

30 December 1999

We are considering using EMC's BCV technology to facilitate the hot backups of a 500+G database. What do you think?
 
? The basic idea of splitting mirrors for backups is not new, and certainly not unique to TimeFinder. However, there is no such thing as a free lunch, and the cost in this case is the performance hit on the system when the mirrors have to be re-synced. This is done in the background by the EMC hardware, and only out-of-sync disk tracks need to be copied. So it only affects foreground I/O response time noticeably if a lot of tracks have been changed and if reads cannot be satisfied from cache, or if writes need to be destaged during the attach operation.
 
 
?

Single-task export

26 January 2000

I remember reading somewhere that one can speed up exports by running them in single-task mode. How is this done under Oracle 7.3 on HP-UX?
 
? To perform a single-task export, you must use the expst executable instead of just exp. You will probably need to create the executable first, as follows.
cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk singletask
If you are intending the single-task executables to be used by a user other than oracle, then you will need to set the setuid bits as follows.
chmod 4511 $ORACLE_HOME/bin/*st
 
?

_disable_logging and _wait_for_sync

10 March 2000

I have to create new database in near future and import some data. What is your opinion about setting _disable_logging = TRUE and _wait_for_sync = FALSE to improve the import performance?
 
? Both those hidden parameters are dangerous. If for any reason you ever fail to shutdown the database cleanly while they are set, then you have an almost certain risk of data corruption. However, if you only intend to set them during the build phase, and will take a good baseline backup once they have been removed, then it may be a reasonable calculated risk, depending on your circumstances. My normal technique for speeding up the logging for such imports is to make LGWR a real-time priority process, and to use the singletask import executable. Also, have a look at Connor McDonald's the tip about import speed at http://www.oracledba.co.uk/.
 
 
?

Complete recovery of hot standby

3 April 2000

We are using hot standby for disaster recovery, but looking for something better. The problem is that if we lose the primary site entirely, all the information in the current log file would be lost, because it would not yet have been archived. Do you think it would be possible to set up something to apply changes on the standby as they are made on the primary without needing to wait for a log switch?
 
? All you need is a remote mirror of the online logs to the hot standby server. Some vendors offers this functionality, but you could write something yourself in C. All that it needs to do is read the online log file one block at a time and write the block to a mirror file on the remote server. If at any time it reads a block from the previous use of that log file, it would spin and re-read that block repeatedly until it had been written by LGWR. The only trick is knowing the internal format of the header section at the beginning of each log block, and I can help you with that.
 
? But how do I apply the mirrored online redo log files to the standby database when disaster occurs? I can't find any documentation.
 
? There are several strategies. Have you spoken with Oracle support? What do they recommend?
 
? I called Oracle support, and they claimed that there is no way that you can apply the current online redo log. But I've tested it, and it works to take the standby out of managed recovery mode, recover the standby database, enter the name of the mirrored log file when prompted, and then just open the database.
 
 
Copyright © Ixora Pty Ltd Send Email Home