OXAR
OXAR copied to clipboard
Inconsistent parameter passing in Oracle scripts
I'm writing Ansible provisioner (see #148) and run into inconsistency issues in the Oracle configuration scripts. E.g.
ACCEPT new_hr_pass CHAR PROMPT 'Please enter a password for the hr schema: ' HIDE
vs.
define new_user_name = '&1'
You've adapted oracle_config.sh
to different calling conventions, but I'm won't be such liberal in my Ansible branch. I'll adapt substitution variables for all the scripts.
Also only some scripts have
whenever sqlerror exit sql.sqlcode
and
begin
if upper(user) != 'SYS' then
raise_application_error(-20000, 'User must be SYS');
end if;
end;
even, AFAICS, all scripts should be run as SYS
and bail out in failures. Well in fact all the failures in oracle_config.sh
will go unnoticed.
@tschf will we make any changes for this? If not can we close it?
I'm in favour of a consistent style, but what are the specific examples? If it's a reusable script (outside the installation), it makes sense using the ACCEPT-HIDE mechanism (to avoid password arguments in command history). I haven't gone through to find which style is where to use a consistent approach...
I think there's actually 3 styles.
- ACCEPT
- define
- Using sed/perl to update values in the script before running
@tschf let's try to avoid sed/perl
for script configuration. I like the fact that some of our scripts are re-runnable (ex create a user, apex workspace, etc)