You can try that code, but take out the second line with the if condition for the username. That way the code always runs for everyone.
This will only work for Oracle Forms based screens. Increasingly OAF pages are used, and thus will not be affected by changes to the custom library. Plus what about concurrent requests etc - they often update data.
You can't really make a true "read-only" instance because to do so reliably would require you make the tablespaces read-only at the database level. And you can't do that because EBS writes a lot of audit data (such as user logins, when a user access a form etc). You wouldn't be able to get a valid session in a read-only instance.
So whilst the above will deal with the forms side of things, it's probably only going to solve half your problem.
Last time I needed to make a read only EBS, I wrote dynamic DDL to create triggers on EBS tables:
select 'CREATE OR REPLACE TRIGGER XXRO_'||substr(replace(replace(replace(replace(replace(replace(table_name,'ORGANIZATION','ORG'),'OPERATION','OPER'),'MATERIAL','MTL'),'TRANSACTIONS','TXN'),'DOCUMENT','DOC'),'QUANTITIES','QTY'),1,20)||'_UPD AFTER INSERT OR UPDATE OR DELETE ON '||owner||'.'||table_name||' FOR EACH ROW
lnID number := 1;
If lnID = 0 then
RAISE_APPLICATION_ERROR(-20101,''YOU ARE NOT ALLOWED TO MODIFY THE TABLE'');
/' trigger_name from dba_tables where num_rows > 10
and owner in (
select oracle_username from fnd_oracle_userid)
and table_name not in ('ICX_SESSIONS') and table_name not like 'MLOG%' and owner <> 'APPLSYS' and owner <> 'APPS'
and table_name not like 'DR%' and owner in ('GL')
order by 1;
I tried doing that but the forms does not launch after the change and are in a hung state.
Thanks for your input.
Thank you. This is helpful.