Thursday, October 30, 2008

Increasing the Speed of Export

Exporting data is a common day to day activity done by most of the DBA's, and when it comes to speeding up the Export jobs these are few tips on it :

• Use Direct Path – Direct path exports (DIRECT=Y) allow the export utility to skip the SQL evaluation buffer, whereas the conventional path export executes SQL SELECT statements. With direct path, the data is read from disk into the buffer cache, returning rows directly to the export client. This can offer substantial performance gains, depending on the actual data. When using the direct path, the recordlength parameter should also be used to optimize performance.

• Use Subsets – By subsetting the data using the QUERY option, the export process is only executed against the data that needs to be exported. If tables have old rows that are never updated, the old data should be exported once, and from that point only the newer data subsets should be exported. Subsets cannot be specified with direct path exports since SQL is necessary to create the subset.

Note: Use a par file for the query as it can help reduce a lot of formatting on the command.

• Use a Larger Buffer – For conventional path exports, a larger buffer will increase the number of rows that are processed between each physical write to the export file. Fewer physical writes equals greater performance. The following formula can be used to determine a proper buffer size:
buffer size = rows in array * max row size

• Separate Tables – Separate those tables that require consistent=y from those that don’t, in order to expedite the export. This way, the performance penalty will only be incurred for those tables that actually require it.
For the table with one million rows, the following benchmark tests were performed using the different export options.

Indexes=No - This will reduce the time taken to export the indexes which is worth creating after the import.

• Set a higher value for the recordlength parameter - Specifies the length of the file record in bytes. This parameter affects the amount of data that accumulates before it is written to disk. The highest value is 64KB.

Friday, October 24, 2008

Backing up OCR and Voting Disk

Backup OCR
============

There are a couple of methods to backup the OCR.

Note: Oracle automatically backs up the OCR every 4 hours.


BAckup can be done using the ocrconfig tool to add a backup location.

ocrconfig -backuploc

Note:This command has to be run as root



A logical backup can be taken using the ocrconfig tool.

ocrconfig -export

a logical backup can only be imported using the ocrconfig tool.

ocrconfig -import



A OCR mirror location can be specified for Oracle 10GR2 using ocrconfig.

ocrconfig -replace ocrmirror



BAckup Voting disk
===================

When raw devices are used for the voting disks, backup on UNIX platform can be taken by dd command


dd if=/dev/rdsk/vot1 of=$ORACLE_HOME/votebackup/