ansible-oracle icon indicating copy to clipboard operation
ansible-oracle copied to clipboard

System password not correctly set when creating a DB

Open duhlig opened this issue 5 years ago • 3 comments

This is an issue between the role oradb-manage-db and the module oracle_db when SYSTEM's password differs from SYS's password.

I create a DB without a template. This means oracle-manage-db/tasks/manage-db.yml creates a response file which correctly contains SYS and SYSTEM password.

$ grep -P "^sys(tem)?Pass" /u01/stage/rsp/dbca_scxas.rsp
sysPassword=Oracle123
systemPassword=system312

So far so good. Oracle-manage-db/tasks/manage-db.yml "calls" oracle_db without the SYSTEM password. It hands over only the SYS password (and the response file and some other parameters of course). The module oracle_db always explicitely specifies -systemPassword as a parameter to dbca and expects the value for this given to the module as a parameter. It defaults to the value of parameter sys_password. In dbca the command line parameter -systemPassword obviously takes precedence over the value from the response file. As a result SYSTEM's password is the same as SYS's password and following roles (oradb-manage-profiles in my example) fail with ORA-01017 when connecting using SYSTEM.

How to change it?

  1. In oracle-manage-db/tasks/manage-db.yml set parameter system_password for oracle_db.

or

  1. In oracle_db check whether systemPassword is set in response file and also not specified as module parameter and if so don't give it as parameter to dbca.

I tend to 2. What do you think?

Kind Regards, Dietmar

duhlig avatar Mar 06 '20 11:03 duhlig

Hi Dietmar, I have the very same problem. System passwords will not be set correctly. Would be good to get a fix for this. Thanks and best regards, Matthias.

matthiaslink77 avatar Mar 09 '20 16:03 matthiaslink77

Hi - I'll look into this.

Thanks for reporting it!

oravirt avatar Mar 09 '20 17:03 oravirt

My solution is in https://github.com/duhlig/ansible-oracle-modules/commit/3baab32b9d7127aae17a47cc84feb52bd19f7e76 which is the content of https://github.com/duhlig/ansible-oracle-modules/tree/pr_dbcreate_systempw.

duhlig avatar Aug 06 '20 07:08 duhlig