Link to home
Start Free TrialLog in
Avatar of xeondxb
xeondxbFlag for United Arab Emirates

asked on

Oracle 10g Triggers on Oracle10g Different Database.

Hi,
Could you guys help me to create oracle triggers, well I have two production oracle 10g servers RAC configured  now I need to build one DR for any unforeseen circumstances, im trying to map some tables or users on DR oracle machine which data very frequently change on production for example if any value change in USER_1 (on Production) it should update on DR database so I can save time to restoring dump file on DR machine and my DR Environment  not same like production that’s why I need to map some tables and user on DR because of same configuration tables and fields are there on production environment.

OS - Windows 2003 32bit
DB – Oracle 10g
Oracle knowledge - Level beginner  
SOLUTION
Avatar of Muhammad Khan
Muhammad Khan
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
alternatively if there are not many tables which get changed, instead of triggers, i would suggest you to go for Materialized views,

you can run a job in the background to do a complete refresh/fast refresh whenever you need.

but as said in the earlier comments, they might be better if your frequency of replication is high and data is huge...
Avatar of xeondxb

ASKER

1st sorry guys i was late in reply i was busy one more issue anyway

@aiklamha:
do i need license for this ??? "Data Guard"

@slightwv:
Please suggest  me some thing which i can help me to  update  my data from from production to DR

@wasimibm:
do i have to create "Materialized views" on production side ??

im using documentum and BEA portal 10

Thanks
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of xeondxb

ASKER

@wasimibm:
so in this scenario i wont change anything on production isn't why im confirming i really don't want to touch my production coz, im not an  expert in oracle on DR side i can do anything coz, it'll be my baby.... for connection do i have to install listener on DR side to make a connection to production?  
@xeondb: Then I'm afraid, how can you achieve this in real time..
because the best possible scenarios are as mentioned earlier, oracle streams, data guard, golden gate, data mirrorig etc.. which are not of Free of Cost and do require a license

and the other ways to do these tasks are MV's, triggers, these will be almost replicatelike a real time scenario and which don't need a licensing fee.

also if you take an export from prod and import in DR it would also suffice your requirement, but this will not be like real time one..

@xeondb, if you create triggers, then also you have to create them on prod right..?

then you can actually do one thing, but this would get a little bit messy if you dont do the scripting right..

Identify all the tables where in data gets changed on frequent basis.

Identify the parent child relationships between those tables.

Schedule a job which will do these things in sequential order

Disable all constraints in DR site
truncate the existing tables in DR site.
import all data from DR site from required tables
enable the constraints..


Avatar of xeondxb

ASKER

@wasimibm: thats what i really wanted to do in the beginning now can you give me guidance how to do this ?

@xeondb: yes, will do.

You have to follow the steps i mentioned in the above comments.

1.create a database link from dr site to production site.
2. Identify all the tables where in data gets changed frequently.
3. Check the primary key and foreign key relation ships in those tables.
4.depending on the frequency you need you have to schedule a job in dr site(as you dont want to any thing on produciton).
this batch job should do the following tasks
a)
disable constraints on the tables or DR site and truncate those tables
and get the data from production again and enable the constraints
                                OR            
if you dont want to disable or enable the constraints then you can go for this approach

insert into dr_table
select * from dr_Table minus select * from prod_table
(based on the primary and foreign key relationship, table sequence should follow)




Avatar of xeondxb

ASKER

how create batch job to  start this insertion process on dr side ?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of xeondxb

ASKER

@wasimibm: Thanks sorry for reply i did not apply these things on my server coz, im rebuilding my server when it'll ready i'll try this...