ansible-oracle-modules
ansible-oracle-modules copied to clipboard
oracle_sql run pl/sql package issue
Hi,
I am trying to run a basic sql package, but to me it seems, the parser is cutting off the line after the first semicolon. Did I miss something here again?
- name: apply application fixes by SQL
oracle_sql:
username: "{{ user_name }}"
mode: "{{ user_mode }}"
password: "{{ user_password }}"
service_name: "{{ service_name }}"
script: "{{ script_name }}"
environment: "{{oracle_env}}"
The script currently only consists of this one command:
BEGIN DBMS_STATS.set_global_prefs ( pname => 'CONCURRENT', pvalue => 'ALL'); END; /
The output is as follows:
TASK [apply application fixes by SQL] ************************************************************************************************************************************
fatal: [
I already tried several syntax variations, but none made it work for me. What am I missing?
Best regards, Matthias.
Hi,
The oracle_sql
module is pretty much in a perpetual alpha state as I haven't really done anything with it for about 2 years.
I will look into this, but it's unfortunately not a priority at the moment.
There is a oracle_stat_prefs
module that should be able to help with at least the stats prefs issue.
Thanks - I will take a look at it!
I assume the part to check would be here:
... else: sqlfile = read_file(module, script) sqlfile = clean_sqlfile(sqlfile) sqldelim = ';' if 'create or replace' in sqlfile.lower(): sqldelim = '/'
So this might need a modification?
Best regards, Matthias.
Hi Mikael, did you have a chance to look at this? Would be highly appreciated? Best regards, Matthias.
Hi, I (hopefully) did a quick fix for this. Try it and let me know if it works out.
And just a note: If you want to manage database objects, you definitely should look into something like liquibase
or flyway
instead of using this module.
Also getting the same error. Any chances on this being fixed?
Hi,
I refactored oracle_sql module. You can find it here : https://github.com/ari-stark/ansible-oracle-modules/blob/devel/plugins/modules/oracle_sql.py.
It works for me, from simple request to several procedures. Tell me if it helps.