![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
"Paul Murphy" <pmurphy (AT) scsinet (DOT) com> wrote in message news:NaEMa.31400$iZ3.7650 (AT) twister (DOT) nyroc.rr.com... ---snip-- I should have been more specific. They don't want to grant any maximo user account any lawson object permissions or vice versa. They're perfectly OK with me creating a totally separate user that's not part of maximo or lawson and giving it permissions on both tables. -Paul So can maximo operate on the same set of rows at the same time as lawson? If they operate on different set .. then implementing this via synonyms shouldn't be a problem. If they operate on similar set . .then even your triggers can encounter a locking problem. So what is it? They operate on similar set or different set? Anurag |
#12
| |||
| |||
|
|
On Wed, 02 Jul 2003 16:58:21 GMT, Paul Murphy <pmurphy (AT) scsinet (DOT) com wrote: I should have been more specific. They don't want to grant any maximo user account any lawson object permissions or vice versa. They're perfectly OK with me creating a totally separate user that's not part of maximo or lawson and giving it permissions on both tables. -Paul They should admit they just don't know a damn thing about Oracle and they are hiding their ignorance by making silly remarks like the above. Their story is just utter bs, and they should be sued for selling such software. Regards Sybrand Bakker, Senior Oracle DBA To reply remove -verwijderdit from my e-mail address |
#13
| |||
| |||
|
#14
| |||
| |||
|
|
OK. Here's an update. I used this trigger: CREATE OR REPLACE TRIGGER UZBMETRSYNC AFTER INSERT OR UPDATE OR DELETE ON UZB1.UZBMETR BEGIN IF INSERTING THEN DELETE FROM UZB2.UZBMETR; INSERT INTO UZB2.UZBMETR (SELECT * FROM UZB1.UZBMETR); ELSIF UPDATING THEN DELETE FROM UZB2.UZBMETR; INSERT INTO UZB2.UZBMETR (SELECT * FROM UZB1.UZBMETR); ELSIF DELETING THEN DELETE FROM UZB2.UZBMETR; INSERT INTO UZB2.UZBMETR (SELECT * FROM UZB1.UZBMETR); END IF; END; / This worked great. It kept the tables in the 2 schemas synched and it was very fast. I initially tried a truncate instead of a delete knowing that it is a faster operation, but I obviously found out you can't use truncate in a trigger. Since there are only a few hundred rows and it's fast, I figured a delete would work fine. My database background is from a web programming perspective and I'm used to just being able to execute any SQL code I want to against a database. I was somewhat shocked that I couldn't issue a truncate or a commit from inside the trigger. I wrote a stored procedure using the second account (the one whose tables the first account's trigger's are modifying, granted permission and created a private synonym in the other schema) I planned to call the SP from inside the trigger. Here's the code: CREATE OR REPLACE PROCEDURE UZBMETRCOMMIT IS BEGIN COMMIT; END; / I tried CALL UZBMETRCOMMIT; from inside the trigger, but that didn't work. I tried to find some syntax for calling a stored procedure from inside a trigger and I'm still looking with no luck so far. Here's my question: I looked in 6 Oracle books for trigger syntax and every single one of them gave examples of issuing inserts, updates and deletes inside a trigger, but none of the books said how to commit these changes. I'm definitely missing something that the authors think is quite obvious. I assume I have to issue any truncates or commits inside a stored procedure and call that procedure from the trigger, but none of these authors actually do this in their examples. TIA for any shoves in the right direction...Paul |
#15
| |||
| |||
|
|
Anurag Varma wrote: Your code is a DBA's worst nightmare. I will never recommend or accept this as a solution! |
#16
| |||
| |||
|
|
OK. Here's an update. I used this trigger: CREATE OR REPLACE TRIGGER UZBMETRSYNC AFTER INSERT OR UPDATE OR DELETE ON UZB1.UZBMETR BEGIN IF INSERTING THEN DELETE FROM UZB2.UZBMETR; INSERT INTO UZB2.UZBMETR (SELECT * FROM UZB1.UZBMETR); ELSIF UPDATING THEN DELETE FROM UZB2.UZBMETR; INSERT INTO UZB2.UZBMETR (SELECT * FROM UZB1.UZBMETR); ELSIF DELETING THEN DELETE FROM UZB2.UZBMETR; INSERT INTO UZB2.UZBMETR (SELECT * FROM UZB1.UZBMETR); END IF; END; / This worked great. It kept the tables in the 2 schemas synched and it was very fast. I initially tried a truncate instead of a delete knowing that it is a faster operation, but I obviously found out you can't use truncate in a trigger. Since there are only a few hundred rows and it's fast, I figured a delete would work fine. My database background is from a web programming perspective and I'm used to just being able to execute any SQL code I want to against a database. I was somewhat shocked that I couldn't issue a truncate or a commit from inside the trigger. I wrote a stored procedure using the second account (the one whose tables the first account's trigger's are modifying, granted permission and created a private synonym in the other schema) I planned to call the SP from inside the trigger. Here's the code: CREATE OR REPLACE PROCEDURE UZBMETRCOMMIT IS BEGIN COMMIT; END; / I tried CALL UZBMETRCOMMIT; from inside the trigger, but that didn't work. I tried to find some syntax for calling a stored procedure from inside a trigger and I'm still looking with no luck so far. Here's my question: I looked in 6 Oracle books for trigger syntax and every single one of them gave examples of issuing inserts, updates and deletes inside a trigger, but none of the books said how to commit these changes. I'm definitely missing something that the authors think is quite obvious. I assume I have to issue any truncates or commits inside a stored procedure and call that procedure from the trigger, but none of these authors actually do this in their examples. |
|
TIA for any shoves in the right direction...Paul |
#17
| |||
| |||
|
|
Anurag Varma wrote: Your code is a DBA's worst nightmare. I will never recommend or accept this as a solution! First, let me thank you and everyone else for the very good advice. Luckily, I convinced everyone to wait until next week to impliment something. Now I have time to thoroughly read about all the topics I've been asking the group about. It's quite a learning curve going from web programming against MySQL and Access to trying to do things the right way in Oracle. I passed the 9i SQL exam no problem and conceptually I have a grasp of an RDBMS, but I have very little real world experience with the specifics of running one securely and efficiently enough for a production system. There's a heck of a lot more to consider than knowing SQL and I know I have a lot to learn. Hopefully this thread will be a good teaching tool to any newcomers that are lurking. Sometimes doing things wrong and struggling to get it right is the best way to learn your lessons. Thanks again, Paul |
#18
| |||
| |||
|
|
Anurag Varma wrote: Your code is a DBA's worst nightmare. I will never recommend or accept this as a solution! |
#19
| |||
| |||
|
|
Paul Murphy wrote: Anurag Varma wrote: Your code is a DBA's worst nightmare. I will never recommend or accept this as a solution! Great news. Thanks to the help I received on this group, I was able to convince everyone that we should just use a single set of tables and use private synonyms for the other software to access them. No triggers, no duplicate tables, just a couple of synonyms. So, if any of you run into a Banner / Maximo integration problem and the vendors try to get you to mirror tables in the same database with triggers...tell them NO. |
|
Thanks again. I look forward to the day when I've got enough experience to help the future newbies that visit c.d.o.m. |

|
Paul Murphy |
![]() |
| Thread Tools | |
| Display Modes | |
| |