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

Similar Messages

  • 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

  • Workspace manager vs. shadow tables

    Hi,
    I have the requirement to track any changes (insert/update/delete) on db tables.
    At the end the user should be able to view the change history of records in the GUI.
    The two possible methods are (in my opinion):
    a) workspace manger
    b) manage shadow tables manually (with triggers)
    Has anyone experience with workspace manager for this use case?
    What are the pros and contras of the two methods?
    Database is 10gR2
    regards
    Peter

    We are using OWB to create OLAP because you have your metadata properly defined in the design repository of OWB from where you can deploy to different databases and schemas. We are also using OWB to create tables and other relational objects instead of using SQL Developer or Toad to do so.
    Nevertheless there are some restrictions when using OWB: You cannot create programs with OWB (e.g. for limiting access to certain objects), not all aggregation operators are supported (e.g. the weighted aggregation operators like WSUM are not supported by OWB), you cannot create models, ...
    If you come to these restrictions you could write "after-deployment scripts", i.e. you deploy your dimensions and cubes from OWB and let the scripts do what you could not model with OWB.
    Hope this helps!

  • 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

  • Upgrading from 9.0.1.3 to 11.2.0.4 with Oracle Workspace Manager

    Our client has a (very old) 9.0.1.3 database on Windows 2000
    This database (and other products – but that’s not the main concern right now) needs to be upgraded to 11.2.0.4 in Windows2008R2 (64 bit).
    A complicating factor might be the use of Oracle Workspace Manager – a lot of tables are Workspace Managed.
    We can do it the long way, by upgrading it via 9.1.0.4, 10.2.0.1, 10.2.0.4 -> Export and then, on the new environment, import on 10.2.0.4 en subsequently upgrade it to 10.2.0.5 and then 11.2 (and maybe some more patching afterwards).
    But that takes way too long (downtime).
    So would it be possible to do it the “easy way”:
    Full Database Export of 9.0.1.3, import it into a brand new empty 11.2.0.4 and then upgrade Workspace Manager to 11.2 as well?
    Or should we upgrade OWM to 11.2 in the old environment - and is that possible at all?
    (FYI: Snippet from the OWM manuals : Workspace Manager supports the import and export of version-enabled tables in one of the following two ways: a full database import and export, and a workspace-level import and export through Workspace Manager procedures. No other export modes, such as schema, table, or partition level, are currently supported).
    (On purpose cross-posted in the "Workspace Manager" Forum : Upgrading from 9.0.1.3 to 11.2.0.4 with Oracle Workspace Manager

    The database is not that big (in fact there are two, both around 130Gb).
    Affordable downtime is one weekend. The long way (with all patching and upgrading) takes around 100 hours...
    We did raise an SR, but the answer was ... take the long way home ;-)
    (But, FYI, I didn't raise the SR, so I don't know what question has been asked... If the original question was "how to upgrade", you get the official statement. If you don't ask for other options, you don't get them - so I ask it here...)
    And I've seen that presentation... Thanks anyway.

  • Analytic Workspace Manager 10.2.0.3.0A posted

    A new version of Analytic Workspace Manager has been posted to the Oracle OLAP site on OTN and MetaLink.
    AWM 10.2.0.3.0A addresses the following bugs found in AWM 10.2.0.3.0:
    5949796<< Period To Date calculation incorrect when using non-Gregorian time dimension
    5889531<< Retrieval of schema list is slow upon connection
    5687603<< Stale data may be displayed while switching between Model and Object Views
    5653421<< Error using even numbers for Median Smoothing Window forecast
    5887261<< Right-click menu does not appear for non-English localesNote: the MS Windows 32-bit standalone version is found both on OTN and MetaLink (PS # 6032088) whereas the Linux x86 patch version is found only on MetaLink (PS # 6032088).
    OTN: http://www.oracle.com/technology/products/bi/olap/index.html
    MetaLink: https://metalink.oracle.com

    hello bart,
    try with oracle client 12C Oracle Database 12c Release 1 for Microsoft Windows (x64)
    Oracle client 12C contains awm 12C
    regards
    jean marc

  • Performance tuning in Cubes in Anlytic Workspace Manager 10g

    Hi,
    Can anyone tell me or suggest anything how i should i improve the performance of cube maintainance in Analytic Workspace Manager..

    generate statspack/AWR reports
    HOW To Make TUNING request
    https://forums.oracle.com/forums/thread.jspa?threadID=2174552#9360003

  • How to install analytic workspace manager?

    I have Oracle 9.2.0.1 running on Windows. I have installed 9.2.0.3 database patch. I couldn’t see analytic workspace manager tool? How to get the tool?
    I will greatly appreciate if you can guide me with some links or steps.

    Few days back I went to a Oracle Demo and there I used Analytic Workspace Manager, which is running on Windows 2000 (both database and the tool on same machine).
    It was located in
    Start menu --> Oracle home --> Integrated Management Tolls Folder.
    I couldn't see that on my 9.2.0.1 installation. So I installed the new patch 9.2.0.3, still I am not able to see that tool.
    Am I missing anything? Any other patch?

  • How to Install Analytic Workspace Manager 10.1.0.4.

    Hi,
    how to Install Analytic Workspace Manager 10.1.0.4.?
    Many thanks before.

    Thank you, we have this :
    SELECT COMP_NAME, VERSION, STATUS FROM DBA_REGISTRY WHERE COMP_NAME LIKE '%OLAP%';
    COMP_NAME VERSION STATUS
    OLAP Analytic Workspace 10.2.0.1.0 VALID
    Oracle OLAP API 10.2.0.1.0 VALID
    OLAP Catalog 10.2.0.1.0 VALID
    Is Analytic Workspace Manager installed ? How to know its version ?
    Thank you.

  • Oracle 10g Analytic Workspace Manager 10.1.0.4( where to download?)

    Guys,
    I'm looking for a link to install Oracle 10g Analytic Workspace Manager 10.1.0.4.
    Can someone help me with the link?.
    Thanks,
    Bhagat

    Thank you, we have this :
    SELECT COMP_NAME, VERSION, STATUS FROM DBA_REGISTRY WHERE COMP_NAME LIKE '%OLAP%';
    COMP_NAME VERSION STATUS
    OLAP Analytic Workspace 10.2.0.1.0 VALID
    Oracle OLAP API 10.2.0.1.0 VALID
    OLAP Catalog 10.2.0.1.0 VALID
    Is Analytic Workspace Manager installed ? How to know its version ?
    Thank you.

  • Install Analytic Workspace Manager 10.1.0.4.

    Hi,
    how to Install Analytic Workspace Manager 10.1.0.4. ?
    We are in DB 10g R2.
    It is urgent please help.
    Many thanks before.

    Thank you, we have this :
    SELECT COMP_NAME, VERSION, STATUS FROM DBA_REGISTRY WHERE COMP_NAME LIKE '%OLAP%';
    COMP_NAME VERSION STATUS
    OLAP Analytic Workspace 10.2.0.1.0 VALID
    Oracle OLAP API 10.2.0.1.0 VALID
    OLAP Catalog 10.2.0.1.0 VALID
    Is Analytic Workspace Manager installed ? How to know its version ?
    Thank you.

  • Has Anyone used View Generator in Workspace Manager 10.2.0.3A

    It does not seem to show the dimensional attributes and all the pretty pictures in the blogs/forums seem to work!!!!
    Can you tell me if I am missing something?

    Hi,
    View Generator appears to be an OLAP product, which is distinct from Workspace Manager. I would recommend to use the following forum:
    OLAP
    Regards,
    Ben

  • Analytic Workspace Manager 9.2.0.4

    Hi
    When I attempt to create a workspace in Analytic Workspace Manager an error message is displayed saying that the database I am using is not a 9.2.0.2 compatible database and the DBMS_AWM package cannot be found.
    I have, however, patched my database to 9.2.0.5. Is Analytic Workspace Manager version 9.0.4 incompatible with Oracle DB version 9.2.0.5?
    My environment setup is as follows:
    Analytic Workspace Manager (9.2.0.4)
    Oracle DB 9i Rel 2 (9.2.0.5)
    Windows XP Professional SP 2.
    Thanks
    Ryan

    AWM 9.2.0.4.1 is forward compatible on the 9.2 code stream. It works with the current 9.2.0.5.0 and 9.2.0.6 patch sets. My guess is that the Post Installation steps for the 9.2.0.5.0 patch set were not performed. For example, did the catpatch.sql script run? A lot of people overlook this required step in the readme.
    In order to check to see if your patch set was installed correctly, perform the following query:
    SQL&gt; select comp_name, version, status from dba_registry;
    You should see 9.2.0.5 and VALID for the OLAP components.

  • Does  Analytic Workspace Manager 11.2.0.3.0A  work with oracle database 12c?

    hello,
    i would like to know if AWM 11.2.0.3.0A works against with oracle database 12c in pdb mode or not .
    regards
    jm

    I have attempted to connect 11g versions of AWM to 12c and get this error:
    'This version of Analytic Workspace Manager is incompatible with the database instance. The Analytic Workspace Manager version is 11.2.0.3.0 and the database compatible version is 12.1.0.0.0'
    So unfortunately it is not compatible, and there is currently no AWM for 12c
    I also contacted Oracle support and they wont give me any information about a release date or any information on the xml template specification for 12c.
    I guess we will just have to wait till they release a version of AWM that supports 12c...
    Laszlo

  • Analytic Workspace Manager 11.2.0.3.0a and Oracle11g 11.2.0.4

    Hello!
    I'm trying to connect from Analytic Workspace Manager, version 11.2.0.3.0a (latest one), to Oracle server ver. 11.2.0.4. Connection fails with following message "This version of Analytic Workspace Manager is incompatible with the database instance.". Is there a way to make this work? The solution I'm aware of is to downgrade a server. Maybe someone knows other solutions?
    Best regards
    Bart

    hello bart,
    try with oracle client 12C Oracle Database 12c Release 1 for Microsoft Windows (x64)
    Oracle client 12C contains awm 12C
    regards
    jean marc

Maybe you are looking for