Oracle9i Advanced Replication Release 2 (9.2) Part Number A96567-01 |
|
Before you begin to plan your replication environment, it is important to understand the replication concepts and architecture described in the previous chapters of this book. After you understand replication concepts and architecture, this chapter presents important considerations for planning a replication environment.
This chapter contains these topics:
The following sections discuss considerations for tables you plan to use in a replication environment.
If possible, each replicated table should have a primary key. Where a primary key is not possible, each replicated table must have a set of columns that can be used as a unique identifier for each row of the table. If the tables that you plan to use in your replication environment do not have a primary key or a set of unique columns, then alter these tables accordingly. In addition, if you plan to create any primary key materialized views based on a master table or master materialized view, then that master must have a primary key.
When replicating tables with foreign key referential constraints, Oracle Corporation recommends that you always index foreign key columns and replicate these indexes, unless no updates and deletes are allowed in the parent table. Indexes are not replicated automatically. To replicate an index, add it to the master group containing its table using either the Replication Management tool or the CREATE_MASTER_REPOBJECT
procedure in the DBMS_REPCAT
package.
Advanced Replication supports the replication of tables and materialized views with columns that use the following datatypes:
VARCHAR2
NVARCHAR2
NUMBER
DATE
TIMESTAMP
TIMESTAMP
WITH
TIME
ZONE
TIMESTAMP
LOCAL
TIME
ZONE
INTERVAL
YEAR
TO
MONTH
INTERVAL
DAY
TO
SECOND
RAW
ROWID
CHAR
NCHAR
Oracle also supports the replication of tables and materialized views with columns that use the following large object types:
The deferred and synchronous remote procedure call mechanism used for multimaster replication propagates only the piece-wise changes to the supported LOB datatypes when piece-wise updates and appends are applied to these LOB columns. Also, you cannot reference LOB columns in a WHERE
clause of a materialized view's defining query.
You can replicate tables and materialized views that use user-defined types, including column objects, object tables, REF
s, varrays, and nested tables.
Oracle does not support the replication of columns that use the LONG
and LONG
RAW
datatypes. Oracle simply omits columns containing these datatypes from replicated tables. You should convert LONG
datatypes to LOBs.
Oracle also does not support the replication of external or file-based LOBs (BFILE
s). Attempts to configure tables containing columns of this datatype as master tables return an error message.
Oracle also does not support the replication of UROWID
columns in master tables or updatable materialized views. However, UROWID
columns are allowed in read-only materialized views.
Note: Oracle does not support replication of LOB datatypes in replication environments where some sites are running Oracle7 release 7.3. |
See Also:
|
When you create a table, you can specify the following options for tracking system change numbers (SCN)s:
NOROWDEPENDENCIES
, the default, specifies that the SCN is tracked at the data block level.ROWDEPENDENCIES
specifies that the SCN is tracked for each row in the table.Using the ROWDEPENDENCIES
option improves performance and scalability when using parallel propagation, but this option also requires six bytes of additional storage space for each row.
The following SQL statement creates a table with the ROWDEPENDENCIES
option:
CREATE TABLE order_items (order_id NUMBER(12), line_item_id NUMBER(3) NOT NULL, product_id NUMBER(6) NOT NULL, unit_price NUMBER(8,2), quantity NUMBER(8) ) ROWDEPENDENCIES;
Oracle tracks the SCN for each row in this order_items
table. You can also use the ROWDEPENDENCIES
option in a CREATE
CLUSTER
statement if your tables are part of a cluster.
See Also:
"Data Propagation Dependency Maintenance" for more information about the |
Table 6-1 lists initialization parameters that are important for the operation, reliability, and performance of a replication environment.
See Also:
Oracle9i Database Reference for more information about these initialization parameters |
Parameter | Values | Description | Recommendation |
---|---|---|---|
COMPATIBLE |
Default: 8.1.0 Range: 8.1.0 to Current Release Number |
Lets you use a new release, while at the same time guaranteeing backward compatibility with an earlier release. This ability is helpful in case it becomes necessary to revert to the earlier release. This parameter specifies the release with which the Oracle server must maintain compatibility. Oracle servers with different compatibility levels can interoperate. |
If you want to use any of the new replication features available in Oracle9i, then set this parameter to 9.0.1 or higher. |
GLOBAL_NAMES |
Default: false Range: true or false |
Specifies whether a database link is required to have the same name as the database to which it connects. |
|
JOB_QUEUE_PROCESSES |
Default: 0 Range: 0 to 1000 |
Specifies the number of Jn job queue processes for each instance ( When You can change the setting for |
This parameter should be set to at least 1, and should be set to the same value as the maximum number of jobs that can run simultaneously plus one. |
OPEN_LINKS |
Default: 4 Range: 0 to 255 |
Specifies the maximum number of concurrent open connections to remote databases in one session. These connections include the schema objects called database links, as well as external procedures and cartridges, each of which uses a separate process. |
If you are using synchronous replication, |
PARALLEL_AUTOMATIC_TUNING |
Range: true or false |
When set to |
See Oracle9i Database Reference and Oracle9i Database Migration for details about using this initialization parameter. |
PARALLEL_MAX_SERVERS |
Default: Derived from the values of the following parameters:
Range: 0 to 3599 |
Specifies the maximum number of parallel execution processes and parallel recovery processes for an instance. As demand increases, Oracle will increase the number of processes from the number created at instance startup up to this value. |
If you use parallel propagation, then make sure the value of this parameter is set high enough to support it. |
PARALLEL_MIN_SERVERS |
Default: 0 Range: 0 to Value of PARALLEL_MAX_SERVERS |
Specifies the minimum number of parallel execution processes for the instance. This value is the number of parallel execution processes Oracle creates when the instance is started. |
If you use parallel propagation, then make sure you have at least one process for each stream. |
PROCESSES |
Default: Derived from PARALLEL_MAX_SERVERS Range: 6 to operating system dependent limit |
Specifies the maximum number of operating system user processes that can simultaneously connect to Oracle. |
Make sure the value of this parameter allows for all background processes, such as locks, job queue processes, and parallel execution processes. |
REPLICATION_DEPENDENCY_TRACKING |
Default: true Range: true or false |
Enables or disables dependency tracking for read/write operations to the database. Dependency tracking is essential for propagating changes in a replication environment in parallel.
|
Typically, specify |
SHARED_POOL_SIZE |
Default: 16 MB (64 MB if 64 bit) Range: 300 KB to Operating System Dependent Limit |
Specifies in bytes the size of the shared pool. The shared pool contains shared cursors, stored procedures, control structures, and other structures. Larger values improve performance in multiuser systems. Smaller values use less memory. |
Typically, the shared pool should be larger for an Oracle server in a replication environment than in a non-replication environment. You can monitor utilization of the shared pool by querying the view |
UTL_FILE_DIR |
Default: None Range: Any valid directory path. |
Specifies the default location for generated files. These files may be generated by the Replication Management tool or by the replication management API. For example, an offline instantiation file for a deployment template can be placed in the directory specified by this initialization parameter. |
Specify a valid directory. |
When you are planning your replication environment, you need to decide whether the sites participating in the replication environment will be master sites or materialized view sites. Consider the characteristics and advantages of both types of replication sites when you are deciding whether a particular site in your replication environment should be a master site or a materialized view site. One replication environment can support both master sites and materialized view sites.
Master Sites | Materialized View Sites |
---|---|
Master sites have the following advantages:
To set up a master site, use either the Replication Management tool's Setup Wizard or the replication management API.
See Also:
|
Materialized view sites have the following advantages:
To set up a materialized view site, you can use either the Replication Management tool's Setup Wizard or the replication management API.
See Also:
|
Most problems encountered with materialized view replication result from not preparing the environment properly. There are four essential tasks that you must perform before you begin creating your materialized view environment:
The Replication Management tool's Setup Wizard automatically performs these tasks. The following discussion is provided to help you understand the replication environment and to help those who use the replication management API. After running Setup Wizard, create the necessary materialized view logs. See the Replication Management tool's online help for instructions on using tool to set up your materialized view site.
If you are not able to use the Replication Management tool, then review the "Set Up Materialized View Sites" section in Chapter 2 of the Oracle9i Replication Management API Reference for detailed instructions on setting up your materialized view site using the replication management API.
The following sections describe what the Replication Management tool's Setup Wizard or the script in the Oracle9i Replication Management API Reference does to set up your materialized view site.
Each materialized view site needs several users to perform the administrative and refreshing activities at the materialized view site. You must create and grant the necessary privileges to the materialized view administrator and to the refresher.
You need equivalent proxy users at the target master site to perform tasks on behalf of the materialized view site users. Usually, a proxy materialized view administrator and a proxy refresher are created.
A schema containing a materialized view in a remote database must correspond to the schema that contains the master table in the master database. Therefore, identify the schemas that contain the master tables that you want to replicate with materialized views. After you have identified the target schemas at the master database, create the corresponding accounts with the same names at the remote database. For example, if all master tables are in the sales
schema of the ny.world
database, then create a corresponding sales
schema in the materialized view database sf.world
.
See Also:
If you are reviewing the steps in Oracle9i Replication Management API Reference, then the necessary schemas are created as part of the script described in the instructions for creating a materialized view group |
The defining query of a materialized view may use one or more database links to reference remote table data. Before creating materialized views, the database links you plan to use must be available. Furthermore, the account that a database link uses to access a remote database defines the security context under which Oracle creates and subsequently refreshes a materialized view.
To ensure proper behavior, a materialized view's defining query must use a database link that includes an embedded user name and password in its definition; you cannot use a public database link when creating a materialized view. A database link with an embedded name and password always establishes connections to the remote database using the specified account. Additionally, the remote account that the link uses must have the SELECT
privileges necessary to access the data referenced in the materialized view's defining query.
Before creating your materialized views, you need to create several administrative database links. Specifically, you should create a PUBLIC
database link from the materialized view site to the master site. Doing so makes defining your private database links easier because you do not need to include the USING
clause in each link. You also need private database links from the materialized view administrator to the proxy administrator and from the propagator to the receiver, but, if you use the Replication Management tool's Setup Wizard, then these database links are created for you automatically.
See Also:
The information about security options in Oracle9i Replication Management API Reference for more information |
After the administrative database links have been created, a private database link must be created connecting each replicated materialized view schema at the materialized view database to the corresponding schema at the master database. Be sure to embed the associated master database account information in each private database link at the materialized view database. For example, the hr
schema at a materialized view database should have a private database link to the master database that connects using the hr
username and password.
See Also:
Oracle9i Database Administrator's Guide for more information about database links |
Both the creator and the owner of the materialized view must be able to issue the defining SELECT
statement of the materialized view. The owner is the schema that contains the materialized view. If a user other than the replication or materialized view administrator creates the materialized view, then that user must have the CREATE
MATERIALIZED
VIEW
privilege and the appropriate SELECT
privileges to execute the defining SELECT
statement.
See Also:
If you are reviewing the steps in Oracle9i Replication Management API Reference, then the necessary privileges are granted as part of the script described in instructions for creating a materialized view group. Privilege requirements are also described in "Required Privileges for Materialized View Operations" |
To keep the size of the deferred transaction queues in check, schedule a purge operation to remove all successfully completed deferred transactions from the deferred transaction queue. This operation may have already been performed at the master site. Scheduling the purge operation again does not harm the master site, but may change the purge scheduling characteristics.
Scheduling a push at the materialized view site automatically propagates the deferred transactions at the materialized view site to the associated target master site using a database link. These types of database links are called scheduled links. Typically, there is only a single scheduled link for each materialized view group at a materialized view site, because a materialized view group only has a single target master site.
It is important that you have allocated sufficient job queue processes to handle the automation of your replication environment. The job queue processes automatically propagate the deferred transaction queue, purge the deferred transaction queue, refresh materialized views, and so on.
For multimaster replication, each site has a scheduled link to each of the other master sites. For example, if you have six master sites, then each site has scheduled links to the other five sites. You typically need one process for each scheduled link. You may also want to add additional job processes for purging the deferred transaction queue and other user-defined jobs.
By the nature of materialized view replication, each materialized view site typically has one scheduled link to the master database and requires at least one job process. Materialized view sites typically require between one and three job processes, depending on purge scheduling, user-defined jobs, and the scheduled link. Also, you need at least one job queue process for each degree of parallelism.
Alternatively, if your users are responsible for manually refreshing the materialized view through an application interface, then you do not need to create a scheduled link and your materialized view site requires one less job process.
The job queue processes are defined using the JOB_QUEUE_PROCESSES
initialization parameter in the initialization parameter file for your database. You can set up your job queue processes in any of the following ways:
Oracle automatically determines the interval for job queue processes. That is, Oracle determines when the job queue processes should "wake up" to execute jobs.
See Also:
"Initialization Parameters" and the Oracle9i Database Reference for information about |
The JOB_QUEUE_PROCESSES
initialization parameter is dynamic. Therefore, it can be modified using the ALTER
SYSTEM
command while an instance is running.
The following statement dynamically sets JOB_QUEUE_PROCESSES
to 50:
ALTER SYSTEM SET JOB_QUEUE_PROCESSES = 50;
Whenever a dynamic parameter is modified using the ALTER
SYSTEM
command, Oracle records in the alert log the command that modifies the parameter. The ALTER
SYSTEM
command in the previous example modifies the global value of the parameter for all sessions in the instance, for the duration of the instance (until the database is shut down). If you shut down and restart the database, then Oracle uses the setting for JOB_QUEUE_PROCESSES
in the initialization parameter file.
You can use the Edit Database dialog box of the Instance Management tool to configure the job queue processes at the materialized view site if you have a dedicated network link to the materialized view site or if you are able to schedule the network link. This operation is required because the Instance Management tool is not installed at the materialized view site in most cases, which means that the configuration must be done remotely from the master site. If remote configuration is not possible, then see the next section.
Complete the following to set your job processes using Instance Manager:
SYSDBA
privileges.You can save this configuration, which is helpful if you use Instance Manager to manage your database.
See Also:
Oracle Enterprise Manager Administrator's Guide and the Instance Management tool's online help for more information on using the Instance Management tool |
If you do not have access to the Instance Management tool, then you can manually edit the initialization parameter file. Use a text editor to modify the contents of your initialization parameter file.
In most cases, all of the initialization parameters used in replication are grouped together under an "Advanced Replication" heading in your initialization parameter file. After you have modified the contents of your initialization parameter file, restart your database with these new settings.
See Also:
"Initialization Parameters" and the Oracle9i Database Reference for more information about initialization parameters important for Advanced Replication, and see Oracle9i Database Administrator's Guide for information on restarting your database. |
Before creating materialized view groups and materialized views for a remote materialized view site, make sure you create the necessary materialized view logs at the master site or master materialized view site. A materialized view log is necessary for every master table or master materialized view that supports at least one materialized view with fast refreshes.
To create a materialized view log, you need the following privileges:
CREATE
ANY
TABLE
CREATE
ANY
TRIGGER
SELECT
(on the materialized view log's master)COMMENT
ANY
TABLE
When you create a materialized view log, you can add columns to the log when necessary. To fast refresh a materialized view, the following types of columns must be added to the materialized view log:
WHERE
clause of a subquery that is not part of an equi-join and is not a primary key column. These columns are called filter columns.A collection column cannot be added to a materialized view log. Also, materialized view logs are not required for materialized views that are complete refreshed.
For example, consider the following DDL:
1) CREATE MATERIALIZED VIEW oe.customers REFRESH FAST AS 2) SELECT * FROM oe.customers@orc1.world c 3) WHERE EXISTS 4) (SELECT * FROM oe.orders@orc1.world o 5) WHERE c.customer_id = o.customer_id AND o.order_total > 20000);
Notice in line 5 of the preceding DDL that three columns are referenced in the WHERE
clause. Columns orders.customer_id
and customers.customer_id
are referenced as part of the equi-join clause. Because customers.customer_id
is a primary key column, it is logged by default, but orders.customer_id
is not a primary key column and so must be added to the materialized view log. Also, the column orders.order_total
is an additional filter column and so must be logged.
Therefore, add orders.customer_id
and orders.order_total
the materialized view log for the oe.orders
table.
To create the materialized view log with these columns added, issue the following statement:
CREATE MATERIALIZED VIEW LOG ON oe.orders WITH PRIMARY KEY (customer_id,order_total);
If a materialized view log already exists on the oe.customers table, you can add these columns by issuing the following statement:
ALTER MATERIALIZED VIEW LOG ON oe.orders ADD (customer_id,order_total);
If you are using user-defined datatypes, then the attributes of column objects can be logged in the materialized view log. For example, the oe.customers
table has the cust_address.postal_code
attribute, which can be logged in the materialized view log by issuing the following statement:
ALTER MATERIALIZED VIEW LOG ON oe.customers ADD (cust_address.postal_code);
You are encouraged to analyze the defining queries of your planned materialized views and identify which columns must be added to your materialized view logs. If you try to create or refresh a materialized view that requires an added column without adding the column to the materialized view log, then your materialized view creation or refresh may fail.
See Also:
|
Materialized view environments can be created in several different ways and from several different locations. In most cases, you should use deployment templates at the master site to locally precreate a materialized view environment that will be individually deployed to the target materialized view site.
You can also individually create the materialized view environment by establishing a connection to the materialized view site and building the materialized view environment directly.
See the Replication Management tool's online help for information on using deployment templates to centrally create a materialized view environment using the Replication Management tool.
See the Replication Management tool's online help for information on individually creating the materialized view environment with a direct connection to the remote materialized view site using the Replication Management tool.
Text description of the illustration rep81076.gif
The instructions for creating a deployment template in the Oracle9i Replication Management API Reference manual for information on using deployment templates to centrally pre-create a materialized view environment using the replication management API.
The instructions for creating a materialized view group the Oracle9i Replication Management API Reference manual for information on individually creating the materialized view environment with a direct connection to the remote materialized view site using the replication management API.
After you have created a materialized view environment with one or more materialized view sites, you may need to add new materialized view sites. You may encounter problems when you try to fast refresh the materialized views you create at a new materialized view site if both of the following conditions are true:
The problem arises when the materialized view logs for the masters are purged before a new materialized view can perform its first fast refresh. If this happens and you try to fast refresh the materialized views at the new materialized view site, then you may encounter the following errors:
ORA-12004 REFRESH FAST cannot be used for materialized view materialized_view_ name ORA-12034 materialized view log on materialized_view_name younger than last refresh
If you receive these errors, then the only solution is to perform a complete refresh of the new materialized view.
To avoid this problem, choose one of the following options:
See Also:
Chapter 4, "Deployment Templates Concepts and Architecture" for information about deployment templates |
If you choose to create a dummy materialized view at the materialized view site, complete the following steps:
dummy_mview
based on the master table or master materialized view. For example, to create a dummy materialized view based on a master table named sales
, issue the following statement at the new materialized view site:
CREATE MATERIALIZED VIEW dummy_mview REFRESH FAST AS SELECT * FROM pr.sales@orc1.world WHERE 1=0;
A scheduled link determines how a master site propagates its deferred transaction queue to another master site, or how a materialized view site propagates its deferred transaction queue to its master site or master materialized view site. When you create a scheduled link, Oracle creates a job in the local job queue to push the deferred transaction queue to another site in the system. When Oracle propagates deferred transactions to a remote master site, it does so within the security context of the replication propagator.
You can configure a scheduled link to push information using serial or parallel propagation. In general, you should use parallel propagation, even if you set the parallelism
parameter to 1.
Before creating the scheduled links for a replication environment, carefully consider how you want replication to occur globally throughout the system. For example, you may choose to propagate deferred transactions at intervals, with time in between these intervals when the deferred transactions are not propagated. In this case, you must decide how often and when to schedule pushes. Alternatively, if you want to simulate real-time (or synchronous) replication, then you may want to have each scheduled link continuously push a master site's deferred transaction queue to its destination.
Also, you may want to schedule pushes at a time of the day when connectivity is guaranteed or when communications costs are lowest, such as during evening hours. Furthermore, you may want to stagger the scheduling for links among all master sites to distribute the load that replication places on network resources.
See Also:
"Serial and Parallel Propagation" for more information about issues related to serial and parallel propagation |
You can schedule periodic intervals between pushes of a site's deferred transaction queue to a remote destination. Examples of periodic intervals are once an hour or once a day. To do so, you can use the DBMS_DEFER_SYS.SCHEDULE_PUSH
procedure and specify the settings shown in Table 6-3.
SCHEDULE_PUSH Procedure Parameter | Value |
---|---|
|
0 |
|
An appropriate date expression; for example, to specify an interval of one hour, use |
You can also use the Replication Management tool to schedule periodic pushes. To do so, set Delay Seconds to the default value of 0 when configuring a scheduled link in any of the following places:
Then configure the interval (the "then push every" control) to push the deferred transaction queue periodically.
The following is an example that schedules a periodic push once an hour:
BEGIN DBMS_DEFER_SYS.SCHEDULE_PUSH ( destination => 'orc2.world', interval => 'SYSDATE + (1/24)', next_date => SYSDATE, delay_seconds => 0); END; /
See Also:
|
Even when using Oracle's asynchronous replication mechanisms, you can configure a scheduled link to simulate continuous, real-time replication. To do so, use the DBMS_DEFER_SYS.SCHEDULE_PUSH
procedure and specify the settings shown in Table 6-4.
SCHEDULE_PUSH Procedure Parameter | Value |
---|---|
|
1200 |
|
Lower than the |
|
1 or higher |
|
Higher than the |
With this configuration, Oracle continues to push transactions that enter the deferred transaction queue for the duration of the entire interval. If the deferred transaction queue has no transactions to propagate for the amount of time specified by the delay_seconds
parameter, then Oracle releases the resources used by the job and starts fresh when the next job queue process becomes available.
If you are using serial propagation by setting the parallelism
parameter to 0 (zero), then you can simulate continuous push by reducing the settings of the delay_seconds
and interval
parameters to an appropriate value for your environment. However, if you are using serial propagation, simulating continuous push is costly when the push job must initiate often.
The following is an example that simulates continual pushes:
BEGIN DBMS_DEFER_SYS.SCHEDULE_PUSH ( destination => 'orc2.world', interval => 'SYSDATE + (1/144)', next_date => SYSDATE, parallelism => 1, execution_seconds => 1500, delay_seconds => 1200); END; /
See Also:
|
A scheduled purge determines how a master site or materialized view site purges applied transactions from its deferred transaction queue. When you use the Replication Management tool's Setup Wizard to set up a master site or materialized view site, Oracle creates a job in each site's local job queue to purge the local deferred transaction queue on a regular basis. Carefully consider how you want purging to occur before configuring the sites in a replication environment. For example, consider the following options:
You can schedule periodic purges of a site's deferred transaction queue. Examples of periodic purges are purges that occur once a day or once a week. To do so, you can use the DBMS_DEFER_SYS.SCHEDULE_PURGE
procedure and specify the settings shown in Table 6-5.
SCHEDULE_PURGE Procedure Parameter | Value |
---|---|
|
0 |
|
An appropriate date expression; for example, to specify an interval of one day, use |
You can also use the Replication Management tool's Setup Wizard, or the Purge sub tab of the Schedule tab on the Administration property sheet to schedule periodic purges. To do so, set Delay Seconds to the default value of 0 (zero). Then configure the interval (the "then purge every" control) to purge the deferred transaction queue.
The following is an example that schedules a periodic purge once a day:
BEGIN DBMS_DEFER_SYS.SCHEDULE_PURGE ( next_date => SYSDATE, interval => 'SYSDATE + 1', delay_seconds => 0); END; /
See Also:
|
To configure continuous purging of a site's deferred transaction queue, you can use the DBMS_DEFER_SYS.SCHEDULE_PURGE
procedure and specify the settings shown in Table 6-6.
SCHEDULE_PURGE Procedure Parameter | Value |
---|---|
|
500000 |
|
Lower than the |
|
|
You can also use the Replication Management tool to configure continuous purge. To do so, on the Purge sub tab of the Schedule tab on the Administration property sheet, set Delay Seconds to 500,000 and set interval (the "then purge every" control) to a value less than the Delay Seconds setting.
The following is an example that simulates continuous purges:
BEGIN DBMS_DEFER_SYS.SCHEDULE_PURGE ( next_date => SYSDATE, interval => 'SYSDATE + (1/144)', purge_method => dbms_defer_sys.purge_method_quick, delay_seconds => 500000); END; /
See Also:
|
When you create the scheduled links for a replication environment, each link can asynchronously propagate changes to a destination using either serial or parallel propagation. Before you configure your replication environment, decide whether you want to use serial propagation or parallel propagation.
parallelism
parameter to 0 (zero) in the DBMS_DEFER_SYS.SCHEDULE_PUSH
procedure. Or, using the Replication Management tool, set the Parallel Propagation Processes control to 0 in the Edit Push Schedule dialog box. Typically, you should use serial propagation only when the destination is an Oracle7 site.parallelism
parameter to 1 or higher in the DBMS_DEFER_SYS.SCHEDULE_PUSH
procedure. Or, using the Replication Management tool, set the Parallel Propagation Processes control to 1 or higher in the Edit Push Schedule dialog box.
See Also:
|
If you plan to include materialized view sites in your replication environment, then consider using deployment templates to create the replicated objects at the materialized view sites.
See Also:
Chapter 4, "Deployment Templates Concepts and Architecture" for information about deployment templates |
If you decide to use deployment templates, then you need to prepare your materialized view sites for instantiation. If a deployment template has been designed well, then little preparation is necessary at the remote materialized view site. This section describes the most common preparations that must be performed at the remote materialized view site. After any required preparations have been completed, you are ready to perform either an online or offline instantiation.
Use the following questions to assess which actions are necessary to prepare the remote materialized view site for instantiation:
The following sections provide guidance for the issues raised by each of these questions.
As with all replication environments, network connectivity is a key component in Advanced Replication. For Oracle Enterprise Edition, Oracle Standard Edition, and Oracle Personal Edition, verify that the remote materialized view site has a proper SQL*Net, Net8, or Oracle Net connection to the target master site.
See Also:
Oracle9i Net Services Administrator's Guide for information about setting up an Oracle network connection |
The materialized view site must have an Oracle8i release 8.1.5 or higher database to instantiate a deployment template. If your materialized view site does not meet the database version requirements, then you need to upgrade your database at the materialized view site before instantiating a deployment template.
Each materialized view site needs several users that have special privileges to support a materialized view site. In addition to having the administrative privileges, these users also participate in the propagation and refreshing of data.
Materialized view site setup also includes scheduling several automated jobs to handle the automatic refreshing of the materialized view (optional) and the purging of the deferred transaction queue.
You can set up your materialized view site with:
See Also:
Oracle9i Replication Management API Reference for instructions on setting up your materialized view site with the replication management API |
If the deployment template that you are instantiating creates objects in multiple schemas, then make sure that all of the necessary schemas have been created. Additionally, the user instantiating the deployment template must have the appropriate CREATE
privileges on that schema. For example, if the deployment template will create a procedure in schema oe
and the user hr
is instantiating the template, then hr
must have the CREATE
ANY
PROCEDURE
privilege on schema oe
.
While it is advantageous to include the DDL to create all necessary database links for a remote materialized view site in the deployment template, it is not required. If the database link DDL is not in the deployment template, then manually create the database links to the target master site prior to instantiating the deployment template. The database links are required to populate the materialized view base tables during an online instantiation and are required for the proper maintenance of the materialized view environment.
You have the option of performing online or offline instantiation of deployment templates at materialized view sites. With online instantiation, the data in your materialized views is pulled from the master site during instantiation. With offline instantiation, the data in your materialized views is packaged in the template itself and is applied locally when you instantiate the template. In general, if your materialized views will contain a large amount of data, then offline instantiation is preferred to minimize utilization of your network resources.
See Also:
"Deployment Template Packaging and Instantiation" for more information about online and offline instantiation |
If the deployment template that you are instantiating will use specific rollback segments that do not currently exist at the remote materialized view site, then create the necessary rollback segments. To see if your template objects use the default rollback segment or a specific rollback segment, query the DBA_REPCAT_TEMPLATE_OBJECTS
data dictionary view.
See Also:
Oracle9i Replication Management API Reference for information about data dictionary views related to replication |
Asynchronous multimaster and updatable materialized view replication environments must address the possibility of replication conflicts that may occur when, for example, two transactions originating from different sites update the same row at nearly the same time. If possible, plan your replication environment to avoid the possibility of conflicts. If data conflicts may occur in your replication environment, then you need a mechanism to ensure that the conflict is resolved in accordance with your business rules and to ensure that the data converges correctly at all sites.
See Also:
Chapter 5, "Conflict Resolution Concepts and Architecture", for more information about avoiding conflicts and for information about the conflict resolution methods available to you if conflicts may occur |
Security may be a concern in both multimaster and materialized view replication environments. You should plan your security strategy before you configure your replication environment.
See Also:
Oracle9i Replication Management API Reference for information about security options in a replication environment |
Survivability is the capability to continue running applications despite system or site failures. Survivability enables you to run applications on a fail over system, accessing the same, or very nearly the same, data as these systems accessed on the primary system when it failed. As shown in Figure 6-3, the Oracle server provides two different technologies for accomplishing survivability: multimaster replication and Oracle Real Application Clusters.
Oracle Real Application Clusters supports fail over to surviving systems when a system supporting an instance of the Oracle server fails. Oracle Real Application Clusters requires a cluster or massively parallel hardware platform, and thus is applicable for protection against processor system failures in the local environment where the cluster or massively parallel system is running.
In these environments, the Oracle Real Application Clusters is a good solution for survivability -- supporting high transaction volumes with no lost transactions or data inconsistencies in the event of an instance failure. If an instance fails, then a surviving instance of the Oracle Real Application Clusters automatically recovers any incomplete transactions. Applications running on the failed system can execute on the fail over system, accessing all data in the database.
The Oracle Real Application Clusters does not, however, provide survivability for site failures (such as power outages, flood, fire, or sabotage) that render an entire site, and thus the entire cluster or massively parallel system, inoperable. To provide survivability for site failures, you can use the multimaster replication to maintain a replica of a database at a geographically remote location. In addition, you can use multimaster replication to replicate data between sites running different operating systems or different releases of Oracle or both.
Should the local system fail, the application can continue to execute at the remote site. Using multimaster replication, some administrative procedures may be necessary to recover transactions at the failed site and to prevent data inconsistencies when restarting the failed site.
See Also:
|
If you choose to use the replication facility for survivability, then consider the following issues:
These "lost" transactions must be dealt with when the primary site is recovered.
Suppose, for example, you are running an order-entry system that uses replication to maintain a remote fail over order-entry system, and the primary system fails.
At the time of the failure, there were two transactions recently executed at the primary site that did not have their changes propagated and applied at the failover site. The first of these was a transaction that entered a new order, and the second was a transaction that cancelled an existing order.
In the first case, someone may notice the absence of the new order when processing continues on the fail over system, and re-enter it. In the second case, the cancellation of the order may not be noticed, and processing of the order may proceed; that is, the canceled item may be shipped and the customer billed.
What happens when you restore the primary site? If you simply push all of the changes executed on the failover system back to the primary system, then you will encounter conflicts.
Specifically, duplicate orders exist for the item originally ordered at the primary system just before it failed. Additionally, data changes result from the transactions to ship and bill the order that was originally canceled on the primary system.
You must carefully design your system to deal with these situations. The next section explains this process.
Advanced Replication provides survivability against site failures by using multiple replicated master sites. You must configure your system using one of the following methods, which are listed in order of increasing implementation difficulty:
You can use Oracle Net to configure automatic connect-time failover, which enables Oracle Net to fail over to a different master site if the first master site fails. You configure automatic connect-time failover in your tnsnames.ora
file by setting the FAILOVER
option to on
and specifying multiple connect descriptors.
See Also:
Oracle Net Services Administrator's Guide for more information about configuring connect-time failover |
Databases using replication are distributed databases. Follow the guidelines for distributed database backups outlined in the Oracle9i Backup and Recovery Concepts when creating backups of replicated databases. Follow the guidelines for coordinated distributed recovery in the Oracle9i User-Managed Backup and Recovery Guide when recovering a replication database.
If you fail to follow the coordinated distributed recovery guidelines, then there is no guarantee that your replication databases will be consistent. For example, a restored master site may have propagated different transactions to different masters. You may need to perform extra steps to correct for an incorrect recovery operation. One such method is to drop and re-create all replicated objects in the recovered database.
After performing an export/import of a replicated object or an object used by Advanced Replication, such as the DBA_REPSITES
data dictionary view, you should run the REPCAT_IMPORT_CHECK
procedure in the DBMS_REPCAT
package.
In the following example, the procedure checks the objects in the acct
replication group at a materialized view site to ensure that they have the appropriate object identifiers and status values:
BEGIN DBMS_REPCAT.REPCAT_IMPORT_CHECK( gname => 'hr_repg', master => FALSE); END; /
See Also:
The |
|
Copyright © 1996, 2002 Oracle Corporation. All Rights Reserved. |
|