Replicate using streams to a different schema

All,
I'm performing replication using streams, I have read the doc and steps by steps notes on metalink getting the replication successfully.
But now, I want to do the same but on differents schemas ie.
source DB: Schema= A Table=test
Destination DB: Schema= B Table=test
On both databases the schemas are basically the same but with different names.
What changes o additional steps I need to perform in order to complete the replication?
Thanks in advance..!

There are demos of both Change Data Capture (superior for what you appear to be doing) and Streams in Morgan's Library at www.psoug.org. Some of them duplicate exactly what you describe.
PS: There is a specific Streams forum. In the future please post Streams related requests there. Thank you.

Similar Messages

  • HTML DB application using table in a different schema

    I need to create a new HTML DB application. The table is in a different schema than mine. The DBA granted me rights to see it and I can see it from iSQL. HTML DB does not give the alternative of selecting this table.

    This thread covers your issue.
    New to HTML DB, have questions about service admin and schemas
    Ask your DBA to add workspace to schema mapping.
    Sergio

  • Help with truncating a table using plsql procedure in different schema

    I have a plsql procedure in schema A that truncates a table that is given in as parameter.
    create or replace procedure truncate_table(schema, table_name)
    EXECUTE IMMEDIATE 'TRUNCATE TABLE '||schema||'.'||table_name;
    end;
    The above procedure has public execute grant.
    I need to truncate a table in schema B. I have a plsql procedure in schema B that calls the truncate_table procedure and passes in the schema B table name.
    Since the table is in schema B, should the delete grant on the table be given to user A or user B to truncate the table in schema B?
    Thanks in advance.

    Procedure created in schema A
    create or replace
    procedure truncate_table(l_schema varchar2, table_name varchar2) authid current_user
    as
    begin
    EXECUTE IMMEDIATE 'TRUNCATE TABLE '||l_schema||'.'||table_name;
    end;from schema B
    grant delete on table1 to Schema_A
    from schema A
    exec truncate_table('Schema_B','Table1');
    Hope this helps.
    Alvinder

  • MapViewer metadata problem - accessing spatial data in a different schema.

    I have a MapViewer application that uses data from three different schemas.
    1. Dynamic Themes come from schema A.
    2. Static Themes come from schema B.
    3. A newly added static theme in B whose data comes from schema C.
    The mapviewer datasource points to schema B where the static themes, data and metadata are defined while the dynamic themes have their own datasource specified as part of addJDBCTheme(...).
    To get the newly added map to work I've had to add a view in schema B that points to C instead of referencing directly the table and I've had to add the metadata twice, once for schema B and once for schema C.
    If I put the metadata in just one of the two schemas I get the following errors.
    08/11/21 13:58:57 ERROR [oracle.sdovis.ThemeTable] cannot find entry in ALL_SDO_GEOM_METADATA table for theme: AMBITOS_REST
    08/11/21 13:58:57 ERROR [oracle.sdovis.ThemeTable] java.sql.SQLException: Invalid column index
    OR
    08/11/21 13:53:39 ERROR [oracle.sdovis.theme.pgtp] java.sql.SQLException: ORA-29902: error in executing ODCIIndexStart() routine
    ORA-13203: failed to read USER_SDO_GEOM_METADATA view
    It's not a big deal but I'd like to know if anyone else has has similar problems.
    Saludos,
    Lew.
    Edited by: Lew2 on Nov 21, 2008 6:42 AM

    Hi Lew,
    if you are using a recent version (10.1.3.1 or later) there is no need to use a view and to create the metadata in both schemas.
    You need to grant selection on tables between the schemas.
    You can try the following. Assume you have the MVDEMO schema (from MapViewer kit) and SCOTT schema.
    1) grant select on MVDEMO Counties table to SCOTT
    SQL> grant select on counties to scott;
    2) Now you are ready to create a predefined theme in schema SCOTT using the MVDEMO Counties table.
    - Open MapBuilder and loads the SCOTT schema.
    - On the Data navigator (bottom left tree), go to Geometry tables and you should see the MVDEMO node and the COUNTIES node inside it.
    - Start a wizard to create a geometry theme based on this Counties table.
    - At the end you should see that the base table name is MVDEMO.COUNTIES. Therefore MapViewer will use the metadata in MVDEMO schema and there is no need to replicate it in SCOTT schema.
    Joao

  • Sinlge select query in different schemas for same table(Indentical Structu)

    Scenario :
    Table XYZ is created in Schema A
    After an year, the old data from the previous year would be moved to different schema. However in the other schema the same table name would be used.
    For eg
    Schema A contains table XYZ with data of 2012 yr
    Schema B contains table XYZ with data of 2011 yr
    Table XYZ in both the schemas have identical structure.
    So can we fire a single select query to read the data from both the tables in effective way.
    Eg select * from XYZ where date range between 15-Oct-2011 to 15-Mar-2012.
    However the data resides in 2 different schema altogether.

    Thanks for the reply
    Creating an view is an option.
    But my problem, there is ORM layer(either Hibernate or Eclipse Top Link) between the application and the database.
    So the queries would be formed by the ORM layer and are not hand generated.
    So i cannot use view.
    So is there any option that would allow me to use single query on different schema's ?

  • Replicate to a different schema using streams

    All,
    I'm performing replication using streams, I have read the doc and steps by steps notes on metalink getting the replication successfully.
    But now, I want to do the same but on differents schemas ie.
    source DB: Schema= A Table=test
    Destination DB: Schema= B Table=test
    On both databases the schemas are basically the same but with different names.
    What changes o additional steps I need to perform in order to complete the replication?
    Thanks in advance..!

    Here is the procedure
    1) Follow the instructions from the documentation to create the streams administrator user on both source and target.(e.g. steams_adm)
    2) Connect to the streams administrator user at the TARGET (10.2) database
    --Create a queue
    Begin
    Dbms_streams_adm.set_up_queue(
    queue_name => 'APPLY_Q',queue_table => 'APPLY_Q_QT');
    End;
    --Create rules for apply process
    begin
    dbms_rule_adm.create_rule(rule_name =>'APPLY_RULE',
    condition => ':dml.get_object_owner()=''<put your source schema owner>'' ');
    end;
    begin
    dbms_rule_adm.create_rule_set(rule_set_name => 'streams_adm.apply_ruleset',
    evaluation_context => 'SYS.STREAMS$_EVALUATION_CONTEXT');
    dbms_rule_adm.add_rule(rule_set_name => 'APPLY_RULESET',rule_name =>'APPLY_RULE');
    end;
    --Set the rule to rename the schema
    begin
    dbms_streams_adm.rename_schema(
    rule_name=>'APPLY_RULE',
    from_schema_name =>'<put the source schema>',
    to_schema_name => '<put the target schema>');
    end;
    --Create the apply
    begin
    dbms_apply_adm.create_apply(apply_name => 'APPLY_CHANGES',
    rule_set_name => 'APPLY_RULESET',
    queue_name => 'APPLY_Q',
    source_database => '<source database name>',
    apply_captured => true);
    end;
    BEGIN
    DBMS_APPLY_ADM.SET_PARAMETER(
    apply_name => 'APPLY_CHANGES',
    parameter => 'DISABLE_ON_ERROR',
    value => 'N' );
    END;
    --Start apply
    begin
    dbms_apply_adm.start_apply('APPLY_CHANGES');
    end;
    3) Connected as strmadmin on SOURCE (9.2) database:
    --Create a database link to the TARGET database connected as streams_adm. The name of the dblink must match the target database name since you have to set global_names=true in the init files of both databases
    --Create a queue
    Begin
    Dbms_streams_adm.set_up_queue(
    queue_name => 'CAPTURE_Q',queue_table => 'CAPTURE_Q_QT');
    End;
    --Create the rule and rulesets
    *** Here replace the schema owner and the list of tables you'd like to capture changes *** from
    begin
    dbms_rule_adm.create_rule(rule_name =>'FILTER_TABLES',
    condition => ':dml.get_object_owner()=''<put your schema owner>'' and :dml.get_object_name() in (''TAB1'',''TAB2'')');
    end;
    begin
    dbms_rule_adm.create_rule_set(rule_set_name => 'streams_adm.capture_ruleset',
    evaluation_context => 'SYS.STREAMS$_EVALUATION_CONTEXT');
    dbms_rule_adm.add_rule(rule_set_name => 'CAPTURE_RULESET',rule_name =>'FILTER_TABLES');
    end;
    --Prepare the schema for instantiation
    *** Replace the schema name with your schema name
    BEGIN
    DBMS_CAPTURE_ADM.PREPARE_SCHEMA_INSTANTIATION(
    schema_name => '<put your schema name here>');
    END;
    --Create propagation
    BEGIN
    DBMS_PROPAGATION_ADM.CREATE_PROPAGATION(
    propagation_name => 'streams_propagation',
    source_queue => 'streams_adm.capture_q',
    destination_queue => 'streams_adm.apply_q',
    destination_dblink => '<database link>',
    rule_set_name => 'streams_adm.capture_ruleset');
    END;
    --Create capture process
    BEGIN
    DBMS_CAPTURE_ADM.CREATE_CAPTURE(
    queue_name => 'streams_adm.capture_q',
    capture_name => 'capture_tables',
    rule_set_name => 'streams_adm.CAPTURE_RULESET',
    first_scn => NULL);
    END;
    --start capture
    begin
    dbms_capture_adm.start_capture('CAPTURE_TABLES');
    end;
    Let me know if you have any questions

  • Different Schemas in different environments for same tables used in a Universe

    Hi,
    I have a Universe in Development where I have tables pointed to a schema (DW) in DEV but in TEST/INT I have the same tables under a different schema (TESTDW). So when I promote the Universe & reports from DEV to TEST, I will be getting errors as the schema is incorrect. So we need to find a way so that we can define the schema globally instead of having it at the individual table.
    I know we can repoint the schemas, etc but i need to avoid extra work in other environments.
    Known Solutions: Promote the reports to TEST, then select all the tables & change the schema by Right Clicking the selected tables and selecting Change Qualifier/Owner.
    One of the few reasons, I don't want to follow this route, because I have lot of derived tables which I need to change it manually by editing the SQL Statement,  &  also If I add new tables or columns again in future & promote them to TEST, then again I have to change the schema.
    Did anyone faced this kind of issue?Is there any other way that we can use like Begin_Sql , etc?
    (FYI, I am using BO4.0 SP5)

    Mark, Thanks a lot for your concern. We actually have same schema name across all 3 environments but there is a huge project going on in my company which is kind of hard to explain, so our team has decided to go ahead with a different names for schemas as 2 different teams will be working on paralelly on these schemas & they will combine them after a year or so. (I know this is not a solution)
    Thanks Swapnil for Synonyms solution. Your solution might have worked, if we were using BO 4.1 SP5 but unfortunately we are using BO 4.0 and in this version I can't view any synonym tables in the universe.

  • Applying Streams changes to a different schema

    We're trying to setup a Streams environment between two DBs 9.2.0.3.
    We have two different schemas, one in each DB, called TEST_HQ and TEST_CO, and both of them contain the same objects, tables, and procedures. What we're interested in is to apply DML/DDL changes to the destination DB even if the schema has a different name, but same structure.
    Right now CAPTURE and PROPAGATE processes are working fine, while the apply process is unable to perform any change. We've also tried creating a new schema in the destination DB called TEST_HQ, just like in the source schema, adding synonyms to the real tables contained within TEST_CO, but this is hitting ORA-23416 'missing primary key'.
    Any help or hint will be greatly appreciated!
    Thanks in advance!
    Max

    Thanks for your reply!
    Actually there is a primary key, but Streams seems to ignore it. I've also tried the SET_KEY_COLUMNS way plus supplementary logging on the source DB, but this didn't help at all. I think this is happenening because the tables are not in the TEST_HQ schema, there are only synonyms to the real tables contained in TEST_CO.
    Is there any other easy way to get Streams working between two different schemas?
    Thanks again for your help!!
    Max

  • Any way to use a single application but point it to different schemas?

    From the searching I have done, it appears that when an end-user runs an application, it can only be associated with a pre-defined schema, which I guess I just need confirmation of. What I was hoping to be able to do was either dynamically change to a different schema at run-time, or create an end-user that is associated with a different schema than the one the application is associated to so the user could use the one application but access a given schema.
    The scenario is that in our production environment, we need to maintain a separate schema for each client we manage data for. But we'd like to maintain one application end users would use but could run against any one of the client schemas. However, it seems that we willneed to make a copy of the application within the production workspace for each client schema that would be the owner schema if I understand how this works. Thus, if we have 7 different schemas we would have to have 7 copies of the application, one associated with each application.
    Thanks in advance!
    Monte Malenke

    Thanks Scott for quick response.
    We will go with different workspace for each schema.
    Just to give you quick background of my requirement. We have a 3 oracle E-Business versions (11.5.8, 11.5.9 and R12 in future) and APEX installed on another 11g database. We don't want to installed APEX on EBS database because of DB patching issues, our EBS 11i database version is 9i DB, future oracle EBS supoort and at the same time we want to use APEX 3.1.2 with 11g. We want use APEX for custom EBS Web UI development.
    We are planning to create separate schema on APEX database for each EBS instance and DB link which points to EBS database. Under APEX schema we are planning to create a view (on our custom table which are same across all EBS instances) using DB link under each schema.
    We will develop APEX application under one of the workspace and they deploy to other workspaces. We have also looked into creating APEX pages based on pl/sql procedure and we can do dynamic sql to query data from EBS instances. But its lots of code (create pl/sql api for every table) and we can not take a advantages of some of the APEX build-in wizard like master-detail, APEX record locking etc
    Based on your APEX experience; Do you think this the way we should go? OR Is there any better way?.
    Thanks in advance
    RK

  • DB2 to Oracle conversion using SQL Developer Migration Wizard - different schemas

    I am performing a conversion between DB2  to Oracle 11 XE, using the SQL Developer Migration Wizard. Specifically I am trying to migrate the DB2User schema over to Oracle.
    Using the migration wizard, when I pick the Oracle target connection to be the same schema ( DB2User schema ) the migration is successful and all data is converted.
    However if I pick a different Oracle target connection ( say OracleUser ) , I run into issues.
    Firstly , the table schema is not created. When I check the project output directory, the .out file has the following errors:
       CREATE USER DB2User IDENTIFIED BY DB2User DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP
            SQL Error: ORA-01031: insufficient privileges
            01031. 00000 -  "insufficient privileges"
        connect DB2User/DB2User
        Error report:
        Connection Failed
        Commit
        Connection created by CONNECT script command disconnected
    I worked around this by manually executing the .sql in the project output directory using the OracleUser id  in the new DB.
    Then I continue with the migration wizard and perform the Move Data step.
    Now - the message appears as succuessful, however, when I review the Migrationlog.xml file, i see errors as follows:
    <level>SEVERE</level>
      <class>oracle.dbtools.migration.workbench.core.logging.MigrationLogUtil</class>
      <message>Failed to disable constraints: Data Move</message>
      <key>DataMove.DISABLE_CONSTRAINTS_FAILED</key>
      <catalog>&lt;null&gt;</catalog>
      <param>Data Move</param>
      <param>oracle.dbtools.migration.workbench.core.logging.LogInfo@753f827a</param>
      <exception>
        <message>java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist</message>
      <level>WARNING</level>
      <class>oracle.dbtools.migration.datamove.online.TriggerHandler</class>
      <message>ORA-01031: insufficient privileges
    </message>
    I think what is happening is that the wizard is attempting to perform the 'move data' process using the DB2User id.
    How do I tell the wizard that the target schema is different than my source schema.
    My requirement is that I need to be able to migrate the DB2User schema to different schemas in the same Oracle database
    ( since we will have multiple test environments under the same database ) .
    Thanks in advance .
    K.

    Perhaps the following from the SQL Developer documentation is helpful for you:
    Command-Line Interface for Migration
    As an alternative to using the SQL Developer graphical interface for migration operations, you can use the migration batch file (Windows) or shell script (Linux) on the operating system command line. These files are located in the sqldeveloper\sqldeveloper\bin folder or sqldeveloper/sqldeveloper/bin directory under the location where you installed SQL Developer.
    migration.bat or migration.sh accepts these commands: capture, convert, datamove, delcaptured, delconn, delconverted, driver, generate, guide, help, idmap, info, init, lscaptured, lsconn, lsconverted, mkconn, qm, runsql, and scan. For information about the syntax and options, start by running migration without any parameters at the system command prompt. For example:
    C:\Program Files\sqldeveloper\sqldeveloper\bin>migration
    You can use the -help option for information about one or more actions. For the most detailed information, including some examples, use the -help=guide option. For example:
    C:\Program Files\sqldeveloper\sqldeveloper\bin>migration -help=guide
    Regards
    Wolfgang

  • Using different schemas

    Is there some easy way of switching between two database schemas?
    In the .jdo metadata files we have table references like this:
    <schema>.<table>
    Let's say that we for some reason have to change the name of
    the schema or have to execute the JDO code against different
    schemas. In these situations, we don't want to change the
    metadata files. Is there some property with a "default schema"
    or something similar? I tried to use the SchemaName property,
    but it didn't help.
    Thanks,
    Joakim Bissmark

    Joakim-
    The SchemaName property is meant to do that. Otherwise, if your driver
    allows you to choose the schema based on a Driver property, could can
    use the com.solarmetric.kodo.ConnectionProperties property to configure
    the Connection (see the docs on this property for more details).
    If this does not help, can you provide more information about your
    database to us? The term "schema" means different things to different
    databases.
    In article <[email protected]>, Joakim Bissmark wrote:
    Is there some easy way of switching between two database schemas?
    In the .jdo metadata files we have table references like this:
    <schema>.<table>
    Let's say that we for some reason have to change the name of
    the schema or have to execute the JDO code against different
    schemas. In these situations, we don't want to change the
    metadata files. Is there some property with a "default schema"
    or something similar? I tried to use the SchemaName property,
    but it didn't help.
    Thanks,
    Joakim Bissmark
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • Can we capture changes made to the objects other than tables using streams

    Hello All,
    I have setup a schema level streams replication using local capture process. I can capture all the DML changes on tables but have some issues capturing DDL. Even though streams are used for sharing data at different or within a database I was wondering if we can replicate the changes made to the objects like views, procedures, functions and triggers at the source database. I am not able to replicate the changes made to the views in my setup.
    Also, when I do a "select source_database,source_object_type,instantiation_scn from dba_apply_instantiated_objects" under the column 'object_type' I just see the TABLE in all the rows selected.
    Thanks,
    Sunny boy

    Hello
    This could be a problem with your rules configured with capture,propagation or apply. Or might be a problem with your instantiation.
    You can replicate Functions, Views, Procedure, Triggers etc using Streams Schema level replication or by configuring the rules.
    Please note that the objects like Functions, Views, Procedure, Triggers etc will not appear in the DBA_APPLY_INSTANTIATED_OBJECTS view. The reason is because you do a schema level instantiation only the INSTANTIATION_SCN in DBA_APPLY_INSTANTIATED_SCHEMAS is accounted for these objects. At the same time tables would get recursively instantiated and you would see an entry in DBA_APPLY_INSTANTIATED_OBJECTS.
    It works fine for me. Please see the below from my database (database is 10.2.0.3):
    on capture site_
    SQL> connect strmadmin/strmadmin
    Connected.
    SQL> select capture_name,rule_set_name,status from dba_capture;
    CAPTURE_NAME RULE_SET_NAME STATUS
    STREAMS_CAPTURE RULESET$_33 ENABLED
    SQL> select rule_name from dba_rule_set_rules where rule_set_name='RULESET$_33';
    RULE_NAME
    TEST41
    TEST40
    SQL> set long 100000
    SQL> select rule_condition from dba_rules where rule_name='TEST41';
    RULE_CONDITION
    ((:ddl.get_object_owner() = 'TEST' or :ddl.get_base_table_owner() = 'TEST') and
    :ddl.is_null_tag() = 'Y' and :ddl.get_source_database_name() = 'SOURCE.WORLD')
    SQL> select rule_condition from dba_rules where rule_name='TEST40';
    RULE_CONDITION
    ((:dml.get_object_owner() = 'TEST') and :dml.is_null_tag() = 'Y' and :dml.get_so
    urce_database_name() = 'SOURCE.WORLD')
    SQL> select * from global_name;
    GLOBAL_NAME
    SOURCE.WORLD
    SQL> conn test/test
    Connected.
    SQL> select object_name,object_type,status from user_objects;
    OBJECT_NAME OBJECT_TYPE STATUS
    TEST_NEW_TABLE TABLE VALID
    TEST_VIEW VIEW VALID
    PRC1 PROCEDURE VALID
    TRG1 TRIGGER VALID
    FUN1 FUNCTION VALID
    5 rows selected.
    on apply site_
    SQL> connect strmadmin/strmadmin
    Connected.
    SQL> col SOURCE_DATABASE for a22
    SQL> select source_database,source_object_owner,source_object_name,source_object_type,instantiation_scn
    2 from dba_apply_instantiated_objects;
    SOURCE_DATABASE SOURCE_OBJ SOURCE_OBJECT_NAME SOURCE_OBJE INSTANTIATION_SCN
    SOURCE.WORLD TEST TEST_NEW_TABLE TABLE 9886497863438
    SQL> select SOURCE_DATABASE,SOURCE_SCHEMA,INSTANTIATION_SCN from
    2 dba_apply_instantiated_schemas;
    SOURCE_DATABASE SOURCE_SCHEMA INSTANTIATION_SCN
    SOURCE.WORLD TEST 9886497863438
    SQL> select * from global_name;
    GLOBAL_NAME
    TARGET.WORLD
    SQL> conn test/test
    Connected.
    SQL> select object_name,object_type,status from user_objects;
    OBJECT_NAME OBJECT_TYPE STATUS
    TEST_VIEW VIEW VALID
    PRC1 PROCEDURE VALID
    TRG1 TRIGGER VALID
    FUN1 FUNCTION VALID
    TEST_NEW_TABLE TABLE VALID
    5 rows selected.
    These Functions, Views, Procedure, Trigger are created on the source and got replicated automatically to the target site TARGET.WORLD. And note that none of these objects are appearing in DBA_APPLY_INSTANTIATED_OBJECTS view.
    I have used the above given rules for capture. For propagation I dont have a ruleset itself and for apply I have same rules as of the capture rules.
    Please verify your environment and let me know if you need further help.
    Thanks,
    Rijesh

  • Oracle Streams setup for multiple schemas in a same database

    We are on 11.1.0.7 and will be using Oracle 11g Streams that will replicate the data real-time for two schemas between the source and target set of schemas with in the same database. We will be doing DDL as well as DML replication.
    I created the following plan and want your inputs. After implementing this, I created a table in SCOTT but it's get replicated to RPT_SCOTT later I tried inserting a row in the table created under SCOTT but that too didn't get replicated to RPT_SCOTT.
    Here are the steps that I used to set up my STREAMS -
    Database Instance:     TESTDB
    Schemas:
         Source:          SCOTT
                   HR
         Target:          RPT_SCOTT
                   RPT_HR
    Configuring Streams:
    1.     Database is in Archive log mode
    2.     Set up the Streams administrator.
    create user STRMADMIN identified by STRMADMIN default tablespace USERS temporary tablespace temp;
    grant resource, dba, AQ_ADMINISTRATOR_ROLE to STRMADMIN;
    BEGIN
    DBMS_STREAMS_AUTH.GRANT_ADMIN_PRIVILEGE(
    grantee => 'STRMADMIN',
    grant_privileges => TRUE);
    END;
    3.     Set up Streams queues
    CONNECT STRMADMIN/****
    BEGIN
    DBMS_STREAMS_ADM.SET_UP_QUEUE(
    queue_name => 'STREAMS_QUEUE',
    queue_table => 'STREAMS_QUETAB',
    queue_user => 'STRMADMIN');
    END;
    4.     Add the Apply rule
    BEGIN
    DBMS_STREAMS_ADM.ADD_SCHEMA_RULES(
    schema_name      => 'RPT_SCOTT',
    streams_type     => 'APPLY',
    streams_name     => 'APPLY_CC_STREAM',
    queue_name          => 'STRMADMIN.STREAMS_QUEUE',
    include_dml     => true,
    include_ddl     => true,
    inclusion_rule     => true,
    source_database     => 'TESTDB');
    END;
    BEGIN
    DBMS_STREAMS_ADM.ADD_SCHEMA_RULES(
    schema_name      => 'RPT_HR',
    streams_type     => 'APPLY',
    streams_name     => 'APPLY_AB_STREAM',
    queue_name          => 'STRMADMIN.STREAMS_QUEUE',
    include_dml     => true,
    include_ddl     => true,
    inclusion_rule     => true,
    source_database     => 'TESTDB');
    END;
    BEGIN
    DBMS_APPLY_ADM.ALTER_APPLY(
    apply_name     => 'APPLY_CC_STREAM',
    apply_user     => 'STRMADMIN');
    END;
    BEGIN
    DBMS_APPLY_ADM.ALTER_APPLY(
    apply_name     => 'APPLY_AB_STREAM',
    apply_user     => 'STRMADMIN');
    END;
    5.     Add the Capture Rule
    CONNECT STRMADMIN/*****
    BEGIN
    DBMS_STREAMS_ADM.ADD_SCHEMA_RULES(
    schema_name     => 'SCOTT',
    streams_type     => 'CAPTURE',
    streams_name     => 'CAPTURE_CC_STREAM',
    queue_name          => 'STRMADMIN.STREAMS_QUEUE',
    include_dml     => true,
    include_ddl     => true,
    inclusion_rule     => true,
    source_database     => 'TESTDB');
    END;
    BEGIN
    DBMS_STREAMS_ADM.ADD_SCHEMA_RULES(
    schema_name     => 'HR',
    streams_type     => 'CAPTURE',
    streams_name     => 'CAPTURE_AB_STREAM',
    queue_name          => 'STRMADMIN.STREAMS_QUEUE',
    include_dml     => true,
    include_ddl     => true,
    inclusion_rule     => true,
    source_database     => 'TESTDB');
    END;
    6.     Set the instantiation system change number (SCN)
    CONNECT STRMADMIN/******
    DECLARE
    source_scn NUMBER;
    BEGIN
    source_scn := DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER();
    DBMS_APPLY_ADM.SET_SCHEMA_INSTANTIATION_SCN (
    source_schema_name => 'SCOTT',
    source_database_name => 'TESTDB',
    instantiation_scn => source_scn);
    END;
    7.     Start the Apply
    CONNECT STRMADMIN/******
    BEGIN
    DBMS_APPLY_ADM.START_APPLY('APPLY_CC_STREAM');
    END;
    BEGIN
    DBMS_APPLY_ADM.START_APPLY('APPLY_AB_STREAM');
    END;
    8.     Start the Capture
    CONNECT STRMADMIN/******
    BEGIN
    DBMS_CAPTURE_ADM.START_CAPTURE('CAPTURE_CC_STREAM');
    END;
    BEGIN
    DBMS_CAPTURE_ADM.START_CAPTURE('CAPTURE_AB_STREAM');
    END;
    Waiting for your inputs!

    If I understand from your code, you want to do this on the same DB :
    SCOTT --> RPT_SCOTT
    HR  --> RPT_HRSo there is a schema transformation, where is it coded ?
    General info : http://download.oracle.com/docs/cd/B28359_01/server.111/b28321/strms_transform.htm
    More specific on schema rename : http://download.oracle.com/docs/cd/B28359_01/server.111/b28321/strms_mtransform.htm#CHDGDHDE
    Next : where are the initialisation of both capture schema ?
    Missing :
    execute DBMS_CAPTURE_ADM.PREPARE_SCHEMA_INSTANTIATION( schema_name          => 'scott'');
    execute DBMS_CAPTURE_ADM.PREPARE_SCHEMA_INSTANTIATION( schema_name          => 'HR'');This tell Streams from where to capture the SCN.
    Also there is an (WRONG) instantiation of SCOTT for the apply, which tells the apply to consider as valuable candidate all LCR after source_scn,
    but where is the code or RPT_HR. Alas, you put for the APPLY target schema 'SCOTT' while it should have been 'RPT_SCOTT'.
    the fact that is correct or false depends where you put the schema transformation. If you put the transformation at apply time then use the SOURCE schema name (SCOTT, HR) for the LCR will contains their name. If you put the transformation at capture time, then put target schema name for the LCR will contain their name (RPT_HR,RPT_SCOTT).
    Let's say you put the schema transformation at capture time then
    Missing:
    DBMS_APPLY_ADM.SET_SCHEMA_INSTANTIATION_SCN (
    source_schema_name => 'RPT_HR',
    source_database_name => 'TESTDB',
    instantiation_scn => source_scn);If you attache the transformation on the apply process then the code is :
    DBMS_APPLY_ADM.SET_SCHEMA_INSTANTIATION_SCN (
    source_schema_name => 'HR',
    source_database_name => 'TESTDB',
    instantiation_scn => source_scn);And this is useless:
    -- useless code
    BEGIN
    DBMS_APPLY_ADM.ALTER_APPLY(
    apply_name => 'APPLY_CC_STREAM',
    apply_user => 'STRMADMIN');
    END;
    BEGIN
    DBMS_APPLY_ADM.ALTER_APPLY(
    apply_name => 'APPLY_AB_STREAM',
    apply_user => 'STRMADMIN');
    END;
    /Last : You are using the same queue for 2 separated capture/apply transformation.
    Do yourself a favor and give each couple capture/tranform/apply its own queue.

  • SQL Query Template to a different schema

    Hi all
    I am on MII 12.2, connecting to Oracle through a data source which references user/schema "Foo"
    I would like to perform queries involving tables from schema "Bar" .
    As a consequence, when I need to access Bar tables I must reference them like "Foo.<TableName>"
    If I use an SQL query with mode Command I can freely write the prefix but no return is allowed
    If I use mode = FixedQuery(With Output) I can't prefix "Foo." because the editor prevents me from freely entering SQL code
    How can I do this? Thanks regards
    Vincenzo

    Thanks for your reply!
    Actually there is a primary key, but Streams seems to ignore it. I've also tried the SET_KEY_COLUMNS way plus supplementary logging on the source DB, but this didn't help at all. I think this is happenening because the tables are not in the TEST_HQ schema, there are only synonyms to the real tables contained in TEST_CO.
    Is there any other easy way to get Streams working between two different schemas?
    Thanks again for your help!!
    Max

  • Replication of tables in different schemas

    Hello,
    I have 2 schemas and would like to have tables (same structure), in the 2 different schemas, to be in sync.
    For eg:
    sample1.table_one
    sample2.table_one
    desc sample1.table_one is exactly the same as sample2.table_one
    I want both sample1.table_one and sample2.table_one to be in sync, when any changes are made to any one of them.
    Does Oracle 9i provide any mechanism for this or is the only obvious solution with PL/SQL and/or triggers.

    Zaid,
    If you have two identical identical tables, that contain the same data, you should just give grants to different applications based on the type of web applications and your business logic.
    Trying to replicate them and keeping in them in Sync is a tedious ( and wrong approach)
    which will will need a change (to the packages used to keep them in sync) everytime any of those table definition changes among many other problems..
    >
    With views the problem or limitation for me is that there are 2 web applications using each of the tables respectively. They have the ability to update the tables.
    This is why replication...
    >
    If you have Schema1.table1 and schema2.table1, is it not possible to change your web application code to just use one of these two schemas ? You can always write scripts to migrate the existing data from schema2 to schema 1.

Maybe you are looking for

  • Field Status Group for Special G/L Indicators

    Could you define different field status group for special G/L indicators? My problem is I am using two different special G/L indicators but their recon accounts are assigned with the same field status group. I used the same posting keys as well.  But

  • Iso 5 update fail

    i tried to update to iso 5 through itunes it failed (like it would seem everybody elses) with the error 3004. now my itunes will not detect my iphone to restore it. my iphone will not start it goes to the start up apple symbol the loading bar comes u

  • PO_INTERFACE_ERRORS

    Hi all, I have a customer who is encountering the following error in the PO_INTERFACE_ERRORS table when the receving transaction processer has run; RCV_WIP_JOB_NOT_OPEN I am not on site with the customer and this is all the detail I have. I am assumi

  • CREATE DATA TYPE TABLE

    Hi Colleagues, regarding my IDOC viewer project I'm facing a question regarding the SAP release. I started with some success on Release 471, now I tried to continue on 46C. CREATE DATA gr_ref   TYPE lvc_t_fcat."STANDARD TABLE OF LVC_S_FCAT. works in

  • Why don't transparencies and drop shadows show right in pdf on Firefox ?

    Hello, We have display problems with transparencies and drop shadows in pdf that we upload on our website. When these pdf are opened on Firefox the areas where we have used transparencies, drop shadows and color gradation end up in grey boxes. This i