Onetime Action:
•Choose a unique prefix per Invantive Vision environment in the database. Often ‘P_’ is used for production and ‘A_’ for acceptance.
•Enter this prefix in the RDBMS User Prefix field in the screen Settings.
•Log on as user ‘system’ on the Oracle database.
•Execute the following statement (this usually happens during the installation):
grant execute on <APPLICATIE SCHEMA>.bubs_session to system
/
grant execute on <APPLICATIE SCHEMA>.itgen_maintain_my_synonyms to system
/
•Create a trigger which takes care that during the login to the database also automatically is logged in to Invantive Vision if the user is registered in Invantive Vision:
create or replace trigger set_bubs_user after logon on database
begin
--
-- Log on to development environment if available and applicable.
--
obubs.bubs_session.log_on_through_oracle;
--
-- Log on to test environment if available and applicable.
--
tbubs.bubs_session.log_on_through_oracle;
--
-- Log on to acceptance environment if available and applicable.
--
abubs.bubs_session.log_on_through_oracle;
--
-- Log on to production environment if available and applicable.
--
-- Caution: you will be logged on to multiple environments at one time. Increased
-- risk of data loss in production due to human error!
--
pbubs.bubs_session.log_on_through_oracle;
--
-- Option to automatically correct synonyms.
-- Currently not possible due to DDL. Might become autonomous in the future.
--
-- pbubs.itgen_maintain_my_synonyms('PBUBS');
exception
when others
then
null;
--
-- To debug uncomment and: raise_application_error(-20163, dbms_utility.format_error_stack || dbms_utility.format_error_backtrace);
-- you might be having al32utf8 problems when using java such as using ojdbc14 instead of ojdbc6.
--
end;
/
•As an alternative to a real development environment, you can also use the following example:
create or replace trigger set_bubs_user after logon on database
begin
if user = 'USR_HGO_BUBS'
then
execute immediate
'begin'
|| ' usr_hgo_bubs.bubs_session.set_session_info'
|| '( ''toad.sql'''
|| ', ''install'''
|| ', ''system'''
|| ', ''various'''
|| ', coalesce(sys_context(''userenv'', ''ip_address''), ''?'')'
|| ', sys_context(''userenv'', ''host'')'
|| ', ''n/a'''
|| ', ''$Header: http://svn.invantive.com/repos/p104/trunk/help/nl/manual/Topics/voorbereiding-database-eenmalig.xml 23615 2013-11-17 11:25:45Z gle3 $'' || to_char(sysdate, ''YYYYMMDDHH24MISS'')'
|| ');'
|| 'end;'
;
end if;
end;
/
•In real development environments it is also easy to turn off project security via the screen Settings or with:
update bubs_instellingen_v set isg_alle_pjt_zien_vlag='Y';
commit;