Question by Ben Pruzinski:
I am looking for a method that would minimize server downtime while performing a
database upgrade from Oracle 9i to Oracle 10g. We cannot use Data Guard due to
licensing costs. Which is better method to use, Streams for Oracle9i or advanced
replication for minimal downtime during upgrades?
If you are staying on the same server, you can
upgrade from 9i to 10g with about 5 minutes of downtime.
To do this, you will be using transportable tablespaces. The only requirement is
that all your tablespaces are locally managed. The idea is simple.
1) Install Oracle 10g to a separate Oracle
Home on the same server
2) Create a 10g database with only the base tablespaces: SYSTEM, SYSAUX,
UNDO, and TEMP
3) On the 9i database, put all your tablespaces into read only mode (write
downtime begins)
4) Perform a transportable tablespace export of all non-system tablespaces
(as a sysdba user)
5) Shut down the 9i database (true downtime begins)
6) Start up the 10g database
7) Perform a transportable tablespace import into the 10g database (end true
downtime)
8) Make all your tablespaces read/write (end write downtime)
This works from 9i to 10g because 10g
datafiles are version aware. When you do the transportable tablespace export
from 9i, all you are doing is dumping the datafile metadata to a dump file. When
you import it to 10g, all you are doing is plugging in where to find the
datafiles. Oracle 10g looks at the datafile headers, realizes that they're 9i,
and changes the header to be 10g. Since the 10g database already has SYSTEM,
SYSAUX, UNDO, and TEMP, there's no downtime doing pesky data dictionary
upgrades.
If you pre-script it all out, you can do all this with only about 5 minutes of
downtime!
By the way, Dataguard's physical backups are a GREAT DR situation for a failed
upgrade. You will have an exact physical copy of your database ready to
switchover to if anything goes wrong with the upgrade. Basically you switch your
final archive log and shut down your primary, then begin the standard upgrade.
If something goes wrong, you can perform a failover on your standby server and
you're back up with no possibility of inconsistencies since it's a physical
backup. In my opinion, the only method better than DataGuard for a backup for
upgrade scenario would be to use SAN tools like NetApp's snapMirror or Sun's
Availability Suite in order to back it up; these tools can snapshot a DB in a
matter of seconds and are good for this sort of situation: if the upgrade goes
wrong, simply restore the snapshot.
If you do it right, you can set up dataguard with only 5 minutes of downtime,
then perform your database upgrade with only 5 minutes of downtime. I have done
this method for clients in the past and they have been very happy with the
results.