 |
|
EnterpriseDB: Create Subscription
Oracle Tips by
Burleson
|
A
Subscription defines the target and links the target database to the
published source. Enter the subscription name and connection
information. If the Publication Name drop down is empty, press
the Load button to refresh the list.
Associate the subscription to the publication as shown in Figure 7.11.
Figure
7.11: Link Subscription to Publisher
Press
Create to create the subscription.
Snapshot
Before
turning on synchronization, a snapshot must be taken to create the
replicated objects in the EnterpriseDB instance. The snapshot
copies all of the replicated structures, including indexes and other
supporting objects.
For
reporting, you may have different index requirements than you would in
an Oracle OLTP or OLAP database. After running the snapshot, you
may drop and/or create any indexes that you feel may help performance.
Do not alter the structure of any replicated tables or you might break
replication.
Examine
any triggers that are copied and decide if they are needed in the
replicated instance. In most situations, they are not required.
You can
get to the Taking Snapshot dialog (Figure 7.12) by right-clicking on
the subscription identified above and choosing Take Snapshot.
Figure
7.12: Take Initial Snapshot
Press
the Take Snapshot button and examine the output window for any errors
before proceeding. You will only need to take the snapshot one
time.
Synchronize
A
synchronization is the process of catching the target up with the
source database. Most forms of replication are to synchronize
multiple instances. You can get to the Synchronize dialog
(Figure 7.13) by right-clicking on the subscription and selecting
Synchronize.
Figure
7.13: Force a Synchronize
The
synchronization process may run for several minutes depending on how
much data is being synchronized. Wait for a successful
completion before moving on to the next step.
The Schedule
While it
is possible to manually synchronize your databases, doing so kind of
defeats the purpose of having an enterprise class replication tool.
You will
probably want to schedule an automatic refresh. Depending on
your uses and needs, you may want a near, real-time refresh or a more
relaxed refresh such as daily, weekly, or monthly. You may also
schedule refreshes via crontab.
A point
to make is that replication is never truly real-time. At best,
transactions will experience some percentage of time delay. It
takes time to enqueue captured transactions at the source, propagate
to the target and then apply them at the target.
The
Schedule Task Wizard (Figure 7.14) is the tool within the Replication
Console that will allow you to schedule your replication jobs.
Figure
7.14: Configure Schedule
You may
choose a complete refresh on each run (Snapshot) or you may choose to
synchronize. For this example, I will choose Synchronize.
As
mentioned above, you may choose to schedule the replication
continuously (near real-time), daily, weekly, monthly or via crontab.
For this
example, I am choosing continuously (Figure 7.15) but I will display
each of the other screens to give you an idea of the information
required to fill them out.
Figure
7.15: Continuous Synchronization
In
Continuous replication, you configure a refresh rate to gather and
apply changes. Remember that the more often you refresh, the
heavier the load on both the source and the target databases.
For a
Daily replication task (Figure 7.16), you define the hour and minute
that you want to begin the synchronization.
Figure
7.16: Daily Synchronization
For a
Weekly replication task (Figure 7.17), you define the hour and minute,
as well as the days of the week that you want to begin the
synchronization.
Figure
7.17: Weekly Synchronization
For a
Monthly replication task (Figure 7.18), you define the hour and
minute, the day of the month and which months that you want to begin
the synchronization.
Figure
7.18: Monthly Synchronization
For
crontab scheduling (Figure 7.19), you must define a valid crontab
expression. You must also have cron running to schedule jobs via
cron.
Figure
7.19: Cron Synchronization
After
successfully defining the scheduling method you require, press the
Next button to arrive at the Schedule Summary dialog (Figure 7.20).
Verify that the summary accurately reflects your choices and press the
Finish button.
Figure
7.20: Complete Schedule
Once the
schedule has been defined, the replication server will ensure that it
executes the data movement as scheduled. You can view the
replication log and real-time monitor by clicking to the lowest node
beneath the subscription service.
This
is an excerpt from the book "EnterpriseDB:
The Definitive Reference" by Rampant TechPress.
|