In case you are planning to upgrade an existing database, Oracle provides a tool called Database Upgrade Assistant (DBUA). It interactively steps you through the upgrade process and configures the database for the new Oracle Database 10g release.
It can be invoked by the dbua command from the UNIX/Linux prompts or from Database Migration Assistant under Configuration and Migration Tools in a Windows environment. The DBUA shows a list of databases and prompts you to choose. After you choose a database for upgrade, it gathers database details (see Figure 2.6). DBUA will also interactively verify whether the database is backed up and start the upgrade process. Please see Oracle Database Upgrade Guide for more details.
Because upgrading a single standalone database to 10g is much simpler than upgrading an environment where there is a primary database and one or more standby databases, we will focus our discussion on standby databases. Most organizations run Oracle 9i Data Guard environment for standby environments (logical or physical). If there are multiple standby databases in your (Data Guard) environment, you have to do the upgrade process discussed next for each standby database.
The preliminary things to be done before any upgrade are checking for nologging operations on standby databases and the recovery of tablespaces or datafiles brought offline.
The common steps in any database-upgrade process for standby configuration are as follows:
1. | Install the new Oracle database release on production (primary) site(s), apply redo logs to standby databases, and complete the upgrade on primary database as per instructions. |
2. | After upgrading the primary, switch log files to archive any remaining redo logs. |
3. | Copy archive logs on the upgraded primary site to the archive destination on the standby host. |
4. | Shut down the standby database and related processes (listener and so on). |
5. | Start and mount the standby database. |
6. | Keep the standby database in managed recovery mode. Apply the archive logs created during the upgrade process. |
7. | Ensure that the standby database has recovered up to the last (copied) log from primary. Update archive log gaps between the primary and the standby. |
8. | Restart remote archiving on the primary database. |
9. | Place the standby database back into the recovery state. |
The following sections look at more details of upgrading a physical standby and a logical standby configuration.
Database Upgrade Assistant (DBUA) can be invoked in silent mode similar to in silent installation. For this, use the –silent option along with dbua command from the command line. In silent mode, you will not see any user interface; check for the upgrade status (messages, alerts, errors, and so on) from the log file. See the Oracle Database Upgrade Guide for more details.
A Word on the Oracle Companion CD and PatchesFor any Oracle Database 10g installation during upgrade process, install the software into a new ORACLE_HOME using Oracle Universal Installer as explained earlier in this chapter. Download the companion CD, extract it, and do a similar installation using OUI. Do not forget to apply any available patches for the version of the Oracle software and platform you are working with. |
Now that you have learned about the Database Upgrade Assistant, we will briefly discuss the upgrade path from an Oracle 9i database in a Data Guard configuration. For more details and SQL commands involved in each step, refer to Oracle Data Guard Broker 10g Guide, Oracle Database Upgrade Guide10g, and MetaLink Note #278521.1.
This section discusses the upgrade path from Oracle 9i database in a logical standby Data Guard configuration. For more details and SQL commands involved, refer to Oracle Data Guard Broker 10g Guide, Oracle Database Upgrade Guide10g, and MetaLink Note #278108.1. Please note that only important SQL commands are given here; we assume that you are familiar with common database-administration tasks.
1. | Log in to the primary and standby databases on separate windows as oracle or as the owner of the Oracle software directory. Set the environment to the existing 9.2.0 installation. |
2. | On the primary database, stop all user activity. If you are using RAC, shut down (normal or immediate) every instance except the primary database instance. |
3. | On the active database instance, archive the current log file: SQL> alter system archive log current; |
4. | On the active primary database instance, note the current log thread number and sequence number: SQL> select thread#, sequence# from v$log where status='CURRENT'; |
5. | Archive the current log: SQL> alter system archive log current; |
6. | If you are using RAC, shut down all other instances cleanly (normal or immediate) except this standby database instance. |
7. | |
8. | Stop the SQL apply operations on this standby database: SQL> alter database stop logical standby apply; |
9. | Shut down the standby database and stop all agents and listeners against the 9i installation. |
10. | Shut down the active primary database instance cleanly (normal or immediate). Stop the Oracle processes running against the ORACLE_HOME. |
11. | On the primary host, install 10.1.0.2 into a new ORACLE_HOME using OUI as explained earlier in this chapter. Don't forget to install Oracle companion CD and patches, if any. |
12. | After 10g is installed, with the environment still set to the 9.2 installation, start up the primary database and disable remote archiving: SQL> startup migrate; SQL> alter system set log_archive_dest_state_2=defer scope=both; |
13. | From the 10.1.0.2 ORACLE_HOME, start the Database Upgrade Assistant and upgrade the primary database. |
14. | When the upgrade process has been completed on the primary database, point your environment to the new 10g installation, shut down the primary database instance, and restart the agent and listener. |
15. | |
16. | Disable the restricted session and archive the current log file: SQL> alter system disable restricted session; SQL> alter system archive log current; |
17. | Execute the following scripts to get the name of the latest dictionary build log file (file_name.arc). Note the name of the log file for later reference. SQL> select name from v$archived_log where (sequence#=(select max(sequence#) from v$archived_log where dictionary_begin = 'YES' and standby_dest= 'NO')); |
18. | On the standby host, install 10.1.0.2 into a new ORACLE_HOME home. With the environment still set to Oracle 9i, start up the logical standby database, activate it, and disable remote archiving: SQL> startup migrate; SQL> alter database activate logical standby database; SQL> alter system set log_archive_dest_state_2=defer scope=both; |
19. | |
20. | Copy the latest dictionary build log file from the primary system to the standby system. Start the logical standby database instance. Turn on the database guard to prevent all users from updating any objects: SQL> startup mount; SQL> alter database guard all; SQL> alter database open; |
21. | Register the copied log file on the logical standby: SQL> alter database register logical logfile 'file_name.arc'; |
22. | Begin SQL apply operations on the standby database. On a RAC setup, you can start the remaining standby database instances: SQL> alter database start logical standby apply initial; |
23. | Begin remote archiving on the primary database. On a RAC setup, you can start the remaining primary database instances: SQL> alter system set log_archive_dest_state_2=enable; |
24. |
3.148.107.255