Rapid DDL for table - generated 3 times grants

Developer SQL version 3.2.20.09

The table is created as follows:
create table test_quick_ddl
(
  column1 varchar2(10 char),
  column2 varchar2(10 char)
);

grant select, update, insert, delete on test_quick_ddl to scott;
And "the fast DDL" generated for this table looks like:
--------------------------------------------------------
--  DDL for Table TEST_QUICK_DDL
--------------------------------------------------------

  CREATE TABLE "KTRM"."TEST_QUICK_DDL" 
   (     "COLUMN1" VARCHAR2(10 CHAR), 
     "COLUMN2" VARCHAR2(10 CHAR)
   ) SEGMENT CREATION DEFERRED 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS NOLOGGING
  TABLESPACE "KTRM" ;
  GRANT DELETE, INSERT, SELECT, UPDATE ON "KTRM"."TEST_QUICK_DDL" TO "SCOTT";
GRANT DELETE, INSERT, SELECT, UPDATE ON "KTRM"."TEST_QUICK_DDL" TO "SCOTT";
GRANT DELETE, INSERT, SELECT, UPDATE ON "KTRM"."TEST_QUICK_DDL" TO "SCOTT";

Hello world
Thanks for your efforts to report/reproduce the problem.

I am able to reproduce the problem and identified the cause of it. Working on a fix for it now.

Joyce Scapicchio
Team SQLDeveloper

Published by: Joyce Scapicchio on November 29, 2012 12:57

Tags: Database

Similar Questions

  • Select text source DDL for tables and views

    I have a script which transforms ' select the text in dba_source where the owner not like '% SYS % ';

    but who does not receive tables, views, materialized views...
    How can I do the same thing for them...

    Hello

    You can use this code

    DECLARE
       res   VARCHAR2 (4000);
    BEGIN
       FOR rec_obj IN (SELECT owner, object_name, object_type
                         FROM all_objects
                        WHERE owner NOT LIKE '%SYS%'
                          AND object_type IN ('TABLE', 'VIEW'))-- you can add others type of objects
       LOOP
          BEGIN
             SELECT DBMS_METADATA.get_ddl (rec_obj.object_type,
                                           rec_obj.object_name,
                                           rec_obj.owner
                                          )
               INTO res
               FROM DUAL;
    
             DBMS_OUTPUT.put_line (res);
          EXCEPTION
             WHEN OTHERS
             THEN
                DBMS_OUTPUT.put_line (SQLCODE || ' - ' || SQLERRM);
          END;
       END LOOP;
    END;
    
  • Get the DDL for all tables in a schema;

    Hello

    I tried to get the DDL for all tables under my own diagram "A". Here are the steps I've tried, but in vain I
     1. logged in as a user A 
    2. And the ran query 
              
    SELECT DBMS_METADATA.get_ddl ('TABLE', 'XYZ')
    FROM user_tables
          
    o/p
    (HugecloB)
    
    {code}
    
    Any idea how i can get the DDL for all the tables under my own schema ?
    
    
    Thank you so much!
    
    Edited by: user642297 on Feb 4, 2011 12:05 PM
    
    Edited by: user642297 on Feb 4, 2011 12:05 PM
    
    Edited by: user642297 on Feb 4, 2011 12:05 PM
    
    Edited by: user642297 on Feb 4, 2011 12:07 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

    Your idea is good, you missed only to use the correct table name:

    SELECT DBMS_METADATA.get_ddl ('TABLE', table_name)
    FROM user_tables;
    

    Concerning

  • Retrieve the DDL for temporary Table existing global

    HI: I'm on 10.2.0.3.

    Anyone know how to recover the DDL for TWG? For an ordinary table, I select dbms_metadata.get_ddl ('TABLE', '< table_name >', '< OWNER >') of double;

    Does not work for GTT! TIA.

    Can you elaborate a bit on "does not work"? Are you an Oracle error, for example? If so, what is the error?

    Seems to work for me on 10.2.0.1

    SQL> select * from v$version;
    
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    
    SQL> create global temporary table gtt_foo (
      2  col1 number
      3  );
    
    Table created.
    
    SQL> select object_type from user_objects
      2  where object_name = 'GTT_FOO';
    
    OBJECT_TYPE
    -------------------
    TABLE
    
    SQL> select dbms_metadata.get_ddl( 'TABLE', 'GTT_FOO' )
      2    from dual;
    
    DBMS_METADATA.GET_DDL('TABLE','GTT_FOO')
    -----------------------------------------------------------
    
      CREATE GLOBAL TEMPORARY TABLE "SCOTT"."GTT_FOO"
       (    "COL1" NUMBER
       ) ON C
    

    Justin

  • Take the minimum value for table data

    I'm storing test data in a table, with the hope that I can output the minimum value of the data. So far, I have used the table of max/min but can't make it work how I want. The test runs continuously in a loop of the holder. I get the minimum values in the table, but I would like to change the number of samples that the table contains, before it generates a minimum. The other option is that I run the test for a period of time (e.g. 3 seconds) and the table stores the data for this time then output 1 minimum value for the entire period.

    My current configuration VI is attached.

    Very appreciated

    Chris

    The size of the array in your VI is determined by the number of samples that you collect in your DAQ assistant, who is now 100 samples.  Never more, never less.

    How many samples do you want before you determine the minimum?

    Maybe what you really want to do is to build the table in the while loop and store it in a shift register, and when the loop has repeated enough times, then you take the minimum of built table.

  • Remove the automatic sequence and trigger the DDL for surrogate keys?

    Is there a way to remove the shutter and the sequence of creation for surrogate keys when export file DDL?

    I know that most of the time the auto sequence and trigger creation is welcome and very convenient.

    However I'm migrating from an old model of Designer and here only the necessary sequences are created.

    They have a different name and logical trigger is personalized (and generated outside of the Designer).

    There is a lot of code package accordingly. So, I prefer to create and use different sequences.

    Is there a way to do this? Tips are welcome. Create

    Hello

    you change preferences - "Data Modeler > model > physics > Oracle"-set "Default auto-increment DDL" and "Identity default DDL" voices against ZERO and generate the DDL for Oracle12c


    Philippe

  • Hello Mr President! I have a few questions about the Word report generation please.1.How can I add a border to a page in word? 2. How can I add gridlines to a table generated related word?. Can 3. how I add a border to a picture of the Word report?. Thank

    Hello!

    Sir, I have a few questions about generating word reports using (C language in labwindows) please.

    1. How can I add a border to a page in word?

    2. How do I add border lines and grid to a table generated in Word report (not "cvi control table"inserted from gui, I wonder about the table generated in Word report)?

    3. How can I fill a table cell of report word with the data type other than 'character '.

    And sir a question on the use of the timer in labwindows cvi please.

    Sir, I'm trying to set a time minimum interval timer to 1millisecond (0.001 s), that I have set, timer cares about the interval set by me he only meets the minimum default time interval which is, I think as 10milliseconds (I'm using windows xp service Pack 3 version 2002).

    Concerning

    Imran

    Pakistan

    Have you read this statement ? It explains how to set the registry value:

    If the REG_SZ useDefaultTimer does not already exist, you must create it under HKEY_LOCAL_MACHINE\SOFTWARE\National Instruments\CVI Run-Time Engine\cvirte. "" This can be done navigate to the appropriate folder, and then click Edit "New" string value. Then, click on means the name of the new value created, select Rename, and then specify useDefaultTimer as the name. Finally, double click on the name and specify the value True or False.

  • CRUD for tables with large number of columns

    Hello

    I work for a government agency in Colombia, and we do a poll with about 1200 variables. Our database model has few paintings, but they have a large number of columns. Our Oracle 11 g database is, and we do not use Oracle APEX. I've read about APEX and it seems to be useful to generate quick forms and reports. However, I would like to know if it is possible to generate CRUD for tables with many columns, and that would be the best way to do it.

    Thanks in advance.

    Carlos.

    With the help of 250 point on a single page is actually really bad for the user experience. I would probably be it cut into pieces and using several pages to guide the customer through it as a workflow.

    You could also add some pop-up windows which includes some elements of your table, just saved on other pages. But I probably don't like that.

    Tobias

  • Table generated by the system type: behavior or bug WAITED?

    I understand that Oracle, in the execution of a SQL statement, sometimes automatically generates objects SQL not explicitly created by the user. One such example is with table in pipeline defined functions to return a collection type of PL/SQL (as opposed to SQL): in this case, Oracle will automatically create an equivalent SQL collection type for the PL/SQL collection type. All well and good...

    However, here is an example where it would appear that oracle unnecessarily creates a SQL collection type, even when there is an explicit CONVERSION to an already existing SQL collection type. The problem seems to be related to the use of the function of COLLECTION (http://docs.oracle.com/database/121/SQLRF/functions034.htm#SQLRF06304).

    First the test script...

    prompt    -- The database version...
    
    select    *
    from    v$version
    /
    
    prompt    -- Create the test object and collection types...
    
    create or replace type OMyObject
    is object
    (
        a integer
    )
    /
    
    create or replace type NMyObjectTable
    is table of OMyObject
    /
    
    prompt    -- Check that no system-generated table types currently exist...
    
    select    C.COLL_TYPE, C.ELEM_TYPE_MOD, C.ELEM_TYPE_NAME, C.TYPE_NAME, C.UPPER_BOUND
    from    USER_COLL_TYPES c
    where    c.TYPE_NAME like 'SYS%'
    and    c.ELEM_TYPE_NAME = 'OMYOBJECT'
    /
    
    prompt    -- CAST with MULTISET does not create a system-generated table type...
    
    select    cast(multiset(
            select    new OMyObject(level)
            from    DUAL
            connect by
                level <= 10
        ) as NMyObjectTable) myObjects
    from    DUAL
    /
    
    select    C.COLL_TYPE, C.ELEM_TYPE_MOD, C.ELEM_TYPE_NAME, C.TYPE_NAME, C.UPPER_BOUND
    from    USER_COLL_TYPES c
    where    c.TYPE_NAME like 'SYS%'
    and    c.ELEM_TYPE_NAME = 'OMYOBJECT'
    /
    
    prompt    -- COLLECT without a CAST creates a new system-generated table type...
    
    select    collect(value(o)) myObjects
    from    table(cast(multiset(
            select    new OMyObject(level)
            from    DUAL
            connect by
                level <= 10
        ) as NMyObjectTable)) o
    /
    
    select    C.COLL_TYPE, C.ELEM_TYPE_MOD, C.ELEM_TYPE_NAME, C.TYPE_NAME, C.UPPER_BOUND
    from    USER_COLL_TYPES c
    where    c.TYPE_NAME like 'SYS%'
    and    c.ELEM_TYPE_NAME = 'OMYOBJECT'
    /
    
    prompt    -- (Drop the system-generated table type...)
    
    set    feedback off
    
    spool    "temp_drop_table_types.sql"
    
    select    'drop type "' || C.TYPE_NAME || '";'    as "-- Drop statement"
    from    USER_COLL_TYPES c
    where    c.TYPE_NAME like 'SYS%'
    and    c.ELEM_TYPE_NAME = 'OMYOBJECT'
    /
    
    spool    off
    
    set    feedback on
    
    @"temp_drop_table_types.sql"
    
    prompt    -- COLLECT with a CAST also creates a system-generated table type...
    
    select    cast(collect(value(o)) as NMyObjectTable) myObjects
    from    table(cast(multiset(
            select    new OMyObject(level)
            from    DUAL
            connect by
                level <= 10
        ) as NMyObjectTable)) o
    /
    
    select    C.COLL_TYPE, C.ELEM_TYPE_MOD, C.ELEM_TYPE_NAME, C.TYPE_NAME, C.UPPER_BOUND
    from    USER_COLL_TYPES c
    where    c.TYPE_NAME like 'SYS%'
    and    c.ELEM_TYPE_NAME = 'OMYOBJECT'
    /
    
    

    which outputs...

    -The version of database...

    BANNER                                                                               CON_ID

    -------------------------------------------------------------------------------- ----------

    Database Oracle 12 c Enterprise Edition Release 12.1.0.2.0 - 64 bit Production 0

    PL/SQL Release 12.1.0.2.0 - Production 0

    CORE 12.1.0.2.0 Production 0

    AMT for 64-bit Windows: Version 12.1.0.2.0 - Production 0

    NLSRTL Version 12.1.0.2.0 - Production 0

    5 selected lines.

    -Create the test object and collection types.

    Type of creation.

    Type of creation.

    -Check that there is currently no type of system-generated table...

    no selected line.

    -Cast IRON with MULTISET does not create a table generated by the system type...

    MYOBJECTS (A)

    ---------------------------------------------------

    NMYOBJECTTABLE (OMYOBJECT (1), OMYOBJECT (2), OMYOBJECT)

    (3), OMYOBJECT (4), OMYOBJECT (5), OMYOBJECT (6), OMYOBJECT

    ((7), OMYOBJECT (8), OMYOBJECT (9), OMYOBJECT (10))

    1 selected line.

    no selected line.

    -At expense LEDGES without a DISTRIBUTION creates a new type of system-generated table...

    MYOBJECTS (A)

    ---------------------------------------------------

    SYSTPUBsptM + HT5OlTJUtIcUfgg is (OMYOBJECT (1), OMYOBJEC)

    OMYOBJE, OMYOBJECT (4), (2) T, OMYOBJECT (5), OMYOBJECT (3)

    CT (6), OMYOBJECT (7), OMYOBJECT (8), OMYOBJECT (9), OMYOBJ

    ECT (10))

    1 selected line.

    COLL_TYPE ELEM_TYPE_MOD ELEM_TYPE_NAME TYPE_NAME UPPER_BOUND

    ---------- ------------- ------------------------------ ------------------------------ -----------

    TABLE OMYOBJECT SYSTPUBsptM + HT5OlTJUtIcUfgg is

    1 selected line.

    -(Drop the type generated by the system of table...)

    -Drop statement

    ---------------------------------------------------------------------------------------------------------------------------------------------

    ' Drop type' SYSTPUBsptM + HT5OlTJUtIcUfgg == ";

    Type fell.

    -At expense LEDGES with a CAST also creates a table generated by the system type...

    MYOBJECTS (A)

    ---------------------------------------------------

    NMYOBJECTTABLE (OMYOBJECT (1), OMYOBJECT (2), OMYOBJECT)

    (3), OMYOBJECT (4), OMYOBJECT (5), OMYOBJECT (6), OMYOBJECT

    ((7), OMYOBJECT (8), OMYOBJECT (9), OMYOBJECT (10))

    1 selected line.

    COLL_TYPE ELEM_TYPE_MOD ELEM_TYPE_NAME TYPE_NAME UPPER_BOUND

    ---------- ------------- ------------------------------ ------------------------------ -----------

    TABLE OMYOBJECT is SYSTPds/KlYeDTnaiTKLsbcLJpg

    1 selected line.

    This behavior is expected, or should it be considered a bug? Thoughts?

    Gerard

    This known issue and how Oracle offers with him (i.e. the SMON process periodically cleans transitional objects) is described in the Doc ID 1603706.1.

    Gerard

  • Serial number of PK column for table

    Hi Experts,

    I hung out and view object to the data control on the page jspx,.


    First VO1 as ADF, as master and primary key (PkMaster)

    Second VO2 as ADF Table, details and primary key(PkMaster,PkDetail)


    I want to add a column autoincrement PkDetail do serial for every PkMaster for the table,

    This autoincrements to the value with the number of rows in table

    When to insert a new line.


    Thanks in advance.


    JDeve 12 c

    You can call this method after calling createInsert to detail to generate new sno and place it in the column

        /**Method to generate Serial Number for Table     * ***/
    
        public void generateSerial(String voName, String columnNm) {
    
    
            ViewObjectImpl vo = (ViewObjectImpl) this.findViewObject(voName);
    
           Row curRow = vo.getCurrentRow();
    
            Integer Srno = 0;
    
           Integer max = 0;
    
           vo.setRangeSize(-1);
            Row row[] = vo.getAllRowsInRange();
    
            for (Row r : row) {
    
                try {
    
                    Srno = Integer.parseInt(r.getAttribute(columnNm).toString());
    
               } catch (NullPointerException e) {
    
                    Srno = 0;
                }
    
           if (Srno > max) {
    
                  max = Srno;
    
              }
    
           }
            max = max + 1;
    
           // System.out.println("Serial No is-" + max);
    
          curRow.setAttribute(columnNm, max);    }
    

    just pass vo name and name of the pk column detail

    Ashish

  • How to collect statistics on the table for tables in a different schema

    Hi all

    I have a table in a schema, and I want to collect statistics for the table in a different schema.

    I gave GRANT ALL ON SCHEMA1. T1 TO SCHEMA2;

    And when I tried to run the command to collect statistics to help

    DBMS_STATS. GATHER_TABLE_STATS (OWNNAME = > 'SCHMEA1', TABNAME = > 'T1');

    The function will fail.

    Is there a way we can collect statistics of the table for tables in a schema into another schema.

    Thank you
    MK.

    You must grant analyze to schema2.

    SY.

  • Potential problems for tables without primary keys and unique keys

    GoldenGate 11.2.1.0.3/Solaris 10
    DB: Oracle for Oracle (Source and target is 11.2.0.3)
    Topology: unidirectional


    In our one-way configuration GG, little of the tables being replicated is not a primary key or a Unique key.

    Last week when we have implemented GG for the test, we received warnings for these table below.
    GGSCI > add trandata WMHS_UD.crtn_dtl
    
    2013-01-12 11:34:33  WARNING OGG-00869  No unique key is defined for table 'CRTN_DTL'. All viable columns will be used to represent the key, but may not guarantee uniqueness.  KEYCOLS may be used to define the key.
    
    Logging of supplemental redo data enabled for table WMHS_UD.crtn_dtl.
    Replication seems to work very well for these tables.

    Googling, I think that there may be performance degradation when you replicate tables without PK or the United Kingdom.

    But are there other potential problems such as data of a certain kind not replicated to the lack of PK/UK?

    It really depends on the data.

    By default, GG is combining all columns as a virtual primary key but don't no conflict control by default. So when you can be sure that the record you insert into the table is unique, then it will work.
    BUT as soon as you insert the same record, which is already inserted, then you will encounter problems.

    Let me show what happens when you use an initial charge because it makes it easier to describe:
    We start at 10:00 the capture for a table. Now, you insert a record at 10:00 in the tables. When you now start an initial charge to 10.02, then check you have inserted in the database to 10.01 will be repeated two times. During the IPL as the initial charge is made to 10.02 and it includes data of 10.01 AND it will be replicated again through the process of capture/replicate.

  • RoboHelp captures together tags conditional compilation for tables

    My FrameMaker 9 tagged conditional text tables is not captured by RoboHelp 8.

    My tests show conditional text for tables in FrameMaker when imported in RoboHelp gives me a table with no tag of conditional compilation at all. If I have, in addition, the value of conditional text for the content in the table I find myself alone with an empty table. IOW, I have to "man-handle" all tables in RoboHelp... sucks big time!

    My RoboHelp settings are fine as I can see all build tags in FrameMaker in RoboHelp (they are not automatically applied to the tables). Applying the compilation conditional tags before importing FrameMaker files is never a good idea because it is not working properly. From my experience, you must always set the same conditions of generation in RoboHelp as you do in FrameMaker. IOW, repeat!

    Everyone has the same problems, or I'm doing something wrong here?

    Adobe confirms that this is a bug!

  • Install RMS 13.1 how to add limits given in the ddl for UK files?

    Hello gurus, the retail
    I installed RMS 13.1 without running the partition.ksh script during installation detail for RMS database and it has created some examples of data too, I saw the Guide installation and especially watched the stages of partitioning in the Guide, can someone give a hint, how the data limits are changed in the ddl for UK files? Since I'm a DBA, I'm a little confused, where to get this data? as the installation guide mentions that the RMS_partition_defintion.xls has modified and used for installation of production combined with partition_attributes.cfg for a production facility.
    Thanks in advance
    -Vivek

    Hi Vivek,
    Let's see...

    UK means United Kingdom of great brittain? I think that there is no UK specific DDL instructions associated with RMS.

    If you look at the Installer (unzip the zip to edelivery.oracle.com for example RMS 13.1), order folders

    V16908-01\rms_13.1_install\rms13dbschema\rms\dbschema\dbscripts_rms\examples\part
    V16908-01\rms_13.1_install\rms13dbschema\rms\dbschema\dbscripts_rms\ddl\part

    This package contains a ksh script which is driven by a script configuration and some lists of specific partitions in the data_def folder.
    This script partition.ksh can recreate DOF to other unpartitioned tables to partitioned.

    The XLS file mentioned also in this file and helps defining the number of partitions and make one or for example multidimensional (e.g. range/hash).

    The whole process is explained in a lot of details in the last chapter of the guide to implementation of goods merch-131 - impg.pdf.

    When your system already contains data, this should be saved and re-established.

    Note that indexes on partitioned tables may need too many partitioning, it takes at least some reflection on this and AFAIK the RMS installation program tries to respond to this also.

    Best regards
    Erik Ykema

    Published by: ErikYkema on October 29, 2010 08:05

  • flow of Installer for tables with source schemas and destination is different

    How to set up courses of water for tables with source schemas and destination is different? But the structure of the table is the same.

    Please paste a small example too.

    Thank you
    Bala

    Hello

    I have a concrete example of this issue, I tested in my environment. Please follow the steps below to install this on your databases.

    My global_name to database source is: REP102A. WORLD
    My global_name to database target is: REP102B. WORLD

    Source table: ORDERS. ORDER_ENTRY
    Target Table: MERCHANT NAVY. ORDER_ENTRY

    Replication will happen as follows:
         
    ORDERS. ORDER_ENTRY (REP102A)-> SHIPPING. ORDER_ENTRY (REP102B)

    Needs to follow the steps below as the one proposed at each site. You may need to make the changes required for your environment.

    SCRIPT:
    =======

    * 1. Remove the configuration of the flow of SOURCE and TARGET sites: *.

    CONNECT / as SYSDBA
    RUN DBMS_STREAMS_ADM. REMOVE_STREAMS_CONFIGURATION;
    DROP USER CASCADE STRMADMIN;

    * 2. Installation STRMADMIN user and streams queued on the Source database: *.

    CONNECT / as sysdba
    Strmadmin CREATE USER IDENTIFIED BY strmadmin;
    GRANT dba, connect, resource, aq_administrator_role to strmadmin;
    ALTER SYSTEM SET aq_tm_processes = 1;
    BEGIN
    DBMS_STREAMS_AUTH. () GRANT_ADMIN_PRIVILEGE
    dealer-online "strmadmin."
    grant_privileges => TRUE);
    END;
    /

    CONNECT strmadmin/strmadmin
    BEGIN
    DBMS_STREAMS_ADM. () SET_UP_QUEUE
    queue_table-online "streams_queue_table."
    queue_name-online "streams_capture_queue."
    queue_user-online "strmadmin");
    END;
    /

    * 3. Installation STRMADMIN user and streams queued to the database target: *.

    CONNECT / as sysdba
    Strmadmin CREATE USER IDENTIFIED BY strmadmin;
    GRANT dba, connect, resource, aq_administrator_role to strmadmin;
    ALTER SYSTEM SET aq_tm_processes = 1;
    BEGIN
    DBMS_STREAMS_AUTH. () GRANT_ADMIN_PRIVILEGE
    dealer-online "strmadmin."
    grant_privileges => TRUE);
    END;
    /

    CONNECT strmadmin/strmadmin
    BEGIN
    DBMS_STREAMS_ADM. () SET_UP_QUEUE
    queue_table-online "streams_queue_table."
    queue_name-online "streams_apply_queue."
    queue_user-online "strmadmin");
    END;
    /

    * 4. Create ORDERS. ORDER_ENTRY Table on the Source database: *.

    CREATE USER controls IDENTIFIED BY;
    GRANT connect, resource TO arrested;
    CONNECT orders/orders

    CREATE THE ORDERS TABLE. ORDER_ENTRY
    (
    order_id number (8) primary key,.
    ORDER_ITEM varchar2 (30),
    ship_no number (8)
    );

    * 5. Create shipping. Target ORDER_ENTRY Table on the database: *.

    CREATE USER IDENTIFIED BY expedition expedition;
    GRANT connect, navigation resources;
    CONNECT shipping/delivery

    CREATE TABLE EXPEDITION TO FRANCE. ORDER_ENTRY
    (
    order_id number (8) primary key,.
    ORDER_ITEM varchar2 (30),
    ship_no number (8)
    );

    * 6. On the target, add the rules to apply and create a dblink from destination to source: *.

    CONNECT strmadmin/strmadmin
    SET SERVEROUTPUT ON
    DECLARE
    v_dml_rule VARCHAR2 (80);
    v_ddl_rule VARCHAR2 (80);
    BEGIN
    DBMS_STREAMS_ADM. () ADD_TABLE_RULES
    table-name => ' EXPEDITION. ORDER_ENTRY',.
    streams_type-online "apply."
    streams_name-online "streams_apply."
    queue_name-online "strmadmin.streams_apply_queue."
    include_dml to-online true.
    include_ddl-online fake,
    include_tagged_lcr-online fake,
    source_database => ' REP102A. WORLD ',.
    dml_rule_name-online v_dml_rule,
    ddl_rule_name-online v_ddl_rule,
    inclusion_rule-online true);
    DBMS_OUTPUT. Put_line (' apply rule DML for SHIPPING.) ORDER_ENTRY => ' | v_dml_rule);
    END;
    /

    CREATE DATABASE LINK rep102a.world CONNECT TO strmadmin IDENTIFIED BY strmadmin USING 'rep102a ';
    -check the link works with:
    SELECT * from [email protected];

    BEGIN
    DBMS_APPLY_ADM. () ALTER_APPLY
    apply_name-online "streams_apply."
    apply_user-online "strmadmin");
    END;
    /

    * 7. The source adds the rules of capture, transformation, create a database link for target, add spread rules, then prepare the tables for instantiation: *.

    CONNECT strmadmin/strmadmin
    SET SERVEROUTPUT ON
    DECLARE
    v_dml_rule VARCHAR2 (80);
    v_ddl_rule VARCHAR2 (80);
    BEGIN
    DBMS_STREAMS_ADM. () ADD_TABLE_RULES
    table-name => ' ORDERS. ORDER_ENTRY',.
    streams_type-online "capture."
    streams_name-online "streams_capture."
    queue_name-online "strmadmin.streams_capture_queue."
    include_dml to-online true.
    include_ddl-online fake,
    include_tagged_lcr-online fake,
    source_database => ' REP102A. WORLD ',.
    dml_rule_name-online v_dml_rule,
    ddl_rule_name-online v_ddl_rule,
    inclusion_rule-online true);
    DBMS_OUTPUT. Put_line ('Capture DML rule for ORDERS.) ORDER_ENTRY => ' | v_dml_rule);
    -Add the schema to rename it to change ORDERS to NAVIGATION for this rule
    DBMS_STREAMS_ADM. () RENAME_SCHEMA
    nom_regle-online v_dml_rule,
    from_schema_name-online "ORDERS."
    to_schema_name-online 'EXPEDITION. "
    operation => "ADD");
    END;
    /

    CREATE DATABASE LINK rep102b.world CONNECT TO strmadmin IDENTIFIED BY strmadmin USING 'rep102b ';
    -check the link works with:
    SELECT * from [email protected];

    -post-harvest enqueues the LCR will have schema as EXPEDITION via renamed of schema processing
    -then add the rule of propagation for SHIPPING. ORDER_ENTRY

    SET SERVEROUTPUT ON
    DECLARE
    v_dml_rule VARCHAR2 (80);
    v_ddl_rule VARCHAR2 (80);
    BEGIN
    DBMS_STREAMS_ADM. () ADD_TABLE_PROPAGATION_RULES
    table-name => ' EXPEDITION. ORDER_ENTRY',.
    streams_name-online "streams_prop."
    source_queue_name-online "strmadmin.streams_capture_queue."
    destination_queue_name-online "[email protected]."
    include_dml to-online true.
    include_ddl-online fake,
    include_tagged_lcr-online fake,
    source_database => ' REP102A. WORLD ',.
    dml_rule_name-online v_dml_rule,
    ddl_rule_name-online v_ddl_rule,
    inclusion_rule to-online true.
    queue_to_queue-online fake);
    DBMS_OUTPUT. Put_line ("rule DML of Propagation for SHIPPING. ORDER_ENTRY => ' | v_dml_rule);
    END;
    /

    BEGIN
    DBMS_CAPTURE_ADM. () PREPARE_TABLE_INSTANTIATION
    table-name => ' ORDERS. ORDER_ENTRY',.
    SUPPLEMENTAL_LOGGING-online 'key');
    END;
    /

    * 8. Set the instantiation scn for ORDERS. ORDER_ENTRY on the site target and start apply: *.

    -Apply on site
    CONNECT strmadmin/strmadmin
    SET SERVEROUTPUT ON
    DECLARE
    iSCN NUMBER;
    BEGIN
    iSCN: = DBMS_FLASHBACK. [email protected] ();
    DBMS_OUTPUT. Put_line (' instantiation SCN is: ' | iSCN);
    DBMS_APPLY_ADM. () SET_TABLE_INSTANTIATION_SCN
    source_object_name => ' ORDERS. ORDER_ENTRY',.
    source_database_name => ' REP102A. WORLD ',.
    instantiation_scn-online iSCN,
    apply_database_link => NULL);
    COMMIT;
    END;
    /

    BEGIN
    DBMS_APPLY_ADM. START_APPLY ('streams_apply');
    END;
    /

    -Check if apply is enabled
    SELECT apply_name, dba_apply State;

    * 9. Start capturing on source: *.

    CONNECT strmadmin/strmadmin
    BEGIN
    DBMS_CAPTURE_ADM. START_CAPTURE ('streams_capture');
    END;
    /

    * 10. Wait capture change its status of 'CAPTURER the CHANGES' and check that the status of propagation is ENABLED: *.

    CONNECT strmadmin/strmadmin
    SELECT capture_name, State FROM v$ streams_capture;
    SELECT propagation_name, dba_propagation State;

    * 11. Perform inserts in ORDERS. Table ORDER_ENTRY on the source site: *.

    CONNECT orders/orders
    INSERT INTO orders.order_entry VALUES (23450, 'Johnny Walker', 98456);
    INSERT INTO orders.order_entry VALUES (23451, "Chivas Regal", 98457);
    COMMIT;

    * 12. On the site apply, check the DELIVERY. ORDER_ENTRY and check if the data is replicated: *.

    CONNECT shipping/delivery
    SELECT * FROM shipping.order_entry;

    * 13. Check the application errors in the queue to apply: *.

    CONNECT strmadmin/strmadmin
    SELECT apply_name, local_transaction_id, error_number, error_message FROM dba_apply_error;

    Thank you
    Florent

Maybe you are looking for