Unique key and foreign key in the view of materialzied

Hello world
I have one main site and 4 materialized view sites.
In my main site, I did a main group that contains my tables participating in replication.
I have a table that has a primary key, foreign key constraint unique.
In my first materialized view site I did group for my opinion

BEGIN
DBMS_REPCAT. () CREATE_MVIEW_REPGROUP
gname = > "hr_repg"
Master = > "orc1.com"
propagation_mode = > 'ASYNCHRONOUS');
END;
/

BEGIN
DBMS_REFRESH. DO)
name = > 'mviewadmin.hr_refg ',.
list = > ",
next_date = > SYSDATE,.
interval = > 'SYSDATE + 1/144',.
implicit_destroy = > FALSE,
rollback_seg = > ",
push_deferred_rpc = > TRUE,
refresh_after_errors = > FALSE);
END;
/

Then I created the materialized view

HR.test CREATE MATERIALIZED VIEW
COOL OFF QUICKLY WITH A PRIMARY FOR THE UPDATE KEY
AS SELECT * FROM [email protected]
/

BEGIN
DBMS_REPCAT. () CREATE_MVIEW_REPOBJECT
gname = > "hr_repg"
sName = > 'hr ',.
oname = > 'test ',.
Type = > "SNAPSHOT."
min_communication = > TRUE);
END;
/

BEGIN
DBMS_REFRESH. ADD)
name = > 'mviewadmin.hr_refg ',.
list = > "hr_test.test"
Lax = > TRUE);
END;
/

When I check the test (materialized view) table in the site of the materialized view to a primary key, but it has no foreign key forced unique having the base table and because my test materialized view can be changed I need to have these 2 constraint on my my materialized view. You have an idea why these 2 constraint were not created on my materialized view? And what should I do to have these two constraints.

Thanks in advance

On MView is created automatically only PK. Other constraints (check, not null, unique or FK) should be created manulay. Indexes also.
But be careful with the FK.
On ORACLE8, I found lines that are inserted to updatable mview back in deleted updating process, then inserted (downloaded on the main site). When FK is with on delete cascade that the lines of the child tables (mviews are removed too). And when the child mview is updated before mview parent you found the child missing lines.
When CF is on delete restrict that you refresh the process fails.

Tags: Database

Similar Questions

  • Please choose a unique key in the selected Recordset or click Cancel - DWCC2015 error

    I am trying to add a form to UPDATE in the PCOC assistance from the server behaviors panel and when I have it, select the unique primary key in my database table, I am presented with the following error:

    "Please choose a unique key in the selected Recordset or click Cancel.

    I tripled checked - the key that I select is correct, it is a primary key in my table of MSSQL database - it does not accept it.

    Any ideas?  Clear the Cache of DW and start over?

    Thank you.

    NJ

    As I suggested in another thread, if you really need to use the obsolete server behaviors, install Dreamweaver CS6, which is included in your subscription to creative cloud. Better yet, stop using the server behaviors. They have been deleted, because the code is desperately obsolete. It will stop working in PHP 7, coming in the next two weeks.

  • Unique key violation - the DB adapter

    Hello

    I have a composite SOA (deployed in clusters of 4 nodes) who questions database and calls a stored procedure (which invokes the records in multiple tables). Now, when I'll be large amount of data in the source database, the composite is mark and tries to insert the records in the target database. But sometimes error cases dating violation of unique key constraint while inserting records into the target database.

    Is locks of adapter DB table before inserting the records so that others may not violate the constraints and they will be able to see changes made by other SOA forums?

    Thank you!

    Yes, certainly not DbAdapter... the problem is the way you do your check and the lack of a facility of mutex in BPEL... Assuming you are using BPEL...

    Ideal scenario...

    1 check key has... There is no instance

    example 1 - insert the key... was ok

    example 2 - check button has exist......

    instance 2 - updates of key has... ok

    Parallel scenario...

    1 check key has... There is no instance

    2 check key has... There is no instance

    example 1 - insert the key... was ok

    example 2 - Insert key a... failure... duplicate a key...

    Hope you get what I'm trying to show here... There is nothing there to prevent another instance to check the existence of the key even before the first instance commits the transaction that inserted the key...

    BPEL is not a mutex AFAIK... something like the statement "synchronized" in Java for example...

    https://docs.Oracle.com/javase/tutorial/essential/concurrency/locksync.html

    Thus, you must use a different approach, for example, try and introduce first always, if the insertion fails try and update... It's 'thread safe' than the approach that you use...

    Much better is to is to abandon controls at all and always insert using the key substitution, such as sequences or guid... If you insert an Oracle database, simply use a sequence, or use the function generate GUIDs BPEL...

    https://en.Wikipedia.org/wiki/Surrogate_key

    See you soon,.

    Vlad

  • E320 unique key on the keyboard malfunction

    My 6 month old E320 (1298-3RG) has a weird malfunction. The only key to the keyboard works not is the number four, but the sign of the dollar (shift + four) DOES not work. Also ctrl + four takes me to the fourth tab when I use Chrome. If laptops saves the entry but does not reach the exit of four. I have updated the drivers of al (keyboard) but still no four. Anyone suffering from the same problem, or better, has a solution?

    I found the solution. It is a breach of the iTunesKeys. Uninstalled, Reinstalled drivers for keyboard, rebooted and reinstalled iTunesKeys. Works fine now (knocks on wood).

  • How Zoom in AND move around in the Viewer

    Hello!  Is it possible to move in the window of the observer after a zoom?  I would quickly see something in the upper part of the frame while zoomed in on the window of the observer, but the Viewer remains centered in the photo.

    WWhen you have zoomed in on the observer of a red navigation box should appear.

  • Unique key on the partitioned table range

    Hello

    We use a range of composite range-hash partitioned table

    Use index - try to do this have same tablespace to the local partitions but not liking it

    ALTER table RETAILER_TRANSACTION_COMP_POR
    Add primary key constraint RETAILER_TRANSACTION_COMP_PK (DWH_NUM)
    using index
    LOCAL


    ORA-14039: partitioning columns must be a subset of the columns in a unique index key

    Without local then fine but does not have same tablespace to walls and don't want to make this part of the partition key.

    Range Tbal partitioned - it's just a UK to avoid duplicates
    [oracle@localhost ~]$ oerr ora 14039
    14039, 00000, "partitioning columns must form a subset of key columns of a UNIQUE index"
    // *Cause:  User attempted to create a UNIQUE partitioned index whose
    //          partitioning columns do not form a subset of its key columns
    //          which is illegal
    // *Action: If the user, indeed, desired to create an index whose
    //          partitioning columns do not form a subset of its key columns,
    //          it must be created as non-UNIQUE; otherwise, correct the
    //          list of key and/or partitioning columns to ensure that the index'
    //          partitioning columns form a subset of its key columns
    
  • can you use a windows pc, or the key with the view on apple tv?

    can I use a tampon or a pc for windows air play to my apple tv?

    Yes, if that goes to iTunes. See use AirPlay to stream content from iTunes on your computer - Apple Support.

    TT2

  • Errors during insertion and update form using the VIEW.

    Here is my opinion:

    CREATE OR REPLACE FORCE 
    VIEW  "SH_ADD_EMPLOYEES_VW" ("EMP_ID", "DEPT_ID", "JOB_DESC_ID", "EMPNO", "EMP_FIRST", "EMP_LAST", "USER_NAME", "USER_INI", "DEPTNO", "DEPT_DESC", "ROLES_ID", "ADMIN", "CREATES", "APPROVES", "QUALITY", "CUST_SVC", "SH_LOCAL", 
    "SH_OFFICE", "SYSTEM") 
    AS
      select
    "SH_EMPLOYEES"."EMP_ID" as "EMP_ID",
    "SH_EMPLOYEES"."DEPT_ID" as "DEPT_ID",
    "SH_EMPLOYEES"."JOB_DESC_ID" as "JOB_DESC_ID",
    "SH_EMPLOYEES"."EMPNO"  as "EMPNO",
    "SH_EMPLOYEES"."EMP_FIRST" as "EMP_FIRST",
    "SH_EMPLOYEES"."EMP_LAST" as "EMP_LAST",
    "SH_EMPLOYEES"."USER_NAME" as "USER_NAME",
    "SH_EMPLOYEES"."USER_INI" as "USER_INI",
    "SH_EMPLOYEES"."DEPTNO" as "DEPTNO",
    "SH_EMPLOYEES"."DEPT_DESC" as "DEPT_DESC",
    "DOC_ROLES"."ROLES_ID" as "ROLES_ID",
    "DOC_ROLES"."ADMIN" as "ADMIN",
    "DOC_ROLES"."CREATES" as "CREATES",
    "DOC_ROLES"."APPROVES" as "APPROVES",
    "DOC_ROLES"."QUALITY" as "QUALITY",
    "DOC_ROLES"."CUST_SVC" as "CUST_SVC",
    "DOC_ROLES"."SH_LOCAL" as "SH_LOCAL",
    "DOC_ROLES"."SH_OFFICE" as "SH_OFFICE",
    "DOC_ROLES"."SYSTEM" as "SYSTEM"
    FROM "SH_EMPLOYEES" "SH_EMPLOYEES", "DOC_ROLES" "DOC_ROLES"
    where "SH_EMPLOYEES"."EMP_ID" = "DOC_ROLES"."EMP_ID"
    /
    
    

    Here's my trigger (note - I do not use the EXCEPTION clause or (declaration of it) because it throws an error msg = >: 'This is my message'.) Here, any help would be great as well.)

    CREATE OR REPLACE TRIGGER bi_ADD_EMPLOYEES_VW
    INSTEAD OF insert ON SH_ADD_EMPLOYEES_vw
    for each row
    declare
    duplicate_info EXCEPTION;
    PRAGMA EXCEPTION_INIT(duplicate_info, -00001);
    begin
    insert into SH_EMPLOYEES
    (EMP_ID, DEPT_ID, JOB_DESC_ID, EMPNO, EMP_FIRST, EMP_LAST, USER_NAME, USER_INI, DEPTNO, DEPT_DESC)
    values
    (:new.EMP_ID, :new.DEPT_ID, :new.JOB_DESC_ID, :new.EMPNO, :new.EMP_FIRST, :new.EMP_LAST, :new.USER_NAME, :new.USER_INI, :new.DEPTNO, :new.DEPT_DESC);
    insert into DOC_ROLES 
    (ROLES_ID, ADMIN, CREATES, APPROVES, QUALITY, CUST_SVC, SH_LOCAL, SH_OFFICE, SYSTEM)
    VALUES (
    :new.ROLES_ID, :new.ADMIN, :new.CREATES, :new.APPROVES, :new.QUALITY, :new.CUST_SVC, :new.SH_LOCAL, :new.SH_OFFICE, :new.SYSTEM);
    EXCEPTION
     WHEN duplicate_info THEN
      RAISE_APPLICATION_ERROR (
       num=> -20107
       msg=> 'Duplicate employee');
    END bi_ADD_EMPLOYEES_VW;
    /
    
    

    ERROR ON UPDATE:

    ORA-20505: DML error: p_rowid = 1001,.
    p_alt_rowid = EMP_ID, p_rowid2 = 2, p_alt_rowid2 = ROLES_ID. ORA-01779: cannot change
    a column that is mapped to a table not preserved key

    ERROR WHEN INSERTING:

    ORA-01400: cannot insert NULL in
    ("SPICE_HUNTER1". "" "" SH_EMPLOYEES '. "" EMP_ID") ORA-06512: at
    "SPICE_HUNTER1. BI_SH_ADD_EMPLOYEES_VW', line 3 ORA-04088: error during execution
    relaxing ' SPICE_HUNTER1. BI_SH_ADD_EMPLOYEES_VW' ORA-06512: at
    'SYS. WWV_DBMS_SQL', line 549 ORA-06512: at "APEX_040000.WWV_FLOW_DML", line 1121
    ORA-22816: feature not supported with RETURNING clause

    Error Impossible to process line on table SH_ADD_EMPLOYEES_VW

    I see you manage emp_id is null, you must assign a value if null sequence... This column cannot be null, where the error, and "Edit" a column of this table the DML to this id value.

  • The sight of my computer has been partially reduced to a minimum and can not get the view full screen. All around the page view is black. Help!

    My view of the Office was "restored to the bottom" permnantly and it cannot be changed. What I discovered on the computer remains low and impossible to get an overview

    Hello Noidea,

    1. When you say restored down, do you mean to say that it is minimized in the taskbar?

    2. did you of recent changes on the system?

    Method 1:

    You can try to change the resolution of the screen and check if it helps.

    Change the screen resolution

    Method 2:

    If it is a recent issue and then try to perform a restore of the system to a prior restore point you have been affected by the issue.

    Note: When you perform the system restore to restore the computer to a previous state, programs and updates that you have installed are removed.

    To run the system restore, you can consult the following link:

    How to restore Windows XP to a previous state

  • How to create a new subfolder and do appear in the view files after you import the pictures inside?  The folder does not appear after that I imported the photos.

    I use 14 elements on Windows 10.  I would like to create new subfolders in the folder view as I get pictures sent to me.  I want to keep by date.  When I import from a camera it creates folders but when I try to import them from a subfolder I created with the windows file manager, it does not appear in the Organizer.

    RonHoward wrote:

    I use 14 elements on Windows 10.  I would like to create new subfolders in the folder view as I get pictures sent to me.  I want to keep by date.  When I import from a camera it creates folders but when I try to import them from a subfolder I created with the windows file manager, it does not appear in the Organizer.

    Don't forget that your left folder tree is set to 'tree' (the little menu icon on the right of the title bar).

    Click on the + sign to the left of the main folder to display subfolders with images.

    If you want to see the subfolders without all the media files, select the master folder and right click, then choose the last option to display all of the subfolders.

  • Fields comments and missing notes for the view columns

    Hello

    Miss me the comments and notes fields for columns to display in the relational model of DM. For the columns of the table, these fields are present, so it would be nice to present to views too. The import of designer must be adapted also to import these fields.

    Joop

    Hi Joop,

    My question is about the import of the designer for these fields. This is still not resolved, not even in rel 4.0

    Actually same DM 3.3 imports comments, notes, and comments in the repository designer RDBMS.  Although comments and notes are not accessible through the user interface, they are there and you can include them in the custom report.

    Comments and notes are accessible through the INTERFACE in DM 4.0

    Philippe

  • my project is to measure the voltage and current by using the view of laboratory.

    Dear Sirs,

    I have a project to measure parameters electric ac current, voltage, power factor etc through aquisitioin of data with labview. Can I do this? If yes then kindly help me with some opinions and ideas. I'll be very grateful to you.

    Muhammad Azam Hanan.

    Student of the University of engineering and Technolgy, Lahore, Pakistan.


  • Update of the LR - where are the digits of the image and not classified in the view filter grid?

    Hello team Adobe,

    I've updated my LR to the most recent update (2015.7 / 1090788 build) that looks great, but... I'm having some trouble with the changes now affecting my work flow.

    1. where is the image numbering system in GridView?

    I watched each individual option in the 'library view Options' [COMMAND + J], but the number of image for the selected view is not available as an option.

    For example, the previous version would count the images in the grid, regardless of the selection filter applied (a star, five stars, not rated, etc...) which has been

    very useful for me. How can I get that back?

    2 - filtering options are all gone. I have to manually create each option filter manually?

    For example, to filter the images not class preset.

    Help, please! Thank you

    Known bug. Add your vote here: 2015.7 CC Lightroom: Badge numbers in the grid view not visible on the Sierra | Community customer Photoshop family

  • Applications of database account and can't question the views

    Not even run queries with db applications account we don't seem to be able to return data in the default views that I know contain data. is it all still around that?

    If you don't know how to change the settings of your tool, you can try running the script below. This will affect only this particular session.

    ALTER SESSION SET NLS_LANGUAGE= 'AMERICAN' ;
    

    See you soon

    AJ

  • index and foreign key

    I just read an article on the index.

    Jonathan Lewis - during indexing

    The author says that if you update the primary key or a unique key at the end of 'parent' of the referential integrity constraint Oracle locks the "child" table to find the rows of children committed and uncommitted if a suitable index does not exist. After that he says do not create indexes 'foreign key '. I mean, there is a contradiction. What do you think?

    delete this thread!

Maybe you are looking for

  • I have a problem with the command window terminal

    I'm doing a bootable disc. I glue in the sudo command and can't go any further. When I am invited to my password it's like my keyboard is disconnected. Comparing what I feel for YouTube videos, I noticed that I see things a little differently and may

  • laptopAJGGJ20K: annoying welcome box

    Have a new laptop. Guarantee completed box. Since the Dungeon is large blue box on say welcome on your new HP screen, you are all set and done. How can I stop this please it is very annoying, any help welcome! If remove the box, he keeps coming back

  • HP spectrum x 360 Convertible: Active pen/stylus

    I'm after an active pen/stylus for a spectrum HP x 360-13-4109na (model 2015). Any help would be great

  • Time to Conversion Timestamp problem string

    Hello I tried to convert the time string timestamp, but I failed. What is wrong with it? I need a timestamp to create waveforms.

  • Error - 80072EFE, cannot install updates.

    Original title: not windows 7, error 80072EFE. Whenever I try to update, I get the error «code 80072EFE» I don't know what to do.