Skip to Main Content

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Kenneth.

Asked: July 16, 2000 - 1:32 am UTC

Last updated: July 12, 2004 - 11:13 am UTC

Version: 7.3.2

Viewed 1000+ times

You Asked

If basic replication creates only read only tables( which are actually views ) .
At the most I will be able to query the replicated database
. since no updates,insert , delete are possible

If my primary database crashes then this replicated is of no use
Cause even an export will actually generate read only tables which can't be used to create a production database.


Is there any way in which i can replicate a database where even small changes ( like changes made to functions etc. , new tables added ) can be incorporated automatically.


Can u throw some light?
Kenneth


and Tom said...

Well, in basic replication -- the data is actually copied -- there are "real" tables out there (with extra columns -- in 7.3 the rowid of the master row at the master site). The views are used to "hide" this extra column. So, in the event of a total failure -- you can get to these "real" tables if need be in the event of an emergency.

What you describe above is called advanced replication. It does this. it replicates not only tables but schema's themselves (although you must use their functions in order to add indexes and objects to the schema so they know that its been changed and they can replicate that for you).

If you are trying to get a failover instance, you might consider other technologies as well -- such as a STANDBY database. See
</code> https://asktom.oracle.com/Misc/oramag/oracle-availability-options.html <code>
for an overview of some of the options.

Rating

  (3 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Replication of Indexes

Faran, July 10, 2003 - 9:04 am UTC

(Using Oracle 9.2.0.1.0 on MS Windows 2000) I have created 2 databases on different machines and run utlsampl.sql on both. I have made first one testing master definition site to replicate the scott.dept table to other master site (multi-master replication)...

SQL>...
SQL> BEGIN
  2  DBMS_REPCAT.ADD_MASTER_DATABASE (
  3  gname => 'scott_repg',
  4  master => 'fruity.benz.com',
  5  use_existing_objects => TRUE,
  6  copy_rows => FALSE,
  7  propagation_mode => 'ASYNCHRONOUS');
  8  END;
  9  /

PL/SQL procedure successfully completed.
...
SQL> BEGIN
  2  DBMS_REPCAT.GENERATE_REPLICATION_SUPPORT (
  3  sname => 'scott',
  4  oname => 'dept',
  5  type => 'TABLE',
  6  min_communication => TRUE);
  7  END;
  8  /

PL/SQL procedure successfully completed.
...

Both the sites already have pk_dept index on dept table. I have moved the index pk_dept to a different tablespace at the second master site. It has been done and no problem at all. Now I have some questions...

I have just added only table dept in the replicatoin group not any index. What are the benifits to replicate the indexes? Is it necessary to add the indexes too in the replication group or will they grow automatically as the data will be replicated to other master sites?
If I add the index too in the replication group, would it not incur more network traffic? Is it not suitable to create indexes separetely on at individual master sites and just replicate the tables. In this way i may choose different tablespaces (for indexes) at the different sites too. Or if oracle gives us the facility to replicate the indexes and procedures where does its applicability more better.

Any guidelines for this... would be highly appreciated.

Thanks & Regards,
Faran 

Tom Kyte
July 10, 2003 - 10:14 am UTC

indexes are local things, they will not add to any network traffic -- only the row level changes are there.

you would use the ddl replication facility in order to make sure you have a consistent set of indexes everywhere -- rather then doing the create index in N sites, you do it once and it gets pushed out to every site.

If you have an index at site 1 -- it is highly probable you need that index at site 2, site 3, and so on.

you are replicating the DEFINITION of the index, not index data.

Thanks

Faran, July 10, 2003 - 12:40 pm UTC

Thanks again Tom! You're doing a great job.

Regards,
Faran

LiLy, July 12, 2004 - 1:01 am UTC

Hi,
On a master definition site SiteA, in quiesced mode, I run the below procedure:

BEGIN
DBMS_REPCAT.ADD_MASTER_DATABASE (
gname => 'test_mg',
master => 'SiteB',
use_existing_objects => TRUE,
copy_rows => FALSE,
propagation_mode => 'asynchronous');
END;
/

to add a master site called SiteB. For some reasons, the process took so long and it hung. Then, I wanted to take the database out of the quiesced mode at SiteB but I couldn't RESUME_MASTER_ACTIVITY at SiteA. So I tried to remove the master group at SiteA to see if it helped but it didn't. Now at SiteB, the master group is still in quiesced mode and I can't remove it. When I tried to remove it using the OEM or on the command line, it just keeps running a long time, for more than 5 hours. I don't know what to do now to make the database at SiteB back to its original state, out of the quiesced mode. Can you please help me. Thanks!



Tom Kyte
July 12, 2004 - 11:13 am UTC

please contact support for this -- that is what they do best here.