| Oracle® Database Advanced Replication 10g Release 1 (10.1) Part Number B10732-01 |
|
6
|
See Als
o:
|
When you create a table, you can specify the following options for tracking sys tem change numbers (SCN)s:
NOROWDEPENDENCIES, the d
efault, specifies that the SCN is tracked at the data block level.ROWDEPE
NDENCIES 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 requir
es 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_i d NUMBER(6) NOT NULL, unit_price NUMBER(8,2), quantity NUMBE R(8) ) ROWDEPENDENCIES;
Oracle tracks the SCN f
or 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 Propag
ation Dependency Maintenance" for more information about the |
Table 6-1 lists initialization parameters that are important for the operation, reliability, and performa
nce of a replication environment. This table specifies whether each parameter is modifiable. A modifiable initialization parameter ca
n be modified using the ALTER SESSION or ALTER SYSTEM statement while an instance
is running.
| Parameter | Values | Description | Recommendation |
|---|---|---|---|
GLOBAL_NAMES |
|
Specifies whether a datab ase link is required to have the same name as the database to which it connects. |
|
JOB_QUEUE_PROCESSES |
Modifiable?: Yes |
a>
Specifies the number of Jn job queue processes for each instance ( When |
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 |
Modifiable?: No |
Specifies the maximum number of concurrent open connections to remote databases in one session. These connections include the schema objects called databas e links, as well as external procedures and cartridges, each of which uses a separate process. |
If you are using synchronous replication, |
PARALLEL_MAX_SERVERS |
Default: Derived from the values of the following paramete rs: Mo difiable?: Yes |
Specifies the maximum number of parallel exec ution processes and parallel recovery processes for an instance. As demand increases, Oracle will increase the number of processes fr om the number created at instance startup up to this value. |
If you us e parallel propagation, then make sure the value of this parameter is set high enough to support it. |
PARALLEL_MIN_SERVERS |
Range:
Modifiable?: Yes |
Specifies the minimum number of parallel execution proc esses 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 proces s for each stream. |
PROCESSES |
Default: Derived from Range: Modifiable?: No |
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. |
R EPLICATION_DEPENDENCY_TRACKING |
Modifiable?: No |
Enables or disables dependency tracking for read/write operations to the database. Dependency tracking is es sential for propagating changes in a replication environment in parallel.
|
Typically, specify |
SHARED_POOL_SIZE |
32-bit platforms: 64-bit platforms: Range: The granule size to operating system-dependent lim it |
Specifies in bytes the size of the shared pool. The shared pool contains shared cursors, sto red 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 Oracl e server in a replication environment than in a non-replication environment. You can monitor u
tilization of the shared pool by querying the view |
|
See Also:
Oracle Database Reference for more information abo ut these initialization parameters |
When you are planning your replication environment, you need to decide whether the sites participating in the replic ation environment will be master sites or materialized view sites. Consider the characteristics and advantages of both types of repli cation sites when you are deciding whether a particular site in your replication environment should be a master site or a materialize d view site. One replication environment can support both master sites and 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 encounter ed with materialized view replication result from not preparing the environment properly. There are four essential tasks that you mus t perform before you begin creating your materialized view environment:
The Replication Management tool's Setup Wizard aut omatically 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 Replic ation Management tool's online help for instructions on using tool to set up your materialized view site.
< div align="center">| See Also: |
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 O racle Database Advanced 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 Replicati on Management tool's Setup Wizard or the script in the Oracle Database Advanced Replication Management API Reference does to set up your materialized view site.
Each materialized view site needs severa l users to perform the administrative and refreshing activities at the materialized view site. You must create and grant the necessar y 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 us ers. 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 sc
hema that contains the master table in the master database. Therefore, identify the schemas that contain the master tables that you w
ant to replicate with materialized views. After you have identified the target schemas at the master database, create the correspondi
ng 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.wor
ld.
| See Also:
If you are reviewing the steps in Oracle Database Advanced Replication Management API Reference, then the necessary schem as 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 da tabase 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 crea tes 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 connect
ions to the remote database using the specified account. Additionally, the remote account that the link uses must have the SELE
CT 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 shoul
d 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 th
e Replication Management tool's Setup Wizard, then these database links are created for you automatically.
| See Also:
The information about security options in Oracle Database Advanced Replication Management API Reference for more information |
After the administrative database links have been created, a private database link must be created conne
cting 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 th
at connects using the hr username and password.
Text description of the illustration repln05 6.gif
For multimaster replication, there must be no Virtual Private Database (VPD) restri
ctions on the replication propagator and receiver schemas. For materialized views, the defining query for the materialized view may n
ot be modified by VPD. VPD must return a NULL policy for the schema that performs both the create and refresh of the mat
erialized view. Creating a remote materialized view with a non-NULL VPD policy will not generate an error but may yield
incorrect results.
See Also:
|
Both the creator and the owner of the materia
lized view must be able to issue the defining SELECT statement of the materialized view. The owner is the schema that co
ntains 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 SELE
CT privileges to execute the defining SELECT statement.
| See Also:
If you are reviewing the steps in < em class="Variable">Oracle Database Advanced Replic ation Management API Reference, then the necessary privileges are granted as part of the script described in instructions fo r 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 pe rformed at the master site. Scheduling the purge operation again does not harm the master site, but may change the purge scheduling c haracteristics.
Scheduling a push at the materialized view site autom atically propagates the deferred transactions at the materialized view site to the associated target master site using a database lin k. These types of database links are called scheduled links. Typically, there is only a single scheduled link for each materialized v iew group at a materialized view site, because a materialized view group only has a single target master site.
a>It is important that you have allocated sufficient job queue processes to ha ndle 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 s ite has scheduled links to the other five sites. You typically need one process for each scheduled link. You may also want to add add itional 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 pu rge scheduling, user-defined jobs, and the scheduled link. Also, you need at least one job queue process for each degree of paralleli sm.
Alternatively, if your users are responsible for manually refreshing the materialized vie w 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. This initialization parameter is modifiable. Therefo
re, you can modify it while an instance is running. 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 th e job queue processes should "wake up" to execute jobs.
"Initialization Parameters"
and the Oracle Database Reference for information about |
Before creating materialized view groups and ma terialized 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 n eed the following privileges:
CREATE ANY TABLECREATE ANY TRIGGER<
/li>
SELECT (on the materialized view log's master)COMMENT ANY TABLE
When you create a materialized view log, you can add c olumns to the log when necessary. To fast refresh a materialized view, the following types of columns must be added to the materializ ed view log:
WHERE claus
e 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 lo gs 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.orde rs@orc1.world o 5) WHERE c.customer_id = o.customer_id AND o.order_total > 20000); pre>Notice in line 5 of the preceding DDL that three columns are referenced in the
WHERE code> clause. Columnsorders.customer_idandcustomers.customer_idare referenced as part of the equi-join clause. Becausecustomers.customer_idis a primary key column, it is logged by default, butorders.customer_id is not a primary key column and so must be added to the materialized view log. Also, the columnorders.order_totali s an additional filter column and so must be logged.Therefore, add
orders.customer_id< /code> andorders.order_totalthe materialized view log for theoe.orderstable.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.customerstabl e, 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-def ined datatypes, then the attributes of column objects can be logged in the materialized view log. For example, the
oe.customerstable has thecust_address.postal_codeattribute, which can be logged in the materialized view log by issuing th e following statement:ALTER MATERIALIZED VIEW LOG ON oe.customers ADD (cust_address.postal_c ode);You are encouraged to analyze the defining queries of your plan ned materialized views and identify which columns must be added to your materialized view logs. If you try to create or refresh a mat erialized view that requires an added column without adding the column to the materialized view log, then your materialized view crea tion or refresh may fail.
See Also:
- "Data Subsetting with Materialized Views" for information about materialized views with subqueries
- "Restrictions for Materialized Views with Subqueries" for additional information about materialized views with subqueries
- "Creating a Materialized View Log" for information about creating a materialized view log
Creating a Materialized View Environment
Materialized view e nvironments can be created in several different ways and from several different locations. In most cases, you should use deployment t emplates at the master site to locally precreate a materialized view environment that will be individually deployed to the target mat erialized view site.
You can also individually create the materialized view environment by es tablishing a connection to the materialized view site and building the materialized view environment directly.
a>Creating a Materialized View Enviro nment Using the Replication Management Tool
See the Replication M anagement 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 inform ation on individually creating the materialized view environment with a direct connection to the remote materialized view site using the Replication Management tool.
Figure 6-2 Fl owchart for Creating Materialized Views
![]()
Text description of the illustration repln076.gif
Creating a Materialized View Environment Using the Replication Management API
The instructions for creati ng a deployment template in the O racle Database Advanced Replication Management API Reference manual for information on using deployment templates to central ly pre-create a materialized view environment using the replication management API.
The instr uctions for creating a materialized view group the Oracle Database Advanced Replication Management API Reference manual for information on individually cr eating the materialized view environment with a direct connection to the remote materialized view site using the replication manageme nt API.
Avoid ing Problems When Adding a New Materialized View Site
After you have c reated 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 th e materialized view logs for the masters are purged before a new materialized view can perform its first fast refresh. If this happen s and you try to fast refresh the materialized views at the new materialized view site, then you may encounter the following errors:< /p>
ORA-12004 REFRESH FAST cannot be used for materialized view materialized_v iew_ name ORA-12034 materialized view log on materialized_view_name younger than las t 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:
If you choose to create a dummy materialized view at the materialized view site, complete the following steps:
d
ummy_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;
If you p lan to configure an Advanced Replication environment that involves different releases of Oracle at different replication sites, then your environment must meet the following requirements:
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 cre ate a scheduled link, Oracle creates a job in the local job queue to push the deferred transaction queue to another site in the syste m. When Oracle propagates deferred transactions to a remote master site, it does so within the security context of the replication pr opagator.
You can configure a scheduled link to push information using serial or parallel pro
pagation. 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 replica tion 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 sch edule 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 th at 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 s
ite's deferred transaction queue to a remote destination. Examples of periodic intervals are once an hour or once a day. To do so, yo
u can use the DBMS_DEFER_SYS.SCHEDULE_PUSH procedure and specify the settings shown in Table
6-3.
| SCHEDUL E_PUSH Procedure Parameter | |
|---|---|
|
|
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 o f 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 o nce an hour:
BEGIN DBMS_DEFER_SYS.SCHEDULE_PUSH ( destination => 'orc2.world', interval => 'SYSDATE + (1/24)', next_dat e => SYSDATE, delay_seconds => 0); END; /
See Also:
|
Even when using Oracle's asynchronous repl
ication mechanisms, you can configure a scheduled link to simulate continuous, real-time replication. To do so, use the DBMS_DE
FER_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 durat
ion of the entire interval. If the deferred transaction queue has no transactions to propagate for the amount of time specified by th
e delay_seconds parameter, then Oracle releases the resources used by the job and starts fresh when the next job queue p
rocess becomes available.
If you are using serial propagation by setting the parallelis
m 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, simulati
ng continuous push is costly when the push job must initiate often.
The following is an examp le 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 lo cal 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 occu
r 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 |
See Also:
|
To configure continuous purging of a site's deferred transaction queue, you can use the DB
MS_DEFER_SYS.SCHEDULE_PURGE procedure and specify the settings shown in Table 6-6.
| SCHEDULE_PURGE Procedure Par ameter | Value |
|---|---|
|
|
500000 |
|
|
Lower than the |
|
|
|
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 w ant to use serial propagation or parallel propagation.
parallelism parameter to 0 (zero) in the DBMS_DE
FER_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.parallelism
code> 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. Typically, you should use parall
el propagation.
See Also:
- "Parallel Prop
agation"
- Oracle Database Advanced Replication Management API Reference
for information about the
DBMS_DEFER_SYS package
- The Replicati
on Management tool online help for information about using this tool
If you plan to include materialized view sites in your replicat ion 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 |
As with all replication environments, network connectivity is a key componen t in Advanced Replication. Verify that the remote materialized view site has a proper SQL*Net, Net8, or Oracle Net connection to the target master site.
| See Also:
font>
Oracle Net Services Administrator's Guide for information about setting up an Oracle network connection |
The materialized view site must have an Oracle release 8.1.5 or high er database to instantiate a deployment template. If your materialized view site does not meet the database version requirements, the n 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 propaga tion and refreshing of data.
Materialized view site setup also includes scheduling several au tomated 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:
Oracle Database Advanced Replication Management API Referen ce for instructions on setting up your materialized view site with the replication management API
If the deployment template that you are instantiat
ing creates objects in multiple schemas, then make sure that all of the necessary schemas have been created. Additionally, the user i
nstantiating the deployment template must have the appropriate CREATE privileges on that schema. For example, if the dep
loyment template will create a procedure in schema oe and the user hr is instantiating the template, then <
code>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 tem plate. The database links are required to populate the materialized views during an online instantiation and are required for the pro per 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, t he data in your materialized views is packaged in the template itself and is applied locally when you instantiate the template. In ge neral, if your materialized views will contain a large amount of data, then offline instantiation is preferred to minimize utilizatio n of your network resources.
| See Also:
strong>
"Deployment Template Packaging and Instantiation" for more information about online and offline instantiation |
If the deployment template that you are instantiating will use specif
ic rollback segments that do not currently exist at the remote materialized view site, then create the necessary rollback segments. T
o see if your template objects use the default rollback segment or a specific rollback segment, query the DBA_REPCAT_TEMPLATE_O
BJECTS data dictionary view.
| See
Also:
Oracle Database Advanced Replication Management API Reference for information about data diction ary views related to replication |
Asynch ronous multimaster and updatable materialized view replication environments must address the possibility of replication conflicts tha t may occur when, for example, two transactions originating from different sites update the same row at nearly the same time. If poss ible, plan your replication environment to avoid the possibility of conflicts. If data conflicts may occur in your replication enviro nment, then you need a mechanism to ensure that the conflict is resolved in accordance with your business rules and to ensure that th e data converges correctly at all sites.
| See Also:
Chapter 5, "Conflict Resolution Conc epts and Architecture", for more information about avoiding conflicts and for information about the conflict resolution methods a vailable to you if conflicts may occur |
Security ma y 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:
Oracle Database Advanced Replication Management API Reference for informa tion about security options in a replication environment |
Survivability is the capability to continue running applications despite system or site failures. Survivabi lity enables you to run applications on a fail over system, accessing the same, or very nearly the same, data as these systems access ed 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.
<
p>Text description of the illustration repln019.gif
Oracle Real Application Clusters supports fail over to surviving systems whe n a system supporting an instance of the Oracle server fails. Oracle Real Application Clusters requires a cluster or massively parall el hardware platform, and thus is applicable for protection against processor system failures in the local environment where the clus ter or massively parallel system is running.
In these environments, the Oracle Real Applicati on Clusters is a good solution for survivability -- supporting high transaction volumes with no lost transactions or data inconsisten cies in the event of an instance failure. If an instance fails, then a surviving instance of the Oracle Real Application Clusters aut omatically recovers any incomplete transactions. Applications running on the failed system can execute on the fail over system, acces sing all data in the database.
The Oracle Real Application Clusters does not, however, provid e survivability for site failures (such as power outages, flood, fire, or sabotage) that render an entire site, and thus the entire c luster 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 replicat e 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 ad ministrative procedures may be necessary to recover transactions at the failed site and to prevent data inconsistencies when restarti ng the failed site.
|
Note< /strong>: You can also configure standby database to protect an Oracle database f rom site failures. |
See Also:
|
If you choose to use the repl ication 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 recen tly 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 enc ounter conflicts.
Specifically, duplicate orders exist for the item originally ordered at th e primary system just before it failed. Additionally, data changes result from the transactions to ship and bill the order that was o riginally 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 mu st configure your system using one of the following methods, which are listed in order of increasing implementation difficulty:
< ul class="LB1">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 conne ct-time failover |
Databases using replication are distributed databases. Follow the guidelines for coordinated distributed recovery in the Oracle Database Backup and Recovery Adva nced User's 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 examp le, a restored master site may have propagated different transactions to different masters. You may need to perform extra steps to co rrect 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 c
hecks the objects in the acct replication group at a materialized view site to ensure that they have the appropriate obj
ect identifiers and status values:
BEGIN DBMS_REPCAT.REPCAT_IMPORT_CHECK( gname => 'hr_repg', master => FALSE); END; /
| See Also:
The |