B
Migration and Compatibility
This Appendix explains the steps that need to be taken to migrate a replication environment from Oracle7 to Oracle8. Topics covered include:
Migration Overview
In some cases you may find it easiest to migrate your environment, particularly the multimaster component of your environment, in one step. Typically, this will only be possible for small configurations. Instead, you may wish to migrate an existing Oracle7 replication environment to Oracle8 incrementally. Replication and administrative operations can be run successfully in a mixed Oracle7 and Oracle8 replication environment.
To successfully interoperate, however, you must observe the following restrictions:
- Oracle8 snapshot sites can only interact with Oracle7 Release 7.3.3 or greater master sites.
- Oracle8 master sites can only interact with Oracle7 Release 7.3.4 or greater snapshot sites and with Oracle7 Release 7.3.3 or greater master sites.
After migrating a master site to Oracle8, perform a full refresh of all of associated snapshot sites.
Downgrading from Oracle8 to Oracle7 is not supported.
Certain Oracle8 replication features require that all sites be successfully migrated to Oracle8 before the features can be used. For example, before you can use primary key snapshots, both the snapshot site and its associated master site must be migrated to Oracle8. The Oracle8 simple snapshots with subqueries feature and the master table reorganization procedures require that you first upgrade from Rowid snapshots to primary key snapshots.
Migration using a full database export from Oracle7 and import to Oracle8 is also supported.
Migrating All Sites at Once
This section describes how to migrate your entire multimaster environment at once to Oracle8. Note that any snapshot sites that you do not also migrate to Oracle8, must be upgraded to Oracle7 Release 7.3.4 or greater.
Follow these steps to migrate all master sites and (optionally) snapshot sites at one time:
- Quiesce the replication environment by executing DBMS_REPCAT. SUSPEND_MASTER_ACTIVITY at the master definition site for all master replication groups, and stopping all propagation and refreshing from snapshot sites to the master, for example, by temporarily suspending or "breaking" entries in the job queue that control automated propagation and refreshing at the snapshot sites. You must also resolve and re-execute any errors in the local error queue until it is empty. For more information see the following sections in Oracle 7 Server Distributed Systems, Volume II: Replicated Data: Chapter 4, "Asynchronous Propagation of DML Changes", and "Suspending Replication Activity", as well as Chapter 7, "Resolving an Error Manually".
- Migrate all master sites using the Oracle7 to Oracle8 Migration Utility and replication CATREP8M.SQL script as documented in Oracle8 Migration.
- Using the Replication Manager setup wizard, create a primary master replication administrator account granting this user Oracle8 Replication Administrator, Propagator, and Receiver privileges on all master sites, and set up the appropriate links connecting all sites. See "Preparing for Multimaster Replication" on page 3-4.
- Using Replication Manager or the replication management API, regenerate replication support for each replication base object. See "Generating Replication Support for Master Group Objects" on page 3-26 for more information. Among other activities, generating replication support will establish the registered propagator as the owner of generated objects
- Using Replication Manager or the replication management API, resume replication activity by unquiescing the environment. See "Resuming Replication Activity for a Master Group" on page 3-19 for more information.
- At a minimum, you must now upgrade all associated snapshot sites to Oracle7 Release 7.3.4. For instructions on migrating your snapshot sites to Oracle8, see "Incremental Migration of Snapshot Sites" on page B-5.
- All snapshots at all snapshot sites will need a full refresh after their master sites have been migrated to Oracle8. Before the refresh, be certain that you have "unbroken" any jobs that you may have "broken" during migration of your snapshot sites by calling the DBMS_JOB.BROKEN procedure.
If your snapshots have been defined with the refresh "FORCE" option, their next attempted refresh will full refresh automatically. Snapshots defined with the refresh "FAST" option will need to be manually refreshed using dbms_refresh.refresh or other refresh procedures.
If you are using procedural replication at snapshot sites, also regenerate snapshot support on all packages and package bodies used for procedural replication.
Note: If you are migrating all of the master's snapshot sites to Oracle8 when the master site is migrated to Oracle8, in other words, you do not need to migrate the snapshot sites incrementally, you can alternatively drop the snapshot logs for the master and recreate them as primary key snapshot logs. The snapshots at each snapshot site should be altered to convert them to primary key snapshots. You can then do a full refresh for each primary key snapshot. See "Upgrading to Primary Key Snapshots" on page B-10 for additional details.
- Drop any administrative accounts and links that you were using to maintain your Oracle7 multimaster replication environment that are not needed in your Oracle8 environment. Unnecessary privileges may also be revoked. Be careful not to drop accounts that are needed to maintain any Oracle7 snapshot sites.
Incremental Migration
It is possible to incrementally migrate your replication environment. However, you must carefully analyze the interdependencies between sites to ensure that they will continue to interoperate throughout your migration. Table B-1 describes the conditions that must be met to allow Oracle7 and Oracle8 replication sites to interoperate.
To avoid interoperability problems within a replication environment, it is strongly recommended that if you must perform an incremental migration that you perform it in the following order:
- Upgrade all of your master sites to Oracle7 Release 7.3.3 or greater and follow the steps in "Preparing Oracle7 Master Sites for Incremental Migration" on page 5 to prepare your Oracle7 master sites for incremental migration.
- Incrementally migrate all snapshot sites to Oracle8.
- Incrementally migrate all master sites to Oracle8.
Preparing Oracle7 Master Sites for Incremental Migration
Before beginning incremental migration of Oracle7 master or snapshot sites, your Oracle7 Release 7.3.3 or greater master sites must be configured so that all replication administration and propagation is done within the security context of a single user at each site. Additionally, this primary master replication administrator must have the same username and password at all Oracle7 and Oracle8 sites. Your Oracle7 master sites may already be configured in this manner. If not, you must complete the following steps:
- Choose a primary master replication administrator for your replication environment. You may select your current replication administrator or create a new user.
- At each master site, grant the required privileges to the primary master replication administrator using both DBMS_REPCAT_ADMIN.GRANT_ADMIN_ANY_REPGROUP and DBMS_REPCAT_AUTH.GRANT_SURROGATE_REPCAT.
- If they do not already exist, you must create the following links for from each master site to all other master sites in the multimaster environment (for a total of 3N(N - 1) links):
- A public database link, created as SYS, that includes a valid global database name, as well as a USING clause with a valid SQL*Net 2.3 TNS alias.
- A private database link, created as SYS, that includes a valid global database name, as well as a CONNECT TO clause with the username and password of the primary master replication administrator.
- A private database link, create as the primary replication administrator, that includes a valid global database name, as well as a CONNECT TO clause with the username and password of the primary master replication administrator.
Incremental Migration of Snapshot Sites
Before you can migrate a snapshot site to Oracle8, its associated master site must have been upgraded to Oracle7 Release 7.3.3 or greater and the master site must have been fully prepared for incremental migration.
To incrementally migrate your Oracle7 snapshot sites to Oracle8, complete the following steps:
- Isolate the snapshot site from the replication environment by stopping all local updates to updatable snapshots at the snapshot site (in a separate session you may lock each snapshot's base table to prevent further transactions). Empty the local deferred transaction queue by pushing the queue to the snapshot's master. For more information refer to the Oracle7 Server Distributed Systems, Volume II: Replicated Data, Chapter 4, "Asynchronous Propagation of DML Changes". Stop all propagation from the snapshot site to its master, for example, by temporarily suspending or "breaking" entries in the job queue that control automated propagation and refreshing at the snapshot sites.
- Run the Oracle7 to Oracle8 Migration Utility and replication CATREP8M.SQL script as documented in Oracle8 Server Migration.
- Use the Replication Manager setup wizard or execute the appropriate replication management API calls to configure the primary snapshot replication administrator as the replication administrator and propagator for the snapshot site, to configure a receiver account at the associated master, and to create the appropriate links to the master. For Oracle7 master sites your receiver at the master site must be the primary master replication administrator that you prepared in the previous section. If you are using the Replication Manager setup wizard select the customize option to specify this receiver.
- Using Replication Manager or the appropriate replication management API calls, regenerate snapshot replication support. See "Regenerating Replication Support for an Updatable Snapshot" on page 4-20 for more information. Among other activities, generating replication support establishes the registered propagator as the owner of generated objects
- Using Replication Manager or the appropriate replication management API calls, reschedule propagation and/or refresh intervals with the master and enable local updates where appropriate. If you used the DBMS_JOB.BROKEN procedure to help isolate your master site in Step 1, you need to "unbreak" your jobs to resume your replication activity from your snapshot sites.
- Drop any administrative accounts and links that you were using to maintain your Oracle7 replication environment that are not needed in your Oracle8 environment. Unnecessary privileges may also be revoked.
Incremental Migration of Master Sites
Before upgrading a master site from Oracle7 to Oracle8, you must meet the following conditions:
To incrementally migrate your Oracle7 master sites to Oracle8, complete the following steps:
- Pick a master site to migrate. You should migrate your master definition site first.
- If you are using procedural replication, record the configuration information and locations (schemas) of existing procedure wrappers. This information will be used later.
- Isolate the master site from the replication environment. To do this you must:
- Stop updates to the master site by either:
calling DBMS_REPCAT.SUSPEND_MASTER_ACTIVITY at the master definition site for all master replication groups,
or by calling DBMS_DEFER_SYS.UNSCHEDULE_EXECUTION (for Oracle7 sites) or DBMS_DEFER_SYS.UNSCHEDULE_PUSH (for Oracle8 sites) at every remote master site and dependent snapshot site, and by preventing update activity at the master site being migrated. You should also refrain from executing any administrative operations at the master definition site that may affect the master site being migrated.
- Resolve and re-execute any errors in the local error queue until it is empty.
- Stop any refreshes of the dependent snapshot sites from occurring by "breaking" entries in the job queue at each snapshot site that control automated propagation and refreshing at the snapshot sites.
- For more information on completing the tasks in Step 1 refer to the following sections in Oracle7 Server Distributed Systems, Volume II: Replicated Data: Chapter 4, "Asynchronous Propagation of DML Changes", "Suspending Replication Activity", "Removing a Master Site from the Deferred Push List", and "Forcing the Deferred Transaction Queue to Push List". Also see Chapter 7, "Resolving an Error Manually".
- Migrate the master site using the Oracle7 to Oracle8 Migration Utility and replication CATREP8M.SQL script as documented in Oracle8 Migration.
- Using the Replication Manager setup wizard or the replication management API, grant your primary master replication administrator Oracle8 Primary Replication Administrator, Propagator, and Receiver privileges for the master site. See "Preparing for Multimaster Replication" on page 3-4 for more information. Database links from the primary replication administrator to the primary master replication administrator at all other Oracle7 and Oracle8 master sites should already exist if you prepared your Oracle 7 master site for compatibility with Oracle8 using the directions in "Preparing Oracle7 Master Sites for Incremental Migration" on page B-5.
- If you are not already in a quiesced state, use Replication Manager or the replication management API to suspend all replication activity for all master groups. See "Suspending Replication Activity for a Master Group" on page 3-17 for more information.
- Using Replication Manager or the replication management API, regenerate replication support for each replicated object. See "Generating Replication Support for Master Group Objects" on page 3-26 for more information. If any sites in the replication environment are still running Oracle7, you must set the "min_communication" parameter to FALSE. The "min_communication" parameter should only be set to TRUE (the default) once all sites have been migrated to Oracle8. For more information, see "Minimizing Data Propagation for Update Conflict Resolution" on page 5-40. Among other activities, generating replication support will establish the registered propagator as the owner of generated objects
- If you are using procedural replication, check your remaining Oracle7 master sites to determine whether the wrappers have been moved (list created from Step 2). If they have been moved, create a synonym in their old location (in the schema of either the replication administrator or the table owner, depending on whether the site previously used the system-based or user-based model) pointing to the new location in the schema of the primary replication administrator. Confirm necessary object privileges have been granted to access the new owner and locations. If you are also using procedural replication at snapshot sites, regenerate snapshot support on all packages and package bodies used for procedural replication.
- Using Replication Manager or the replication management API, resume replication activity and unquiesce the environment for each master group. See "Resuming Replication Activity for a Master Group" on page 3-19 for more information. If you have isolated the master by unscheduling propagation to other masters and from other masters then reschedule propagation by executing DBMS_DEFER_SYS.SCHEDULE_EXECUTION (for Oracle7 sites) or following the instructions in"Editing a Scheduled Link" on page 3-11(for Oracle8 sites) for all master sites.
- All snapshots at both Oracle7 and Oracle8 snapshot sites will need a full refresh after their master site has been migrated to Oracle8. Because of the new Oracle8 rowid format, the Oracle7 to Oracle8 migration utility truncates all master snapshot logs. If you used the DBMS_JOB.BROKEN procedure to help isolate you master site in Step 3, "unbreak" your jobs to resume your replication activity from your snapshot sites.
If your snapshots have been defined with the refresh "FORCE" option, their next attempted refresh will full refresh automatically. Snapshots defined with the refresh "FAST" option will need to be manually refreshed using dbms_refresh.refresh or other refresh procedures.
Note: If you are able to migrate all of the master's snapshot sites to Oracle8 when the master site is migrated to Oracle8, (that is, you do not need to migrate the snapshot sites incrementally) you can alternatively drop the snapshot logs for the master and recreate them as primary key snapshot logs. The snapshots at each snapshot site should be altered to convert them to primary key snapshots. You can then do a full refresh for each primary key snapshot. See "Upgrading to Primary Key Snapshots" on page B-10 for additional details.
- Drop any administrative accounts and links that you were using to maintain your Oracle7 multimaster replication environment that are not needed in your Oracle8 environment. Unnecessary privileges may also be revoked. Be careful not to drop accounts that are needed to maintain any Oracle7 snapshot sites or master sites.
Migration Using Export/ Import
Full database export from Oracle7 Release 7.3.3 or greater and import to Oracle8 is supported for both masters and snapshots. You may use export/import as an alternative to the Oracle7 to Oracle8 Migration Utility and replication CATREP8M.SQL script in the procedures described above. Be sure that you follow all the steps, both before and after the actual migration from Oracle7 to Oracle8, in the above procedures however.
To export a full database from Oracle7 Release 7.3.3 or greater and import to Oracle8, follow these steps:
- Export the Oracle7 Release 7.3.3 or greater database to a dump file using the Release 7.3 export utility under the SYSTEM schema with FULL=y.
- Start up an Oracle8 database with advanced replication installed. Connect as SYSTEM and execute DBMS_REPCAT_MIG.PRE_IMPORT. This procedure temporarily disables referential constraints on the replication data dictionary tables.
- Import the dump file to the Oracle8 database using the Oracle8 import utility under the SYSTEM schema with FULL=y. The referential constraints on the replication data dictionary tables will be automatically enabled.
You may also export data from individual Oracle7 tables, import the data to Oracle8 tables, and then configure those tables as masters in an Oracle8 replication environment using standard advanced replication procedures.
See the Oracle8 Utilities reference guide for more information.
Upgrading to Primary Key Snapshots
Once a snapshot site and its master have been migrated to Oracle8, you can upgrade your rowid snapshots to Oracle8 primary key snapshots. To do this you must first alter the snapshot logs for each master table to log primary key information, as well as rowid information, when master rows are updated. Once this is completed at your master site(s), you can incrementally convert your Oracle8 snapshots sites by altering the snapshots to convert them to primary key snapshots. Oracle8 masters that have been altered to log primary key as well as rowid information can support Oracle7 rowid snapshots as well as Oracle8 rowid and primary key snapshots simultaneously to allow for incremental migration.
Note: A primary key snapshot cannot be converted or downgraded to a rowid snapshot.
Primary Key Snapshots Conversion at Master Site(s)
To support primary key snapshots, do the following at the Oracle8 master site:
- Define and enable a primary key constraint on each master table that does not already have a primary key constraint enabled.
- Alter the snapshot log for each master table supporting fast refresh to include primary key information using the ALTER SNAPSHOT LOG command. See ALTER SNAPSHOT LOG in the Oracle8 SQL Reference manual for additional information.
Note: If the above conditions are not met an error will be raised when you execute the ALTER SNAPSHOT command at the snapshot sites to convert to primary key snapshots.
Primary Key Snapshot Conversion at Snapshot Site(s)
After the Oracle8 master site has been configured to support primary key snapshots, do the following at the Oracle8 snapshot sites:
- Isolate the snapshot site from the replication environment by stopping all local updates to updatable snapshots at the snapshot site.
- If any read-only ROWID snapshots being converted to primary key snapshots do not include all the columns of the primary key, drop and recreate them with all the primary key columns. See "Creating Simple Snapshots" on page 2-10 for more information.
Note: Constraints should not be defined on Rowid snapshots.
- Perform a fast refresh of all snapshots to remove the need for any remaining rowid references in the master snapshot log.
- Use the ALTER SNAPSHOT command to convert rowid snapshots to primary key snapshots. For complete syntax information, see the book Oracle8 SQL Reference.
- Resume replication by rescheduling propagation and/or snapshot refresh with the master, enabling local updates where appropriate. If you used the DBMS_JOB.BROKEN procedure to help isolate you master site in Step 1, you need to "unbreak" your jobs to resume your replication activity from your snapshot sites.
Features Requiring Migration to Oracle8
The following features require that all the sites involved be successfully migrated to Oracle8:
- Replication of LOB data types.
- Reduced data propagation.
- Use the min_communication parameter and,
- the send_and_compare_old_values procedure.
- Parallel propagation of deferred transactions.
- Global authentication and privileged database links.
- Validate procedure.
Additional Information: See Appendix A, "New Features".
The following features require that all the sites involved must be successfully migrated to Oracle8 and primary key snapshots:
- Simple snapshots with subqueries.
- Master table reorganization procedures.
The following features will automatically work in mixed Oracle7 and Oracle8 environments, but only affect Oracle8 sites:
- Fine grained quiesce.
- Snapshot registration.
Note: All master groups at Oracle7 sites will be quiesced if any master group at that site is quiesced.
Note: Oracle7 snapshots will not be automatically registered at Oracle8 sites but can be manually registered using the DBMS_SNAPSHOT.REGISTER_ SNAPSHOT and DBMS_SNAPSHOT.UNREGISTER_SNAPSHOT procedures at the master site(s). See "Registering a Snapshot at its Master Site" on page 2-35 for more information.
Obsolete procedures
Procedures that are obsoleted in Oracle8 include:
DBMS_REPCAT_ADMIN.GRANT_ADMIN_REPGROUP
DBMS_REPCAT_ADMIN.GRANT_ADMIN_ANY_REPGROUP
DBMS_REPCAT_ADMIN.REVOKE_ADMIN_REPGROUP
DBMS_REPCAT_ADMIN.REVOKE_ADMIN_ANY_REPGROUP
DBMS_REPCAT_AUTH.GRANT_SURROGATE_REPCAT
DBMS_REPCAT_AUTH.REVOKE_SURROGATE_REPCAT
DBMS_DEFER_SYS.EXECUTE