Oracle11gR2 Workspace Manager and table consistency after merge

Hi folks,
     I'm working with Oracle Workspace Manager in order to get data inserted and validated into workpaces before they become available to the LIVE workspace.
     Doing some tests I found a problem about data consistency after I merge the data from a child workspace to the parent workspace.
     To be able to explain and reproduce the problem I create a simple test case:
--Create table TB_LINK
create table TB_LINK
  CD_LINK NUMBER not null,
  DS_LINK VARCHAR2(30)
--Create primary key
alter table TB_LINK add primary key (CD_LINK);
--Create table TB_GUD
create table TB_GUD
  CD_GUD  NUMBER not null,
  DS_GUD  VARCHAR2(30),
  CD_LINK NUMBER
-- Create primary key
alter table TB_GUD add primary key (CD_GUD);
-- Create foreign key 
alter table TB_GUD
  add constraint FK_TB_LINK foreign key (CD_LINK)
  references TB_LINK (CD_LINK);
-- Create sequences
create sequence SEQ_TB_GUD
minvalue 1
maxvalue 9999999999999999999999999999
start with 1
increment by 1
nocache;
create sequence SEQ_TB_LINK
minvalue 1
maxvalue 9999999999999999999999999999
start with 1
increment by 1
nocache; 
--Create Triggers
create or replace trigger "INS_TB_GUD" before insert on TB_GUD for each row
Begin
select SEQ_TB_GUD.nextval into :new.CD_GUD from dual;
end;
create or replace trigger "INS_TB_LINK" before insert on TB_LINK for each row
Begin
select SEQ_TB_LINK.nextval into :new.CD_LINK from dual;
end;
--Enable version TB_LINK and TB_GUD
EXECUTE DBMS_WM.EnableVersioning('TB_GUD','VIEW_WO_OVERWRITE',FALSE,FALSE,'UNLIMITED');
EXECUTE DBMS_WM.EnableVersioning('TB_LINK','VIEW_WO_OVERWRITE',FALSE,FALSE,'UNLIMITED');
--Create a workspace
EXECUTE DBMS_WM.CreateWorkspace ('TEST_WKS');
--Goto workspace TEST_WKS
EXECUTE dbms_wm.gotoworkspace('TEST_WKS');
--Insert data into TB_LINK and TB_GUD
INSERT INTO TB_LINK(DS_LINK) VALUES ('DS1');
INSERT INTO TB_LINK(DS_LINK) VALUES ('DS2');
INSERT INTO TB_LINK(DS_LINK) VALUES ('DS3');
INSERT INTO TB_LINK(DS_LINK) VALUES ('DS4');
COMMIT;
INSERT INTO TB_GUD(DS_GUD,CD_LINK) VALUES ('GUD1',1);
INSERT INTO TB_GUD(DS_GUD,CD_LINK) VALUES ('GUD2',2);
INSERT INTO TB_GUD(DS_GUD,CD_LINK) VALUES ('GUD3',3);
INSERT INTO TB_GUD(DS_GUD,CD_LINK) VALUES ('GUD4',4);
COMMIT;
--Checking keys
select * from tb_link;
   CD_LINK      DS_LINK
         1           DS1
         2           DS2
         3           DS3
         4           DS4
select * from tb_gud;
   CD_GUD      DS_GUD     CD_LINK
         1           GUD1              1
         2           GUD2              2
         3           GUD3              3
         4           GUD4              4
--Merge Workspace
EXECUTE DBMS_WM.MergeWorkspace ('TEST_WKS');
--Checking keys
EXECUTE dbms_wm.gotoworkspace('LIVE');
select * from tb_link;
   CD_LINK      DS_LINK
         5           DS4
         6           DS3
         7           DS1
         8           DS2
We can see that the CD_LINK got new values after merge and that was not expected.
select * from tb_gud;
   CD_GUD      DS_GUD                  CD_LINK
         6           GUD3                       3
         7           GUD1                       1
         8           GUD2                       2
         5           GUD4                       4
We can see that the CD_GUD got new values after merge and that was not expected.
Now, the values for the CD_LINK column does not have corresponding records at the TB_LINK table, as the foreign key does not exist anymore.
Could you please help me understand what is going on?
Thanks,
Luis

Hi Luis,
The reason for the difference is that the trigger is being run during the MergeWorkspace operation.  The inserts into the child workspace(TEST_WKS) translates into an insert into the LIVE workspace during merge as the rows do not yet exist.  As a result, the trigger is fired and the sequence is evaluated.  Ideally, we should not allow the PK to be modified by a sequence in this case.
You have 2 options:
(1) Check for :new.CD_GUD being null prior to using the sequence.  Any dml coming from a merge/refresh operation will have a non-null value.
(2) Turn off the trigger during dbms_wm procedures.  This can be done using dbms_wm.SetTriggerEvents.  I would assume you would only want this trigger being run for DML events.
Let me know if you have any questions.
Regards,
Ben

Similar Messages

  • Workspace Manager and APEX

    I was experimenting with using workspace manager (via DBMS_WM) to version a set of tables. Does everything I want, easily and quickly.
    However, when I update versioned objects in APEX, and then look at the HIST table, the user name is APEXPUBLIC_USER.
    I understand why this is, but does anyone know of any means of overriding the user saved in the _HIST table, using the APEX user instead.
    I had a look at the IOT on the BASE object, but didnt see where it inserts into HIST.
    Any help greatly appreciated.
    Thanks, Rob

    Hi Robert,
    some time ago I created a german how to document on Workspace Manager and APEX - you'll find it here.
    http://www.oracle.com/webfolder/technetwork/de/community/apex/tipps/wm/index.html
    Be careful - in the following text a "workspace" is not an APEX workspace but a DBMS_WM workspace.
    The "_HIST table" is not a table but a view. When version-enabling a table Workspace Manager renames the table, adds columns
    for the versioning information and creates some views. The most important view is the view which "replaces" the original table. The
    "_HIST" view is another view.
    Workspace manager also creates an INSTEAD OF trigger which "catches" the DML done on the view (which now has the name
    of the original object). That DML is being enriched with User and timestamp information and then placed into the original table
    (which now has another name).
    The user information is there because Workspace manager allows to grant privileges on "workspaces" to other users. So you ...
    * first version-enable a table
    * create a new workspace (CHANGES_1)
    * do some DML
    * grant access on your workspace to the other user say: HUGO
    Now you and HUGO can access the workspace CHANGES_1 and review your DML. All other users can only see the
    table status before your changes. So as long as you don't access the version enabled object from different database
    schemas (i.e. different parsing schemas) and you don't use the DBMS_WM.GRANT.... procedures you don't have to care
    about the APEX_PUBLIC_USER information in the HIST view.  You can live with the APEXPUBLIC_USER information.
    Does that help ...?
    Best regards
    -Carsten

  • OLAP Analytic Workspace Manager and Worksheet

    Hi,
    I have installed a datawarehouse and OLAP 10gR2 on a WinXP but in the Start menu.
    - Oracle_home, in Integrated Management Tools, I do not haveOLAP Analytic
    Workspace Manager and Worksheet.
    What is the problem ? What more should I install ?
    Many thanks for your help.

    Hi,
    What more should I install ?Did you do the OLAP catalog (dbms_olap)?
    http://www.oracle.com/technology/products/bi/samples/samples_readme.html
    Check the install docs for full instructions, and don't forget to pay your $20,000.00 license fee first:
    http://oraclestore.oracle.com/OA_HTML/ibeCCtpSctDspRte.jsp?section=11222
    http://searchoracle.techtarget.com/tip/0,289483,sid41_gci1024826,00.html?topic=299433
    Another option is Excel-DB, an easier (and less expensive) way to Oracle-enable spreadsheets:
    http://www.excel-db.net/menu_overview.htm

  • Workspace Manager and HTML DB

    Hi Folks,
    I was wondering if an HTML DB application can take advantage of
    Workspace Manager features, I mean, work with versions inside the database.
    The idea is, validate the user login and redirect it to an specific workspace ("version") of the database. Thus, I can control the data inserted by each application user, validated it and then promote it to the live database.
    TIA,
    Luis Paolini

    Hi,
    Yes you should be able to do this. The versioning of the table will be transparent to html db. When a table is versioned, the original table is renamed, and a view is created in its place with the original name. Any sql statements running against the original table, will also be able to be run against this new view.
    The creation, merging, refreshing, etc of workspaces would need be handled in the same way as any other pl/sql statement being executed by html db.
    You would also be able to create a logon trigger, which based on the user logging in, would be able to place the user in an appropriate workspace.
    Regards,
    Ben

  • Workspace Manager and tabular forms

    Does anyone know whether it is possible to use Workspace Manager with tabular forms using APEX's multi row processes?
    I tried creating a process that runs before the multi-row processes that uses gotoWorkspace() to switch to a different workspace and another process afterwards that switches back to the LIVE workspace. However, the changes go into the LIVE workspace rather than the desired workspace.
    Rodney

    Turns out my application did indeed need to be debugged. I had an explicit condition written to limit the process to certain buttons, but I also managed to add an unintended constraint that the process only run when the Add button was used. The result was that the process ran, creating a workspace, when one added a row, but didn't switch back to that workspace when one saved the new row.
    Sorry for the false alarm.
    At least I can confirm for anyone considering this option that APEX does work with Workspace Manager as long as you can enable the versioning on the tables through another means.
    Rodney

  • Can Designer 9i generate Workspace Manager versioned tables?

    All,
    I am exploring the use of the Oracle 9i feature Workspace Manager.
    Can Designer 9i generate versioned tables for a Workspace Manager enabled instance. I know that the tables could be generated to scripts and then edited to properly alter versioned tables. However manually editing each script is not a long term solution. I have read through the application help, newsgroups, and this discussion group and did not find any information.
    I welcome any input you have to offer,
    Doug

    Hi Steve,
    I'm the Product Manager. Feel free to contact me directly at [email protected] to discuss your auditing requirements.
    In general, yes, Workspace Manager can maintain a history of changes to a table.
    It can make a timestamped copy of a row every time a change to it is committed. The GotoDate command allows the user to set session context to a particular point in time to see the database (including the changed rows) as it was at that time.
    DML doesn't need to change (unless hints are needed to optimize performance). All historical copies of the rows are kept in the same table as the original row.
    Best Regards,
    Bill

  • Workspace manager and Streams

    I wanted to know if workspace manager support streams.
    If it supports, can Advanced replication and workspace manager co-exist in a database?
    We currently have advanced replication between 2 database with workspace manager installed. The tables are version enabled and replicated. We are adding a new database that is going to use Streams for data movement instead of advanced replication. I would like to know if they can co-exist?
    Thanks.

    Hi,
    There are a number of different modes in collecting data when using Streams. If the LCR records are being created using the redo log, then you would need to specify the LT table when adding support.  Otherwise, if a custom application was creating its own LCRs (for example, via triggers) it would not have to use the LT table, but could create the records based on the column values in the trigger.
    Also, I should note that it would not really be feasible to replicate the versioned tables completely using streams on top of Workspace Manager. The types of operations that I was referring to that could be performed would be moving data into a non-versioned table. For example, creating a rule so that only specified rows or a particular workspace are streamed into a table at a different database. The metadata would also need to be removed from the record, which would only be useful in a versioned environment. Aside, from these types of activities, advanced replication would need to be used.
    Regards,
    Ben

  • Firefox 3.6 won't open, it comes up in the task manager and then disappears after about 3 seconds

    Firefox 3.6 will not open, I have noticed that it loads in the task manager in windows vista 32 bit, after 3 seconds it then disappears and won't open, I have reinstalled firefox, all this did was to loose all my passwords and bookmarks, I have disabled my anti virus which is kaspersky internet security 2011, firefox still won't open, I have uninstalled various programmes and that does not work and I have loaded my laptop into safe mode and firefox still won't open,
    if anyone can help then it will be most appreciated because I am so frustrated, everything I do seems not to work with firefox, yet my other browser which is safari works every time, there was only a problem with firefox 3 days ago, I have been using firefox for over 1 and half years with no problems, I have also have scanned my pc for viruses but this has not solved the problem.

    Do any of the possible causes listed at https://support.mozilla.com/en-US/kb/Firefox+hangs#Hang_at_exit fit?
    Your Firefox settings and info are kept in a folder separate from the Firefox program, called your profile folder. Try creating a test profile, to see if the problem still occurs. See [[Managing profiles]]

  • Mass structure and table Inconsistencies after upgrade

    Hi all,
    I'm on an upgrade project upgrading system from R/3 4.6 to SAP ECC 6.0 EHP4. After the upgrade, apparently there's a mass inconsistencies that happen in the table. There's at least 1000 table which can be activated because of this inconsistencies between runtime and DDIC based on the checking run using program RUTMSJOB.
    I've tried applying note 1248769 but it does not fix the problem. I've also tried the mass checking and activation feature of report RUTMSJOB which also does not fix the problem.
    Has anybody encounter this problem before? What's your solution on this problem?
    Here's the pic of the condition of the table in my SE11
    http://img683.imageshack.us/i/64131370.jpg/
    Here's the inconsistencies which is found:
    http://img375.imageshack.us/i/47550099.jpg/
    Kindly note that the same error happen even after I implement the note correction 1248769.
    Thanks
    -Suwardi-
    Edited by: Suwardi Nursalim on Jul 9, 2010 9:40 AM - Change pic link.

    Hello Suwardi,
    please inform which actions you took in SPDD and SPAU - this is key for a problem like yours.
    Did you have a transport request ready with modifications from a previous upgrade? Please check these notes:
    #68678:   Exporting modification adjustment for second upgrade
    #610311: Importing modification adjustment in second upgrade from 620
    Lastly, did you run the upgrade with latest sapup version AND latest upgrade fix?
    Now in order to fix the problem, you'll likely have to restore from backup and perform the upgrade again. Alternatively, please check note #1406740 (are you using IBM's DB2 as your database?). If you faced the problem described on this note (which points to errors in table DD03L during EU_IMP2 phase), you need to apply FP8 like on this note.
    Then you could proceed like the following to fix the problem:
    1. Restore the backup from phase MODPROF immediately before the downtime including the /usr/sap/P01/upg/abap directory
    2. reset the Upgrade with report RSUPGRES
    3. clear the upgrade directory
    4. Start the upgrade from the very beginning after installing Fix Pack 8 for your database.
    Please let us know if this helped.
    Tomas Black

  • Difference between Analytic workspace manager and AWB

    Hi could anyone tell me the difference between AWM and AWB , . I finished designing my cube using AWB and i was planing to use OBIEE to browse and view my cube for reporting etc but it turns out that OWB cubes arent diretly compatible with OBIEE workspace we have to use AWM to make it compatible or something.. So why use OWB in the first place ???

    Hi Jan,
    The difference is that one uses a memory mapped file and one uses direct nio memory (as part of the memory allocated by the JVM process) to store the data. Both allow storing cache data off heap making it possible to store more data with a single cache node (JVM) without long GC pauses.
    If you are using a 32 bit JVM, the JVM process will be limited to a total of ~3GB on Windows and 4GB on Linux/Solaris. This includes heap and off heap memory allocation.
    Regarding the size limitations for the nio-file manager Please see the following doc for more information.
    With the release of 3.5 there is now the idea of a Partitioned backing map which helps create larger (up to 8GB of capacity) for nio storage. Please refer to the following doc.
    Both can be used to query data but it should be noted that the indexes will be stored in heap.
    hth,
    -Dave

  • Oracle Text and Workspace Manager

    Has anybody incoroporated Workspace Manager and Oracle text together. How is the Oracle Text index handled? Can users in different workspaces submit documents, have them indexed and be the only ones to see those documents?

    Hi,
    I do not have much experience with Oracle text, and am unsure exactly how it works. As such, I would suggest to file a TAR requesting this information.
    Regards,
    Ben

  • Triggers in Workspace Manager

    I've got some problems with the workspace manager and triggers in 10g:
    If you have a trigger defined on a table and you version this table, ORACLE will create 3 "instead of"-triggers on the view representing the table.
    The "content" of the trigger will be created in a wm$ procedure.
    My question is: How can I change my trigger without unversioning the table?
    As an example, consider the following two tables:
    -- Create Data Table
    CREATE TABLE MY_TABLE
         X_ID NUMBER(28) NOT NULL,
         V_TEXT VARCHAR2(200),
         V_COMMENT VARCHAR2(4000)
    -- The Table's PK
    ALTER TABLE MY_TABLE ADD CONSTRAINT PK_MY_TABLE
         PRIMARY KEY (X_ID)
    USING INDEX;
    -- Create Registry Table
    CREATE TABLE MY_REGISTRY_TABLE
         X_ID NUMBER(28) NOT NULL,
         V_OLD_TEXT VARCHAR2(200),
         V_OLD_COMMENT VARCHAR2(4000),
         V_NEW_TEXT VARCHAR2(200),
         V_NEW_COMMENT VARCHAR2(4000),
         D_WHEN DATE NOT NULL
    Now, we create a trigger that automatically registers the changes made on MY_TABLE:
    -- Create Trigger
    CREATE OR REPLACE TRIGGER TR_MY_TABLE
    AFTER INSERT OR UPDATE OR DELETE ON MY_TABLE
    FOR EACH ROW
    BEGIN
         INSERT INTO MY_REGISTRY_TABLE(
              X_ID
              ,V_OLD_TEXT
              ,V_OLD_COMMENT
              ,V_NEW_TEXT
              ,V_NEW_COMMENT
              ,D_WHEN
         VALUES (
              NVL(:old.X_ID, :new.X_ID)
              ,:old.V_TEXT
              ,:old.V_COMMENT
              ,:new.V_TEXT
              ,:new.V_COMMENT
              ,sysdate
    END TR_MY_TABLE;
    Now, we decide to version MY_TABLE.
    exec dbms_wm.enableversioning('MY_TABLE');
    This turns MY_TABLE into 2 data tables and a collection of views.
    The trigger has changed as well. The original trigger has disappeared, and there are 3 "INSTEAD OF"-triggers on the view MY_TABLE:
    OVM_Delete_102
    OVM_Insert_102
    OVM_Update_102
    These three triggers in the end call a system generated procedure:
    wm$proc_udt_187
    If I try to change this procedure, the system won't let me do that.
    So, my question is, how can I change my trigger on MY_TABLE without unversioning the table?

    Hi,
    The 3 instead of triggers are created regardless of whether the table contained a user defined trigger or not. They are primarily used to implement the DML, but are used for other things as well as you noted. To change the definition of the trigger, you would need to use the Workspace Manager DDL procedure. See section 1.8 of the user guide. Essentially, you execute dbms_wm.beginDDL on the table, update the trigger on the <table_name>LTS table that is created (the trigger will have the original name that you gave it), then execute dbmswm.commitDDL.
    Regards,
    Ben

  • Oracle10g with Workspace Manager

    Has anyone used Workspace Manager in 10g? I'm trying to draw the line between workspaces and version tables. Can someone please shed some light on this.
    Thanks,
    Bobby

    TopLink does not have a formal integration with Workspace manager but I have worked with at least one customer using them together. For basic version usage you need to ensure you force the same connection to be used and execute the appropriate stored procedures.
    I do see an opportunity for a more seamless integration to allow TopLink to automatically invoke the stored procs and to facilitate conflict resolution.
    Can you describe how you want to use workspace manager and maybe we can work out an example that meets your needs.
    Doug

  • Workspace-Manager Error-numbers

    Hi everybody,
    i have an oracle forms-application using Workspace-manager-enabled table. My problem is that i can not handle the WM-errors directly as Exceptions for they are all treated as ORA-06510-exceptions in forms. So i have to go with the error-numbers of the exceptions to cast them to a "meaningful" text. Does anybody know of a list where also the number is listed next to the Exception WM_ERROR_xxx ?
    Thanks for your help.

    Found the answer by testing:
    Raised an DBMS_WM.WM_ERROR_1 and checked sqlcode (-20001) and DBMS_WM.WM_ERROR_282 (-20282) and "guessed" the rest :-)

  • Workspace Manager download software

    Hi!
    I am trying to download the Oracle Workspace Manager 10g, but I could not find in the Oracle Workspace dowload (for the 10g release)!!!
    http://www.oracle.com/technology/software/products/workspace_mgr/index.html
    Please, somebody can help me?
    Many thanks in advance,
    Ale

    Ale,
    there are 2 prodoucts
    Oracle Workspace Manager ( for the database)
    for downloads start here http://www.oracle.com/technology/software/index.html
    for the OWM forum start here Workspace Manager
    and
    Oracle Collaborative Workspaces (part of the Collaboration Suite)
    to learn more about OCW
    http://www.oracle.com/technology/products/oworkspaces/index.html
    the to products are not releated.

Maybe you are looking for

  • 1099-MISC issue in ECC6

    This is a new ECC6 implementation and first time 1099 reporting from SAP We are facing two issues with 1099-MISC reporting. I guess these are not unique problems and you might have faced in other projects as well. 1. We have multiple vendor records/n

  • My Jsp is showing error while using tag liabrary in code

    Error(3,48): FIXED type Attribute value not equal to the default value 'http://java.sun.com/xml/ns/j2ee'. Error(4,14): Attribute 'xmlns:xsi' used but not declared. Error(5,23): Attribute 'xsi:schemaLocation' used but not declared. Error(6,12): Attrib

  • HT201210 'cannot be updated b/c firmware file is not compatible'

    What happens if I get this message while trying to update my iPhone?

  • Wrong Photo Orientation

    Hi there. I just upgraded to Z1 Compact and while copying new photos I noticed my vertically taken photos are shown rotated left. Looks like all photos are taken in Width>Height resolution 3840x2160. This is fine for horizontal photos of course but V

  • How to start on BOBJ ???

    Dear All, I am an SAP BI Consultant. I am interested in learning BOBJ. Could you please guide me in this regards.... Kind of what flow should be followed ??? Any links ??? Many Thanks. Cheers, Neel.