privilege for Alter fixed_date parameter [message #427414] |
Thu, 22 October 2009 08:35  |
chetanaZ
Messages: 132 Registered: October 2009 Location: UK
|
Senior Member |
|
|
Hi,
In one of our databases we need to grant users the right for changing the fixed_date parameter.
As of now we are granting privilege using
grant alter system to <username>;
But since this may cause security issue, I am looking for an alternative.
Is there anyways to grant this specific privilege, possibly without writing any trigger?
Thanks and Regards,
Chetana
|
|
|
|
Re: privilege for Alter fixed_date parameter [message #427422 is a reply to message #427414] |
Thu, 22 October 2009 09:20   |
chetanaZ
Messages: 132 Registered: October 2009 Location: UK
|
Senior Member |
|
|
Hi Michel,
It is for testing purpose
The Test team needs to run some batch processes for specfic dates to test the software.
Example would be premium calculation for system takes place on 5th of every month or arrears calculation in 10th of month etc.
I do not know exact details since the sytem is new to me.
But in my past experience such testing was carried out.
(obviously then we used to store a business date in table which we used to alter using normal DMLs)
Thanks for the good option, I will try this
Thanks and Regards,
Chetana
|
|
|
Re: privilege for Alter fixed_date parameter [message #427426 is a reply to message #427414] |
Thu, 22 October 2009 10:02   |
chetanaZ
Messages: 132 Registered: October 2009 Location: UK
|
Senior Member |
|
|
Hi Michel,
It works! Many Thanks!!
Here are the related lines
Thanks and Regards,
Chetana
conn sys / as sysdba
grant alter system to system;
conn system/<password>
create or replace procedure change_fixed_date(dt date) as
sqls1 varchar2(30):='dd-mon-yyyy hh24:mi:ss';
begin
execute immediate 'alter session set nls_date_format='''||sqls1 || '''';
execute immediate 'alter system set fixed_date='''||dt||'''';
end;
/
grant execute on change_fixed_date to a;
create user a identified by a;
grant connect to a;
grant execute on change_fixed_date to a;
conn a/a
exec change_fixed_date('01-Oct-2009 01:00:00')
|
|
|
|