OXAR icon indicating copy to clipboard operation
OXAR copied to clipboard

Inconsistent parameter passing in Oracle scripts

Open janihur opened this issue 8 years ago • 3 comments

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.

janihur avatar Apr 17 '16 07:04 janihur

@tschf will we make any changes for this? If not can we close it?

martindsouza avatar Sep 05 '16 04:09 martindsouza

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.

  1. ACCEPT
  2. define
  3. Using sed/perl to update values in the script before running

tschf avatar Sep 05 '16 05:09 tschf

@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)

martindsouza avatar Sep 05 '16 19:09 martindsouza