From da7f6f2e68c2b5819ce54d4a2e015ad580a425b8 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 10 Feb 2021 17:04:16 -0300 Subject: [PATCH 001/229] Update README.md --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index 31f8685..ccb1cd3 100644 --- a/README.md +++ b/README.md @@ -80,10 +80,3 @@ _P.S: Note that all the 5 parameters above are independent._ * A shared folder between your machine and the VirtualBox VM must exists and properly configured in config_vars.yml. * Base Image used for each release must already have latest OPatch version. * VM must be configured to have the network interface auto-started as soon as snapshot is loaded. - -## Versions ## -* v1.05 (2020-01-04) by Rodrigo Jorge -* v1.04 (2019-08-04) by Rodrigo Jorge -* v1.03 (2019-06-05) by Rodrigo Jorge -* v1.02 (2019-05-17) by Rodrigo Jorge -* v1.01 (2019-05-13) by Rodrigo Jorge \ No newline at end of file From 1405616b3c2a7578f05b61b939d048f639d7e4b3 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 28 Apr 2021 00:42:34 -0300 Subject: [PATCH 002/229] v1.08 - Included 2021-Apr patches. --- ansible.cfg | 3 ++- config_vars.yml | 2 +- list_exceptions.yml | 4 +++- list_patches.yml | 24 ++++++++++++++++++++++++ 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/ansible.cfg b/ansible.cfg index bfb3f6f..fa8af7a 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -27,4 +27,5 @@ timeout = 30 [ssh_connection] pipelining = true -ssh_args = "-o ServerAliveInterval=60" \ No newline at end of file +#ssh_args = "-o ServerAliveInterval=60" +ssh_args = "-o ControlMaster=auto -o ControlPersist=3600s -o ServerAliveInterval=60 -o ServerAliveCountMax=20" \ No newline at end of file diff --git a/config_vars.yml b/config_vars.yml index 7cff357..a6f73cd 100644 --- a/config_vars.yml +++ b/config_vars.yml @@ -39,7 +39,7 @@ skip_dump_exists: true # When loader is executed, you can specify a strict snapshot to be used for loading all dumps of each version. If null, will be used the one specified for each version in list_versions. loader_VM_machine : "Oracle Linux 7.6" -loader_VM_snapshot : "19.0.0.0 RU 10" +loader_VM_snapshot : "19.0.0.0 RU 11" loader_VM_IP : "192.168.56.102" # Files in "user_scripts" folder that will run before and after the final expdp. diff --git a/list_exceptions.yml b/list_exceptions.yml index 9dc8783..c16c1f5 100644 --- a/list_exceptions.yml +++ b/list_exceptions.yml @@ -28,4 +28,6 @@ list_retry_datapatch: - { version: "12.1.0.2" , type : "PSU" , id : 210119 , retries : 2 } - { version: "12.1.0.2" , type : "BP" , id : 210119 , retries : 2 } - { version: "12.2.0.1" , type : "RU" , id : 210119 , retries : 1 } - - { version: "12.2.0.1" , type : "RUR" , id : 210119 , retries : 1 } + - { version: "12.1.0.2" , type : "PSU" , id : 210420 , retries : 2 } + - { version: "12.1.0.2" , type : "BP" , id : 210420 , retries : 2 } + - { version: "12.2.0.1" , type : "RU" , id : 210420 , retries : 1 } diff --git a/list_patches.yml b/list_patches.yml index 5562b66..461ff16 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -34,6 +34,7 @@ list_11204: - { type : "PSU" , id : 200714 , patch_number : 31103343 } - { type : "PSU" , id : 201020 , patch_number : 31537677 } - { type : "PSU" , id : 210119 , patch_number : 31983472 } + - { type : "PSU" , id : 210420 , patch_number : 32328626 } - { type : "OJVM" , id : 1 , patch_number : 19282021 } - { type : "OJVM" , id : 2 , patch_number : 19877440 } - { type : "OJVM" , id : 3 , patch_number : 20406239 } @@ -60,6 +61,7 @@ list_11204: - { type : "OJVM" , id : 200714 , patch_number : 31219953 } - { type : "OJVM" , id : 201020 , patch_number : 31668908 } # - { type : "OJVM" , id : 210119 , patch_number : } + - { type : "OJVM" , id : 210420 , patch_number : 32671980 } - { type : "BP" , id : 1 , patch_number : 17628025 , patch_folder : 17628006 } - { type : "BP" , id : 2 , patch_number : 17838803 , patch_folder : 17741631 } - { type : "BP" , id : 3 , patch_number : 17904156 , patch_folder : 17943261 } @@ -102,6 +104,7 @@ list_11204: - { type : "BP" , id : 200714 , patch_number : 31220011 , patch_folder : 31103314 } - { type : "BP" , id : 201020 , patch_number : 31718644 , patch_folder : 31537652 } - { type : "BP" , id : 210119 , patch_number : 32131241 , patch_folder : 31983477 } + - { type : "BP" , id : 210420 , patch_number : 32537095 , patch_folder : 32328629 } #################### ##### 12.1.0.1 ##### @@ -133,6 +136,8 @@ list_12101: ##### 12.1.0.2 ##### #################### +# Database 12.1.0.2 Proactive Patch Information (Doc ID 2285558.1) + list_12102: - { type : "PSU" , id : 1 , patch_number : 19303936 } - { type : "PSU" , id : 2 , patch_number : 19769480 } @@ -161,6 +166,7 @@ list_12102: - { type : "PSU" , id : 200714 , patch_number : 31113348 } - { type : "PSU" , id : 201020 , patch_number : 31550110 } - { type : "PSU" , id : 210119 , patch_number : 31985579 } + - { type : "PSU" , id : 210420 , patch_number : 32328635 } - { type : "OJVM" , id : 1 , patch_number : 19282028 } - { type : "OJVM" , id : 2 , patch_number : 19877336 } - { type : "OJVM" , id : 3 , patch_number : 20415564 } @@ -187,6 +193,7 @@ list_12102: - { type : "OJVM" , id : 200714 , patch_number : 31219939 } - { type : "OJVM" , id : 201020 , patch_number : 31668915 } - { type : "OJVM" , id : 210119 , patch_number : 32119956 } + - { type : "OJVM" , id : 210420 , patch_number : 32473164 } - { type : "BP" , id : 1 , patch_number : 19404326 , patch_folder : 19189240 } - { type : "BP" , id : 2 , patch_number : 19774304 , patch_folder : 19649591 } - { type : "BP" , id : 3 , patch_number : 20026159 , patch_folder : 19878106 } @@ -222,12 +229,15 @@ list_12102: - { type : "BP" , id : 200714 , patch_number : 31307682 , patch_folder : 31001106 } - { type : "BP" , id : 201020 , patch_number : 31718813 , patch_folder : 31511219 } - { type : "BP" , id : 210119 , patch_number : 32131231 , patch_folder : 31965033 } + - { type : "BP" , id : 210420 , patch_number : 32518631 , patch_folder : 32328632 } #################### ##### 12.2.0.1 ##### #################### +# Database 12.2.0.1 Proactive Patch Information (Doc ID 2285557.1) + list_12201: - { type : "RU" , id : 170718 , patch_number : 26123830 } - { type : "RU" , id : 170814 , patch_number : 26609817 } @@ -245,6 +255,7 @@ list_12201: - { type : "RU" , id : 200714 , patch_number : 31312468 } - { type : "RU" , id : 201020 , patch_number : 31741641 } - { type : "RU" , id : 210119 , patch_number : 32228578 } + - { type : "RU" , id : 210420 , patch_number : 32507738 } - { type : "RUR" , id : 171017 , patch_number : 26518812 , base_ru : JUL2017 } - { type : "RUR" , id : 180116 , patch_number : 27013506 , base_ru : JUL2017 } - { type : "RUR" , id : 180116 , patch_number : 27013510 , base_ru : OCT2017 } @@ -285,11 +296,14 @@ list_12201: - { type : "OJVM" , id : 200714 , patch_number : 31219919 } - { type : "OJVM" , id : 201020 , patch_number : 31668898 } - { type : "OJVM" , id : 210119 , patch_number : 32119931 } + - { type : "OJVM" , id : 210420 , patch_number : 32473172 } #################### ##### 18.0.0.0 ##### #################### +# Database 18 Proactive Patch Information (Doc ID 2369376.1) + list_18000: - { type : "RU" , id : 2 , patch_number : 27676517 } - { type : "RU" , id : 3 , patch_number : 28090523 } @@ -303,6 +317,7 @@ list_18000: - { type : "RU" , id : 11 , patch_number : 31308624 } - { type : "RU" , id : 12 , patch_number : 31730250 } - { type : "RU" , id : 13 , patch_number : 32204699 } + - { type : "RU" , id : 14 , patch_number : 32524155 } - { type : "RUR" , id : 1 , patch_number : 28346593 , base_ru : '18.2' } - { type : "RUR" , id : 2 , patch_number : 28601267 , base_ru : '18.2' } - { type : "RUR" , id : 1 , patch_number : 28507480 , base_ru : '18.3' } @@ -324,6 +339,8 @@ list_18000: - { type : "RUR" , id : 1 , patch_number : 31666917 , base_ru : '18.11' } - { type : "RUR" , id : 2 , patch_number : 32066686 , base_ru : '18.11' } - { type : "RUR" , id : 1 , patch_number : 32072459 , base_ru : '18.12' } + - { type : "RUR" , id : 2 , patch_number : 32421478 , base_ru : '18.12' } + - { type : "RUR" , id : 1 , patch_number : 32451079 , base_ru : '18.13' } - { type : "OJVM" , id : 180417 , patch_number : 27636900 } - { type : "OJVM" , id : 180717 , patch_number : 27923415 } - { type : "OJVM" , id : 181016 , patch_number : 28502229 } @@ -336,11 +353,14 @@ list_18000: - { type : "OJVM" , id : 200714 , patch_number : 31219909 } - { type : "OJVM" , id : 201020 , patch_number : 31668892 } - { type : "OJVM" , id : 210119 , patch_number : 32119939 } + - { type : "OJVM" , id : 210420 , patch_number : 32552752 } #################### ##### 19.0.0.0 ##### #################### +# Oracle Database 19c Proactive Patch Information (Doc ID 2521164.1) + list_19000: - { type : "RU" , id : 3 , patch_number : 29517242 , base_snap : "19.2.0" } - { type : "RU" , id : 4 , patch_number : 29834717 } @@ -350,6 +370,7 @@ list_19000: - { type : "RU" , id : 8 , patch_number : 31281355 } - { type : "RU" , id : 9 , patch_number : 31771877 } - { type : "RU" , id : 10 , patch_number : 32218454 } + - { type : "RU" , id : 11 , patch_number : 32545013 } - { type : "RUR" , id : 1 , patch_number : 29799057 , base_ru : '19.3' } - { type : "RUR" , id : 2 , patch_number : 30087906 , base_ru : '19.3' } - { type : "RUR" , id : 1 , patch_number : 30080447 , base_ru : '19.4' } @@ -363,6 +384,8 @@ list_19000: - { type : "RUR" , id : 1 , patch_number : 31666885 , base_ru : '19.8' } - { type : "RUR" , id : 2 , patch_number : 32066676 , base_ru : '19.8' } - { type : "RUR" , id : 1 , patch_number : 32072711 , base_ru : '19.9' } + - { type : "RUR" , id : 2 , patch_number : 32421507 , base_ru : '19.9' } + - { type : "RUR" , id : 1 , patch_number : 32441092 , base_ru : '19.10' } - { type : "OJVM" , id : 190416 , patch_number : 29548437 } - { type : "OJVM" , id : 190716 , patch_number : 29774421 } - { type : "OJVM" , id : 191015 , patch_number : 30128191 } @@ -371,3 +394,4 @@ list_19000: - { type : "OJVM" , id : 200714 , patch_number : 31219897 } - { type : "OJVM" , id : 201020 , patch_number : 31668882 } - { type : "OJVM" , id : 210119 , patch_number : 32067171 } + - { type : "OJVM" , id : 210420 , patch_number : 32399816 } From 1a8e1c450fe093fb5ccf661de555c6236b0bacf2 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 3 May 2021 14:56:35 -0300 Subject: [PATCH 003/229] Small fixes --- README.md | 2 +- config_vars.yml | 7 ++++--- examples.sh | 20 ++++++++++++++++++++ loader.yml | 1 - main.yml | 1 - 5 files changed, 25 insertions(+), 6 deletions(-) create mode 100755 examples.sh diff --git a/README.md b/README.md index ccb1cd3..535081d 100644 --- a/README.md +++ b/README.md @@ -78,5 +78,5 @@ _P.S: Note that all the 5 parameters above are independent._ * Passwordless SSH connection to VM user. * Passwordless sudo to root for VM user. * A shared folder between your machine and the VirtualBox VM must exists and properly configured in config_vars.yml. -* Base Image used for each release must already have latest OPatch version. +* Base Image used for each release. * VM must be configured to have the network interface auto-started as soon as snapshot is loaded. diff --git a/config_vars.yml b/config_vars.yml index a6f73cd..ab97c5c 100644 --- a/config_vars.yml +++ b/config_vars.yml @@ -1,7 +1,7 @@ # Folder where the database patches are placed. The patches can also be placed in sub-folders of the directory specified below. source_folder : "/Volumes/Untitled/Rodrigo/ORACHKSUM/DB\ Install" -# Folder in RW mode on your compute shared with VM to process files. +# Folder in RW mode on local compute and shared with the VM. It is used to process the files. shared_folder : "/Users/rodrigo.jorge/Desktop/extract" # Path of the folder mounted within the VM. @@ -10,7 +10,7 @@ VM_folder : "/media/sf_Patch/" # Oracle SID. Must be included in /etc/oratab for oraenv utility. mysid : "orcl" -# Folder to store the final generated DB dump +# Folder to store the final generated DB expdp dumpfiles. dump_folder : "/Volumes/Samsung_T3/OraSum/files/exp" # Files in "user_scripts" folder that will run before and after the final expdp. script_types can be "shell", "sql" or "yml". @@ -49,4 +49,5 @@ user_impdp_pre : user_impdp_post : - { file : "fileLoad.yml" , folder : "user_scripts/load" , type : "yml" , task_action : "Load chksum table" } -- { file : "insert_all_exec.sql" , folder : "user_scripts/load" , type : "sql" , task_action : "Create consolidated tables" } \ No newline at end of file +- { file : "insert_all_exec.sql" , folder : "user_scripts/load" , type : "sql" , task_action : "Create consolidated tables" } +- { file : "changed_object.sql" , folder : "user_scripts/report" , type : "sql" , task_action : "Create list of changed objects" } \ No newline at end of file diff --git a/examples.sh b/examples.sh new file mode 100755 index 0000000..2aaf573 --- /dev/null +++ b/examples.sh @@ -0,0 +1,20 @@ +ansible-playbook main.yml --extra-vars "param_type=OJVM" +ansible-playbook main.yml --extra-vars "param_version=12.1.0.2 param_patch=191015" +ansible-playbook main.yml --extra-vars "param_version=18.0.0.0 param_type=OJVM param_patch=190716" +ansible-playbook main.yml --extra-vars "param_version=12.2.0.1 param_type=RU param_patch=191015" +### +while true +do + ssh rodrigo@192.168.56.101 '(ps -fu oracle | grep -q pmon) && printf "set lines 10000 pages 10000\nselect count(*) from dba_objects;" | sudo su - oracle -c "sqlplus / as sysdba"' + sleep 60 +done +### +while true +do + #ansible-playbook main.yml --extra-vars "param_version=19.0.0.0" + ansible-playbook main.yml + ret=$? + [ $ret -eq 0 ] && break +done +### +ansible-playbook loader.yml \ No newline at end of file diff --git a/loader.yml b/loader.yml index 8fd5d3e..db6425f 100644 --- a/loader.yml +++ b/loader.yml @@ -17,7 +17,6 @@ #************************************************************************ # Available at: https://github.com/dbarj/oracle_patch_loop/ # Created on: May/2019 by Rodrigo Jorge -# Version 1.02 #************************************************************************ - hosts: localhost diff --git a/main.yml b/main.yml index d02b71e..ef532f1 100644 --- a/main.yml +++ b/main.yml @@ -17,7 +17,6 @@ #************************************************************************ # Available at: https://github.com/dbarj/oracle_patch_loop/ # Created on: May/2019 by Rodrigo Jorge -# Version 1.05 #************************************************************************ - hosts: localhost From 1eed58760d2cab1b13dee353fc2e6d6f7bbb9dd6 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 18 Jun 2021 18:59:37 -0300 Subject: [PATCH 004/229] Adapt script to handle OCI --- ansible.cfg | 2 +- config_main.yml | 2 + config_oci.yml | 38 +++++++ config_vars.yml => config_vbox.yml | 6 +- main.yml | 15 ++- patch_sql/startupForce.sql | 2 + .../meta/main.yml | 2 + .../tasks/main.yml | 47 ++++++++ tasks/impdp_file.yml | 6 +- tasks/lvm_reload.yml | 27 +++++ tasks/main_PSU_BP.yml | 30 ++++- tasks/patch_main_11g.yml | 17 +-- tasks/patch_tasks_post.yml | 4 +- tasks/patch_tasks_pre.yml | 23 ++-- tasks/setup_database.yml | 60 +++++----- tasks/{vm_reload.yml => vbox_reload.yml} | 0 .../{vm_savestate.yml => vbox_savestate.yml} | 0 user_scripts/createUser.sql | 11 +- user_scripts/gen/fileGet.yml | 106 ++++++++++-------- user_scripts/tables_recreate_OCI.sql | 15 +++ 20 files changed, 298 insertions(+), 115 deletions(-) create mode 100644 config_main.yml create mode 100644 config_oci.yml rename config_vars.yml => config_vbox.yml (93%) create mode 100644 patch_sql/startupForce.sql create mode 100644 roles/oci_compute_instance_actions/meta/main.yml create mode 100644 roles/oci_compute_instance_actions/tasks/main.yml create mode 100644 tasks/lvm_reload.yml rename tasks/{vm_reload.yml => vbox_reload.yml} (100%) rename tasks/{vm_savestate.yml => vbox_savestate.yml} (100%) create mode 100644 user_scripts/tables_recreate_OCI.sql diff --git a/ansible.cfg b/ansible.cfg index fa8af7a..d4f50a0 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -20,7 +20,7 @@ log_path = main.log retry_files_enabled = False   # default ssh user -remote_user = rodrigo +remote_user = opc # connection timeout timeout = 30 diff --git a/config_main.yml b/config_main.yml new file mode 100644 index 0000000..1ffff64 --- /dev/null +++ b/config_main.yml @@ -0,0 +1,2 @@ +# OCI Mode? If true, script will load and run in OCI move, otherwise, VBox. +oci_mode : true \ No newline at end of file diff --git a/config_oci.yml b/config_oci.yml new file mode 100644 index 0000000..2504948 --- /dev/null +++ b/config_oci.yml @@ -0,0 +1,38 @@ +# Folder where the database patches are placed. The patches can also be placed in sub-folders of the directory specified below. +source_folder : "/u01/patch_automation/patches" + +# Folder in RW mode on local compute and shared with the VM. It is used to process the files. +shared_folder : "/u01/patch_automation/shared" + +# Path of the folder mounted within the VM. +VM_folder : "/u02/" + +# Oracle SID. Must be included in /etc/oratab for oraenv utility. +mysid : "orcl" + +# Folder to store the final generated files. +output_folder : "/u01/patch_automation/output" + +# Files in "user_scripts" folder that will run before and after the final expdp. script_types can be "shell", "sql" or "yml". +user_expdp_pre : +- { file : "fileGet.yml" , folder : "user_scripts/gen" , type : "yml", task_action : "Collect OS Info" } +- { file : "tables_recreate_OCI.sql" , type : "sql" , task_action : "Recreate Tables" } +- { file : "hashGet.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Collect DB Info" } +- { file : "externalDir.yml" , type : "yml" , task_action : "Create External Directory" } + +user_expdp_post : +- { file : "postActions.sql" , type : "sql", task_action : "Do nothing." } + +# User that will hold your tables outputs and be exported after each execution. If the database is CDB, "C##" will be automatically inserted if not. +dump_user : hash + +# User pass +dump_pass : hash + +# This parameter will skip execution for patches that already have a dump file generated in "dump_folder" ("output_folder"/expdp). +skip_dump_exists: true + +# OCI Information to deploy VM +oci_compartment_id : ocid1.compartment.oc1..aaaaaaaa6lt4nm5eq6uynk4x4h3vyw3cpdszdyyl2qc7kq4wzlaiwtojqgrq +oci_subnet_id : ocid1.subnet.oc1.iad.aaaaaaaarpoyj63i2hfron6wzhk25rnnsmraome3oz3oqnnfk4cahsi5amgq +oci_ad : ocid1.subnet.oc1.iad.aaaaaaaarpoyj63i2hfron6wzhk25rnnsmraome3oz3oqnnfk4cahsi5amgq \ No newline at end of file diff --git a/config_vars.yml b/config_vbox.yml similarity index 93% rename from config_vars.yml rename to config_vbox.yml index ab97c5c..9cb8fb5 100644 --- a/config_vars.yml +++ b/config_vbox.yml @@ -10,8 +10,8 @@ VM_folder : "/media/sf_Patch/" # Oracle SID. Must be included in /etc/oratab for oraenv utility. mysid : "orcl" -# Folder to store the final generated DB expdp dumpfiles. -dump_folder : "/Volumes/Samsung_T3/OraSum/files/exp" +# Folder to store the final generated files. It must contain the subfolder expdp +output_folder : "/Volumes/Samsung_T3/OraSum/files" # Files in "user_scripts" folder that will run before and after the final expdp. script_types can be "shell", "sql" or "yml". user_expdp_pre : @@ -30,7 +30,7 @@ dump_user : hash # User pass dump_pass : hash -# This parameter will skip execution for patches that already have a dump file generated in "dump_folder". +# This parameter will skip execution for patches that already have a dump file generated in "dump_folder" ("output_folder"/expdp). skip_dump_exists: true ########################### diff --git a/main.yml b/main.yml index ef532f1..724983b 100644 --- a/main.yml +++ b/main.yml @@ -25,16 +25,21 @@ any_errors_fatal: true vars_files: - - config_vars.yml + - config_main.yml - list_versions.yml - list_patches.yml - - list_exceptions.yml - - pre_tasks: - - import_tasks: tasks/setup_env.yml + - list_exceptions.yml tasks: + - include_vars: config_vbox.yml + when: oci_mode == false + + - include_vars: config_oci.yml + when: oci_mode == true + + - import_tasks: tasks/setup_env.yml + - include: tasks/main_PSU_BP.yml db_version="11.2.0.4" when: param_version is undefined or param_version == "11.2.0.4" diff --git a/patch_sql/startupForce.sql b/patch_sql/startupForce.sql new file mode 100644 index 0000000..483503f --- /dev/null +++ b/patch_sql/startupForce.sql @@ -0,0 +1,2 @@ +startup force; +exit; diff --git a/roles/oci_compute_instance_actions/meta/main.yml b/roles/oci_compute_instance_actions/meta/main.yml new file mode 100644 index 0000000..b42ca0c --- /dev/null +++ b/roles/oci_compute_instance_actions/meta/main.yml @@ -0,0 +1,2 @@ +collections: + - oracle.oci \ No newline at end of file diff --git a/roles/oci_compute_instance_actions/tasks/main.yml b/roles/oci_compute_instance_actions/tasks/main.yml new file mode 100644 index 0000000..c9fe270 --- /dev/null +++ b/roles/oci_compute_instance_actions/tasks/main.yml @@ -0,0 +1,47 @@ +- name: Perform action "{{ compute_action }}" on instance + oci_compute_instance_actions: + instance_id: "{{ oci_instance_id }}" + action: "{{ compute_action }}" + register: oci_action + +- block: + + - name: Get the VNIC attachment details of instance + oci_compute_vnic_attachment_facts: + compartment_id: "{{ oci_compartment_id }}" + instance_id: "{{ oci_instance_id }}" + register: result + + - name: Get details of the VNIC + oci_network_vnic_facts: + id: "{{ result.vnic_attachments[0].vnic_id }}" + register: result + - set_fact: + vm_ip_address: "{{result.vnic.private_ip}}" + + - name: Print the private ip of the newly launched instance + debug: + msg: "Private IP of launched instance {{ vm_ip_address }}" + + - name: Wait (up to 2 minutes) for port 22 to become open + wait_for: + port: 22 + host: '{{ vm_ip_address }}' + state: started + delay: 10 + timeout: 120 + vars: + ansible_connection: local + when: oci_action.changed + + - name: Wait (up to 10 seconds) for port 22 to become open + wait_for: + port: 22 + host: '{{ vm_ip_address }}' + state: started + timeout: 10 + vars: + ansible_connection: local + when: not oci_action.changed + + when: compute_action == "start" \ No newline at end of file diff --git a/tasks/impdp_file.yml b/tasks/impdp_file.yml index f8a46e5..42c33e1 100644 --- a/tasks/impdp_file.yml +++ b/tasks/impdp_file.yml @@ -5,9 +5,9 @@ set_fact: dump_file_prefix: "tables_{{ db_version }}_{{ patch.base_ru | default('')}}{{ patch.type }}_{{ patch.id }}" -- name: "Check if {{ dump_folder }}/{{ dump_file_prefix }}.dmp exists" +- name: "Check if {{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp exists" stat: - path: "{{ dump_folder }}/{{ dump_file_prefix }}.dmp" + path: "{{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp" register: dump_stat_result - fail: @@ -16,7 +16,7 @@ - name: "Copy {{ dump_file_prefix }}.dmp to shared_folder" copy: - src: "{{ dump_folder }}/{{ dump_file_prefix }}.dmp" + src: "{{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp" dest: "{{ shared_folder }}" - name: Import Database Tables diff --git a/tasks/lvm_reload.yml b/tasks/lvm_reload.yml new file mode 100644 index 0000000..d7b4337 --- /dev/null +++ b/tasks/lvm_reload.yml @@ -0,0 +1,27 @@ +- name: "Load base snapshot {{ vm_snapshot }}" + shell: | + set -e + v_snapshot="{{ vm_snapshot }}" + v_disk='/dev/mapper/vg_u01-lv_u01' + pkill -9 -U oracle || true + sleep 5 + umount -l -f /u01 || true + sleep 5 + lvconvert --merge -i 1 -v ${v_disk}_${v_snapshot} + lvchange -a n ${v_disk} + lvchange -a y ${v_disk} + while : + do + if ! lvs -a | grep lv_u01_${v_snapshot} + then + break + fi + dmsetup status ${v_disk} + sleep 1 + done + v_size=$(lvs --noheadings -o seg_size ${v_disk}) + lvcreate --size 25G --snapshot --name lv_u01_${v_snapshot} ${v_disk} + mount /u01 + become: true + become_user: root + delegate_to: "{{ vm_ip_address }}" \ No newline at end of file diff --git a/tasks/main_PSU_BP.yml b/tasks/main_PSU_BP.yml index cf1f9ec..2131767 100644 --- a/tasks/main_PSU_BP.yml +++ b/tasks/main_PSU_BP.yml @@ -11,12 +11,31 @@ with_items: "{{ list_versions }}" when: item.id == db_version +- name : Define Cloud params + set_fact: + oci_instance_id: "{{ item.oci_instance_id }}" + patch_base: "{{ item.base_snap }}" + with_items: "{{ list_info_oci }}" + when: item.id == db_version and oci_mode == true + # vm_reload is called before every patch is applied to rollback the VM to the snapshot image. - name : Define snapshot base version to rollback when vm_reload is called. set_fact: vm_snapshot: "{{ patch_base }}" -- include: vm_reload.yml +- name: Call role to start OCI VM + include_role: + name: oci_compute_instance_actions + vars: + compute_action: start + when: oci_mode == true + +- include: vbox_reload.yml + when: oci_mode == false + +- include: lvm_reload.yml + when: oci_mode == true + - include: setup_opatch.yml - include: setup_database.yml @@ -64,7 +83,7 @@ debug: msg="Latest PSU ID - {{ latest_psu_line }}" # Save lastest PSU as a new snapshot - Also changes vm_snapshot variable to it (for OJVM). - - include: vm_savestate.yml + - include: vbox_savestate.yml when: latest_psu_line == latest_processed when: param_type is undefined or param_type == "PSU" @@ -141,3 +160,10 @@ - patch.id <= (param_patch_to | int) or param_patch_to == -1 when: param_type is undefined or param_type == "BP" + +- name: Call role to stop OCI VM + include_role: + name: oci_compute_instance_actions + vars: + compute_action: stop + when: oci_mode == true \ No newline at end of file diff --git a/tasks/patch_main_11g.yml b/tasks/patch_main_11g.yml index 318094e..e009fdb 100644 --- a/tasks/patch_main_11g.yml +++ b/tasks/patch_main_11g.yml @@ -8,8 +8,8 @@ # Stop the database - include: run_sql.yml vars: - sql_param : { file : "shutdown.sql" , folder : "patch_sql" , task_action : "Stop Database" } - + sql_param : { file : "shutdown.sql" , folder : "patch_sql" , task_action : "Stop Database for OPatch" } + - name: Run OPatch shell: | export ORACLE_HOME ORACLE_SID @@ -43,7 +43,7 @@ # Start the database - include: run_sql.yml vars: - sql_param : { file : "startup.sql" , folder : "patch_sql" , task_action : "Start Database" } + sql_param : { file : "startup.sql" , folder : "patch_sql" , task_action : "Start Database for sqlpatch" } # Apply patch changes on DB (if PSU) - include: run_sql.yml @@ -80,8 +80,9 @@ # Stop the database - include: run_sql.yml vars: - sql_param : { file : "shutdown.sql" , folder : "patch_sql" , task_action : "Stop Database" } - + sql_param : { file : "shutdown.sql" , folder : "patch_sql" , task_action : "Stop Database to re-enable DB Vault" } + when: dbvault_enabled == true + - name: Enable Database Vault shell: | {{ dbhome_locl }}/bin/chopt enable dv @@ -96,10 +97,12 @@ when: patch.id != 0 - # Start the database + # Reason for Startup Force is that sqlplus may say instance is already up when it is actually down. + # This happens when you kill oracle processes when DB is running and reinstate LVM. - include: run_sql.yml vars: - sql_param : { file : "startup.sql" , folder : "patch_sql" , task_action : "Start Database" } + sql_param : { file : "startupForce.sql" , folder : "patch_sql" , task_action : "Start Database" } + when: patch.id == 0 or (patch.id != 0 and dbvault_enabled == true) # User custom pre-scripts - name: Run user custom pre-scripts diff --git a/tasks/patch_tasks_post.yml b/tasks/patch_tasks_post.yml index 756a1ee..11eca08 100644 --- a/tasks/patch_tasks_post.yml +++ b/tasks/patch_tasks_post.yml @@ -1,12 +1,12 @@ - name: "Copy {{ dump_file_prefix }}.dmp to repository" copy: src: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" - dest: "{{ dump_folder }}" + dest: "{{ output_folder }}/expdp" - name: "Copy {{ dump_file_prefix }}.log to repository" copy: src: "{{ shared_folder }}/{{ dump_file_prefix }}.log" - dest: "{{ dump_folder }}" + dest: "{{ output_folder }}/expdp" - name : "Remove file {{ dump_file_prefix }}.dmp" file: diff --git a/tasks/patch_tasks_pre.yml b/tasks/patch_tasks_pre.yml index f7c1be1..51c9a3b 100644 --- a/tasks/patch_tasks_pre.yml +++ b/tasks/patch_tasks_pre.yml @@ -1,16 +1,16 @@ - name: "Processing {{ db_version }} {{ patch.type }} {{ patch.id }} - Patch {{ patch.patch_number }}" debug: msg="Processing {{ db_version }} {{ patch.type }} {{ patch.id }} - Patch {{ patch.patch_number }}" -- name : Define file names +- name : Define dump and sha256 file names set_fact: dump_file_prefix: "tables_{{ db_version }}_{{ patch.base_ru | default('')}}{{ patch.type }}_{{ patch.id }}" sha256_file: "sha256sum_{{ db_version }}_{{ patch.base_ru | default('')}}{{ patch.type }}_{{ patch.id }}.chk" skip_all: false fix_datapatch_retries: 0 -- name: "Check if {{ dump_folder }}/{{ dump_file_prefix }}.dmp exists" +- name: "Check if {{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp exists" stat: - path: "{{ dump_folder }}/{{ dump_file_prefix }}.dmp" + path: "{{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp" register: dump_stat_result # Will skip all the rest if the dump file exists @@ -43,10 +43,10 @@ # Place patch file on the shared folder - name: Finding Patch File find: - paths: "{{ source_folder }}" - patterns: "p{{ patch.patch_number }}_{{ db_version | regex_replace('\\.','') }}0_Linux-x86-64.zip" - recurse: "yes" - file_type: "file" + paths: "{{ source_folder }}" + patterns: "p{{ patch.patch_number }}_{{ db_version | regex_replace('\\.','') }}0_Linux-x86-64.zip" + recurse: "yes" + file_type: "file" register: find_result - fail: @@ -56,7 +56,7 @@ - name: "Patch File" debug: msg="{{ find_result.files[0].path }}" - - name : Define file name + - name : Define Patch file name set_fact: db_patch: "{{ find_result.files[0].path }}" unzip_patch_folder: "{{ shared_folder }}/{{ patch.patch_number }}" @@ -89,8 +89,11 @@ when: patch.id != 0 and skip_all == false -- include: vm_reload.yml - when: skip_all == false +- include: vbox_reload.yml + when: oci_mode == false and skip_all == false + +- include: lvm_reload.yml + when: oci_mode == true and skip_all == false # Replace opatch with latest version, when not processing base release. i.e patch.id != 0 - block: diff --git a/tasks/setup_database.yml b/tasks/setup_database.yml index a23640b..7d5124b 100644 --- a/tasks/setup_database.yml +++ b/tasks/setup_database.yml @@ -39,41 +39,39 @@ ### Check if CDB -- name: "Check if CDB is enabled" - shell: | - export ORACLE_HOME ORACLE_SID - {{ dbhome_locl }}/bin/sqlplus -s "/ as sysdba" <<'EOF' | sed '/^$/d' - whenever sqlerror exit sql.sqlcode - set pages 0 head off feed off echo off trims on ver off term off - - COL is_ver_ge_12 new_v is_ver_ge_12 nopri - COL is_cdb_temp_col new_v is_cdb_temp_col nopri - COL is_cdb new_v is_cdb - - select case when version >= 12 then 'Y' else 'N' end is_ver_ge_12 - from (select to_number(substr(version,1,instr(version,'.')-1)) version - from v$instance); - - select DECODE('&&is_ver_ge_12.','Y','CDB','''N''') is_cdb_temp_col from dual; - - set term on - select decode(substr(&&is_cdb_temp_col.,1,1),'Y','true','N','false') is_cdb from v$database; - exit - EOF - environment: - ORACLE_HOME: "{{ dbhome_locl }}" - ORACLE_SID: "{{ mysid }}" - register: shell_output - become: true - become_user: oracle - delegate_to: "{{ vm_ip_address }}" +- block: + + - name: "Check if CDB is enabled" + shell: | + set -eo pipefail + export ORACLE_HOME ORACLE_SID + {{ dbhome_locl }}/bin/sqlplus -s "/ as sysdba" <<'EOF' | sed '/^$/d' + whenever sqlerror exit sql.sqlcode + set pages 0 head off feed off echo off trims on ver off term on + select decode(substr(CDB,1,1),'Y','true','N','false') is_cdb from v$database; + exit + EOF + environment: + ORACLE_HOME: "{{ dbhome_locl }}" + ORACLE_SID: "{{ mysid }}" + register: shell_output + become: true + become_user: oracle + delegate_to: "{{ vm_ip_address }}" + + - name: SQL Output + debug: msg="{{ shell_output.stdout_lines }}" + + - name : Define CDB variable + set_fact: + db_iscdb: "{{ shell_output.stdout | bool }}" -- name: SQL Output - debug: msg="{{ shell_output.stdout_lines }}" + when: db_version != "11.2.0.4" - name : Define CDB variable set_fact: - db_iscdb: "{{ shell_output.stdout | bool }}" + db_iscdb: false + when: db_version == "11.2.0.4" ### Adjust dump_user_int based on database type and provided value. diff --git a/tasks/vm_reload.yml b/tasks/vbox_reload.yml similarity index 100% rename from tasks/vm_reload.yml rename to tasks/vbox_reload.yml diff --git a/tasks/vm_savestate.yml b/tasks/vbox_savestate.yml similarity index 100% rename from tasks/vm_savestate.yml rename to tasks/vbox_savestate.yml diff --git a/user_scripts/createUser.sql b/user_scripts/createUser.sql index aa755c2..8ece518 100644 --- a/user_scripts/createUser.sql +++ b/user_scripts/createUser.sql @@ -1,11 +1,12 @@ -- Create HASH user +WHENEVER SQLERROR CONTINUE -DROP USER HASH CASCADE; +DROP USER &&1. CASCADE; WHENEVER SQLERROR EXIT SQL.SQLCODE -CREATE USER HASH IDENTIFIED BY "hash" DEFAULT TABLESPACE "USERS" TEMPORARY TABLESPACE "TEMP"; +CREATE USER &&1. IDENTIFIED BY "hash" DEFAULT TABLESPACE "USERS" TEMPORARY TABLESPACE "TEMP"; -GRANT UNLIMITED TABLESPACE TO HASH; -GRANT CREATE SESSION TO HASH; -GRANT "DBA" TO HASH; \ No newline at end of file +GRANT UNLIMITED TABLESPACE TO &&1.; +GRANT CREATE SESSION TO &&1.; +GRANT "DBA" TO &&1.; \ No newline at end of file diff --git a/user_scripts/gen/fileGet.yml b/user_scripts/gen/fileGet.yml index 2a2299d..c58c8cc 100644 --- a/user_scripts/gen/fileGet.yml +++ b/user_scripts/gen/fileGet.yml @@ -1,54 +1,68 @@ # Folder to store the final generated ORACLE_HOME checksum - name : Define folder name set_fact: - chksum_folder: "/Volumes/Samsung_T3/OraSum/files/binsum" + chksum_folder: "{{ output_folder }}/binsum" - name : Define file names set_fact: sha256_file: "sha256sum_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}.chk" -- name: Generate files checksum - shell: | - find -type f -exec sha256sum "{}" + > {{ VM_folder }}/{{ sha256_file }} - args: - chdir: "{{ dbhome_locl }}" - register: sqloutput - become: true - become_user: root - delegate_to: "{{ vm_ip_address }}" - -- name: Generate files checksum for static libs - shell: | - v_libs=$(find {{ dbhome_locl }} -type f -name "*.a") - - v_ext_fold=/tmp/statlib - v_out_file=/tmp/statlib_list.txt - - IFS=$'\n' - for v_lib in ${v_libs} - do - rm -rf "${v_ext_fold}" - mkdir "${v_ext_fold}" - cd "${v_ext_fold}" - ar x "${v_lib}" - find -type f -exec sha256sum "{}" + > ${v_out_file} - sed -i "s| \.| ${v_lib}|" ${v_out_file} - cat ${v_out_file} >> {{ VM_folder }}/{{ sha256_file }} - rm -rf ${v_ext_fold} ${v_out_file} - done - args: - chdir: "{{ dbhome_locl }}" - register: sqloutput - become: true - become_user: root - delegate_to: "{{ vm_ip_address }}" - -- name: Copy {{ sha256_file }} to repository - copy: - src: "{{ shared_folder }}/{{ sha256_file }}" - dest: "{{ chksum_folder }}" - -- name : "Remove file {{ sha256_file }}" - file: - state: absent - path: "{{ shared_folder }}/{{ sha256_file }}" \ No newline at end of file +- name: "Check if {{ chksum_folder }}/{{ sha256_file }} exists" + stat: + path: "{{ chksum_folder }}/{{ sha256_file }}" + register: chksum_stat_result + +# Will skip all the rest if the chksum file exists +- name : Define exists_chksum + set_fact: + exists_chksum: "{{ chksum_stat_result.stat.exists }}" + +- block : + + - name: Generate files checksum + shell: | + find -type f -exec sha256sum "{}" + > {{ VM_folder }}/{{ sha256_file }} + args: + chdir: "{{ dbhome_locl }}" + register: sqloutput + become: true + become_user: root + delegate_to: "{{ vm_ip_address }}" + + - name: Generate files checksum for static libs + shell: | + v_libs=$(find {{ dbhome_locl }} -type f -name "*.a") + + v_ext_fold=/tmp/statlib + v_out_file=/tmp/statlib_list.txt + + IFS=$'\n' + for v_lib in ${v_libs} + do + rm -rf "${v_ext_fold}" + mkdir "${v_ext_fold}" + cd "${v_ext_fold}" + ar x "${v_lib}" + find -type f -exec sha256sum "{}" + > ${v_out_file} + sed -i "s| \.| ${v_lib}|" ${v_out_file} + cat ${v_out_file} >> {{ VM_folder }}/{{ sha256_file }} + rm -rf ${v_ext_fold} ${v_out_file} + done + args: + chdir: "{{ dbhome_locl }}" + register: sqloutput + become: true + become_user: root + delegate_to: "{{ vm_ip_address }}" + + - name: Copy {{ sha256_file }} to repository + copy: + src: "{{ shared_folder }}/{{ sha256_file }}" + dest: "{{ chksum_folder }}" + + - name : "Remove file {{ sha256_file }}" + file: + state: absent + path: "{{ shared_folder }}/{{ sha256_file }}" + + when: exists_chksum == false \ No newline at end of file diff --git a/user_scripts/tables_recreate_OCI.sql b/user_scripts/tables_recreate_OCI.sql new file mode 100644 index 0000000..3210fb6 --- /dev/null +++ b/user_scripts/tables_recreate_OCI.sql @@ -0,0 +1,15 @@ +WHENEVER SQLERROR EXIT SQL.SQLCODE + +col v_username new_v v_username nopri + +select case when version >= 12 then 'C##HASH' else 'HASH' end v_username +from (select to_number(substr(version,1,instr(version,'.')-1)) version + from v$instance); + +col v_username clear + +@@createUser.sql &&v_username. + +conn &&v_username./hash; + +@@tables_create.sql From f7d84db65d12daffce1c8f3af8fff90459b1a2c4 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 21 Jun 2021 14:26:03 -0300 Subject: [PATCH 005/229] Update main_PSU_BP.yml --- tasks/main_PSU_BP.yml | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/tasks/main_PSU_BP.yml b/tasks/main_PSU_BP.yml index 2131767..1762086 100644 --- a/tasks/main_PSU_BP.yml +++ b/tasks/main_PSU_BP.yml @@ -19,7 +19,7 @@ when: item.id == db_version and oci_mode == true # vm_reload is called before every patch is applied to rollback the VM to the snapshot image. -- name : Define snapshot base version to rollback when vm_reload is called. +- name : Define snapshot base version to rollback when reload is called. set_fact: vm_snapshot: "{{ patch_base }}" @@ -74,17 +74,27 @@ vars: filter_qry: "[?type=='PSU'].id" - - name : Generate Snapshot Name + - name : Generate Snapshot Name - VBox Mode set_fact: vm_snapshot: "{{ db_version }} PSU {{ latest_psu_id }}" latest_psu_line: "{{ db_version }}.PSU.{{ latest_psu_id }}" + when: oci_mode == false + + - name : Generate Snapshot Name - LVM Mode + set_fact: + vm_snapshot: "PSU_{{ latest_psu_id }}" + latest_psu_line: "{{ db_version }}.PSU.{{ latest_psu_id }}" + when: oci_mode == true - name: "Latest PSU" debug: msg="Latest PSU ID - {{ latest_psu_line }}" # Save lastest PSU as a new snapshot - Also changes vm_snapshot variable to it (for OJVM). - include: vbox_savestate.yml - when: latest_psu_line == latest_processed + when: latest_psu_line == latest_processed and oci_mode == false + + - include: lvm_savestate.yml + when: latest_psu_line == latest_processed and oci_mode == true when: param_type is undefined or param_type == "PSU" @@ -98,9 +108,15 @@ vars: filter_qry: "[?type=='PSU'].id" - - name : Generate Snapshot Name + - name : Generate Snapshot Name - VBox Mode set_fact: vm_snapshot: "{{ db_version }} PSU {{ latest_psu_id }}" + when: oci_mode == false + + - name : Generate Snapshot Name - LVM Mode + set_fact: + vm_snapshot: "PSU_{{ latest_psu_id }}" + when: oci_mode == true - name: "Base Snapshot will be {{ vm_snapshot }}" debug: msg="Base Snapshot will be {{ vm_snapshot }}" @@ -127,7 +143,7 @@ ### BP - block: - - name : Define snapshot base version to rollback when vm_reload is called. + - name : Define snapshot base version to rollback when reload is called. set_fact: vm_snapshot: "{{ patch_base }}" From 763ba63626aec05dd811f21a2d7ffdb2b2c5b6b4 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 21 Jun 2021 14:32:58 -0300 Subject: [PATCH 006/229] Small changes --- tasks/lvm_reload.yml | 3 ++- tasks/lvm_savestate.yml | 15 +++++++++++++++ tasks/patch_main_11g.yml | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 tasks/lvm_savestate.yml diff --git a/tasks/lvm_reload.yml b/tasks/lvm_reload.yml index d7b4337..4c65480 100644 --- a/tasks/lvm_reload.yml +++ b/tasks/lvm_reload.yml @@ -7,6 +7,7 @@ sleep 5 umount -l -f /u01 || true sleep 5 + lvchange -a n ${v_disk} lvconvert --merge -i 1 -v ${v_disk}_${v_snapshot} lvchange -a n ${v_disk} lvchange -a y ${v_disk} @@ -20,7 +21,7 @@ sleep 1 done v_size=$(lvs --noheadings -o seg_size ${v_disk}) - lvcreate --size 25G --snapshot --name lv_u01_${v_snapshot} ${v_disk} + lvcreate --size ${v_size} --snapshot --name lv_u01_${v_snapshot} ${v_disk} mount /u01 become: true become_user: root diff --git a/tasks/lvm_savestate.yml b/tasks/lvm_savestate.yml new file mode 100644 index 0000000..ed9e588 --- /dev/null +++ b/tasks/lvm_savestate.yml @@ -0,0 +1,15 @@ +## This code will take a snapshot named "vm_snapshot" for the VM. It will later be used as a base release for OJVMs. + +# Save latest machine image if not already +- name: "Create new LVM snapshot \"{{ vm_snapshot }}\" if not exists." + shell: | + v_snapshot="{{ vm_snapshot }}" + v_disk='/dev/mapper/vg_u01-lv_u01' + if ! $(lvs -a | grep -q "${v_snapshot}") + then + v_size=$(lvs --noheadings -o seg_size ${v_disk}) + lvcreate --size ${v_size} --snapshot --name ${v_snapshot} ${v_disk} + fi + become: true + become_user: root + delegate_to: "{{ vm_ip_address }}" \ No newline at end of file diff --git a/tasks/patch_main_11g.yml b/tasks/patch_main_11g.yml index e009fdb..1f750c2 100644 --- a/tasks/patch_main_11g.yml +++ b/tasks/patch_main_11g.yml @@ -99,6 +99,7 @@ # Reason for Startup Force is that sqlplus may say instance is already up when it is actually down. # This happens when you kill oracle processes when DB is running and reinstate LVM. + # This start is only required if database was never stopped. - include: run_sql.yml vars: sql_param : { file : "startupForce.sql" , folder : "patch_sql" , task_action : "Start Database" } From 2b9265c00dd14e447290a0137c35f45ed732e5c4 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 21 Jun 2021 14:53:01 -0300 Subject: [PATCH 007/229] Small changes --- config_oci.yml | 3 ++- tasks/lvm_savestate.yml | 2 +- tasks/main_PSU_BP.yml | 3 ++- tasks/main_RU_RUR.yml | 59 +++++++++++++++++++++++++++++++++++------ 4 files changed, 56 insertions(+), 11 deletions(-) diff --git a/config_oci.yml b/config_oci.yml index 2504948..1303cde 100644 --- a/config_oci.yml +++ b/config_oci.yml @@ -2,7 +2,7 @@ source_folder : "/u01/patch_automation/patches" # Folder in RW mode on local compute and shared with the VM. It is used to process the files. -shared_folder : "/u01/patch_automation/shared" +shared_folder : "/u01/patch_automation/shared_bindfs" # Path of the folder mounted within the VM. VM_folder : "/u02/" @@ -19,6 +19,7 @@ user_expdp_pre : - { file : "tables_recreate_OCI.sql" , type : "sql" , task_action : "Recreate Tables" } - { file : "hashGet.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Collect DB Info" } - { file : "externalDir.yml" , type : "yml" , task_action : "Create External Directory" } +# - { file : "preActions.sql" , type : "sql", task_action : "Do nothing." } user_expdp_post : - { file : "postActions.sql" , type : "sql", task_action : "Do nothing." } diff --git a/tasks/lvm_savestate.yml b/tasks/lvm_savestate.yml index ed9e588..fd63f20 100644 --- a/tasks/lvm_savestate.yml +++ b/tasks/lvm_savestate.yml @@ -8,7 +8,7 @@ if ! $(lvs -a | grep -q "${v_snapshot}") then v_size=$(lvs --noheadings -o seg_size ${v_disk}) - lvcreate --size ${v_size} --snapshot --name ${v_snapshot} ${v_disk} + lvcreate --size ${v_size} --snapshot --name lv_u01_${v_snapshot} ${v_disk} fi become: true become_user: root diff --git a/tasks/main_PSU_BP.yml b/tasks/main_PSU_BP.yml index 1762086..d518a7d 100644 --- a/tasks/main_PSU_BP.yml +++ b/tasks/main_PSU_BP.yml @@ -18,7 +18,7 @@ with_items: "{{ list_info_oci }}" when: item.id == db_version and oci_mode == true -# vm_reload is called before every patch is applied to rollback the VM to the snapshot image. +# reload is called before every patch is applied to rollback the VM to the snapshot image. - name : Define snapshot base version to rollback when reload is called. set_fact: vm_snapshot: "{{ patch_base }}" @@ -177,6 +177,7 @@ when: param_type is undefined or param_type == "BP" +# Stop OCI VM - name: Call role to stop OCI VM include_role: name: oci_compute_instance_actions diff --git a/tasks/main_RU_RUR.yml b/tasks/main_RU_RUR.yml index 2016715..f3987ba 100644 --- a/tasks/main_RU_RUR.yml +++ b/tasks/main_RU_RUR.yml @@ -11,12 +11,31 @@ with_items: "{{ list_versions }}" when: item.id == db_version -# vm_reload is called before every patch is applied to rollback the VM to the snapshot image. -- name : Define snapshot base version to rollback when vm_reload is called. +- name : Define Cloud params + set_fact: + oci_instance_id: "{{ item.oci_instance_id }}" + patch_base: "{{ item.base_snap }}" + with_items: "{{ list_info_oci }}" + when: item.id == db_version and oci_mode == true + +# reload is called before every patch is applied to rollback the VM to the snapshot image. +- name : Define snapshot base version to rollback when reload is called. set_fact: vm_snapshot: "{{ patch_base }}" -- include: vm_reload.yml +- name: Call role to start OCI VM + include_role: + name: oci_compute_instance_actions + vars: + compute_action: start + when: oci_mode == true + +- include: vbox_reload.yml + when: oci_mode == false + +- include: lvm_reload.yml + when: oci_mode == true + - include: setup_opatch.yml - include: setup_database.yml @@ -55,17 +74,27 @@ vars: filter_qry: "[?type=='RU'].id" - - name : Generate Snapshot Name + - name : Generate Snapshot Name - VBox Mode set_fact: vm_snapshot: "{{ db_version }} RU {{ latest_RU_id }}" latest_RU_line: "{{ db_version }}.RU.{{ latest_RU_id }}" + when: oci_mode == false + + - name : Generate Snapshot Name - LVM Mode + set_fact: + vm_snapshot: "RU_{{ latest_RU_id }}" + latest_RU_line: "{{ db_version }}.RU.{{ latest_RU_id }}" + when: oci_mode == true - name: "Latest RU" debug: msg="Latest RU ID - {{ latest_RU_line }}" # Save lastest RU as a new snapshot - Also changes vm_snapshot variable to it (for OJVM). - - include: vm_savestate.yml - when: latest_RU_line == latest_processed + - include: vbox_savestate.yml + when: latest_RU_line == latest_processed and oci_mode == false + + - include: lvm_savestate.yml + when: latest_RU_line == latest_processed and oci_mode == true when: param_type is undefined or param_type == "RU" @@ -79,9 +108,15 @@ vars: filter_qry: "[?type=='RU'].id" - - name : Generate Snapshot Name + - name : Generate Snapshot Name - VBox Mode set_fact: vm_snapshot: "{{ db_version }} RU {{ latest_RU_id }}" + when: oci_mode == false + + - name : Generate Snapshot Name - LVM Mode + set_fact: + vm_snapshot: "RU_{{ latest_RU_id }}" + when: oci_mode == true - name: "Base Snapshot will be {{ vm_snapshot }}" debug: msg="Base Snapshot will be {{ vm_snapshot }}" @@ -108,7 +143,7 @@ ### RUR - block: - - name : Define snapshot base version to rollback when vm_reload is called. + - name : Define snapshot base version to rollback when reload is called. set_fact: vm_snapshot: "{{ patch_base }}" @@ -125,3 +160,11 @@ - patch.id <= (param_patch_to | int) or param_patch_to == -1 when: param_type is undefined or param_type == "RUR" + +# Stop OCI VM +- name: Call role to stop OCI VM + include_role: + name: oci_compute_instance_actions + vars: + compute_action: stop + when: oci_mode == true \ No newline at end of file From 900ac98ae56c5865ebad328e186a441e221882b6 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 23 Jun 2021 18:01:11 -0300 Subject: [PATCH 008/229] Update config_oci.yml --- config_oci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config_oci.yml b/config_oci.yml index 1303cde..55b3166 100644 --- a/config_oci.yml +++ b/config_oci.yml @@ -15,8 +15,10 @@ output_folder : "/u01/patch_automation/output" # Files in "user_scripts" folder that will run before and after the final expdp. script_types can be "shell", "sql" or "yml". user_expdp_pre : -- { file : "fileGet.yml" , folder : "user_scripts/gen" , type : "yml", task_action : "Collect OS Info" } -- { file : "tables_recreate_OCI.sql" , type : "sql" , task_action : "Recreate Tables" } +- { file : "fileGet.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Collect OS Info" } +- { file : "fileCollect.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Collect OS Info" } +- { file : "symbolGet.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Collect OS Info" } +- { file : "tables_recreate.sql" , folder : "user_scripts/odbfcl" , type : "sql" , task_action : "Recreate Tables" } - { file : "hashGet.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Collect DB Info" } - { file : "externalDir.yml" , type : "yml" , task_action : "Create External Directory" } # - { file : "preActions.sql" , type : "sql", task_action : "Do nothing." } From e6f727eb69108c858e62784e9fd2aa4d46dfa372 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 2 Jul 2021 14:19:02 -0300 Subject: [PATCH 009/229] Update config_oci.yml --- config_oci.yml | 53 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 15 deletions(-) diff --git a/config_oci.yml b/config_oci.yml index 55b3166..2f7d126 100644 --- a/config_oci.yml +++ b/config_oci.yml @@ -2,10 +2,10 @@ source_folder : "/u01/patch_automation/patches" # Folder in RW mode on local compute and shared with the VM. It is used to process the files. -shared_folder : "/u01/patch_automation/shared_bindfs" +shared_folder : "/u02" # Path of the folder mounted within the VM. -VM_folder : "/u02/" +VM_folder : "/u02" # Oracle SID. Must be included in /etc/oratab for oraenv utility. mysid : "orcl" @@ -15,16 +15,20 @@ output_folder : "/u01/patch_automation/output" # Files in "user_scripts" folder that will run before and after the final expdp. script_types can be "shell", "sql" or "yml". user_expdp_pre : -- { file : "fileGet.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Collect OS Info" } -- { file : "fileCollect.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Collect OS Info" } -- { file : "symbolGet.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Collect OS Info" } -- { file : "tables_recreate.sql" , folder : "user_scripts/odbfcl" , type : "sql" , task_action : "Recreate Tables" } -- { file : "hashGet.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Collect DB Info" } +- { file : "fileGet.yml" , folder : "user_scripts/odbfcl/extract" , type : "yml", task_action : "Generate chksum for ORACLE_HOME" } +- { file : "fileCollect.yml" , folder : "user_scripts/odbfcl/extract" , type : "yml", task_action : "Collect non-binary files from ORACLE_HOME" } +- { file : "symbolGet.yml" , folder : "user_scripts/odbfcl/extract" , type : "yml", task_action : "Get all symbols on ORACLE_HOME binaries and libs" } +- { file : "tables_recreate.sql" , folder : "user_scripts/odbfcl" , type : "sql" , task_action : "Recreate tables" } +- { file : "hashGet.yml" , folder : "user_scripts/odbfcl/extract" , type : "yml", task_action : "Collect Database Info" } - { file : "externalDir.yml" , type : "yml" , task_action : "Create External Directory" } -# - { file : "preActions.sql" , type : "sql", task_action : "Do nothing." } user_expdp_post : -- { file : "postActions.sql" , type : "sql", task_action : "Do nothing." } +- { file : "tables_recreate_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Recreate tables in ADB" } +- { file : "adb_load_filechksum.yml" , folder : "user_scripts/odbfcl/adb_load_filechksum" , type : "yml", task_action : "Load chksum for ORACLE_HOME in ADB" } +- { file : "adb_load_symbols.yml" , folder : "user_scripts/odbfcl/adb_load_symbols" , type : "yml", task_action : "Load chksum for ORACLE_HOME in ADB" } +- { file : "adb_load_txtcollection_files.yml" , folder : "user_scripts/odbfcl/adb_load_txtcollection_files" , type : "yml", task_action : "Load non-binary files from ORACLE_HOME in ADB" } +- { file : "adb_load_expdp.yml" , folder : "user_scripts/odbfcl/adb_load_expdp" , type : "yml", task_action : "impdp files from OS to ADB" } +- { file : "exchange_tables_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Exchange loaded table in the correct partition position" } # User that will hold your tables outputs and be exported after each execution. If the database is CDB, "C##" will be automatically inserted if not. dump_user : hash @@ -32,10 +36,29 @@ dump_user : hash # User pass dump_pass : hash -# This parameter will skip execution for patches that already have a dump file generated in "dump_folder" ("output_folder"/expdp). -skip_dump_exists: true - # OCI Information to deploy VM -oci_compartment_id : ocid1.compartment.oc1..aaaaaaaa6lt4nm5eq6uynk4x4h3vyw3cpdszdyyl2qc7kq4wzlaiwtojqgrq -oci_subnet_id : ocid1.subnet.oc1.iad.aaaaaaaarpoyj63i2hfron6wzhk25rnnsmraome3oz3oqnnfk4cahsi5amgq -oci_ad : ocid1.subnet.oc1.iad.aaaaaaaarpoyj63i2hfron6wzhk25rnnsmraome3oz3oqnnfk4cahsi5amgq \ No newline at end of file +oci_compartment_id : ocid1.compartment.oc1..xxx +oci_subnet_id : ocid1.subnet.oc1.iad.xxx +oci_ad : ocid1.subnet.oc1.iad.xxx + +# OCI Information to upload objects to OS +oci_namespace: xxx +oci_bucket: xxx + +# OCI Information to connect and load in ADB +oci_adb_user: xxx +oci_adb_pass: xxx +oci_adb_tns: xxx_tp +oci_adb_credential: XXX +oci_adb_os_url_prefix: https://objectstorage.us-ashburn-1.oraclecloud.com/n/xxx/b/xxx/o + +########################### +### For loader.yml only ### +########################### + +# Files in "user_scripts" folder that will run before and after the final expdp. +user_impdp_pre : +- { file : "pre_prepare_dump_file.yml" , folder : "user_scripts/odbfcl/adb_load_expdp" , type : "yml", task_action : "Prepare files for impdp" } + +user_impdp_post : +- { file : "post_remove_dump_file.yml" , folder : "user_scripts/odbfcl/adb_load_expdp" , type : "yml", task_action : "Clean files used for impdp" } \ No newline at end of file From 8ed9ce9b309a43ce59cbf5f07b2cc1636bd55fcb Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 2 Jul 2021 14:20:47 -0300 Subject: [PATCH 010/229] Changes for new version --- .gitignore | 5 +++-- config_main.yml | 8 +++++++- config_vbox.yml | 3 --- list_exceptions.yml | 5 +++++ list_patches.yml | 4 ++-- list_versions.yml | 9 +++++++++ 6 files changed, 26 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 5b17f33..ec5f113 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ - .DS_Store main.retry *.txt -*.log \ No newline at end of file +*.log +/user_scripts/report/* +/user_scripts/odbfcl/* \ No newline at end of file diff --git a/config_main.yml b/config_main.yml index 1ffff64..8b61b61 100644 --- a/config_main.yml +++ b/config_main.yml @@ -1,2 +1,8 @@ # OCI Mode? If true, script will load and run in OCI move, otherwise, VBox. -oci_mode : true \ No newline at end of file +oci_mode : true + +# This parameter will skip execution for patches that already have a dump file generated in "dump_folder" ("output_folder"/expdp). +skip_dump_exists: true + +# If true, will only deploy the patch and skip the expdp and the pre/post steps. +only_deploy_patch: false diff --git a/config_vbox.yml b/config_vbox.yml index 9cb8fb5..0865407 100644 --- a/config_vbox.yml +++ b/config_vbox.yml @@ -30,9 +30,6 @@ dump_user : hash # User pass dump_pass : hash -# This parameter will skip execution for patches that already have a dump file generated in "dump_folder" ("output_folder"/expdp). -skip_dump_exists: true - ########################### ### For loader.yml only ### ########################### diff --git a/list_exceptions.yml b/list_exceptions.yml index c16c1f5..98d2f7c 100644 --- a/list_exceptions.yml +++ b/list_exceptions.yml @@ -5,6 +5,11 @@ # Patches that will retry "datapatch" if they fail. Max retries is 3. list_retry_datapatch: + - { version: "12.1.0.2" , type : "BP" , id : 8 , retries : 2 } + - { version: "12.1.0.2" , type : "BP" , id : 9 , retries : 2 } + - { version: "12.1.0.2" , type : "BP" , id : 190115 , retries : 2 } + - { version: "12.2.0.1" , type : "RUR" , id : 180717 , retries : 1 } + - { version: "12.2.0.1" , type : "RUR" , id : 181016 , retries : 1 } - { version: "12.1.0.2" , type : "BP" , id : 190716 , retries : 2 } - { version: "12.2.0.1" , type : "RU" , id : 190716 , retries : 1 } - { version: "12.2.0.1" , type : "RUR" , id : 190716 , retries : 1 } diff --git a/list_patches.yml b/list_patches.yml index 461ff16..b83fef7 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -305,8 +305,8 @@ list_12201: # Database 18 Proactive Patch Information (Doc ID 2369376.1) list_18000: - - { type : "RU" , id : 2 , patch_number : 27676517 } - - { type : "RU" , id : 3 , patch_number : 28090523 } + - { type : "RU" , id : 2 , patch_number : 27676517 , base_snap : "18.1.0" } + - { type : "RU" , id : 3 , patch_number : 28090523 , base_snap : "18.1.0" } - { type : "RU" , id : 4 , patch_number : 28655784 } - { type : "RU" , id : 5 , patch_number : 28822489 } - { type : "RU" , id : 6 , patch_number : 29301631 } diff --git a/list_versions.yml b/list_versions.yml index 490b5bc..be5485d 100644 --- a/list_versions.yml +++ b/list_versions.yml @@ -13,3 +13,12 @@ list_versions: - { id : "12.2.0.1" , patch_list : "list_12201" , main_file : "patch_main.yml" , vmachine : "Oracle Linux 6.8" , base_snap : "12.2.0.1 Ready" , opatch_file : "p6880880_200000_Linux-x86-64.zip" , ip : "192.168.56.101" } - { id : "18.0.0.0" , patch_list : "list_18000" , main_file : "patch_main.yml" , vmachine : "Oracle Linux 6.8" , base_snap : "18.0.0.0 Ready" , opatch_file : "p6880880_200000_Linux-x86-64.zip" , ip : "192.168.56.101" } - { id : "19.0.0.0" , patch_list : "list_19000" , main_file : "patch_main.yml" , vmachine : "Oracle Linux 7.6" , base_snap : "19.0.0.0 Ready" , opatch_file : "p6880880_200000_Linux-x86-64.zip" , ip : "192.168.56.102" } + +list_info_oci: + - { id : "11.2.0.4" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" } + - { id : "12.1.0.1" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" } + - { id : "12.1.0.2" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" } + - { id : "12.2.0.1" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" } + - { id : "18.0.0.0" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" , out_of_box_ru : 3 } + - { id : "19.0.0.0" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" , out_of_box_ru : 3 } + - { id : "21.0.0.0" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" } From cd503be4e6698115b6abebbcfb6d5162a1a459b2 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 2 Jul 2021 14:24:24 -0300 Subject: [PATCH 011/229] More files changed --- loader_adb.yml | 54 +++++++++++++++++ patch_sql/startupCDB.sql | 1 + patch_sql/startupCDBOJVM.sql | 1 + patch_sql/startupForce.sql | 2 - .../tasks/main.yml | 13 ++++ roles/oci_object_storage_object/meta/main.yml | 2 + .../oci_object_storage_object/tasks/main.yml | 18 ++++++ tasks/impdp_file.yml | 4 +- tasks/impdp_file_adb.yml | 25 ++++++++ tasks/lvm_reload.yml | 13 +++- tasks/lvm_savestate.yml | 13 ++++ tasks/main_PSU_BP.yml | 2 +- tasks/main_RU_RUR.yml | 12 ++-- tasks/main_loader_adb.yml | 55 +++++++++++++++++ tasks/patch_main.yml | 60 ++++++++++--------- tasks/patch_main_11g.yml | 59 +++++++++--------- tasks/patch_tasks_post.yml | 41 +++++++------ tasks/patch_tasks_pre.yml | 44 +++++++------- tasks/run_sql.yml | 3 +- 19 files changed, 315 insertions(+), 107 deletions(-) create mode 100644 loader_adb.yml delete mode 100644 patch_sql/startupForce.sql create mode 100644 roles/oci_object_storage_object/meta/main.yml create mode 100644 roles/oci_object_storage_object/tasks/main.yml create mode 100644 tasks/impdp_file_adb.yml create mode 100644 tasks/main_loader_adb.yml diff --git a/loader_adb.yml b/loader_adb.yml new file mode 100644 index 0000000..2d21450 --- /dev/null +++ b/loader_adb.yml @@ -0,0 +1,54 @@ +#************************************************************************ +# +# Oracle Patch Loop Applier +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +#************************************************************************ +# Available at: https://github.com/dbarj/oracle_patch_loop/ +# Created on: May/2019 by Rodrigo Jorge +#************************************************************************ + +- hosts: localhost + gather_facts: true + become: false + any_errors_fatal: true + + vars_files: + - config_main.yml + - config_oci.yml + - list_versions.yml + - list_patches.yml + + pre_tasks: + - import_tasks: tasks/setup_env.yml + + tasks: + + - include: tasks/main_loader_adb.yml db_version="11.2.0.4" + when: param_version is undefined or param_version == "11.2.0.4" + + - include: tasks/main_loader_adb.yml db_version="12.1.0.1" + when: param_version is undefined or param_version == "12.1.0.1" + + - include: tasks/main_loader_adb.yml db_version="12.1.0.2" + when: param_version is undefined or param_version == "12.1.0.2" + + - include: tasks/main_loader_adb.yml db_version="12.2.0.1" + when: param_version is undefined or param_version == "12.2.0.1" + + - include: tasks/main_loader_adb.yml db_version="18.0.0.0" + when: param_version is undefined or param_version == "18.0.0.0" + + - include: tasks/main_loader_adb.yml db_version="19.0.0.0" + when: param_version is undefined or param_version == "19.0.0.0" diff --git a/patch_sql/startupCDB.sql b/patch_sql/startupCDB.sql index cc9343e..fb71438 100644 --- a/patch_sql/startupCDB.sql +++ b/patch_sql/startupCDB.sql @@ -1,3 +1,4 @@ +whenever sqlerror exit sql.sqlcode startup; alter pluggable database all open; exit; diff --git a/patch_sql/startupCDBOJVM.sql b/patch_sql/startupCDBOJVM.sql index 796289c..cf963d5 100644 --- a/patch_sql/startupCDBOJVM.sql +++ b/patch_sql/startupCDBOJVM.sql @@ -1,3 +1,4 @@ +whenever sqlerror exit sql.sqlcode startup upgrade; alter pluggable database all open upgrade; exit; diff --git a/patch_sql/startupForce.sql b/patch_sql/startupForce.sql deleted file mode 100644 index 483503f..0000000 --- a/patch_sql/startupForce.sql +++ /dev/null @@ -1,2 +0,0 @@ -startup force; -exit; diff --git a/roles/oci_compute_instance_actions/tasks/main.yml b/roles/oci_compute_instance_actions/tasks/main.yml index c9fe270..d80ef99 100644 --- a/roles/oci_compute_instance_actions/tasks/main.yml +++ b/roles/oci_compute_instance_actions/tasks/main.yml @@ -44,4 +44,17 @@ ansible_connection: local when: not oci_action.changed + - name: Ensure shared disk "{{ VM_folder }}" is mounted + shell: | + set -eo pipefail + if mount | grep -q -F ' {{ VM_folder }} ' + then + echo ok + else + mount {{ VM_folder }} + fi + become: true + become_user: root + delegate_to: "{{ vm_ip_address }}" + when: compute_action == "start" \ No newline at end of file diff --git a/roles/oci_object_storage_object/meta/main.yml b/roles/oci_object_storage_object/meta/main.yml new file mode 100644 index 0000000..b42ca0c --- /dev/null +++ b/roles/oci_object_storage_object/meta/main.yml @@ -0,0 +1,2 @@ +collections: + - oracle.oci \ No newline at end of file diff --git a/roles/oci_object_storage_object/tasks/main.yml b/roles/oci_object_storage_object/tasks/main.yml new file mode 100644 index 0000000..2c11c65 --- /dev/null +++ b/roles/oci_object_storage_object/tasks/main.yml @@ -0,0 +1,18 @@ +- name: Upload file to object storage + oci_object_storage_object: + namespace_name: "{{ oci_namespace }}" + bucket_name: "{{ oci_bucket }}" + object_name: "{{ oci_upload_file | regex_replace('^.*\\/', '') }}" + src: "{{ oci_upload_file }}" + state: present + register: oci_action + when: object_action == "create" + +- name: Remove file from object storage + oci_object_storage_object: + namespace_name: "{{ oci_namespace }}" + bucket_name: "{{ oci_bucket }}" + object_name: "{{ oci_upload_file | regex_replace('^.*\\/', '') }}" + state: absent + register: oci_action + when: object_action == "remove" \ No newline at end of file diff --git a/tasks/impdp_file.yml b/tasks/impdp_file.yml index 42c33e1..fe53acc 100644 --- a/tasks/impdp_file.yml +++ b/tasks/impdp_file.yml @@ -51,6 +51,4 @@ - name : "Remove file {{ dump_file_prefix }}.log" file: state: absent - path: "{{ shared_folder }}/{{ dump_file_prefix }}.log" - -# Skip all is true when dump file is already generated and skip_dump_exists is true at config. \ No newline at end of file + path: "{{ shared_folder }}/{{ dump_file_prefix }}.log" \ No newline at end of file diff --git a/tasks/impdp_file_adb.yml b/tasks/impdp_file_adb.yml new file mode 100644 index 0000000..3650e53 --- /dev/null +++ b/tasks/impdp_file_adb.yml @@ -0,0 +1,25 @@ +- name: "Processing {{ db_version }} {{ patch.type }} {{ patch.id }}" + debug: msg="Processing {{ db_version }} {{ patch.type }} {{ patch.id }}" + +# User custom pre-scripts +- include: run_script.yml + loop: "{{ user_impdp_pre | flatten(levels=1) }}" + loop_control: + loop_var: script_param + when: user_impdp_pre is defined + +# The impdp loader are the same steps executed after the expdp +- include: run_script.yml + loop: "{{ user_expdp_post | flatten(levels=1) }}" + loop_control: + loop_var: script_param + when: user_expdp_post is defined + +# User custom post-scripts +- include: run_script.yml + loop: "{{ user_impdp_post | flatten(levels=1) }}" + loop_control: + loop_var: script_param + when: user_impdp_post is defined + +# Skip all is true when dump file is already generated and skip_dump_exists is true at config. \ No newline at end of file diff --git a/tasks/lvm_reload.yml b/tasks/lvm_reload.yml index 4c65480..c17e8ce 100644 --- a/tasks/lvm_reload.yml +++ b/tasks/lvm_reload.yml @@ -7,7 +7,7 @@ sleep 5 umount -l -f /u01 || true sleep 5 - lvchange -a n ${v_disk} + lvchange -a n ${v_disk} -f lvconvert --merge -i 1 -v ${v_disk}_${v_snapshot} lvchange -a n ${v_disk} lvchange -a y ${v_disk} @@ -22,7 +22,16 @@ done v_size=$(lvs --noheadings -o seg_size ${v_disk}) lvcreate --size ${v_size} --snapshot --name lv_u01_${v_snapshot} ${v_disk} - mount /u01 + mount /u01 || true + mount | grep -q -F ' /u01 ' become: true become_user: root + delegate_to: "{{ vm_ip_address }}" + +- name: "Clean oracle Shared Segments" + shell: | + # Clean Shared Segments (ORA-12547 TNS: Lost Contact) + ipcs -m | grep oracle | awk ' { print $2 } ' | xargs -I {} ipcrm -m {} + become: true + become_user: oracle delegate_to: "{{ vm_ip_address }}" \ No newline at end of file diff --git a/tasks/lvm_savestate.yml b/tasks/lvm_savestate.yml index fd63f20..95de59b 100644 --- a/tasks/lvm_savestate.yml +++ b/tasks/lvm_savestate.yml @@ -1,5 +1,18 @@ ## This code will take a snapshot named "vm_snapshot" for the VM. It will later be used as a base release for OJVMs. +# Drop old machine image if exists +- name: "Drop old LVM snapshots for previous RU or PSU if exists." + shell: | + v_snapshot="{{ vm_snapshot }}" + v_disk_vg='/dev/mapper/vg_u01' + for lv_name in `lvs --noheadings -o lv_name | grep -E 'PSU|RU' | grep -v ${v_snapshot}` + do + lvremove -f ${v_disk_vg}-${lv_name} + done + become: true + become_user: root + delegate_to: "{{ vm_ip_address }}" + # Save latest machine image if not already - name: "Create new LVM snapshot \"{{ vm_snapshot }}\" if not exists." shell: | diff --git a/tasks/main_PSU_BP.yml b/tasks/main_PSU_BP.yml index d518a7d..8c09a3c 100644 --- a/tasks/main_PSU_BP.yml +++ b/tasks/main_PSU_BP.yml @@ -183,4 +183,4 @@ name: oci_compute_instance_actions vars: compute_action: stop - when: oci_mode == true \ No newline at end of file + when: oci_mode == true and not only_deploy_patch \ No newline at end of file diff --git a/tasks/main_RU_RUR.yml b/tasks/main_RU_RUR.yml index f3987ba..c5248b1 100644 --- a/tasks/main_RU_RUR.yml +++ b/tasks/main_RU_RUR.yml @@ -15,6 +15,7 @@ set_fact: oci_instance_id: "{{ item.oci_instance_id }}" patch_base: "{{ item.base_snap }}" + out_of_box_ru: "{{ item.out_of_box_ru | default(0) }}" with_items: "{{ list_info_oci }}" when: item.id == db_version and oci_mode == true @@ -45,11 +46,11 @@ # Execute for base release - include: "{{ patch_file }}" vars: - patch : { type : RU , id : 0, patch_number : 0 } + patch : { type : RU , id : "{{ out_of_box_ru }}" , patch_number : 0 } when: - - 0 == (param_patch | int) or param_patch == -1 - - 0 >= (param_patch_from | int) or param_patch_from == -1 - - 0 <= (param_patch_to | int) or param_patch_to == -1 + - (out_of_box_ru | int) == (param_patch | int) or param_patch == -1 + - (out_of_box_ru | int) >= (param_patch_from | int) or param_patch_from == -1 + - (out_of_box_ru | int) <= (param_patch_to | int) or param_patch_to == -1 # Execute for every RU - include: "{{ patch_file }}" @@ -62,6 +63,7 @@ - patch.id == (param_patch | int) or param_patch == -1 - patch.id >= (param_patch_from | int) or param_patch_from == -1 - patch.id <= (param_patch_to | int) or param_patch_to == -1 + - patch.id > (out_of_box_ru | int) when: param_type is undefined or param_type == "RU" @@ -167,4 +169,4 @@ name: oci_compute_instance_actions vars: compute_action: stop - when: oci_mode == true \ No newline at end of file + when: oci_mode == true and not only_deploy_patch \ No newline at end of file diff --git a/tasks/main_loader_adb.yml b/tasks/main_loader_adb.yml new file mode 100644 index 0000000..2fde1a7 --- /dev/null +++ b/tasks/main_loader_adb.yml @@ -0,0 +1,55 @@ +### Will import all dumps to a given database. + +- name : Define version + set_fact: + patch_list: "{{ item.patch_list }}" + with_items: "{{ list_versions }}" + when: item.id == db_version + +- name : Define Cloud params + set_fact: + out_of_box_ru: "{{ item.out_of_box_ru | default(0) }}" + with_items: "{{ list_info_oci }}" + when: item.id == db_version + +#- fail: +# msg: "Stop here." + +- name : Check if there is any PSU + set_fact: + total_psus: "{{ lookup('vars', patch_list) | json_query(filter_qry) | count }}" + vars: + filter_qry: "[?type=='PSU'].id" + +- name : Check if there is any BP + set_fact: + total_bps: "{{ lookup('vars', patch_list) | json_query(filter_qry) | count }}" + vars: + filter_qry: "[?type=='BP'].id" + +- name : Check if there is any RU + set_fact: + total_rus: "{{ lookup('vars', patch_list) | json_query(filter_qry) | count }}" + vars: + filter_qry: "[?type=='RU'].id" + +# Execute for every PSU +- include: "impdp_file_adb.yml patch={{ item }}" + with_items: + - { type : PSU , id : 0 } + - "{{ lookup('vars', patch_list) | flatten(levels=1) }}" + when: total_psus != "0" + +# Execute for base BP only. The others were included above. +- include: "impdp_file_adb.yml patch={{ item }}" + with_items: + - { type : BP , id : 0 } + when: total_bps != "0" + +# Execute for every RU +- include: "impdp_file_adb.yml patch={{ item }}" + with_items: + - "{{ lookup('vars', patch_list) | flatten(levels=1) }}" + when: total_rus != "0" + +### \ No newline at end of file diff --git a/tasks/patch_main.yml b/tasks/patch_main.yml index 5a3e40f..21888fc 100644 --- a/tasks/patch_main.yml +++ b/tasks/patch_main.yml @@ -6,7 +6,8 @@ # Stop the database - include: run_sql.yml vars: - sql_param : { file : "shutdown.sql" , folder : "patch_sql" , task_action : "Stop Database" } + sql_param : { file : "shutdown.sql" , folder : "patch_sql" , task_action : "Stop Database for OPatch" } + when: oci_mode == false - name: Run OPatch shell: | @@ -20,7 +21,7 @@ register: shell_output become: true become_user: oracle - when: patch.id != 0 + when: patch.patch_number != 0 delegate_to: "{{ vm_ip_address }}" - name: Opatch Output @@ -30,13 +31,13 @@ # Start the database - include: run_sql.yml vars: - sql_param : { file : "startupCDB.sql" , folder : "patch_sql" , task_action : "Start Database" } + sql_param : { file : "startupCDB.sql" , folder : "patch_sql" , task_action : "Start Database for sqlpatch" } when: patch.type != "OJVM" # Start the database (in OJVM, it must be in upgrade mode) - include: run_sql.yml vars: - sql_param : { file : "startupCDBOJVM.sql" , folder : "patch_sql" , task_action : "Start Database" } + sql_param : { file : "startupCDBOJVM.sql" , folder : "patch_sql" , task_action : "Start Database for OJVM sqlpatch" } when: patch.type == "OJVM" # Run Datapatch @@ -45,7 +46,7 @@ - name: Run Datapatch include: datapatch.yml - when: patch.id != 0 + when: patch.patch_number != 0 # Evaluate if it's needed to reexecute datapatch on 12.1.1 due to bug. @@ -62,29 +63,34 @@ when: patch.type == "OJVM" - # User custom pre-scripts - - include: run_script.yml - loop: "{{ user_expdp_pre | flatten(levels=1) }}" - loop_control: - loop_var: script_param - - #- name : Export database tables - - name: Export Database Tables - shell: | - {{ dbhome_locl }}/bin/expdp userid={{ dump_user_int }}/{{ dump_pass }} directory=expdir compression=all dumpfile={{ dump_file_prefix }}.dmp logfile={{ dump_file_prefix }}.log content=data_only schemas={{ dump_user_int }} - environment: - ORACLE_HOME: "{{ dbhome_locl }}" - ORACLE_SID: "{{ mysid }}" - register: shell_output - become: true - become_user: oracle - delegate_to: "{{ vm_ip_address }}" + # When only_deploy_patch is false (most common case) + - block: - # User custom post-scripts - - include: run_script.yml - loop: "{{ user_expdp_post | flatten(levels=1) }}" - loop_control: - loop_var: script_param + # User custom pre-scripts + - include: run_script.yml + loop: "{{ user_expdp_pre | flatten(levels=1) }}" + loop_control: + loop_var: script_param + + #- name : Export database tables + - name: Export Database Tables + shell: | + {{ dbhome_locl }}/bin/expdp userid={{ dump_user_int }}/{{ dump_pass }} directory=expdir compression=all dumpfile={{ dump_file_prefix }}.dmp logfile={{ dump_file_prefix }}.log content=data_only schemas={{ dump_user_int }} + environment: + ORACLE_HOME: "{{ dbhome_locl }}" + ORACLE_SID: "{{ mysid }}" + register: shell_output + become: true + become_user: oracle + delegate_to: "{{ vm_ip_address }}" + + # User custom post-scripts + - include: run_script.yml + loop: "{{ user_expdp_post | flatten(levels=1) }}" + loop_control: + loop_var: script_param + + when: not only_deploy_patch # Post Actions - include: patch_tasks_post.yml diff --git a/tasks/patch_main_11g.yml b/tasks/patch_main_11g.yml index 1f750c2..e5c0342 100644 --- a/tasks/patch_main_11g.yml +++ b/tasks/patch_main_11g.yml @@ -95,41 +95,44 @@ delegate_to: "{{ vm_ip_address }}" when: dbvault_enabled == true - when: patch.id != 0 + when: patch.patch_number != 0 - # Reason for Startup Force is that sqlplus may say instance is already up when it is actually down. - # This happens when you kill oracle processes when DB is running and reinstate LVM. # This start is only required if database was never stopped. - include: run_sql.yml vars: - sql_param : { file : "startupForce.sql" , folder : "patch_sql" , task_action : "Start Database" } - when: patch.id == 0 or (patch.id != 0 and dbvault_enabled == true) + sql_param : { file : "startup.sql" , folder : "patch_sql" , task_action : "Start Database" } + when: patch.patch_number == 0 or (patch.patch_number != 0 and dbvault_enabled == true) - # User custom pre-scripts - - name: Run user custom pre-scripts - include: run_script.yml - loop: "{{ user_expdp_pre | flatten(levels=1) }}" - loop_control: - loop_var: script_param + # When only_deploy_patch is false (most common case) + - block: + + # User custom pre-scripts + - name: Run user custom pre-scripts + include: run_script.yml + loop: "{{ user_expdp_pre | flatten(levels=1) }}" + loop_control: + loop_var: script_param + + #- name : Export database tables + - name: Export Database Tables + shell: | + {{ dbhome_locl }}/bin/expdp userid={{ dump_user_int }}/{{ dump_pass }} directory=expdir compression=all dumpfile={{ dump_file_prefix }}.dmp logfile={{ dump_file_prefix }}.log content=data_only schemas={{ dump_user_int }} + environment: + ORACLE_HOME: "{{ dbhome_locl }}" + ORACLE_SID: "{{ mysid }}" + register: shell_output + become: true + become_user: oracle + delegate_to: "{{ vm_ip_address }}" - #- name : Export database tables - - name: Export Database Tables - shell: | - {{ dbhome_locl }}/bin/expdp userid={{ dump_user_int }}/{{ dump_pass }} directory=expdir compression=all dumpfile={{ dump_file_prefix }}.dmp logfile={{ dump_file_prefix }}.log content=data_only schemas={{ dump_user_int }} - environment: - ORACLE_HOME: "{{ dbhome_locl }}" - ORACLE_SID: "{{ mysid }}" - register: shell_output - become: true - become_user: oracle - delegate_to: "{{ vm_ip_address }}" + # User custom post-scripts + - name: Run user custom post-scripts + include: run_script.yml + loop: "{{ user_expdp_post | flatten(levels=1) }}" + loop_control: + loop_var: script_param - # User custom post-scripts - - name: Run user custom post-scripts - include: run_script.yml - loop: "{{ user_expdp_post | flatten(levels=1) }}" - loop_control: - loop_var: script_param + when: not only_deploy_patch # Post Actions - include: patch_tasks_post.yml diff --git a/tasks/patch_tasks_post.yml b/tasks/patch_tasks_post.yml index 11eca08..2d0c849 100644 --- a/tasks/patch_tasks_post.yml +++ b/tasks/patch_tasks_post.yml @@ -1,34 +1,39 @@ -- name: "Copy {{ dump_file_prefix }}.dmp to repository" - copy: - src: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" - dest: "{{ output_folder }}/expdp" +# Skip the dump part if not expdp does not run +- block: -- name: "Copy {{ dump_file_prefix }}.log to repository" - copy: - src: "{{ shared_folder }}/{{ dump_file_prefix }}.log" - dest: "{{ output_folder }}/expdp" + - name: "Copy {{ dump_file_prefix }}.dmp to repository" + copy: + src: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" + dest: "{{ output_folder }}/expdp" -- name : "Remove file {{ dump_file_prefix }}.dmp" - file: - state: absent - path: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" + - name: "Copy {{ dump_file_prefix }}.log to repository" + copy: + src: "{{ shared_folder }}/{{ dump_file_prefix }}.log" + dest: "{{ output_folder }}/expdp" -- name : "Remove file {{ dump_file_prefix }}.log" - file: - state: absent - path: "{{ shared_folder }}/{{ dump_file_prefix }}.log" + - name : "Remove file {{ dump_file_prefix }}.dmp" + file: + state: absent + path: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" + + - name : "Remove file {{ dump_file_prefix }}.log" + file: + state: absent + path: "{{ shared_folder }}/{{ dump_file_prefix }}.log" + + when: not only_deploy_patch - name : Remove unzipped patch folder file: state: absent path: "{{ unzip_patch_folder }}" - when: patch.id != 0 + when: patch.patch_number != 0 - name : Remove PatchSearch.xml file: state: absent path: "{{ shared_folder }}/PatchSearch.xml" - when: patch.id != 0 + when: patch.patch_number != 0 - name : Define latest processed set_fact: diff --git a/tasks/patch_tasks_pre.yml b/tasks/patch_tasks_pre.yml index 51c9a3b..0871390 100644 --- a/tasks/patch_tasks_pre.yml +++ b/tasks/patch_tasks_pre.yml @@ -1,29 +1,33 @@ - name: "Processing {{ db_version }} {{ patch.type }} {{ patch.id }} - Patch {{ patch.patch_number }}" debug: msg="Processing {{ db_version }} {{ patch.type }} {{ patch.id }} - Patch {{ patch.patch_number }}" -- name : Define dump and sha256 file names +- name : Define dump file name set_fact: dump_file_prefix: "tables_{{ db_version }}_{{ patch.base_ru | default('')}}{{ patch.type }}_{{ patch.id }}" - sha256_file: "sha256sum_{{ db_version }}_{{ patch.base_ru | default('')}}{{ patch.type }}_{{ patch.id }}.chk" skip_all: false fix_datapatch_retries: 0 -- name: "Check if {{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp exists" - stat: - path: "{{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp" - register: dump_stat_result +# Ignore dumpfile checks when only_deploy_patch is true +- block: -# Will skip all the rest if the dump file exists -- name : Define skip_all - set_fact: - skip_all: "{{ dump_stat_result.stat.exists }}" - when: skip_dump_exists == true + - name: "Check if {{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp exists" + stat: + path: "{{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp" + register: dump_stat_result + + # Will skip all the rest if the dump file exists + - name : Define skip_all + set_fact: + skip_all: "{{ dump_stat_result.stat.exists }}" + when: skip_dump_exists == true + + - name : Remove dump file if exists + file: + state: absent + path: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" + when: skip_all == false -- name : Remove dump file if exists - file: - state: absent - path: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" - when: skip_all == false + when: not only_deploy_patch # Check if patch will need to reexecute datapatch - name : Check datapatch reexecution @@ -37,7 +41,7 @@ - err_list.type == patch.type - err_list.id == patch.id -# When not processing base release. i.e patch.id != 0 +# When not processing base release. i.e patch.patch_number != 0 - block: # Place patch file on the shared folder @@ -87,7 +91,7 @@ when: patch.patch_folder is defined - when: patch.id != 0 and skip_all == false + when: patch.patch_number != 0 and skip_all == false - include: vbox_reload.yml when: oci_mode == false and skip_all == false @@ -95,7 +99,7 @@ - include: lvm_reload.yml when: oci_mode == true and skip_all == false -# Replace opatch with latest version, when not processing base release. i.e patch.id != 0 +# Replace opatch with latest version, when not processing base release. i.e patch.patch_number != 0 - block: - name: Remove OPatch folder @@ -114,4 +118,4 @@ become_user: oracle delegate_to: "{{ vm_ip_address }}" - when: db_opatch|length > 0 and patch.id != 0 and skip_all == false \ No newline at end of file + when: db_opatch|length > 0 and patch.patch_number != 0 and skip_all == false \ No newline at end of file diff --git a/tasks/run_sql.yml b/tasks/run_sql.yml index 384aa64..7dede84 100644 --- a/tasks/run_sql.yml +++ b/tasks/run_sql.yml @@ -8,8 +8,9 @@ - name: "Run SQL - {{ sql_param.task_action }}" shell: | + set -e export ORACLE_HOME ORACLE_SID - {{ dbhome_locl }}/bin/sqlplus -s "/ as sysdba" @{{ VM_folder }}/{{ sql_param.folder | default('user_scripts') }}/{{ sql_param.file }} {{ sql_param.params | default('') }} + {{ dbhome_locl }}/bin/sqlplus -L -S "/ as sysdba" @{{ VM_folder }}/{{ sql_param.folder | default('user_scripts') }}/{{ sql_param.file }} {{ sql_param.params | default('') }} environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" From c9c5e48b7ee486599622411cd39f2a362eea5db4 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 2 Jul 2021 14:31:59 -0300 Subject: [PATCH 012/229] Last fixes --- tasks/setup_database.yml | 8 +++++++- tasks/setup_env.yml | 15 ++++++++++++++- user_scripts/externalDir.sql | 10 ++++++++++ user_scripts/gen/fileGet.yml | 9 +++------ user_scripts/load/fileLoad.yml | 2 +- 5 files changed, 35 insertions(+), 9 deletions(-) diff --git a/tasks/setup_database.yml b/tasks/setup_database.yml index 7d5124b..ee6d0dd 100644 --- a/tasks/setup_database.yml +++ b/tasks/setup_database.yml @@ -41,11 +41,17 @@ - block: + - name: "Startup" + include: run_sql.yml + vars: + sql_param : { file : "startup.sql" , folder : "patch_sql" , task_action : "Start Database" } + when: oci_mode == true + - name: "Check if CDB is enabled" shell: | set -eo pipefail export ORACLE_HOME ORACLE_SID - {{ dbhome_locl }}/bin/sqlplus -s "/ as sysdba" <<'EOF' | sed '/^$/d' + {{ dbhome_locl }}/bin/sqlplus -L -S "/ as sysdba" <<'EOF' | sed '/^$/d' whenever sqlerror exit sql.sqlcode set pages 0 head off feed off echo off trims on ver off term on select decode(substr(CDB,1,1),'Y','true','N','false') is_cdb from v$database; diff --git a/tasks/setup_env.yml b/tasks/setup_env.yml index 4456749..5337624 100644 --- a/tasks/setup_env.yml +++ b/tasks/setup_env.yml @@ -1,3 +1,16 @@ +- name: Ensure shared disk "{{ shared_folder }}" is mounted + shell: | + set -eo pipefail + if mount | grep -q -F ' {{ shared_folder }} ' + then + echo ok + else + mount {{ shared_folder }} + fi + become: true + become_user: root + when: oci_mode == true + - name: Copy patch SQL to shared folder copy: src: patch_sql/ @@ -27,4 +40,4 @@ - name : Define latest processed as null set_fact: - latest_processed: "" \ No newline at end of file + latest_processed: "" diff --git a/user_scripts/externalDir.sql b/user_scripts/externalDir.sql index 79ca417..6195c3a 100644 --- a/user_scripts/externalDir.sql +++ b/user_scripts/externalDir.sql @@ -3,4 +3,14 @@ WHENEVER SQLERROR EXIT SQL.SQLCODE CREATE OR REPLACE DIRECTORY expdir AS '&1'; +col v_username new_v v_username nopri + +select case when version >= 12 then 'C##' end || 'HASH' v_username +from (select to_number(substr(version,1,instr(version,'.')-1)) version + from v$instance); + +col v_username clear + +GRANT READ,WRITE ON DIRECTORY expdir to &v_username.; + EXIT 0 \ No newline at end of file diff --git a/user_scripts/gen/fileGet.yml b/user_scripts/gen/fileGet.yml index c58c8cc..e3e24af 100644 --- a/user_scripts/gen/fileGet.yml +++ b/user_scripts/gen/fileGet.yml @@ -1,9 +1,9 @@ # Folder to store the final generated ORACLE_HOME checksum -- name : Define folder name +- name : Define chksum folder name set_fact: chksum_folder: "{{ output_folder }}/binsum" -- name : Define file names +- name : Define chksum file names set_fact: sha256_file: "sha256sum_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}.chk" @@ -13,9 +13,6 @@ register: chksum_stat_result # Will skip all the rest if the chksum file exists -- name : Define exists_chksum - set_fact: - exists_chksum: "{{ chksum_stat_result.stat.exists }}" - block : @@ -65,4 +62,4 @@ state: absent path: "{{ shared_folder }}/{{ sha256_file }}" - when: exists_chksum == false \ No newline at end of file + when: not chksum_stat_result.stat.exists \ No newline at end of file diff --git a/user_scripts/load/fileLoad.yml b/user_scripts/load/fileLoad.yml index 60f3780..6e22bd6 100644 --- a/user_scripts/load/fileLoad.yml +++ b/user_scripts/load/fileLoad.yml @@ -1,7 +1,7 @@ # Folder to store the final generated ORACLE_HOME checksum - name : Define file names set_fact: - chksum_path: "/Volumes/Samsung_T3/OraSum/files" + chksum_path: "{{ output_folder }}" chksum_folder: "binsum" - name: "Copy {{ chksum_path }}/{{ chksum_folder }} to shared location." From 65b1952730470909683e3133d11a96d42109e826 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 2 Jul 2021 14:35:01 -0300 Subject: [PATCH 013/229] Delete tables_recreate_OCI.sql --- user_scripts/tables_recreate_OCI.sql | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 user_scripts/tables_recreate_OCI.sql diff --git a/user_scripts/tables_recreate_OCI.sql b/user_scripts/tables_recreate_OCI.sql deleted file mode 100644 index 3210fb6..0000000 --- a/user_scripts/tables_recreate_OCI.sql +++ /dev/null @@ -1,15 +0,0 @@ -WHENEVER SQLERROR EXIT SQL.SQLCODE - -col v_username new_v v_username nopri - -select case when version >= 12 then 'C##HASH' else 'HASH' end v_username -from (select to_number(substr(version,1,instr(version,'.')-1)) version - from v$instance); - -col v_username clear - -@@createUser.sql &&v_username. - -conn &&v_username./hash; - -@@tables_create.sql From 9e8745f5b472b5821ac8e8e9be03c4820d776823 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 23 Jul 2021 17:48:41 -0300 Subject: [PATCH 014/229] Create set_version.yml --- set_version.yml | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 set_version.yml diff --git a/set_version.yml b/set_version.yml new file mode 100644 index 0000000..b3eee95 --- /dev/null +++ b/set_version.yml @@ -0,0 +1,52 @@ +#************************************************************************ +# +# Oracle Patch Loop Applier +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +#************************************************************************ +# Available at: https://github.com/dbarj/oracle_patch_loop/ +# Created on: May/2019 by Rodrigo Jorge +#************************************************************************ + +- hosts: localhost + gather_facts: true + become: false + any_errors_fatal: true + + vars_files: + - config_main.yml + - list_versions.yml + - list_patches.yml + - list_exceptions.yml + + tasks: + + - include_vars: config_vbox.yml + when: oci_mode == false + + - include_vars: config_oci.yml + when: oci_mode == true + + - import_tasks: tasks/setup_env.yml + + - name : Replace settings + set_fact: + skip_dump_exists: false + only_deploy_patch: true + + - include: tasks/main_PSU_BP.yml db_version="{{ param_version }}" + when: param_version == "11.2.0.4" or param_version == "12.1.0.1" or param_version == "12.1.0.2" + + - include: tasks/main_RU_RUR.yml db_version="{{ param_version }}" + when: param_version == "12.2.0.1" or param_version == "18.0.0.0" or param_version == "19.0.0.0" From 35e49f74b84e03a7505be6ae18afd1977ab7e21f Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 26 Jul 2021 12:14:34 -0300 Subject: [PATCH 015/229] Small fixes --- config_oci.yml | 2 ++ set_version.yml | 5 +++++ .../gen/{create_hash_others.sql => create_hash_dba_cdb.sql} | 0 user_scripts/gen/hashGet.sql | 2 +- 4 files changed, 8 insertions(+), 1 deletion(-) rename user_scripts/gen/{create_hash_others.sql => create_hash_dba_cdb.sql} (100%) diff --git a/config_oci.yml b/config_oci.yml index 2f7d126..7bcd932 100644 --- a/config_oci.yml +++ b/config_oci.yml @@ -15,6 +15,7 @@ output_folder : "/u01/patch_automation/output" # Files in "user_scripts" folder that will run before and after the final expdp. script_types can be "shell", "sql" or "yml". user_expdp_pre : +- { file : "bugsGet.yml" , folder : "user_scripts/odbfcl/extract" , type : "yml", task_action : "Generate fixed bugs list for ORACLE_HOME" } - { file : "fileGet.yml" , folder : "user_scripts/odbfcl/extract" , type : "yml", task_action : "Generate chksum for ORACLE_HOME" } - { file : "fileCollect.yml" , folder : "user_scripts/odbfcl/extract" , type : "yml", task_action : "Collect non-binary files from ORACLE_HOME" } - { file : "symbolGet.yml" , folder : "user_scripts/odbfcl/extract" , type : "yml", task_action : "Get all symbols on ORACLE_HOME binaries and libs" } @@ -24,6 +25,7 @@ user_expdp_pre : user_expdp_post : - { file : "tables_recreate_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Recreate tables in ADB" } +- { file : "adb_load_bugs_fixed.yml" , folder : "user_scripts/odbfcl/adb_load_bugs_fixed" , type : "yml", task_action : "Load fixed bugs list for ORACLE_HOME in ADB" } - { file : "adb_load_filechksum.yml" , folder : "user_scripts/odbfcl/adb_load_filechksum" , type : "yml", task_action : "Load chksum for ORACLE_HOME in ADB" } - { file : "adb_load_symbols.yml" , folder : "user_scripts/odbfcl/adb_load_symbols" , type : "yml", task_action : "Load chksum for ORACLE_HOME in ADB" } - { file : "adb_load_txtcollection_files.yml" , folder : "user_scripts/odbfcl/adb_load_txtcollection_files" , type : "yml", task_action : "Load non-binary files from ORACLE_HOME in ADB" } diff --git a/set_version.yml b/set_version.yml index b3eee95..27c29c7 100644 --- a/set_version.yml +++ b/set_version.yml @@ -45,6 +45,11 @@ skip_dump_exists: false only_deploy_patch: true + - name: Variables not provided + fail: + msg: "Variables param_version / param_type / param_patch must be defined." + when: param_version is undefined or param_type is undefined or param_patch is undefined + - include: tasks/main_PSU_BP.yml db_version="{{ param_version }}" when: param_version == "11.2.0.4" or param_version == "12.1.0.1" or param_version == "12.1.0.2" diff --git a/user_scripts/gen/create_hash_others.sql b/user_scripts/gen/create_hash_dba_cdb.sql similarity index 100% rename from user_scripts/gen/create_hash_others.sql rename to user_scripts/gen/create_hash_dba_cdb.sql diff --git a/user_scripts/gen/hashGet.sql b/user_scripts/gen/hashGet.sql index f4aaed6..be88336 100644 --- a/user_scripts/gen/hashGet.sql +++ b/user_scripts/gen/hashGet.sql @@ -47,7 +47,7 @@ PRO CDB/DBA_VIEWS @@create_hash_view.sql PRO All others CDB/DBA -@@create_hash_others.sql +@@create_hash_dba_cdb.sql PRO Non CDB/DBA views or tables @@create_hash_custom.sql From c31a5fa3fcd9812333497a077b56482d0b113f63 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 27 Jul 2021 15:41:42 -0300 Subject: [PATCH 016/229] Including some odbfcl scripts --- .gitignore | 3 +- config_main.yml | 2 +- tasks/patch_main.yml | 1 - tasks/patch_main_11g.yml | 1 - .../adb_load_bugs_fixed.yml | 64 ++ .../create_sqlldr_bugs_fixed_table.sql | 20 + .../load_bugs_fixed_table.sql | 27 + .../odbfcl/adb_load_expdp/adb_load_expdp.yml | 46 + .../adb_load_expdp/post_remove_dump_file.yml | 5 + .../adb_load_expdp/pre_prepare_dump_file.yml | 14 + .../adb_load_filechksum.yml | 64 ++ .../create_sqlldr_chksum_table.sql | 19 + .../adb_load_filechksum/load_chksum_table.sql | 13 + .../load_chksum_table_2.sql | 17 + .../adb_load_symbols/adb_load_symbols.yml | 67 ++ .../create_sqlldr_symbols_table.sql | 20 + .../adb_load_symbols/load_symbols_table.sql | 14 + .../adb_load_txtcollection_files.yml | 74 ++ .../create_sqlldr_txtcollection_table.sql | 20 + .../load_txtcollection_table.sql | 29 + user_scripts/odbfcl/createUser.sql | 11 + user_scripts/odbfcl/exchange_tables_adb.sql | 70 ++ user_scripts/odbfcl/exchange_tables_adb.yml | 8 + user_scripts/odbfcl/extract/bugsGet.yml | 62 + user_scripts/odbfcl/extract/fileCollect.yml | 38 + user_scripts/odbfcl/extract/fileGet.yml | 68 ++ user_scripts/odbfcl/extract/hashGet.sql | 64 ++ user_scripts/odbfcl/extract/hashGet.yml | 4 + user_scripts/odbfcl/extract/load_custom.sql | 67 ++ .../odbfcl/extract/load_database_vault.sql | 60 + user_scripts/odbfcl/extract/load_dba_cdb.sql | 153 +++ user_scripts/odbfcl/extract/load_source.sql | 47 + user_scripts/odbfcl/extract/load_v_dollar.sql | 66 ++ user_scripts/odbfcl/extract/load_view.sql | 93 ++ user_scripts/odbfcl/extract/load_x_dollar.sql | 80 ++ user_scripts/odbfcl/extract/symbolGet.yml | 58 + user_scripts/odbfcl/tables_create.sql | 1008 +++++++++++++++++ user_scripts/odbfcl/tables_recreate.sql | 15 + user_scripts/odbfcl/tables_recreate_adb.sql | 34 + user_scripts/odbfcl/tables_recreate_adb.yml | 12 + 40 files changed, 2533 insertions(+), 5 deletions(-) create mode 100644 user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml create mode 100644 user_scripts/odbfcl/adb_load_bugs_fixed/create_sqlldr_bugs_fixed_table.sql create mode 100644 user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql create mode 100644 user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml create mode 100644 user_scripts/odbfcl/adb_load_expdp/post_remove_dump_file.yml create mode 100644 user_scripts/odbfcl/adb_load_expdp/pre_prepare_dump_file.yml create mode 100644 user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml create mode 100644 user_scripts/odbfcl/adb_load_filechksum/create_sqlldr_chksum_table.sql create mode 100644 user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql create mode 100644 user_scripts/odbfcl/adb_load_filechksum/load_chksum_table_2.sql create mode 100644 user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml create mode 100644 user_scripts/odbfcl/adb_load_symbols/create_sqlldr_symbols_table.sql create mode 100644 user_scripts/odbfcl/adb_load_symbols/load_symbols_table.sql create mode 100644 user_scripts/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml create mode 100644 user_scripts/odbfcl/adb_load_txtcollection_files/create_sqlldr_txtcollection_table.sql create mode 100644 user_scripts/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql create mode 100644 user_scripts/odbfcl/createUser.sql create mode 100644 user_scripts/odbfcl/exchange_tables_adb.sql create mode 100644 user_scripts/odbfcl/exchange_tables_adb.yml create mode 100644 user_scripts/odbfcl/extract/bugsGet.yml create mode 100644 user_scripts/odbfcl/extract/fileCollect.yml create mode 100644 user_scripts/odbfcl/extract/fileGet.yml create mode 100644 user_scripts/odbfcl/extract/hashGet.sql create mode 100644 user_scripts/odbfcl/extract/hashGet.yml create mode 100644 user_scripts/odbfcl/extract/load_custom.sql create mode 100644 user_scripts/odbfcl/extract/load_database_vault.sql create mode 100644 user_scripts/odbfcl/extract/load_dba_cdb.sql create mode 100644 user_scripts/odbfcl/extract/load_source.sql create mode 100644 user_scripts/odbfcl/extract/load_v_dollar.sql create mode 100644 user_scripts/odbfcl/extract/load_view.sql create mode 100644 user_scripts/odbfcl/extract/load_x_dollar.sql create mode 100644 user_scripts/odbfcl/extract/symbolGet.yml create mode 100644 user_scripts/odbfcl/tables_create.sql create mode 100644 user_scripts/odbfcl/tables_recreate.sql create mode 100644 user_scripts/odbfcl/tables_recreate_adb.sql create mode 100644 user_scripts/odbfcl/tables_recreate_adb.yml diff --git a/.gitignore b/.gitignore index ec5f113..fd53fe6 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,4 @@ main.retry *.txt *.log -/user_scripts/report/* -/user_scripts/odbfcl/* \ No newline at end of file +/user_scripts/report/* \ No newline at end of file diff --git a/config_main.yml b/config_main.yml index 8b61b61..03128ad 100644 --- a/config_main.yml +++ b/config_main.yml @@ -2,7 +2,7 @@ oci_mode : true # This parameter will skip execution for patches that already have a dump file generated in "dump_folder" ("output_folder"/expdp). -skip_dump_exists: true +skip_dump_exists: false # If true, will only deploy the patch and skip the expdp and the pre/post steps. only_deploy_patch: false diff --git a/tasks/patch_main.yml b/tasks/patch_main.yml index 21888fc..923041c 100644 --- a/tasks/patch_main.yml +++ b/tasks/patch_main.yml @@ -72,7 +72,6 @@ loop_control: loop_var: script_param - #- name : Export database tables - name: Export Database Tables shell: | {{ dbhome_locl }}/bin/expdp userid={{ dump_user_int }}/{{ dump_pass }} directory=expdir compression=all dumpfile={{ dump_file_prefix }}.dmp logfile={{ dump_file_prefix }}.log content=data_only schemas={{ dump_user_int }} diff --git a/tasks/patch_main_11g.yml b/tasks/patch_main_11g.yml index e5c0342..90bb739 100644 --- a/tasks/patch_main_11g.yml +++ b/tasks/patch_main_11g.yml @@ -113,7 +113,6 @@ loop_control: loop_var: script_param - #- name : Export database tables - name: Export Database Tables shell: | {{ dbhome_locl }}/bin/expdp userid={{ dump_user_int }}/{{ dump_pass }} directory=expdir compression=all dumpfile={{ dump_file_prefix }}.dmp logfile={{ dump_file_prefix }}.log content=data_only schemas={{ dump_user_int }} diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml b/user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml new file mode 100644 index 0000000..bad9daf --- /dev/null +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml @@ -0,0 +1,64 @@ +- name : Define bugs_fixed filename and folder + set_fact: + bugs_fixed_file: "bugs_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}.txt" + bugs_fixed_folder: "{{ output_folder }}/bugsfixed" + +- name: "Check if {{ bugs_fixed_folder }}/{{ bugs_fixed_file }} exists" + stat: + path: "{{ bugs_fixed_folder }}/{{ bugs_fixed_file }}" + register: bugs_fixed_stat_result + +# Will skip all the rest if the bugs_fixed file does not exists +- block: + + - name: "Create sqlldr table" + shell: | + set -e + sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/adb_load_bugs_fixed/create_sqlldr_bugs_fixed_table.sql + register: sqloutput + + - name: SQL Output + debug: msg="{{ sqloutput.stdout_lines }}" + + - name: "Load {{ bugs_fixed_file }} in the database" + shell: | + set -e + + v_file="{{ bugs_fixed_file }}" + v_outpref="{{ shared_folder }}/{{ bugs_fixed_file }}" + + cat << EOF > "${v_outpref}_load.ctl" + LOAD + INTO TABLE T_BUGSFIXED_LOAD + APPEND + FIELDS TERMINATED BY x'09' + (file_name constant "${v_file}",bug_id, patch_id, bug_desc) + EOF + + cd "{{ bugs_fixed_folder }}" + + sqlldr {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} \ + control="${v_outpref}_load.ctl" \ + errors=0 \ + discardmax=0 \ + direct=Y \ + data="${v_file}" \ + log="${v_outpref}_load.log" + + rm -f "${v_outpref}_load.log" "${v_outpref}_load.ctl" + + register: sqloutput + + - name: SQL Output + debug: msg="{{ sqloutput.stdout_lines }}" + + - name: "Load bugs_fixed table" + shell: | + set -e + sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql + register: sqloutput + + - name: SQL Output + debug: msg="{{ sqloutput.stdout_lines }}" + + when: bugs_fixed_stat_result.stat.exists \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/create_sqlldr_bugs_fixed_table.sql b/user_scripts/odbfcl/adb_load_bugs_fixed/create_sqlldr_bugs_fixed_table.sql new file mode 100644 index 0000000..1a03385 --- /dev/null +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/create_sqlldr_bugs_fixed_table.sql @@ -0,0 +1,20 @@ +WHENEVER SQLERROR EXIT SQL.SQLCODE + +BEGIN + EXECUTE IMMEDIATE 'DROP TABLE T_BUGSFIXED_LOAD PURGE'; +EXCEPTION + WHEN OTHERS THEN + IF SQLCODE != -942 THEN + RAISE; + END IF; +END; +/ + +CREATE TABLE T_BUGSFIXED_LOAD +( + FILE_NAME VARCHAR2(50) NOT NULL, + BUG_ID NUMBER NOT NULL, + PATCH_ID NUMBER NOT NULL, + BUG_DESC VARCHAR2(1000 CHAR) +) +COMPRESS NOLOGGING; \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql b/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql new file mode 100644 index 0000000..44fd924 --- /dev/null +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql @@ -0,0 +1,27 @@ +WHENEVER SQLERROR EXIT SQL.SQLCODE + +-- TODO: CHANGE 2 QUERIES FOR 1 USING "INSERT ALL" + +insert /*+ append */ + into T_BUGS (BUG_ID, BUG_DESC) +select BUG_ID, BUG_DESC +from ( + select BUG_ID, + BUG_DESC, + RANK() over (partition by BUG_ID order by rowid asc) col_ind + from T_BUGSFIXED_LOAD +) +where col_ind=1; + +insert /*+ append */ + into T_BUGSFIXED (BUG_ID, PATCH_ID, ORAVERSION, ORASERIES, ORAPATCH) +select BUG_ID, + PATCH_ID, + substr(file_name,instr(file_name,'_',1,1)+1,instr(file_name,'_',1,2)-instr(file_name,'_',1,1)-1) oraversion, + substr(file_name,instr(file_name,'_',1,2)+1,instr(file_name,'_',1,3)-instr(file_name,'_',1,2)-1) oraseries, + to_number(substr(file_name,instr(file_name,'_',1,3)+1,instr(file_name,'.',-1)-instr(file_name,'_',1,3)-1)) orapatch +from T_BUGSFIXED_LOAD; + +commit; + +drop table T_BUGSFIXED_LOAD purge; \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml new file mode 100644 index 0000000..6d152f6 --- /dev/null +++ b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml @@ -0,0 +1,46 @@ +# This dump_stat_result.stat.exists block is required only because this code is used +# for both the extraction (main.yml), where the file obviusly exists, but also on the +# loader_adb.yml. + +- block: + + - name: Upload expdp to OCI Bucket + include_role: + name: oci_object_storage_object + vars: + oci_upload_file: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" + object_action: "create" + + - name : Define source schema + set_fact: + dump_user_int: "{{ dump_user }}" + when: db_version == "11.2.0.4" + + - name : Define source schema + set_fact: + dump_user_int: "c##{{ dump_user }}" + when: db_version != "11.2.0.4" + + - name: Import DB Tables + shell: | + impdp \ + userid={{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} \ + directory=data_pump_dir \ + credential='{{ oci_adb_credential }}' \ + remap_schema='{{ dump_user_int }}:{{ oci_adb_transient_user }}' \ + parallel=16 \ + table_exists_action=truncate \ + dumpfile={{ oci_adb_os_url_prefix }}/{{ dump_file_prefix }}.dmp > "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.log" 2>&1 + register: shell_output + + - name: Import Output + debug: msg="{{ shell_output.stderr_lines }}" + + - name: Remove expdp from OCI Bucket + include_role: + name: oci_object_storage_object + vars: + oci_upload_file: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" + object_action: "remove" + + when: dump_stat_result.stat.exists \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_expdp/post_remove_dump_file.yml b/user_scripts/odbfcl/adb_load_expdp/post_remove_dump_file.yml new file mode 100644 index 0000000..ca54526 --- /dev/null +++ b/user_scripts/odbfcl/adb_load_expdp/post_remove_dump_file.yml @@ -0,0 +1,5 @@ +- name : "Remove file {{ dump_file_prefix }}.dmp from shared folder" + file: + state: absent + path: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" + when: dump_stat_result.stat.exists \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_expdp/pre_prepare_dump_file.yml b/user_scripts/odbfcl/adb_load_expdp/pre_prepare_dump_file.yml new file mode 100644 index 0000000..abe655e --- /dev/null +++ b/user_scripts/odbfcl/adb_load_expdp/pre_prepare_dump_file.yml @@ -0,0 +1,14 @@ +- name : Define expdp filename + set_fact: + dump_file_prefix: "tables_{{ db_version }}_{{ patch.base_ru | default('')}}{{ patch.type }}_{{ patch.id }}" + +- name: "Check if {{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp exists" + stat: + path: "{{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp" + register: dump_stat_result + +- name: "Copy {{ dump_file_prefix }}.dmp to shared_folder" + copy: + src: "{{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp" + dest: "{{ shared_folder }}" + when: dump_stat_result.stat.exists \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml b/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml new file mode 100644 index 0000000..4f1b1c7 --- /dev/null +++ b/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml @@ -0,0 +1,64 @@ +- name : Define chksum filename and folder + set_fact: + chksum_file: "sha256sum_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}.chk" + chksum_folder: "{{ output_folder }}/binsum" + +- name: "Check if {{ chksum_folder }}/{{ chksum_file }} exists" + stat: + path: "{{ chksum_folder }}/{{ chksum_file }}" + register: chksum_stat_result + +# Will skip all the rest if the chksum file does not exists +- block: + + - name: "Create sqlldr table" + shell: | + set -e + sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/adb_load_filechksum/create_sqlldr_chksum_table.sql + register: sqloutput + + - name: SQL Output + debug: msg="{{ sqloutput.stdout_lines }}" + + - name: "Load {{ chksum_file }} in the database" + shell: | + set -e + + v_file="{{ chksum_file }}" + v_outpref="{{ shared_folder }}/{{ chksum_file }}" + + cat << EOF > "${v_outpref}_load.ctl" + LOAD + INTO TABLE T_FILES_LOAD + APPEND + FIELDS TERMINATED BY ' ' + (file_name constant "${v_file}",hash,path) + EOF + + cd "{{ chksum_folder }}" + + sqlldr {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} \ + control="${v_outpref}_load.ctl" \ + errors=0 \ + discardmax=0 \ + direct=Y \ + data="${v_file}" \ + log="${v_outpref}_load.log" + + rm -f "${v_outpref}_load.log" "${v_outpref}_load.ctl" + + register: sqloutput + + - name: SQL Output + debug: msg="{{ sqloutput.stdout_lines }}" + + - name: "Load chksum table" + shell: | + set -e + sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql + register: sqloutput + + - name: SQL Output + debug: msg="{{ sqloutput.stdout_lines }}" + + when: chksum_stat_result.stat.exists \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_filechksum/create_sqlldr_chksum_table.sql b/user_scripts/odbfcl/adb_load_filechksum/create_sqlldr_chksum_table.sql new file mode 100644 index 0000000..dea39a7 --- /dev/null +++ b/user_scripts/odbfcl/adb_load_filechksum/create_sqlldr_chksum_table.sql @@ -0,0 +1,19 @@ +WHENEVER SQLERROR EXIT SQL.SQLCODE + +BEGIN + EXECUTE IMMEDIATE 'DROP TABLE T_FILES_LOAD PURGE'; +EXCEPTION + WHEN OTHERS THEN + IF SQLCODE != -942 THEN + RAISE; + END IF; +END; +/ + +CREATE TABLE T_FILES_LOAD +( + FILE_NAME VARCHAR2(50) NOT NULL, + HASH RAW(32) NOT NULL, + PATH VARCHAR2(500) NOT NULL +) +COMPRESS NOLOGGING; \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql b/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql new file mode 100644 index 0000000..bb4c00d --- /dev/null +++ b/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql @@ -0,0 +1,13 @@ +WHENEVER SQLERROR EXIT SQL.SQLCODE + +insert /*+ append */ into T_FILES (PATH, SHA256_ENC, ORAVERSION, ORASERIES, ORAPATCH) +select path, + hash, + substr(file_name,instr(file_name,'_',1,1)+1,instr(file_name,'_',1,2)-instr(file_name,'_',1,1)-1) oraversion, + substr(file_name,instr(file_name,'_',1,2)+1,instr(file_name,'_',1,3)-instr(file_name,'_',1,2)-1) oraseries, + to_number(substr(file_name,instr(file_name,'_',1,3)+1,instr(file_name,'.',-1)-instr(file_name,'_',1,3)-1)) orapatch +from T_FILES_LOAD; + +commit; + +drop table T_FILES_LOAD purge; \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table_2.sql b/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table_2.sql new file mode 100644 index 0000000..1bcd2eb --- /dev/null +++ b/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table_2.sql @@ -0,0 +1,17 @@ +-- Check one day if loading from Object Storage is faster + +WHENEVER SQLERROR EXIT SQL.SQLCODE + +DEF P_CRED = '&1' +DEF P_URL = '&2' +DEF P_FILE = '&3' + +BEGIN + DBMS_CLOUD.COPY_DATA( + table_name =>'T_FILES', + credential_name =>'&P_CRED', + file_uri_list =>'&P_URL/&P_FILE', + format => json_object('type' value 'datapump') + ); +END; +/ \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml b/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml new file mode 100644 index 0000000..801b9c1 --- /dev/null +++ b/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml @@ -0,0 +1,67 @@ +- name : Define symbols filename and folder + set_fact: + symbols_file: "symbols_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}.csv" + symbols_folder: "{{ output_folder }}/symbols" + +- name: "Check if {{ symbols_folder }}/{{ symbols_file }} exists" + stat: + path: "{{ symbols_folder }}/{{ symbols_file }}" + register: symbols_stat_result + +# Will skip all the rest if the symbols file does not exists +- block: + + - name: "Create sqlldr table" + shell: | + set -e + sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/adb_load_symbols/create_sqlldr_symbols_table.sql + register: sqloutput + + - name: SQL Output + debug: msg="{{ sqloutput.stdout_lines }}" + + - name: "Load {{ symbols_file }} in the database" + shell: | + set -e + + v_file="{{ symbols_file }}" + v_outpref="{{ shared_folder }}/{{ symbols_file }}" + + cat << EOF > "${v_outpref}_load.ctl" + LOAD + INTO TABLE T_SYMBOLS_LOAD + APPEND + FIELDS TERMINATED BY '|' + (source_file constant "${v_file}",file_name,symbol_type,symbol_name) + EOF + + cd "{{ symbols_folder }}" + + # Remove empty lines or sqlldr will fail due to constant. + sed -i '/^$/d' "${v_file}" + + sqlldr {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} \ + control="${v_outpref}_load.ctl" \ + errors=0 \ + discardmax=0 \ + direct=Y \ + data="${v_file}" \ + log="${v_outpref}_load.log" + + rm -f "${v_outpref}_load.log" "${v_outpref}_load.ctl" + + register: sqloutput + + - name: SQL Output + debug: msg="{{ sqloutput.stdout_lines }}" + + - name: "Load symbols table" + shell: | + set -e + sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/adb_load_symbols/load_symbols_table.sql + register: sqloutput + + - name: SQL Output + debug: msg="{{ sqloutput.stdout_lines }}" + + when: symbols_stat_result.stat.exists \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_symbols/create_sqlldr_symbols_table.sql b/user_scripts/odbfcl/adb_load_symbols/create_sqlldr_symbols_table.sql new file mode 100644 index 0000000..6357f94 --- /dev/null +++ b/user_scripts/odbfcl/adb_load_symbols/create_sqlldr_symbols_table.sql @@ -0,0 +1,20 @@ +WHENEVER SQLERROR EXIT SQL.SQLCODE + +BEGIN + EXECUTE IMMEDIATE 'DROP TABLE T_SYMBOLS_LOAD PURGE'; +EXCEPTION + WHEN OTHERS THEN + IF SQLCODE != -942 THEN + RAISE; + END IF; +END; +/ + +CREATE TABLE T_SYMBOLS_LOAD +( + SOURCE_FILE VARCHAR2(50) NOT NULL, + FILE_NAME VARCHAR2(100) NOT NULL, + SYMBOL_TYPE VARCHAR2(1) NOT NULL, + SYMBOL_NAME VARCHAR2(500) NOT NULL +) +COMPRESS NOLOGGING; \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_symbols/load_symbols_table.sql b/user_scripts/odbfcl/adb_load_symbols/load_symbols_table.sql new file mode 100644 index 0000000..86cbb1e --- /dev/null +++ b/user_scripts/odbfcl/adb_load_symbols/load_symbols_table.sql @@ -0,0 +1,14 @@ +WHENEVER SQLERROR EXIT SQL.SQLCODE + +insert /*+ append */ into T_SYMBOLS (FILE_NAME, SYMBOL_TYPE, SYMBOL_NAME, ORAVERSION, ORASERIES, ORAPATCH) +select file_name, + symbol_type, + symbol_name, + substr(source_file,instr(source_file,'_',1,1)+1,instr(source_file,'_',1,2)-instr(source_file,'_',1,1)-1) oraversion, + substr(source_file,instr(source_file,'_',1,2)+1,instr(source_file,'_',1,3)-instr(source_file,'_',1,2)-1) oraseries, + to_number(substr(source_file,instr(source_file,'_',1,3)+1,instr(source_file,'.',-1)-instr(source_file,'_',1,3)-1)) orapatch +from T_SYMBOLS_LOAD; + +commit; + +drop table T_SYMBOLS_LOAD purge; \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml b/user_scripts/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml new file mode 100644 index 0000000..0eb4f2f --- /dev/null +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml @@ -0,0 +1,74 @@ +- name : Define txtcollection filename and folder + set_fact: + txtcollection_file: "txtcol_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}.tar.gz" + txtcollection_folder: "{{ output_folder }}/txtcollect" + +- name: "Check if {{ txtcollection_folder }}/{{ txtcollection_file }} exists" + stat: + path: "{{ txtcollection_folder }}/{{ txtcollection_file }}" + register: txtcollection_stat_result + +# Will skip all the rest if the txtcollection file does not exists +- block: + + - name: "Create sqlldr table" + shell: | + set -e + sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/adb_load_txtcollection_files/create_sqlldr_txtcollection_table.sql + register: sqloutput + + - name: SQL Output + debug: msg="{{ sqloutput.stdout_lines }}" + + - name: "Load {{ txtcollection_file }} in the database" + shell: | + set -e + + v_file="{{ txtcollection_file }}" + v_outpref="{{ shared_folder }}/{{ txtcollection_file }}" + + rm -rf "${v_outpref}_unzip" + mkdir "${v_outpref}_unzip" + + tar -tvf "{{ txtcollection_folder }}/${v_file}" | grep -o '\./.*' > "${v_outpref}_unzip/${v_file}_files.txt" + + tar -xf "{{ txtcollection_folder }}/${v_file}" -C "${v_outpref}_unzip" + + cat << EOF > "${v_outpref}_load.ctl" + LOAD + INTO TABLE T_TXTCOLLECTION_LOAD + APPEND + FIELDS TERMINATED BY ',' + (file_name constant "${v_file}", + path, + contents lobfile(path) terminated by eof) + EOF + + cd "${v_outpref}_unzip" + + sqlldr {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} \ + control="${v_outpref}_load.ctl" \ + errors=0 \ + discardmax=0 \ + direct=Y \ + data="${v_file}_files.txt" \ + log="${v_outpref}_load.log" + + rm -f "${v_outpref}_load.log" "${v_outpref}_load.ctl" + rm -rf "${v_outpref}_unzip" + + register: sqloutput + + - name: SQL Output + debug: msg="{{ sqloutput.stdout_lines }}" + + - name: "Load txtcollection table" + shell: | + set -e + sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql + register: sqloutput + + - name: SQL Output + debug: msg="{{ sqloutput.stdout_lines }}" + + when: txtcollection_stat_result.stat.exists \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/create_sqlldr_txtcollection_table.sql b/user_scripts/odbfcl/adb_load_txtcollection_files/create_sqlldr_txtcollection_table.sql new file mode 100644 index 0000000..fa02dae --- /dev/null +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/create_sqlldr_txtcollection_table.sql @@ -0,0 +1,20 @@ +WHENEVER SQLERROR EXIT SQL.SQLCODE + +BEGIN + EXECUTE IMMEDIATE 'DROP TABLE T_TXTCOLLECTION_LOAD PURGE'; +EXCEPTION + WHEN OTHERS THEN + IF SQLCODE != -942 THEN + RAISE; + END IF; +END; +/ + +CREATE TABLE T_TXTCOLLECTION_LOAD +( + FILE_NAME VARCHAR2(50) NOT NULL, + PATH VARCHAR2(500) NOT NULL, + CONTENTS CLOB NOT NULL, + MD5_HASH RAW(16) +) +COMPRESS NOLOGGING; \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql b/user_scripts/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql new file mode 100644 index 0000000..63fa68c --- /dev/null +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql @@ -0,0 +1,29 @@ +WHENEVER SQLERROR EXIT SQL.SQLCODE + +UPDATE T_TXTCOLLECTION_LOAD SET MD5_HASH=SYS.DBMS_CRYPTO.HASH(CONTENTS,2); + +-- TODO: CHANGE 2 QUERIES FOR 1 USING "INSERT ALL" + +insert /*+ append */ + into T_CONTENTS (MD5_HASH, CONTENTS) +select MD5_HASH, CONTENTS +from ( + select MD5_HASH, + CONTENTS, + RANK() over (partition by MD5_HASH order by rowid asc) col_ind + from T_TXTCOLLECTION_LOAD +) +where col_ind=1; + +insert /*+ append */ + into T_TXTCOLLECTION (PATH, MD5_HASH, ORAVERSION, ORASERIES, ORAPATCH) +select PATH, + MD5_HASH, + substr(file_name,instr(file_name,'_',1,1)+1,instr(file_name,'_',1,2)-instr(file_name,'_',1,1)-1) oraversion, + substr(file_name,instr(file_name,'_',1,2)+1,instr(file_name,'_',1,3)-instr(file_name,'_',1,2)-1) oraseries, + to_number(substr(file_name,instr(file_name,'_',1,3)+1,instr(file_name,'.',-1,2)-instr(file_name,'_',1,3)-1)) orapatch +from T_TXTCOLLECTION_LOAD; + +commit; + +drop table T_TXTCOLLECTION_LOAD purge; \ No newline at end of file diff --git a/user_scripts/odbfcl/createUser.sql b/user_scripts/odbfcl/createUser.sql new file mode 100644 index 0000000..56ad116 --- /dev/null +++ b/user_scripts/odbfcl/createUser.sql @@ -0,0 +1,11 @@ +-- Create HASH user +WHENEVER SQLERROR CONTINUE + +DROP USER &1 CASCADE; + +WHENEVER SQLERROR EXIT SQL.SQLCODE + +CREATE USER &1 IDENTIFIED BY "hash" DEFAULT TABLESPACE "USERS" TEMPORARY TABLESPACE "TEMP" QUOTA UNLIMITED ON "USERS"; + +GRANT CREATE SESSION TO &1.; +GRANT CREATE TABLE TO &1.; \ No newline at end of file diff --git a/user_scripts/odbfcl/exchange_tables_adb.sql b/user_scripts/odbfcl/exchange_tables_adb.sql new file mode 100644 index 0000000..fa28ba6 --- /dev/null +++ b/user_scripts/odbfcl/exchange_tables_adb.sql @@ -0,0 +1,70 @@ +WHENEVER SQLERROR EXIT SQL.SQLCODE + +SET LINES 1000 + +DEF P_OWNER = '&1' +DEF P_PATCH = '&2' +DEF P_SER = '&3' +DEF P_VERS = '&4' + +CREATE OR REPLACE FUNCTION GET_HIGH_VALUE_AS_STRING ( + p_Owner IN VARCHAR2, + p_TableName IN VARCHAR2, + p_PatitionName IN VARCHAR2 +) RETURN VARCHAR2 +IS + v_LongVal LONG; +BEGIN + SELECT HIGH_VALUE INTO v_LongVal + FROM ALL_TAB_PARTITIONS + WHERE TABLE_OWNER = p_Owner + AND TABLE_NAME = p_TableName + AND PARTITION_NAME = p_PatitionName; + + RETURN substr(v_LongVal, 1, 200); +END; +/ + +-- TODO: IMPROVE TO CREATE/EXCHANGE PARTITION INSTEAD OF INSERT/APPEND WHEN PARTITION DONT EXIST + +SET SERVEROUT ON +DECLARE + v_PatitionName VARCHAR2(100); + V_CMD CLOB; + -- V_CMD_2 CLOB; + v_OWNER VARCHAR2(30) := UPPER('&P_OWNER'); +BEGIN + FOR I IN (SELECT TABLE_NAME FROM USER_TABLES ORDER BY TABLE_NAME) + LOOP + BEGIN + select partition_name + INTO v_PatitionName + from all_tab_partitions + where TABLE_OWNER=v_OWNER + AND TABLE_NAME=i.table_name + and GET_HIGH_VALUE_AS_STRING(table_owner,table_name,partition_name) = q'[( '&P_SER', '&P_VERS', &P_PATCH )]'; + + V_CMD := 'ALTER TABLE ' || DBMS_ASSERT.ENQUOTE_NAME(v_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' EXCHANGE PARTITION ' || DBMS_ASSERT.ENQUOTE_NAME(v_PatitionName) || ' WITH TABLE ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' INCLUDING INDEXES WITH VALIDATION'; + + EXCEPTION + WHEN NO_DATA_FOUND THEN + IF I.TABLE_NAME = 'T_CONTENTS' + THEN + V_CMD := 'INSERT /*+ APPEND */ INTO ' || DBMS_ASSERT.ENQUOTE_NAME(v_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' SELECT * FROM ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' A WHERE NOT EXISTS (SELECT 1 FROM ' || DBMS_ASSERT.ENQUOTE_NAME(v_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' B WHERE A.MD5_HASH = B.MD5_HASH)'; + ELSIF I.TABLE_NAME = 'T_BUGS' + THEN + V_CMD := 'INSERT /*+ APPEND */ INTO ' || DBMS_ASSERT.ENQUOTE_NAME(v_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' SELECT * FROM ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' A WHERE NOT EXISTS (SELECT 1 FROM ' || DBMS_ASSERT.ENQUOTE_NAME(v_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' B WHERE A.BUG_ID = B.BUG_ID)'; + ELSE + V_CMD := 'INSERT /*+ APPEND */ INTO ' || DBMS_ASSERT.ENQUOTE_NAME(v_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' SELECT * FROM ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME); + -- V_CMD_2 := 'ALTER TABLE ' || DBMS_ASSERT.ENQUOTE_NAME(v_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' ADD PARTITION VALUES ( ''&P_SER'', ''&P_VERS'', &P_PATCH )'; + -- DBMS_OUTPUT.PUT_LINE(V_CMD_2 || ';'); + -- EXECUTE IMMEDIATE V_CMD_2; + END IF; + END; + DBMS_OUTPUT.PUT_LINE(V_CMD || ';'); + EXECUTE IMMEDIATE V_CMD; + END LOOP; +END; +/ + +EXIT 0 diff --git a/user_scripts/odbfcl/exchange_tables_adb.yml b/user_scripts/odbfcl/exchange_tables_adb.yml new file mode 100644 index 0000000..efdf57d --- /dev/null +++ b/user_scripts/odbfcl/exchange_tables_adb.yml @@ -0,0 +1,8 @@ +- name: "Load {{ oci_adb_transient_user }} tables into {{ oci_adb_user }} schema" + shell: | + set -e + sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/exchange_tables_adb.sql {{ oci_adb_user }} {{ patch.id }} {{ patch.base_ru | default('') }}{{ patch.type }} {{ db_version }} + register: sqloutput + +- name: SQL Output + debug: msg="{{ sqloutput.stdout_lines }}" \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/bugsGet.yml b/user_scripts/odbfcl/extract/bugsGet.yml new file mode 100644 index 0000000..3b55dd4 --- /dev/null +++ b/user_scripts/odbfcl/extract/bugsGet.yml @@ -0,0 +1,62 @@ +- name : Define bugs_fixed filename and folder + set_fact: + bugs_fixed_file: "bugs_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}.txt" + bugs_fixed_folder: "{{ output_folder }}/bugsfixed" + +- name: "Check if {{ bugs_fixed_folder }}/{{ bugs_fixed_file }} exists" + stat: + path: "{{ bugs_fixed_folder }}/{{ bugs_fixed_file }}" + register: bugs_fixed_stat_result + +# Will skip all the rest if the bugs_fixed file exists +- block : + + - name: Collect bugs from ORACLE_HOME + shell: | + set -eo pipefail + + export ORACLE_HOME ORACLE_SID + + ./opatch lsinv -bugs_fixed | + # Remove lines before this entry (inclusive) + sed '1,/^List of Bugs fixed by Installed Patches/d' | + # Remove lines before this entry (inclusive) + sed '1,/^---/d' | + # Remove lines after this entry (inclusive) + sed '/^---/Q' | + # Remove empty lines + sed '/^$/d' | + # Remove breaks from lines not starting with number + sed ':a $!{N; ba}; s/\n\+/\n/g; s/\n\([^0-9]\)/\1/g' | + # Remove double spaces + sed -E 's/[[:space:]]+/ /g' | + # Remove date columns + awk '{$3=$4=$5=$6=$7=$8=""; print $0}' | + # Remove double spaces again after column removal + sed -E 's/[[:space:]]+/ /g' | + # Replace first space per tab + sed 's/ /'$'\t''/' | + # Replace first space per tab (that was the second) + sed 's/ /'$'\t''/' > {{ VM_folder }}/{{ bugs_fixed_file }} + + environment: + ORACLE_HOME: "{{ dbhome_locl }}" + ORACLE_SID: "{{ mysid }}" + args: + chdir: "{{ dbhome_locl }}/OPatch" + register: shell_output + become: true + become_user: oracle + delegate_to: "{{ vm_ip_address }}" + + - name: Copy {{ bugs_fixed_file }} to repository + copy: + src: "{{ shared_folder }}/{{ bugs_fixed_file }}" + dest: "{{ bugs_fixed_folder }}" + + - name : "Remove file {{ bugs_fixed_file }}" + file: + state: absent + path: "{{ shared_folder }}/{{ bugs_fixed_file }}" + + when: not bugs_fixed_stat_result.stat.exists \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/fileCollect.yml b/user_scripts/odbfcl/extract/fileCollect.yml new file mode 100644 index 0000000..1333a9b --- /dev/null +++ b/user_scripts/odbfcl/extract/fileCollect.yml @@ -0,0 +1,38 @@ +# Folder to store the collected ORACLE_HOME text files +- name : Define txtcollect folder name + set_fact: + txtcollect_folder: "{{ output_folder }}/txtcollect" + +- name : Define txtcollect file names + set_fact: + txtcollect_file: "txtcol_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}.tar.gz" + +- name: "Check if {{ txtcollect_folder }}/{{ txtcollect_file }} exists" + stat: + path: "{{ txtcollect_folder }}/{{ txtcollect_file }}" + register: txtcollect_stat_result + +# Will skip the rest if the txtcollect file exists + +- block : + + - name: Collect text files from ORACLE_HOME + shell: | + find -type f -not -path "./.patch_storage/*" -not -name "tfa_setup" -print0 | xargs -0 grep -Il '.' | tar -czf {{ VM_folder }}/{{ txtcollect_file }} -T - + args: + chdir: "{{ dbhome_locl }}" + become: true + become_user: root + delegate_to: "{{ vm_ip_address }}" + + - name: Copy {{ txtcollect_file }} to repository + copy: + src: "{{ shared_folder }}/{{ txtcollect_file }}" + dest: "{{ txtcollect_folder }}" + + - name : "Remove file {{ txtcollect_file }}" + file: + state: absent + path: "{{ shared_folder }}/{{ txtcollect_file }}" + + when: not txtcollect_stat_result.stat.exists \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/fileGet.yml b/user_scripts/odbfcl/extract/fileGet.yml new file mode 100644 index 0000000..c58c8cc --- /dev/null +++ b/user_scripts/odbfcl/extract/fileGet.yml @@ -0,0 +1,68 @@ +# Folder to store the final generated ORACLE_HOME checksum +- name : Define folder name + set_fact: + chksum_folder: "{{ output_folder }}/binsum" + +- name : Define file names + set_fact: + sha256_file: "sha256sum_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}.chk" + +- name: "Check if {{ chksum_folder }}/{{ sha256_file }} exists" + stat: + path: "{{ chksum_folder }}/{{ sha256_file }}" + register: chksum_stat_result + +# Will skip all the rest if the chksum file exists +- name : Define exists_chksum + set_fact: + exists_chksum: "{{ chksum_stat_result.stat.exists }}" + +- block : + + - name: Generate files checksum + shell: | + find -type f -exec sha256sum "{}" + > {{ VM_folder }}/{{ sha256_file }} + args: + chdir: "{{ dbhome_locl }}" + register: sqloutput + become: true + become_user: root + delegate_to: "{{ vm_ip_address }}" + + - name: Generate files checksum for static libs + shell: | + v_libs=$(find {{ dbhome_locl }} -type f -name "*.a") + + v_ext_fold=/tmp/statlib + v_out_file=/tmp/statlib_list.txt + + IFS=$'\n' + for v_lib in ${v_libs} + do + rm -rf "${v_ext_fold}" + mkdir "${v_ext_fold}" + cd "${v_ext_fold}" + ar x "${v_lib}" + find -type f -exec sha256sum "{}" + > ${v_out_file} + sed -i "s| \.| ${v_lib}|" ${v_out_file} + cat ${v_out_file} >> {{ VM_folder }}/{{ sha256_file }} + rm -rf ${v_ext_fold} ${v_out_file} + done + args: + chdir: "{{ dbhome_locl }}" + register: sqloutput + become: true + become_user: root + delegate_to: "{{ vm_ip_address }}" + + - name: Copy {{ sha256_file }} to repository + copy: + src: "{{ shared_folder }}/{{ sha256_file }}" + dest: "{{ chksum_folder }}" + + - name : "Remove file {{ sha256_file }}" + file: + state: absent + path: "{{ shared_folder }}/{{ sha256_file }}" + + when: exists_chksum == false \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/hashGet.sql b/user_scripts/odbfcl/extract/hashGet.sql new file mode 100644 index 0000000..23188d0 --- /dev/null +++ b/user_scripts/odbfcl/extract/hashGet.sql @@ -0,0 +1,64 @@ +WHENEVER SQLERROR EXIT SQL.SQLCODE + +set lines 1000 +set verify off +set tab off +set serverout on + +col v_username new_v v_username nopri + +select case when version >= 12 then 'C##' end || 'HASH' v_username +from (select to_number(substr(version,1,instr(version,'.')-1)) version + from v$instance); + +col v_username clear + +DEF P_PATCH = '&1' +DEF P_SER = '&2' +DEF P_VERS = '&3' + +DECLARE + V_ORA_VER_MAJOR NUMBER; + V_ORA_VERSION VARCHAR2(20); +BEGIN + select substr(version,1,instr(version,'.',1,4)-1), + substr(version,1,instr(version,'.',1,1)-1) + into v_ora_version, + v_ora_ver_major + from (select '&P_VERS..0' version from dual); + IF v_ora_version = '12.1.0.1' THEN + NULL; + ELSIF v_ora_version = '12.1.0.2' THEN + execute immediate 'alter session set exclude_seed_cdb_view=false'; + ELSIF v_ora_ver_major >= 12 THEN + execute immediate 'alter session set "_exclude_seed_cdb_view"=false'; + END IF; +END; +/ + +PRO CDB/DBA_SOURCE +@@load_source.sql + +PRO CDB/DBA_VIEWS +@@load_view.sql + +PRO Some CDB/DBA Views +@@load_dba_cdb.sql + +-- PRO Database Vault tables +-- @@load_database_vault.sql + +PRO Some V$ Info +@@load_v_dollar.sql + +PRO Non CDB/DBA views or tables +@@load_custom.sql + +commit; + +PRO Some X$ Info +@@load_x_dollar.sql + +commit; + +exit; diff --git a/user_scripts/odbfcl/extract/hashGet.yml b/user_scripts/odbfcl/extract/hashGet.yml new file mode 100644 index 0000000..aa537d1 --- /dev/null +++ b/user_scripts/odbfcl/extract/hashGet.yml @@ -0,0 +1,4 @@ +- include: tasks/run_sql.yml + vars: + sql_param : { file : "hashGet.sql" , folder : "user_scripts/odbfcl/extract" , task_action : "Calculate Hash" , params : "{{ patch.id }} {{ patch.base_ru | default('') }}{{ patch.type }} {{ db_version }}" } +# patch.base_ru will only be populated for RURs \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/load_custom.sql b/user_scripts/odbfcl/extract/load_custom.sql new file mode 100644 index 0000000..0a5339b --- /dev/null +++ b/user_scripts/odbfcl/extract/load_custom.sql @@ -0,0 +1,67 @@ +DECLARE + VVERS VARCHAR2(20) := '&P_VERS.'; + VSER VARCHAR2(10) := '&P_SER.'; + VPATCH NUMBER := &P_PATCH.; + + PROCEDURE RUN_INSERT (IN_TAB_NAME VARCHAR2, OUT_TAB_NAME VARCHAR2, IN_WHERE_CLAUSE_12 VARCHAR2 DEFAULT NULL, IN_WHERE_CLAUSE_11 VARCHAR2 DEFAULT NULL) + AS + V_TAB_COLS CLOB; + V_INS_COLS CLOB; + V_SQL CLOB; + V_CDB_CLAUSE VARCHAR2(30); + BEGIN + + IF VVERS = '11.2.0.4' THEN + V_CDB_CLAUSE := ''; + else + V_CDB_CLAUSE := ', CON_ID'; + END IF; + + -- Bug 22168436 ORA-600 [kkdoilsn2] on select from CONTAINERS(...) - Using BLOB / ANYDATA / XMLTYPE. + + select listagg(c1.column_name,', ') within group(order by c1.column_id), + listagg(nvl(c2.column_name,'NULL'),', ') within group(order by c1.column_id) + into V_TAB_COLS, V_INS_COLS + from dba_tab_columns c1, dba_tab_columns c2 + where c1.table_name = OUT_TAB_NAME + and c2.table_name (+) = IN_TAB_NAME + and c1.owner = '&v_username.' + and c2.owner(+) = 'SYS' + and c1.column_name = c2.column_name (+) + and c1.column_name not in ('CON_ID', 'ORASERIES', 'ORAVERSION', 'ORAPATCH'); + + V_SQL := 'INSERT /*+ APPEND */ INTO &v_username..' || OUT_TAB_NAME || '(' || V_TAB_COLS || V_CDB_CLAUSE || ', ORAVERSION, ORASERIES, ORAPATCH) SELECT '; + + V_SQL := V_SQL || V_INS_COLS || V_CDB_CLAUSE || ', ' || SYS.DBMS_ASSERT.enquote_literal(VVERS) || ', ' || SYS.DBMS_ASSERT.enquote_literal(VSER) || ', ' || SYS.DBMS_ASSERT.enquote_literal(VPATCH); + + IF VVERS = '11.2.0.4' THEN + V_SQL := V_SQL || ' FROM ' || IN_TAB_NAME; + ELSIF VVERS = '12.1.0.1' THEN + V_SQL := V_SQL || ' FROM CDB$VIEW("' || IN_TAB_NAME || '")'; + ELSE + V_SQL := V_SQL || ' FROM CONTAINERS(' || IN_TAB_NAME || ')'; + END IF; + + IF VVERS = '11.2.0.4' THEN + IF IN_WHERE_CLAUSE_11 IS NOT NULL THEN + V_SQL := V_SQL || ' WHERE ' || IN_WHERE_CLAUSE_11; + END IF; + ELSE + IF IN_WHERE_CLAUSE_12 IS NOT NULL THEN + V_SQL := V_SQL || ' WHERE ' || IN_WHERE_CLAUSE_12; + END IF; + END IF; + + DBMS_OUTPUT.PUT_LINE(V_SQL); + EXECUTE IMMEDIATE V_SQL; + + END; +BEGIN + DBMS_OUTPUT.ENABLE(NULL); + + IF VVERS != '11.2.0.4' THEN + RUN_INSERT ('AUDIT_UNIFIED_POLICIES','T_AUDIT_UNIFIED_POLICIES'); + END IF; + +END; +/ \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/load_database_vault.sql b/user_scripts/odbfcl/extract/load_database_vault.sql new file mode 100644 index 0000000..dfcecbe --- /dev/null +++ b/user_scripts/odbfcl/extract/load_database_vault.sql @@ -0,0 +1,60 @@ +DECLARE + VVERS VARCHAR2(20) := '&P_VERS.'; + VSER VARCHAR2(10) := '&P_SER.'; + VPSU NUMBER := &P_PSU.; + VUSER VARCHAR2(30) := '&v_username.'; + + PROCEDURE RUN_INSERT (IN_TAB_NAME VARCHAR2, + OUT_TAB_NAME VARCHAR2) + AS + V_TAB_COLS CLOB; + V_INS_COLS CLOB; + V_SQL CLOB; + V_CDB_CLAUSE VARCHAR2(30); + BEGIN + + IF VVERS = '11.2.0.4' THEN + V_CDB_CLAUSE := ''; + else + V_CDB_CLAUSE := ', CON_ID'; + END IF; + + select listagg(c1.column_name,', ') within group(order by c1.column_id), + listagg(nvl(c2.column_name,'NULL'),', ') within group(order by c1.column_id) + into V_TAB_COLS, V_INS_COLS + from dba_tab_columns c1, dba_tab_columns c2 + where c1.table_name = OUT_TAB_NAME + and c2.table_name (+) = IN_TAB_NAME + and c1.owner = VUSER + and c2.owner(+) = 'DVSYS' + and c1.column_name = c2.column_name (+) + and c1.column_name not in ('CON_ID', 'SERIES', 'ORAVERSION', 'PSU'); + + V_SQL := 'INSERT /*+ APPEND */ INTO ' || VUSER || '.' || OUT_TAB_NAME || '(' || V_TAB_COLS || V_CDB_CLAUSE || ', ORAVERSION, ORASERIES, ORAPATCH) SELECT '; + + V_SQL := V_SQL || V_INS_COLS || V_CDB_CLAUSE || ', ' || SYS.DBMS_ASSERT.enquote_literal(VSER) || ', ' || SYS.DBMS_ASSERT.enquote_literal(VVERS) || ', ' || SYS.DBMS_ASSERT.enquote_literal(VPSU); + + IF VVERS = '11.2.0.4' THEN + V_SQL := V_SQL || ' FROM DVSYS.' || IN_TAB_NAME; + ELSIF VVERS = '12.1.0.1' THEN + V_SQL := V_SQL || ' FROM CDB$VIEW("DVSYS"."' || IN_TAB_NAME || '")'; + ELSE + V_SQL := V_SQL || ' FROM CONTAINERS(DVSYS.' || IN_TAB_NAME || ')'; + END IF; + + DBMS_OUTPUT.PUT_LINE(V_SQL); + EXECUTE IMMEDIATE V_SQL; + + END; +BEGIN + DBMS_OUTPUT.ENABLE(NULL); + + RUN_INSERT ('DBA_DV_COMMAND_RULE','T_DV_COMMAND_RULE'); + RUN_INSERT ('DBA_DV_REALM','T_DV_REALM'); + RUN_INSERT ('DBA_DV_REALM_AUTH','T_DV_REALM_AUTH'); + RUN_INSERT ('DBA_DV_REALM_OBJECT','T_DV_REALM_OBJECT'); + RUN_INSERT ('DBA_DV_RULE','T_DV_RULE'); + RUN_INSERT ('DBA_DV_RULE_SET','T_DV_RULE_SET'); + +END; +/ \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/load_dba_cdb.sql b/user_scripts/odbfcl/extract/load_dba_cdb.sql new file mode 100644 index 0000000..bef48ac --- /dev/null +++ b/user_scripts/odbfcl/extract/load_dba_cdb.sql @@ -0,0 +1,153 @@ +DECLARE + VVERS VARCHAR2(20) := '&P_VERS.'; + VSER VARCHAR2(10) := '&P_SER.'; + VPATCH NUMBER := &P_PATCH.; + VUSER VARCHAR2(30) := '&v_username.'; + + PROCEDURE RUN_INSERT (IN_TAB_NAME VARCHAR2, + IN_WHERE_CLAUSE_12 VARCHAR2 DEFAULT NULL, + IN_WHERE_CLAUSE_11 VARCHAR2 DEFAULT NULL) + AS + V_TAB_COLS CLOB; + V_INS_COLS CLOB; + V_PREFIX VARCHAR2(4); + V_SQL CLOB; + V_OBJ_EXISTS NUMBER; + BEGIN + IF VVERS = '11.2.0.4' THEN + V_PREFIX := 'DBA_'; + else + V_PREFIX := 'CDB_'; + END IF; + + SELECT COUNT(1) + INTO V_OBJ_EXISTS + FROM DBA_VIEWS V1 + WHERE V1.OWNER = 'SYS' + AND V1.VIEW_NAME = V_PREFIX || IN_TAB_NAME; + + -- ORA-12805: parallel query server died unexpectedly + -- ORA-00600: internal error code, arguments: [kkdlGetBaseUser2:authIdType], [0], [104], [_NEXT_USER], [], [], [], [], [], [], [], [] + -- Bug 22168436 ORA-600 [kkdoilsn2] on select from CONTAINERS(...) - Using BLOB / ANYDATA / XMLTYPE. + + SELECT LISTAGG(C1.COLUMN_NAME,', ') WITHIN GROUP(ORDER BY C1.COLUMN_ID), + LISTAGG(NVL(C2.COLUMN_NAME,'NULL'),', ') WITHIN GROUP(ORDER BY C1.COLUMN_ID) + INTO V_TAB_COLS, V_INS_COLS + FROM DBA_TAB_COLUMNS C1, DBA_TAB_COLUMNS C2 + WHERE C1.TABLE_NAME = 'T_' || IN_TAB_NAME + AND C2.TABLE_NAME (+) = V_PREFIX || IN_TAB_NAME + AND C1.OWNER = VUSER + AND C2.OWNER(+) = 'SYS' + AND C1.COLUMN_NAME = C2.COLUMN_NAME (+) + AND C1.COLUMN_NAME NOT IN ('ORAVERSION', 'ORASERIES', 'ORAPATCH'); + + V_SQL := 'INSERT /*+ APPEND */ INTO ' || VUSER || '.T_' || IN_TAB_NAME || '(' || V_TAB_COLS || ', ORAVERSION, ORASERIES, ORAPATCH) SELECT '; + + V_SQL := V_SQL || V_INS_COLS || ', ' || SYS.DBMS_ASSERT.ENQUOTE_LITERAL(VVERS) || ', ' || SYS.DBMS_ASSERT.ENQUOTE_LITERAL(VSER) || ', ' || SYS.DBMS_ASSERT.ENQUOTE_LITERAL(VPATCH); + + V_SQL := V_SQL || ' FROM ' || V_PREFIX || IN_TAB_NAME; + + IF VVERS = '11.2.0.4' THEN + IF IN_WHERE_CLAUSE_11 IS NOT NULL THEN + V_SQL := V_SQL || ' WHERE ' || IN_WHERE_CLAUSE_11; + END IF; + else + IF IN_WHERE_CLAUSE_12 IS NOT NULL THEN + V_SQL := V_SQL || ' WHERE ' || IN_WHERE_CLAUSE_12; + END IF; + END IF; + + IF V_OBJ_EXISTS = 1 + THEN + DBMS_OUTPUT.PUT_LINE(V_SQL); + EXECUTE IMMEDIATE V_SQL; + ELSE + DBMS_OUTPUT.PUT_LINE(V_PREFIX || IN_TAB_NAME || ' does not exist.'); + END IF; + + END; +BEGIN + DBMS_OUTPUT.ENABLE(NULL); + + RUN_INSERT ('TAB_PRIVS', + q'[GRANTEE != 'C##HASH' AND NOT(TABLE_NAME LIKE 'C##HASH' AND PRIVILEGE='INHERIT PRIVILEGES')]', + q'[GRANTEE != 'HASH']' + ); + RUN_INSERT ('COL_PRIVS', + q'[GRANTEE != 'C##HASH']', + q'[GRANTEE != 'HASH']' + ); + RUN_INSERT ('SYS_PRIVS', + q'[GRANTEE != 'C##HASH']', + q'[GRANTEE != 'HASH']' + ); + RUN_INSERT ('ROLE_PRIVS', + q'[GRANTEE != 'C##HASH']', + q'[GRANTEE != 'HASH']' + ); + + RUN_INSERT ('JAVA_POLICY'); + + RUN_INSERT ('JOBS'); + + RUN_INSERT ('TS_QUOTAS', + q'[USERNAME != 'C##HASH']', + q'[USERNAME != 'HASH']' + ); + + RUN_INSERT ('POLICIES'); + + RUN_INSERT ('TRIGGERS'); + + RUN_INSERT ('SCHEDULER_JOBS'); + + RUN_INSERT ('SCHEDULER_PROGRAMS'); + + RUN_INSERT ('OBJ_AUDIT_OPTS'); + + RUN_INSERT ('STMT_AUDIT_OPTS'); + + RUN_INSERT ('PRIV_AUDIT_OPTS'); + + RUN_INSERT ('AUDIT_POLICIES'); + + RUN_INSERT ('AUDIT_POLICY_COLUMNS'); + + RUN_INSERT ('SYNONYMS', + q'[ORIGIN_CON_ID=CON_ID]', + NULL + ); + + RUN_INSERT ('USERS', + q'[USERNAME != 'C##HASH']', + q'[USERNAME != 'HASH']' + ); + + RUN_INSERT ('ROLES'); + + RUN_INSERT ('OBJECTS', + q'[OWNER != 'C##HASH']', + q'[OWNER != 'HASH']' + ); + + RUN_INSERT ('TAB_COLUMNS', + q'[OWNER != 'C##HASH']', + q'[OWNER != 'HASH']' + ); + + RUN_INSERT ('REGISTRY'); + RUN_INSERT ('REGISTRY_BACKPORTS'); + RUN_INSERT ('REGISTRY_DATABASE'); + RUN_INSERT ('REGISTRY_DEPENDENCIES'); + RUN_INSERT ('REGISTRY_ERROR'); + RUN_INSERT ('REGISTRY_HIERARCHY'); + RUN_INSERT ('REGISTRY_HISTORY'); + RUN_INSERT ('REGISTRY_LOG'); + RUN_INSERT ('REGISTRY_PROGRESS'); + RUN_INSERT ('REGISTRY_SCHEMAS'); + RUN_INSERT ('REGISTRY_SQLPATCH'); + RUN_INSERT ('REGISTRY_SQLPATCH_RU_INFO'); + RUN_INSERT ('SERVER_REGISTRY'); + +END; +/ \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/load_source.sql b/user_scripts/odbfcl/extract/load_source.sql new file mode 100644 index 0000000..06ad860 --- /dev/null +++ b/user_scripts/odbfcl/extract/load_source.sql @@ -0,0 +1,47 @@ +DECLARE + VCODE CLOB; + + VVERS VARCHAR2(20) := '&P_VERS.'; + VSER VARCHAR2(10) := '&P_SER.'; + VPATCH NUMBER := &P_PATCH.; + + $IF DBMS_DB_VERSION.VER_LE_11 + $THEN + CURSOR OBJS IS + SELECT OWNER, + NAME, + TYPE, + NULL ORIGIN_CON_ID, + NULL CON_ID, + LINE, + MAX(LINE) OVER (PARTITION BY OWNER, NAME, TYPE) LAST_LINE, + TEXT + FROM DBA_SOURCE + ORDER BY OWNER, NAME, TYPE, LINE ASC; + $ELSE + CURSOR OBJS IS + SELECT OWNER, + NAME, + TYPE, + ORIGIN_CON_ID, + CON_ID, + LINE, + MAX(LINE) OVER (PARTITION BY OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID) LAST_LINE, + TEXT + FROM CDB_SOURCE WHERE ORIGIN_CON_ID=CON_ID -- AND CON_ID IN (1,2) + ORDER BY OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, LINE ASC; + $END +BEGIN + VCODE := ''; -- Zera a variável + FOR I IN OBJS + LOOP + VCODE := VCODE || I.TEXT; + IF I.LINE = I.LAST_LINE THEN + INSERT INTO &v_username..T_HASH (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_ENC, SHA1_ENC, ORAVERSION, ORASERIES, ORAPATCH, CODE) + VALUES + (I.OWNER, I.NAME, I.TYPE, I.ORIGIN_CON_ID, I.CON_ID, SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_MD5), SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_SH1), VVERS, VSER, VPATCH, VCODE); + VCODE := ''; -- Zera a variável + END IF; + END LOOP; +END; +/ \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/load_v_dollar.sql b/user_scripts/odbfcl/extract/load_v_dollar.sql new file mode 100644 index 0000000..bc8c35b --- /dev/null +++ b/user_scripts/odbfcl/extract/load_v_dollar.sql @@ -0,0 +1,66 @@ +DECLARE + VVERS VARCHAR2(20) := '&P_VERS.'; + VSER VARCHAR2(10) := '&P_SER.'; + VPATCH NUMBER := &P_PATCH.; + + PROCEDURE RUN_INSERT (OUT_TAB_NAME VARCHAR2, + IN_TAB_NAME VARCHAR2, + IN_WHERE_CLAUSE_12 VARCHAR2 DEFAULT NULL, + IN_WHERE_CLAUSE_11 VARCHAR2 DEFAULT NULL) + AS + V_TAB_COLS CLOB; + V_INS_COLS CLOB; + V_SQL CLOB; + BEGIN + + select listagg(c1.column_name,', ') within group(order by c1.column_id), + listagg(nvl(c2.column_name,'NULL'),', ') within group(order by c1.column_id) + into V_TAB_COLS, V_INS_COLS + from dba_tab_columns c1, dba_tab_columns c2 + where c1.table_name = OUT_TAB_NAME + and c2.table_name (+) = IN_TAB_NAME + and c1.owner = '&v_username.' + and c2.owner(+) = 'SYS' + and c1.column_name = c2.column_name (+) + and c1.column_name not in ('ORASERIES', 'ORAVERSION', 'ORAPATCH'); + + V_SQL := 'INSERT /*+ APPEND */ INTO &v_username..' || OUT_TAB_NAME || '(' || V_TAB_COLS || ', ORAVERSION, ORASERIES, ORAPATCH) SELECT '; + + V_SQL := V_SQL || V_INS_COLS || ', ' || SYS.DBMS_ASSERT.enquote_literal(VVERS) || ', ' || SYS.DBMS_ASSERT.enquote_literal(VSER) || ', ' || SYS.DBMS_ASSERT.enquote_literal(VPATCH); + + V_SQL := V_SQL || ' FROM ' || IN_TAB_NAME; + + IF VVERS = '11.2.0.4' THEN + IF IN_WHERE_CLAUSE_11 IS NOT NULL THEN + V_SQL := V_SQL || ' WHERE ' || IN_WHERE_CLAUSE_11; + END IF; + else + IF IN_WHERE_CLAUSE_12 IS NOT NULL THEN + V_SQL := V_SQL || ' WHERE ' || IN_WHERE_CLAUSE_12; + END IF; + END IF; + DBMS_OUTPUT.PUT_LINE(V_SQL); + + EXECUTE IMMEDIATE V_SQL; + END; +BEGIN + DBMS_OUTPUT.ENABLE(NULL); + + RUN_INSERT ('T_FIXED_TABLE','V_$FIXED_TABLE'); + + RUN_INSERT ('T_FIXED_VIEW_DEFINITION','V_$FIXED_VIEW_DEFINITION'); + + RUN_INSERT ('T_SYSSTAT','V_$SYSSTAT'); + + RUN_INSERT ('T_SYS_TIME_MODEL','V_$SYS_TIME_MODEL'); + + RUN_INSERT ('T_EVENT_NAME','V_$EVENT_NAME'); + + RUN_INSERT ('T_PARAMETER','V_$PARAMETER'); + + RUN_INSERT ('T_PARAMETER_VALID_VALUES','V_$PARAMETER_VALID_VALUES'); + + RUN_INSERT ('T_RESERVED_WORDS','V_$RESERVED_WORDS'); + +END; +/ \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/load_view.sql b/user_scripts/odbfcl/extract/load_view.sql new file mode 100644 index 0000000..cf0c65f --- /dev/null +++ b/user_scripts/odbfcl/extract/load_view.sql @@ -0,0 +1,93 @@ +DECLARE + VCODE CLOB; + VVERS VARCHAR2(20) := '&P_VERS.'; + VSER VARCHAR2(10) := '&P_SER.'; + VPATCH NUMBER := &P_PATCH.; + VSID VARCHAR2(30) := 'VIEW_TESTE'; + CURSOR OBJS IS + SELECT OBJECT_OWNER OWNER, + OBJECT_NAME NAME, + OBJECT_TYPE TYPE, + ID CON_ID, + PARENT_ID ORIGIN_CON_ID, + OTHER_XML TEXT + FROM PLAN_TABLE + WHERE STATEMENT_ID = VSID-- and rownum < 1000; + ORDER BY 1,2; + FUNCTION replaceClob + ( srcClob IN CLOB, + replaceStr IN varchar2, + replaceWith IN varchar2 ) + RETURN CLOB + IS + l_buffer VARCHAR2 (32767); + l_amount BINARY_INTEGER := 32767; + l_pos INTEGER := 1; + l_clob_len INTEGER; + newClob clob := EMPTY_CLOB; + BEGIN + -- initalize the new clob + dbms_lob.CreateTemporary( newClob, TRUE ); + l_clob_len := DBMS_LOB.getlength (srcClob); + WHILE l_pos <= l_clob_len + LOOP + DBMS_LOB.READ (srcClob,l_amount,l_pos,l_buffer); + IF l_buffer IS NOT NULL + THEN + -- replace the text + l_buffer := regexp_replace(l_buffer,replaceStr,replaceWith); + -- write it to the new clob + DBMS_LOB.writeAppend(newClob, LENGTH(l_buffer), l_buffer); + END IF; + l_pos := l_pos + l_amount; + END LOOP; + RETURN newClob; + END; +BEGIN + $IF DBMS_DB_VERSION.VER_LE_11 + $THEN + INSERT INTO PLAN_TABLE (STATEMENT_ID, OBJECT_OWNER, OBJECT_NAME, OBJECT_TYPE, ID, PARENT_ID, OTHER_XML) + SELECT VSID, + OWNER, + VIEW_NAME, + 'VIEW', + NULL CON_ID, + NULL ORIGIN_CON_ID, + TO_LOB(TEXT) + FROM DBA_VIEWS; + $ELSE + INSERT INTO PLAN_TABLE (STATEMENT_ID, OBJECT_OWNER, OBJECT_NAME, OBJECT_TYPE, ID, PARENT_ID, OTHER_XML) + SELECT VSID, + OWNER, + VIEW_NAME, + 'VIEW', + SYS_CONTEXT('USERENV','CON_ID') CON_ID, + ORIGIN_CON_ID, + TO_LOB(TEXT) + FROM DBA_VIEWS; + + INSERT INTO PLAN_TABLE (STATEMENT_ID, OBJECT_OWNER, OBJECT_NAME, OBJECT_TYPE, ID, PARENT_ID, OTHER_XML) + SELECT VSID, + OWNER, + VIEW_NAME, + 'VIEW', + CON_ID, + ORIGIN_CON_ID, + TEXT_VC + FROM CDB_VIEWS + WHERE CON_ID <> SYS_CONTEXT('USERENV','CON_ID') -- AND CON_ID IN (1,2) + AND ORIGIN_CON_ID = CON_ID; + $END + FOR I IN OBJS + LOOP + VCODE := UPPER(I.TEXT); + VCODE := replaceClob(VCODE,'[[:space:]]*',''); -- Remove all space characters + VCODE := replaceClob(VCODE,'"',''); -- Remove all quotes + INSERT INTO &v_username..T_HASH (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_ENC, SHA1_ENC, ORAVERSION, ORASERIES, ORAPATCH, CODE) + VALUES + (I.OWNER, I.NAME, I.TYPE, I.ORIGIN_CON_ID, I.CON_ID, SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_MD5), SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_SH1), VVERS, VSER, VPATCH, I.TEXT); + + END LOOP; + DELETE FROM PLAN_TABLE WHERE STATEMENT_ID = VSID; +END; +/ \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/load_x_dollar.sql b/user_scripts/odbfcl/extract/load_x_dollar.sql new file mode 100644 index 0000000..e49abca --- /dev/null +++ b/user_scripts/odbfcl/extract/load_x_dollar.sql @@ -0,0 +1,80 @@ +INSERT INTO &v_username..T_PARAMETER +( + "NAME", + "TYPE", + "DEFAULT_VALUE", + "DESCRIPTION", + "ORAVERSION", + "ORASERIES", + "ORAPATCH" +) +select a.ksppinm name, + a.ksppity type, + b.ksppstdf def_value, + a.ksppdesc description, + '&P_VERS.', + '&P_SER.', + &P_PATCH. +from sys.x$ksppi a, + sys.x$ksppcv b +where a.indx = b.indx +and a.ksppinm like '\_%' ESCAPE '\'; + +-- + +INSERT INTO &v_username..T_PARAMETER_VALID_VALUES +( + "NAME", + "VALUE", + "ISDEFAULT", + "ORAVERSION", + "ORASERIES", + "ORAPATCH" +) +select a.ksppinm name, + b.value_kspvld_values value, + b.isdefault_kspvld_values is_default, + '&P_VERS.', + '&P_SER.', + &P_PATCH. +from sys.x$ksppi a, + sys.x$kspvld_values b +where a.ksppinm = b.name_kspvld_values +and a.ksppinm like '\_%' ESCAPE '\'; + +-- + +-- There is a bug since oracle 11.2 which is that starting from x$kqfta.nkqftanam=x$ksxptesttbl, +-- The field x$kqfco.kqfcotab should be subtracted by one to get the correct columns. +-- Thanks David Kurtz and Frits Hoogland + +INSERT INTO &v_username..T_XTABCOLS +( + "TABLE_NAME", + "COLUMN_NAME", + "COLUMN_TYPE", + "ORAVERSION", + "ORASERIES", + "ORAPATCH" +) +select t.kqftanam table_name, + c.kqfconam column_name, + c.kqfcodty column_type, + '&P_VERS.', + '&P_SER.', + &P_PATCH. +from x$kqfta t, x$kqfco c, x$kqfta divider +where divider.kqftanam = 'X$KSXPTESTTBL' +and t.indx < divider.indx +and t.indx = c.kqfcotab +union all +select t.kqftanam table_name, + c.kqfconam column_name, + c.kqfcodty column_type, + '&P_VERS.', + '&P_SER.', + &P_PATCH. +from x$kqfta t, x$kqfco c, x$kqfta divider +where divider.kqftanam = 'X$KSXPTESTTBL' +and t.indx >= divider.indx +and t.indx = c.kqfcotab-1; \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/symbolGet.yml b/user_scripts/odbfcl/extract/symbolGet.yml new file mode 100644 index 0000000..ba70794 --- /dev/null +++ b/user_scripts/odbfcl/extract/symbolGet.yml @@ -0,0 +1,58 @@ +# Folder to store the collected ORACLE_HOME text files +- name : Define symbols folder name + set_fact: + symbols_folder: "{{ output_folder }}/symbols" + +- name : Define symbols file names + set_fact: + symbols_file: "symbols_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}.csv" + +- name: "Check if {{ symbols_folder }}/{{ symbols_file }} exists" + stat: + path: "{{ symbols_folder }}/{{ symbols_file }}" + register: symbols_stat_result + +# Will skip the rest if the symbols file exists + +- block : + + # Thanks Frits Hooglang + - name: Collect symbols from ORACLE_HOME + shell: | + echo > "{{ VM_folder }}/{{ symbols_file }}" + + # Extract Symbols from Oracle archives (.a) + for ARCHIVE in $(ls $ORACLE_HOME/lib/*.a $ORACLE_HOME/rdbms/lib/*.a); do + nm -A $ARCHIVE | grep ' [Tt] ' | tr ':' ' ' | cut -d" " -f1,2,4,5 | sort -u | awk '{ if ( $4 != "" ) { file=$1; sub(".*/","", file); printf "%s/%s|%s|%s\n", file, $2, $3, $4 } }' >> "{{ VM_folder }}/{{ symbols_file }}" + done + + # Extract Symbols from Oracle objects (.o) + for OBJECT in $(ls $ORACLE_HOME/lib/*.o $ORACLE_HOME/rdbms/lib/*.o); do + nm -A $OBJECT | grep ' [Tt] ' | tr ':' ' ' | cut -d" " -f1,3,4 | sort -u | awk '{ if ( $3 != "" ) { file=$1; sub(".*/","", file); printf "%s|%s|%s\n", file, $2, $3 } }' >> "{{ VM_folder }}/{{ symbols_file }}" + done + + # Extract Symbols from Oracle executable + nm -A -C $ORACLE_HOME/bin/oracle | grep ' [TtDdRrVv] ' | tr ':' ' ' | cut -d" " -f1,3,4 | sort -u | awk '{ if ( $3 != "" ) { file=$1; sub(".*/","", file); printf "%s|%s|%s\n", file, $2, $3 } }' >> "{{ VM_folder }}/{{ symbols_file }}" + + # Remove empty lines or sqlldr will fail due to constant. + sed -i '/^$/d' "{{ VM_folder }}/{{ symbols_file }}" + + args: + chdir: "{{ dbhome_locl }}" + environment: + ORACLE_HOME: "{{ dbhome_locl }}" + become: true + become_user: root + delegate_to: "{{ vm_ip_address }}" + + - name: Copy {{ symbols_file }} to repository + copy: + src: "{{ shared_folder }}/{{ symbols_file }}" + dest: "{{ symbols_folder }}" + + - name : "Remove file {{ symbols_file }}" + file: + state: absent + path: "{{ shared_folder }}/{{ symbols_file }}" + + when: not symbols_stat_result.stat.exists \ No newline at end of file diff --git a/user_scripts/odbfcl/tables_create.sql b/user_scripts/odbfcl/tables_create.sql new file mode 100644 index 0000000..1c17c91 --- /dev/null +++ b/user_scripts/odbfcl/tables_create.sql @@ -0,0 +1,1008 @@ +WHENEVER SQLERROR EXIT SQL.SQLCODE + +-- Tables: + +---------------- +-- From X$: +---------------- +-- T_PARAMETER +-- T_PARAMETERVAL +-- T_XTABCOLS + +---------------- +-- From V$: +---------------- +-- T_FIXED_TABLE +-- T_FIXED_VIEW_DEFINITION +-- T_SYSSTAT +-- T_SYS_TIME_MODEL +-- T_EVENT_NAME + +---------------- +-- From DBA/DBA: +---------------- +-- T_TAB_PRIVS +-- T_COL_PRIVS +-- T_SYS_PRIVS +-- T_ROLE_PRIVS +-- T_JAVA_POLICY +-- T_JOBS +-- T_TS_QUOTAS +-- T_POLICIES +-- T_TRIGGERS +-- T_SCHEDULER_JOBS +-- T_SCHEDULER_PROGRAMS +-- T_OBJ_AUDIT_OPTS +-- T_STMT_AUDIT_OPTS +-- T_PRIV_AUDIT_OPTS +-- T_AUDIT_POLICIES +-- T_AUDIT_POLICY_COLUMNS +-- T_SYNONYMS +-- T_USERS +-- T_ROLES +-- T_OBJECTS +-- T_TAB_COLUMNS + +---------------- +-- From Others: +---------------- +-- T_HASH +-- T_AUDIT_UNIFIED_POLICIES +-- T_FILES +-- T_SYMBOLS +-- T_TXTCOLLECTION + +---------------------------------------------------------- +---------------------------------------------------------- +---------------------------------------------------------- + +CREATE TABLE "T_PARAMETER" +( +"NAME" VARCHAR2(80 CHAR), +"TYPE" NUMBER, +"DEFAULT_VALUE" VARCHAR2(255 CHAR), +"ISSES_MODIFIABLE" VARCHAR2(5 CHAR), +"ISSYS_MODIFIABLE" VARCHAR2(9 CHAR), +"ISPDB_MODIFIABLE" VARCHAR2(5 CHAR), +"ISINSTANCE_MODIFIABLE" VARCHAR2(5 CHAR), +"ISDEPRECATED" VARCHAR2(5 CHAR), +"ISBASIC" VARCHAR2(5 CHAR), +"DESCRIPTION" VARCHAR2(255 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_PARAMETER_VALID_VALUES" +( +"NAME" VARCHAR2(80 CHAR), +"ORDINAL" NUMBER, +"VALUE" VARCHAR2(255 CHAR), +"ISDEFAULT" VARCHAR2(64 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_SYSSTAT" +( +"STATISTIC#" NUMBER, +"NAME" VARCHAR2(64 CHAR), +"CLASS" NUMBER, +"STAT_ID" NUMBER, +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_SYS_TIME_MODEL" +( +"STAT_ID" NUMBER, +"STAT_NAME" VARCHAR2(64 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_EVENT_NAME" +( +"EVENT#" NUMBER, +"EVENT_ID" NUMBER, +"NAME" VARCHAR2(64 CHAR), +"PARAMETER1" VARCHAR2(64 CHAR), +"PARAMETER2" VARCHAR2(64 CHAR), +"PARAMETER3" VARCHAR2(64 CHAR), +"WAIT_CLASS_ID" NUMBER, +"WAIT_CLASS#" NUMBER, +"WAIT_CLASS" VARCHAR2(64 CHAR), +"DISPLAY_NAME" VARCHAR2(64 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_XTABCOLS" +( +"TABLE_NAME" VARCHAR2(128 CHAR), +"COLUMN_NAME" VARCHAR2(128 CHAR), +"COLUMN_TYPE" NUMBER, +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_OBJECTS" +( +"OWNER" VARCHAR2(128 CHAR), +"OBJECT_NAME" VARCHAR2(128 CHAR), +"SUBOBJECT_NAME" VARCHAR2(128 CHAR), +"OBJECT_TYPE" VARCHAR2(23 CHAR), +"TEMPORARY" VARCHAR2(1 CHAR), +"GENERATED" VARCHAR2(1 CHAR), +"SECONDARY" VARCHAR2(1 CHAR), +"NAMESPACE" NUMBER, +"EDITION_NAME" VARCHAR2(128 CHAR), +"SHARING" VARCHAR2(18 CHAR), +"EDITIONABLE" VARCHAR2(1 CHAR), +"ORACLE_MAINTAINED" VARCHAR2(1 CHAR), +"APPLICATION" VARCHAR2(1 CHAR), +"DEFAULT_COLLATION" VARCHAR2(100 CHAR), +"DUPLICATED" VARCHAR2(1 CHAR), +"SHARDED" VARCHAR2(1 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_TAB_COLUMNS" +( +"OWNER" VARCHAR2(128 CHAR), +"TABLE_NAME" VARCHAR2(128 CHAR), +"COLUMN_NAME" VARCHAR2(128 CHAR), +"DATA_TYPE" VARCHAR2(128 CHAR), +"DATA_TYPE_MOD" VARCHAR2(3 CHAR), +"DATA_TYPE_OWNER" VARCHAR2(128 CHAR), +"DATA_LENGTH" NUMBER, +"DATA_PRECISION" NUMBER, +"DATA_SCALE" NUMBER, +"NULLABLE" VARCHAR2(1 CHAR), +"COLUMN_ID" NUMBER, +"DEFAULT_LENGTH" NUMBER, +"CHARACTER_SET_NAME" VARCHAR2(44 CHAR), +"CHAR_COL_DECL_LENGTH" NUMBER, +"DEFAULT_ON_NULL" VARCHAR2(3 CHAR), +"IDENTITY_COLUMN" VARCHAR2(3 CHAR), +"SENSITIVE_COLUMN" VARCHAR2(3 CHAR), +"COLLATION" VARCHAR2(100 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_FIXED_TABLE" +( +"NAME" VARCHAR2(128 CHAR), +"TYPE" VARCHAR2(5 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_FIXED_VIEW_DEFINITION" +( +"VIEW_NAME" VARCHAR2(128 CHAR), +"VIEW_DEFINITION" VARCHAR2(4000 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_USERS" +( +"USERNAME" VARCHAR2(128 CHAR), +"USER_ID" NUMBER, +"ACCOUNT_STATUS" VARCHAR2(32 CHAR), +"DEFAULT_TABLESPACE" VARCHAR2(30 CHAR), +"TEMPORARY_TABLESPACE" VARCHAR2(30 CHAR), +"LOCAL_TEMP_TABLESPACE" VARCHAR2(30 CHAR), +"PROFILE" VARCHAR2(128 CHAR), +"INITIAL_RSRC_CONSUMER_GROUP" VARCHAR2(128 CHAR), +"EXTERNAL_NAME" VARCHAR2(4000 CHAR), +"PASSWORD_VERSIONS" VARCHAR2(17 CHAR), +"EDITIONS_ENABLED" VARCHAR2(1 CHAR), +"AUTHENTICATION_TYPE" VARCHAR2(8 CHAR), +"PROXY_ONLY_CONNECT" VARCHAR2(1 CHAR), +"COMMON" VARCHAR2(3 CHAR), +"ORACLE_MAINTAINED" VARCHAR2(1 CHAR), +"INHERITED" VARCHAR2(3 CHAR), +"DEFAULT_COLLATION" VARCHAR2(100 CHAR), +"IMPLICIT" VARCHAR2(3 CHAR), +"ALL_SHARD" VARCHAR2(3 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_ROLES" +( +"ROLE" VARCHAR2(128 CHAR), +"PASSWORD_REQUIRED" VARCHAR2(8 CHAR), +"AUTHENTICATION_TYPE" VARCHAR2(11 CHAR), +"COMMON" VARCHAR2(3 CHAR), +"ORACLE_MAINTAINED" VARCHAR2(1 CHAR), +"INHERITED" VARCHAR2(3 CHAR), +"IMPLICIT" VARCHAR2(3 CHAR), +"EXTERNAL_NAME" VARCHAR2(4000 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_RESERVED_WORDS" +( +"KEYWORD" VARCHAR2(128 CHAR), +"LENGTH" NUMBER, +"RESERVED" VARCHAR2(1 CHAR), +"RES_TYPE" VARCHAR2(1 CHAR), +"RES_ATTR" VARCHAR2(1 CHAR), +"RES_SEMI" VARCHAR2(1 CHAR), +"DUPLICATE" VARCHAR2(1 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_TRIGGERS" +( +"OWNER" VARCHAR2(128 CHAR), +"TRIGGER_NAME" VARCHAR2(128 CHAR), +"TRIGGER_TYPE" VARCHAR2(16 CHAR), +"TRIGGERING_EVENT" VARCHAR2(246 CHAR), +"TABLE_OWNER" VARCHAR2(128 CHAR), +"BASE_OBJECT_TYPE" VARCHAR2(18 CHAR), +"TABLE_NAME" VARCHAR2(128 CHAR), +"COLUMN_NAME" VARCHAR2(4000 CHAR), +"REFERENCING_NAMES" VARCHAR2(422 CHAR), +"WHEN_CLAUSE" VARCHAR2(4000 CHAR), +"STATUS" VARCHAR2(8 CHAR), +"DESCRIPTION" VARCHAR2(4000 CHAR), +"ACTION_TYPE" VARCHAR2(11 CHAR), +"CROSSEDITION" VARCHAR2(7 CHAR), +"BEFORE_STATEMENT" VARCHAR2(3 CHAR), +"BEFORE_ROW" VARCHAR2(3 CHAR), +"AFTER_ROW" VARCHAR2(3 CHAR), +"AFTER_STATEMENT" VARCHAR2(3 CHAR), +"INSTEAD_OF_ROW" VARCHAR2(3 CHAR), +"FIRE_ONCE" VARCHAR2(3 CHAR), +"APPLY_SERVER_ONLY" VARCHAR2(3 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_AUDIT_POLICY_COLUMNS" +( +"OBJECT_SCHEMA" VARCHAR2(128 CHAR), +"OBJECT_NAME" VARCHAR2(128 CHAR), +"POLICY_NAME" VARCHAR2(128 CHAR), +"POLICY_COLUMN" VARCHAR2(128 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_AUDIT_UNIFIED_POLICIES" +( +"POLICY_NAME" VARCHAR2(128 CHAR), +"AUDIT_CONDITION" VARCHAR2(4000 CHAR), +"CONDITION_EVAL_OPT" VARCHAR2(9 CHAR), +"AUDIT_OPTION" VARCHAR2(128 CHAR), +"AUDIT_OPTION_TYPE" VARCHAR2(18 CHAR), +"OBJECT_SCHEMA" VARCHAR2(128 CHAR), +"OBJECT_NAME" VARCHAR2(128 CHAR), +"OBJECT_TYPE" VARCHAR2(23 CHAR), +"COMMON" VARCHAR2(3 CHAR), +"INHERITED" VARCHAR2(3 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_COL_PRIVS" +( +"GRANTEE" VARCHAR2(128 CHAR), +"OWNER" VARCHAR2(128 CHAR), +"TABLE_NAME" VARCHAR2(128 CHAR), +"COLUMN_NAME" VARCHAR2(128 CHAR), +"GRANTOR" VARCHAR2(128 CHAR), +"PRIVILEGE" VARCHAR2(40 CHAR), +"GRANTABLE" VARCHAR2(3 CHAR), +"COMMON" VARCHAR2(3 CHAR), +"INHERITED" VARCHAR2(3 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_SCHEDULER_PROGRAMS" +( +"OWNER" VARCHAR2(128 CHAR), +"PROGRAM_NAME" VARCHAR2(128 CHAR), +"PROGRAM_TYPE" VARCHAR2(16 CHAR), +"PROGRAM_ACTION" VARCHAR2(4000 CHAR), +"NUMBER_OF_ARGUMENTS" NUMBER, +"ENABLED" VARCHAR2(5 CHAR), +"DETACHED" VARCHAR2(5 CHAR), +"SCHEDULE_LIMIT" INTERVAL DAY (3) TO SECOND (0), +"PRIORITY" NUMBER, +"WEIGHT" NUMBER, +"MAX_RUNS" NUMBER, +"MAX_FAILURES" NUMBER, +"MAX_RUN_DURATION" INTERVAL DAY (3) TO SECOND (0), +"HAS_CONSTRAINTS" VARCHAR2(5 CHAR), +"NLS_ENV" VARCHAR2(4000 CHAR), +"COMMENTS" VARCHAR2(4000 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_JOBS" +( +"JOB" NUMBER, +"LOG_USER" VARCHAR2(128 CHAR), +"PRIV_USER" VARCHAR2(128 CHAR), +"SCHEMA_USER" VARCHAR2(128 CHAR), +"LAST_DATE" DATE, +"LAST_SEC" VARCHAR2(8 CHAR), +"THIS_DATE" DATE, +"THIS_SEC" VARCHAR2(8 CHAR), +"NEXT_DATE" DATE, +"NEXT_SEC" VARCHAR2(8 CHAR), +"TOTAL_TIME" NUMBER, +"BROKEN" VARCHAR2(1 CHAR), +"INTERVAL" VARCHAR2(200 CHAR), +"FAILURES" NUMBER, +"WHAT" VARCHAR2(4000 CHAR), +"NLS_ENV" VARCHAR2(4000 CHAR), +"MISC_ENV" RAW(32), +"INSTANCE" NUMBER, +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_TAB_PRIVS" +( +"GRANTEE" VARCHAR2(128 CHAR), +"OWNER" VARCHAR2(128 CHAR), +"TABLE_NAME" VARCHAR2(128 CHAR), +"GRANTOR" VARCHAR2(128 CHAR), +"PRIVILEGE" VARCHAR2(40 CHAR), +"GRANTABLE" VARCHAR2(3 CHAR), +"HIERARCHY" VARCHAR2(3 CHAR), +"COMMON" VARCHAR2(3 CHAR), +"TYPE" VARCHAR2(24 CHAR), +"INHERITED" VARCHAR2(3 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_PRIV_AUDIT_OPTS" +( +"USER_NAME" VARCHAR2(128 CHAR), +"PROXY_NAME" VARCHAR2(128 CHAR), +"PRIVILEGE" VARCHAR2(40 CHAR), +"SUCCESS" VARCHAR2(10 CHAR), +"FAILURE" VARCHAR2(10 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_TS_QUOTAS" +( +"TABLESPACE_NAME" VARCHAR2(30 CHAR), +"USERNAME" VARCHAR2(128 CHAR), +"BYTES" NUMBER, +"MAX_BYTES" NUMBER, +"BLOCKS" NUMBER, +"MAX_BLOCKS" NUMBER, +"DROPPED" VARCHAR2(3 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_OBJ_AUDIT_OPTS" +( +"OWNER" VARCHAR2(128 CHAR), +"OBJECT_NAME" VARCHAR2(128 CHAR), +"OBJECT_TYPE" VARCHAR2(23 CHAR), +"ALT" VARCHAR2(3 CHAR), +"AUD" VARCHAR2(3 CHAR), +"COM" VARCHAR2(3 CHAR), +"DEL" VARCHAR2(3 CHAR), +"GRA" VARCHAR2(3 CHAR), +"IND" VARCHAR2(3 CHAR), +"INS" VARCHAR2(3 CHAR), +"LOC" VARCHAR2(3 CHAR), +"REN" VARCHAR2(3 CHAR), +"SEL" VARCHAR2(3 CHAR), +"UPD" VARCHAR2(3 CHAR), +"REF" CHAR(3 CHAR), +"EXE" VARCHAR2(3 CHAR), +"CRE" VARCHAR2(3 CHAR), +"REA" VARCHAR2(3 CHAR), +"WRI" VARCHAR2(3 CHAR), +"FBK" VARCHAR2(3 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_STMT_AUDIT_OPTS" +( +"USER_NAME" VARCHAR2(128 CHAR), +"PROXY_NAME" VARCHAR2(128 CHAR), +"AUDIT_OPTION" VARCHAR2(40 CHAR), +"SUCCESS" VARCHAR2(10 CHAR), +"FAILURE" VARCHAR2(10 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_POLICIES" +( +"OBJECT_OWNER" VARCHAR2(128 CHAR), +"OBJECT_NAME" VARCHAR2(128 CHAR), +"POLICY_GROUP" VARCHAR2(128 CHAR), +"POLICY_NAME" VARCHAR2(128 CHAR), +"PF_OWNER" VARCHAR2(128 CHAR), +"PACKAGE" VARCHAR2(128 CHAR), +"FUNCTION" VARCHAR2(128 CHAR), +"SEL" VARCHAR2(3 CHAR), +"INS" VARCHAR2(3 CHAR), +"UPD" VARCHAR2(3 CHAR), +"DEL" VARCHAR2(3 CHAR), +"IDX" VARCHAR2(3 CHAR), +"CHK_OPTION" VARCHAR2(3 CHAR), +"ENABLE" VARCHAR2(3 CHAR), +"STATIC_POLICY" VARCHAR2(3 CHAR), +"POLICY_TYPE" VARCHAR2(24 CHAR), +"LONG_PREDICATE" VARCHAR2(3 CHAR), +"COMMON" VARCHAR2(3 CHAR), +"INHERITED" VARCHAR2(3 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_ROLE_PRIVS" +( +"GRANTEE" VARCHAR2(128 CHAR), +"GRANTED_ROLE" VARCHAR2(128 CHAR), +"ADMIN_OPTION" VARCHAR2(3 CHAR), +"DELEGATE_OPTION" VARCHAR2(3 CHAR), +"DEFAULT_ROLE" VARCHAR2(3 CHAR), +"COMMON" VARCHAR2(3 CHAR), +"INHERITED" VARCHAR2(3 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_JAVA_POLICY" +( +"KIND" VARCHAR2(8 CHAR), +"GRANTEE" VARCHAR2(128 CHAR), +"TYPE_SCHEMA" VARCHAR2(128 CHAR), +"TYPE_NAME" VARCHAR2(4000 CHAR), +"NAME" VARCHAR2(4000 CHAR), +"ACTION" VARCHAR2(4000 CHAR), +"ENABLED" VARCHAR2(8 CHAR), +"SEQ" NUMBER, +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_SCHEDULER_JOBS" +( +"OWNER" VARCHAR2(128 CHAR), +"JOB_NAME" VARCHAR2(128 CHAR), +"JOB_SUBNAME" VARCHAR2(128 CHAR), +"JOB_STYLE" VARCHAR2(17 CHAR), +"JOB_CREATOR" VARCHAR2(128 CHAR), +"CLIENT_ID" VARCHAR2(65 CHAR), +"GLOBAL_UID" VARCHAR2(33 CHAR), +"PROGRAM_OWNER" VARCHAR2(4000 CHAR), +"PROGRAM_NAME" VARCHAR2(4000 CHAR), +"JOB_TYPE" VARCHAR2(16 CHAR), +"JOB_ACTION" VARCHAR2(4000 CHAR), +"NUMBER_OF_ARGUMENTS" NUMBER, +"SCHEDULE_OWNER" VARCHAR2(4000 CHAR), +"SCHEDULE_NAME" VARCHAR2(4000 CHAR), +"SCHEDULE_TYPE" VARCHAR2(12 CHAR), +"START_DATE" TIMESTAMP (6) WITH TIME ZONE, +"REPEAT_INTERVAL" VARCHAR2(4000 CHAR), +"EVENT_QUEUE_OWNER" VARCHAR2(128 CHAR), +"EVENT_QUEUE_NAME" VARCHAR2(128 CHAR), +"EVENT_QUEUE_AGENT" VARCHAR2(523 CHAR), +"EVENT_CONDITION" VARCHAR2(4000 CHAR), +"EVENT_RULE" VARCHAR2(261 CHAR), +"FILE_WATCHER_OWNER" VARCHAR2(261 CHAR), +"FILE_WATCHER_NAME" VARCHAR2(261 CHAR), +"END_DATE" TIMESTAMP (6) WITH TIME ZONE, +"JOB_CLASS" VARCHAR2(128 CHAR), +"ENABLED" VARCHAR2(5 CHAR), +"AUTO_DROP" VARCHAR2(5 CHAR), +"RESTART_ON_RECOVERY" VARCHAR2(5 CHAR), +"RESTART_ON_FAILURE" VARCHAR2(5 CHAR), +"STATE" VARCHAR2(15 CHAR), +"JOB_PRIORITY" NUMBER, +"RUN_COUNT" NUMBER, +"UPTIME_RUN_COUNT" NUMBER, +"MAX_RUNS" NUMBER, +"FAILURE_COUNT" NUMBER, +"UPTIME_FAILURE_COUNT" NUMBER, +"MAX_FAILURES" NUMBER, +"RETRY_COUNT" NUMBER, +"LAST_START_DATE" TIMESTAMP (6) WITH TIME ZONE, +"LAST_RUN_DURATION" INTERVAL DAY (9) TO SECOND (6), +"NEXT_RUN_DATE" TIMESTAMP (6) WITH TIME ZONE, +"SCHEDULE_LIMIT" INTERVAL DAY (3) TO SECOND (0), +"MAX_RUN_DURATION" INTERVAL DAY (3) TO SECOND (0), +"LOGGING_LEVEL" VARCHAR2(11 CHAR), +"STORE_OUTPUT" VARCHAR2(5 CHAR), +"STOP_ON_WINDOW_CLOSE" VARCHAR2(5 CHAR), +"INSTANCE_STICKINESS" VARCHAR2(5 CHAR), +"RAISE_EVENTS" VARCHAR2(4000 CHAR), +"SYSTEM" VARCHAR2(5 CHAR), +"JOB_WEIGHT" NUMBER, +"NLS_ENV" VARCHAR2(4000 CHAR), +"SOURCE" VARCHAR2(128 CHAR), +"NUMBER_OF_DESTINATIONS" NUMBER, +"DESTINATION_OWNER" VARCHAR2(261 CHAR), +"DESTINATION" VARCHAR2(261 CHAR), +"CREDENTIAL_OWNER" VARCHAR2(128 CHAR), +"CREDENTIAL_NAME" VARCHAR2(128 CHAR), +"INSTANCE_ID" NUMBER, +"DEFERRED_DROP" VARCHAR2(5 CHAR), +"ALLOW_RUNS_IN_RESTRICTED_MODE" VARCHAR2(5 CHAR), +"COMMENTS" VARCHAR2(4000 CHAR), +"FLAGS" NUMBER, +"RESTARTABLE" VARCHAR2(5 CHAR), +"HAS_CONSTRAINTS" VARCHAR2(5 CHAR), +"CONNECT_CREDENTIAL_OWNER" VARCHAR2(128 CHAR), +"CONNECT_CREDENTIAL_NAME" VARCHAR2(128 CHAR), +"FAIL_ON_SCRIPT_ERROR" VARCHAR2(5 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_AUDIT_POLICIES" +( +"OBJECT_SCHEMA" VARCHAR2(128 CHAR), +"OBJECT_NAME" VARCHAR2(128 CHAR), +"POLICY_OWNER" VARCHAR2(128 CHAR), +"POLICY_NAME" VARCHAR2(128 CHAR), +"POLICY_TEXT" VARCHAR2(4000 CHAR), +"POLICY_COLUMN" VARCHAR2(128 CHAR), +"PF_SCHEMA" VARCHAR2(128 CHAR), +"PF_PACKAGE" VARCHAR2(128 CHAR), +"PF_FUNCTION" VARCHAR2(128 CHAR), +"ENABLED" VARCHAR2(3 CHAR), +"SEL" VARCHAR2(3 CHAR), +"INS" VARCHAR2(3 CHAR), +"UPD" VARCHAR2(3 CHAR), +"DEL" VARCHAR2(3 CHAR), +"AUDIT_TRAIL" VARCHAR2(12 CHAR), +"POLICY_COLUMN_OPTIONS" VARCHAR2(11 CHAR), +"COMMON" VARCHAR2(3 CHAR), +"INHERITED" VARCHAR2(3 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_SYS_PRIVS" +( +"GRANTEE" VARCHAR2(128 CHAR), +"PRIVILEGE" VARCHAR2(40 CHAR), +"ADMIN_OPTION" VARCHAR2(3 CHAR), +"COMMON" VARCHAR2(3 CHAR), +"INHERITED" VARCHAR2(3 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_SYNONYMS" +( +"OWNER" VARCHAR2(128 CHAR), +"SYNONYM_NAME" VARCHAR2(128 CHAR), +"TABLE_OWNER" VARCHAR2(128 CHAR), +"TABLE_NAME" VARCHAR2(128 CHAR), +"DB_LINK" VARCHAR2(128 CHAR), +"ORIGIN_CON_ID" NUMBER, +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_HASH" +( +"OWNER" VARCHAR2(128 CHAR), +"NAME" VARCHAR2(128 CHAR), +"TYPE" VARCHAR2(12 CHAR), +"ORIGIN_CON_ID" NUMBER, +"CON_ID" NUMBER, +"MD5_ENC" RAW(16) NOT NULL, +"SHA1_ENC" RAW(20) NOT NULL, +"CODE" CLOB NOT NULL, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_FILES" +( +"PATH" VARCHAR2(500 CHAR), +"SHA256_ENC" RAW(32), +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_SYMBOLS" +( +"FILE_NAME" VARCHAR2(100 CHAR), +"SYMBOL_TYPE" VARCHAR2(1 CHAR), +"SYMBOL_NAME" VARCHAR2(500 CHAR), +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_TXTCOLLECTION" +( +"PATH" VARCHAR2(500 CHAR), +"MD5_HASH" RAW(16), +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_BUGSFIXED" +( +"BUG_ID" NUMBER NOT NULL, +"PATCH_ID" NUMBER NOT NULL, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +----------------------------------------------------- +----------------------------------------------------- +----------------------------------------------------- + +CREATE TABLE "T_CONTENTS" +( +"MD5_HASH" RAW(16) NOT NULL, +"CONTENTS" CLOB NOT NULL, +CONSTRAINT T_CONTENTS_PK PRIMARY KEY ("MD5_HASH") +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_BUGS" +( +"BUG_ID" NUMBER NOT NULL, +"BUG_DESC" VARCHAR2(1000 CHAR) NOT NULL, +CONSTRAINT T_BUGS_PK PRIMARY KEY ("BUG_ID") +) +COMPRESS NOLOGGING; + +----------------------------------------------------- +-- Tables only for process logging +-- For the tables below, I don't remove any column +----------------------------------------------------- + +-- select view_name from dba_views where view_name like 'CDB%REGISTRY%' order by 1; +-- SET LINES 10000 PAGES 10000 LONG 10000 LONGC 10000 TRIMS ON HEA OFF +-- EXECUTE DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'STORAGE',false); +-- EXECUTE DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'PRETTY',true); +-- EXECUTE DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'SQLTERMINATOR',true); +-- EXECUTE DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'SEGMENT_ATTRIBUTES',false); +-- EXECUTE DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'SIZE_BYTE_KEYWORD',true); +-- DROP TABLE T_REGISTRY; +-- CREATE TABLE T_REGISTRY AS SELECT * FROM CDB_REGISTRY; +-- SELECT DBMS_METADATA.GET_DDL('TABLE','T_REGISTRY') FROM DUAL; + +CREATE TABLE "T_REGISTRY" +( +"COMP_ID" VARCHAR2(30 CHAR), +"COMP_NAME" VARCHAR2(255 CHAR), +"VERSION" VARCHAR2(30 CHAR), +"VERSION_FULL" VARCHAR2(30 CHAR), +"STATUS" VARCHAR2(44 CHAR), +"MODIFIED" VARCHAR2(29 CHAR), +"NAMESPACE" VARCHAR2(30 CHAR), +"CONTROL" VARCHAR2(128 CHAR), +"SCHEMA" VARCHAR2(128 CHAR), +"PROCEDURE" VARCHAR2(128 CHAR), +"STARTUP" VARCHAR2(8 CHAR), +"PARENT_ID" VARCHAR2(30 CHAR), +"OTHER_SCHEMAS" VARCHAR2(4000 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_REGISTRY_BACKPORTS" +( +"BUGNO" NUMBER, +"VERSION_FULL" VARCHAR2(30 CHAR), +"COMP_ID" VARCHAR2(30 CHAR), +"NAMESPACE" VARCHAR2(30 CHAR), +"BACKPORT_TYPE" VARCHAR2(30 CHAR), +"BACKPORT_TIME" TIMESTAMP (6), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_REGISTRY_DATABASE" +( +"PLATFORM_ID" NUMBER, +"PLATFORM_NAME" VARCHAR2(101 CHAR), +"EDITION" VARCHAR2(30 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_REGISTRY_DEPENDENCIES" +( +"COMP_ID" VARCHAR2(30 CHAR), +"NAMESPACE" VARCHAR2(30 CHAR), +"REQ_COMP_ID" VARCHAR2(30 CHAR), +"REQ_NAMESPACE" VARCHAR2(30 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_REGISTRY_ERROR" +( +"USERNAME" VARCHAR2(256 CHAR), +"TIMESTAMP" TIMESTAMP (6), +"SCRIPT" VARCHAR2(1024 CHAR), +"IDENTIFIER" VARCHAR2(256 CHAR), +"MESSAGE" CLOB, +"STATEMENT" CLOB, +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_REGISTRY_HIERARCHY" +( +"NAMESPACE" VARCHAR2(30 CHAR), +"COMP_ID" VARCHAR2(4000 CHAR), +"VERSION" VARCHAR2(30 CHAR), +"VERSION_FULL" VARCHAR2(30 CHAR), +"STATUS" VARCHAR2(44 CHAR), +"MODIFIED" VARCHAR2(29 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_REGISTRY_HISTORY" +( +"ACTION_TIME" TIMESTAMP (6), +"ACTION" VARCHAR2(30 CHAR), +"NAMESPACE" VARCHAR2(30 CHAR), +"VERSION" VARCHAR2(30 CHAR), +"ID" NUMBER, +"COMMENTS" VARCHAR2(255 CHAR), +"BUNDLE_SERIES" VARCHAR2(30 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_REGISTRY_LOG" +( +"OPTIME" TIMESTAMP (6), +"NAMESPACE" VARCHAR2(30 CHAR), +"COMP_ID" VARCHAR2(30 CHAR), +"OPERATION" VARCHAR2(11 CHAR), +"MESSAGE" VARCHAR2(1000 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_REGISTRY_PROGRESS" +( +"COMP_ID" VARCHAR2(30 CHAR), +"NAMESPACE" VARCHAR2(30 CHAR), +"ACTION" VARCHAR2(255 CHAR), +"VALUE" VARCHAR2(255 CHAR), +"STEP" NUMBER, +"ACTION_TIME" TIMESTAMP (6), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_REGISTRY_SCHEMAS" +( +"NAMESPACE" VARCHAR2(30 CHAR), +"COMP_ID" VARCHAR2(30 CHAR), +"SCHEMA" VARCHAR2(128 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_REGISTRY_SQLPATCH" +( +"INSTALL_ID" NUMBER, +"PATCH_ID" NUMBER, +"PATCH_UID" NUMBER, +"PATCH_TYPE" VARCHAR2(10 CHAR), +"ACTION" VARCHAR2(15 CHAR), +"STATUS" VARCHAR2(25 CHAR), +"ACTION_TIME" TIMESTAMP (6), +"DESCRIPTION" VARCHAR2(100 CHAR), +"LOGFILE" VARCHAR2(500 CHAR), +"RU_LOGFILE" VARCHAR2(500 CHAR), +"FLAGS" VARCHAR2(10 CHAR), +--"PATCH_DESCRIPTOR" "SYS"."XMLTYPE" , +--"PATCH_DIRECTORY" BLOB, +"SOURCE_VERSION" VARCHAR2(15 CHAR), +"SOURCE_BUILD_DESCRIPTION" VARCHAR2(80 CHAR), +"SOURCE_BUILD_TIMESTAMP" TIMESTAMP (6), +"TARGET_VERSION" VARCHAR2(15 CHAR), +"TARGET_BUILD_DESCRIPTION" VARCHAR2(80 CHAR), +"TARGET_BUILD_TIMESTAMP" TIMESTAMP (6), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_REGISTRY_SQLPATCH_RU_INFO" +( +"PATCH_ID" NUMBER, +"PATCH_UID" NUMBER, +--"PATCH_DESCRIPTOR" "SYS"."XMLTYPE" , +"RU_VERSION" VARCHAR2(15 CHAR), +"RU_BUILD_DESCRIPTION" VARCHAR2(80 CHAR), +"RU_BUILD_TIMESTAMP" TIMESTAMP (6), +--"PATCH_DIRECTORY" BLOB, +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_SERVER_REGISTRY" +( +"COMP_ID" VARCHAR2(30 CHAR), +"COMP_NAME" VARCHAR2(255 CHAR), +"VERSION" VARCHAR2(30 CHAR), +"VERSION_FULL" VARCHAR2(30 CHAR), +"STATUS" VARCHAR2(44 CHAR), +"MODIFIED" VARCHAR2(29 CHAR), +"CONTROL" VARCHAR2(128 CHAR), +"SCHEMA" VARCHAR2(128 CHAR), +"PROCEDURE" VARCHAR2(128 CHAR), +"STARTUP" VARCHAR2(8 CHAR), +"PARENT_ID" VARCHAR2(30 CHAR), +"OTHER_SCHEMAS" VARCHAR2(4000 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +---------------------------------------------------------- +---------------------------------------------------------- +---------------------------------------------------------- \ No newline at end of file diff --git a/user_scripts/odbfcl/tables_recreate.sql b/user_scripts/odbfcl/tables_recreate.sql new file mode 100644 index 0000000..ee447b3 --- /dev/null +++ b/user_scripts/odbfcl/tables_recreate.sql @@ -0,0 +1,15 @@ +WHENEVER SQLERROR EXIT SQL.SQLCODE + +col v_username new_v v_username nopri + +select case when version >= 12 then 'C##' end || 'HASH' v_username +from (select to_number(substr(version,1,instr(version,'.')-1)) version + from v$instance); + +col v_username clear + +@@createUser.sql &v_username. + +conn &v_username./hash; + +@@tables_create.sql diff --git a/user_scripts/odbfcl/tables_recreate_adb.sql b/user_scripts/odbfcl/tables_recreate_adb.sql new file mode 100644 index 0000000..3002584 --- /dev/null +++ b/user_scripts/odbfcl/tables_recreate_adb.sql @@ -0,0 +1,34 @@ +WHENEVER SQLERROR EXIT SQL.SQLCODE + +SET LINES 1000 PAGES 1000 + +SET SERVEROUT ON +DECLARE + VCODE CLOB; +BEGIN + FOR I IN (select table_name from sys.user_tables order by 1) + LOOP + VCODE := 'DROP TABLE ' || DBMS_ASSERT.SQL_OBJECT_NAME(I.TABLE_NAME) || ' CASCADE CONSTRAINTS PURGE'; + DBMS_OUTPUT.PUT_LINE(VCODE); + EXECUTE IMMEDIATE VCODE; + END LOOP; +END; +/ + +-- @@tables_create.sql + +DECLARE + V_CMD CLOB; +BEGIN + FOR I IN (SELECT TABLE_NAME + FROM SYS.ALL_TABLES + WHERE OWNER='HASH' + AND TABLE_NAME LIKE 'T\_%' ESCAPE '\' + ORDER BY 1) + LOOP + V_CMD := 'CREATE TABLE ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' FOR EXCHANGE WITH TABLE ' || DBMS_ASSERT.ENQUOTE_NAME('HASH') || '.' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME); + DBMS_OUTPUT.PUT_LINE(V_CMD || ';'); + EXECUTE IMMEDIATE V_CMD; + END LOOP; +END; +/ diff --git a/user_scripts/odbfcl/tables_recreate_adb.yml b/user_scripts/odbfcl/tables_recreate_adb.yml new file mode 100644 index 0000000..87f247a --- /dev/null +++ b/user_scripts/odbfcl/tables_recreate_adb.yml @@ -0,0 +1,12 @@ +- name: Define oci_adb_transient_user + set_fact: + oci_adb_transient_user: "{{ oci_adb_user }}_{{ db_version | replace('.', '') }}" + +- name: "Run tables recreate ADB SQL" + shell: | + set -e + sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/tables_recreate_adb.sql + register: sqloutput + +- name: SQL Output + debug: msg="{{ sqloutput.stdout_lines }}" \ No newline at end of file From 8bf808bbd82d56afdd4aef9f55fb3a9f60d62aee Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 28 Jul 2021 13:22:20 -0300 Subject: [PATCH 017/229] Add ojvm cleanup --- config_main.yml | 2 +- config_oci.yml | 2 +- tasks/clean_ojvm_dumps.yml | 22 +++ tasks/main_PSU_BP.yml | 2 + tasks/main_RU_RUR.yml | 2 + user_scripts/odbfcl/exchange_tables_adb.sql | 165 +++++++++++++++----- 6 files changed, 152 insertions(+), 43 deletions(-) create mode 100644 tasks/clean_ojvm_dumps.yml diff --git a/config_main.yml b/config_main.yml index 03128ad..8b61b61 100644 --- a/config_main.yml +++ b/config_main.yml @@ -2,7 +2,7 @@ oci_mode : true # This parameter will skip execution for patches that already have a dump file generated in "dump_folder" ("output_folder"/expdp). -skip_dump_exists: false +skip_dump_exists: true # If true, will only deploy the patch and skip the expdp and the pre/post steps. only_deploy_patch: false diff --git a/config_oci.yml b/config_oci.yml index 7bcd932..6760b7b 100644 --- a/config_oci.yml +++ b/config_oci.yml @@ -25,11 +25,11 @@ user_expdp_pre : user_expdp_post : - { file : "tables_recreate_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Recreate tables in ADB" } +- { file : "adb_load_expdp.yml" , folder : "user_scripts/odbfcl/adb_load_expdp" , type : "yml", task_action : "impdp files from OS to ADB" } - { file : "adb_load_bugs_fixed.yml" , folder : "user_scripts/odbfcl/adb_load_bugs_fixed" , type : "yml", task_action : "Load fixed bugs list for ORACLE_HOME in ADB" } - { file : "adb_load_filechksum.yml" , folder : "user_scripts/odbfcl/adb_load_filechksum" , type : "yml", task_action : "Load chksum for ORACLE_HOME in ADB" } - { file : "adb_load_symbols.yml" , folder : "user_scripts/odbfcl/adb_load_symbols" , type : "yml", task_action : "Load chksum for ORACLE_HOME in ADB" } - { file : "adb_load_txtcollection_files.yml" , folder : "user_scripts/odbfcl/adb_load_txtcollection_files" , type : "yml", task_action : "Load non-binary files from ORACLE_HOME in ADB" } -- { file : "adb_load_expdp.yml" , folder : "user_scripts/odbfcl/adb_load_expdp" , type : "yml", task_action : "impdp files from OS to ADB" } - { file : "exchange_tables_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Exchange loaded table in the correct partition position" } # User that will hold your tables outputs and be exported after each execution. If the database is CDB, "C##" will be automatically inserted if not. diff --git a/tasks/clean_ojvm_dumps.yml b/tasks/clean_ojvm_dumps.yml new file mode 100644 index 0000000..6220245 --- /dev/null +++ b/tasks/clean_ojvm_dumps.yml @@ -0,0 +1,22 @@ +## This code will clean all OJVM dump files from past executions that have a old RU or PSU base. + +- name: "Remove old OJVM expdp dumps for previous RU or PSU if exists." + shell: | + set -eo pipefail + set -x + + v_ojvm_path="{{ output_folder }}/expdp" + v_ojvm_pref="tables_{{ db_version }}_OJVM" + v_ojvm_name="${v_ojvm_pref}.txt" + v_ojvm_base_file="${v_ojvm_path}/${v_ojvm_name}" + + [ ! -f "${v_ojvm_base_file}" ] && touch "${v_ojvm_base_file}" + + v_ojvm_val=$(cat "${v_ojvm_base_file}") + + if [ "${v_ojvm_val}" != "{{ base_id }}" ] + then + rm -f ${v_ojvm_path}/${v_ojvm_pref}_* + echo "{{ base_id }}" > "${v_ojvm_base_file}" + fi + register: shell_output \ No newline at end of file diff --git a/tasks/main_PSU_BP.yml b/tasks/main_PSU_BP.yml index 8c09a3c..eb32152 100644 --- a/tasks/main_PSU_BP.yml +++ b/tasks/main_PSU_BP.yml @@ -96,6 +96,8 @@ - include: lvm_savestate.yml when: latest_psu_line == latest_processed and oci_mode == true + - include: clean_ojvm_dumps.yml base_id="PSU_{{ latest_psu_id }}" + when: param_type is undefined or param_type == "PSU" ### OJVM define base Snapshot diff --git a/tasks/main_RU_RUR.yml b/tasks/main_RU_RUR.yml index c5248b1..400fafd 100644 --- a/tasks/main_RU_RUR.yml +++ b/tasks/main_RU_RUR.yml @@ -98,6 +98,8 @@ - include: lvm_savestate.yml when: latest_RU_line == latest_processed and oci_mode == true + - include: clean_ojvm_dumps.yml base_id="RU_{{ latest_RU_id }}" + when: param_type is undefined or param_type == "RU" ### OJVM define base Snapshot diff --git a/user_scripts/odbfcl/exchange_tables_adb.sql b/user_scripts/odbfcl/exchange_tables_adb.sql index fa28ba6..d2151e6 100644 --- a/user_scripts/odbfcl/exchange_tables_adb.sql +++ b/user_scripts/odbfcl/exchange_tables_adb.sql @@ -8,20 +8,20 @@ DEF P_SER = '&3' DEF P_VERS = '&4' CREATE OR REPLACE FUNCTION GET_HIGH_VALUE_AS_STRING ( - p_Owner IN VARCHAR2, - p_TableName IN VARCHAR2, - p_PatitionName IN VARCHAR2 + P_OWNER IN VARCHAR2, + P_TABLENAME IN VARCHAR2, + P_PATITIONNAME IN VARCHAR2 ) RETURN VARCHAR2 IS - v_LongVal LONG; + V_LONGVAL LONG; BEGIN - SELECT HIGH_VALUE INTO v_LongVal - FROM ALL_TAB_PARTITIONS - WHERE TABLE_OWNER = p_Owner - AND TABLE_NAME = p_TableName - AND PARTITION_NAME = p_PatitionName; + SELECT HIGH_VALUE INTO V_LONGVAL + FROM ALL_TAB_PARTITIONS + WHERE TABLE_OWNER = P_OWNER + AND TABLE_NAME = P_TABLENAME + AND PARTITION_NAME = P_PATITIONNAME; - RETURN substr(v_LongVal, 1, 200); + RETURN SUBSTR(V_LONGVAL, 1, 200); END; / @@ -29,40 +29,123 @@ END; SET SERVEROUT ON DECLARE - v_PatitionName VARCHAR2(100); - V_CMD CLOB; - -- V_CMD_2 CLOB; - v_OWNER VARCHAR2(30) := UPPER('&P_OWNER'); + V_PNAME VARCHAR2(100); + V_HV VARCHAR2(100); + V_OWNER VARCHAR2(30) := UPPER('&P_OWNER'); + V_OWNER_TNAME VARCHAR2(100); + + -------------------------------------------- + + FUNCTION IS_EMPTY ( + P_OWNER IN VARCHAR2, + P_TABLENAME IN VARCHAR2 + ) RETURN BOOLEAN + IS + V_RES NUMBER; + BEGIN + -- DBMS_OUTPUT.PUT_LINE('SELECT 1 FROM DUAL WHERE EXISTS (SELECT 1 FROM ' || DBMS_ASSERT.ENQUOTE_NAME(P_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(P_TABLENAME) || ')'); + EXECUTE IMMEDIATE 'SELECT 1 FROM DUAL WHERE EXISTS (SELECT 1 FROM ' || DBMS_ASSERT.ENQUOTE_NAME(P_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(P_TABLENAME) || ')' + INTO V_RES; + RETURN FALSE; + EXCEPTION + WHEN NO_DATA_FOUND THEN + RETURN TRUE; + END; + + -------------------------------------------- + + FUNCTION GEN_PART_HV ( + P_OWNER IN VARCHAR2, + P_TABLE_NAME IN VARCHAR2 + ) RETURN VARCHAR2 + IS + V_HV VARCHAR2(30); + BEGIN + SELECT MAX(DECODE(COLUMN_POSITION,1,DECODE(COLUMN_NAME,'ORASERIES',q'['&P_SER']','ORAVERSION',q'['&P_VERS']','ORAPATCH','&P_PATCH'),'')) || ', ' || + MAX(DECODE(COLUMN_POSITION,2,DECODE(COLUMN_NAME,'ORASERIES',q'['&P_SER']','ORAVERSION',q'['&P_VERS']','ORAPATCH','&P_PATCH'),'')) || ', ' || + MAX(DECODE(COLUMN_POSITION,3,DECODE(COLUMN_NAME,'ORASERIES',q'['&P_SER']','ORAVERSION',q'['&P_VERS']','ORAPATCH','&P_PATCH'),'')) + INTO V_HV + FROM ALL_PART_KEY_COLUMNS + WHERE OWNER=P_OWNER + AND NAME=P_TABLE_NAME + AND OBJECT_TYPE='TABLE'; + + RETURN V_HV; + EXCEPTION + WHEN NO_DATA_FOUND THEN + RETURN ''; + END; + + -------------------------------------------- + + FUNCTION GET_PART_NAME ( + P_OWNER IN VARCHAR2, + P_TABLE_NAME IN VARCHAR2, + P_HV IN VARCHAR2 + ) RETURN VARCHAR2 + IS + V_PART_NAME VARCHAR2(30); + BEGIN + SELECT PARTITION_NAME + INTO V_PART_NAME + FROM ALL_TAB_PARTITIONS + WHERE TABLE_OWNER=P_OWNER + AND TABLE_NAME=P_TABLE_NAME + AND GET_HIGH_VALUE_AS_STRING(TABLE_OWNER,TABLE_NAME,PARTITION_NAME) = '( ' || P_HV || ' )'; + + RETURN V_PART_NAME; + EXCEPTION + WHEN NO_DATA_FOUND THEN + RETURN ''; + END; + + -------------------------------------------- + + PROCEDURE RUN_CMD (P_CMD CLOB) + IS + BEGIN + DBMS_OUTPUT.PUT_LINE(P_CMD || ';'); + EXECUTE IMMEDIATE P_CMD; + END; + + -------------------------------------------- + BEGIN FOR I IN (SELECT TABLE_NAME FROM USER_TABLES ORDER BY TABLE_NAME) LOOP - BEGIN - select partition_name - INTO v_PatitionName - from all_tab_partitions - where TABLE_OWNER=v_OWNER - AND TABLE_NAME=i.table_name - and GET_HIGH_VALUE_AS_STRING(table_owner,table_name,partition_name) = q'[( '&P_SER', '&P_VERS', &P_PATCH )]'; - - V_CMD := 'ALTER TABLE ' || DBMS_ASSERT.ENQUOTE_NAME(v_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' EXCHANGE PARTITION ' || DBMS_ASSERT.ENQUOTE_NAME(v_PatitionName) || ' WITH TABLE ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' INCLUDING INDEXES WITH VALIDATION'; - - EXCEPTION - WHEN NO_DATA_FOUND THEN - IF I.TABLE_NAME = 'T_CONTENTS' - THEN - V_CMD := 'INSERT /*+ APPEND */ INTO ' || DBMS_ASSERT.ENQUOTE_NAME(v_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' SELECT * FROM ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' A WHERE NOT EXISTS (SELECT 1 FROM ' || DBMS_ASSERT.ENQUOTE_NAME(v_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' B WHERE A.MD5_HASH = B.MD5_HASH)'; - ELSIF I.TABLE_NAME = 'T_BUGS' - THEN - V_CMD := 'INSERT /*+ APPEND */ INTO ' || DBMS_ASSERT.ENQUOTE_NAME(v_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' SELECT * FROM ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' A WHERE NOT EXISTS (SELECT 1 FROM ' || DBMS_ASSERT.ENQUOTE_NAME(v_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' B WHERE A.BUG_ID = B.BUG_ID)'; - ELSE - V_CMD := 'INSERT /*+ APPEND */ INTO ' || DBMS_ASSERT.ENQUOTE_NAME(v_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' SELECT * FROM ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME); - -- V_CMD_2 := 'ALTER TABLE ' || DBMS_ASSERT.ENQUOTE_NAME(v_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' ADD PARTITION VALUES ( ''&P_SER'', ''&P_VERS'', &P_PATCH )'; - -- DBMS_OUTPUT.PUT_LINE(V_CMD_2 || ';'); - -- EXECUTE IMMEDIATE V_CMD_2; - END IF; - END; - DBMS_OUTPUT.PUT_LINE(V_CMD || ';'); - EXECUTE IMMEDIATE V_CMD; + + IF IS_EMPTY(USER,I.TABLE_NAME) + THEN + DBMS_OUTPUT.PUT_LINE( '--- ' || I.TABLE_NAME || ' - EMPTY'); + CONTINUE; + END IF; + + V_HV := GEN_PART_HV(V_OWNER,I.TABLE_NAME); + + -- Null V_HV = Non-partitioned table. + + IF V_HV IS NOT NULL + THEN + V_PNAME := GET_PART_NAME(V_OWNER,I.TABLE_NAME,V_HV); + END IF; + + V_OWNER_TNAME := DBMS_ASSERT.ENQUOTE_NAME(V_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME); + + IF V_PNAME IS NOT NULL AND V_HV IS NOT NULL + THEN + RUN_CMD('ALTER TABLE ' || V_OWNER_TNAME || ' EXCHANGE PARTITION ' || DBMS_ASSERT.ENQUOTE_NAME(V_PNAME) || ' WITH TABLE ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' INCLUDING INDEXES WITH VALIDATION'); + ELSIF I.TABLE_NAME = 'T_CONTENTS' + THEN + RUN_CMD('INSERT /*+ APPEND */ INTO ' || V_OWNER_TNAME || ' SELECT * FROM ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' A WHERE NOT EXISTS (SELECT 1 FROM ' || V_OWNER_TNAME || ' B WHERE A.MD5_HASH = B.MD5_HASH)'); + ELSIF I.TABLE_NAME = 'T_BUGS' + THEN + RUN_CMD('INSERT /*+ APPEND */ INTO ' || V_OWNER_TNAME || ' SELECT * FROM ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' A WHERE NOT EXISTS (SELECT 1 FROM ' || V_OWNER_TNAME || ' B WHERE A.BUG_ID = B.BUG_ID)'); + ELSE + -- V_CMD := 'INSERT /*+ APPEND */ INTO ' || V_OWNER_TNAME || ' SELECT * FROM ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME); + RUN_CMD('ALTER TABLE ' || V_OWNER_TNAME || ' ADD PARTITION VALUES ( ' || V_HV || ' )'); + V_PNAME := GET_PART_NAME(V_OWNER,I.TABLE_NAME,V_HV); + RUN_CMD('ALTER TABLE ' || V_OWNER_TNAME || ' EXCHANGE PARTITION ' || DBMS_ASSERT.ENQUOTE_NAME(V_PNAME) || ' WITH TABLE ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' INCLUDING INDEXES WITH VALIDATION'); + END IF; END LOOP; END; / From d065f9e525366e9ec9b9e0540cebe30b507df878 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 28 Jul 2021 17:01:45 -0300 Subject: [PATCH 018/229] New patches --- list_exceptions.yml | 3 +++ list_patches.yml | 22 +++++++++++++++++++ .../odbfcl/adb_load_expdp/adb_load_expdp.yml | 8 +++++++ 3 files changed, 33 insertions(+) diff --git a/list_exceptions.yml b/list_exceptions.yml index 98d2f7c..b95e2e5 100644 --- a/list_exceptions.yml +++ b/list_exceptions.yml @@ -36,3 +36,6 @@ list_retry_datapatch: - { version: "12.1.0.2" , type : "PSU" , id : 210420 , retries : 2 } - { version: "12.1.0.2" , type : "BP" , id : 210420 , retries : 2 } - { version: "12.2.0.1" , type : "RU" , id : 210420 , retries : 1 } + - { version: "12.1.0.2" , type : "PSU" , id : 210720 , retries : 2 } + - { version: "12.1.0.2" , type : "BP" , id : 210720 , retries : 2 } + - { version: "12.2.0.1" , type : "RU" , id : 210720 , retries : 1 } diff --git a/list_patches.yml b/list_patches.yml index b83fef7..ac3094a 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -35,6 +35,7 @@ list_11204: - { type : "PSU" , id : 201020 , patch_number : 31537677 } - { type : "PSU" , id : 210119 , patch_number : 31983472 } - { type : "PSU" , id : 210420 , patch_number : 32328626 } + - { type : "PSU" , id : 210720 , patch_number : 32758711 } - { type : "OJVM" , id : 1 , patch_number : 19282021 } - { type : "OJVM" , id : 2 , patch_number : 19877440 } - { type : "OJVM" , id : 3 , patch_number : 20406239 } @@ -62,6 +63,7 @@ list_11204: - { type : "OJVM" , id : 201020 , patch_number : 31668908 } # - { type : "OJVM" , id : 210119 , patch_number : } - { type : "OJVM" , id : 210420 , patch_number : 32671980 } + - { type : "OJVM" , id : 210720 , patch_number : 32876451 } - { type : "BP" , id : 1 , patch_number : 17628025 , patch_folder : 17628006 } - { type : "BP" , id : 2 , patch_number : 17838803 , patch_folder : 17741631 } - { type : "BP" , id : 3 , patch_number : 17904156 , patch_folder : 17943261 } @@ -105,11 +107,15 @@ list_11204: - { type : "BP" , id : 201020 , patch_number : 31718644 , patch_folder : 31537652 } - { type : "BP" , id : 210119 , patch_number : 32131241 , patch_folder : 31983477 } - { type : "BP" , id : 210420 , patch_number : 32537095 , patch_folder : 32328629 } + - { type : "BP" , id : 210720 , patch_number : 32917411 , patch_folder : 32758732 } + #################### ##### 12.1.0.1 ##### #################### +# No more updates on this one. + list_12101: - { type : "PSU" , id : 1 , patch_number : 17027533 } - { type : "PSU" , id : 2 , patch_number : 17552800 } @@ -132,6 +138,8 @@ list_12101: - { type : "OJVM" , id : 160419 , patch_number : 22674703 } - { type : "OJVM" , id : 160719 , patch_number : 23177541 } +# No more updates on this one. + #################### ##### 12.1.0.2 ##### #################### @@ -167,6 +175,7 @@ list_12102: - { type : "PSU" , id : 201020 , patch_number : 31550110 } - { type : "PSU" , id : 210119 , patch_number : 31985579 } - { type : "PSU" , id : 210420 , patch_number : 32328635 } + - { type : "PSU" , id : 210720 , patch_number : 32768233 } - { type : "OJVM" , id : 1 , patch_number : 19282028 } - { type : "OJVM" , id : 2 , patch_number : 19877336 } - { type : "OJVM" , id : 3 , patch_number : 20415564 } @@ -194,6 +203,7 @@ list_12102: - { type : "OJVM" , id : 201020 , patch_number : 31668915 } - { type : "OJVM" , id : 210119 , patch_number : 32119956 } - { type : "OJVM" , id : 210420 , patch_number : 32473164 } + - { type : "OJVM" , id : 210720 , patch_number : 32876425 } - { type : "BP" , id : 1 , patch_number : 19404326 , patch_folder : 19189240 } - { type : "BP" , id : 2 , patch_number : 19774304 , patch_folder : 19649591 } - { type : "BP" , id : 3 , patch_number : 20026159 , patch_folder : 19878106 } @@ -230,6 +240,7 @@ list_12102: - { type : "BP" , id : 201020 , patch_number : 31718813 , patch_folder : 31511219 } - { type : "BP" , id : 210119 , patch_number : 32131231 , patch_folder : 31965033 } - { type : "BP" , id : 210420 , patch_number : 32518631 , patch_folder : 32328632 } + - { type : "BP" , id : 210720 , patch_number : 32917362 , patch_folder : 32768230 } #################### @@ -256,6 +267,7 @@ list_12201: - { type : "RU" , id : 201020 , patch_number : 31741641 } - { type : "RU" , id : 210119 , patch_number : 32228578 } - { type : "RU" , id : 210420 , patch_number : 32507738 } + - { type : "RU" , id : 210720 , patch_number : 32916808 } - { type : "RUR" , id : 171017 , patch_number : 26518812 , base_ru : JUL2017 } - { type : "RUR" , id : 180116 , patch_number : 27013506 , base_ru : JUL2017 } - { type : "RUR" , id : 180116 , patch_number : 27013510 , base_ru : OCT2017 } @@ -297,6 +309,7 @@ list_12201: - { type : "OJVM" , id : 201020 , patch_number : 31668898 } - { type : "OJVM" , id : 210119 , patch_number : 32119931 } - { type : "OJVM" , id : 210420 , patch_number : 32473172 } + - { type : "OJVM" , id : 210720 , patch_number : 32876409 } #################### ##### 18.0.0.0 ##### @@ -304,6 +317,8 @@ list_12201: # Database 18 Proactive Patch Information (Doc ID 2369376.1) +# No more updates on this one. + list_18000: - { type : "RU" , id : 2 , patch_number : 27676517 , base_snap : "18.1.0" } - { type : "RU" , id : 3 , patch_number : 28090523 , base_snap : "18.1.0" } @@ -355,6 +370,8 @@ list_18000: - { type : "OJVM" , id : 210119 , patch_number : 32119939 } - { type : "OJVM" , id : 210420 , patch_number : 32552752 } +# No more updates on this one. + #################### ##### 19.0.0.0 ##### #################### @@ -371,6 +388,7 @@ list_19000: - { type : "RU" , id : 9 , patch_number : 31771877 } - { type : "RU" , id : 10 , patch_number : 32218454 } - { type : "RU" , id : 11 , patch_number : 32545013 } + - { type : "RU" , id : 12 , patch_number : 32904851 } - { type : "RUR" , id : 1 , patch_number : 29799057 , base_ru : '19.3' } - { type : "RUR" , id : 2 , patch_number : 30087906 , base_ru : '19.3' } - { type : "RUR" , id : 1 , patch_number : 30080447 , base_ru : '19.4' } @@ -386,6 +404,9 @@ list_19000: - { type : "RUR" , id : 1 , patch_number : 32072711 , base_ru : '19.9' } - { type : "RUR" , id : 2 , patch_number : 32421507 , base_ru : '19.9' } - { type : "RUR" , id : 1 , patch_number : 32441092 , base_ru : '19.10' } + - { type : "RUR" , id : 2 , patch_number : 32819074 , base_ru : '19.10' } + - { type : "RUR" , id : 3 , patch_number : 32923627 , base_ru : '19.10' } + - { type : "RUR" , id : 1 , patch_number : 32844504 , base_ru : '19.11' } - { type : "OJVM" , id : 190416 , patch_number : 29548437 } - { type : "OJVM" , id : 190716 , patch_number : 29774421 } - { type : "OJVM" , id : 191015 , patch_number : 30128191 } @@ -395,3 +416,4 @@ list_19000: - { type : "OJVM" , id : 201020 , patch_number : 31668882 } - { type : "OJVM" , id : 210119 , patch_number : 32067171 } - { type : "OJVM" , id : 210420 , patch_number : 32399816 } + - { type : "OJVM" , id : 210720 , patch_number : 32876380 } \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml index 6d152f6..f32b0ec 100644 --- a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml +++ b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml @@ -1,3 +1,11 @@ +# For main.yml, the pre_prepare_dump_file.yml won't be called. +# So dump_stat_result may be false if the dump was created on this execution. +- name: "Check if {{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp exists" + stat: + path: "{{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp" + register: dump_stat_result + when: not dump_stat_result.stat.exists + # This dump_stat_result.stat.exists block is required only because this code is used # for both the extraction (main.yml), where the file obviusly exists, but also on the # loader_adb.yml. From 671855aec953c3528add7e5d6e9d43719dc5d76c Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 3 Aug 2021 17:00:24 -0300 Subject: [PATCH 019/229] Improvements. --- .../load_bugs_fixed_table.sql | 2 +- .../odbfcl/adb_load_expdp/adb_load_expdp.yml | 5 +- .../load_txtcollection_table.sql | 2 +- user_scripts/odbfcl/createUser.sql | 4 +- user_scripts/odbfcl/exchange_tables_adb.sql | 53 ++-- .../odbfcl/extract/create_hash_load_table.sql | 24 ++ user_scripts/odbfcl/extract/hashGet.sql | 6 + user_scripts/odbfcl/extract/load_code.sql | 293 ++++++++++++++++++ user_scripts/odbfcl/extract/load_source.sql | 4 +- user_scripts/odbfcl/extract/load_view.sql | 4 +- user_scripts/odbfcl/tables_create.sql | 24 +- 11 files changed, 383 insertions(+), 38 deletions(-) create mode 100644 user_scripts/odbfcl/extract/create_hash_load_table.sql create mode 100644 user_scripts/odbfcl/extract/load_code.sql diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql b/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql index 44fd924..be20362 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql @@ -3,7 +3,7 @@ WHENEVER SQLERROR EXIT SQL.SQLCODE -- TODO: CHANGE 2 QUERIES FOR 1 USING "INSERT ALL" insert /*+ append */ - into T_BUGS (BUG_ID, BUG_DESC) + into DM_BUGS (BUG_ID, BUG_DESC) select BUG_ID, BUG_DESC from ( select BUG_ID, diff --git a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml index f32b0ec..f93f92a 100644 --- a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml +++ b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml @@ -1,10 +1,9 @@ # For main.yml, the pre_prepare_dump_file.yml won't be called. # So dump_stat_result may be false if the dump was created on this execution. -- name: "Check if {{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp exists" +- name: "Check if {{ shared_folder }}/{{ dump_file_prefix }}.dmp exists" stat: - path: "{{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp" + path: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" register: dump_stat_result - when: not dump_stat_result.stat.exists # This dump_stat_result.stat.exists block is required only because this code is used # for both the extraction (main.yml), where the file obviusly exists, but also on the diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql b/user_scripts/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql index 63fa68c..69d56c2 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql @@ -5,7 +5,7 @@ UPDATE T_TXTCOLLECTION_LOAD SET MD5_HASH=SYS.DBMS_CRYPTO.HASH(CONTENTS,2); -- TODO: CHANGE 2 QUERIES FOR 1 USING "INSERT ALL" insert /*+ append */ - into T_CONTENTS (MD5_HASH, CONTENTS) + into DM_CONTENTS (MD5_HASH, CONTENTS) select MD5_HASH, CONTENTS from ( select MD5_HASH, diff --git a/user_scripts/odbfcl/createUser.sql b/user_scripts/odbfcl/createUser.sql index 56ad116..1739fe8 100644 --- a/user_scripts/odbfcl/createUser.sql +++ b/user_scripts/odbfcl/createUser.sql @@ -8,4 +8,6 @@ WHENEVER SQLERROR EXIT SQL.SQLCODE CREATE USER &1 IDENTIFIED BY "hash" DEFAULT TABLESPACE "USERS" TEMPORARY TABLESPACE "TEMP" QUOTA UNLIMITED ON "USERS"; GRANT CREATE SESSION TO &1.; -GRANT CREATE TABLE TO &1.; \ No newline at end of file +GRANT CREATE TABLE TO &1.; +-- For unwrapper: +GRANT CREATE PROCEDURE TO &1.; \ No newline at end of file diff --git a/user_scripts/odbfcl/exchange_tables_adb.sql b/user_scripts/odbfcl/exchange_tables_adb.sql index d2151e6..610abff 100644 --- a/user_scripts/odbfcl/exchange_tables_adb.sql +++ b/user_scripts/odbfcl/exchange_tables_adb.sql @@ -59,11 +59,12 @@ DECLARE P_TABLE_NAME IN VARCHAR2 ) RETURN VARCHAR2 IS - V_HV VARCHAR2(30); + V_HV VARCHAR2(50); BEGIN - SELECT MAX(DECODE(COLUMN_POSITION,1,DECODE(COLUMN_NAME,'ORASERIES',q'['&P_SER']','ORAVERSION',q'['&P_VERS']','ORAPATCH','&P_PATCH'),'')) || ', ' || - MAX(DECODE(COLUMN_POSITION,2,DECODE(COLUMN_NAME,'ORASERIES',q'['&P_SER']','ORAVERSION',q'['&P_VERS']','ORAPATCH','&P_PATCH'),'')) || ', ' || - MAX(DECODE(COLUMN_POSITION,3,DECODE(COLUMN_NAME,'ORASERIES',q'['&P_SER']','ORAVERSION',q'['&P_VERS']','ORAPATCH','&P_PATCH'),'')) + SELECT LISTAGG(DECODE(COLUMN_NAME,'ORASERIES',q'['&P_SER']','ORAVERSION',q'['&P_VERS']','ORAPATCH','&P_PATCH'),', ') WITHIN GROUP(ORDER BY COLUMN_POSITION) + -- MAX(DECODE(COLUMN_POSITION,1,DECODE(COLUMN_NAME,'ORASERIES',q'['&P_SER']','ORAVERSION',q'['&P_VERS']','ORAPATCH','&P_PATCH'),'')) || ', ' || + -- MAX(DECODE(COLUMN_POSITION,2,DECODE(COLUMN_NAME,'ORASERIES',q'['&P_SER']','ORAVERSION',q'['&P_VERS']','ORAPATCH','&P_PATCH'),'')) || ', ' || + -- MAX(DECODE(COLUMN_POSITION,3,DECODE(COLUMN_NAME,'ORASERIES',q'['&P_SER']','ORAVERSION',q'['&P_VERS']','ORAPATCH','&P_PATCH'),'')) INTO V_HV FROM ALL_PART_KEY_COLUMNS WHERE OWNER=P_OWNER @@ -120,31 +121,37 @@ BEGIN CONTINUE; END IF; - V_HV := GEN_PART_HV(V_OWNER,I.TABLE_NAME); + V_OWNER_TNAME := DBMS_ASSERT.ENQUOTE_NAME(V_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME); - -- Null V_HV = Non-partitioned table. - - IF V_HV IS NOT NULL - THEN - V_PNAME := GET_PART_NAME(V_OWNER,I.TABLE_NAME,V_HV); - END IF; + V_HV := GEN_PART_HV(V_OWNER,I.TABLE_NAME); + -- DBMS_OUTPUT.PUT_LINE('V_HV: ' || V_HV); - V_OWNER_TNAME := DBMS_ASSERT.ENQUOTE_NAME(V_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME); + -- NULL V_HV = Non-partitioned table. - IF V_PNAME IS NOT NULL AND V_HV IS NOT NULL - THEN - RUN_CMD('ALTER TABLE ' || V_OWNER_TNAME || ' EXCHANGE PARTITION ' || DBMS_ASSERT.ENQUOTE_NAME(V_PNAME) || ' WITH TABLE ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' INCLUDING INDEXES WITH VALIDATION'); - ELSIF I.TABLE_NAME = 'T_CONTENTS' - THEN - RUN_CMD('INSERT /*+ APPEND */ INTO ' || V_OWNER_TNAME || ' SELECT * FROM ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' A WHERE NOT EXISTS (SELECT 1 FROM ' || V_OWNER_TNAME || ' B WHERE A.MD5_HASH = B.MD5_HASH)'); - ELSIF I.TABLE_NAME = 'T_BUGS' + IF V_HV IS NULL THEN - RUN_CMD('INSERT /*+ APPEND */ INTO ' || V_OWNER_TNAME || ' SELECT * FROM ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' A WHERE NOT EXISTS (SELECT 1 FROM ' || V_OWNER_TNAME || ' B WHERE A.BUG_ID = B.BUG_ID)'); + IF I.TABLE_NAME = 'DM_CONTENTS' + THEN + RUN_CMD('INSERT /*+ APPEND */ INTO ' || V_OWNER_TNAME || ' SELECT * FROM ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' A WHERE NOT EXISTS (SELECT 1 FROM ' || V_OWNER_TNAME || ' B WHERE A.MD5_HASH = B.MD5_HASH)'); + ELSIF I.TABLE_NAME = 'DM_BUGS' + THEN + RUN_CMD('INSERT /*+ APPEND */ INTO ' || V_OWNER_TNAME || ' SELECT * FROM ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' A WHERE NOT EXISTS (SELECT 1 FROM ' || V_OWNER_TNAME || ' B WHERE A.BUG_ID = B.BUG_ID)'); + ELSIF I.TABLE_NAME = 'DM_CODES' + THEN + RUN_CMD('INSERT /*+ APPEND */ INTO ' || V_OWNER_TNAME || ' SELECT * FROM ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' A WHERE NOT EXISTS (SELECT 1 FROM ' || V_OWNER_TNAME || ' B WHERE A.MD5_HASH = B.MD5_HASH)'); + ELSE + RAISE_APPLICATION_ERROR(-20000,'Unknown Table'); + END IF; ELSE - -- V_CMD := 'INSERT /*+ APPEND */ INTO ' || V_OWNER_TNAME || ' SELECT * FROM ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME); - RUN_CMD('ALTER TABLE ' || V_OWNER_TNAME || ' ADD PARTITION VALUES ( ' || V_HV || ' )'); V_PNAME := GET_PART_NAME(V_OWNER,I.TABLE_NAME,V_HV); - RUN_CMD('ALTER TABLE ' || V_OWNER_TNAME || ' EXCHANGE PARTITION ' || DBMS_ASSERT.ENQUOTE_NAME(V_PNAME) || ' WITH TABLE ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' INCLUDING INDEXES WITH VALIDATION'); + IF V_PNAME IS NOT NULL + THEN + RUN_CMD('ALTER TABLE ' || V_OWNER_TNAME || ' EXCHANGE PARTITION ' || DBMS_ASSERT.ENQUOTE_NAME(V_PNAME) || ' WITH TABLE ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' INCLUDING INDEXES WITH VALIDATION'); + ELSE + RUN_CMD('ALTER TABLE ' || V_OWNER_TNAME || ' ADD PARTITION VALUES ( ' || V_HV || ' )'); + V_PNAME := GET_PART_NAME(V_OWNER,I.TABLE_NAME,V_HV); + RUN_CMD('ALTER TABLE ' || V_OWNER_TNAME || ' EXCHANGE PARTITION ' || DBMS_ASSERT.ENQUOTE_NAME(V_PNAME) || ' WITH TABLE ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' INCLUDING INDEXES WITH VALIDATION'); + END IF; END IF; END LOOP; END; diff --git a/user_scripts/odbfcl/extract/create_hash_load_table.sql b/user_scripts/odbfcl/extract/create_hash_load_table.sql new file mode 100644 index 0000000..a816c17 --- /dev/null +++ b/user_scripts/odbfcl/extract/create_hash_load_table.sql @@ -0,0 +1,24 @@ +WHENEVER SQLERROR EXIT SQL.SQLCODE + +BEGIN + EXECUTE IMMEDIATE 'DROP TABLE T_HASH_LOAD PURGE'; +EXCEPTION + WHEN OTHERS THEN + IF SQLCODE != -942 THEN + RAISE; + END IF; +END; +/ + +CREATE TABLE "T_HASH_LOAD" +( + "OWNER" VARCHAR2(128 CHAR), + "NAME" VARCHAR2(128 CHAR), + "TYPE" VARCHAR2(12 CHAR), + "ORIGIN_CON_ID" NUMBER, + "CON_ID" NUMBER, + "MD5_ENC" RAW(16) NOT NULL, + "SHA1_ENC" RAW(20) NOT NULL, + "CODE" CLOB NOT NULL +) +COMPRESS NOLOGGING; \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/hashGet.sql b/user_scripts/odbfcl/extract/hashGet.sql index 23188d0..459c3eb 100644 --- a/user_scripts/odbfcl/extract/hashGet.sql +++ b/user_scripts/odbfcl/extract/hashGet.sql @@ -36,12 +36,18 @@ BEGIN END; / +PRO CREATE TABLE FOR HASH_LOAD +@@create_hash_load_table.sql + PRO CDB/DBA_SOURCE @@load_source.sql PRO CDB/DBA_VIEWS @@load_view.sql +PRO LOAD HASH/CODE TABLES +@@load_code.sql + PRO Some CDB/DBA Views @@load_dba_cdb.sql diff --git a/user_scripts/odbfcl/extract/load_code.sql b/user_scripts/odbfcl/extract/load_code.sql new file mode 100644 index 0000000..fb59996 --- /dev/null +++ b/user_scripts/odbfcl/extract/load_code.sql @@ -0,0 +1,293 @@ +WHENEVER SQLERROR EXIT SQL.SQLCODE + +-- TODO: CHANGE 2 QUERIES FOR 1 USING "INSERT ALL" + +insert /*+ append */ + into DM_CODES (MD5_HASH, CODE, WRAPPED) +select MD5_ENC, + CODE, + CASE + WHEN REGEXP_INSTR(CODE, 'wrapped', 1, 1, 0, 'i') > 0 + AND REGEXP_INSTR(CODE, 'abcd', 1, 1, 0, 'i') > 0 + THEN 'Y' + ELSE 'N' + END WRAPPED +from ( + select MD5_ENC, + CODE, + RANK() over (partition by MD5_ENC order by rowid asc) col_ind + from T_HASH_LOAD +) +where col_ind=1; + +insert /*+ append */ + into T_HASH (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_ENC, SHA1_ENC, ORAVERSION, ORASERIES, ORAPATCH) +select OWNER, + NAME, + TYPE, + ORIGIN_CON_ID, + CON_ID, + MD5_ENC, + SHA1_ENC, + '&P_VERS.' oraversion, + '&P_SER.' oraseries, + &P_PATCH. orapatch +from T_HASH_LOAD; + +commit; + +drop table T_HASH_LOAD purge; + +--------------------------------------------- +------------ SECTION START ------------ +------------ UNWRAP WRAPPED CODE ------------ +--------------------------------------------- + +set def ^ + +create or replace java source named CUX_UNWRAPPER +as +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.Reader; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.util.zip.Deflater; +import java.util.zip.InflaterInputStream; +import oracle.jdbc.OracleDriver; +import oracle.sql.CLOB; + +public class UNWRAPPER { + //unzip + public static CLOB Inflate(CLOB src) throws IOException, SQLException { + StringBuffer sb = new StringBuffer(); + String s = src.stringValue(); + try{ + ByteArrayInputStream bis = + new ByteArrayInputStream(decodeHex(s.toCharArray())); + //ByteArrayInputStream bis = new ByteArrayInputStream(src); + InflaterInputStream iis = new InflaterInputStream(bis); + for (int c = iis.read(); c != -1; c = iis.read()) { + sb.append((char)c); + } + }catch (Exception e) + { + e.printStackTrace(); + } + + Connection conn = DriverManager.getConnection("jdbc:default:connection:"); + CLOB clob = CLOB.createTemporary(conn, false, CLOB.DURATION_SESSION); + clob.setString(1, sb.toString()); + return clob; + + } + + public static byte[] Deflate(String src, int quality) { + try { + byte[] tmp = new byte[src.length() + 100]; + Deflater defl = new Deflater(quality); + defl.setInput(src.getBytes("UTF-8")); + defl.finish(); + int cnt = defl.deflate(tmp); + byte[] res = new byte[cnt]; + for (int i = 0; i < cnt; i++) + res = tmp; + return res; + } catch (Exception e) { + } + return null; + } + + public static int toDigit(char ch, int index) { + int digit = Character.digit(ch, 16); + if (digit == -1) { + throw new RuntimeException("illegal hexadecimal character " + ch + + " at index " + index); + } + return digit; + } + + //16-ary string to byte array + public static byte[] decodeHex(char[] data) { + int len = data.length; + if ((len & 0x01) != 0) { + throw new RuntimeException("odd number of characters "); + } + + byte[] out = new byte[len >> 1]; + + for (int i = 0, j = 0; j < len; i++) { + int f = toDigit(data[j], j) << 4; + j++; + f = f | toDigit(data[j], j); + j++; + out[i] = (byte)(f & 0xFF); + } + + return out; + } +} +/ + +ALTER JAVA SOURCE CUX_UNWRAPPER COMPILE +/ + +CREATE OR REPLACE PACKAGE CUX_UNWRAPPER IS + FUNCTION UNWRAP(P_CLOB IN CLOB) RETURN CLOB; +END; +/ + +create or replace package body cux_unwrapper is + + --unzip + function inflate(src in clob) return clob as + language java name 'UNWRAPPER.Inflate( oracle.sql.CLOB ) return oracle.sql.CLOB'; + + --Decrypt the main program + function unwrap(p_clob IN CLOB) return clob AS + + l_wrap varchar2(32767); + + l_inf clob; + l_res clob; + l_src clob; + l_inflate varchar2(32767); + l_temp VARCHAR2(32767); + l_bt varchar2(32767); + l_text varchar2(32767); + l_char varchar2(2); + l_len number; + l_slen integer; + l_offset integer := 1; + l_chunk_len integer := 10080; + + --Decryption byte comparison dictionary table + l_dict varchar2(512) := '3D6585B318DBE287F152AB634BB5A05F' || + '7D687B9B24C228678ADEA4261E03EB17' || + '6F343E7A3FD2A96A0FE935561FB14D10' || + '78D975F6BC4104816106F9ADD6D5297E' || + '869E79E505BA84CC6E278EB05DA8F39F' || + 'D0A271B858DD2C38994C480755E4538C' || + '46B62DA5AF322240DC50C3A1258B9C16' || + '605CCFFD0C981CD4376D3C3A30E86C31' || + '47F533DA43C8E35E1994ECE6A39514E0' || + '9D64FA5915C52FCABB0BDFF297BF0A76' || + 'B449445A1DF0009621807F1A82394FC1' || + 'A7D70DD1D8FF139370EE5BEFBE09B977' || + '72E7B254B72AC7739066200E51EDF87C' || + '8F2EF412C62B83CDACCB3BC44EC06936' || + '6202AE88FCAA4208A64557D39ABDE123' || + '8D924A1189746B91FBFEC901EA1BF7CE'; + l_sl varchar2(512) := '000102030405060708090A0B0C0D0E0F' || + '101112131415161718191A1B1C1D1E1F' || + '202122232425262728292A2B2C2D2E2F' || + '303132333435363738393A3B3C3D3E3F' || + '404142434445464748494A4B4C4D4E4F' || + '505152535455565758595A5B5C5D5E5F' || + '606162636465666768696A6B6C6D6E6F' || + '707172737475767778797A7B7C7D7E7F' || + '808182838485868788898A8B8C8D8E8F' || + '909192939495969798999A9B9C9D9E9F' || + 'A0A1A2A3A4A5A6A7A8A9AAABACADAEAF' || + 'B0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF' || + 'C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF' || + 'D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF' || + 'E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF' || + 'F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF'; + BEGIN + dbms_lob.createtemporary(lob_loc => l_inf, + cache => TRUE, + dur => dbms_lob.session); + --Get package ciphertext + l_src := p_clob; + + --out_put('source:<'||l_src||'>'); + l_src := substr(l_src, regexp_instr(l_src, 'wrapped', 1, 1, 0, 'i')); + l_src := rtrim(substr(l_src, instr(l_src, chr(10), 1, 20) + 1), chr(10)); + l_src := replace(l_src, chr(10), ''); + --dbms_output.put_line('source:<'||l_src||'>'); + --l_src:=substr(l_src,41); + + --base64 decoding + l_len := dbms_lob.getlength(l_src); + while l_offset < l_len loop + if (l_len - l_offset) < 10080 then + l_chunk_len := (l_len - l_offset); + end if; + l_temp := dbms_lob.substr(l_src, l_chunk_len, l_offset); + l_bt := utl_encode.base64_decode(utl_raw.cast_to_raw(l_temp)); + + if l_bt is not null then + if l_offset = 1 then + -- Remove the first 40 hash strings + l_bt := substr(l_bt, 41); + end if; + -- l_wrap := l_wrap || l_bt; + -- dictionary table conversion + l_bt := utl_raw.translate(l_bt, l_sl, l_dict); + + l_offset := l_offset + l_chunk_len; + -- l_inflate := l_inflate || l_bt; + dbms_lob.writeappend(l_inf, length(l_bt), l_bt); + end if; + + end loop; + + /* dbms_output.put_line('base:' || l_wrap); + dbms_output.put_line('<' || l_inflate || '>');*/ + + --unzip + l_res := inflate(l_inf); + return l_res; + END unwrap; +END; +/ + +set def & + +--------------------------------------------- +------------ SECTION END ------------ +------------ UNWRAP WRAPPED CODE ------------ +--------------------------------------------- + +-- Create unwrapped table +create table DM_CODES_LOAD AS +select SYS.DBMS_CRYPTO.HASH(UNCODE,2) MD5_HASH, + MD5_HASH MD5_HASH_WRAPPED, + UNCODE CODE, + 'N' WRAPPED +from ( select cux_unwrapper.unwrap(code) uncode, MD5_HASH + from DM_CODES + where WRAPPED='Y'); + +-- Load back into DM_CODES +insert /*+ append */ + into DM_CODES (MD5_HASH, CODE, WRAPPED) +select MD5_HASH, + CODE, + 'N' WRAPPED +from ( select MD5_HASH, + CODE, + RANK() over (partition by MD5_HASH order by rowid asc) col_ind + from DM_CODES_LOAD +) +where col_ind=1; + +commit; + +-- Update DM_CODES +update DM_CODES T1 SET T1.MD5_HASH_UNWRAPPED = + (SELECT T2.MD5_HASH + FROM DM_CODES_LOAD T2 + WHERE T2.MD5_HASH_WRAPPED=T1.MD5_HASH) +WHERE T1.WRAPPED = 'Y'; + +commit; + +drop table DM_CODES_LOAD purge; + +drop package cux_unwrapper; + +drop java source CUX_UNWRAPPER; \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/load_source.sql b/user_scripts/odbfcl/extract/load_source.sql index 06ad860..4c4000d 100644 --- a/user_scripts/odbfcl/extract/load_source.sql +++ b/user_scripts/odbfcl/extract/load_source.sql @@ -37,9 +37,9 @@ BEGIN LOOP VCODE := VCODE || I.TEXT; IF I.LINE = I.LAST_LINE THEN - INSERT INTO &v_username..T_HASH (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_ENC, SHA1_ENC, ORAVERSION, ORASERIES, ORAPATCH, CODE) + INSERT INTO &v_username..T_HASH_LOAD (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_ENC, SHA1_ENC, CODE) VALUES - (I.OWNER, I.NAME, I.TYPE, I.ORIGIN_CON_ID, I.CON_ID, SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_MD5), SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_SH1), VVERS, VSER, VPATCH, VCODE); + (I.OWNER, I.NAME, I.TYPE, I.ORIGIN_CON_ID, I.CON_ID, SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_MD5), SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_SH1), VCODE); VCODE := ''; -- Zera a variável END IF; END LOOP; diff --git a/user_scripts/odbfcl/extract/load_view.sql b/user_scripts/odbfcl/extract/load_view.sql index cf0c65f..57e818e 100644 --- a/user_scripts/odbfcl/extract/load_view.sql +++ b/user_scripts/odbfcl/extract/load_view.sql @@ -83,9 +83,9 @@ BEGIN VCODE := UPPER(I.TEXT); VCODE := replaceClob(VCODE,'[[:space:]]*',''); -- Remove all space characters VCODE := replaceClob(VCODE,'"',''); -- Remove all quotes - INSERT INTO &v_username..T_HASH (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_ENC, SHA1_ENC, ORAVERSION, ORASERIES, ORAPATCH, CODE) + INSERT INTO &v_username..T_HASH_LOAD (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_ENC, SHA1_ENC, CODE) VALUES - (I.OWNER, I.NAME, I.TYPE, I.ORIGIN_CON_ID, I.CON_ID, SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_MD5), SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_SH1), VVERS, VSER, VPATCH, I.TEXT); + (I.OWNER, I.NAME, I.TYPE, I.ORIGIN_CON_ID, I.CON_ID, SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_MD5), SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_SH1), I.TEXT); END LOOP; DELETE FROM PLAN_TABLE WHERE STATEMENT_ID = VSID; diff --git a/user_scripts/odbfcl/tables_create.sql b/user_scripts/odbfcl/tables_create.sql index 1c17c91..b0bae8d 100644 --- a/user_scripts/odbfcl/tables_create.sql +++ b/user_scripts/odbfcl/tables_create.sql @@ -705,13 +705,14 @@ CREATE TABLE "T_HASH" "CON_ID" NUMBER, "MD5_ENC" RAW(16) NOT NULL, "SHA1_ENC" RAW(20) NOT NULL, -"CODE" CLOB NOT NULL, "ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, "ORASERIES" VARCHAR2(10 CHAR) NOT NULL, "ORAPATCH" NUMBER NOT NULL ) COMPRESS NOLOGGING; +COMMENT ON COLUMN T_HASH.MD5_ENC IS 'Join with DM_CODES on MD5_HASH column.'; + CREATE TABLE "T_FILES" ( "PATH" VARCHAR2(500 CHAR), @@ -743,6 +744,8 @@ CREATE TABLE "T_TXTCOLLECTION" ) COMPRESS NOLOGGING; +COMMENT ON COLUMN T_TXTCOLLECTION.MD5_HASH IS 'Join with DM_CONTENTS on MD5_HASH column.'; + CREATE TABLE "T_BUGSFIXED" ( "BUG_ID" NUMBER NOT NULL, @@ -757,19 +760,30 @@ COMPRESS NOLOGGING; ----------------------------------------------------- ----------------------------------------------------- -CREATE TABLE "T_CONTENTS" +CREATE TABLE "DM_CONTENTS" ( "MD5_HASH" RAW(16) NOT NULL, "CONTENTS" CLOB NOT NULL, -CONSTRAINT T_CONTENTS_PK PRIMARY KEY ("MD5_HASH") +CONSTRAINT DM_CONTENTS_PK PRIMARY KEY ("MD5_HASH") ) COMPRESS NOLOGGING; -CREATE TABLE "T_BUGS" +CREATE TABLE "DM_BUGS" ( "BUG_ID" NUMBER NOT NULL, "BUG_DESC" VARCHAR2(1000 CHAR) NOT NULL, -CONSTRAINT T_BUGS_PK PRIMARY KEY ("BUG_ID") +CONSTRAINT DM_BUGS_PK PRIMARY KEY ("BUG_ID") +) +COMPRESS NOLOGGING; + +CREATE TABLE "DM_CODES" +( +"MD5_HASH" RAW(16) NOT NULL, +"MD5_HASH_UNWRAPPED" RAW(16) NULL, +"CODE" CLOB NOT NULL, +"WRAPPED" VARCHAR2(1 CHAR) NOT NULL CHECK ("WRAPPED" IN ('Y','N')), +CONSTRAINT DM_CODES_PK PRIMARY KEY ("MD5_HASH"), +CONSTRAINT DM_CODES_FK FOREIGN KEY ("MD5_HASH") REFERENCES DM_CODES ("MD5_HASH") ) COMPRESS NOLOGGING; From 8e63e113559a705c658f39eb1511dd82db2dbe1b Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 16 Aug 2021 16:42:44 -0300 Subject: [PATCH 020/229] Preparing to accept 21c load --- config_main.yml | 3 + list_patches.yml | 8 +- list_versions.yml | 1 + main.yml | 3 + tasks/patch_main.yml | 7 +- tasks/patch_tasks_pre.yml | 3 +- .../create_sqlldr_symbols_table.sql | 2 +- .../odbfcl/extract/create_hash_load_table.sql | 4 +- user_scripts/odbfcl/extract/load_code.sql | 24 +-- user_scripts/odbfcl/tables_create.sql | 140 +++++++++--------- user_scripts/odbfcl/tables_recreate_adb.sql | 2 +- 11 files changed, 108 insertions(+), 89 deletions(-) diff --git a/config_main.yml b/config_main.yml index 8b61b61..d7e8aa8 100644 --- a/config_main.yml +++ b/config_main.yml @@ -6,3 +6,6 @@ skip_dump_exists: true # If true, will only deploy the patch and skip the expdp and the pre/post steps. only_deploy_patch: false + +# Target DB version where dumps will be imported +target_db_version: 19 # Used to check if version parameter will be required on expdp \ No newline at end of file diff --git a/list_patches.yml b/list_patches.yml index ac3094a..68b0ebb 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -416,4 +416,10 @@ list_19000: - { type : "OJVM" , id : 201020 , patch_number : 31668882 } - { type : "OJVM" , id : 210119 , patch_number : 32067171 } - { type : "OJVM" , id : 210420 , patch_number : 32399816 } - - { type : "OJVM" , id : 210720 , patch_number : 32876380 } \ No newline at end of file + - { type : "OJVM" , id : 210720 , patch_number : 32876380 } + +#################### +##### 21.0.0.0 ##### +#################### + +list_21000: diff --git a/list_versions.yml b/list_versions.yml index be5485d..585e772 100644 --- a/list_versions.yml +++ b/list_versions.yml @@ -13,6 +13,7 @@ list_versions: - { id : "12.2.0.1" , patch_list : "list_12201" , main_file : "patch_main.yml" , vmachine : "Oracle Linux 6.8" , base_snap : "12.2.0.1 Ready" , opatch_file : "p6880880_200000_Linux-x86-64.zip" , ip : "192.168.56.101" } - { id : "18.0.0.0" , patch_list : "list_18000" , main_file : "patch_main.yml" , vmachine : "Oracle Linux 6.8" , base_snap : "18.0.0.0 Ready" , opatch_file : "p6880880_200000_Linux-x86-64.zip" , ip : "192.168.56.101" } - { id : "19.0.0.0" , patch_list : "list_19000" , main_file : "patch_main.yml" , vmachine : "Oracle Linux 7.6" , base_snap : "19.0.0.0 Ready" , opatch_file : "p6880880_200000_Linux-x86-64.zip" , ip : "192.168.56.102" } + - { id : "21.0.0.0" , patch_list : "list_21000" , main_file : "patch_main.yml" , vmachine : "Oracle Linux 8" , base_snap : "21.0.0.0 Ready" , opatch_file : "p6880880_200000_Linux-x86-64.zip" , ip : "192.168.56.102" } list_info_oci: - { id : "11.2.0.4" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" } diff --git a/main.yml b/main.yml index 724983b..c02c949 100644 --- a/main.yml +++ b/main.yml @@ -57,3 +57,6 @@ - include: tasks/main_RU_RUR.yml db_version="19.0.0.0" when: param_version is undefined or param_version == "19.0.0.0" + + - include: tasks/main_RU_RUR.yml db_version="21.0.0.0" + when: param_version is undefined or param_version == "21.0.0.0" diff --git a/tasks/patch_main.yml b/tasks/patch_main.yml index 923041c..bd25f9a 100644 --- a/tasks/patch_main.yml +++ b/tasks/patch_main.yml @@ -72,9 +72,14 @@ loop_control: loop_var: script_param + - name: Set version parameter for expdp + set_fact: + expdp_version: "version={{ target_db_version }}" + when: db_version.split('.')[1] > target_db_version + - name: Export Database Tables shell: | - {{ dbhome_locl }}/bin/expdp userid={{ dump_user_int }}/{{ dump_pass }} directory=expdir compression=all dumpfile={{ dump_file_prefix }}.dmp logfile={{ dump_file_prefix }}.log content=data_only schemas={{ dump_user_int }} + {{ dbhome_locl }}/bin/expdp userid={{ dump_user_int }}/{{ dump_pass }} directory=expdir compression=all dumpfile={{ dump_file_prefix }}.dmp logfile={{ dump_file_prefix }}.log content=data_only schemas={{ dump_user_int }} {{ expdp_version }} environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" diff --git a/tasks/patch_tasks_pre.yml b/tasks/patch_tasks_pre.yml index 0871390..c4217e7 100644 --- a/tasks/patch_tasks_pre.yml +++ b/tasks/patch_tasks_pre.yml @@ -1,11 +1,12 @@ - name: "Processing {{ db_version }} {{ patch.type }} {{ patch.id }} - Patch {{ patch.patch_number }}" debug: msg="Processing {{ db_version }} {{ patch.type }} {{ patch.id }} - Patch {{ patch.patch_number }}" -- name : Define dump file name +- name : Define dump file name and parameters set_fact: dump_file_prefix: "tables_{{ db_version }}_{{ patch.base_ru | default('')}}{{ patch.type }}_{{ patch.id }}" skip_all: false fix_datapatch_retries: 0 + expdp_version: "" # Ignore dumpfile checks when only_deploy_patch is true - block: diff --git a/user_scripts/odbfcl/adb_load_symbols/create_sqlldr_symbols_table.sql b/user_scripts/odbfcl/adb_load_symbols/create_sqlldr_symbols_table.sql index 6357f94..d41caa3 100644 --- a/user_scripts/odbfcl/adb_load_symbols/create_sqlldr_symbols_table.sql +++ b/user_scripts/odbfcl/adb_load_symbols/create_sqlldr_symbols_table.sql @@ -13,7 +13,7 @@ END; CREATE TABLE T_SYMBOLS_LOAD ( SOURCE_FILE VARCHAR2(50) NOT NULL, - FILE_NAME VARCHAR2(100) NOT NULL, + FILE_NAME VARCHAR2(200) NOT NULL, SYMBOL_TYPE VARCHAR2(1) NOT NULL, SYMBOL_NAME VARCHAR2(500) NOT NULL ) diff --git a/user_scripts/odbfcl/extract/create_hash_load_table.sql b/user_scripts/odbfcl/extract/create_hash_load_table.sql index a816c17..191d384 100644 --- a/user_scripts/odbfcl/extract/create_hash_load_table.sql +++ b/user_scripts/odbfcl/extract/create_hash_load_table.sql @@ -1,7 +1,7 @@ WHENEVER SQLERROR EXIT SQL.SQLCODE BEGIN - EXECUTE IMMEDIATE 'DROP TABLE T_HASH_LOAD PURGE'; + EXECUTE IMMEDIATE 'DROP TABLE &v_username.."T_HASH_LOAD" PURGE'; EXCEPTION WHEN OTHERS THEN IF SQLCODE != -942 THEN @@ -10,7 +10,7 @@ EXCEPTION END; / -CREATE TABLE "T_HASH_LOAD" +CREATE TABLE &v_username.."T_HASH_LOAD" ( "OWNER" VARCHAR2(128 CHAR), "NAME" VARCHAR2(128 CHAR), diff --git a/user_scripts/odbfcl/extract/load_code.sql b/user_scripts/odbfcl/extract/load_code.sql index fb59996..2903dbb 100644 --- a/user_scripts/odbfcl/extract/load_code.sql +++ b/user_scripts/odbfcl/extract/load_code.sql @@ -3,7 +3,7 @@ WHENEVER SQLERROR EXIT SQL.SQLCODE -- TODO: CHANGE 2 QUERIES FOR 1 USING "INSERT ALL" insert /*+ append */ - into DM_CODES (MD5_HASH, CODE, WRAPPED) + into &v_username..DM_CODES (MD5_HASH, CODE, WRAPPED) select MD5_ENC, CODE, CASE @@ -16,12 +16,12 @@ from ( select MD5_ENC, CODE, RANK() over (partition by MD5_ENC order by rowid asc) col_ind - from T_HASH_LOAD + from &v_username..T_HASH_LOAD ) where col_ind=1; insert /*+ append */ - into T_HASH (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_ENC, SHA1_ENC, ORAVERSION, ORASERIES, ORAPATCH) + into &v_username..T_HASH (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_ENC, SHA1_ENC, ORAVERSION, ORASERIES, ORAPATCH) select OWNER, NAME, TYPE, @@ -32,11 +32,11 @@ select OWNER, '&P_VERS.' oraversion, '&P_SER.' oraseries, &P_PATCH. orapatch -from T_HASH_LOAD; +from &v_username..T_HASH_LOAD; commit; -drop table T_HASH_LOAD purge; +drop table &v_username..T_HASH_LOAD purge; --------------------------------------------- ------------ SECTION START ------------ @@ -253,40 +253,40 @@ set def & --------------------------------------------- -- Create unwrapped table -create table DM_CODES_LOAD AS +create table &v_username..DM_CODES_LOAD AS select SYS.DBMS_CRYPTO.HASH(UNCODE,2) MD5_HASH, MD5_HASH MD5_HASH_WRAPPED, UNCODE CODE, 'N' WRAPPED from ( select cux_unwrapper.unwrap(code) uncode, MD5_HASH - from DM_CODES + from &v_username..DM_CODES where WRAPPED='Y'); -- Load back into DM_CODES insert /*+ append */ - into DM_CODES (MD5_HASH, CODE, WRAPPED) + into &v_username..DM_CODES (MD5_HASH, CODE, WRAPPED) select MD5_HASH, CODE, 'N' WRAPPED from ( select MD5_HASH, CODE, RANK() over (partition by MD5_HASH order by rowid asc) col_ind - from DM_CODES_LOAD + from &v_username..DM_CODES_LOAD ) where col_ind=1; commit; -- Update DM_CODES -update DM_CODES T1 SET T1.MD5_HASH_UNWRAPPED = +update &v_username..DM_CODES T1 SET T1.MD5_HASH_UNWRAPPED = (SELECT T2.MD5_HASH - FROM DM_CODES_LOAD T2 + FROM &v_username..DM_CODES_LOAD T2 WHERE T2.MD5_HASH_WRAPPED=T1.MD5_HASH) WHERE T1.WRAPPED = 'Y'; commit; -drop table DM_CODES_LOAD purge; +drop table &v_username..DM_CODES_LOAD purge; drop package cux_unwrapper; diff --git a/user_scripts/odbfcl/tables_create.sql b/user_scripts/odbfcl/tables_create.sql index b0bae8d..69d7dfa 100644 --- a/user_scripts/odbfcl/tables_create.sql +++ b/user_scripts/odbfcl/tables_create.sql @@ -58,7 +58,7 @@ WHENEVER SQLERROR EXIT SQL.SQLCODE CREATE TABLE "T_PARAMETER" ( -"NAME" VARCHAR2(80 CHAR), +"NAME" VARCHAR2(80 CHAR) NOT NULL, "TYPE" NUMBER, "DEFAULT_VALUE" VARCHAR2(255 CHAR), "ISSES_MODIFIABLE" VARCHAR2(5 CHAR), @@ -77,9 +77,9 @@ COMPRESS NOLOGGING; CREATE TABLE "T_PARAMETER_VALID_VALUES" ( -"NAME" VARCHAR2(80 CHAR), +"NAME" VARCHAR2(80 CHAR) NOT NULL, "ORDINAL" NUMBER, -"VALUE" VARCHAR2(255 CHAR), +"VALUE" VARCHAR2(255 CHAR) NOT NULL, "ISDEFAULT" VARCHAR2(64 CHAR), "CON_ID" NUMBER, "ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, @@ -93,7 +93,7 @@ CREATE TABLE "T_SYSSTAT" "STATISTIC#" NUMBER, "NAME" VARCHAR2(64 CHAR), "CLASS" NUMBER, -"STAT_ID" NUMBER, +"STAT_ID" NUMBER NOT NULL, "CON_ID" NUMBER, "ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, "ORASERIES" VARCHAR2(10 CHAR) NOT NULL, @@ -103,7 +103,7 @@ COMPRESS NOLOGGING; CREATE TABLE "T_SYS_TIME_MODEL" ( -"STAT_ID" NUMBER, +"STAT_ID" NUMBER NOT NULL, "STAT_NAME" VARCHAR2(64 CHAR), "CON_ID" NUMBER, "ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, @@ -115,7 +115,7 @@ COMPRESS NOLOGGING; CREATE TABLE "T_EVENT_NAME" ( "EVENT#" NUMBER, -"EVENT_ID" NUMBER, +"EVENT_ID" NUMBER NOT NULL, "NAME" VARCHAR2(64 CHAR), "PARAMETER1" VARCHAR2(64 CHAR), "PARAMETER2" VARCHAR2(64 CHAR), @@ -133,8 +133,8 @@ COMPRESS NOLOGGING; CREATE TABLE "T_XTABCOLS" ( -"TABLE_NAME" VARCHAR2(128 CHAR), -"COLUMN_NAME" VARCHAR2(128 CHAR), +"TABLE_NAME" VARCHAR2(128 CHAR) NOT NULL, +"COLUMN_NAME" VARCHAR2(128 CHAR) NOT NULL, "COLUMN_TYPE" NUMBER, "CON_ID" NUMBER, "ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, @@ -145,10 +145,10 @@ COMPRESS NOLOGGING; CREATE TABLE "T_OBJECTS" ( -"OWNER" VARCHAR2(128 CHAR), -"OBJECT_NAME" VARCHAR2(128 CHAR), +"OWNER" VARCHAR2(128 CHAR) NOT NULL, +"OBJECT_NAME" VARCHAR2(128 CHAR) NOT NULL, "SUBOBJECT_NAME" VARCHAR2(128 CHAR), -"OBJECT_TYPE" VARCHAR2(23 CHAR), +"OBJECT_TYPE" VARCHAR2(23 CHAR) NOT NULL, "TEMPORARY" VARCHAR2(1 CHAR), "GENERATED" VARCHAR2(1 CHAR), "SECONDARY" VARCHAR2(1 CHAR), @@ -170,9 +170,9 @@ COMPRESS NOLOGGING; CREATE TABLE "T_TAB_COLUMNS" ( -"OWNER" VARCHAR2(128 CHAR), -"TABLE_NAME" VARCHAR2(128 CHAR), -"COLUMN_NAME" VARCHAR2(128 CHAR), +"OWNER" VARCHAR2(128 CHAR) NOT NULL, +"TABLE_NAME" VARCHAR2(128 CHAR) NOT NULL, +"COLUMN_NAME" VARCHAR2(128 CHAR) NOT NULL, "DATA_TYPE" VARCHAR2(128 CHAR), "DATA_TYPE_MOD" VARCHAR2(3 CHAR), "DATA_TYPE_OWNER" VARCHAR2(128 CHAR), @@ -197,7 +197,7 @@ COMPRESS NOLOGGING; CREATE TABLE "T_FIXED_TABLE" ( -"NAME" VARCHAR2(128 CHAR), +"NAME" VARCHAR2(128 CHAR) NOT NULL, "TYPE" VARCHAR2(5 CHAR), "CON_ID" NUMBER, "ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, @@ -208,7 +208,7 @@ COMPRESS NOLOGGING; CREATE TABLE "T_FIXED_VIEW_DEFINITION" ( -"VIEW_NAME" VARCHAR2(128 CHAR), +"VIEW_NAME" VARCHAR2(128 CHAR) NOT NULL, "VIEW_DEFINITION" VARCHAR2(4000 CHAR), "CON_ID" NUMBER, "ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, @@ -219,7 +219,7 @@ COMPRESS NOLOGGING; CREATE TABLE "T_USERS" ( -"USERNAME" VARCHAR2(128 CHAR), +"USERNAME" VARCHAR2(128 CHAR) NOT NULL, "USER_ID" NUMBER, "ACCOUNT_STATUS" VARCHAR2(32 CHAR), "DEFAULT_TABLESPACE" VARCHAR2(30 CHAR), @@ -247,7 +247,7 @@ COMPRESS NOLOGGING; CREATE TABLE "T_ROLES" ( -"ROLE" VARCHAR2(128 CHAR), +"ROLE" VARCHAR2(128 CHAR) NOT NULL, "PASSWORD_REQUIRED" VARCHAR2(8 CHAR), "AUTHENTICATION_TYPE" VARCHAR2(11 CHAR), "COMMON" VARCHAR2(3 CHAR), @@ -280,8 +280,8 @@ COMPRESS NOLOGGING; CREATE TABLE "T_TRIGGERS" ( -"OWNER" VARCHAR2(128 CHAR), -"TRIGGER_NAME" VARCHAR2(128 CHAR), +"OWNER" VARCHAR2(128 CHAR) NOT NULL, +"TRIGGER_NAME" VARCHAR2(128 CHAR) NOT NULL, "TRIGGER_TYPE" VARCHAR2(16 CHAR), "TRIGGERING_EVENT" VARCHAR2(246 CHAR), "TABLE_OWNER" VARCHAR2(128 CHAR), @@ -323,14 +323,14 @@ COMPRESS NOLOGGING; CREATE TABLE "T_AUDIT_UNIFIED_POLICIES" ( -"POLICY_NAME" VARCHAR2(128 CHAR), -"AUDIT_CONDITION" VARCHAR2(4000 CHAR), -"CONDITION_EVAL_OPT" VARCHAR2(9 CHAR), -"AUDIT_OPTION" VARCHAR2(128 CHAR), -"AUDIT_OPTION_TYPE" VARCHAR2(18 CHAR), -"OBJECT_SCHEMA" VARCHAR2(128 CHAR), -"OBJECT_NAME" VARCHAR2(128 CHAR), -"OBJECT_TYPE" VARCHAR2(23 CHAR), +"POLICY_NAME" VARCHAR2(128 CHAR) NOT NULL, +"AUDIT_CONDITION" VARCHAR2(4000 CHAR) NOT NULL, +"CONDITION_EVAL_OPT" VARCHAR2(9 CHAR) NOT NULL, +"AUDIT_OPTION" VARCHAR2(128 CHAR) NOT NULL, +"AUDIT_OPTION_TYPE" VARCHAR2(18 CHAR) NOT NULL, +"OBJECT_SCHEMA" VARCHAR2(128 CHAR) NOT NULL, +"OBJECT_NAME" VARCHAR2(128 CHAR) NOT NULL, +"OBJECT_TYPE" VARCHAR2(23 CHAR) NOT NULL, "COMMON" VARCHAR2(3 CHAR), "INHERITED" VARCHAR2(3 CHAR), "CON_ID" NUMBER, @@ -342,12 +342,12 @@ COMPRESS NOLOGGING; CREATE TABLE "T_COL_PRIVS" ( -"GRANTEE" VARCHAR2(128 CHAR), -"OWNER" VARCHAR2(128 CHAR), -"TABLE_NAME" VARCHAR2(128 CHAR), -"COLUMN_NAME" VARCHAR2(128 CHAR), +"GRANTEE" VARCHAR2(128 CHAR) NOT NULL, +"OWNER" VARCHAR2(128 CHAR) NOT NULL, +"TABLE_NAME" VARCHAR2(128 CHAR) NOT NULL, +"COLUMN_NAME" VARCHAR2(128 CHAR) NOT NULL, "GRANTOR" VARCHAR2(128 CHAR), -"PRIVILEGE" VARCHAR2(40 CHAR), +"PRIVILEGE" VARCHAR2(40 CHAR) NOT NULL, "GRANTABLE" VARCHAR2(3 CHAR), "COMMON" VARCHAR2(3 CHAR), "INHERITED" VARCHAR2(3 CHAR), @@ -360,8 +360,8 @@ COMPRESS NOLOGGING; CREATE TABLE "T_SCHEDULER_PROGRAMS" ( -"OWNER" VARCHAR2(128 CHAR), -"PROGRAM_NAME" VARCHAR2(128 CHAR), +"OWNER" VARCHAR2(128 CHAR) NOT NULL, +"PROGRAM_NAME" VARCHAR2(128 CHAR) NOT NULL, "PROGRAM_TYPE" VARCHAR2(16 CHAR), "PROGRAM_ACTION" VARCHAR2(4000 CHAR), "NUMBER_OF_ARGUMENTS" NUMBER, @@ -388,7 +388,7 @@ CREATE TABLE "T_JOBS" "JOB" NUMBER, "LOG_USER" VARCHAR2(128 CHAR), "PRIV_USER" VARCHAR2(128 CHAR), -"SCHEMA_USER" VARCHAR2(128 CHAR), +"SCHEMA_USER" VARCHAR2(128 CHAR) NOT NULL, "LAST_DATE" DATE, "LAST_SEC" VARCHAR2(8 CHAR), "THIS_DATE" DATE, @@ -399,7 +399,7 @@ CREATE TABLE "T_JOBS" "BROKEN" VARCHAR2(1 CHAR), "INTERVAL" VARCHAR2(200 CHAR), "FAILURES" NUMBER, -"WHAT" VARCHAR2(4000 CHAR), +"WHAT" VARCHAR2(4000 CHAR) NOT NULL, "NLS_ENV" VARCHAR2(4000 CHAR), "MISC_ENV" RAW(32), "INSTANCE" NUMBER, @@ -412,11 +412,11 @@ COMPRESS NOLOGGING; CREATE TABLE "T_TAB_PRIVS" ( -"GRANTEE" VARCHAR2(128 CHAR), -"OWNER" VARCHAR2(128 CHAR), -"TABLE_NAME" VARCHAR2(128 CHAR), +"GRANTEE" VARCHAR2(128 CHAR) NOT NULL, +"OWNER" VARCHAR2(128 CHAR) NOT NULL, +"TABLE_NAME" VARCHAR2(128 CHAR) NOT NULL, "GRANTOR" VARCHAR2(128 CHAR), -"PRIVILEGE" VARCHAR2(40 CHAR), +"PRIVILEGE" VARCHAR2(40 CHAR) NOT NULL, "GRANTABLE" VARCHAR2(3 CHAR), "HIERARCHY" VARCHAR2(3 CHAR), "COMMON" VARCHAR2(3 CHAR), @@ -433,7 +433,7 @@ CREATE TABLE "T_PRIV_AUDIT_OPTS" ( "USER_NAME" VARCHAR2(128 CHAR), "PROXY_NAME" VARCHAR2(128 CHAR), -"PRIVILEGE" VARCHAR2(40 CHAR), +"PRIVILEGE" VARCHAR2(40 CHAR) NOT NULL, "SUCCESS" VARCHAR2(10 CHAR), "FAILURE" VARCHAR2(10 CHAR), "CON_ID" NUMBER, @@ -445,8 +445,8 @@ COMPRESS NOLOGGING; CREATE TABLE "T_TS_QUOTAS" ( -"TABLESPACE_NAME" VARCHAR2(30 CHAR), -"USERNAME" VARCHAR2(128 CHAR), +"TABLESPACE_NAME" VARCHAR2(30 CHAR) NOT NULL, +"USERNAME" VARCHAR2(128 CHAR) NOT NULL, "BYTES" NUMBER, "MAX_BYTES" NUMBER, "BLOCKS" NUMBER, @@ -461,9 +461,9 @@ COMPRESS NOLOGGING; CREATE TABLE "T_OBJ_AUDIT_OPTS" ( -"OWNER" VARCHAR2(128 CHAR), -"OBJECT_NAME" VARCHAR2(128 CHAR), -"OBJECT_TYPE" VARCHAR2(23 CHAR), +"OWNER" VARCHAR2(128 CHAR) NOT NULL, +"OBJECT_NAME" VARCHAR2(128 CHAR) NOT NULL, +"OBJECT_TYPE" VARCHAR2(23 CHAR) NOT NULL, "ALT" VARCHAR2(3 CHAR), "AUD" VARCHAR2(3 CHAR), "COM" VARCHAR2(3 CHAR), @@ -492,7 +492,7 @@ CREATE TABLE "T_STMT_AUDIT_OPTS" ( "USER_NAME" VARCHAR2(128 CHAR), "PROXY_NAME" VARCHAR2(128 CHAR), -"AUDIT_OPTION" VARCHAR2(40 CHAR), +"AUDIT_OPTION" VARCHAR2(40 CHAR) NOT NULL, "SUCCESS" VARCHAR2(10 CHAR), "FAILURE" VARCHAR2(10 CHAR), "CON_ID" NUMBER, @@ -504,10 +504,10 @@ COMPRESS NOLOGGING; CREATE TABLE "T_POLICIES" ( -"OBJECT_OWNER" VARCHAR2(128 CHAR), +"OBJECT_OWNER" VARCHAR2(128 CHAR) NOT NULL, "OBJECT_NAME" VARCHAR2(128 CHAR), "POLICY_GROUP" VARCHAR2(128 CHAR), -"POLICY_NAME" VARCHAR2(128 CHAR), +"POLICY_NAME" VARCHAR2(128 CHAR) NOT NULL, "PF_OWNER" VARCHAR2(128 CHAR), "PACKAGE" VARCHAR2(128 CHAR), "FUNCTION" VARCHAR2(128 CHAR), @@ -532,8 +532,8 @@ COMPRESS NOLOGGING; CREATE TABLE "T_ROLE_PRIVS" ( -"GRANTEE" VARCHAR2(128 CHAR), -"GRANTED_ROLE" VARCHAR2(128 CHAR), +"GRANTEE" VARCHAR2(128 CHAR) NOT NULL, +"GRANTED_ROLE" VARCHAR2(128 CHAR) NOT NULL, "ADMIN_OPTION" VARCHAR2(3 CHAR), "DELEGATE_OPTION" VARCHAR2(3 CHAR), "DEFAULT_ROLE" VARCHAR2(3 CHAR), @@ -548,11 +548,11 @@ COMPRESS NOLOGGING; CREATE TABLE "T_JAVA_POLICY" ( -"KIND" VARCHAR2(8 CHAR), -"GRANTEE" VARCHAR2(128 CHAR), -"TYPE_SCHEMA" VARCHAR2(128 CHAR), -"TYPE_NAME" VARCHAR2(4000 CHAR), -"NAME" VARCHAR2(4000 CHAR), +"KIND" VARCHAR2(8 CHAR) NOT NULL, +"GRANTEE" VARCHAR2(128 CHAR) NOT NULL, +"TYPE_SCHEMA" VARCHAR2(128 CHAR) NOT NULL, +"TYPE_NAME" VARCHAR2(4000 CHAR) NOT NULL, +"NAME" VARCHAR2(4000 CHAR) NOT NULL, "ACTION" VARCHAR2(4000 CHAR), "ENABLED" VARCHAR2(8 CHAR), "SEQ" NUMBER, @@ -565,8 +565,8 @@ COMPRESS NOLOGGING; CREATE TABLE "T_SCHEDULER_JOBS" ( -"OWNER" VARCHAR2(128 CHAR), -"JOB_NAME" VARCHAR2(128 CHAR), +"OWNER" VARCHAR2(128 CHAR) NOT NULL, +"JOB_NAME" VARCHAR2(128 CHAR) NOT NULL, "JOB_SUBNAME" VARCHAR2(128 CHAR), "JOB_STYLE" VARCHAR2(17 CHAR), "JOB_CREATOR" VARCHAR2(128 CHAR), @@ -669,8 +669,8 @@ COMPRESS NOLOGGING; CREATE TABLE "T_SYS_PRIVS" ( -"GRANTEE" VARCHAR2(128 CHAR), -"PRIVILEGE" VARCHAR2(40 CHAR), +"GRANTEE" VARCHAR2(128 CHAR) NOT NULL, +"PRIVILEGE" VARCHAR2(40 CHAR) NOT NULL, "ADMIN_OPTION" VARCHAR2(3 CHAR), "COMMON" VARCHAR2(3 CHAR), "INHERITED" VARCHAR2(3 CHAR), @@ -683,8 +683,8 @@ COMPRESS NOLOGGING; CREATE TABLE "T_SYNONYMS" ( -"OWNER" VARCHAR2(128 CHAR), -"SYNONYM_NAME" VARCHAR2(128 CHAR), +"OWNER" VARCHAR2(128 CHAR) NOT NULL, +"SYNONYM_NAME" VARCHAR2(128 CHAR) NOT NULL, "TABLE_OWNER" VARCHAR2(128 CHAR), "TABLE_NAME" VARCHAR2(128 CHAR), "DB_LINK" VARCHAR2(128 CHAR), @@ -698,9 +698,9 @@ COMPRESS NOLOGGING; CREATE TABLE "T_HASH" ( -"OWNER" VARCHAR2(128 CHAR), -"NAME" VARCHAR2(128 CHAR), -"TYPE" VARCHAR2(12 CHAR), +"OWNER" VARCHAR2(128 CHAR) NOT NULL, +"NAME" VARCHAR2(128 CHAR) NOT NULL, +"TYPE" VARCHAR2(12 CHAR) NOT NULL, "ORIGIN_CON_ID" NUMBER, "CON_ID" NUMBER, "MD5_ENC" RAW(16) NOT NULL, @@ -715,7 +715,7 @@ COMMENT ON COLUMN T_HASH.MD5_ENC IS 'Join with DM_CODES on MD5_HASH column.'; CREATE TABLE "T_FILES" ( -"PATH" VARCHAR2(500 CHAR), +"PATH" VARCHAR2(500 CHAR) NOT NULL, "SHA256_ENC" RAW(32), "ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, "ORASERIES" VARCHAR2(10 CHAR) NOT NULL, @@ -725,8 +725,8 @@ COMPRESS NOLOGGING; CREATE TABLE "T_SYMBOLS" ( -"FILE_NAME" VARCHAR2(100 CHAR), -"SYMBOL_TYPE" VARCHAR2(1 CHAR), +"FILE_NAME" VARCHAR2(200 CHAR) NOT NULL, +"SYMBOL_TYPE" VARCHAR2(1 CHAR) NOT NULL, "SYMBOL_NAME" VARCHAR2(500 CHAR), "ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, "ORASERIES" VARCHAR2(10 CHAR) NOT NULL, @@ -736,7 +736,7 @@ COMPRESS NOLOGGING; CREATE TABLE "T_TXTCOLLECTION" ( -"PATH" VARCHAR2(500 CHAR), +"PATH" VARCHAR2(500 CHAR) NOT NULL, "MD5_HASH" RAW(16), "ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, "ORASERIES" VARCHAR2(10 CHAR) NOT NULL, diff --git a/user_scripts/odbfcl/tables_recreate_adb.sql b/user_scripts/odbfcl/tables_recreate_adb.sql index 3002584..8d630d8 100644 --- a/user_scripts/odbfcl/tables_recreate_adb.sql +++ b/user_scripts/odbfcl/tables_recreate_adb.sql @@ -23,7 +23,7 @@ BEGIN FOR I IN (SELECT TABLE_NAME FROM SYS.ALL_TABLES WHERE OWNER='HASH' - AND TABLE_NAME LIKE 'T\_%' ESCAPE '\' + AND (TABLE_NAME LIKE 'T\_%' ESCAPE '\' OR TABLE_NAME LIKE 'DM\_%' ESCAPE '\') ORDER BY 1) LOOP V_CMD := 'CREATE TABLE ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' FOR EXCHANGE WITH TABLE ' || DBMS_ASSERT.ENQUOTE_NAME('HASH') || '.' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME); From 20cd996be18f4e096e9188b0206d9b5118e1d02d Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 24 Aug 2021 21:22:16 -0300 Subject: [PATCH 021/229] Minor improvements --- tasks/impdp_file_adb.yml | 47 ++++++++++++--------- tasks/main_loader_adb.yml | 4 +- user_scripts/odbfcl/exchange_tables_adb.sql | 2 + 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/tasks/impdp_file_adb.yml b/tasks/impdp_file_adb.yml index 3650e53..1baf520 100644 --- a/tasks/impdp_file_adb.yml +++ b/tasks/impdp_file_adb.yml @@ -1,25 +1,32 @@ -- name: "Processing {{ db_version }} {{ patch.type }} {{ patch.id }}" - debug: msg="Processing {{ db_version }} {{ patch.type }} {{ patch.id }}" +# Skip processing only if param_patch and param_type filters are defined +- block: -# User custom pre-scripts -- include: run_script.yml - loop: "{{ user_impdp_pre | flatten(levels=1) }}" - loop_control: - loop_var: script_param - when: user_impdp_pre is defined + - name: "Processing {{ db_version }} {{ patch.type }} {{ patch.id }}" + debug: msg="Processing {{ db_version }} {{ patch.type }} {{ patch.id }}" -# The impdp loader are the same steps executed after the expdp -- include: run_script.yml - loop: "{{ user_expdp_post | flatten(levels=1) }}" - loop_control: - loop_var: script_param - when: user_expdp_post is defined + # User custom pre-scripts + - include: run_script.yml + loop: "{{ user_impdp_pre | flatten(levels=1) }}" + loop_control: + loop_var: script_param + when: user_impdp_pre is defined -# User custom post-scripts -- include: run_script.yml - loop: "{{ user_impdp_post | flatten(levels=1) }}" - loop_control: - loop_var: script_param - when: user_impdp_post is defined + # The impdp loader are the same steps executed after the expdp + - include: run_script.yml + loop: "{{ user_expdp_post | flatten(levels=1) }}" + loop_control: + loop_var: script_param + when: user_expdp_post is defined + + # User custom post-scripts + - include: run_script.yml + loop: "{{ user_impdp_post | flatten(levels=1) }}" + loop_control: + loop_var: script_param + when: user_impdp_post is defined + + when: + - param_type is undefined or param_type == patch.type + - param_patch is undefined or (param_patch | int) == patch.id # Skip all is true when dump file is already generated and skip_dump_exists is true at config. \ No newline at end of file diff --git a/tasks/main_loader_adb.yml b/tasks/main_loader_adb.yml index 2fde1a7..798f615 100644 --- a/tasks/main_loader_adb.yml +++ b/tasks/main_loader_adb.yml @@ -33,7 +33,7 @@ vars: filter_qry: "[?type=='RU'].id" -# Execute for every PSU +# Execute for every PSU, BP and OJVM if has a single PSU - include: "impdp_file_adb.yml patch={{ item }}" with_items: - { type : PSU , id : 0 } @@ -46,7 +46,7 @@ - { type : BP , id : 0 } when: total_bps != "0" -# Execute for every RU +# Execute for every RU, RUR and OJVM if has a single RU - include: "impdp_file_adb.yml patch={{ item }}" with_items: - "{{ lookup('vars', patch_list) | flatten(levels=1) }}" diff --git a/user_scripts/odbfcl/exchange_tables_adb.sql b/user_scripts/odbfcl/exchange_tables_adb.sql index 610abff..23d7b3a 100644 --- a/user_scripts/odbfcl/exchange_tables_adb.sql +++ b/user_scripts/odbfcl/exchange_tables_adb.sql @@ -157,4 +157,6 @@ BEGIN END; / +EXEC DBMS_MVIEW.REFRESH('MV_VERSIONS'); + EXIT 0 From 96bba1461ad271bf39644857b26ab9e6b64a4fd2 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 15 Sep 2021 18:30:18 -0300 Subject: [PATCH 022/229] Renamed "ENC" to "HASH" --- user_scripts/gen/create_hash_source.sql | 2 +- user_scripts/gen/create_hash_view.sql | 2 +- user_scripts/load/change_all_hash_code.sql | 12 ++++++------ user_scripts/load/fileLoad.sh | 4 ++-- user_scripts/load/insert_all_hash.sql | 16 ++++++++-------- user_scripts/load/insert_all_privs_code.sql | 2 +- .../load_bugs_fixed_table.sql | 14 ++------------ .../adb_load_filechksum/load_chksum_table.sql | 2 +- user_scripts/odbfcl/exchange_tables_adb.sql | 3 +++ .../odbfcl/extract/create_hash_load_table.sql | 4 ++-- user_scripts/odbfcl/extract/load_code.sql | 12 ++++++------ user_scripts/odbfcl/extract/load_source.sql | 2 +- user_scripts/odbfcl/extract/load_view.sql | 2 +- user_scripts/odbfcl/tables_create.sql | 9 +++++---- user_scripts/tables_create.sql | 4 ++-- 15 files changed, 42 insertions(+), 48 deletions(-) diff --git a/user_scripts/gen/create_hash_source.sql b/user_scripts/gen/create_hash_source.sql index 126d4ca..cd38375 100644 --- a/user_scripts/gen/create_hash_source.sql +++ b/user_scripts/gen/create_hash_source.sql @@ -37,7 +37,7 @@ BEGIN LOOP VCODE := VCODE || I.TEXT; IF I.LINE = I.LAST_LINE THEN - INSERT INTO T_HASH (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_ENC, SHA1_ENC, SERIES, ORAVERSION, PSU, CODE) + INSERT INTO T_HASH (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_HASH, SHA1_HASH, SERIES, ORAVERSION, PSU, CODE) VALUES (I.OWNER, I.NAME, I.TYPE, I.ORIGIN_CON_ID, I.CON_ID, SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_MD5), SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_SH1), VSER, VVERS, VPSU, VCODE); VCODE := ''; -- Zera a variável diff --git a/user_scripts/gen/create_hash_view.sql b/user_scripts/gen/create_hash_view.sql index af0d82e..b6c94d2 100644 --- a/user_scripts/gen/create_hash_view.sql +++ b/user_scripts/gen/create_hash_view.sql @@ -85,7 +85,7 @@ BEGIN VCODE := UPPER(I.TEXT); VCODE := replaceClob(VCODE,'[[:space:]]*',''); -- Remove all space characters VCODE := replaceClob(VCODE,'"',''); -- Remove all quotes - INSERT INTO T_HASH (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_ENC, SHA1_ENC, SERIES, ORAVERSION, PSU, CODE) + INSERT INTO T_HASH (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_HASH, SHA1_HASH, SERIES, ORAVERSION, PSU, CODE) VALUES (I.OWNER, I.NAME, I.TYPE, I.ORIGIN_CON_ID, I.CON_ID, SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_MD5), SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_SH1), VSER, VVERS, VPSU, I.TEXT); diff --git a/user_scripts/load/change_all_hash_code.sql b/user_scripts/load/change_all_hash_code.sql index 9fd2f30..17bd47e 100755 --- a/user_scripts/load/change_all_hash_code.sql +++ b/user_scripts/load/change_all_hash_code.sql @@ -81,7 +81,7 @@ DECLARE end; -- [[:graph:]] should be replaced by [A-Z][a-z][0-9]_$+=# BEGIN - FOR I IN (SELECT T_HASH_F.ROWID,T_HASH_F.*,T2.CODE REALCODE FROM T_HASH_F, (SELECT SHA1_ENC, CODE, RANK() OVER(PARTITION BY SHA1_ENC ORDER BY ROWID ASC) LIN FROM T_HASH) T2 WHERE T_HASH_F.SHA1_ENC = T2.SHA1_ENC AND T2.LIN=1 + FOR I IN (SELECT T_HASH_F.ROWID,T_HASH_F.*,T2.CODE REALCODE FROM T_HASH_F, (SELECT SHA1_HASH, CODE, RANK() OVER(PARTITION BY SHA1_HASH ORDER BY ROWID ASC) LIN FROM T_HASH) T2 WHERE T_HASH_F.SHA1_HASH = T2.SHA1_HASH AND T2.LIN=1 AND T_HASH_F.TYPE <> 'VIEW') LOOP VCODE := I.REALCODE; -- Zera a variável @@ -126,8 +126,8 @@ BEGIN IF VCODE <> I.REALCODE THEN UPDATE T_HASH_F - SET MD5_ENC = SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_MD5), - SHA1_ENC = SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_SH1) + SET MD5_HASH = SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_MD5), + SHA1_HASH = SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_SH1) WHERE ROWID = I.ROWID; END IF; IF VNAME <> I.NAME THEN @@ -199,7 +199,7 @@ DECLARE end; BEGIN - FOR I IN (SELECT T_HASH_F.ROWID,T_HASH_F.*,T2.CODE REALCODE FROM T_HASH_F, (SELECT SHA1_ENC, CODE, RANK() OVER(PARTITION BY SHA1_ENC ORDER BY ROWID ASC) LIN FROM T_HASH) T2 WHERE T_HASH_F.SHA1_ENC = T2.SHA1_ENC AND T2.LIN=1 + FOR I IN (SELECT T_HASH_F.ROWID,T_HASH_F.*,T2.CODE REALCODE FROM T_HASH_F, (SELECT SHA1_HASH, CODE, RANK() OVER(PARTITION BY SHA1_HASH ORDER BY ROWID ASC) LIN FROM T_HASH) T2 WHERE T_HASH_F.SHA1_HASH = T2.SHA1_HASH AND T2.LIN=1 AND T_HASH_F.TYPE = 'VIEW') LOOP VREALCODE := UPPER(I.REALCODE); @@ -218,8 +218,8 @@ BEGIN IF VCODE <> VREALCODE THEN UPDATE T_HASH_F - SET MD5_ENC = SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_MD5), - SHA1_ENC = SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_SH1) + SET MD5_HASH = SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_MD5), + SHA1_HASH = SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_SH1) WHERE ROWID = I.ROWID; END IF; IF VNAME <> I.NAME THEN diff --git a/user_scripts/load/fileLoad.sh b/user_scripts/load/fileLoad.sh index 716291a..498ce9f 100755 --- a/user_scripts/load/fileLoad.sh +++ b/user_scripts/load/fileLoad.sh @@ -55,13 +55,13 @@ BEGIN EXECUTE IMMEDIATE 'DROP TABLE T_FILES PURGE'; EXCEPTION WHEN OTHERS THEN N CREATE TABLE T_FILES ( PATH VARCHAR2(500), - SHA256_ENC RAW(32), + SHA256_HASH RAW(32), SERIES VARCHAR2(10), ORAVERSION VARCHAR2(20), PSU NUMBER) COMPRESS NOLOGGING; -insert /*+ append */ into T_FILES (PATH, SHA256_ENC, ORAVERSION, SERIES, PSU) +insert /*+ append */ into T_FILES (PATH, SHA256_HASH, ORAVERSION, SERIES, PSU) select path, hash, substr(file_name,instr(file_name,'_',1,1)+1,instr(file_name,'_',1,2)-instr(file_name,'_',1,1)-1) oraversion, diff --git a/user_scripts/load/insert_all_hash.sql b/user_scripts/load/insert_all_hash.sql index 72f5675..2aaea8c 100755 --- a/user_scripts/load/insert_all_hash.sql +++ b/user_scripts/load/insert_all_hash.sql @@ -3,20 +3,20 @@ @@insert_all_privs_clean "T_FILES" --------------------------------------------------- -alter table T_HASH modify (code null, md5_enc null,sha1_enc null); +alter table T_HASH modify (code null, md5_hash null,sha1_hash null); var v_table_cols clob var v_table_id_cols clob var v_print_cols clob def v_table_name = "T_HASH" ---exec :v_table_cols := 'owner, name, type, origin_con_id, md5_enc, sha1_enc'; -exec :v_table_cols := 'owner, name, type, sha1_enc'; +--exec :v_table_cols := 'owner, name, type, origin_con_id, md5_hash, sha1_hash'; +exec :v_table_cols := 'owner, name, type, sha1_hash'; exec :v_table_id_cols := 'owner, name, type, con_id, oraversion, hash_line_id'; -def v_hash_col_id = "sha1_enc" +def v_hash_col_id = "sha1_hash" def v_print_table = "&&v_table_name." -exec :v_print_cols := 'owner, name_comp, type, con_id, sha1_enc'; +exec :v_print_cols := 'owner, name_comp, type, con_id, sha1_hash'; def v_file_pref = 'db' def v_srczip_pref = 'db' @@ -33,12 +33,12 @@ var v_table_id_cols clob var v_print_cols clob def v_table_name = "T_FILES" -exec :v_table_cols := 'path, sha256_enc'; +exec :v_table_cols := 'path, sha256_hash'; exec :v_table_id_cols := 'path, con_id, oraversion, hash_line_id'; -def v_hash_col_id = "sha256_enc" +def v_hash_col_id = "sha256_hash" def v_print_table = "&&v_table_name." -exec :v_print_cols := 'path, con_id, sha256_enc'; +exec :v_print_cols := 'path, con_id, sha256_hash'; def v_file_pref = 'files' def v_srczip_pref = 'files.all' diff --git a/user_scripts/load/insert_all_privs_code.sql b/user_scripts/load/insert_all_privs_code.sql index a717ad4..6041137 100755 --- a/user_scripts/load/insert_all_privs_code.sql +++ b/user_scripts/load/insert_all_privs_code.sql @@ -277,7 +277,7 @@ and not exists (select 1 commit; -- Analisar isso: oracle/net/ano/a em t_hash ou o output da query: --- select * from t_hash_final t1, t_hash_final t2 where t1.hash_line_id=t2.hash_line_id and t1.series <> 'OJVM' and t2.series='OJVM' and t1.sha1_enc=t2.sha1_enc and t1.flag='A' and t2.flag='A'; +-- select * from t_hash_final t1, t_hash_final t2 where t1.hash_line_id=t2.hash_line_id and t1.series <> 'OJVM' and t2.series='OJVM' and t1.sha1_hash=t2.sha1_hash and t1.flag='A' and t2.flag='A'; delete from &&v_table_final. a where series = 'OJVM' and PSU_FROM = (select min(c.PSU_FROM) from &&v_table_final. c where c.series = a.series and c.oraversion=a.oraversion and c.PSU_FROM>=0) diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql b/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql index be20362..f5886e9 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql @@ -3,20 +3,10 @@ WHENEVER SQLERROR EXIT SQL.SQLCODE -- TODO: CHANGE 2 QUERIES FOR 1 USING "INSERT ALL" insert /*+ append */ - into DM_BUGS (BUG_ID, BUG_DESC) -select BUG_ID, BUG_DESC -from ( - select BUG_ID, - BUG_DESC, - RANK() over (partition by BUG_ID order by rowid asc) col_ind - from T_BUGSFIXED_LOAD -) -where col_ind=1; - -insert /*+ append */ - into T_BUGSFIXED (BUG_ID, PATCH_ID, ORAVERSION, ORASERIES, ORAPATCH) + into T_BUGSFIXED (BUG_ID, PATCH_ID, BUG_DESC, ORAVERSION, ORASERIES, ORAPATCH) select BUG_ID, PATCH_ID, + BUG_DESC, substr(file_name,instr(file_name,'_',1,1)+1,instr(file_name,'_',1,2)-instr(file_name,'_',1,1)-1) oraversion, substr(file_name,instr(file_name,'_',1,2)+1,instr(file_name,'_',1,3)-instr(file_name,'_',1,2)-1) oraseries, to_number(substr(file_name,instr(file_name,'_',1,3)+1,instr(file_name,'.',-1)-instr(file_name,'_',1,3)-1)) orapatch diff --git a/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql b/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql index bb4c00d..7660881 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql +++ b/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql @@ -1,6 +1,6 @@ WHENEVER SQLERROR EXIT SQL.SQLCODE -insert /*+ append */ into T_FILES (PATH, SHA256_ENC, ORAVERSION, ORASERIES, ORAPATCH) +insert /*+ append */ into T_FILES (PATH, SHA256_HASH, ORAVERSION, ORASERIES, ORAPATCH) select path, hash, substr(file_name,instr(file_name,'_',1,1)+1,instr(file_name,'_',1,2)-instr(file_name,'_',1,1)-1) oraversion, diff --git a/user_scripts/odbfcl/exchange_tables_adb.sql b/user_scripts/odbfcl/exchange_tables_adb.sql index 23d7b3a..93eaa86 100644 --- a/user_scripts/odbfcl/exchange_tables_adb.sql +++ b/user_scripts/odbfcl/exchange_tables_adb.sql @@ -158,5 +158,8 @@ END; / EXEC DBMS_MVIEW.REFRESH('MV_VERSIONS'); +EXEC DBMS_MVIEW.REFRESH('MV_PARAMETERS'); +EXEC DBMS_MVIEW.REFRESH('MV_OBJECTS'); +EXEC DBMS_MVIEW.REFRESH('MV_FILES'); EXIT 0 diff --git a/user_scripts/odbfcl/extract/create_hash_load_table.sql b/user_scripts/odbfcl/extract/create_hash_load_table.sql index 191d384..ec2d455 100644 --- a/user_scripts/odbfcl/extract/create_hash_load_table.sql +++ b/user_scripts/odbfcl/extract/create_hash_load_table.sql @@ -17,8 +17,8 @@ CREATE TABLE &v_username.."T_HASH_LOAD" "TYPE" VARCHAR2(12 CHAR), "ORIGIN_CON_ID" NUMBER, "CON_ID" NUMBER, - "MD5_ENC" RAW(16) NOT NULL, - "SHA1_ENC" RAW(20) NOT NULL, + "MD5_HASH" RAW(16) NOT NULL, + "SHA1_HASH" RAW(20) NOT NULL, "CODE" CLOB NOT NULL ) COMPRESS NOLOGGING; \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/load_code.sql b/user_scripts/odbfcl/extract/load_code.sql index 2903dbb..dd2b218 100644 --- a/user_scripts/odbfcl/extract/load_code.sql +++ b/user_scripts/odbfcl/extract/load_code.sql @@ -4,7 +4,7 @@ WHENEVER SQLERROR EXIT SQL.SQLCODE insert /*+ append */ into &v_username..DM_CODES (MD5_HASH, CODE, WRAPPED) -select MD5_ENC, +select MD5_HASH, CODE, CASE WHEN REGEXP_INSTR(CODE, 'wrapped', 1, 1, 0, 'i') > 0 @@ -13,22 +13,22 @@ select MD5_ENC, ELSE 'N' END WRAPPED from ( - select MD5_ENC, + select MD5_HASH, CODE, - RANK() over (partition by MD5_ENC order by rowid asc) col_ind + RANK() over (partition by MD5_HASH order by rowid asc) col_ind from &v_username..T_HASH_LOAD ) where col_ind=1; insert /*+ append */ - into &v_username..T_HASH (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_ENC, SHA1_ENC, ORAVERSION, ORASERIES, ORAPATCH) + into &v_username..T_HASH (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_HASH, SHA1_HASH, ORAVERSION, ORASERIES, ORAPATCH) select OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, - MD5_ENC, - SHA1_ENC, + MD5_HASH, + SHA1_HASH, '&P_VERS.' oraversion, '&P_SER.' oraseries, &P_PATCH. orapatch diff --git a/user_scripts/odbfcl/extract/load_source.sql b/user_scripts/odbfcl/extract/load_source.sql index 4c4000d..9d656fd 100644 --- a/user_scripts/odbfcl/extract/load_source.sql +++ b/user_scripts/odbfcl/extract/load_source.sql @@ -37,7 +37,7 @@ BEGIN LOOP VCODE := VCODE || I.TEXT; IF I.LINE = I.LAST_LINE THEN - INSERT INTO &v_username..T_HASH_LOAD (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_ENC, SHA1_ENC, CODE) + INSERT INTO &v_username..T_HASH_LOAD (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_HASH, SHA1_HASH, CODE) VALUES (I.OWNER, I.NAME, I.TYPE, I.ORIGIN_CON_ID, I.CON_ID, SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_MD5), SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_SH1), VCODE); VCODE := ''; -- Zera a variável diff --git a/user_scripts/odbfcl/extract/load_view.sql b/user_scripts/odbfcl/extract/load_view.sql index 57e818e..372ac4d 100644 --- a/user_scripts/odbfcl/extract/load_view.sql +++ b/user_scripts/odbfcl/extract/load_view.sql @@ -83,7 +83,7 @@ BEGIN VCODE := UPPER(I.TEXT); VCODE := replaceClob(VCODE,'[[:space:]]*',''); -- Remove all space characters VCODE := replaceClob(VCODE,'"',''); -- Remove all quotes - INSERT INTO &v_username..T_HASH_LOAD (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_ENC, SHA1_ENC, CODE) + INSERT INTO &v_username..T_HASH_LOAD (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_HASH, SHA1_HASH, CODE) VALUES (I.OWNER, I.NAME, I.TYPE, I.ORIGIN_CON_ID, I.CON_ID, SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_MD5), SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_SH1), I.TEXT); diff --git a/user_scripts/odbfcl/tables_create.sql b/user_scripts/odbfcl/tables_create.sql index 69d7dfa..886b5c1 100644 --- a/user_scripts/odbfcl/tables_create.sql +++ b/user_scripts/odbfcl/tables_create.sql @@ -703,20 +703,20 @@ CREATE TABLE "T_HASH" "TYPE" VARCHAR2(12 CHAR) NOT NULL, "ORIGIN_CON_ID" NUMBER, "CON_ID" NUMBER, -"MD5_ENC" RAW(16) NOT NULL, -"SHA1_ENC" RAW(20) NOT NULL, +"MD5_HASH" RAW(16) NOT NULL, +"SHA1_HASH" RAW(20) NOT NULL, "ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, "ORASERIES" VARCHAR2(10 CHAR) NOT NULL, "ORAPATCH" NUMBER NOT NULL ) COMPRESS NOLOGGING; -COMMENT ON COLUMN T_HASH.MD5_ENC IS 'Join with DM_CODES on MD5_HASH column.'; +COMMENT ON COLUMN T_HASH.MD5_HASH IS 'Join with DM_CODES on MD5_HASH column.'; CREATE TABLE "T_FILES" ( "PATH" VARCHAR2(500 CHAR) NOT NULL, -"SHA256_ENC" RAW(32), +"SHA256_HASH" RAW(32), "ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, "ORASERIES" VARCHAR2(10 CHAR) NOT NULL, "ORAPATCH" NUMBER NOT NULL @@ -750,6 +750,7 @@ CREATE TABLE "T_BUGSFIXED" ( "BUG_ID" NUMBER NOT NULL, "PATCH_ID" NUMBER NOT NULL, +"BUG_DESC" VARCHAR2(1000 CHAR) NOT NULL, "ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, "ORASERIES" VARCHAR2(10 CHAR) NOT NULL, "ORAPATCH" NUMBER NOT NULL diff --git a/user_scripts/tables_create.sql b/user_scripts/tables_create.sql index dd5aa3d..f43e57a 100644 --- a/user_scripts/tables_create.sql +++ b/user_scripts/tables_create.sql @@ -441,8 +441,8 @@ CREATE TABLE "T_HASH" "TYPE" VARCHAR2(12 CHAR), "ORIGIN_CON_ID" NUMBER, "CON_ID" NUMBER, -"MD5_ENC" RAW(16) NOT NULL, -"SHA1_ENC" RAW(20) NOT NULL, +"MD5_HASH" RAW(16) NOT NULL, +"SHA1_HASH" RAW(20) NOT NULL, "SERIES" VARCHAR2(10 CHAR) NOT NULL, "ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, "PSU" NUMBER NOT NULL, From 10b13895383cebea0e398e134884864b11db8f1e Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 16 Sep 2021 15:41:15 -0300 Subject: [PATCH 023/229] Remove DM_BUGS and small fixes --- tasks/patch_main.yml | 2 +- .../odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql | 2 -- user_scripts/odbfcl/exchange_tables_adb.sql | 8 +------- user_scripts/odbfcl/tables_create.sql | 8 -------- 4 files changed, 2 insertions(+), 18 deletions(-) diff --git a/tasks/patch_main.yml b/tasks/patch_main.yml index bd25f9a..cbe6722 100644 --- a/tasks/patch_main.yml +++ b/tasks/patch_main.yml @@ -75,7 +75,7 @@ - name: Set version parameter for expdp set_fact: expdp_version: "version={{ target_db_version }}" - when: db_version.split('.')[1] > target_db_version + when: (db_version.split('.')[0] | int) > target_db_version - name: Export Database Tables shell: | diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql b/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql index f5886e9..2d153ee 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql @@ -1,7 +1,5 @@ WHENEVER SQLERROR EXIT SQL.SQLCODE --- TODO: CHANGE 2 QUERIES FOR 1 USING "INSERT ALL" - insert /*+ append */ into T_BUGSFIXED (BUG_ID, PATCH_ID, BUG_DESC, ORAVERSION, ORASERIES, ORAPATCH) select BUG_ID, diff --git a/user_scripts/odbfcl/exchange_tables_adb.sql b/user_scripts/odbfcl/exchange_tables_adb.sql index 93eaa86..9ec403a 100644 --- a/user_scripts/odbfcl/exchange_tables_adb.sql +++ b/user_scripts/odbfcl/exchange_tables_adb.sql @@ -133,9 +133,6 @@ BEGIN IF I.TABLE_NAME = 'DM_CONTENTS' THEN RUN_CMD('INSERT /*+ APPEND */ INTO ' || V_OWNER_TNAME || ' SELECT * FROM ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' A WHERE NOT EXISTS (SELECT 1 FROM ' || V_OWNER_TNAME || ' B WHERE A.MD5_HASH = B.MD5_HASH)'); - ELSIF I.TABLE_NAME = 'DM_BUGS' - THEN - RUN_CMD('INSERT /*+ APPEND */ INTO ' || V_OWNER_TNAME || ' SELECT * FROM ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' A WHERE NOT EXISTS (SELECT 1 FROM ' || V_OWNER_TNAME || ' B WHERE A.BUG_ID = B.BUG_ID)'); ELSIF I.TABLE_NAME = 'DM_CODES' THEN RUN_CMD('INSERT /*+ APPEND */ INTO ' || V_OWNER_TNAME || ' SELECT * FROM ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' A WHERE NOT EXISTS (SELECT 1 FROM ' || V_OWNER_TNAME || ' B WHERE A.MD5_HASH = B.MD5_HASH)'); @@ -157,9 +154,6 @@ BEGIN END; / -EXEC DBMS_MVIEW.REFRESH('MV_VERSIONS'); -EXEC DBMS_MVIEW.REFRESH('MV_PARAMETERS'); -EXEC DBMS_MVIEW.REFRESH('MV_OBJECTS'); -EXEC DBMS_MVIEW.REFRESH('MV_FILES'); +EXEC HASH.REFRESH_MVS; EXIT 0 diff --git a/user_scripts/odbfcl/tables_create.sql b/user_scripts/odbfcl/tables_create.sql index 886b5c1..d2f1456 100644 --- a/user_scripts/odbfcl/tables_create.sql +++ b/user_scripts/odbfcl/tables_create.sql @@ -769,14 +769,6 @@ CONSTRAINT DM_CONTENTS_PK PRIMARY KEY ("MD5_HASH") ) COMPRESS NOLOGGING; -CREATE TABLE "DM_BUGS" -( -"BUG_ID" NUMBER NOT NULL, -"BUG_DESC" VARCHAR2(1000 CHAR) NOT NULL, -CONSTRAINT DM_BUGS_PK PRIMARY KEY ("BUG_ID") -) -COMPRESS NOLOGGING; - CREATE TABLE "DM_CODES" ( "MD5_HASH" RAW(16) NOT NULL, From 8a2f4ec25050bf11024491cef7a1194e7f643e9a Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 23 Sep 2021 21:20:07 -0300 Subject: [PATCH 024/229] Add file_type in T_FILES --- .../odbfcl/adb_load_filechksum/adb_load_filechksum.yml | 2 +- .../odbfcl/adb_load_filechksum/create_sqlldr_chksum_table.sql | 3 ++- user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql | 3 ++- user_scripts/odbfcl/extract/fileGet.yml | 2 ++ user_scripts/odbfcl/tables_create.sql | 1 + 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml b/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml index 4f1b1c7..dd53190 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml +++ b/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml @@ -32,7 +32,7 @@ INTO TABLE T_FILES_LOAD APPEND FIELDS TERMINATED BY ' ' - (file_name constant "${v_file}",hash,path) + (file_name constant "${v_file}",hash,path,file_type) EOF cd "{{ chksum_folder }}" diff --git a/user_scripts/odbfcl/adb_load_filechksum/create_sqlldr_chksum_table.sql b/user_scripts/odbfcl/adb_load_filechksum/create_sqlldr_chksum_table.sql index dea39a7..ced7a2f 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/create_sqlldr_chksum_table.sql +++ b/user_scripts/odbfcl/adb_load_filechksum/create_sqlldr_chksum_table.sql @@ -14,6 +14,7 @@ CREATE TABLE T_FILES_LOAD ( FILE_NAME VARCHAR2(50) NOT NULL, HASH RAW(32) NOT NULL, - PATH VARCHAR2(500) NOT NULL + PATH VARCHAR2(500) NOT NULL, + FILE_TYPE VARCHAR2(1 CHAR) NOT NULL ) COMPRESS NOLOGGING; \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql b/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql index 7660881..01d1786 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql +++ b/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql @@ -1,8 +1,9 @@ WHENEVER SQLERROR EXIT SQL.SQLCODE -insert /*+ append */ into T_FILES (PATH, SHA256_HASH, ORAVERSION, ORASERIES, ORAPATCH) +insert /*+ append */ into T_FILES (PATH, SHA256_HASH, FILE_TYPE, ORAVERSION, ORASERIES, ORAPATCH) select path, hash, + file_type, substr(file_name,instr(file_name,'_',1,1)+1,instr(file_name,'_',1,2)-instr(file_name,'_',1,1)-1) oraversion, substr(file_name,instr(file_name,'_',1,2)+1,instr(file_name,'_',1,3)-instr(file_name,'_',1,2)-1) oraseries, to_number(substr(file_name,instr(file_name,'_',1,3)+1,instr(file_name,'.',-1)-instr(file_name,'_',1,3)-1)) orapatch diff --git a/user_scripts/odbfcl/extract/fileGet.yml b/user_scripts/odbfcl/extract/fileGet.yml index c58c8cc..22f86bd 100644 --- a/user_scripts/odbfcl/extract/fileGet.yml +++ b/user_scripts/odbfcl/extract/fileGet.yml @@ -22,6 +22,7 @@ - name: Generate files checksum shell: | find -type f -exec sha256sum "{}" + > {{ VM_folder }}/{{ sha256_file }} + sed -i 's/$/ F/' {{ VM_folder }}/{{ sha256_file }} args: chdir: "{{ dbhome_locl }}" register: sqloutput @@ -45,6 +46,7 @@ ar x "${v_lib}" find -type f -exec sha256sum "{}" + > ${v_out_file} sed -i "s| \.| ${v_lib}|" ${v_out_file} + sed -i 's/$/ L/' cat ${v_out_file} >> {{ VM_folder }}/{{ sha256_file }} rm -rf ${v_ext_fold} ${v_out_file} done diff --git a/user_scripts/odbfcl/tables_create.sql b/user_scripts/odbfcl/tables_create.sql index d2f1456..bd2506c 100644 --- a/user_scripts/odbfcl/tables_create.sql +++ b/user_scripts/odbfcl/tables_create.sql @@ -717,6 +717,7 @@ CREATE TABLE "T_FILES" ( "PATH" VARCHAR2(500 CHAR) NOT NULL, "SHA256_HASH" RAW(32), +"FILE_TYPE" VARCHAR2(1 CHAR) NOT NULL, "ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, "ORASERIES" VARCHAR2(10 CHAR) NOT NULL, "ORAPATCH" NUMBER NOT NULL From 7688557331f3b5caee7d40eb3b885a5548a498c6 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 23 Sep 2021 21:21:00 -0300 Subject: [PATCH 025/229] Update fileGet.yml --- user_scripts/odbfcl/extract/fileGet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_scripts/odbfcl/extract/fileGet.yml b/user_scripts/odbfcl/extract/fileGet.yml index 22f86bd..8c19b18 100644 --- a/user_scripts/odbfcl/extract/fileGet.yml +++ b/user_scripts/odbfcl/extract/fileGet.yml @@ -46,7 +46,7 @@ ar x "${v_lib}" find -type f -exec sha256sum "{}" + > ${v_out_file} sed -i "s| \.| ${v_lib}|" ${v_out_file} - sed -i 's/$/ L/' + sed -i 's/$/ L/' ${v_out_file} cat ${v_out_file} >> {{ VM_folder }}/{{ sha256_file }} rm -rf ${v_ext_fold} ${v_out_file} done From e5162713533a4a14b941663ed0d02ce807f55330 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 4 Oct 2021 14:48:07 -0300 Subject: [PATCH 026/229] Include V_$SYSTEM_FIX_CONTROL --- user_scripts/odbfcl/extract/fileGet.yml | 6 +++--- user_scripts/odbfcl/extract/load_v_dollar.sql | 2 ++ user_scripts/odbfcl/tables_create.sql | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/user_scripts/odbfcl/extract/fileGet.yml b/user_scripts/odbfcl/extract/fileGet.yml index 8c19b18..f8cb8e9 100644 --- a/user_scripts/odbfcl/extract/fileGet.yml +++ b/user_scripts/odbfcl/extract/fileGet.yml @@ -40,9 +40,9 @@ IFS=$'\n' for v_lib in ${v_libs} do - rm -rf "${v_ext_fold}" - mkdir "${v_ext_fold}" - cd "${v_ext_fold}" + rm -rf ${v_ext_fold} + mkdir ${v_ext_fold} + cd ${v_ext_fold} ar x "${v_lib}" find -type f -exec sha256sum "{}" + > ${v_out_file} sed -i "s| \.| ${v_lib}|" ${v_out_file} diff --git a/user_scripts/odbfcl/extract/load_v_dollar.sql b/user_scripts/odbfcl/extract/load_v_dollar.sql index bc8c35b..5ae5bf2 100644 --- a/user_scripts/odbfcl/extract/load_v_dollar.sql +++ b/user_scripts/odbfcl/extract/load_v_dollar.sql @@ -62,5 +62,7 @@ BEGIN RUN_INSERT ('T_RESERVED_WORDS','V_$RESERVED_WORDS'); + RUN_INSERT ('T_SYSTEM_FIX_CONTROL','V_$SYSTEM_FIX_CONTROL'); + END; / \ No newline at end of file diff --git a/user_scripts/odbfcl/tables_create.sql b/user_scripts/odbfcl/tables_create.sql index bd2506c..ffd3d3f 100644 --- a/user_scripts/odbfcl/tables_create.sql +++ b/user_scripts/odbfcl/tables_create.sql @@ -278,6 +278,22 @@ CREATE TABLE "T_RESERVED_WORDS" ) COMPRESS NOLOGGING; +CREATE TABLE "T_SYSTEM_FIX_CONTROL" +( +"BUGNO" NUMBER NOT NULL, +"VALUE" NUMBER, +"SQL_FEATURE" VARCHAR2(64 CHAR) NOT NULL, +"DESCRIPTION" VARCHAR2(64 CHAR), +"OPTIMIZER_FEATURE_ENABLE" VARCHAR2(25 CHAR), +"EVENT" NUMBER, +"IS_DEFAULT" NUMBER, +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + CREATE TABLE "T_TRIGGERS" ( "OWNER" VARCHAR2(128 CHAR) NOT NULL, From 39221a1d5dc9524d235e34b5b8e9a3462f302874 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 15 Oct 2021 14:23:58 -0300 Subject: [PATCH 027/229] Fix loading underscore parameters --- user_scripts/odbfcl/extract/load_v_dollar.sql | 5 +- user_scripts/odbfcl/extract/load_x_dollar.sql | 42 +---------- .../load_underscore_11.2.0.4.sql | 72 ++++++++++++++++++ .../load_underscore_12.1.0.1.sql | 72 ++++++++++++++++++ .../load_underscore_12.1.0.2.sql | 73 +++++++++++++++++++ .../load_underscore_12.2.0.1.sql | 73 +++++++++++++++++++ .../load_underscore_18.0.0.0.sql | 73 +++++++++++++++++++ .../load_underscore_19.0.0.0.sql | 6 ++ .../load_underscore_21.0.0.0.sql | 6 ++ .../load_underscore_vv_11.2.0.4.sql | 56 ++++++++++++++ .../load_underscore_vv_12.1.0.1.sql | 57 +++++++++++++++ .../load_underscore_vv_12.1.0.2.sql | 38 ++++++++++ .../load_underscore_vv_12.2.0.1.sql | 6 ++ .../load_underscore_vv_18.0.0.0.sql | 6 ++ .../load_underscore_vv_19.0.0.0.sql | 6 ++ .../load_underscore_vv_21.0.0.0.sql | 6 ++ 16 files changed, 555 insertions(+), 42 deletions(-) create mode 100644 user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.4.sql create mode 100644 user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.1.0.1.sql create mode 100644 user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.1.0.2.sql create mode 100644 user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.2.0.1.sql create mode 100644 user_scripts/odbfcl/extract/underscore_parameters/load_underscore_18.0.0.0.sql create mode 100644 user_scripts/odbfcl/extract/underscore_parameters/load_underscore_19.0.0.0.sql create mode 100644 user_scripts/odbfcl/extract/underscore_parameters/load_underscore_21.0.0.0.sql create mode 100644 user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.4.sql create mode 100644 user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.1.0.1.sql create mode 100644 user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.1.0.2.sql create mode 100644 user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.2.0.1.sql create mode 100644 user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_18.0.0.0.sql create mode 100644 user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_19.0.0.0.sql create mode 100644 user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_21.0.0.0.sql diff --git a/user_scripts/odbfcl/extract/load_v_dollar.sql b/user_scripts/odbfcl/extract/load_v_dollar.sql index 5ae5bf2..e45736c 100644 --- a/user_scripts/odbfcl/extract/load_v_dollar.sql +++ b/user_scripts/odbfcl/extract/load_v_dollar.sql @@ -56,9 +56,10 @@ BEGIN RUN_INSERT ('T_EVENT_NAME','V_$EVENT_NAME'); - RUN_INSERT ('T_PARAMETER','V_$PARAMETER'); +-- Those 2 tables will be loaded from X$ to include hidden parameters - RUN_INSERT ('T_PARAMETER_VALID_VALUES','V_$PARAMETER_VALID_VALUES'); +-- RUN_INSERT ('T_PARAMETER','V_$PARAMETER'); +-- RUN_INSERT ('T_PARAMETER_VALID_VALUES','V_$PARAMETER_VALID_VALUES'); RUN_INSERT ('T_RESERVED_WORDS','V_$RESERVED_WORDS'); diff --git a/user_scripts/odbfcl/extract/load_x_dollar.sql b/user_scripts/odbfcl/extract/load_x_dollar.sql index e49abca..fe4008f 100644 --- a/user_scripts/odbfcl/extract/load_x_dollar.sql +++ b/user_scripts/odbfcl/extract/load_x_dollar.sql @@ -1,46 +1,8 @@ -INSERT INTO &v_username..T_PARAMETER -( - "NAME", - "TYPE", - "DEFAULT_VALUE", - "DESCRIPTION", - "ORAVERSION", - "ORASERIES", - "ORAPATCH" -) -select a.ksppinm name, - a.ksppity type, - b.ksppstdf def_value, - a.ksppdesc description, - '&P_VERS.', - '&P_SER.', - &P_PATCH. -from sys.x$ksppi a, - sys.x$ksppcv b -where a.indx = b.indx -and a.ksppinm like '\_%' ESCAPE '\'; +@@underscore_parameters/load_underscore_&P_VERS..sql -- -INSERT INTO &v_username..T_PARAMETER_VALID_VALUES -( - "NAME", - "VALUE", - "ISDEFAULT", - "ORAVERSION", - "ORASERIES", - "ORAPATCH" -) -select a.ksppinm name, - b.value_kspvld_values value, - b.isdefault_kspvld_values is_default, - '&P_VERS.', - '&P_SER.', - &P_PATCH. -from sys.x$ksppi a, - sys.x$kspvld_values b -where a.ksppinm = b.name_kspvld_values -and a.ksppinm like '\_%' ESCAPE '\'; +@@underscore_valid_values/load_underscore_vv_&P_VERS..sql -- diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.4.sql b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.4.sql new file mode 100644 index 0000000..9886816 --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.4.sql @@ -0,0 +1,72 @@ +-------------------------------------- +-- 11.2.0.4 +-------------------------------------- + +DELETE FROM &v_username..T_PARAMETER; + +INSERT INTO &v_username..T_PARAMETER +( + "NAME", + "TYPE", + "DEFAULT_VALUE", + "ISSES_MODIFIABLE", + "ISSYS_MODIFIABLE", + "ISPDB_MODIFIABLE", + "ISINSTANCE_MODIFIABLE", + "ISDEPRECATED", + "ISBASIC", + "DESCRIPTION", + "CON_ID", + "ORAVERSION", + "ORASERIES", + "ORAPATCH" +) +WITH T1 AS ( +SELECT + x.inst_id, + x.indx + 1 num, + ksppinm name, + ksppity type, + ksppstvl value, + ksppstdvl display_value, + ksppstdf isdefault, + decode(bitand(ksppiflg / 256, 1), 1, 'TRUE', 'FALSE') isses_modifiable, + decode(bitand(ksppiflg / 65536, 3), 1, 'IMMEDIATE', 2, 'DEFERRED', + 3, 'IMMEDIATE', 'FALSE') issys_modifiable, + decode(bitand(ksppiflg, 4), 4, 'FALSE', decode(bitand(ksppiflg / 65536, 3), 0, 'FALSE', 'TRUE')) isinstance_modifiable, + decode(bitand(ksppstvf, 7), 1, 'MODIFIED', 4, 'SYSTEM_MOD', + 'FALSE') ismodified, + decode(bitand(ksppstvf, 2), 2, 'TRUE', 'FALSE') isadjusted, + decode(bitand(ksppilrmflg / 64, 1), 1, 'TRUE', 'FALSE') isdeprecated, + decode(bitand(ksppilrmflg / 268435456, 1), 1, 'TRUE', 'FALSE') isbasic, + ksppdesc description, + ksppstcmnt update_comment, + ksppihash hash +FROM + x$ksppi x, + x$ksppcv y +WHERE + ( x.indx = y.indx ) +-- AND NOT ( +-- bitand(ksppiflg, 268435456) = 0 +-- AND ( ( translate(ksppinm, '_', '#') NOT LIKE '##%' ) +-- AND ( ( translate(ksppinm, '_', '#') NOT LIKE '#%' ) +-- OR ( ksppstdf = 'FALSE' ) +-- OR ( bitand(ksppstvf, 5) > 0 ) ) ) +-- ) +) +SELECT "NAME", + "TYPE", + DECODE("ISDEFAULT",'TRUE',"VALUE",NULL) "DEFAULT_VALUE", + "ISSES_MODIFIABLE", + "ISSYS_MODIFIABLE", + NULL "ISPDB_MODIFIABLE", + "ISINSTANCE_MODIFIABLE", + "ISDEPRECATED", + "ISBASIC", + "DESCRIPTION", + NULL "CON_ID", + '&P_VERS.' "ORAVERSION", + '&P_SER.' "ORASERIES", + &P_PATCH. "ORAPATCH" +FROM T1; \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.1.0.1.sql b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.1.0.1.sql new file mode 100644 index 0000000..1eabe52 --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.1.0.1.sql @@ -0,0 +1,72 @@ +-------------------------------------- +-- 12.1.0.1 +-------------------------------------- + +INSERT INTO &v_username..T_PARAMETER +( + "NAME", + "TYPE", + "DEFAULT_VALUE", + "ISSES_MODIFIABLE", + "ISSYS_MODIFIABLE", + "ISPDB_MODIFIABLE", + "ISINSTANCE_MODIFIABLE", + "ISDEPRECATED", + "ISBASIC", + "DESCRIPTION", + "CON_ID", + "ORAVERSION", + "ORASERIES", + "ORAPATCH" +) +WITH T1 AS ( +SELECT + x.inst_id, + x.indx + 1 num, + ksppinm name, + ksppity type, + ksppstvl value, + ksppstdvl display_value, + ksppstdf isdefault, + decode(bitand(ksppiflg / 256, 1), 1, 'TRUE', 'FALSE') isses_modifiable, + decode(bitand(ksppiflg / 65536, 3), 1, 'IMMEDIATE', 2, 'DEFERRED', + 3, 'IMMEDIATE', 'FALSE') issys_modifiable, + decode(bitand(ksppiflg / 524288, 1), 1, 'TRUE', 'FALSE') ispdb_modifiable, + decode(bitand(ksppiflg, 4), 4, 'FALSE', decode(bitand(ksppiflg / 65536, 3), 0, 'FALSE', 'TRUE')) isinstance_modifiable, + decode(bitand(ksppstvf, 7), 1, 'MODIFIED', 4, 'SYSTEM_MOD', + 'FALSE') ismodified, + decode(bitand(ksppstvf, 2), 2, 'TRUE', 'FALSE') isadjusted, + decode(bitand(ksppilrmflg / 64, 1), 1, 'TRUE', 'FALSE') isdeprecated, + decode(bitand(ksppilrmflg / 268435456, 1), 1, 'TRUE', 'FALSE') isbasic, + ksppdesc description, + ksppstcmnt update_comment, + ksppihash hash, + x.con_id +FROM + x$ksppi x, + x$ksppcv y +WHERE + ( x.indx = y.indx ) +-- AND NOT ( +-- bitand(ksppiflg, 268435456) = 0 +-- AND ( ( translate(ksppinm, '_', '#') NOT LIKE '##%' ) +-- AND ( ( translate(ksppinm, '_', '#') NOT LIKE '#%' ) +-- OR ( ksppstdf = 'FALSE' ) +-- OR ( bitand(ksppstvf, 5) > 0 ) ) ) +-- ) +) +SELECT "NAME", + "TYPE", + DECODE("ISDEFAULT",'TRUE',"VALUE",NULL) "DEFAULT_VALUE", + "ISSES_MODIFIABLE", + "ISSYS_MODIFIABLE", + "ISPDB_MODIFIABLE", + "ISINSTANCE_MODIFIABLE", + "ISDEPRECATED", + "ISBASIC", + "DESCRIPTION", + "CON_ID", + '&P_VERS.' "ORAVERSION", + '&P_SER.' "ORASERIES", + &P_PATCH. "ORAPATCH" +FROM T1; \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.1.0.2.sql b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.1.0.2.sql new file mode 100644 index 0000000..3fa11ff --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.1.0.2.sql @@ -0,0 +1,73 @@ +-------------------------------------- +-- 12.1.0.2 +-------------------------------------- + +INSERT INTO &v_username..T_PARAMETER +( + "NAME", + "TYPE", + "DEFAULT_VALUE", + "ISSES_MODIFIABLE", + "ISSYS_MODIFIABLE", + "ISPDB_MODIFIABLE", + "ISINSTANCE_MODIFIABLE", + "ISDEPRECATED", + "ISBASIC", + "DESCRIPTION", + "CON_ID", + "ORAVERSION", + "ORASERIES", + "ORAPATCH" +) +WITH T1 AS ( +SELECT + x.inst_id, + x.indx + 1 num, + ksppinm name, + ksppity type, + ksppstvl value, + ksppstdvl display_value, + ksppstdfl default_value, + ksppstdf isdefault, + decode(bitand(ksppiflg / 256, 1), 1, 'TRUE', 'FALSE') isses_modifiable, + decode(bitand(ksppiflg / 65536, 3), 1, 'IMMEDIATE', 2, 'DEFERRED', + 3, 'IMMEDIATE', 'FALSE') issys_modifiable, + decode(bitand(ksppiflg / 524288, 1), 1, 'TRUE', 'FALSE') ispdb_modifiable, + decode(bitand(ksppiflg, 4), 4, 'FALSE', decode(bitand(ksppiflg / 65536, 3), 0, 'FALSE', 'TRUE')) isinstance_modifiable, + decode(bitand(ksppstvf, 7), 1, 'MODIFIED', 4, 'SYSTEM_MOD', + 'FALSE') ismodified, + decode(bitand(ksppstvf, 2), 2, 'TRUE', 'FALSE') isadjusted, + decode(bitand(ksppilrmflg / 64, 1), 1, 'TRUE', 'FALSE') isdeprecated, + decode(bitand(ksppilrmflg / 268435456, 1), 1, 'TRUE', 'FALSE') isbasic, + ksppdesc description, + ksppstcmnt update_comment, + ksppihash hash, + x.con_id +FROM + x$ksppi x, + x$ksppcv y +WHERE + ( x.indx = y.indx ) +-- AND NOT ( +-- bitand(ksppiflg, 268435456) = 0 +-- AND ( ( translate(ksppinm, '_', '#') NOT LIKE '##%' ) +-- AND ( ( translate(ksppinm, '_', '#') NOT LIKE '#%' ) +-- OR ( ksppstdf = 'FALSE' ) +-- OR ( bitand(ksppstvf, 5) > 0 ) ) ) +-- ) +) +SELECT "NAME", + "TYPE", + "DEFAULT_VALUE", + "ISSES_MODIFIABLE", + "ISSYS_MODIFIABLE", + "ISPDB_MODIFIABLE", + "ISINSTANCE_MODIFIABLE", + "ISDEPRECATED", + "ISBASIC", + "DESCRIPTION", + "CON_ID", + '&P_VERS.' "ORAVERSION", + '&P_SER.' "ORASERIES", + &P_PATCH. "ORAPATCH" +FROM T1; \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.2.0.1.sql b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.2.0.1.sql new file mode 100644 index 0000000..5ff962b --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.2.0.1.sql @@ -0,0 +1,73 @@ +-------------------------------------- +-- 12.2.0.1 +-------------------------------------- + +INSERT INTO &v_username..T_PARAMETER +( + "NAME", + "TYPE", + "DEFAULT_VALUE", + "ISSES_MODIFIABLE", + "ISSYS_MODIFIABLE", + "ISPDB_MODIFIABLE", + "ISINSTANCE_MODIFIABLE", + "ISDEPRECATED", + "ISBASIC", + "DESCRIPTION", + "CON_ID", + "ORAVERSION", + "ORASERIES", + "ORAPATCH" +) +WITH T1 AS ( +SELECT + x.inst_id, + x.indx + 1 num, + ksppinm name, + ksppity type, + ksppstvl value, + ksppstdvl display_value, + ksppstdfl default_value, + ksppstdf isdefault, + decode(bitand(ksppiflg / 256, 1), 1, 'TRUE', 'FALSE') isses_modifiable, + decode(bitand(ksppiflg / 65536, 3), 1, 'IMMEDIATE', 2, 'DEFERRED', + 3, 'IMMEDIATE', 'FALSE') issys_modifiable, + decode(bitand(ksppiflg / 524288, 1), 1, 'TRUE', 'FALSE') ispdb_modifiable, + decode(bitand(ksppiflg, 4), 4, 'FALSE', decode(bitand(ksppiflg / 65536, 3), 0, 'FALSE', 'TRUE')) isinstance_modifiable, + decode(bitand(ksppstvf, 7), 1, 'MODIFIED', 4, 'SYSTEM_MOD', + 'FALSE') ismodified, + decode(bitand(ksppstvf, 2), 2, 'TRUE', 'FALSE') isadjusted, + decode(bitand(ksppilrmflg / 64, 1), 1, 'TRUE', 'FALSE') isdeprecated, + decode(bitand(ksppilrmflg / 268435456, 1), 1, 'TRUE', 'FALSE') isbasic, + ksppdesc description, + ksppstcmnt update_comment, + ksppihash hash, + y.con_id +FROM + x$ksppi x, + x$ksppcv y +WHERE + ( x.indx = y.indx ) +-- AND NOT ( +-- bitand(ksppiflg, 268435456) = 0 +-- AND ( ( translate(ksppinm, '_', '$') NOT LIKE '$$%' ) +-- AND ( ( translate(ksppinm, '_', '$') NOT LIKE '$%' ) +-- OR ( ksppstdf = 'FALSE' ) +-- OR ( bitand(ksppstvf, 5) > 0 ) ) ) +-- ) +) +SELECT "NAME", + "TYPE", + "DEFAULT_VALUE", + "ISSES_MODIFIABLE", + "ISSYS_MODIFIABLE", + "ISPDB_MODIFIABLE", + "ISINSTANCE_MODIFIABLE", + "ISDEPRECATED", + "ISBASIC", + "DESCRIPTION", + "CON_ID", + '&P_VERS.' "ORAVERSION", + '&P_SER.' "ORASERIES", + &P_PATCH. "ORAPATCH" +FROM T1; \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_18.0.0.0.sql b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_18.0.0.0.sql new file mode 100644 index 0000000..2d024e0 --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_18.0.0.0.sql @@ -0,0 +1,73 @@ +-------------------------------------- +-- 18.0.0.0 +-------------------------------------- + +INSERT INTO &v_username..T_PARAMETER +( + "NAME", + "TYPE", + "DEFAULT_VALUE", + "ISSES_MODIFIABLE", + "ISSYS_MODIFIABLE", + "ISPDB_MODIFIABLE", + "ISINSTANCE_MODIFIABLE", + "ISDEPRECATED", + "ISBASIC", + "DESCRIPTION", + "CON_ID", + "ORAVERSION", + "ORASERIES", + "ORAPATCH" +) +WITH T1 AS ( +SELECT /*+ use_hash(x y) */ + x.inst_id, + x.indx + 1 num, + ksppinm name, + ksppity type, + ksppstvl value, + ksppstdvl display_value, + ksppstdfl default_value, + ksppstdf isdefault, + decode(bitand(ksppiflg / 256, 1), 1, 'TRUE', 'FALSE') isses_modifiable, + decode(bitand(ksppiflg / 65536, 3), 1, 'IMMEDIATE', 2, 'DEFERRED', + 3, 'IMMEDIATE', 'FALSE') issys_modifiable, + decode(bitand(ksppiflg / 524288, 1), 1, 'TRUE', 'FALSE') ispdb_modifiable, + decode(bitand(ksppiflg, 4), 4, 'FALSE', decode(bitand(ksppiflg / 65536, 3), 0, 'FALSE', 'TRUE')) isinstance_modifiable, + decode(bitand(ksppstvf, 7), 1, 'MODIFIED', 4, 'SYSTEM_MOD', + 'FALSE') ismodified, + decode(bitand(ksppstvf, 2), 2, 'TRUE', 'FALSE') isadjusted, + decode(bitand(ksppilrmflg / 64, 1), 1, 'TRUE', 'FALSE') isdeprecated, + decode(bitand(ksppilrmflg / 268435456, 1), 1, 'TRUE', 'FALSE') isbasic, + ksppdesc description, + ksppstcmnt update_comment, + ksppihash hash, + y.con_id +FROM + x$ksppi x, + x$ksppcv y +WHERE + ( x.indx = y.indx ) +-- AND NOT ( +-- bitand(ksppiflg, 268435456) = 0 +-- AND ( ( translate(ksppinm, '_', '$') NOT LIKE '$$%' ) +-- AND ( ( translate(ksppinm, '_', '$') NOT LIKE '$%' ) +-- OR ( ksppstdf = 'FALSE' ) +-- OR ( bitand(ksppstvf, 5) > 0 ) ) ) +-- ) +) +SELECT "NAME", + "TYPE", + "DEFAULT_VALUE", + "ISSES_MODIFIABLE", + "ISSYS_MODIFIABLE", + "ISPDB_MODIFIABLE", + "ISINSTANCE_MODIFIABLE", + "ISDEPRECATED", + "ISBASIC", + "DESCRIPTION", + "CON_ID", + '&P_VERS.' "ORAVERSION", + '&P_SER.' "ORASERIES", + &P_PATCH. "ORAPATCH" +FROM T1; \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_19.0.0.0.sql b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_19.0.0.0.sql new file mode 100644 index 0000000..97da1cd --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_19.0.0.0.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 19.0.0.0 +-------------------------------------- + +-- The code is the same as 18c in V$FIXED_VIEW_DEFINITION +@@load_underscore_18.0.0.0.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_21.0.0.0.sql b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_21.0.0.0.sql new file mode 100644 index 0000000..31339b6 --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_21.0.0.0.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 21.0.0.0 +-------------------------------------- + +-- The code is the same as 18c in V$FIXED_VIEW_DEFINITION +@@load_underscore_18.0.0.0.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.4.sql b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.4.sql new file mode 100644 index 0000000..332e327 --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.4.sql @@ -0,0 +1,56 @@ +-------------------------------------- +-- 11.2.0.4 +-------------------------------------- + +INSERT INTO &v_username..T_PARAMETER_VALID_VALUES +( + "NAME", + "ORDINAL", + "VALUE", + "ISDEFAULT", + "CON_ID", + "ORAVERSION", + "ORASERIES", + "ORAPATCH" +) +WITH T1 AS ( +SELECT + inst_id, + parno_kspvld_values num, + name_kspvld_values name, + ordinal_kspvld_values ordinal, + value_kspvld_values value, + isdefault_kspvld_values isdefault +FROM + x$kspvld_values +-- WHERE +-- NOT (translate(name_kspvld_values, '_', '#') NOT LIKE '#%') +) +SELECT "NAME", + "ORDINAL", + "VALUE", + "ISDEFAULT", + NULL "CON_ID", + '&P_VERS.' "ORAVERSION", + '&P_SER.' "ORASERIES", + &P_PATCH. "ORAPATCH" +FROM T1; + +-- Add Default Value info into T_PARAMETER + +UPDATE &v_username..T_PARAMETER A +SET A."DEFAULT_VALUE" = ( + SELECT B."VALUE" + FROM &v_username..T_PARAMETER_VALID_VALUES B + WHERE A."NAME"=B."NAME" + AND B."ISDEFAULT"='TRUE' + AND B."VALUE" IS NOT NULL +) +WHERE A."DEFAULT_VALUE" IS NULL +AND EXISTS ( + SELECT 1 + FROM &v_username..T_PARAMETER_VALID_VALUES B + WHERE A."NAME"=B."NAME" + AND B."ISDEFAULT"='TRUE' + AND B."VALUE" IS NOT NULL +); \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.1.0.1.sql b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.1.0.1.sql new file mode 100644 index 0000000..a42cf86 --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.1.0.1.sql @@ -0,0 +1,57 @@ +-------------------------------------- +-- 12.1.0.1 +-------------------------------------- + +INSERT INTO &v_username..T_PARAMETER_VALID_VALUES +( + "NAME", + "ORDINAL", + "VALUE", + "ISDEFAULT", + "CON_ID", + "ORAVERSION", + "ORASERIES", + "ORAPATCH" +) +WITH T1 AS ( +SELECT + inst_id, + parno_kspvld_values num, + name_kspvld_values name, + ordinal_kspvld_values ordinal, + value_kspvld_values value, + isdefault_kspvld_values isdefault, + con_id +FROM + x$kspvld_values +-- WHERE +-- NOT (translate(name_kspvld_values, '_', '#') NOT LIKE '#%') +) +SELECT "NAME", + "ORDINAL", + "VALUE", + "ISDEFAULT", + "CON_ID", + '&P_VERS.' "ORAVERSION", + '&P_SER.' "ORASERIES", + &P_PATCH. "ORAPATCH" +FROM T1; + +-- Add Default Value info into T_PARAMETER + +UPDATE &v_username..T_PARAMETER A +SET A."DEFAULT_VALUE" = ( + SELECT B."VALUE" + FROM &v_username..T_PARAMETER_VALID_VALUES B + WHERE A."NAME"=B."NAME" + AND B."ISDEFAULT"='TRUE' + AND B."VALUE" IS NOT NULL +) +WHERE A."DEFAULT_VALUE" IS NULL +AND EXISTS ( + SELECT 1 + FROM &v_username..T_PARAMETER_VALID_VALUES B + WHERE A."NAME"=B."NAME" + AND B."ISDEFAULT"='TRUE' + AND B."VALUE" IS NOT NULL +); \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.1.0.2.sql b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.1.0.2.sql new file mode 100644 index 0000000..60bb2d3 --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.1.0.2.sql @@ -0,0 +1,38 @@ +-------------------------------------- +-- 12.1.0.2 +-------------------------------------- + +INSERT INTO &v_username..T_PARAMETER_VALID_VALUES +( + "NAME", + "ORDINAL", + "VALUE", + "ISDEFAULT", + "CON_ID", + "ORAVERSION", + "ORASERIES", + "ORAPATCH" +) +WITH T1 AS ( +SELECT + inst_id, + parno_kspvld_values num, + name_kspvld_values name, + ordinal_kspvld_values ordinal, + value_kspvld_values value, + isdefault_kspvld_values isdefault, + con_id +FROM + x$kspvld_values +-- WHERE +-- NOT (translate(name_kspvld_values, '_', '#') NOT LIKE '#%') +) +SELECT "NAME", + "ORDINAL", + "VALUE", + "ISDEFAULT", + "CON_ID", + '&P_VERS.' "ORAVERSION", + '&P_SER.' "ORASERIES", + &P_PATCH. "ORAPATCH" +FROM T1; \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.2.0.1.sql b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.2.0.1.sql new file mode 100644 index 0000000..aa4ef9b --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.2.0.1.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 12.2.0.1 +-------------------------------------- + +-- The code is the same as 12.1.0.2 in V$FIXED_VIEW_DEFINITION +@@load_underscore_vv_12.1.0.2.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_18.0.0.0.sql b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_18.0.0.0.sql new file mode 100644 index 0000000..d287639 --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_18.0.0.0.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 18.0.0.0 +-------------------------------------- + +-- The code is the same as 12.1.0.2 in V$FIXED_VIEW_DEFINITION +@@load_underscore_vv_12.1.0.2.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_19.0.0.0.sql b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_19.0.0.0.sql new file mode 100644 index 0000000..1562d4d --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_19.0.0.0.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 19.0.0.0 +-------------------------------------- + +-- The code is the same as 12.1.0.2 in V$FIXED_VIEW_DEFINITION +@@load_underscore_vv_12.1.0.2.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_21.0.0.0.sql b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_21.0.0.0.sql new file mode 100644 index 0000000..ad0196f --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_21.0.0.0.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 21.0.0.0 +-------------------------------------- + +-- The code is the same as 12.1.0.2 in V$FIXED_VIEW_DEFINITION +@@load_underscore_vv_12.1.0.2.sql \ No newline at end of file From b18c9e7c7d62a7d5ac2c4b07d2bf55f692846950 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 15 Oct 2021 15:32:51 -0300 Subject: [PATCH 028/229] Fix relative calls in sqlplus Changing to script directory to make relative calls like @./xxx/x.sql --- tasks/run_sql.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tasks/run_sql.yml b/tasks/run_sql.yml index 7dede84..f98f08c 100644 --- a/tasks/run_sql.yml +++ b/tasks/run_sql.yml @@ -14,6 +14,8 @@ environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" + args: + chdir: "{{ VM_folder }}/{{ sql_param.folder | default('user_scripts') }}" register: sqloutput become: true become_user: oracle @@ -22,3 +24,9 @@ - name: SQL Output debug: msg="{{ sqloutput.stdout_lines }}" when: (sql_param.termout | default(false)) == true + +- name: SQLPlus Error! + fail: + msg: "Found SP2 string in SQLPlus output." + when: '"SP2-" in sqloutput.stdout' +# when: sql_param.file == "hashGet.sql" From 20fc70a475d8443a690106abf9e1281ebae96e64 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 22 Oct 2021 16:20:25 -0300 Subject: [PATCH 029/229] Enable download patch option and only start server when required --- main.yml | 1 + tasks/clean_ojvm_dumps.yml | 3 +- tasks/config_checks.yml | 16 ++++++ tasks/download_patch.yml | 26 ++++++++++ tasks/main_PSU_BP.yml | 21 ++------ tasks/main_RU_RUR.yml | 21 ++------ tasks/patch_tasks_pre.yml | 102 +++++++++++++++++++++++++++++-------- tasks/setup_env.yml | 2 +- 8 files changed, 136 insertions(+), 56 deletions(-) create mode 100644 tasks/config_checks.yml create mode 100644 tasks/download_patch.yml diff --git a/main.yml b/main.yml index c02c949..c42b217 100644 --- a/main.yml +++ b/main.yml @@ -38,6 +38,7 @@ - include_vars: config_oci.yml when: oci_mode == true + - import_tasks: tasks/config_checks.yml - import_tasks: tasks/setup_env.yml - include: tasks/main_PSU_BP.yml db_version="11.2.0.4" diff --git a/tasks/clean_ojvm_dumps.yml b/tasks/clean_ojvm_dumps.yml index 6220245..6d12376 100644 --- a/tasks/clean_ojvm_dumps.yml +++ b/tasks/clean_ojvm_dumps.yml @@ -16,7 +16,8 @@ if [ "${v_ojvm_val}" != "{{ base_id }}" ] then - rm -f ${v_ojvm_path}/${v_ojvm_pref}_* + find "{{ output_folder }}" -name "*_{{ db_version }}_OJVM_*" -delete + # rm -f ${v_ojvm_path}/${v_ojvm_pref}_* echo "{{ base_id }}" > "${v_ojvm_base_file}" fi register: shell_output \ No newline at end of file diff --git a/tasks/config_checks.yml b/tasks/config_checks.yml new file mode 100644 index 0000000..c23f386 --- /dev/null +++ b/tasks/config_checks.yml @@ -0,0 +1,16 @@ +- name: Variables not provided + fail: + msg: "Variables downloader_tool / downloader_user / downloader_pass must be defined when download_patch is true." + when: ( downloader_tool is undefined or downloader_user is undefined + or (downloader_tool|length == 0) or (downloader_user|length == 0)) and download_patch == true + +- name: "Check if {{ downloader_tool }} exists" + stat: + path: "{{ downloader_tool }}" + register: downloader_tool_result + when: download_patch == true + +- name: Tool does not exist + fail: + msg: "{{ downloader_tool }} must exist when download_patch is true." + when: downloader_tool_result.stat.exists == false and download_patch == true \ No newline at end of file diff --git a/tasks/download_patch.yml b/tasks/download_patch.yml new file mode 100644 index 0000000..1bedb37 --- /dev/null +++ b/tasks/download_patch.yml @@ -0,0 +1,26 @@ +- block: + + - name: "Get password for {{ downloader_user }}" + pause: + prompt: "Enter password for {{ downloader_user }}: " + echo: false + register: input + + - name: Set Password + set_fact: + downloader_pass: "{{ input.user_input }}" + + when: downloader_pass is undefined + + +- name: "Calling {{ downloader_tool }}" + shell: | + $ORACLE_HOME/jdk/bin/java -jar {{ downloader_tool }} \ + patch={{ patch.patch_number }} \ + platform=226P \ + download=all \ + MOSUser={{ downloader_user }} \ + MOSPass='{{ downloader_pass }}' + args: + chdir: "{{ source_folder }}" + register: shell_output \ No newline at end of file diff --git a/tasks/main_PSU_BP.yml b/tasks/main_PSU_BP.yml index eb32152..c1f07bc 100644 --- a/tasks/main_PSU_BP.yml +++ b/tasks/main_PSU_BP.yml @@ -23,21 +23,10 @@ set_fact: vm_snapshot: "{{ patch_base }}" -- name: Call role to start OCI VM - include_role: - name: oci_compute_instance_actions - vars: - compute_action: start - when: oci_mode == true - -- include: vbox_reload.yml - when: oci_mode == false - -- include: lvm_reload.yml - when: oci_mode == true - -- include: setup_opatch.yml -- include: setup_database.yml +# This parameter will control if database start command was ever called. +- name : Define database_started variable to false. + set_fact: + database_started: false ### PSU - block: @@ -185,4 +174,4 @@ name: oci_compute_instance_actions vars: compute_action: stop - when: oci_mode == true and not only_deploy_patch \ No newline at end of file + when: oci_mode == true and not only_deploy_patch and database_started \ No newline at end of file diff --git a/tasks/main_RU_RUR.yml b/tasks/main_RU_RUR.yml index 400fafd..4e96bd3 100644 --- a/tasks/main_RU_RUR.yml +++ b/tasks/main_RU_RUR.yml @@ -24,21 +24,10 @@ set_fact: vm_snapshot: "{{ patch_base }}" -- name: Call role to start OCI VM - include_role: - name: oci_compute_instance_actions - vars: - compute_action: start - when: oci_mode == true - -- include: vbox_reload.yml - when: oci_mode == false - -- include: lvm_reload.yml - when: oci_mode == true - -- include: setup_opatch.yml -- include: setup_database.yml +# This parameter will control if database start command was ever called. +- name : Define database_started variable to false. + set_fact: + database_started: false ### RU - block: @@ -171,4 +160,4 @@ name: oci_compute_instance_actions vars: compute_action: stop - when: oci_mode == true and not only_deploy_patch \ No newline at end of file + when: oci_mode == true and not only_deploy_patch and database_started == true \ No newline at end of file diff --git a/tasks/patch_tasks_pre.yml b/tasks/patch_tasks_pre.yml index c4217e7..50e75fb 100644 --- a/tasks/patch_tasks_pre.yml +++ b/tasks/patch_tasks_pre.yml @@ -54,27 +54,54 @@ file_type: "file" register: find_result - - fail: - msg: "Could not find patch file. Check if patch folder is correct." - when: find_result.files[0] is undefined - - - name: "Patch File" - debug: msg="{{ find_result.files[0].path }}" + # Call downloader when download_patch is defined + - block: - - name : Define Patch file name + - name: Call downloader + include: download_patch.yml + + # Try again after downloader was called + - name: Finding Patch File + find: + paths: "{{ source_folder }}" + patterns: "p{{ patch.patch_number }}_{{ db_version | regex_replace('\\.','') }}0_Linux-x86-64.zip" + recurse: "yes" + file_type: "file" + register: find_result + + when: find_result.files[0] is undefined and download_patch == true + + # If still can't find the patch but ignore flag is set, jump to the next. + - name : Patch is not there, but ignoring... set_fact: - db_patch: "{{ find_result.files[0].path }}" - unzip_patch_folder: "{{ shared_folder }}/{{ patch.patch_number }}" + skip_all: true + when: find_result.files[0] is undefined and error_on_no_patch == false - - name: Remove unzipped patch folder - file: - state: absent - path: "{{ unzip_patch_folder }}" + - block: - - name : Unzip Patch to VM shared folder - unarchive: - src: "{{ db_patch }}" - dest: "{{ shared_folder }}" + - fail: + msg: "Could not find patch file. Check if patch folder is correct." + when: find_result.files[0] is undefined + + - name: "Patch File" + debug: msg="{{ find_result.files[0].path }}" + + - name : Define Patch file name + set_fact: + db_patch: "{{ find_result.files[0].path }}" + unzip_patch_folder: "{{ shared_folder }}/{{ patch.patch_number }}" + + - name: Remove unzipped patch folder + file: + state: absent + path: "{{ unzip_patch_folder }}" + + - name : Unzip Patch to VM shared folder + unarchive: + src: "{{ db_patch }}" + dest: "{{ shared_folder }}" + + when: skip_all == false # When patch_folder variable is defined (mostly for BPs), extract that folder from unziped patch to apply - block: @@ -94,11 +121,41 @@ when: patch.patch_number != 0 and skip_all == false -- include: vbox_reload.yml - when: oci_mode == false and skip_all == false +# Trigger database refresh command if it was already started +- block: + + - include: vbox_reload.yml + when: oci_mode == false + + - include: lvm_reload.yml + when: oci_mode == true + + when: database_started == true and skip_all == false + +# Trigger database start command for the first time if never started +- block: + + - name: Call role to start OCI VM + include_role: + name: oci_compute_instance_actions + vars: + compute_action: start + when: oci_mode == true + + - include: vbox_reload.yml + when: oci_mode == false + + - include: lvm_reload.yml + when: oci_mode == true + + - include: setup_opatch.yml + - include: setup_database.yml + + - name : Define database_started variable to true. + set_fact: + database_started: true -- include: lvm_reload.yml - when: oci_mode == true and skip_all == false + when: database_started == false and skip_all == false # Replace opatch with latest version, when not processing base release. i.e patch.patch_number != 0 - block: @@ -119,4 +176,5 @@ become_user: oracle delegate_to: "{{ vm_ip_address }}" - when: db_opatch|length > 0 and patch.patch_number != 0 and skip_all == false \ No newline at end of file + # skip_all must come first as db_opatch may not yet be declared + when: skip_all == false and db_opatch|length > 0 and patch.patch_number != 0 \ No newline at end of file diff --git a/tasks/setup_env.yml b/tasks/setup_env.yml index 5337624..f8be969 100644 --- a/tasks/setup_env.yml +++ b/tasks/setup_env.yml @@ -40,4 +40,4 @@ - name : Define latest processed as null set_fact: - latest_processed: "" + latest_processed: "" \ No newline at end of file From 9ebbe2fb4d746addf3a0f9e88032a842a126eebc Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 22 Oct 2021 16:57:04 -0300 Subject: [PATCH 030/229] Improving patch_tasks_pre format. --- tasks/download_patch.yml | 2 ++ tasks/patch_tasks_pre.yml | 49 ++++++++++++++++++++------------------- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/tasks/download_patch.yml b/tasks/download_patch.yml index 1bedb37..5e675d7 100644 --- a/tasks/download_patch.yml +++ b/tasks/download_patch.yml @@ -19,6 +19,8 @@ patch={{ patch.patch_number }} \ platform=226P \ download=all \ + silent=yes \ + regexp='.*_{{ db_version | replace('.','') }}0_.*' \ MOSUser={{ downloader_user }} \ MOSPass='{{ downloader_pass }}' args: diff --git a/tasks/patch_tasks_pre.yml b/tasks/patch_tasks_pre.yml index 50e75fb..5ec79a2 100644 --- a/tasks/patch_tasks_pre.yml +++ b/tasks/patch_tasks_pre.yml @@ -20,13 +20,13 @@ - name : Define skip_all set_fact: skip_all: "{{ dump_stat_result.stat.exists }}" - when: skip_dump_exists == true + when: skip_dump_exists - name : Remove dump file if exists file: state: absent path: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" - when: skip_all == false + when: not skip_all when: not only_deploy_patch @@ -69,7 +69,7 @@ file_type: "file" register: find_result - when: find_result.files[0] is undefined and download_patch == true + when: find_result.files[0] is undefined and download_patch # If still can't find the patch but ignore flag is set, jump to the next. - name : Patch is not there, but ignoring... @@ -101,36 +101,37 @@ src: "{{ db_patch }}" dest: "{{ shared_folder }}" - when: skip_all == false + # When patch_folder variable is defined (mostly for BPs), extract that folder from unziped patch to apply + - block: - # When patch_folder variable is defined (mostly for BPs), extract that folder from unziped patch to apply - - block: + - name: Process only patch subfolder + command: "mv {{ unzip_patch_folder }}/{{ patch.patch_folder }} {{ shared_folder }}" - - name: Process only patch subfolder - command: "mv {{ unzip_patch_folder }}/{{ patch.patch_folder }} {{ shared_folder }}" + - name : Remove unzipped patch + file: + state: absent + path: "{{ unzip_patch_folder }}" - - name : Remove unzipped patch - file: - state: absent - path: "{{ unzip_patch_folder }}" + - name : Rename patch subfolder + shell: "mv {{ shared_folder }}/{{ patch.patch_folder }} {{ unzip_patch_folder }}" - - name : Rename patch subfolder - shell: "mv {{ shared_folder }}/{{ patch.patch_folder }} {{ unzip_patch_folder }}" + when: patch.patch_folder is defined - when: patch.patch_folder is defined + # This is required as skip_all may be set by error_on_no_patch == false + when: not skip_all - when: patch.patch_number != 0 and skip_all == false + when: patch.patch_number != 0 and not skip_all # Trigger database refresh command if it was already started - block: - include: vbox_reload.yml - when: oci_mode == false + when: not oci_mode - include: lvm_reload.yml - when: oci_mode == true + when: oci_mode - when: database_started == true and skip_all == false + when: database_started and not skip_all # Trigger database start command for the first time if never started - block: @@ -140,13 +141,13 @@ name: oci_compute_instance_actions vars: compute_action: start - when: oci_mode == true + when: oci_mode - include: vbox_reload.yml - when: oci_mode == false + when: not oci_mode - include: lvm_reload.yml - when: oci_mode == true + when: oci_mode - include: setup_opatch.yml - include: setup_database.yml @@ -155,7 +156,7 @@ set_fact: database_started: true - when: database_started == false and skip_all == false + when: not database_started and not skip_all # Replace opatch with latest version, when not processing base release. i.e patch.patch_number != 0 - block: @@ -177,4 +178,4 @@ delegate_to: "{{ vm_ip_address }}" # skip_all must come first as db_opatch may not yet be declared - when: skip_all == false and db_opatch|length > 0 and patch.patch_number != 0 \ No newline at end of file + when: not skip_all and db_opatch|length > 0 and patch.patch_number != 0 \ No newline at end of file From 90cbcb410b39363496e399250c7c8a1516daa2cf Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 12 Nov 2021 16:13:33 -0300 Subject: [PATCH 031/229] New sh_extractor and small fixes --- list_exceptions.yml | 3 + list_patches.yml | 18 ++++- tasks/main_RU_RUR.yml | 2 +- tasks/patch_tasks_pre.yml | 48 ++++++----- user_scripts/odbfcl/sh_extractor/bugsGet.sh | 48 +++++++++++ .../odbfcl/sh_extractor/dumpCreate.sh | 81 +++++++++++++++++++ user_scripts/odbfcl/sh_extractor/exporter.sh | 76 +++++++++++++++++ .../odbfcl/sh_extractor/fileCollect.sh | 34 ++++++++ user_scripts/odbfcl/sh_extractor/fileGet.sh | 57 +++++++++++++ user_scripts/odbfcl/sh_extractor/symbolGet.sh | 47 +++++++++++ user_scripts/odbfcl/tables_create.sql | 2 +- 11 files changed, 394 insertions(+), 22 deletions(-) create mode 100644 user_scripts/odbfcl/sh_extractor/bugsGet.sh create mode 100644 user_scripts/odbfcl/sh_extractor/dumpCreate.sh create mode 100644 user_scripts/odbfcl/sh_extractor/exporter.sh create mode 100644 user_scripts/odbfcl/sh_extractor/fileCollect.sh create mode 100644 user_scripts/odbfcl/sh_extractor/fileGet.sh create mode 100644 user_scripts/odbfcl/sh_extractor/symbolGet.sh diff --git a/list_exceptions.yml b/list_exceptions.yml index b95e2e5..ebd2149 100644 --- a/list_exceptions.yml +++ b/list_exceptions.yml @@ -39,3 +39,6 @@ list_retry_datapatch: - { version: "12.1.0.2" , type : "PSU" , id : 210720 , retries : 2 } - { version: "12.1.0.2" , type : "BP" , id : 210720 , retries : 2 } - { version: "12.2.0.1" , type : "RU" , id : 210720 , retries : 1 } + - { version: "12.1.0.2" , type : "PSU" , id : 211019 , retries : 2 } + - { version: "12.1.0.2" , type : "BP" , id : 211019 , retries : 2 } + - { version: "12.2.0.1" , type : "RU" , id : 211019 , retries : 1 } diff --git a/list_patches.yml b/list_patches.yml index 68b0ebb..ae714b6 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -36,6 +36,7 @@ list_11204: - { type : "PSU" , id : 210119 , patch_number : 31983472 } - { type : "PSU" , id : 210420 , patch_number : 32328626 } - { type : "PSU" , id : 210720 , patch_number : 32758711 } + - { type : "PSU" , id : 211019 , patch_number : 33128584 } - { type : "OJVM" , id : 1 , patch_number : 19282021 } - { type : "OJVM" , id : 2 , patch_number : 19877440 } - { type : "OJVM" , id : 3 , patch_number : 20406239 } @@ -64,6 +65,7 @@ list_11204: # - { type : "OJVM" , id : 210119 , patch_number : } - { type : "OJVM" , id : 210420 , patch_number : 32671980 } - { type : "OJVM" , id : 210720 , patch_number : 32876451 } + - { type : "OJVM" , id : 211019 , patch_number : 33192642 } - { type : "BP" , id : 1 , patch_number : 17628025 , patch_folder : 17628006 } - { type : "BP" , id : 2 , patch_number : 17838803 , patch_folder : 17741631 } - { type : "BP" , id : 3 , patch_number : 17904156 , patch_folder : 17943261 } @@ -108,6 +110,7 @@ list_11204: - { type : "BP" , id : 210119 , patch_number : 32131241 , patch_folder : 31983477 } - { type : "BP" , id : 210420 , patch_number : 32537095 , patch_folder : 32328629 } - { type : "BP" , id : 210720 , patch_number : 32917411 , patch_folder : 32758732 } + - { type : "BP" , id : 211019 , patch_number : 33248386 , patch_folder : 33128587 } #################### @@ -176,6 +179,7 @@ list_12102: - { type : "PSU" , id : 210119 , patch_number : 31985579 } - { type : "PSU" , id : 210420 , patch_number : 32328635 } - { type : "PSU" , id : 210720 , patch_number : 32768233 } + - { type : "PSU" , id : 211019 , patch_number : 33128590 } - { type : "OJVM" , id : 1 , patch_number : 19282028 } - { type : "OJVM" , id : 2 , patch_number : 19877336 } - { type : "OJVM" , id : 3 , patch_number : 20415564 } @@ -204,6 +208,7 @@ list_12102: - { type : "OJVM" , id : 210119 , patch_number : 32119956 } - { type : "OJVM" , id : 210420 , patch_number : 32473164 } - { type : "OJVM" , id : 210720 , patch_number : 32876425 } + - { type : "OJVM" , id : 211019 , patch_number : 33192662 } - { type : "BP" , id : 1 , patch_number : 19404326 , patch_folder : 19189240 } - { type : "BP" , id : 2 , patch_number : 19774304 , patch_folder : 19649591 } - { type : "BP" , id : 3 , patch_number : 20026159 , patch_folder : 19878106 } @@ -241,6 +246,7 @@ list_12102: - { type : "BP" , id : 210119 , patch_number : 32131231 , patch_folder : 31965033 } - { type : "BP" , id : 210420 , patch_number : 32518631 , patch_folder : 32328632 } - { type : "BP" , id : 210720 , patch_number : 32917362 , patch_folder : 32768230 } + - { type : "BP" , id : 211019 , patch_number : 33248411 , patch_folder : 33114885 } #################### @@ -268,6 +274,7 @@ list_12201: - { type : "RU" , id : 210119 , patch_number : 32228578 } - { type : "RU" , id : 210420 , patch_number : 32507738 } - { type : "RU" , id : 210720 , patch_number : 32916808 } + - { type : "RU" , id : 211019 , patch_number : 33261817 } - { type : "RUR" , id : 171017 , patch_number : 26518812 , base_ru : JUL2017 } - { type : "RUR" , id : 180116 , patch_number : 27013506 , base_ru : JUL2017 } - { type : "RUR" , id : 180116 , patch_number : 27013510 , base_ru : OCT2017 } @@ -310,6 +317,7 @@ list_12201: - { type : "OJVM" , id : 210119 , patch_number : 32119931 } - { type : "OJVM" , id : 210420 , patch_number : 32473172 } - { type : "OJVM" , id : 210720 , patch_number : 32876409 } + - { type : "OJVM" , id : 211019 , patch_number : 33192662 } #################### ##### 18.0.0.0 ##### @@ -333,8 +341,8 @@ list_18000: - { type : "RU" , id : 12 , patch_number : 31730250 } - { type : "RU" , id : 13 , patch_number : 32204699 } - { type : "RU" , id : 14 , patch_number : 32524155 } - - { type : "RUR" , id : 1 , patch_number : 28346593 , base_ru : '18.2' } - - { type : "RUR" , id : 2 , patch_number : 28601267 , base_ru : '18.2' } + # - { type : "RUR" , id : 1 , patch_number : 28346593 , base_ru : '18.2' } + # - { type : "RUR" , id : 2 , patch_number : 28601267 , base_ru : '18.2' } - { type : "RUR" , id : 1 , patch_number : 28507480 , base_ru : '18.3' } - { type : "RUR" , id : 2 , patch_number : 28790643 , base_ru : '18.3' } - { type : "RUR" , id : 1 , patch_number : 28822587 , base_ru : '18.4' } @@ -389,6 +397,7 @@ list_19000: - { type : "RU" , id : 10 , patch_number : 32218454 } - { type : "RU" , id : 11 , patch_number : 32545013 } - { type : "RU" , id : 12 , patch_number : 32904851 } + - { type : "RU" , id : 13 , patch_number : 33192793 } - { type : "RUR" , id : 1 , patch_number : 29799057 , base_ru : '19.3' } - { type : "RUR" , id : 2 , patch_number : 30087906 , base_ru : '19.3' } - { type : "RUR" , id : 1 , patch_number : 30080447 , base_ru : '19.4' } @@ -407,6 +416,8 @@ list_19000: - { type : "RUR" , id : 2 , patch_number : 32819074 , base_ru : '19.10' } - { type : "RUR" , id : 3 , patch_number : 32923627 , base_ru : '19.10' } - { type : "RUR" , id : 1 , patch_number : 32844504 , base_ru : '19.11' } + - { type : "RUR" , id : 2 , patch_number : 33153989 , base_ru : '19.11' } + - { type : "RUR" , id : 1 , patch_number : 33210889 , base_ru : '19.12' } - { type : "OJVM" , id : 190416 , patch_number : 29548437 } - { type : "OJVM" , id : 190716 , patch_number : 29774421 } - { type : "OJVM" , id : 191015 , patch_number : 30128191 } @@ -417,9 +428,12 @@ list_19000: - { type : "OJVM" , id : 210119 , patch_number : 32067171 } - { type : "OJVM" , id : 210420 , patch_number : 32399816 } - { type : "OJVM" , id : 210720 , patch_number : 32876380 } + - { type : "OJVM" , id : 211019 , patch_number : 33192694 } #################### ##### 21.0.0.0 ##### #################### list_21000: + #- { type : "RU" , id : 3 , patch_number : 00000000 , base_snap : "21.2.0" } + - { type : "RU" , id : 4 , patch_number : 33239276 } \ No newline at end of file diff --git a/tasks/main_RU_RUR.yml b/tasks/main_RU_RUR.yml index 4e96bd3..9ea2b96 100644 --- a/tasks/main_RU_RUR.yml +++ b/tasks/main_RU_RUR.yml @@ -160,4 +160,4 @@ name: oci_compute_instance_actions vars: compute_action: stop - when: oci_mode == true and not only_deploy_patch and database_started == true \ No newline at end of file + when: oci_mode == true and not only_deploy_patch and database_started \ No newline at end of file diff --git a/tasks/patch_tasks_pre.yml b/tasks/patch_tasks_pre.yml index 5ec79a2..a352835 100644 --- a/tasks/patch_tasks_pre.yml +++ b/tasks/patch_tasks_pre.yml @@ -7,6 +7,7 @@ skip_all: false fix_datapatch_retries: 0 expdp_version: "" + patch_file_path: "" # Ignore dumpfile checks when only_deploy_patch is true - block: @@ -54,6 +55,11 @@ file_type: "file" register: find_result + - name : Define patch_file_path + set_fact: + patch_file_path: "{{ find_result.files[0].path }}" + when: find_result.files[0] is defined + # Call downloader when download_patch is defined - block: @@ -61,34 +67,39 @@ include: download_patch.yml # Try again after downloader was called - - name: Finding Patch File + - name: Finding Patch File Again find: paths: "{{ source_folder }}" patterns: "p{{ patch.patch_number }}_{{ db_version | regex_replace('\\.','') }}0_Linux-x86-64.zip" recurse: "yes" file_type: "file" register: find_result - - when: find_result.files[0] is undefined and download_patch + + - name : Define patch_file_path + set_fact: + patch_file_path: "{{ find_result.files[0].path }}" + when: find_result.files[0] is defined + + when: (patch_file_path|length == 0) and download_patch # If still can't find the patch but ignore flag is set, jump to the next. - name : Patch is not there, but ignoring... set_fact: skip_all: true - when: find_result.files[0] is undefined and error_on_no_patch == false + when: (patch_file_path|length == 0) and error_on_no_patch == false - block: - fail: msg: "Could not find patch file. Check if patch folder is correct." - when: find_result.files[0] is undefined + when: (patch_file_path|length == 0) - name: "Patch File" - debug: msg="{{ find_result.files[0].path }}" + debug: msg="{{ patch_file_path }}" - name : Define Patch file name set_fact: - db_patch: "{{ find_result.files[0].path }}" + db_patch: "{{ patch_file_path }}" unzip_patch_folder: "{{ shared_folder }}/{{ patch.patch_number }}" - name: Remove unzipped patch folder @@ -122,17 +133,6 @@ when: patch.patch_number != 0 and not skip_all -# Trigger database refresh command if it was already started -- block: - - - include: vbox_reload.yml - when: not oci_mode - - - include: lvm_reload.yml - when: oci_mode - - when: database_started and not skip_all - # Trigger database start command for the first time if never started - block: @@ -158,6 +158,18 @@ when: not database_started and not skip_all +# Trigger database refresh command. +# This must be executed even if the "not database_started" block was just executed because of setup_database.yml script. +- block: + + - include: vbox_reload.yml + when: not oci_mode + + - include: lvm_reload.yml + when: oci_mode + + when: not skip_all + # Replace opatch with latest version, when not processing base release. i.e patch.patch_number != 0 - block: diff --git a/user_scripts/odbfcl/sh_extractor/bugsGet.sh b/user_scripts/odbfcl/sh_extractor/bugsGet.sh new file mode 100644 index 0000000..f44dfd0 --- /dev/null +++ b/user_scripts/odbfcl/sh_extractor/bugsGet.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# Script to get all bugs fixed on OPatch +# Created by Rodrigo Jorge + +set -eo pipefail + +function echoError () +{ + (>&2 echo "$1") +} + +function exitError () +{ + echoError "$1" + exit 1 +} + +v_output="$1" + +[ -z "$v_output" ] && exitError "First parameter is the target file and cannot be null." +[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." +[ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." + +echo "Generating bugs list. Please wait.." + +"${ORACLE_HOME}"/OPatch/opatch lsinv -bugs_fixed | +# Remove lines before this entry (inclusive) +sed '1,/^List of Bugs fixed by Installed Patches/d' | +# Remove lines before this entry (inclusive) +sed '1,/^---/d' | +# Remove lines after this entry (inclusive) +sed '/^---/Q' | +# Remove empty lines +sed '/^$/d' | +# Remove breaks from lines not starting with number +sed ':a $!{N; ba}; s/\n\+/\n/g; s/\n\([^0-9]\)/\1/g' | +# Remove double spaces +sed -E 's/[[:space:]]+/ /g' | +# Remove date columns +awk '{$3=$4=$5=$6=$7=$8=""; print $0}' | +# Remove double spaces again after column removal +sed -E 's/[[:space:]]+/ /g' | +# Replace first space per tab +sed 's/ /'$'\t''/' | +# Replace first space per tab (that was the second) +sed 's/ /'$'\t''/' > "${v_output}" + +exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh new file mode 100644 index 0000000..40b0465 --- /dev/null +++ b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh @@ -0,0 +1,81 @@ +#!/bin/bash +# Script to list all symbols in ORACLE_HOME +# Created by Rodrigo Jorge + +set -eo pipefail + +function echoError () +{ + (>&2 echo "$1") +} + +function exitError () +{ + echoError "$1" + exit 1 +} + +v_output="$1" + +[ -z "$v_output" ] && exitError "First parameter is the target file and cannot be null." +[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." +[ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." +[ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." + +v_output_fdr="$(cd "$(dirname "${v_output}")"; pwd)" +v_output_file="$(basename "${v_output}")" + +v_output_full="${v_output_fdr}/${v_output_file}" + +v_user='c##hash' +v_pass='hash' + +v_thisdir="$(cd "$(dirname "$0")"; pwd)" + +v_output_file_noext="${v_output_file%.*}" + +v_output_file_cnt=`awk -F"_" '{print NF-1}' <<< "${v_output_file_noext}"` +[ ${v_output_file_cnt} -ne 2 ] && exitError "File \"${v_output}\" must have 2 \"_\" on the name." + +v_output_file_cnt=`awk -F" " '{print NF-1}' <<< "${v_output_file_noext}"` +[ ${v_output_file_cnt} -ne 0 ] && exitError "File \"${v_output}\" must not have any spaces." + +v_patch_version=`cut -d '_' -f 1 <<< "${v_output_file_noext}"` +v_patch_type=`cut -d '_' -f 2 <<< "${v_output_file_noext}"` +v_patch_id=`cut -d '_' -f 3 <<< "${v_output_file_noext}"` + +v_output_file_cnt=`awk -F"." '{print NF-1}' <<< "${v_patch_version}"` +[ ${v_output_file_cnt} -ne 3 ] && exitError "Version \"${v_patch_version}\" must be in \"X.X.X.X\" format." + +re='^[0-9]+$' +if ! [[ $v_patch_id =~ $re ]] ; then + exitError "\"$v_patch_id\" must be a number." +fi + +echo "Generating tables export. Please wait.." + +cd "${v_thisdir}"/../ +$ORACLE_HOME/bin/sqlplus "/ as sysdba" < + +set -eo pipefail + +function echoError () +{ + (>&2 echo "$1") +} + +function exitError () +{ + echoError "$1" + exit 1 +} + +v_pattern="$1" + +[ -z "$v_pattern" -o "$#" -ne 1 ] && exitError "Usage: $0 + +First parameter is the file name pattern and cannot be null. + +The pattern is composed by 3 parts, divided by \"_\": +1st - Version, in the X.X.X.X format. +2nd - Type. Can be any string. +3rd - ID. Must be a number. + +Eg: $0 19.0.0.0_RU-L_14 + +The output is a zip file. +" + +v_pattern_cnt=`awk -F"_" '{print NF-1}' <<< "${v_pattern}"` +[ ${v_pattern_cnt} -ne 2 ] && exitError "Pattern \"${v_output}\" must have 2 \"_\" on it. Eg: 19.0.0.0_RU-L_14" + +v_pattern_cnt=`awk -F" " '{print NF-1}' <<< "${v_pattern}"` +[ ${v_pattern_cnt} -ne 0 ] && exitError "Pattern \"${v_output}\" must not have any spaces. Eg: 19.0.0.0_RU-L_14" + +v_patch_version=`cut -d '_' -f 1 <<< "${v_pattern}"` +v_patch_type=`cut -d '_' -f 2 <<< "${v_pattern}"` +v_patch_id=`cut -d '_' -f 3 <<< "${v_pattern}"` + +v_pattern_cnt=`awk -F"." '{print NF-1}' <<< "${v_patch_version}"` +[ ${v_pattern_cnt} -ne 3 ] && exitError "Version \"${v_patch_version}\" must be in \"X.X.X.X\" format. Eg: 19.0.0.0_RU-L_14" + +re='^[0-9]+$' +if ! [[ $v_patch_id =~ $re ]] ; then + exitError "\"$v_patch_id\" must be a number. Eg: 19.0.0.0_RU-L_14" +fi + +v_zip=${v_pattern}.zip + +v_file=bugs_${v_pattern}.txt +sh bugsGet.sh ${v_file} +zip -m ${v_zip} ${v_file} + +v_file=sha256sum_${v_pattern}.chk +sh fileGet.sh ${v_file} +zip -m ${v_zip} ${v_file} + +v_file=txtcol_${v_pattern}.tar.gz +sh fileCollect.sh ${v_file} +zip -m ${v_zip} ${v_file} + +v_file=symbols_${v_pattern}.csv +sh symbolGet.sh ${v_file} +zip -m ${v_zip} ${v_file} + +sh dumpCreate.sh ${v_pattern}.dmp +mv ${v_pattern}.dmp tables_${v_pattern}.dmp +mv ${v_pattern}.log tables_${v_pattern}.log +zip -m ${v_pattern}.zip tables_${v_pattern}.dmp +zip -m ${v_pattern}.zip tables_${v_pattern}.log + +exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/fileCollect.sh b/user_scripts/odbfcl/sh_extractor/fileCollect.sh new file mode 100644 index 0000000..ed705ba --- /dev/null +++ b/user_scripts/odbfcl/sh_extractor/fileCollect.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Script to get all non-binary files in ORACLE_HOME +# Created by Rodrigo Jorge + +set -eo pipefail + +function echoError () +{ + (>&2 echo "$1") +} + +function exitError () +{ + echoError "$1" + exit 1 +} + +v_output="$1" + +[ -z "$v_output" ] && exitError "First parameter is the target file and cannot be null." +[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." +[ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." + +v_output_fdr="$(cd "$(dirname "${v_output}")"; pwd)" +v_output_file="$(basename "${v_output}")" + +v_output_full="${v_output_fdr}/${v_output_file}" + +echo "Generating ORACLE_HOME non-binary files list. Please wait.." + +cd "$ORACLE_HOME" +find -type f -not -path "./.patch_storage/*" -not -name "tfa_setup" -print0 | xargs -0 grep -Il '.' | tar -czf "${v_output_full}" -T - + +exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/fileGet.sh b/user_scripts/odbfcl/sh_extractor/fileGet.sh new file mode 100644 index 0000000..c3c0a5f --- /dev/null +++ b/user_scripts/odbfcl/sh_extractor/fileGet.sh @@ -0,0 +1,57 @@ +#!/bin/bash +# Script to get the sha256sum of all ORACLE_HOME files and libraries +# Created by Rodrigo Jorge + +set -eo pipefail + +function echoError () +{ + (>&2 echo "$1") +} + +function exitError () +{ + echoError "$1" + exit 1 +} + +v_output="$1" + +[ -z "$v_output" ] && exitError "First parameter is the target file and cannot be null." +[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." +[ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." + +v_output_fdr="$(cd "$(dirname "${v_output}")"; pwd)" +v_output_file="$(basename "${v_output}")" + +v_output_full="${v_output_fdr}/${v_output_file}" + +echo "Generating sha256sum list. Please wait.." + +cd "$ORACLE_HOME" +find -type f -exec sha256sum "{}" + > "${v_output_full}" +cd - > /dev/null + +sed -i 's/$/ F/' "${v_output_full}" + +v_libs=$(find "$ORACLE_HOME" -type f -name "*.a") + +v_ext_fold=`mktemp -d` +v_out_file=`mktemp` + +IFS=$'\n' +for v_lib in ${v_libs} +do + rm -rf "${v_ext_fold}" + mkdir "${v_ext_fold}" + cd "${v_ext_fold}" + ar x "${v_lib}" + find -type f -exec sha256sum "{}" + > "${v_out_file}" + cd - > /dev/null + sed -i "s| \.| ${v_lib}|" "${v_out_file}" + sed -i 's/$/ L/' "${v_out_file}" + cat "${v_out_file}" >> "${v_output}" + rm -rf "${v_ext_fold}" "${v_out_file}" +done + +exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/symbolGet.sh b/user_scripts/odbfcl/sh_extractor/symbolGet.sh new file mode 100644 index 0000000..9823c30 --- /dev/null +++ b/user_scripts/odbfcl/sh_extractor/symbolGet.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# Script to list all symbols in ORACLE_HOME +# Created by Rodrigo Jorge + +# set -eo pipefail +set -e # grep can return 0 lines + +function echoError () +{ + (>&2 echo "$1") +} + +function exitError () +{ + echoError "$1" + exit 1 +} + +v_output="$1" + +[ -z "$v_output" ] && exitError "First parameter is the target file and cannot be null." +[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." +[ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." + +echo > "${v_output}" + +echo "Generating symbols list. Please wait.." + +# Extract Symbols from Oracle archives (.a) +for ARCHIVE in $(ls $ORACLE_HOME/lib/*.a $ORACLE_HOME/rdbms/lib/*.a) +do + nm -A $ARCHIVE | grep ' [Tt] ' | tr ':' ' ' | cut -d" " -f1,2,4,5 | sort -u | awk '{ if ( $4 != "" ) { file=$1; sub(".*/","", file); printf "%s/%s|%s|%s\n", file, $2, $3, $4 } }' >> "${v_output}" +done + +# Extract Symbols from Oracle objects (.o) +for OBJECT in $(ls $ORACLE_HOME/lib/*.o $ORACLE_HOME/rdbms/lib/*.o) +do + nm -A $OBJECT | grep ' [Tt] ' | tr ':' ' ' | cut -d" " -f1,3,4 | sort -u | awk '{ if ( $3 != "" ) { file=$1; sub(".*/","", file); printf "%s|%s|%s\n", file, $2, $3 } }' >> "${v_output}" +done + +# Extract Symbols from Oracle executable +nm -A -C $ORACLE_HOME/bin/oracle | grep ' [TtDdRrVv] ' | tr ':' ' ' | cut -d" " -f1,3,4 | sort -u | awk '{ if ( $3 != "" ) { file=$1; sub(".*/","", file); printf "%s|%s|%s\n", file, $2, $3 } }' >> "${v_output}" + +# Remove empty lines or sqlldr will fail due to constant. +sed -i '/^$/d' "${v_output}" + +exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/tables_create.sql b/user_scripts/odbfcl/tables_create.sql index ffd3d3f..e07a9a2 100644 --- a/user_scripts/odbfcl/tables_create.sql +++ b/user_scripts/odbfcl/tables_create.sql @@ -282,7 +282,7 @@ CREATE TABLE "T_SYSTEM_FIX_CONTROL" ( "BUGNO" NUMBER NOT NULL, "VALUE" NUMBER, -"SQL_FEATURE" VARCHAR2(64 CHAR) NOT NULL, +"SQL_FEATURE" VARCHAR2(64 CHAR), -- NOT NULL, -- Found NULL entry on 12.1.0.2 - 18907562 "DESCRIPTION" VARCHAR2(64 CHAR), "OPTIMIZER_FEATURE_ENABLE" VARCHAR2(25 CHAR), "EVENT" NUMBER, From 062b9bc4bc1999c6cab664afb78aba2924dafa40 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 12 Nov 2021 16:15:00 -0300 Subject: [PATCH 032/229] Config adjustments --- config_main.yml | 8 +++++++- config_oci.yml | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/config_main.yml b/config_main.yml index d7e8aa8..769c32b 100644 --- a/config_main.yml +++ b/config_main.yml @@ -8,4 +8,10 @@ skip_dump_exists: true only_deploy_patch: false # Target DB version where dumps will be imported -target_db_version: 19 # Used to check if version parameter will be required on expdp \ No newline at end of file +target_db_version: 19 # Used to check if version parameter will be required on expdp + +# Download Mode? If true, script will try to download the patch if not found in "source_folder". +download_patch : true + +# Stop when patch zip is not found? Control if the code will fail or just skip that patch. +error_on_no_patch : true \ No newline at end of file diff --git a/config_oci.yml b/config_oci.yml index 6760b7b..907b231 100644 --- a/config_oci.yml +++ b/config_oci.yml @@ -13,6 +13,11 @@ mysid : "orcl" # Folder to store the final generated files. output_folder : "/u01/patch_automation/output" +# Download utility info, if you are using one. +# wget https://github.com/MarisElsins/getMOSPatch/raw/master/getMOSPatch.jar +downloader_tool : "/u01/patch_automation/patches/getMOSPatch.jar" +downloader_user : "" +downloader_pass : "" # Files in "user_scripts" folder that will run before and after the final expdp. script_types can be "shell", "sql" or "yml". user_expdp_pre : - { file : "bugsGet.yml" , folder : "user_scripts/odbfcl/extract" , type : "yml", task_action : "Generate fixed bugs list for ORACLE_HOME" } From f80d4c94ee2b527f967a54f22909d6ab2d1a09fb Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 6 Jan 2022 14:59:55 -0300 Subject: [PATCH 033/229] Include new update_table_keys script Include new update_table_keys script --- config_oci.yml | 1 + user_scripts/odbfcl/update_table_keys_adb.sql | 70 +++++++++++++++++++ user_scripts/odbfcl/update_table_keys_adb.yml | 8 +++ 3 files changed, 79 insertions(+) create mode 100644 user_scripts/odbfcl/update_table_keys_adb.sql create mode 100644 user_scripts/odbfcl/update_table_keys_adb.yml diff --git a/config_oci.yml b/config_oci.yml index 907b231..e6e7d4e 100644 --- a/config_oci.yml +++ b/config_oci.yml @@ -35,6 +35,7 @@ user_expdp_post : - { file : "adb_load_filechksum.yml" , folder : "user_scripts/odbfcl/adb_load_filechksum" , type : "yml", task_action : "Load chksum for ORACLE_HOME in ADB" } - { file : "adb_load_symbols.yml" , folder : "user_scripts/odbfcl/adb_load_symbols" , type : "yml", task_action : "Load chksum for ORACLE_HOME in ADB" } - { file : "adb_load_txtcollection_files.yml" , folder : "user_scripts/odbfcl/adb_load_txtcollection_files" , type : "yml", task_action : "Load non-binary files from ORACLE_HOME in ADB" } +- { file : "update_table_keys_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Update table keys to reflect correct partition name" } - { file : "exchange_tables_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Exchange loaded table in the correct partition position" } # User that will hold your tables outputs and be exported after each execution. If the database is CDB, "C##" will be automatically inserted if not. diff --git a/user_scripts/odbfcl/update_table_keys_adb.sql b/user_scripts/odbfcl/update_table_keys_adb.sql new file mode 100644 index 0000000..738d0a4 --- /dev/null +++ b/user_scripts/odbfcl/update_table_keys_adb.sql @@ -0,0 +1,70 @@ +WHENEVER SQLERROR EXIT SQL.SQLCODE + +SET LINES 1000 + +DEF P_VERSION = '&1' +DEF P_SERIES = '&2' +DEF P_PATCH = '&3' + +SET SERVEROUT ON +DECLARE + + -------------------------------------------- + + FUNCTION IS_READY ( + P_OWNER IN VARCHAR2, + P_TABLENAME IN VARCHAR2 + ) RETURN BOOLEAN + IS + V_RES NUMBER; + V_CMD CLOB; + BEGIN + -- BE READY = FIND LINES TO UPDATE + V_CMD := ' + SELECT 1 FROM DUAL + WHERE EXISTS + ( SELECT 1 FROM ' || DBMS_ASSERT.ENQUOTE_NAME(P_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(P_TABLENAME) || ' + WHERE NOT ( ORAVERSION = ''&P_VERSION.'' AND + ORASERIES = ''&P_SERIES.'' AND + ORAPATCH = &P_PATCH. + ) + )'; + -- DBMS_OUTPUT.PUT_LINE(V_CMD || ';'); + EXECUTE IMMEDIATE V_CMD + INTO V_RES; + RETURN TRUE; + EXCEPTION + WHEN NO_DATA_FOUND THEN + RETURN FALSE; + END; + + -------------------------------------------- + + PROCEDURE RUN_CMD (P_CMD CLOB) + IS + BEGIN + DBMS_OUTPUT.PUT_LINE(P_CMD || ';'); + EXECUTE IMMEDIATE P_CMD; + END; + + -------------------------------------------- + +BEGIN + FOR I IN (SELECT TABLE_NAME FROM USER_TABLES WHERE TABLE_NAME LIKE 'T\_%' ESCAPE '\' ORDER BY TABLE_NAME) + LOOP + + IF NOT IS_READY(USER,I.TABLE_NAME) + THEN + DBMS_OUTPUT.PUT_LINE( '--- ' || I.TABLE_NAME || ' - NOTHING TO DO'); + CONTINUE; + END IF; + + RUN_CMD('UPDATE ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' SET ORAVERSION = ''&P_VERSION.'', ORASERIES = ''&P_SERIES.'', ORAPATCH = &P_PATCH.'); + DBMS_OUTPUT.PUT_LINE(TO_CHAR(SQL%ROWCOUNT) || ' rows affected.'); + RUN_CMD('ALTER TABLE ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' MOVE ONLINE'); + + END LOOP; +END; +/ + +EXIT 0 diff --git a/user_scripts/odbfcl/update_table_keys_adb.yml b/user_scripts/odbfcl/update_table_keys_adb.yml new file mode 100644 index 0000000..b49bf14 --- /dev/null +++ b/user_scripts/odbfcl/update_table_keys_adb.yml @@ -0,0 +1,8 @@ +- name: "Update {{ oci_adb_transient_user }} tables with new keys" + shell: | + set -e + sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/update_table_keys_adb.sql {{ db_version }} {{ patch.base_ru | default('') }}{{ patch.type }} {{ patch.id }} + register: sqloutput + +- name: SQL Output + debug: msg="{{ sqloutput.stdout_lines }}" \ No newline at end of file From 2f5640c072e3f98fee21443f1efda9146c7522d0 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 6 Jan 2022 15:01:28 -0300 Subject: [PATCH 034/229] Refine manual extractor --- .../{sh_extractor => extract}/fileGet.sh | 0 user_scripts/odbfcl/sh_extractor/build_zip.sh | 16 ++++ .../odbfcl/sh_extractor/cleanUser.sql | 8 ++ .../odbfcl/sh_extractor/dumpCreate.sh | 5 ++ .../odbfcl/sh_extractor/dumpCreate_inzip.sh | 82 +++++++++++++++++++ user_scripts/odbfcl/sh_extractor/exporter.sh | 13 +-- 6 files changed, 119 insertions(+), 5 deletions(-) rename user_scripts/odbfcl/{sh_extractor => extract}/fileGet.sh (100%) create mode 100644 user_scripts/odbfcl/sh_extractor/build_zip.sh create mode 100644 user_scripts/odbfcl/sh_extractor/cleanUser.sql create mode 100644 user_scripts/odbfcl/sh_extractor/dumpCreate_inzip.sh diff --git a/user_scripts/odbfcl/sh_extractor/fileGet.sh b/user_scripts/odbfcl/extract/fileGet.sh similarity index 100% rename from user_scripts/odbfcl/sh_extractor/fileGet.sh rename to user_scripts/odbfcl/extract/fileGet.sh diff --git a/user_scripts/odbfcl/sh_extractor/build_zip.sh b/user_scripts/odbfcl/sh_extractor/build_zip.sh new file mode 100644 index 0000000..0c83c90 --- /dev/null +++ b/user_scripts/odbfcl/sh_extractor/build_zip.sh @@ -0,0 +1,16 @@ +set -eo pipefail + +mkdir exporter +cp -a ../extract/ exporter/ +cp -a ../createUser.sql exporter/ +cp -a ../tables_recreate.sql exporter/ +cp -a ../tables_create.sql exporter/ +cp -a ../../externalDir.sql exporter/ +cp -a *.sh *.sql exporter/ +mv exporter/dumpCreate_inzip.sh exporter/dumpCreate.sh +find exporter/ -name "*.yml" -delete +find exporter/ -name ".DS_Store" -delete +rm -f exporter/build_zip.sh + +rm -f exporter.zip +zip -rm exporter.zip exporter/ \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/cleanUser.sql b/user_scripts/odbfcl/sh_extractor/cleanUser.sql new file mode 100644 index 0000000..73858b2 --- /dev/null +++ b/user_scripts/odbfcl/sh_extractor/cleanUser.sql @@ -0,0 +1,8 @@ +-- This code will clean the created objects. +WHENEVER SQLERROR EXIT SQL.SQLCODE + +DROP DIRECTORY expdir; + +DROP USER C##HASH CASCADE; + +EXIT 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh index 40b0465..37ccfa0 100644 --- a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh @@ -78,4 +78,9 @@ logfile="${v_output_file_noext}.log" \ content=data_only \ schemas="${v_user}" +cd ../extract/sh_extractor/ +$ORACLE_HOME/bin/sqlplus "/ as sysdba" < + +set -eo pipefail + +function echoError () +{ + (>&2 echo "$1") +} + +function exitError () +{ + echoError "$1" + exit 1 +} + +v_output="$1" + +[ -z "$v_output" ] && exitError "First parameter is the target file and cannot be null." +[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." +[ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." +[ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." + +v_output_fdr="$(cd "$(dirname "${v_output}")"; pwd)" +v_output_file="$(basename "${v_output}")" + +v_output_full="${v_output_fdr}/${v_output_file}" + +v_user='c##hash' +v_pass='hash' + +v_thisdir="$(cd "$(dirname "$0")"; pwd)" + +v_output_file_noext="${v_output_file%.*}" + +v_output_file_cnt=`awk -F"_" '{print NF-1}' <<< "${v_output_file_noext}"` +[ ${v_output_file_cnt} -ne 2 ] && exitError "File \"${v_output}\" must have 2 \"_\" on the name." + +v_output_file_cnt=`awk -F" " '{print NF-1}' <<< "${v_output_file_noext}"` +[ ${v_output_file_cnt} -ne 0 ] && exitError "File \"${v_output}\" must not have any spaces." + +v_patch_version=`cut -d '_' -f 1 <<< "${v_output_file_noext}"` +v_patch_type=`cut -d '_' -f 2 <<< "${v_output_file_noext}"` +v_patch_id=`cut -d '_' -f 3 <<< "${v_output_file_noext}"` + +v_output_file_cnt=`awk -F"." '{print NF-1}' <<< "${v_patch_version}"` +[ ${v_output_file_cnt} -ne 3 ] && exitError "Version \"${v_patch_version}\" must be in \"X.X.X.X\" format." + +re='^[0-9]+$' +if ! [[ $v_patch_id =~ $re ]] ; then + exitError "\"$v_patch_id\" must be a number." +fi + +echo "Generating tables export. Please wait.." + +$ORACLE_HOME/bin/sqlplus "/ as sysdba" < +# v1.0.0.0 set -eo pipefail @@ -49,25 +50,27 @@ if ! [[ $v_patch_id =~ $re ]] ; then exitError "\"$v_patch_id\" must be a number. Eg: 19.0.0.0_RU-L_14" fi +v_thisdir="$(cd "$(dirname "$0")"; pwd)" + v_zip=${v_pattern}.zip v_file=bugs_${v_pattern}.txt -sh bugsGet.sh ${v_file} +sh "${v_thisdir}/bugsGet.sh" ${v_file} zip -m ${v_zip} ${v_file} v_file=sha256sum_${v_pattern}.chk -sh fileGet.sh ${v_file} +sh "${v_thisdir}/fileGet.sh" ${v_file} zip -m ${v_zip} ${v_file} v_file=txtcol_${v_pattern}.tar.gz -sh fileCollect.sh ${v_file} +sh "${v_thisdir}/fileCollect.sh" ${v_file} zip -m ${v_zip} ${v_file} v_file=symbols_${v_pattern}.csv -sh symbolGet.sh ${v_file} +sh "${v_thisdir}/symbolGet.sh" ${v_file} zip -m ${v_zip} ${v_file} -sh dumpCreate.sh ${v_pattern}.dmp +sh "${v_thisdir}/dumpCreate.sh" ${v_pattern}.dmp mv ${v_pattern}.dmp tables_${v_pattern}.dmp mv ${v_pattern}.log tables_${v_pattern}.log zip -m ${v_pattern}.zip tables_${v_pattern}.dmp From 76eba553afeb32bca30b3fae6d4713dde229a468 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 6 Jan 2022 15:01:45 -0300 Subject: [PATCH 035/229] New table --- user_scripts/odbfcl/tables_create.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/user_scripts/odbfcl/tables_create.sql b/user_scripts/odbfcl/tables_create.sql index e07a9a2..9440770 100644 --- a/user_scripts/odbfcl/tables_create.sql +++ b/user_scripts/odbfcl/tables_create.sql @@ -210,6 +210,7 @@ CREATE TABLE "T_FIXED_VIEW_DEFINITION" ( "VIEW_NAME" VARCHAR2(128 CHAR) NOT NULL, "VIEW_DEFINITION" VARCHAR2(4000 CHAR), +"VIEW_DEFINITION_CLOB" CLOB, "CON_ID" NUMBER, "ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, "ORASERIES" VARCHAR2(10 CHAR) NOT NULL, @@ -774,6 +775,20 @@ CREATE TABLE "T_BUGSFIXED" ) COMPRESS NOLOGGING; +CREATE TABLE "T_ORAERR" +( +"ORAERR" NUMBER(5,0) NOT NULL, +"RESERVED" NUMBER, +"MESSAGE" VARCHAR2(4000 CHAR), +"CAUSE" VARCHAR2(4000 CHAR), +"ACTION" VARCHAR2(4000 CHAR), +"NOTE" VARCHAR2(4000 CHAR), +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + ----------------------------------------------------- ----------------------------------------------------- ----------------------------------------------------- From d32c3f1c8f409bff31556cc44fb4a366ea46f4cf Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 6 Jan 2022 15:03:06 -0300 Subject: [PATCH 036/229] New features and bug fixes --- loader_adb.yml | 3 + loader_manual.yml | 37 +++++ tasks/main_loader_manual.yml | 147 ++++++++++++++++++ tasks/setup_env.yml | 8 +- user_scripts/odbfcl/exchange_tables_adb.sql | 29 ++-- user_scripts/odbfcl/exchange_tables_adb.yml | 2 +- user_scripts/odbfcl/extract/load_v_dollar.sql | 24 ++- user_scripts/odbfcl/extract/load_view.sql | 8 +- 8 files changed, 238 insertions(+), 20 deletions(-) create mode 100644 loader_manual.yml create mode 100644 tasks/main_loader_manual.yml diff --git a/loader_adb.yml b/loader_adb.yml index 2d21450..de023cb 100644 --- a/loader_adb.yml +++ b/loader_adb.yml @@ -52,3 +52,6 @@ - include: tasks/main_loader_adb.yml db_version="19.0.0.0" when: param_version is undefined or param_version == "19.0.0.0" + + - include: tasks/main_loader_adb.yml db_version="21.0.0.0" + when: param_version is undefined or param_version == "21.0.0.0" diff --git a/loader_manual.yml b/loader_manual.yml new file mode 100644 index 0000000..4b43f3e --- /dev/null +++ b/loader_manual.yml @@ -0,0 +1,37 @@ +#************************************************************************ +# +# Oracle Patch Loop Applier +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +#************************************************************************ +# Available at: https://github.com/dbarj/oracle_patch_loop/ +# Created on: May/2019 by Rodrigo Jorge +#************************************************************************ + +- hosts: localhost + gather_facts: true + become: false + any_errors_fatal: true + + vars_files: + - config_main.yml + - config_oci.yml + - list_versions.yml + - list_patches.yml + + pre_tasks: + - import_tasks: tasks/setup_env.yml + + tasks: + - include: tasks/main_loader_manual.yml diff --git a/tasks/main_loader_manual.yml b/tasks/main_loader_manual.yml new file mode 100644 index 0000000..aac3361 --- /dev/null +++ b/tasks/main_loader_manual.yml @@ -0,0 +1,147 @@ +### Will import all dumps to a given database. + +- name: Variables not provided + fail: + msg: "Variables input_version / input_series / input_patch / input_file must be defined." + when: input_version is undefined or (input_version|length == 0) or + input_series is undefined or (input_series|length == 0) or + input_patch is undefined or (input_patch|length == 0) or + input_file is undefined or (input_file|length == 0) + +- name: Error + fail: + msg: "input_series must start with L." + when: input_series is not match("L.*") + +- name : Define db_version + set_fact: + db_version: "{{ input_version }}" + param_type: "{{ input_series }}" + param_patch: "{{ input_patch }}" + output_folder: "{{ shared_folder }}/temp_load" + +- name: "Check if {{ input_file }} exists" + stat: + path: "{{ input_file }}" + register: ifile_stat_result + +- fail: + msg: "Could not find {{ input_file }} file." + when: ifile_stat_result.stat.exists == false + +- name: Delete content & directory + file: + state: absent + path: "{{ output_folder }}" + +- name: Creates directory + file: + path: "{{ item }}" + state: directory + loop: + - "{{ output_folder }}" + - "{{ output_folder }}/bugsfixed" + - "{{ output_folder }}/binsum" + - "{{ output_folder }}/txtcollect" + - "{{ output_folder }}/symbols" + - "{{ output_folder }}/expdp" + +- name: "Extract {{ input_file }} into {{ output_folder }}" + unarchive: + src: "{{ input_file }}" + dest: "{{ output_folder }}" + +##################################################################### +### Place the files in the correct directories. Also rename them. ### +##################################################################### + +## Dump +- name: Find dump file + find: + paths: "{{ output_folder }}" + patterns: "tables_*.dmp" + recurse: "no" + file_type: "file" + register: find_result + +- name: "Move it to {{ output_folder }}/expdp" + command: mv "{{ find_result.files[0].path }}" "{{ output_folder }}/expdp/tables_{{ db_version }}_{{ param_type }}_{{ param_patch }}.dmp" + when: find_result.files[0] is defined + +## Bugs +- name: Find bugs file + find: + paths: "{{ output_folder }}" + patterns: "bugs_*.txt" + recurse: "no" + file_type: "file" + register: find_result + +- name: "Move it to {{ output_folder }}/bugsfixed" + command: mv "{{ find_result.files[0].path }}" "{{ output_folder }}/bugsfixed/bugs_{{ db_version }}_{{ param_type }}_{{ param_patch }}.txt" + when: find_result.files[0] is defined + +## Symbols +- name: Find symbols file + find: + paths: "{{ output_folder }}" + patterns: "symbols_*.csv" + recurse: "no" + file_type: "file" + register: find_result + +- name: "Move it to {{ output_folder }}/symbols" + command: mv "{{ find_result.files[0].path }}" "{{ output_folder }}/symbols/symbols_{{ db_version }}_{{ param_type }}_{{ param_patch }}.csv" + when: find_result.files[0] is defined + +## Collection +- name: Find txt collection file + find: + paths: "{{ output_folder }}" + patterns: "txtcol_*.tar.gz" + recurse: "no" + file_type: "file" + register: find_result + +- name: "Move it to {{ output_folder }}/txtcollect" + command: mv "{{ find_result.files[0].path }}" "{{ output_folder }}/txtcollect/txtcol_{{ db_version }}_{{ param_type }}_{{ param_patch }}.tar.gz" + when: find_result.files[0] is defined + +## Chksum +- name: Find chksum file + find: + paths: "{{ output_folder }}" + patterns: "sha256sum_*.chk" + recurse: "no" + file_type: "file" + register: find_result + +- name: "Move it to {{ output_folder }}/binsum" + command: mv "{{ find_result.files[0].path }}" "{{ output_folder }}/binsum/sha256sum_{{ db_version }}_{{ param_type }}_{{ param_patch }}.chk" + when: find_result.files[0] is defined + +##################################################################### +##################################################################### + +- name : Define version + set_fact: + patch_list: "{{ item.patch_list }}" + with_items: "{{ list_versions }}" + when: item.id == db_version + +- name : Define Cloud params + set_fact: + out_of_box_ru: "{{ item.out_of_box_ru | default(0) }}" + with_items: "{{ list_info_oci }}" + when: item.id == db_version + +- include: "impdp_file_adb.yml patch={{ item }}" + with_items: + - { type : "{{ input_series }}" , id : "{{ input_patch }}" } + +- name: Delete content & directory + file: + state: absent + path: "{{ output_folder }}" + +### \ No newline at end of file diff --git a/tasks/setup_env.yml b/tasks/setup_env.yml index f8be969..46951f2 100644 --- a/tasks/setup_env.yml +++ b/tasks/setup_env.yml @@ -12,16 +12,16 @@ when: oci_mode == true - name: Copy patch SQL to shared folder - copy: + synchronize: src: patch_sql/ dest: "{{ shared_folder }}/patch_sql/" - mode: u=rw,g=r,o=r + delete: yes - name: Copy user SQL to shared folder - copy: + synchronize: src: user_scripts/ dest: "{{ shared_folder }}/user_scripts/" - mode: u=rw,g=r,o=r + delete: yes - name : Check parameter param_patch set_fact: diff --git a/user_scripts/odbfcl/exchange_tables_adb.sql b/user_scripts/odbfcl/exchange_tables_adb.sql index 9ec403a..45613a0 100644 --- a/user_scripts/odbfcl/exchange_tables_adb.sql +++ b/user_scripts/odbfcl/exchange_tables_adb.sql @@ -3,9 +3,9 @@ WHENEVER SQLERROR EXIT SQL.SQLCODE SET LINES 1000 DEF P_OWNER = '&1' -DEF P_PATCH = '&2' +DEF P_VERS = '&2' DEF P_SER = '&3' -DEF P_VERS = '&4' +DEF P_PATCH = '&4' CREATE OR REPLACE FUNCTION GET_HIGH_VALUE_AS_STRING ( P_OWNER IN VARCHAR2, @@ -25,14 +25,17 @@ BEGIN END; / --- TODO: IMPROVE TO CREATE/EXCHANGE PARTITION INSTEAD OF INSERT/APPEND WHEN PARTITION DONT EXIST - SET SERVEROUT ON DECLARE + V_OWNER VARCHAR2(30) := UPPER('&P_OWNER'); + V_ORAVERSION T_PARAMETER.ORAVERSION%TYPE := '&P_VERS.'; + V_ORASERIES T_PARAMETER.ORASERIES%TYPE := '&P_SER.'; + V_ORAPATCH T_PARAMETER.ORAPATCH%TYPE := &P_PATCH.; + --- V_PNAME VARCHAR2(100); V_HV VARCHAR2(100); - V_OWNER VARCHAR2(30) := UPPER('&P_OWNER'); V_OWNER_TNAME VARCHAR2(100); + V_DID_SMTG BOOLEAN := FALSE; -------------------------------------------- @@ -61,10 +64,7 @@ DECLARE IS V_HV VARCHAR2(50); BEGIN - SELECT LISTAGG(DECODE(COLUMN_NAME,'ORASERIES',q'['&P_SER']','ORAVERSION',q'['&P_VERS']','ORAPATCH','&P_PATCH'),', ') WITHIN GROUP(ORDER BY COLUMN_POSITION) - -- MAX(DECODE(COLUMN_POSITION,1,DECODE(COLUMN_NAME,'ORASERIES',q'['&P_SER']','ORAVERSION',q'['&P_VERS']','ORAPATCH','&P_PATCH'),'')) || ', ' || - -- MAX(DECODE(COLUMN_POSITION,2,DECODE(COLUMN_NAME,'ORASERIES',q'['&P_SER']','ORAVERSION',q'['&P_VERS']','ORAPATCH','&P_PATCH'),'')) || ', ' || - -- MAX(DECODE(COLUMN_POSITION,3,DECODE(COLUMN_NAME,'ORASERIES',q'['&P_SER']','ORAVERSION',q'['&P_VERS']','ORAPATCH','&P_PATCH'),'')) + SELECT LISTAGG(DECODE(COLUMN_NAME,'ORASERIES',DBMS_ASSERT.ENQUOTE_LITERAL(V_ORASERIES),'ORAVERSION',DBMS_ASSERT.ENQUOTE_LITERAL(V_ORAVERSION),'ORAPATCH',V_ORAPATCH),', ') WITHIN GROUP(ORDER BY COLUMN_POSITION) INTO V_HV FROM ALL_PART_KEY_COLUMNS WHERE OWNER=P_OWNER @@ -107,6 +107,7 @@ DECLARE BEGIN DBMS_OUTPUT.PUT_LINE(P_CMD || ';'); EXECUTE IMMEDIATE P_CMD; + V_DID_SMTG := TRUE; END; -------------------------------------------- @@ -151,9 +152,17 @@ BEGIN END IF; END IF; END LOOP; + IF V_DID_SMTG + THEN + -- Add here any optional code to do after the exchange. + NULL; + ELSE + DBMS_OUTPUT.PUT_LINE('---'); + DBMS_OUTPUT.PUT_LINE('--- ATTENTION: ALL TABLES ARE EMPTY'); + END IF; END; / -EXEC HASH.REFRESH_MVS; +DROP FUNCTION GET_HIGH_VALUE_AS_STRING; EXIT 0 diff --git a/user_scripts/odbfcl/exchange_tables_adb.yml b/user_scripts/odbfcl/exchange_tables_adb.yml index efdf57d..aca77ed 100644 --- a/user_scripts/odbfcl/exchange_tables_adb.yml +++ b/user_scripts/odbfcl/exchange_tables_adb.yml @@ -1,7 +1,7 @@ - name: "Load {{ oci_adb_transient_user }} tables into {{ oci_adb_user }} schema" shell: | set -e - sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/exchange_tables_adb.sql {{ oci_adb_user }} {{ patch.id }} {{ patch.base_ru | default('') }}{{ patch.type }} {{ db_version }} + sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/exchange_tables_adb.sql {{ oci_adb_user }} {{ db_version }} {{ patch.base_ru | default('') }}{{ patch.type }} {{ patch.id }} register: sqloutput - name: SQL Output diff --git a/user_scripts/odbfcl/extract/load_v_dollar.sql b/user_scripts/odbfcl/extract/load_v_dollar.sql index e45736c..2e68c82 100644 --- a/user_scripts/odbfcl/extract/load_v_dollar.sql +++ b/user_scripts/odbfcl/extract/load_v_dollar.sql @@ -66,4 +66,26 @@ BEGIN RUN_INSERT ('T_SYSTEM_FIX_CONTROL','V_$SYSTEM_FIX_CONTROL'); END; -/ \ No newline at end of file +/ + +commit; + +-- Get Fixed View Definition full code + +DECLARE + l_clob CLOB; + VVERS VARCHAR2(20) := '&P_VERS.'; +BEGIN + IF VVERS = '11.2.0.4' THEN + RETURN; + END IF; + FOR I IN (select view_name from v_$fixed_view_definition t1 where length(t1.view_definition)=4000) + LOOP + DBMS_UTILITY.expand_sql_text ( + input_sql_text => 'select * from ' || i.view_name, + output_sql_text => l_clob + ); + update &v_username..t_fixed_view_definition t1 set t1.view_definition_clob=l_clob where t1.view_name=i.view_name; + END LOOP; +END; +/ diff --git a/user_scripts/odbfcl/extract/load_view.sql b/user_scripts/odbfcl/extract/load_view.sql index 372ac4d..a866b5d 100644 --- a/user_scripts/odbfcl/extract/load_view.sql +++ b/user_scripts/odbfcl/extract/load_view.sql @@ -1,9 +1,9 @@ DECLARE - VCODE CLOB; - VVERS VARCHAR2(20) := '&P_VERS.'; - VSER VARCHAR2(10) := '&P_SER.'; + VCODE CLOB; + VVERS VARCHAR2(20) := '&P_VERS.'; + VSER VARCHAR2(10) := '&P_SER.'; VPATCH NUMBER := &P_PATCH.; - VSID VARCHAR2(30) := 'VIEW_TESTE'; + VSID VARCHAR2(30) := 'VIEW_TESTE'; CURSOR OBJS IS SELECT OBJECT_OWNER OWNER, OBJECT_NAME NAME, From 9f3c528cc2f87835483046a2ba6a0f5e30806c9d Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 6 Jan 2022 15:04:09 -0300 Subject: [PATCH 037/229] Update impdp_file_adb.yml --- tasks/impdp_file_adb.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/impdp_file_adb.yml b/tasks/impdp_file_adb.yml index 1baf520..b8db366 100644 --- a/tasks/impdp_file_adb.yml +++ b/tasks/impdp_file_adb.yml @@ -27,6 +27,6 @@ when: - param_type is undefined or param_type == patch.type - - param_patch is undefined or (param_patch | int) == patch.id + - param_patch is undefined or (param_patch | int) == (patch.id | int) # Skip all is true when dump file is already generated and skip_dump_exists is true at config. \ No newline at end of file From efc3140684135a107829d3912f05bc0fce474f72 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 6 Jan 2022 15:04:12 -0300 Subject: [PATCH 038/229] Update .gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index fd53fe6..816cc27 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ main.retry *.txt *.log -/user_scripts/report/* \ No newline at end of file +/user_scripts/report/* +user_scripts/odbfcl/sh_extractor/exporter.zip From 626ad26ac4ad5164c9b0b1c6d5cd8ca5eab8b553 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 7 Jan 2022 09:11:17 -0300 Subject: [PATCH 039/229] Update list_versions.yml --- list_versions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/list_versions.yml b/list_versions.yml index 585e772..7614861 100644 --- a/list_versions.yml +++ b/list_versions.yml @@ -22,4 +22,4 @@ list_info_oci: - { id : "12.2.0.1" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" } - { id : "18.0.0.0" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" , out_of_box_ru : 3 } - { id : "19.0.0.0" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" , out_of_box_ru : 3 } - - { id : "21.0.0.0" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" } + - { id : "21.0.0.0" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" , out_of_box_ru : 3 } From 0abcc8c8135e2b8bfcbf28bae61d476b97bfcf8b Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 7 Jan 2022 09:12:20 -0300 Subject: [PATCH 040/229] oci_object_storage_object_facts --- .../meta/main.yml | 2 ++ .../tasks/main.yml | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 roles/oci_object_storage_object_facts/meta/main.yml create mode 100644 roles/oci_object_storage_object_facts/tasks/main.yml diff --git a/roles/oci_object_storage_object_facts/meta/main.yml b/roles/oci_object_storage_object_facts/meta/main.yml new file mode 100644 index 0000000..b42ca0c --- /dev/null +++ b/roles/oci_object_storage_object_facts/meta/main.yml @@ -0,0 +1,2 @@ +collections: + - oracle.oci \ No newline at end of file diff --git a/roles/oci_object_storage_object_facts/tasks/main.yml b/roles/oci_object_storage_object_facts/tasks/main.yml new file mode 100644 index 0000000..1e43dc0 --- /dev/null +++ b/roles/oci_object_storage_object_facts/tasks/main.yml @@ -0,0 +1,16 @@ +- name: Download file from object storage + oci_object_storage_object_facts: + namespace_name: "{{ oci_namespace }}" + bucket_name: "{{ oci_manual_bucket }}" + object_name: "{{ oci_download_file }}" + auth_type: instance_principal + dest: "{{ oci_dest_file }}" + register: oci_action + when: object_action == "download" + +- name: List files from object storage + oci_object_storage_object_facts: + namespace_name: "{{ oci_namespace }}" + bucket_name: "{{ oci_manual_bucket }}" + register: oci_action + when: object_action == "list" \ No newline at end of file From 8da80ec0eedf958baf800b7697b690d4591ad8f3 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 7 Jan 2022 17:44:25 -0300 Subject: [PATCH 041/229] Fix some issues --- config_main.yml | 2 +- tasks/config_checks.yml | 2 +- tasks/main_loader_manual.yml | 53 ++++++++++++++------ user_scripts/odbfcl/extract/load_dba_cdb.sql | 4 ++ user_scripts/odbfcl/tables_create.sql | 43 ++++++++++++++++ 5 files changed, 87 insertions(+), 17 deletions(-) diff --git a/config_main.yml b/config_main.yml index 769c32b..54adb78 100644 --- a/config_main.yml +++ b/config_main.yml @@ -11,7 +11,7 @@ only_deploy_patch: false target_db_version: 19 # Used to check if version parameter will be required on expdp # Download Mode? If true, script will try to download the patch if not found in "source_folder". -download_patch : true +download_patch : false # Stop when patch zip is not found? Control if the code will fail or just skip that patch. error_on_no_patch : true \ No newline at end of file diff --git a/tasks/config_checks.yml b/tasks/config_checks.yml index c23f386..d41d68f 100644 --- a/tasks/config_checks.yml +++ b/tasks/config_checks.yml @@ -13,4 +13,4 @@ - name: Tool does not exist fail: msg: "{{ downloader_tool }} must exist when download_patch is true." - when: downloader_tool_result.stat.exists == false and download_patch == true \ No newline at end of file + when: download_patch == true and downloader_tool_result.stat.exists == false \ No newline at end of file diff --git a/tasks/main_loader_manual.yml b/tasks/main_loader_manual.yml index aac3361..1eafc25 100644 --- a/tasks/main_loader_manual.yml +++ b/tasks/main_loader_manual.yml @@ -8,11 +8,6 @@ input_patch is undefined or (input_patch|length == 0) or input_file is undefined or (input_file|length == 0) -- name: Error - fail: - msg: "input_series must start with L." - when: input_series is not match("L.*") - - name : Define db_version set_fact: db_version: "{{ input_version }}" @@ -20,20 +15,48 @@ param_patch: "{{ input_patch }}" output_folder: "{{ shared_folder }}/temp_load" -- name: "Check if {{ input_file }} exists" +- name: Delete content & directory + file: + state: absent + path: "{{ output_folder }}" + +- name: Creates output folder + file: + path: "{{ output_folder }}" + state: directory + +- name: List files in OCI Bucket + include_role: + name: oci_object_storage_object_facts + vars: + object_action: "list" + +# Not working for whatever reason... + +# - name: Download file from OCI Bucket +# include_role: +# name: oci_object_storage_object_facts +# vars: +# oci_download_file: "{{ input_file }}" +# oci_dest_file: "{{ output_folder }}/{{ input_file }}" +# object_action: "download" + +- name: Download file from OCI Bucket + shell: | + export LC_ALL=C.UTF-8 + export LANG=C.UTF-8 + oci os object get --bucket-name {{ oci_manual_bucket }} --name {{ input_file }} --file {{ output_folder }}/{{ input_file }} + register: shoutput + +- name: "Check if {{ output_folder }}/{{ input_file }} exists" stat: - path: "{{ input_file }}" + path: "{{ output_folder }}/{{ input_file }}" register: ifile_stat_result - fail: - msg: "Could not find {{ input_file }} file." + msg: "Could not find {{ output_folder }}/{{ input_file }} file." when: ifile_stat_result.stat.exists == false -- name: Delete content & directory - file: - state: absent - path: "{{ output_folder }}" - - name: Creates directory file: path: "{{ item }}" @@ -46,9 +69,9 @@ - "{{ output_folder }}/symbols" - "{{ output_folder }}/expdp" -- name: "Extract {{ input_file }} into {{ output_folder }}" +- name: "Extract {{ output_folder }}/{{ input_file }} into {{ output_folder }}" unarchive: - src: "{{ input_file }}" + src: "{{ output_folder }}/{{ input_file }}" dest: "{{ output_folder }}" ##################################################################### diff --git a/user_scripts/odbfcl/extract/load_dba_cdb.sql b/user_scripts/odbfcl/extract/load_dba_cdb.sql index bef48ac..44c1d68 100644 --- a/user_scripts/odbfcl/extract/load_dba_cdb.sql +++ b/user_scripts/odbfcl/extract/load_dba_cdb.sql @@ -113,6 +113,10 @@ BEGIN RUN_INSERT ('AUDIT_POLICY_COLUMNS'); + RUN_INSERT ('DIRECTORIES'); + + RUN_INSERT ('PROCEDURES'); + RUN_INSERT ('SYNONYMS', q'[ORIGIN_CON_ID=CON_ID]', NULL diff --git a/user_scripts/odbfcl/tables_create.sql b/user_scripts/odbfcl/tables_create.sql index 9440770..a8c8fa8 100644 --- a/user_scripts/odbfcl/tables_create.sql +++ b/user_scripts/odbfcl/tables_create.sql @@ -789,6 +789,49 @@ CREATE TABLE "T_ORAERR" ) COMPRESS NOLOGGING; +CREATE TABLE "T_DIRECTORIES" +( +"OWNER" VARCHAR2(128) NOT NULL, +"DIRECTORY_NAME" VARCHAR2(128) NOT NULL, +"DIRECTORY_PATH" VARCHAR2(4000), +"ORIGIN_CON_ID" NUMBER, +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_PROCEDURES" +( +"OWNER" VARCHAR2(128 CHAR) NOT NULL, +"OBJECT_NAME" VARCHAR2(128 CHAR) NOT NULL, +"PROCEDURE_NAME" VARCHAR2(128 CHAR), +"OBJECT_ID" NUMBER, +"SUBPROGRAM_ID" NUMBER, +"OVERLOAD" VARCHAR2(40 CHAR), +"OBJECT_TYPE" VARCHAR2(13 CHAR), +"AGGREGATE" VARCHAR2(3 CHAR), +"PIPELINED" VARCHAR2(3 CHAR), +"IMPLTYPEOWNER" VARCHAR2(128 CHAR), +"IMPLTYPENAME" VARCHAR2(128 CHAR), +"PARALLEL" VARCHAR2(3 CHAR), +"INTERFACE" VARCHAR2(3 CHAR), +"DETERMINISTIC" VARCHAR2(3 CHAR), +"AUTHID" VARCHAR2(12 CHAR), +"RESULT_CACHE" VARCHAR2(3 CHAR), +"ORIGIN_CON_ID" NUMBER, +"POLYMORPHIC" VARCHAR2(5 CHAR), +"SQL_MACRO" VARCHAR2(6 CHAR), +"BLOCKCHAIN" VARCHAR2(3 CHAR), +"BLOCKCHAIN_MANDATORY_VOTES" VARCHAR2(4000 CHAR), +"CON_ID" NUMBER, +"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, +"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, +"ORAPATCH" NUMBER NOT NULL +) +COMPRESS NOLOGGING; + ----------------------------------------------------- ----------------------------------------------------- ----------------------------------------------------- From 53f9825877d2e26c9f57e6bd5cc73499d270b0c9 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Sat, 8 Jan 2022 13:02:11 -0300 Subject: [PATCH 042/229] Update load_v_dollar.sql --- user_scripts/odbfcl/extract/load_v_dollar.sql | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/user_scripts/odbfcl/extract/load_v_dollar.sql b/user_scripts/odbfcl/extract/load_v_dollar.sql index 2e68c82..f78e8c0 100644 --- a/user_scripts/odbfcl/extract/load_v_dollar.sql +++ b/user_scripts/odbfcl/extract/load_v_dollar.sql @@ -79,13 +79,16 @@ BEGIN IF VVERS = '11.2.0.4' THEN RETURN; END IF; - FOR I IN (select view_name from v_$fixed_view_definition t1 where length(t1.view_definition)=4000) - LOOP - DBMS_UTILITY.expand_sql_text ( - input_sql_text => 'select * from ' || i.view_name, - output_sql_text => l_clob - ); - update &v_username..t_fixed_view_definition t1 set t1.view_definition_clob=l_clob where t1.view_name=i.view_name; - END LOOP; + $IF NOT DBMS_DB_VERSION.VER_LE_11 + $THEN + FOR I IN (select view_name from v_$fixed_view_definition t1 where length(t1.view_definition)=4000) + LOOP + DBMS_UTILITY.expand_sql_text ( + input_sql_text => 'select * from ' || i.view_name, + output_sql_text => l_clob + ); + update &v_username..t_fixed_view_definition t1 set t1.view_definition_clob=l_clob where t1.view_name=i.view_name; + END LOOP; + $END END; / From 3e4b82e016c165a0c7569ab0c39438b307a556f7 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 10 Jan 2022 10:18:47 -0300 Subject: [PATCH 043/229] Update list_patches.yml --- list_patches.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/list_patches.yml b/list_patches.yml index ae714b6..6a8fb92 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -208,7 +208,7 @@ list_12102: - { type : "OJVM" , id : 210119 , patch_number : 32119956 } - { type : "OJVM" , id : 210420 , patch_number : 32473164 } - { type : "OJVM" , id : 210720 , patch_number : 32876425 } - - { type : "OJVM" , id : 211019 , patch_number : 33192662 } + - { type : "OJVM" , id : 211019 , patch_number : 33192628 } - { type : "BP" , id : 1 , patch_number : 19404326 , patch_folder : 19189240 } - { type : "BP" , id : 2 , patch_number : 19774304 , patch_folder : 19649591 } - { type : "BP" , id : 3 , patch_number : 20026159 , patch_folder : 19878106 } From 13074053b7a5d9d703bb4eef6a224eb192545e44 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 10 Jan 2022 11:35:41 -0300 Subject: [PATCH 044/229] Move some files --- .../{sh_extractor => extract}/bugsGet.sh | 0 .../{sh_extractor => extract}/fileCollect.sh | 0 user_scripts/odbfcl/sh_extractor/symbolGet.sh | 47 ------------------- 3 files changed, 47 deletions(-) rename user_scripts/odbfcl/{sh_extractor => extract}/bugsGet.sh (100%) rename user_scripts/odbfcl/{sh_extractor => extract}/fileCollect.sh (100%) delete mode 100644 user_scripts/odbfcl/sh_extractor/symbolGet.sh diff --git a/user_scripts/odbfcl/sh_extractor/bugsGet.sh b/user_scripts/odbfcl/extract/bugsGet.sh similarity index 100% rename from user_scripts/odbfcl/sh_extractor/bugsGet.sh rename to user_scripts/odbfcl/extract/bugsGet.sh diff --git a/user_scripts/odbfcl/sh_extractor/fileCollect.sh b/user_scripts/odbfcl/extract/fileCollect.sh similarity index 100% rename from user_scripts/odbfcl/sh_extractor/fileCollect.sh rename to user_scripts/odbfcl/extract/fileCollect.sh diff --git a/user_scripts/odbfcl/sh_extractor/symbolGet.sh b/user_scripts/odbfcl/sh_extractor/symbolGet.sh deleted file mode 100644 index 9823c30..0000000 --- a/user_scripts/odbfcl/sh_extractor/symbolGet.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# Script to list all symbols in ORACLE_HOME -# Created by Rodrigo Jorge - -# set -eo pipefail -set -e # grep can return 0 lines - -function echoError () -{ - (>&2 echo "$1") -} - -function exitError () -{ - echoError "$1" - exit 1 -} - -v_output="$1" - -[ -z "$v_output" ] && exitError "First parameter is the target file and cannot be null." -[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." -[ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." - -echo > "${v_output}" - -echo "Generating symbols list. Please wait.." - -# Extract Symbols from Oracle archives (.a) -for ARCHIVE in $(ls $ORACLE_HOME/lib/*.a $ORACLE_HOME/rdbms/lib/*.a) -do - nm -A $ARCHIVE | grep ' [Tt] ' | tr ':' ' ' | cut -d" " -f1,2,4,5 | sort -u | awk '{ if ( $4 != "" ) { file=$1; sub(".*/","", file); printf "%s/%s|%s|%s\n", file, $2, $3, $4 } }' >> "${v_output}" -done - -# Extract Symbols from Oracle objects (.o) -for OBJECT in $(ls $ORACLE_HOME/lib/*.o $ORACLE_HOME/rdbms/lib/*.o) -do - nm -A $OBJECT | grep ' [Tt] ' | tr ':' ' ' | cut -d" " -f1,3,4 | sort -u | awk '{ if ( $3 != "" ) { file=$1; sub(".*/","", file); printf "%s|%s|%s\n", file, $2, $3 } }' >> "${v_output}" -done - -# Extract Symbols from Oracle executable -nm -A -C $ORACLE_HOME/bin/oracle | grep ' [TtDdRrVv] ' | tr ':' ' ' | cut -d" " -f1,3,4 | sort -u | awk '{ if ( $3 != "" ) { file=$1; sub(".*/","", file); printf "%s|%s|%s\n", file, $2, $3 } }' >> "${v_output}" - -# Remove empty lines or sqlldr will fail due to constant. -sed -i '/^$/d' "${v_output}" - -exit 0 \ No newline at end of file From 64af57052b48f3986fab042c6bd77aee1723d3e0 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 10 Jan 2022 11:35:58 -0300 Subject: [PATCH 045/229] Create symbolGet.sh --- user_scripts/odbfcl/extract/symbolGet.sh | 47 ++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 user_scripts/odbfcl/extract/symbolGet.sh diff --git a/user_scripts/odbfcl/extract/symbolGet.sh b/user_scripts/odbfcl/extract/symbolGet.sh new file mode 100644 index 0000000..9823c30 --- /dev/null +++ b/user_scripts/odbfcl/extract/symbolGet.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# Script to list all symbols in ORACLE_HOME +# Created by Rodrigo Jorge + +# set -eo pipefail +set -e # grep can return 0 lines + +function echoError () +{ + (>&2 echo "$1") +} + +function exitError () +{ + echoError "$1" + exit 1 +} + +v_output="$1" + +[ -z "$v_output" ] && exitError "First parameter is the target file and cannot be null." +[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." +[ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." + +echo > "${v_output}" + +echo "Generating symbols list. Please wait.." + +# Extract Symbols from Oracle archives (.a) +for ARCHIVE in $(ls $ORACLE_HOME/lib/*.a $ORACLE_HOME/rdbms/lib/*.a) +do + nm -A $ARCHIVE | grep ' [Tt] ' | tr ':' ' ' | cut -d" " -f1,2,4,5 | sort -u | awk '{ if ( $4 != "" ) { file=$1; sub(".*/","", file); printf "%s/%s|%s|%s\n", file, $2, $3, $4 } }' >> "${v_output}" +done + +# Extract Symbols from Oracle objects (.o) +for OBJECT in $(ls $ORACLE_HOME/lib/*.o $ORACLE_HOME/rdbms/lib/*.o) +do + nm -A $OBJECT | grep ' [Tt] ' | tr ':' ' ' | cut -d" " -f1,3,4 | sort -u | awk '{ if ( $3 != "" ) { file=$1; sub(".*/","", file); printf "%s|%s|%s\n", file, $2, $3 } }' >> "${v_output}" +done + +# Extract Symbols from Oracle executable +nm -A -C $ORACLE_HOME/bin/oracle | grep ' [TtDdRrVv] ' | tr ':' ' ' | cut -d" " -f1,3,4 | sort -u | awk '{ if ( $3 != "" ) { file=$1; sub(".*/","", file); printf "%s|%s|%s\n", file, $2, $3 } }' >> "${v_output}" + +# Remove empty lines or sqlldr will fail due to constant. +sed -i '/^$/d' "${v_output}" + +exit 0 \ No newline at end of file From 659c7d6715ec3c5860e9216157d1c099f22299ad Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 10 Jan 2022 11:36:21 -0300 Subject: [PATCH 046/229] Rename file --- .../sh_extractor/{dumpCreate_inzip.sh => dumpCreate_forzip.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename user_scripts/odbfcl/sh_extractor/{dumpCreate_inzip.sh => dumpCreate_forzip.sh} (100%) diff --git a/user_scripts/odbfcl/sh_extractor/dumpCreate_inzip.sh b/user_scripts/odbfcl/sh_extractor/dumpCreate_forzip.sh similarity index 100% rename from user_scripts/odbfcl/sh_extractor/dumpCreate_inzip.sh rename to user_scripts/odbfcl/sh_extractor/dumpCreate_forzip.sh From 40cc9c4559fc45a75eede6b2eef761e387d98bb7 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 10 Jan 2022 11:36:30 -0300 Subject: [PATCH 047/229] Update build_zip.sh --- user_scripts/odbfcl/sh_extractor/build_zip.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_scripts/odbfcl/sh_extractor/build_zip.sh b/user_scripts/odbfcl/sh_extractor/build_zip.sh index 0c83c90..8399a18 100644 --- a/user_scripts/odbfcl/sh_extractor/build_zip.sh +++ b/user_scripts/odbfcl/sh_extractor/build_zip.sh @@ -7,7 +7,7 @@ cp -a ../tables_recreate.sql exporter/ cp -a ../tables_create.sql exporter/ cp -a ../../externalDir.sql exporter/ cp -a *.sh *.sql exporter/ -mv exporter/dumpCreate_inzip.sh exporter/dumpCreate.sh +mv exporter/dumpCreate_forzip.sh exporter/dumpCreate.sh find exporter/ -name "*.yml" -delete find exporter/ -name ".DS_Store" -delete rm -f exporter/build_zip.sh From f22b13091c1371ecc8fdf29360d5c05717d330bb Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 10 Jan 2022 18:59:43 -0300 Subject: [PATCH 048/229] sh_extractor config --- .../{extract => sh_extractor}/bugsGet.sh | 0 user_scripts/odbfcl/sh_extractor/build_zip.sh | 15 +++- .../odbfcl/sh_extractor/dumpCreate.sh | 5 +- .../odbfcl/sh_extractor/dumpCreate_forzip.sh | 82 ------------------- user_scripts/odbfcl/sh_extractor/exporter.sh | 14 ++-- .../{extract => sh_extractor}/fileCollect.sh | 0 .../{extract => sh_extractor}/fileGet.sh | 0 .../{extract => sh_extractor}/symbolGet.sh | 0 8 files changed, 22 insertions(+), 94 deletions(-) rename user_scripts/odbfcl/{extract => sh_extractor}/bugsGet.sh (100%) delete mode 100644 user_scripts/odbfcl/sh_extractor/dumpCreate_forzip.sh rename user_scripts/odbfcl/{extract => sh_extractor}/fileCollect.sh (100%) rename user_scripts/odbfcl/{extract => sh_extractor}/fileGet.sh (100%) rename user_scripts/odbfcl/{extract => sh_extractor}/symbolGet.sh (100%) diff --git a/user_scripts/odbfcl/extract/bugsGet.sh b/user_scripts/odbfcl/sh_extractor/bugsGet.sh similarity index 100% rename from user_scripts/odbfcl/extract/bugsGet.sh rename to user_scripts/odbfcl/sh_extractor/bugsGet.sh diff --git a/user_scripts/odbfcl/sh_extractor/build_zip.sh b/user_scripts/odbfcl/sh_extractor/build_zip.sh index 8399a18..e8c213b 100644 --- a/user_scripts/odbfcl/sh_extractor/build_zip.sh +++ b/user_scripts/odbfcl/sh_extractor/build_zip.sh @@ -7,10 +7,19 @@ cp -a ../tables_recreate.sql exporter/ cp -a ../tables_create.sql exporter/ cp -a ../../externalDir.sql exporter/ cp -a *.sh *.sql exporter/ -mv exporter/dumpCreate_forzip.sh exporter/dumpCreate.sh +# mv exporter/dumpCreate_forzip.sh exporter/dumpCreate.sh +sed '/^cd /d' exporter/dumpCreate.sh > exporter/dumpCreate.sh.tmp +mv exporter/dumpCreate.sh.tmp exporter/dumpCreate.sh find exporter/ -name "*.yml" -delete find exporter/ -name ".DS_Store" -delete rm -f exporter/build_zip.sh - rm -f exporter.zip -zip -rm exporter.zip exporter/ \ No newline at end of file + +# Put all files at the same stamp to create a deterministic zip. +find exporter/ -exec touch -t 202201010000 {} + + +zip -rmXD exporter.zip exporter/ +rmdir exporter/* +rmdir exporter/ + +exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh index 37ccfa0..95ae7da 100644 --- a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Script to list all symbols in ORACLE_HOME +# Script to collect dictionary tables # Created by Rodrigo Jorge set -eo pipefail @@ -83,4 +83,5 @@ $ORACLE_HOME/bin/sqlplus "/ as sysdba" < - -set -eo pipefail - -function echoError () -{ - (>&2 echo "$1") -} - -function exitError () -{ - echoError "$1" - exit 1 -} - -v_output="$1" - -[ -z "$v_output" ] && exitError "First parameter is the target file and cannot be null." -[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." -[ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." -[ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." - -v_output_fdr="$(cd "$(dirname "${v_output}")"; pwd)" -v_output_file="$(basename "${v_output}")" - -v_output_full="${v_output_fdr}/${v_output_file}" - -v_user='c##hash' -v_pass='hash' - -v_thisdir="$(cd "$(dirname "$0")"; pwd)" - -v_output_file_noext="${v_output_file%.*}" - -v_output_file_cnt=`awk -F"_" '{print NF-1}' <<< "${v_output_file_noext}"` -[ ${v_output_file_cnt} -ne 2 ] && exitError "File \"${v_output}\" must have 2 \"_\" on the name." - -v_output_file_cnt=`awk -F" " '{print NF-1}' <<< "${v_output_file_noext}"` -[ ${v_output_file_cnt} -ne 0 ] && exitError "File \"${v_output}\" must not have any spaces." - -v_patch_version=`cut -d '_' -f 1 <<< "${v_output_file_noext}"` -v_patch_type=`cut -d '_' -f 2 <<< "${v_output_file_noext}"` -v_patch_id=`cut -d '_' -f 3 <<< "${v_output_file_noext}"` - -v_output_file_cnt=`awk -F"." '{print NF-1}' <<< "${v_patch_version}"` -[ ${v_output_file_cnt} -ne 3 ] && exitError "Version \"${v_patch_version}\" must be in \"X.X.X.X\" format." - -re='^[0-9]+$' -if ! [[ $v_patch_id =~ $re ]] ; then - exitError "\"$v_patch_id\" must be a number." -fi - -echo "Generating tables export. Please wait.." - -$ORACLE_HOME/bin/sqlplus "/ as sysdba" < -# v1.0.0.0 +# v1.0.0.1 set -eo pipefail @@ -27,27 +27,27 @@ The pattern is composed by 3 parts, divided by \"_\": 2nd - Type. Can be any string. 3rd - ID. Must be a number. -Eg: $0 19.0.0.0_RU-L_14 +Eg: $0 19.0.0.0_LRU14_20220101 The output is a zip file. " v_pattern_cnt=`awk -F"_" '{print NF-1}' <<< "${v_pattern}"` -[ ${v_pattern_cnt} -ne 2 ] && exitError "Pattern \"${v_output}\" must have 2 \"_\" on it. Eg: 19.0.0.0_RU-L_14" +[ ${v_pattern_cnt} -ne 2 ] && exitError "Pattern \"${v_output}\" must have 2 \"_\" on it. Eg: 19.0.0.0_LRU14_20220101" v_pattern_cnt=`awk -F" " '{print NF-1}' <<< "${v_pattern}"` -[ ${v_pattern_cnt} -ne 0 ] && exitError "Pattern \"${v_output}\" must not have any spaces. Eg: 19.0.0.0_RU-L_14" +[ ${v_pattern_cnt} -ne 0 ] && exitError "Pattern \"${v_output}\" must not have any spaces. Eg: 19.0.0.0_LRU14_20220101" v_patch_version=`cut -d '_' -f 1 <<< "${v_pattern}"` v_patch_type=`cut -d '_' -f 2 <<< "${v_pattern}"` v_patch_id=`cut -d '_' -f 3 <<< "${v_pattern}"` v_pattern_cnt=`awk -F"." '{print NF-1}' <<< "${v_patch_version}"` -[ ${v_pattern_cnt} -ne 3 ] && exitError "Version \"${v_patch_version}\" must be in \"X.X.X.X\" format. Eg: 19.0.0.0_RU-L_14" +[ ${v_pattern_cnt} -ne 3 ] && exitError "Version \"${v_patch_version}\" must be in \"X.X.X.X\" format. Eg: 19.0.0.0_LRU14_20220101" re='^[0-9]+$' if ! [[ $v_patch_id =~ $re ]] ; then - exitError "\"$v_patch_id\" must be a number. Eg: 19.0.0.0_RU-L_14" + exitError "\"$v_patch_id\" must be a number. Eg: 19.0.0.0_LRU14_20220101" fi v_thisdir="$(cd "$(dirname "$0")"; pwd)" diff --git a/user_scripts/odbfcl/extract/fileCollect.sh b/user_scripts/odbfcl/sh_extractor/fileCollect.sh similarity index 100% rename from user_scripts/odbfcl/extract/fileCollect.sh rename to user_scripts/odbfcl/sh_extractor/fileCollect.sh diff --git a/user_scripts/odbfcl/extract/fileGet.sh b/user_scripts/odbfcl/sh_extractor/fileGet.sh similarity index 100% rename from user_scripts/odbfcl/extract/fileGet.sh rename to user_scripts/odbfcl/sh_extractor/fileGet.sh diff --git a/user_scripts/odbfcl/extract/symbolGet.sh b/user_scripts/odbfcl/sh_extractor/symbolGet.sh similarity index 100% rename from user_scripts/odbfcl/extract/symbolGet.sh rename to user_scripts/odbfcl/sh_extractor/symbolGet.sh From 45a8b1ff628701555a336ccbb928d2a48dd1c07f Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Sun, 23 Jan 2022 11:45:39 -0300 Subject: [PATCH 049/229] Separate vbox from main list and new patches Separate vbox from main list and new patches --- list_exceptions.yml | 3 +++ list_patches.yml | 15 ++++++++++++++- list_versions.yml | 23 ++++++++++++++++------- tasks/main_PSU_BP.yml | 11 ++++++++--- tasks/main_RU_RUR.yml | 11 ++++++++--- tasks/main_loader.yml | 9 +++++++-- 6 files changed, 56 insertions(+), 16 deletions(-) diff --git a/list_exceptions.yml b/list_exceptions.yml index ebd2149..b029f8e 100644 --- a/list_exceptions.yml +++ b/list_exceptions.yml @@ -42,3 +42,6 @@ list_retry_datapatch: - { version: "12.1.0.2" , type : "PSU" , id : 211019 , retries : 2 } - { version: "12.1.0.2" , type : "BP" , id : 211019 , retries : 2 } - { version: "12.2.0.1" , type : "RU" , id : 211019 , retries : 1 } + - { version: "12.1.0.2" , type : "PSU" , id : 220118 , retries : 2 } + - { version: "12.1.0.2" , type : "BP" , id : 220118 , retries : 2 } + - { version: "12.2.0.1" , type : "RU" , id : 220118 , retries : 1 } diff --git a/list_patches.yml b/list_patches.yml index 6a8fb92..bb20c06 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -37,6 +37,7 @@ list_11204: - { type : "PSU" , id : 210420 , patch_number : 32328626 } - { type : "PSU" , id : 210720 , patch_number : 32758711 } - { type : "PSU" , id : 211019 , patch_number : 33128584 } + - { type : "PSU" , id : 220118 , patch_number : 33477185 } - { type : "OJVM" , id : 1 , patch_number : 19282021 } - { type : "OJVM" , id : 2 , patch_number : 19877440 } - { type : "OJVM" , id : 3 , patch_number : 20406239 } @@ -66,6 +67,7 @@ list_11204: - { type : "OJVM" , id : 210420 , patch_number : 32671980 } - { type : "OJVM" , id : 210720 , patch_number : 32876451 } - { type : "OJVM" , id : 211019 , patch_number : 33192642 } + - { type : "OJVM" , id : 220118 , patch_number : 33561250 } - { type : "BP" , id : 1 , patch_number : 17628025 , patch_folder : 17628006 } - { type : "BP" , id : 2 , patch_number : 17838803 , patch_folder : 17741631 } - { type : "BP" , id : 3 , patch_number : 17904156 , patch_folder : 17943261 } @@ -111,6 +113,7 @@ list_11204: - { type : "BP" , id : 210420 , patch_number : 32537095 , patch_folder : 32328629 } - { type : "BP" , id : 210720 , patch_number : 32917411 , patch_folder : 32758732 } - { type : "BP" , id : 211019 , patch_number : 33248386 , patch_folder : 33128587 } + - { type : "BP" , id : 220118 , patch_number : 33575241 , patch_folder : 33477193 } #################### @@ -180,6 +183,7 @@ list_12102: - { type : "PSU" , id : 210420 , patch_number : 32328635 } - { type : "PSU" , id : 210720 , patch_number : 32768233 } - { type : "PSU" , id : 211019 , patch_number : 33128590 } + - { type : "PSU" , id : 220118 , patch_number : 33477199 } - { type : "OJVM" , id : 1 , patch_number : 19282028 } - { type : "OJVM" , id : 2 , patch_number : 19877336 } - { type : "OJVM" , id : 3 , patch_number : 20415564 } @@ -209,6 +213,7 @@ list_12102: - { type : "OJVM" , id : 210420 , patch_number : 32473164 } - { type : "OJVM" , id : 210720 , patch_number : 32876425 } - { type : "OJVM" , id : 211019 , patch_number : 33192628 } + - { type : "OJVM" , id : 220118 , patch_number : 33561268 } - { type : "BP" , id : 1 , patch_number : 19404326 , patch_folder : 19189240 } - { type : "BP" , id : 2 , patch_number : 19774304 , patch_folder : 19649591 } - { type : "BP" , id : 3 , patch_number : 20026159 , patch_folder : 19878106 } @@ -247,6 +252,7 @@ list_12102: - { type : "BP" , id : 210420 , patch_number : 32518631 , patch_folder : 32328632 } - { type : "BP" , id : 210720 , patch_number : 32917362 , patch_folder : 32768230 } - { type : "BP" , id : 211019 , patch_number : 33248411 , patch_folder : 33114885 } + - { type : "BP" , id : 220118 , patch_number : 33575286 , patch_folder : 00000000 } #################### @@ -275,6 +281,7 @@ list_12201: - { type : "RU" , id : 210420 , patch_number : 32507738 } - { type : "RU" , id : 210720 , patch_number : 32916808 } - { type : "RU" , id : 211019 , patch_number : 33261817 } + - { type : "RU" , id : 220118 , patch_number : 33587128 } - { type : "RUR" , id : 171017 , patch_number : 26518812 , base_ru : JUL2017 } - { type : "RUR" , id : 180116 , patch_number : 27013506 , base_ru : JUL2017 } - { type : "RUR" , id : 180116 , patch_number : 27013510 , base_ru : OCT2017 } @@ -318,6 +325,7 @@ list_12201: - { type : "OJVM" , id : 210420 , patch_number : 32473172 } - { type : "OJVM" , id : 210720 , patch_number : 32876409 } - { type : "OJVM" , id : 211019 , patch_number : 33192662 } + - { type : "OJVM" , id : 220118 , patch_number : 33561275 } #################### ##### 18.0.0.0 ##### @@ -398,6 +406,7 @@ list_19000: - { type : "RU" , id : 11 , patch_number : 32545013 } - { type : "RU" , id : 12 , patch_number : 32904851 } - { type : "RU" , id : 13 , patch_number : 33192793 } + - { type : "RU" , id : 14 , patch_number : 33515361 } - { type : "RUR" , id : 1 , patch_number : 29799057 , base_ru : '19.3' } - { type : "RUR" , id : 2 , patch_number : 30087906 , base_ru : '19.3' } - { type : "RUR" , id : 1 , patch_number : 30080447 , base_ru : '19.4' } @@ -418,6 +427,8 @@ list_19000: - { type : "RUR" , id : 1 , patch_number : 32844504 , base_ru : '19.11' } - { type : "RUR" , id : 2 , patch_number : 33153989 , base_ru : '19.11' } - { type : "RUR" , id : 1 , patch_number : 33210889 , base_ru : '19.12' } + - { type : "RUR" , id : 2 , patch_number : 33494256 , base_ru : '19.12' } + - { type : "RUR" , id : 1 , patch_number : 33516456 , base_ru : '19.13' } - { type : "OJVM" , id : 190416 , patch_number : 29548437 } - { type : "OJVM" , id : 190716 , patch_number : 29774421 } - { type : "OJVM" , id : 191015 , patch_number : 30128191 } @@ -429,6 +440,7 @@ list_19000: - { type : "OJVM" , id : 210420 , patch_number : 32399816 } - { type : "OJVM" , id : 210720 , patch_number : 32876380 } - { type : "OJVM" , id : 211019 , patch_number : 33192694 } + - { type : "OJVM" , id : 220118 , patch_number : 33561310 } #################### ##### 21.0.0.0 ##### @@ -436,4 +448,5 @@ list_19000: list_21000: #- { type : "RU" , id : 3 , patch_number : 00000000 , base_snap : "21.2.0" } - - { type : "RU" , id : 4 , patch_number : 33239276 } \ No newline at end of file + - { type : "RU" , id : 4 , patch_number : 33239276 } + - { type : "RU" , id : 5 , patch_number : 33516412 } \ No newline at end of file diff --git a/list_versions.yml b/list_versions.yml index 7614861..8d841f6 100644 --- a/list_versions.yml +++ b/list_versions.yml @@ -7,13 +7,22 @@ # IP Address: For local SSH connection. list_versions: - - { id : "11.2.0.4" , patch_list : "list_11204" , main_file : "patch_main_11g.yml" , vmachine : "Oracle Linux 6.8" , base_snap : "11.2.0.4 Ready" , opatch_file : "p6880880_112000_Linux-x86-64.zip" , ip : "192.168.56.101" } - - { id : "12.1.0.1" , patch_list : "list_12101" , main_file : "patch_main.yml" , vmachine : "Oracle Linux 6.8" , base_snap : "12.1.0.1 Ready" , opatch_file : "p6880880_200000_Linux-x86-64.zip" , ip : "192.168.56.101" } - - { id : "12.1.0.2" , patch_list : "list_12102" , main_file : "patch_main.yml" , vmachine : "Oracle Linux 6.8" , base_snap : "12.1.0.2 Ready" , opatch_file : "p6880880_200000_Linux-x86-64.zip" , ip : "192.168.56.101" } - - { id : "12.2.0.1" , patch_list : "list_12201" , main_file : "patch_main.yml" , vmachine : "Oracle Linux 6.8" , base_snap : "12.2.0.1 Ready" , opatch_file : "p6880880_200000_Linux-x86-64.zip" , ip : "192.168.56.101" } - - { id : "18.0.0.0" , patch_list : "list_18000" , main_file : "patch_main.yml" , vmachine : "Oracle Linux 6.8" , base_snap : "18.0.0.0 Ready" , opatch_file : "p6880880_200000_Linux-x86-64.zip" , ip : "192.168.56.101" } - - { id : "19.0.0.0" , patch_list : "list_19000" , main_file : "patch_main.yml" , vmachine : "Oracle Linux 7.6" , base_snap : "19.0.0.0 Ready" , opatch_file : "p6880880_200000_Linux-x86-64.zip" , ip : "192.168.56.102" } - - { id : "21.0.0.0" , patch_list : "list_21000" , main_file : "patch_main.yml" , vmachine : "Oracle Linux 8" , base_snap : "21.0.0.0 Ready" , opatch_file : "p6880880_200000_Linux-x86-64.zip" , ip : "192.168.56.102" } + - { id : "11.2.0.4" , patch_list : "list_11204" , main_file : "patch_main_11g.yml" , opatch_file : "p6880880_112000_Linux-x86-64.zip" } + - { id : "12.1.0.1" , patch_list : "list_12101" , main_file : "patch_main.yml" , opatch_file : "p6880880_210000_Linux-x86-64.zip" } + - { id : "12.1.0.2" , patch_list : "list_12102" , main_file : "patch_main.yml" , opatch_file : "p6880880_210000_Linux-x86-64.zip" } + - { id : "12.2.0.1" , patch_list : "list_12201" , main_file : "patch_main.yml" , opatch_file : "p6880880_210000_Linux-x86-64.zip" } + - { id : "18.0.0.0" , patch_list : "list_18000" , main_file : "patch_main.yml" , opatch_file : "p6880880_210000_Linux-x86-64.zip" } + - { id : "19.0.0.0" , patch_list : "list_19000" , main_file : "patch_main.yml" , opatch_file : "p6880880_210000_Linux-x86-64.zip" } + - { id : "21.0.0.0" , patch_list : "list_21000" , main_file : "patch_main.yml" , opatch_file : "p6880880_210000_Linux-x86-64.zip" } + +list_info_vbox: + - { id : "11.2.0.4" , vmachine : "Oracle Linux 6.8" , base_snap : "11.2.0.4 Ready" , ip : "xxx" } + - { id : "12.1.0.1" , vmachine : "Oracle Linux 6.8" , base_snap : "12.1.0.1 Ready" , ip : "xxx" } + - { id : "12.1.0.2" , vmachine : "Oracle Linux 6.8" , base_snap : "12.1.0.2 Ready" , ip : "xxx" } + - { id : "12.2.0.1" , vmachine : "Oracle Linux 6.8" , base_snap : "12.2.0.1 Ready" , ip : "xxx" } + - { id : "18.0.0.0" , vmachine : "Oracle Linux 6.8" , base_snap : "18.0.0.0 Ready" , ip : "xxx" } + - { id : "19.0.0.0" , vmachine : "Oracle Linux 7.6" , base_snap : "19.0.0.0 Ready" , ip : "xxx" } + - { id : "21.0.0.0" , vmachine : "Oracle Linux 8" , base_snap : "21.0.0.0 Ready" , ip : "xxx" } list_info_oci: - { id : "11.2.0.4" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" } diff --git a/tasks/main_PSU_BP.yml b/tasks/main_PSU_BP.yml index c1f07bc..0aa97f8 100644 --- a/tasks/main_PSU_BP.yml +++ b/tasks/main_PSU_BP.yml @@ -2,15 +2,20 @@ - name : Define version set_fact: - vm_machine: "{{ item.vmachine }}" - vm_ip_address: "{{ item.ip }}" - patch_base: "{{ item.base_snap }}" patch_file: "{{ item.main_file }}" patch_list: "{{ item.patch_list }}" opatch_file: "{{ item.opatch_file }}" with_items: "{{ list_versions }}" when: item.id == db_version +- name : Define VBox params + set_fact: + vm_machine: "{{ item.vmachine }}" + vm_ip_address: "{{ item.ip }}" + patch_base: "{{ item.base_snap }}" + with_items: "{{ list_info_vbox }}" + when: item.id == db_version and oci_mode == false + - name : Define Cloud params set_fact: oci_instance_id: "{{ item.oci_instance_id }}" diff --git a/tasks/main_RU_RUR.yml b/tasks/main_RU_RUR.yml index 9ea2b96..1675ab7 100644 --- a/tasks/main_RU_RUR.yml +++ b/tasks/main_RU_RUR.yml @@ -2,15 +2,20 @@ - name : Define version set_fact: - vm_machine: "{{ item.vmachine }}" - vm_ip_address: "{{ item.ip }}" - patch_base: "{{ item.base_snap }}" patch_file: "{{ item.main_file }}" patch_list: "{{ item.patch_list }}" opatch_file: "{{ item.opatch_file }}" with_items: "{{ list_versions }}" when: item.id == db_version +- name : Define VBox params + set_fact: + vm_machine: "{{ item.vmachine }}" + vm_ip_address: "{{ item.ip }}" + patch_base: "{{ item.base_snap }}" + with_items: "{{ list_info_vbox }}" + when: item.id == db_version and oci_mode == false + - name : Define Cloud params set_fact: oci_instance_id: "{{ item.oci_instance_id }}" diff --git a/tasks/main_loader.yml b/tasks/main_loader.yml index e04a003..aaafe65 100644 --- a/tasks/main_loader.yml +++ b/tasks/main_loader.yml @@ -2,12 +2,17 @@ - name : Define version set_fact: - vm_machine: "{{ item.vmachine }}" patch_base: "{{ item.base_snap }}" patch_list: "{{ item.patch_list }}" + with_items: "{{ list_versions }}" + when: item.id == db_version + +- name : Define VBox params + set_fact: + vm_machine: "{{ item.vmachine }}" vm_snapshot: "{{ item.base_snap }}" vm_ip_address: "{{ item.ip }}" - with_items: "{{ list_versions }}" + with_items: "{{ list_info_vbox }}" when: item.id == db_version # vm_reload is called before every patch is applied to rollback the VM to the snapshot image. From 58c3a3c94d41939e57e96824e9eb6408b18a554b Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Sun, 23 Jan 2022 11:50:28 -0300 Subject: [PATCH 050/229] Renamed source_folder to patch_folder Renamed source_folder to patch_folder --- config_vbox.yml | 2 +- tasks/download_patch.yml | 2 +- tasks/patch_tasks_pre.yml | 4 ++-- tasks/setup_opatch.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config_vbox.yml b/config_vbox.yml index 0865407..17c677e 100644 --- a/config_vbox.yml +++ b/config_vbox.yml @@ -1,5 +1,5 @@ # Folder where the database patches are placed. The patches can also be placed in sub-folders of the directory specified below. -source_folder : "/Volumes/Untitled/Rodrigo/ORACHKSUM/DB\ Install" +patch_folder : "/Volumes/Untitled/Rodrigo/ORACHKSUM/DB\ Install" # Folder in RW mode on local compute and shared with the VM. It is used to process the files. shared_folder : "/Users/rodrigo.jorge/Desktop/extract" diff --git a/tasks/download_patch.yml b/tasks/download_patch.yml index 5e675d7..88e036b 100644 --- a/tasks/download_patch.yml +++ b/tasks/download_patch.yml @@ -24,5 +24,5 @@ MOSUser={{ downloader_user }} \ MOSPass='{{ downloader_pass }}' args: - chdir: "{{ source_folder }}" + chdir: "{{ patch_folder }}" register: shell_output \ No newline at end of file diff --git a/tasks/patch_tasks_pre.yml b/tasks/patch_tasks_pre.yml index a352835..e0b0b2a 100644 --- a/tasks/patch_tasks_pre.yml +++ b/tasks/patch_tasks_pre.yml @@ -49,7 +49,7 @@ # Place patch file on the shared folder - name: Finding Patch File find: - paths: "{{ source_folder }}" + paths: "{{ patch_folder }}" patterns: "p{{ patch.patch_number }}_{{ db_version | regex_replace('\\.','') }}0_Linux-x86-64.zip" recurse: "yes" file_type: "file" @@ -69,7 +69,7 @@ # Try again after downloader was called - name: Finding Patch File Again find: - paths: "{{ source_folder }}" + paths: "{{ patch_folder }}" patterns: "p{{ patch.patch_number }}_{{ db_version | regex_replace('\\.','') }}0_Linux-x86-64.zip" recurse: "yes" file_type: "file" diff --git a/tasks/setup_opatch.yml b/tasks/setup_opatch.yml index c728381..c0e0cc6 100644 --- a/tasks/setup_opatch.yml +++ b/tasks/setup_opatch.yml @@ -1,6 +1,6 @@ - name: Finding OPatch File find: - paths: "{{ source_folder }}" + paths: "{{ patch_folder }}" patterns: "{{ opatch_file }}" recurse: "yes" file_type: "file" From 06da2fad4903d1e6113cb75b46b44ecb56c510f5 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 16 Feb 2022 15:25:31 -0300 Subject: [PATCH 051/229] Add patch location on OS option Now patches can be stored in Object Storage --- config_main.yml | 2 +- config_oci.yml | 15 +++---- config_vbox.yml | 3 +- list_patches.yml | 6 ++- .../oci_object_storage_object/tasks/main.yml | 14 ++++--- .../tasks/main.yml | 2 +- tasks/config_checks.yml | 7 +++- tasks/download_patch.yml | 29 +++++++++++-- tasks/find_patch.yml | 41 +++++++++++++++++++ tasks/main_loader_manual.yml | 3 +- tasks/patch_tasks_pre.yml | 26 ++---------- tasks/setup_env.yml | 8 +++- tasks/setup_opatch.yml | 25 ++++++++++- 13 files changed, 134 insertions(+), 47 deletions(-) create mode 100644 tasks/find_patch.yml diff --git a/config_main.yml b/config_main.yml index 54adb78..2c166e2 100644 --- a/config_main.yml +++ b/config_main.yml @@ -10,8 +10,8 @@ only_deploy_patch: false # Target DB version where dumps will be imported target_db_version: 19 # Used to check if version parameter will be required on expdp -# Download Mode? If true, script will try to download the patch if not found in "source_folder". download_patch : false +# Download Mode? If true, script will try to download the patch listed in list_patches.yml if not found in "patch_location_path". # Stop when patch zip is not found? Control if the code will fail or just skip that patch. error_on_no_patch : true \ No newline at end of file diff --git a/config_oci.yml b/config_oci.yml index e6e7d4e..4e1dedf 100644 --- a/config_oci.yml +++ b/config_oci.yml @@ -1,13 +1,16 @@ +# Patch location type: Can be "folder" or "bucket" +# Patch location path: Can be the local folder path or the bucket name. # Folder where the database patches are placed. The patches can also be placed in sub-folders of the directory specified below. -source_folder : "/u01/patch_automation/patches" +patch_location_type : bucket +patch_location_path : oradiff_patches -# Folder in RW mode on local compute and shared with the VM. It is used to process the files. +# Folder in RW mode on local compute and shared with the VM. It is used to move the patches to the VMs and also to copy back the expdp output. shared_folder : "/u02" -# Path of the folder mounted within the VM. +# Path of the folder mounted within the VM. This is the path of the "shared_folder" in the VM. VM_folder : "/u02" -# Oracle SID. Must be included in /etc/oratab for oraenv utility. +# Oracle SID of the database that we are collecting data from. Must be included in /etc/oratab for oraenv utility. mysid : "orcl" # Folder to store the final generated files. @@ -38,7 +41,7 @@ user_expdp_post : - { file : "update_table_keys_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Update table keys to reflect correct partition name" } - { file : "exchange_tables_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Exchange loaded table in the correct partition position" } -# User that will hold your tables outputs and be exported after each execution. If the database is CDB, "C##" will be automatically inserted if not. +# User that will hold your tables outputs and be exported after each execution. If the database is CDB, "C##" will be automatically inserted if not there. dump_user : hash # User pass @@ -46,8 +49,6 @@ dump_pass : hash # OCI Information to deploy VM oci_compartment_id : ocid1.compartment.oc1..xxx -oci_subnet_id : ocid1.subnet.oc1.iad.xxx -oci_ad : ocid1.subnet.oc1.iad.xxx # OCI Information to upload objects to OS oci_namespace: xxx diff --git a/config_vbox.yml b/config_vbox.yml index 17c677e..ef96d7b 100644 --- a/config_vbox.yml +++ b/config_vbox.yml @@ -1,5 +1,6 @@ # Folder where the database patches are placed. The patches can also be placed in sub-folders of the directory specified below. -patch_folder : "/Volumes/Untitled/Rodrigo/ORACHKSUM/DB\ Install" +patch_location_type : folder +patch_location_path : "/Volumes/Untitled/Rodrigo/ORACHKSUM/DB\ Install" # Folder in RW mode on local compute and shared with the VM. It is used to process the files. shared_folder : "/Users/rodrigo.jorge/Desktop/extract" diff --git a/list_patches.yml b/list_patches.yml index bb20c06..3aca155 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -252,7 +252,7 @@ list_12102: - { type : "BP" , id : 210420 , patch_number : 32518631 , patch_folder : 32328632 } - { type : "BP" , id : 210720 , patch_number : 32917362 , patch_folder : 32768230 } - { type : "BP" , id : 211019 , patch_number : 33248411 , patch_folder : 33114885 } - - { type : "BP" , id : 220118 , patch_number : 33575286 , patch_folder : 00000000 } + - { type : "BP" , id : 220118 , patch_number : 33575286 , patch_folder : 33465249 } #################### @@ -336,7 +336,7 @@ list_12201: # No more updates on this one. list_18000: - - { type : "RU" , id : 2 , patch_number : 27676517 , base_snap : "18.1.0" } +# - { type : "RU" , id : 2 , patch_number : 27676517 , base_snap : "18.1.0" } - { type : "RU" , id : 3 , patch_number : 28090523 , base_snap : "18.1.0" } - { type : "RU" , id : 4 , patch_number : 28655784 } - { type : "RU" , id : 5 , patch_number : 28822489 } @@ -349,6 +349,7 @@ list_18000: - { type : "RU" , id : 12 , patch_number : 31730250 } - { type : "RU" , id : 13 , patch_number : 32204699 } - { type : "RU" , id : 14 , patch_number : 32524155 } + - { type : "RU" , id : 17 , patch_number : 33583960 } # - { type : "RUR" , id : 1 , patch_number : 28346593 , base_ru : '18.2' } # - { type : "RUR" , id : 2 , patch_number : 28601267 , base_ru : '18.2' } - { type : "RUR" , id : 1 , patch_number : 28507480 , base_ru : '18.3' } @@ -385,6 +386,7 @@ list_18000: - { type : "OJVM" , id : 201020 , patch_number : 31668892 } - { type : "OJVM" , id : 210119 , patch_number : 32119939 } - { type : "OJVM" , id : 210420 , patch_number : 32552752 } + - { type : "OJVM" , id : 220118 , patch_number : 33549631 } # No more updates on this one. diff --git a/roles/oci_object_storage_object/tasks/main.yml b/roles/oci_object_storage_object/tasks/main.yml index 2c11c65..4ecdef4 100644 --- a/roles/oci_object_storage_object/tasks/main.yml +++ b/roles/oci_object_storage_object/tasks/main.yml @@ -1,8 +1,8 @@ - name: Upload file to object storage oci_object_storage_object: namespace_name: "{{ oci_namespace }}" - bucket_name: "{{ oci_bucket }}" - object_name: "{{ oci_upload_file | regex_replace('^.*\\/', '') }}" + bucket_name: "{{ oci_upload_bucket }}" + object_name: "{{ oci_object_name }}" src: "{{ oci_upload_file }}" state: present register: oci_action @@ -11,8 +11,12 @@ - name: Remove file from object storage oci_object_storage_object: namespace_name: "{{ oci_namespace }}" - bucket_name: "{{ oci_bucket }}" - object_name: "{{ oci_upload_file | regex_replace('^.*\\/', '') }}" + bucket_name: "{{ oci_upload_bucket }}" + object_name: "{{ oci_object_name }}" state: absent register: oci_action - when: object_action == "remove" \ No newline at end of file + when: object_action == "remove" + +- name: Set target oci_object_name when undefined + set_fact: + oci_object_name: "" diff --git a/roles/oci_object_storage_object_facts/tasks/main.yml b/roles/oci_object_storage_object_facts/tasks/main.yml index 1e43dc0..9f2ba9b 100644 --- a/roles/oci_object_storage_object_facts/tasks/main.yml +++ b/roles/oci_object_storage_object_facts/tasks/main.yml @@ -11,6 +11,6 @@ - name: List files from object storage oci_object_storage_object_facts: namespace_name: "{{ oci_namespace }}" - bucket_name: "{{ oci_manual_bucket }}" + bucket_name: "{{ oci_list_bucket }}" register: oci_action when: object_action == "list" \ No newline at end of file diff --git a/tasks/config_checks.yml b/tasks/config_checks.yml index d41d68f..b3f16e4 100644 --- a/tasks/config_checks.yml +++ b/tasks/config_checks.yml @@ -13,4 +13,9 @@ - name: Tool does not exist fail: msg: "{{ downloader_tool }} must exist when download_patch is true." - when: download_patch == true and downloader_tool_result.stat.exists == false \ No newline at end of file + when: download_patch == true and downloader_tool_result.stat.exists == false + +- name: Check patch_location_type variable + fail: + msg: 'patch_location_type must be "folder" or "bucket".' + when: patch_location_type != "folder" and patch_location_type != "bucket" \ No newline at end of file diff --git a/tasks/download_patch.yml b/tasks/download_patch.yml index 88e036b..ae493a3 100644 --- a/tasks/download_patch.yml +++ b/tasks/download_patch.yml @@ -12,9 +12,10 @@ when: downloader_pass is undefined - - name: "Calling {{ downloader_tool }}" shell: | + [ ! -d "{{ db_version }}/{{ patch.type }}" ] && mkdir -p "{{ db_version }}/{{ patch.type }}" + cd "{{ db_version }}/{{ patch.type }}" $ORACLE_HOME/jdk/bin/java -jar {{ downloader_tool }} \ patch={{ patch.patch_number }} \ platform=226P \ @@ -24,5 +25,27 @@ MOSUser={{ downloader_user }} \ MOSPass='{{ downloader_pass }}' args: - chdir: "{{ patch_folder }}" - register: shell_output \ No newline at end of file + chdir: "{{ patch_location_path }}" + register: shell_output + +# If block storage: +- block: + + - name: Get patch file name to upload to OS + find: + paths: "{{ patch_location_path }}" + patterns: "p{{ patch.patch_number }}_{{ db_version | regex_replace('\\.','') }}0_Linux-x86-64.zip" + file_type: "file" + register: get_name + + - name: + include_role: + name: oci_object_storage_object + vars: + oci_upload_file: "{{ get_name.files[0].path }}" + oci_object_name: "{{ db_version }}/{{ patch.type }}/{{ get_name.files[0].path | basename }}" + oci_upload_bucket: "{{ patch_location_bucket }}" + object_action: "create" + when: get_name.files[0] is defined + + when: patch_location_type == "bucket" \ No newline at end of file diff --git a/tasks/find_patch.yml b/tasks/find_patch.yml new file mode 100644 index 0000000..e9015f1 --- /dev/null +++ b/tasks/find_patch.yml @@ -0,0 +1,41 @@ +# If bucket +- block: + + - name: List files in OCI Bucket + include_role: + name: oci_object_storage_object_facts + vars: + object_action: "list" + oci_list_bucket: "{{ patch_location_bucket }}" + + # For debugging + # - name: Check if patch is in the bucket + # debug: msg="{{ oci_action.objects | map(attribute='name') | select('search', my_query) | list }}" + # vars: + # my_query: "p{{ patch.patch_number }}" + + - name: Download file from OCI Bucket + shell: | + export LC_ALL=C.UTF-8 + export LANG=C.UTF-8 + oci os object get --bucket-name {{ patch_location_bucket }} --name {{ oci_download_file }} --file {{ patch_location_path }}/{{ oci_download_file | basename }} + register: shoutput + vars: + my_query: "p{{ patch.patch_number }}" + oci_download_file: "{{ oci_action.objects | map(attribute='name') | select('search', my_query) | list | first }}" + when: oci_action.objects | map(attribute='name') | select('search', my_query) | list | length > 0 + + when: patch_location_type == "bucket" + +- name: Finding Patch File + find: + paths: "{{ patch_location_path }}" + patterns: "p{{ patch.patch_number }}_{{ db_version | regex_replace('\\.','') }}0_Linux-x86-64.zip" + recurse: "yes" + file_type: "file" + register: find_result + +- name : Define patch_file_path + set_fact: + patch_file_path: "{{ find_result.files[0].path }}" + when: find_result.files[0] is defined \ No newline at end of file diff --git a/tasks/main_loader_manual.yml b/tasks/main_loader_manual.yml index 1eafc25..7cc4e5b 100644 --- a/tasks/main_loader_manual.yml +++ b/tasks/main_loader_manual.yml @@ -13,7 +13,7 @@ db_version: "{{ input_version }}" param_type: "{{ input_series }}" param_patch: "{{ input_patch }}" - output_folder: "{{ shared_folder }}/temp_load" + output_folder: "{{ stage_folder }}/temp_load" - name: Delete content & directory file: @@ -30,6 +30,7 @@ name: oci_object_storage_object_facts vars: object_action: "list" + oci_list_bucket: " {{ oci_manual_bucket }}" # Not working for whatever reason... diff --git a/tasks/patch_tasks_pre.yml b/tasks/patch_tasks_pre.yml index e0b0b2a..461f068 100644 --- a/tasks/patch_tasks_pre.yml +++ b/tasks/patch_tasks_pre.yml @@ -48,19 +48,9 @@ # Place patch file on the shared folder - name: Finding Patch File - find: - paths: "{{ patch_folder }}" - patterns: "p{{ patch.patch_number }}_{{ db_version | regex_replace('\\.','') }}0_Linux-x86-64.zip" - recurse: "yes" - file_type: "file" - register: find_result - - - name : Define patch_file_path - set_fact: - patch_file_path: "{{ find_result.files[0].path }}" - when: find_result.files[0] is defined + include: find_patch.yml - # Call downloader when download_patch is defined + # Call downloader when download_patch is defined and could not find the patch - block: - name: Call downloader @@ -68,17 +58,7 @@ # Try again after downloader was called - name: Finding Patch File Again - find: - paths: "{{ patch_folder }}" - patterns: "p{{ patch.patch_number }}_{{ db_version | regex_replace('\\.','') }}0_Linux-x86-64.zip" - recurse: "yes" - file_type: "file" - register: find_result - - - name : Define patch_file_path - set_fact: - patch_file_path: "{{ find_result.files[0].path }}" - when: find_result.files[0] is defined + include: find_patch.yml when: (patch_file_path|length == 0) and download_patch diff --git a/tasks/setup_env.yml b/tasks/setup_env.yml index 46951f2..1d07227 100644 --- a/tasks/setup_env.yml +++ b/tasks/setup_env.yml @@ -40,4 +40,10 @@ - name : Define latest processed as null set_fact: - latest_processed: "" \ No newline at end of file + latest_processed: "" + +- name : Define patch_location_bucket + set_fact: + patch_location_bucket: "{{ patch_location_path }}" + patch_location_path: "{{ stage_folder }}" + when: patch_location_type == "bucket" \ No newline at end of file diff --git a/tasks/setup_opatch.yml b/tasks/setup_opatch.yml index c0e0cc6..460d8fe 100644 --- a/tasks/setup_opatch.yml +++ b/tasks/setup_opatch.yml @@ -1,6 +1,29 @@ +# If bucket +- block: + + - name: List files in OCI Bucket + include_role: + name: oci_object_storage_object_facts + vars: + object_action: "list" + oci_list_bucket: "{{ patch_location_bucket }}" + + - name: Download OPatch file from OCI Bucket + shell: | + export LC_ALL=C.UTF-8 + export LANG=C.UTF-8 + oci os object get --bucket-name {{ patch_location_bucket }} --name {{ oci_download_file }} --file {{ patch_location_path }}/{{ oci_download_file | basename }} + register: shoutput + vars: + my_query: "{{ opatch_file }}" + oci_download_file: "{{ oci_action.objects | map(attribute='name') | select('search', my_query) | list | first }}" + when: oci_action.objects | map(attribute='name') | select('search', my_query) | list | length > 0 + + when: patch_location_type == "bucket" + - name: Finding OPatch File find: - paths: "{{ patch_folder }}" + paths: "{{ patch_location_path }}" patterns: "{{ opatch_file }}" recurse: "yes" file_type: "file" From 3fd0f0bd52d0217b3c6d1592b00a1b90d420b969 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 16 Feb 2022 18:14:06 -0300 Subject: [PATCH 052/229] Added local_sqlplus task --- config_oci.yml | 3 +- tasks/local_sqlplus.yml | 23 ++ tasks/patch_tasks_post.yml | 8 +- .../adb_load_bugs_fixed.yml | 32 +- .../odbfcl/adb_load_expdp/adb_load_expdp.yml | 49 +++- .../adb_load_expdp/adb_oradir_copy_file.sql | 9 + .../adb_load_expdp/adb_oradir_remove_file.sql | 8 + .../adb_load_filechksum.yml | 32 +- .../adb_load_symbols/adb_load_symbols.yml | 32 +- .../adb_load_txtcollection_files.yml | 32 +- .../odbfcl/diff_calculate/diff_calculate.sql | 274 ++++++++++++++++++ .../odbfcl/diff_calculate/diff_calculate.yml | 24 ++ .../odbfcl/diff_calculate/diff_main.sql | 55 ++++ user_scripts/odbfcl/exchange_tables_adb.yml | 16 +- user_scripts/odbfcl/tables_recreate_adb.yml | 16 +- user_scripts/odbfcl/update_table_keys_adb.yml | 16 +- 16 files changed, 537 insertions(+), 92 deletions(-) create mode 100644 tasks/local_sqlplus.yml create mode 100644 user_scripts/odbfcl/adb_load_expdp/adb_oradir_copy_file.sql create mode 100644 user_scripts/odbfcl/adb_load_expdp/adb_oradir_remove_file.sql create mode 100644 user_scripts/odbfcl/diff_calculate/diff_calculate.sql create mode 100644 user_scripts/odbfcl/diff_calculate/diff_calculate.yml create mode 100644 user_scripts/odbfcl/diff_calculate/diff_main.sql diff --git a/config_oci.yml b/config_oci.yml index 4e1dedf..a5938b0 100644 --- a/config_oci.yml +++ b/config_oci.yml @@ -40,6 +40,7 @@ user_expdp_post : - { file : "adb_load_txtcollection_files.yml" , folder : "user_scripts/odbfcl/adb_load_txtcollection_files" , type : "yml", task_action : "Load non-binary files from ORACLE_HOME in ADB" } - { file : "update_table_keys_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Update table keys to reflect correct partition name" } - { file : "exchange_tables_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Exchange loaded table in the correct partition position" } +- { file : "diff_calculate.yml" , folder : "user_scripts/odbfcl/diff_calculate" , type : "yml", task_action : "Generate differences between 2 releases" } # User that will hold your tables outputs and be exported after each execution. If the database is CDB, "C##" will be automatically inserted if not there. dump_user : hash @@ -52,7 +53,7 @@ oci_compartment_id : ocid1.compartment.oc1..xxx # OCI Information to upload objects to OS oci_namespace: xxx -oci_bucket: xxx +oci_adb_bucket: xxx # OCI Information to connect and load in ADB oci_adb_user: xxx diff --git a/tasks/local_sqlplus.yml b/tasks/local_sqlplus.yml new file mode 100644 index 0000000..ee7e86f --- /dev/null +++ b/tasks/local_sqlplus.yml @@ -0,0 +1,23 @@ +# Will execute the provided SQL using sqlplus in the local server (not remote). + +# sql_param.file : File to process. +# sql_param.cred : user/pass@tns or any other credential input. +# sql_param.folder : Folder on VM shared folder where file is. (Default: "user_scripts") +# sql_param.params : Eventual parameters that may be provided to SQL script. +# sql_param.termout : Boolean - print the SQL output. (Default: true) +# sql_param.task_action : Task name to print. + +- name: "{{ sql_param.task_action }}" + shell: | + set -e + sqlplus -L -S "{{ sql_param.cred }}" @{{ VM_folder }}/{{ sql_param.folder | default('user_scripts') }}/{{ sql_param.file }} {{ sql_param.params | default('') }} + register: sqloutput + +- name: SQL Output + debug: msg="{{ sqloutput.stdout_lines }}" + when: (sql_param.termout | default(true)) == true + +- name: SQLPlus Error! + fail: + msg: "Found SP2 string in SQLPlus output." + when: '"SP2-" in sqloutput.stdout' \ No newline at end of file diff --git a/tasks/patch_tasks_post.yml b/tasks/patch_tasks_post.yml index 2d0c849..e897fe4 100644 --- a/tasks/patch_tasks_post.yml +++ b/tasks/patch_tasks_post.yml @@ -1,4 +1,4 @@ -# Skip the dump part if not expdp does not run +# Skip the dump part if no expdp was executed - block: - name: "Copy {{ dump_file_prefix }}.dmp to repository" @@ -29,6 +29,12 @@ path: "{{ unzip_patch_folder }}" when: patch.patch_number != 0 +- name: Remove file downloaded from OCI Bucket + file: + state: absent + path: "{{ db_patch }}" + when: patch_location_type == "bucket" and db_patch is defined + - name : Remove PatchSearch.xml file: state: absent diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml b/user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml index bad9daf..695aad6 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml @@ -11,14 +11,14 @@ # Will skip all the rest if the bugs_fixed file does not exists - block: - - name: "Create sqlldr table" - shell: | - set -e - sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/adb_load_bugs_fixed/create_sqlldr_bugs_fixed_table.sql - register: sqloutput - - - name: SQL Output - debug: msg="{{ sqloutput.stdout_lines }}" + - include: tasks/local_sqlplus.yml + vars: + sql_param : { task_action : "Create sqlldr table" , + cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + file : "create_sqlldr_bugs_fixed_table.sql" , + folder : "user_scripts/odbfcl/adb_load_bugs_fixed" , + params : "" + } - name: "Load {{ bugs_fixed_file }} in the database" shell: | @@ -52,13 +52,13 @@ - name: SQL Output debug: msg="{{ sqloutput.stdout_lines }}" - - name: "Load bugs_fixed table" - shell: | - set -e - sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql - register: sqloutput - - - name: SQL Output - debug: msg="{{ sqloutput.stdout_lines }}" + - include: tasks/local_sqlplus.yml + vars: + sql_param : { task_action : "Load bugs_fixed table" , + cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + file : "load_bugs_fixed_table.sql" , + folder : "user_scripts/odbfcl/adb_load_bugs_fixed" , + params : "" + } when: bugs_fixed_stat_result.stat.exists \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml index f93f92a..ea27edb 100644 --- a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml +++ b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml @@ -16,6 +16,8 @@ name: oci_object_storage_object vars: oci_upload_file: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" + oci_object_name: "{{ oci_upload_file | basename }}" + oci_upload_bucket: "{{ oci_adb_bucket }}" object_action: "create" - name : Define source schema @@ -28,26 +30,69 @@ dump_user_int: "c##{{ dump_user }}" when: db_version != "11.2.0.4" + # This is done because expdp/impdp still can't handle Credential using oracle native authentication (instance principal, tenancy id, etc), only swift. + - include: tasks/local_sqlplus.yml + vars: + sql_param : { task_action : "Copy file from Bucket to Oracle Directory" , + cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + file : "adb_oradir_copy_file.sql" , + folder : "user_scripts/odbfcl/adb_load_expdp" , + params : "'{{ oci_adb_credential }}' '{{ oci_adb_os_url_prefix }}/{{ dump_file_prefix }}.dmp'" + } + + # This is done because expdp/impdp still can't handle Credential using oracle native authentication (instance principal, tenancy id, etc), only swift. + # - name: Import DB Tables + # shell: | + # impdp \ + # userid={{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} \ + # directory=data_pump_dir \ + # credential='{{ oci_adb_credential }}' \ + # remap_schema='{{ dump_user_int }}:{{ oci_adb_transient_user }}' \ + # parallel=16 \ + # table_exists_action=truncate \ + # dumpfile={{ oci_adb_os_url_prefix }}/{{ dump_file_prefix }}.dmp > "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.log" 2>&1 + # register: shell_output + - name: Import DB Tables shell: | impdp \ userid={{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} \ directory=data_pump_dir \ - credential='{{ oci_adb_credential }}' \ remap_schema='{{ dump_user_int }}:{{ oci_adb_transient_user }}' \ parallel=16 \ table_exists_action=truncate \ - dumpfile={{ oci_adb_os_url_prefix }}/{{ dump_file_prefix }}.dmp > "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.log" 2>&1 + dumpfile={{ dump_file_prefix }}.dmp > "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.log" 2>&1 register: shell_output - name: Import Output debug: msg="{{ shell_output.stderr_lines }}" + # This is done because expdp/impdp still can't handle Credential using oracle native authentication (instance principal, tenancy id, etc), only swift. + - include: tasks/local_sqlplus.yml + vars: + sql_param : { task_action : "Remove file from Oracle Directory" , + cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + file : "adb_oradir_remove_file.sql" , + folder : "user_scripts/odbfcl/adb_load_expdp" , + params : "'{{ dump_file_prefix }}.dmp'" + } + + - name: + include_role: + name: oci_object_storage_object + vars: + oci_upload_file: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" + oci_object_name: "{{ oci_upload_file | basename }}" + oci_upload_bucket: "{{ oci_adb_bucket }}" + object_action: "create" + - name: Remove expdp from OCI Bucket include_role: name: oci_object_storage_object vars: oci_upload_file: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" + oci_object_name: "{{ oci_upload_file | basename }}" + oci_upload_bucket: "{{ oci_adb_bucket }}" object_action: "remove" when: dump_stat_result.stat.exists \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_expdp/adb_oradir_copy_file.sql b/user_scripts/odbfcl/adb_load_expdp/adb_oradir_copy_file.sql new file mode 100644 index 0000000..ef629aa --- /dev/null +++ b/user_scripts/odbfcl/adb_load_expdp/adb_oradir_copy_file.sql @@ -0,0 +1,9 @@ +WHENEVER SQLERROR EXIT SQL.SQLCODE + +BEGIN + DBMS_CLOUD.GET_OBJECT ( + credential_name => '&1.', + object_uri => '&2.', + directory_name => 'DATA_PUMP_DIR'); +END; +/ \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_expdp/adb_oradir_remove_file.sql b/user_scripts/odbfcl/adb_load_expdp/adb_oradir_remove_file.sql new file mode 100644 index 0000000..ece33f6 --- /dev/null +++ b/user_scripts/odbfcl/adb_load_expdp/adb_oradir_remove_file.sql @@ -0,0 +1,8 @@ +WHENEVER SQLERROR EXIT SQL.SQLCODE + +BEGIN + DBMS_CLOUD.DELETE_FILE ( + directory_name => 'DATA_PUMP_DIR', + file_name => '&1.'); +END; +/ \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml b/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml index dd53190..d751130 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml +++ b/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml @@ -11,14 +11,14 @@ # Will skip all the rest if the chksum file does not exists - block: - - name: "Create sqlldr table" - shell: | - set -e - sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/adb_load_filechksum/create_sqlldr_chksum_table.sql - register: sqloutput - - - name: SQL Output - debug: msg="{{ sqloutput.stdout_lines }}" + - include: tasks/local_sqlplus.yml + vars: + sql_param : { task_action : "Create sqlldr table" , + cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + file : "create_sqlldr_chksum_table.sql" , + folder : "user_scripts/odbfcl/adb_load_filechksum" , + params : "" + } - name: "Load {{ chksum_file }} in the database" shell: | @@ -52,13 +52,13 @@ - name: SQL Output debug: msg="{{ sqloutput.stdout_lines }}" - - name: "Load chksum table" - shell: | - set -e - sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql - register: sqloutput - - - name: SQL Output - debug: msg="{{ sqloutput.stdout_lines }}" + - include: tasks/local_sqlplus.yml + vars: + sql_param : { task_action : "Load chksum table" , + cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + file : "load_chksum_table.sql" , + folder : "user_scripts/odbfcl/adb_load_filechksum" , + params : "" + } when: chksum_stat_result.stat.exists \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml b/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml index 801b9c1..c13ff54 100644 --- a/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml +++ b/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml @@ -11,14 +11,14 @@ # Will skip all the rest if the symbols file does not exists - block: - - name: "Create sqlldr table" - shell: | - set -e - sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/adb_load_symbols/create_sqlldr_symbols_table.sql - register: sqloutput - - - name: SQL Output - debug: msg="{{ sqloutput.stdout_lines }}" + - include: tasks/local_sqlplus.yml + vars: + sql_param : { task_action : "Create sqlldr table" , + cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + file : "create_sqlldr_symbols_table.sql" , + folder : "user_scripts/odbfcl/adb_load_symbols" , + params : "" + } - name: "Load {{ symbols_file }} in the database" shell: | @@ -55,13 +55,13 @@ - name: SQL Output debug: msg="{{ sqloutput.stdout_lines }}" - - name: "Load symbols table" - shell: | - set -e - sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/adb_load_symbols/load_symbols_table.sql - register: sqloutput - - - name: SQL Output - debug: msg="{{ sqloutput.stdout_lines }}" + - include: tasks/local_sqlplus.yml + vars: + sql_param : { task_action : "Load symbols table" , + cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + file : "load_symbols_table.sql" , + folder : "user_scripts/odbfcl/adb_load_symbols" , + params : "" + } when: symbols_stat_result.stat.exists \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml b/user_scripts/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml index 0eb4f2f..e81456f 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml @@ -11,14 +11,14 @@ # Will skip all the rest if the txtcollection file does not exists - block: - - name: "Create sqlldr table" - shell: | - set -e - sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/adb_load_txtcollection_files/create_sqlldr_txtcollection_table.sql - register: sqloutput - - - name: SQL Output - debug: msg="{{ sqloutput.stdout_lines }}" + - include: tasks/local_sqlplus.yml + vars: + sql_param : { task_action : "Create sqlldr table" , + cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + file : "create_sqlldr_txtcollection_table.sql" , + folder : "user_scripts/odbfcl/adb_load_txtcollection_files" , + params : "" + } - name: "Load {{ txtcollection_file }} in the database" shell: | @@ -62,13 +62,13 @@ - name: SQL Output debug: msg="{{ sqloutput.stdout_lines }}" - - name: "Load txtcollection table" - shell: | - set -e - sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql - register: sqloutput - - - name: SQL Output - debug: msg="{{ sqloutput.stdout_lines }}" + - include: tasks/local_sqlplus.yml + vars: + sql_param : { task_action : "Load txtcollection table" , + cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + file : "load_txtcollection_table.sql" , + folder : "user_scripts/odbfcl/adb_load_txtcollection_files" , + params : "" + } when: txtcollection_stat_result.stat.exists \ No newline at end of file diff --git a/user_scripts/odbfcl/diff_calculate/diff_calculate.sql b/user_scripts/odbfcl/diff_calculate/diff_calculate.sql new file mode 100644 index 0000000..c5180b5 --- /dev/null +++ b/user_scripts/odbfcl/diff_calculate/diff_calculate.sql @@ -0,0 +1,274 @@ +WHENEVER SQLERROR EXIT SQL.SQLCODE + +DEF V_CONN = '&1' +DEF V_VERS_FROM = '&2' +DEF V_VERS_TO = '&3' + +SET TERMOUT OFF ECHO OFF + +set define '^' +SPO get_code.sql +PRO set pages 0 +PRO set long 1000000 +PRO set lines 10000 +PRO set trims on +PRO set feed off +PRO set echo off +PRO set verify off +PRO set define '&' +PRO col code for a10000 +PRO set termout off +PRO spool &1..sql +PRO select code from dm_codes where md5_hash='&1';; +PRO spool off +SPO OFF +set define '&' + +set define '^' +SPO get_contents.sql +PRO set pages 0 +PRO set long 1000000 +PRO set lines 10000 +PRO set trims on +PRO set feed off +PRO set echo off +PRO set verify off +PRO set define '&' +PRO col code for a10000 +PRO set termout off +PRO spool &1..sql +PRO select contents from dm_contents where md5_hash='&1';; +PRO spool off +SPO OFF +set define '&' + +SPO gen_diff.sh +PRO set -e +PRO v_file_1="$1" +PRO v_file_2="$2" +PRO +PRO v_size=$(diff -t -bB "${v_file_1}.sql" "${v_file_2}.sql" | awk '{ print length }' | sort -n | tail -1) +PRO +PRO # -2 to remove '> ' or '< ' +PRO # +3 to include ' | ' +PRO if [ -z ${v_size} ] +PRO then +PRO touch "${v_file_1}_${v_file_2}.txt" +PRO exit 0 +PRO fi +PRO v_size=$(((v_size-2)*2+3)) +PRO +PRO sdiff -w ${v_size} -bB -t -l "${v_file_1}.sql" "${v_file_2}.sql" | cat -n | grep -v -e '($' > "${v_file_1}_${v_file_2}.txt" +SPO OFF + +SPO load_codes.sh +PRO set -e +PRO +PRO v_outpref="./list" +PRO v_file="${v_outpref}.csv" +PRO +PRO if ! ls *_*.txt >/dev/null 2>/dev/null +PRO then +PRO echo "No file to process." +PRO exit 0 +PRO fi +PRO +PRO ls -1 *_*.txt > "${v_file}" +PRO +PRO cat << EOF > "${v_outpref}_load.ctl" +PRO LOAD +PRO INTO TABLE DIFF_CODES_LOAD +PRO APPEND +PRO FIELDS TERMINATED BY ',' +PRO (file_name, +PRO contents lobfile(file_name) terminated by eof) +PRO EOF +PRO +PRO sqlldr &V_CONN \ +PRO control="${v_outpref}_load.ctl" \ +PRO errors=0 \ +PRO discardmax=0 \ +PRO direct=Y \ +PRO data="${v_file}" \ +PRO log="${v_outpref}_load.log" +PRO +PRO rm -f "${v_outpref}_load.log" "${v_outpref}_load.ctl" "${v_file}" +SPO OFF + +SPO load_contents.sh +PRO set -e +PRO +PRO v_outpref="./list" +PRO v_file="${v_outpref}.csv" +PRO +PRO if ! ls *_*.txt >/dev/null 2>/dev/null +PRO then +PRO echo "No file to process." +PRO exit 0 +PRO fi +PRO +PRO ls -1 *_*.txt > "${v_file}" +PRO +PRO cat << EOF > "${v_outpref}_load.ctl" +PRO LOAD +PRO INTO TABLE DIFF_CONTENTS_LOAD +PRO APPEND +PRO FIELDS TERMINATED BY ',' +PRO (file_name, +PRO contents lobfile(file_name) terminated by eof) +PRO EOF +PRO +PRO sqlldr &V_CONN \ +PRO control="${v_outpref}_load.ctl" \ +PRO errors=0 \ +PRO discardmax=0 \ +PRO direct=Y \ +PRO data="${v_file}" \ +PRO log="${v_outpref}_load.log" +PRO +PRO rm -f "${v_outpref}_load.log" "${v_outpref}_load.ctl" "${v_file}" +SPO OFF + +-------------------------- +------- LOAD CODES ------- +-------------------------- + +! rm -f *_*.txt + +-- For Labels +BEGIN + ADMIN.INITAPEXFROMOUTSIDE(100,2,'XYZ') ; + APEX_UTIL.SET_SESSION_STATE('ALLOW_LABELS','Y'); +END; +/ + +ROLLBACK; +EXEC L_HASH('&V_VERS_FROM','&V_VERS_TO'); + +set serverout on lines 10000 trims on verify off feed off +SPOOL aaa.sql +BEGIN + FOR I IN (SELECT NVL(D1.MD5_HASH_UNWRAPPED,D1.MD5_HASH) OLD_VALUE, + NVL(D2.MD5_HASH_UNWRAPPED,D2.MD5_HASH) NEW_VALUE + FROM P_HASH.F('&V_VERS_TO') D0, DM_CODES D1, DM_CODES D2 + WHERE D0.COMPARE_COLUMN_NAME='MD5_HASH' + AND D1.MD5_HASH = D0.OLD_VALUE + AND D2.MD5_HASH = D0.NEW_VALUE + MINUS + SELECT MD5_HASH_FROM, MD5_HASH_TO + FROM DIFF_CODES) + LOOP + DBMS_OUTPUT.PUT_LINE('@get_code.sql ' || I.OLD_VALUE); + DBMS_OUTPUT.PUT_LINE('@get_code.sql ' || I.NEW_VALUE); + DBMS_OUTPUT.PUT_LINE('! sh gen_diff.sh ' || I.OLD_VALUE || ' ' || I.NEW_VALUE); + DBMS_OUTPUT.PUT_LINE('! rm -f ' || I.OLD_VALUE || '.sql ' || I.NEW_VALUE || '.sql'); + DBMS_OUTPUT.PUT_LINE('! echo Processing ' || I.OLD_VALUE || '_' || I.NEW_VALUE); + END LOOP; +END; +/ +SPOOL OFF + +@aaa.sql + +BEGIN + EXECUTE IMMEDIATE 'DROP TABLE DIFF_CODES_LOAD PURGE'; +EXCEPTION + WHEN OTHERS THEN + IF SQLCODE != -942 THEN + RAISE; + END IF; +END; +/ + +CREATE TABLE DIFF_CODES_LOAD +( + FILE_NAME VARCHAR2(100) NOT NULL, + CONTENTS CLOB NOT NULL +) +COMPRESS NOLOGGING; + +! sh load_codes.sh + +insert /*+ append */ + into DIFF_CODES (MD5_HASH_FROM, MD5_HASH_TO, DIFF_CODE) +select substr(file_name,1,instr(file_name,'_',1,1)-1), + substr(file_name,instr(file_name,'_',1,1)+1,instr(file_name,'.',1,1)-instr(file_name,'_',1,1)-1), + CONTENTS +from DIFF_CODES_LOAD; + +commit; + +DROP TABLE DIFF_CODES_LOAD PURGE; + +! rm -f *_*.txt +! rm -f load_codes.sh +! rm -f get_code.sql + +----------------------------- +------- LOAD CONTENTS ------- +----------------------------- + +ROLLBACK; +EXEC L_TXTCOLLECTION('&V_VERS_FROM','&V_VERS_TO'); + +set serverout on lines 10000 trims on verify off feed off +SPOOL aaa.sql +BEGIN + FOR I IN (SELECT HEXTORAW(D0.OLD_VALUE) OLD_VALUE, + HEXTORAW(D0.NEW_VALUE) NEW_VALUE + FROM P_TXTCOLLECTION.F('&V_VERS_TO') D0 + WHERE D0.COMPARE_COLUMN_NAME='MD5_HASH' + MINUS + SELECT MD5_HASH_FROM, MD5_HASH_TO + FROM DIFF_CONTENTS) + LOOP + DBMS_OUTPUT.PUT_LINE('@get_contents.sql ' || I.OLD_VALUE); + DBMS_OUTPUT.PUT_LINE('@get_contents.sql ' || I.NEW_VALUE); + DBMS_OUTPUT.PUT_LINE('! sh gen_diff.sh ' || I.OLD_VALUE || ' ' || I.NEW_VALUE); + DBMS_OUTPUT.PUT_LINE('! rm -f ' || I.OLD_VALUE || '.sql ' || I.NEW_VALUE || '.sql'); + DBMS_OUTPUT.PUT_LINE('! echo Processing ' || I.OLD_VALUE || '_' || I.NEW_VALUE); + END LOOP; +END; +/ +SPOOL OFF + +@aaa.sql + +BEGIN + EXECUTE IMMEDIATE 'DROP TABLE DIFF_CONTENTS_LOAD PURGE'; +EXCEPTION + WHEN OTHERS THEN + IF SQLCODE != -942 THEN + RAISE; + END IF; +END; +/ + +CREATE TABLE DIFF_CONTENTS_LOAD +( + FILE_NAME VARCHAR2(100) NOT NULL, + CONTENTS CLOB NOT NULL +) +COMPRESS NOLOGGING; + +! sh load_contents.sh + +insert /*+ append */ + into DIFF_CONTENTS (MD5_HASH_FROM, MD5_HASH_TO, DIFF_CODE) +select substr(file_name,1,instr(file_name,'_',1,1)-1), + substr(file_name,instr(file_name,'_',1,1)+1,instr(file_name,'.',1,1)-instr(file_name,'_',1,1)-1), + CONTENTS +from DIFF_CONTENTS_LOAD; + +commit; + +DROP TABLE DIFF_CONTENTS_LOAD PURGE; + +! rm -f *_*.txt +! rm -f load_contents.sh +! rm -f get_contents.sql + +! rm -f gen_diff.sh +! rm -f aaa.sql + +exit \ No newline at end of file diff --git a/user_scripts/odbfcl/diff_calculate/diff_calculate.yml b/user_scripts/odbfcl/diff_calculate/diff_calculate.yml new file mode 100644 index 0000000..2f3fa04 --- /dev/null +++ b/user_scripts/odbfcl/diff_calculate/diff_calculate.yml @@ -0,0 +1,24 @@ +# This must come after MV_VERSIONS is reloaded + +- name: "Load {{ oci_adb_transient_user }} diff code and contents" + shell: | + set -e + v_folder="{{ stage_folder }}/temp_diff_{{ oci_adb_transient_user }}" + rm -rf "${v_folder}" + mkdir "${v_folder}" + cd "${v_folder}" + sqlplus -L -S {{ oci_adb_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/diff_calculate/diff_main.sql '{{ oci_adb_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}' '@{{ shared_folder }}/user_scripts/odbfcl/diff_calculate' {{ db_version }} {{ patch.base_ru | default('') }}{{ patch.type }} {{ patch.id }} + #rm -rf "${v_folder}" + register: sqloutput + +#- include: tasks/local_sqlplus.yml +# vars: +# sql_param : { task_action : "Load {{ oci_adb_transient_user }} diff code and contents" , +# cred : "{{ oci_adb_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , +# file : "diff_main.sql" , +# folder : "user_scripts/odbfcl/diff_calculate" , +# params : "'{{ oci_adb_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}' {{ db_version }} {{ patch.base_ru | default('') }}{{ patch.type }} {{ patch.id }}" +# } + +- name: SQL Output + debug: msg="{{ sqloutput.stdout_lines }}" \ No newline at end of file diff --git a/user_scripts/odbfcl/diff_calculate/diff_main.sql b/user_scripts/odbfcl/diff_calculate/diff_main.sql new file mode 100644 index 0000000..da31fd6 --- /dev/null +++ b/user_scripts/odbfcl/diff_calculate/diff_main.sql @@ -0,0 +1,55 @@ +WHENEVER SQLERROR CONTINUE + +CREATE TABLE "DIFF_CODES" +( + "MD5_HASH_FROM" RAW(16) NOT NULL, + "MD5_HASH_TO" RAW(16) NOT NULL, + "DIFF_CODE" CLOB NOT NULL, + CONSTRAINT DIFF_CODES_PK PRIMARY KEY ("MD5_HASH_FROM", "MD5_HASH_TO"), + CONSTRAINT DIFF_CODES_FK_1 FOREIGN KEY ("MD5_HASH_FROM") REFERENCES DM_CODES ("MD5_HASH"), + CONSTRAINT DIFF_CODES_FK_2 FOREIGN KEY ("MD5_HASH_TO") REFERENCES DM_CODES ("MD5_HASH") +) +COMPRESS NOLOGGING; + +CREATE TABLE "DIFF_CONTENTS" +( + "MD5_HASH_FROM" RAW(16) NOT NULL, + "MD5_HASH_TO" RAW(16) NOT NULL, + "DIFF_CODE" CLOB NOT NULL, + CONSTRAINT DIFF_CONTENTS_PK PRIMARY KEY ("MD5_HASH_FROM", "MD5_HASH_TO"), + CONSTRAINT DIFF_CONTENTS_FK_1 FOREIGN KEY ("MD5_HASH_FROM") REFERENCES DM_CONTENTS ("MD5_HASH"), + CONSTRAINT DIFF_CONTENTS_FK_2 FOREIGN KEY ("MD5_HASH_TO") REFERENCES DM_CONTENTS ("MD5_HASH") +) +COMPRESS NOLOGGING; + +WHENEVER SQLERROR EXIT SQL.SQLCODE + +DEF P_CRED = '&1' +DEF P_FOLDER = '&2' +DEF P_VERS = '&3' +DEF P_SER = '&4' +DEF P_PATCH = '&5' + +set pages 0 +set long 1000000 +set lines 10000 +set trims on +set feed off +set echo off +set verify off +col code for a10000 +set termout off +spo run_code.sql +select '@&P_FOLDER./diff_calculate.sql ''&P_CRED.'' ''' || v1.display_name || ''' ''' || v1.display_name_prev || '''' +from mv_versions v1, mv_versions v2 +where v1.display_name_prev=v2.display_name +and ((v1.oraversion='&P_VERS.' and v1.oraseries='&P_SER.' and v1.orapatch=&P_PATCH.) +or (v2.oraversion='&P_VERS.' and v2.oraseries='&P_SER.' and v2.orapatch=&P_PATCH.)); +spool off + +set echo on term on +@run_code.sql + +! rm -f run_code.sql + +exit \ No newline at end of file diff --git a/user_scripts/odbfcl/exchange_tables_adb.yml b/user_scripts/odbfcl/exchange_tables_adb.yml index aca77ed..159b2a1 100644 --- a/user_scripts/odbfcl/exchange_tables_adb.yml +++ b/user_scripts/odbfcl/exchange_tables_adb.yml @@ -1,8 +1,8 @@ -- name: "Load {{ oci_adb_transient_user }} tables into {{ oci_adb_user }} schema" - shell: | - set -e - sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/exchange_tables_adb.sql {{ oci_adb_user }} {{ db_version }} {{ patch.base_ru | default('') }}{{ patch.type }} {{ patch.id }} - register: sqloutput - -- name: SQL Output - debug: msg="{{ sqloutput.stdout_lines }}" \ No newline at end of file +- include: tasks/local_sqlplus.yml + vars: + sql_param : { task_action : "Load {{ oci_adb_transient_user }} tables into {{ oci_adb_user }} schema" , + cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + file : "exchange_tables_adb.sql" , + folder : "user_scripts/odbfcl" , + params : "{{ oci_adb_user }} {{ db_version }} {{ patch.base_ru | default('') }}{{ patch.type }} {{ patch.id }}" + } \ No newline at end of file diff --git a/user_scripts/odbfcl/tables_recreate_adb.yml b/user_scripts/odbfcl/tables_recreate_adb.yml index 87f247a..ba56654 100644 --- a/user_scripts/odbfcl/tables_recreate_adb.yml +++ b/user_scripts/odbfcl/tables_recreate_adb.yml @@ -2,11 +2,11 @@ set_fact: oci_adb_transient_user: "{{ oci_adb_user }}_{{ db_version | replace('.', '') }}" -- name: "Run tables recreate ADB SQL" - shell: | - set -e - sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/tables_recreate_adb.sql - register: sqloutput - -- name: SQL Output - debug: msg="{{ sqloutput.stdout_lines }}" \ No newline at end of file +- include: tasks/local_sqlplus.yml + vars: + sql_param : { task_action : "Run tables recreate ADB SQL" , + cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + file : "tables_recreate_adb.sql" , + folder : "user_scripts/odbfcl" , + params : "" + } \ No newline at end of file diff --git a/user_scripts/odbfcl/update_table_keys_adb.yml b/user_scripts/odbfcl/update_table_keys_adb.yml index b49bf14..4524efa 100644 --- a/user_scripts/odbfcl/update_table_keys_adb.yml +++ b/user_scripts/odbfcl/update_table_keys_adb.yml @@ -1,8 +1,8 @@ -- name: "Update {{ oci_adb_transient_user }} tables with new keys" - shell: | - set -e - sqlplus -L -S {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/update_table_keys_adb.sql {{ db_version }} {{ patch.base_ru | default('') }}{{ patch.type }} {{ patch.id }} - register: sqloutput - -- name: SQL Output - debug: msg="{{ sqloutput.stdout_lines }}" \ No newline at end of file +- include: tasks/local_sqlplus.yml + vars: + sql_param : { task_action : "Update {{ oci_adb_transient_user }} tables with new keys" , + cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + file : "update_table_keys_adb.sql" , + folder : "user_scripts/odbfcl" , + params : "{{ db_version }} {{ patch.base_ru | default('') }}{{ patch.type }} {{ patch.id }}" + } \ No newline at end of file From fefdaceb1b4c8167e4a535afe14ad7878fca91de Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 16 Feb 2022 18:23:15 -0300 Subject: [PATCH 053/229] Fix introduced bugs --- roles/oci_object_storage_object/tasks/main.yml | 6 +----- user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml | 10 ---------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/roles/oci_object_storage_object/tasks/main.yml b/roles/oci_object_storage_object/tasks/main.yml index 4ecdef4..963c9b1 100644 --- a/roles/oci_object_storage_object/tasks/main.yml +++ b/roles/oci_object_storage_object/tasks/main.yml @@ -15,8 +15,4 @@ object_name: "{{ oci_object_name }}" state: absent register: oci_action - when: object_action == "remove" - -- name: Set target oci_object_name when undefined - set_fact: - oci_object_name: "" + when: object_action == "remove" \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml index ea27edb..1636e8a 100644 --- a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml +++ b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml @@ -77,20 +77,10 @@ params : "'{{ dump_file_prefix }}.dmp'" } - - name: - include_role: - name: oci_object_storage_object - vars: - oci_upload_file: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" - oci_object_name: "{{ oci_upload_file | basename }}" - oci_upload_bucket: "{{ oci_adb_bucket }}" - object_action: "create" - - name: Remove expdp from OCI Bucket include_role: name: oci_object_storage_object vars: - oci_upload_file: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" oci_object_name: "{{ oci_upload_file | basename }}" oci_upload_bucket: "{{ oci_adb_bucket }}" object_action: "remove" From 2fbe6971eed5adc33e4ffeb41615d6d18a5b4395 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 16 Feb 2022 20:39:44 -0300 Subject: [PATCH 054/229] Minor fixes --- user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml | 1 + user_scripts/odbfcl/diff_calculate/diff_calculate.sql | 4 +--- user_scripts/odbfcl/diff_calculate/diff_main.sql | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml index 1636e8a..8e20332 100644 --- a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml +++ b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml @@ -81,6 +81,7 @@ include_role: name: oci_object_storage_object vars: + oci_upload_file: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" oci_object_name: "{{ oci_upload_file | basename }}" oci_upload_bucket: "{{ oci_adb_bucket }}" object_action: "remove" diff --git a/user_scripts/odbfcl/diff_calculate/diff_calculate.sql b/user_scripts/odbfcl/diff_calculate/diff_calculate.sql index c5180b5..6050f82 100644 --- a/user_scripts/odbfcl/diff_calculate/diff_calculate.sql +++ b/user_scripts/odbfcl/diff_calculate/diff_calculate.sql @@ -269,6 +269,4 @@ DROP TABLE DIFF_CONTENTS_LOAD PURGE; ! rm -f get_contents.sql ! rm -f gen_diff.sh -! rm -f aaa.sql - -exit \ No newline at end of file +! rm -f aaa.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/diff_calculate/diff_main.sql b/user_scripts/odbfcl/diff_calculate/diff_main.sql index da31fd6..7951875 100644 --- a/user_scripts/odbfcl/diff_calculate/diff_main.sql +++ b/user_scripts/odbfcl/diff_calculate/diff_main.sql @@ -40,14 +40,13 @@ set verify off col code for a10000 set termout off spo run_code.sql -select '@&P_FOLDER./diff_calculate.sql ''&P_CRED.'' ''' || v1.display_name || ''' ''' || v1.display_name_prev || '''' +select '@&P_FOLDER./diff_calculate.sql ''&P_CRED.'' ''' || v1.display_name_prev || ''' ''' || v1.display_name || '''' from mv_versions v1, mv_versions v2 where v1.display_name_prev=v2.display_name and ((v1.oraversion='&P_VERS.' and v1.oraseries='&P_SER.' and v1.orapatch=&P_PATCH.) or (v2.oraversion='&P_VERS.' and v2.oraseries='&P_SER.' and v2.orapatch=&P_PATCH.)); spool off -set echo on term on @run_code.sql ! rm -f run_code.sql From d38690c8a1a9ec3a9850f65c11ff448623383087 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 25 Mar 2022 15:42:50 -0300 Subject: [PATCH 055/229] Update sh_extractor scripts --- .../odbfcl/sh_extractor/cleanUser.sql | 4 +++- .../odbfcl/sh_extractor/dumpCreate.sh | 23 ++++++++++++------- user_scripts/odbfcl/sh_extractor/exporter.sh | 21 +++++++++++------ .../odbfcl/sh_extractor/fileCollect.sh | 2 ++ user_scripts/odbfcl/sh_extractor/fileGet.sh | 4 ++++ .../odbfcl/sh_extractor/get_user_prefix.sql | 12 ++++++++++ 6 files changed, 50 insertions(+), 16 deletions(-) create mode 100644 user_scripts/odbfcl/sh_extractor/get_user_prefix.sql diff --git a/user_scripts/odbfcl/sh_extractor/cleanUser.sql b/user_scripts/odbfcl/sh_extractor/cleanUser.sql index 73858b2..5a5f435 100644 --- a/user_scripts/odbfcl/sh_extractor/cleanUser.sql +++ b/user_scripts/odbfcl/sh_extractor/cleanUser.sql @@ -3,6 +3,8 @@ WHENEVER SQLERROR EXIT SQL.SQLCODE DROP DIRECTORY expdir; -DROP USER C##HASH CASCADE; +def v_username='&1.' + +DROP USER &v_username. CASCADE; EXIT 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh index 95ae7da..2fc792c 100644 --- a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh @@ -27,7 +27,7 @@ v_output_file="$(basename "${v_output}")" v_output_full="${v_output_fdr}/${v_output_file}" -v_user='c##hash' +v_user='hash' v_pass='hash' v_thisdir="$(cd "$(dirname "$0")"; pwd)" @@ -44,29 +44,36 @@ v_patch_version=`cut -d '_' -f 1 <<< "${v_output_file_noext}"` v_patch_type=`cut -d '_' -f 2 <<< "${v_output_file_noext}"` v_patch_id=`cut -d '_' -f 3 <<< "${v_output_file_noext}"` -v_output_file_cnt=`awk -F"." '{print NF-1}' <<< "${v_patch_version}"` -[ ${v_output_file_cnt} -ne 3 ] && exitError "Version \"${v_patch_version}\" must be in \"X.X.X.X\" format." +re='^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$' +if ! [[ $v_patch_version =~ $re ]] ; then + exitError "Version \"${v_patch_version}\" must be in \"X.X.X.X\" format." +fi re='^[0-9]+$' if ! [[ $v_patch_id =~ $re ]] ; then exitError "\"$v_patch_id\" must be a number." fi -echo "Generating tables export. Please wait.." +echo "Check if common user. Please wait.." +v_common_user=$($ORACLE_HOME/bin/sqlplus -L -S "/ as sysdba" @get_user_prefix.sql) + +[ -n "${v_common_user}" ] && v_user="${v_common_user}${v_user}" + +echo "Generating table export. Please wait.." cd "${v_thisdir}"/../ $ORACLE_HOME/bin/sqlplus "/ as sysdba" < -# v1.0.0.1 +# v1.0.0.2 set -eo pipefail @@ -18,6 +18,8 @@ function exitError () v_pattern="$1" +v_example='19.0.0.0_LRU14_20220101' + [ -z "$v_pattern" -o "$#" -ne 1 ] && exitError "Usage: $0 First parameter is the file name pattern and cannot be null. @@ -27,27 +29,32 @@ The pattern is composed by 3 parts, divided by \"_\": 2nd - Type. Can be any string. 3rd - ID. Must be a number. -Eg: $0 19.0.0.0_LRU14_20220101 +Eg: $0 ${v_example} The output is a zip file. " v_pattern_cnt=`awk -F"_" '{print NF-1}' <<< "${v_pattern}"` -[ ${v_pattern_cnt} -ne 2 ] && exitError "Pattern \"${v_output}\" must have 2 \"_\" on it. Eg: 19.0.0.0_LRU14_20220101" +[ ${v_pattern_cnt} -ne 2 ] && exitError "Pattern \"${v_output}\" must have 2 \"_\" on it. Eg: ${v_example}" v_pattern_cnt=`awk -F" " '{print NF-1}' <<< "${v_pattern}"` -[ ${v_pattern_cnt} -ne 0 ] && exitError "Pattern \"${v_output}\" must not have any spaces. Eg: 19.0.0.0_LRU14_20220101" +[ ${v_pattern_cnt} -ne 0 ] && exitError "Pattern \"${v_output}\" must not have any spaces. Eg: ${v_example}" v_patch_version=`cut -d '_' -f 1 <<< "${v_pattern}"` v_patch_type=`cut -d '_' -f 2 <<< "${v_pattern}"` v_patch_id=`cut -d '_' -f 3 <<< "${v_pattern}"` -v_pattern_cnt=`awk -F"." '{print NF-1}' <<< "${v_patch_version}"` -[ ${v_pattern_cnt} -ne 3 ] && exitError "Version \"${v_patch_version}\" must be in \"X.X.X.X\" format. Eg: 19.0.0.0_LRU14_20220101" +# v_pattern_cnt=`awk -F"." '{print NF-1}' <<< "${v_patch_version}"` +# [ ${v_pattern_cnt} -ne 3 ] && exitError "Version \"${v_patch_version}\" must be in \"X.X.X.X\" format. Eg: ${v_example}" + +re='^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$' +if ! [[ $v_patch_version =~ $re ]] ; then + exitError "Version \"${v_patch_version}\" must be in \"X.X.X.X\" format. Eg: ${v_example}" +fi re='^[0-9]+$' if ! [[ $v_patch_id =~ $re ]] ; then - exitError "\"$v_patch_id\" must be a number. Eg: 19.0.0.0_LRU14_20220101" + exitError "\"$v_patch_id\" must be a number. Eg: ${v_example}" fi v_thisdir="$(cd "$(dirname "$0")"; pwd)" diff --git a/user_scripts/odbfcl/sh_extractor/fileCollect.sh b/user_scripts/odbfcl/sh_extractor/fileCollect.sh index ed705ba..005133e 100644 --- a/user_scripts/odbfcl/sh_extractor/fileCollect.sh +++ b/user_scripts/odbfcl/sh_extractor/fileCollect.sh @@ -29,6 +29,8 @@ v_output_full="${v_output_fdr}/${v_output_file}" echo "Generating ORACLE_HOME non-binary files list. Please wait.." cd "$ORACLE_HOME" + +set +e # grep may return "Permission denied" find -type f -not -path "./.patch_storage/*" -not -name "tfa_setup" -print0 | xargs -0 grep -Il '.' | tar -czf "${v_output_full}" -T - exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/fileGet.sh b/user_scripts/odbfcl/sh_extractor/fileGet.sh index c3c0a5f..8be3709 100644 --- a/user_scripts/odbfcl/sh_extractor/fileGet.sh +++ b/user_scripts/odbfcl/sh_extractor/fileGet.sh @@ -29,7 +29,9 @@ v_output_full="${v_output_fdr}/${v_output_file}" echo "Generating sha256sum list. Please wait.." cd "$ORACLE_HOME" +set +e find -type f -exec sha256sum "{}" + > "${v_output_full}" +set -eo pipefail cd - > /dev/null sed -i 's/$/ F/' "${v_output_full}" @@ -45,7 +47,9 @@ do rm -rf "${v_ext_fold}" mkdir "${v_ext_fold}" cd "${v_ext_fold}" + set +e ar x "${v_lib}" + set -eo pipefail find -type f -exec sha256sum "{}" + > "${v_out_file}" cd - > /dev/null sed -i "s| \.| ${v_lib}|" "${v_out_file}" diff --git a/user_scripts/odbfcl/sh_extractor/get_user_prefix.sql b/user_scripts/odbfcl/sh_extractor/get_user_prefix.sql new file mode 100644 index 0000000..6bc101a --- /dev/null +++ b/user_scripts/odbfcl/sh_extractor/get_user_prefix.sql @@ -0,0 +1,12 @@ +SET SERVEROUT ON ECHO OFF FEED OFF +DECLARE + V_RESULT NUMBER; +BEGIN + select 1 INTO V_RESULT from dual where SYS_CONTEXT('USERENV', 'CON_ID')=1; + DBMS_OUTPUT.PUT_LINE('c##'); +EXCEPTION + WHEN OTHERS THEN + NULL; +END; +/ +EXIT \ No newline at end of file From c77e26f02e4601f1fd1b54b34e724973862fa098 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 25 Mar 2022 15:43:48 -0300 Subject: [PATCH 056/229] tables_recreate change Now it gets the user and password from parameters, instead of hard-coded --- user_scripts/odbfcl/tables_recreate.sql | 13 ++++--------- user_scripts/odbfcl/tables_recreate.yml | 3 +++ 2 files changed, 7 insertions(+), 9 deletions(-) create mode 100644 user_scripts/odbfcl/tables_recreate.yml diff --git a/user_scripts/odbfcl/tables_recreate.sql b/user_scripts/odbfcl/tables_recreate.sql index ee447b3..d04ce0e 100644 --- a/user_scripts/odbfcl/tables_recreate.sql +++ b/user_scripts/odbfcl/tables_recreate.sql @@ -1,15 +1,10 @@ WHENEVER SQLERROR EXIT SQL.SQLCODE -col v_username new_v v_username nopri +def v_username='&1.' +def v_password='&2.' -select case when version >= 12 then 'C##' end || 'HASH' v_username -from (select to_number(substr(version,1,instr(version,'.')-1)) version - from v$instance); +@@createUser.sql '&v_username.' '&v_password.' -col v_username clear - -@@createUser.sql &v_username. - -conn &v_username./hash; +conn &v_username./&v_password. @@tables_create.sql diff --git a/user_scripts/odbfcl/tables_recreate.yml b/user_scripts/odbfcl/tables_recreate.yml new file mode 100644 index 0000000..125bf2f --- /dev/null +++ b/user_scripts/odbfcl/tables_recreate.yml @@ -0,0 +1,3 @@ +- include: tasks/run_sql.yml + vars: + sql_param : { file : "tables_recreate.sql" , folder : "user_scripts/odbfcl" , task_action : "Recreate tables" , params : "'{{ dump_user_int }}' '{{ dump_pass }}'" } \ No newline at end of file From 4607c7ef971a64ba781a9488635d2b402a2105dc Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 25 Mar 2022 15:44:16 -0300 Subject: [PATCH 057/229] hash_get username via parameter Now hashGet username is no more hardcoded --- user_scripts/odbfcl/extract/hashGet.sql | 15 ++++----- user_scripts/odbfcl/extract/hashGet.yml | 2 +- user_scripts/odbfcl/extract/load_dba_cdb.sql | 34 ++++++++++---------- 3 files changed, 25 insertions(+), 26 deletions(-) diff --git a/user_scripts/odbfcl/extract/hashGet.sql b/user_scripts/odbfcl/extract/hashGet.sql index 459c3eb..7009a2b 100644 --- a/user_scripts/odbfcl/extract/hashGet.sql +++ b/user_scripts/odbfcl/extract/hashGet.sql @@ -5,18 +5,17 @@ set verify off set tab off set serverout on -col v_username new_v v_username nopri +DEF V_USERNAME = '&1' -select case when version >= 12 then 'C##' end || 'HASH' v_username -from (select to_number(substr(version,1,instr(version,'.')-1)) version - from v$instance); +DEF P_VERS = '&2' +DEF P_SER = '&3' +DEF P_PATCH = '&4' +-- Convert to uppercase +col v_username new_v v_username nopri +SELECT UPPER('&V_USERNAME.') V_USERNAME FROM DUAL; col v_username clear -DEF P_PATCH = '&1' -DEF P_SER = '&2' -DEF P_VERS = '&3' - DECLARE V_ORA_VER_MAJOR NUMBER; V_ORA_VERSION VARCHAR2(20); diff --git a/user_scripts/odbfcl/extract/hashGet.yml b/user_scripts/odbfcl/extract/hashGet.yml index aa537d1..f693c02 100644 --- a/user_scripts/odbfcl/extract/hashGet.yml +++ b/user_scripts/odbfcl/extract/hashGet.yml @@ -1,4 +1,4 @@ - include: tasks/run_sql.yml vars: - sql_param : { file : "hashGet.sql" , folder : "user_scripts/odbfcl/extract" , task_action : "Calculate Hash" , params : "{{ patch.id }} {{ patch.base_ru | default('') }}{{ patch.type }} {{ db_version }}" } + sql_param : { file : "hashGet.sql" , folder : "user_scripts/odbfcl/extract" , task_action : "Calculate Hash" , params : "{{ dump_user_int }} {{ db_version }} {{ patch.base_ru | default('') }}{{ patch.type }} {{ patch.id }}" } # patch.base_ru will only be populated for RURs \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/load_dba_cdb.sql b/user_scripts/odbfcl/extract/load_dba_cdb.sql index 44c1d68..b99d1ac 100644 --- a/user_scripts/odbfcl/extract/load_dba_cdb.sql +++ b/user_scripts/odbfcl/extract/load_dba_cdb.sql @@ -2,7 +2,7 @@ DECLARE VVERS VARCHAR2(20) := '&P_VERS.'; VSER VARCHAR2(10) := '&P_SER.'; VPATCH NUMBER := &P_PATCH.; - VUSER VARCHAR2(30) := '&v_username.'; + VUSER VARCHAR2(30) := '&V_USERNAME.'; PROCEDURE RUN_INSERT (IN_TAB_NAME VARCHAR2, IN_WHERE_CLAUSE_12 VARCHAR2 DEFAULT NULL, @@ -70,20 +70,20 @@ BEGIN DBMS_OUTPUT.ENABLE(NULL); RUN_INSERT ('TAB_PRIVS', - q'[GRANTEE != 'C##HASH' AND NOT(TABLE_NAME LIKE 'C##HASH' AND PRIVILEGE='INHERIT PRIVILEGES')]', - q'[GRANTEE != 'HASH']' + q'[GRANTEE != '&V_USERNAME.' AND NOT(TABLE_NAME LIKE '&V_USERNAME.' AND PRIVILEGE='INHERIT PRIVILEGES')]', + q'[GRANTEE != '&V_USERNAME.']' ); RUN_INSERT ('COL_PRIVS', - q'[GRANTEE != 'C##HASH']', - q'[GRANTEE != 'HASH']' + q'[GRANTEE != '&V_USERNAME.']', + q'[GRANTEE != '&V_USERNAME.']' ); RUN_INSERT ('SYS_PRIVS', - q'[GRANTEE != 'C##HASH']', - q'[GRANTEE != 'HASH']' + q'[GRANTEE != '&V_USERNAME.']', + q'[GRANTEE != '&V_USERNAME.']' ); RUN_INSERT ('ROLE_PRIVS', - q'[GRANTEE != 'C##HASH']', - q'[GRANTEE != 'HASH']' + q'[GRANTEE != '&V_USERNAME.']', + q'[GRANTEE != '&V_USERNAME.']' ); RUN_INSERT ('JAVA_POLICY'); @@ -91,8 +91,8 @@ BEGIN RUN_INSERT ('JOBS'); RUN_INSERT ('TS_QUOTAS', - q'[USERNAME != 'C##HASH']', - q'[USERNAME != 'HASH']' + q'[USERNAME != '&V_USERNAME.']', + q'[USERNAME != '&V_USERNAME.']' ); RUN_INSERT ('POLICIES'); @@ -123,20 +123,20 @@ BEGIN ); RUN_INSERT ('USERS', - q'[USERNAME != 'C##HASH']', - q'[USERNAME != 'HASH']' + q'[USERNAME != '&V_USERNAME.']', + q'[USERNAME != '&V_USERNAME.']' ); RUN_INSERT ('ROLES'); RUN_INSERT ('OBJECTS', - q'[OWNER != 'C##HASH']', - q'[OWNER != 'HASH']' + q'[OWNER != '&V_USERNAME.']', + q'[OWNER != '&V_USERNAME.']' ); RUN_INSERT ('TAB_COLUMNS', - q'[OWNER != 'C##HASH']', - q'[OWNER != 'HASH']' + q'[OWNER != '&V_USERNAME.']', + q'[OWNER != '&V_USERNAME.']' ); RUN_INSERT ('REGISTRY'); From 2ace741786a08e867ddd272846c9eb476402e97a Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 25 Mar 2022 15:44:52 -0300 Subject: [PATCH 058/229] Remove hardcoded HASH user --- user_scripts/externalDir.sql | 8 +------- user_scripts/externalDir.yml | 2 +- user_scripts/odbfcl/createUser.sql | 13 ++++++++----- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/user_scripts/externalDir.sql b/user_scripts/externalDir.sql index 6195c3a..70d70f3 100644 --- a/user_scripts/externalDir.sql +++ b/user_scripts/externalDir.sql @@ -3,13 +3,7 @@ WHENEVER SQLERROR EXIT SQL.SQLCODE CREATE OR REPLACE DIRECTORY expdir AS '&1'; -col v_username new_v v_username nopri - -select case when version >= 12 then 'C##' end || 'HASH' v_username -from (select to_number(substr(version,1,instr(version,'.')-1)) version - from v$instance); - -col v_username clear +def v_username='&2.' GRANT READ,WRITE ON DIRECTORY expdir to &v_username.; diff --git a/user_scripts/externalDir.yml b/user_scripts/externalDir.yml index fc579ab..88b8f2c 100644 --- a/user_scripts/externalDir.yml +++ b/user_scripts/externalDir.yml @@ -1,3 +1,3 @@ - include: tasks/run_sql.yml vars: - sql_param : { file : "externalDir.sql" , task_action : "Create External Directory" , params : "{{ VM_folder }}" } + sql_param : { file : "externalDir.sql" , task_action : "Create External Directory" , params : "'{{ VM_folder }}' '{{ dump_user_int }}'" } diff --git a/user_scripts/odbfcl/createUser.sql b/user_scripts/odbfcl/createUser.sql index 1739fe8..d546e48 100644 --- a/user_scripts/odbfcl/createUser.sql +++ b/user_scripts/odbfcl/createUser.sql @@ -1,13 +1,16 @@ -- Create HASH user WHENEVER SQLERROR CONTINUE -DROP USER &1 CASCADE; +def v_username='&1.' +def v_password='&2.' + +DROP USER &v_username. CASCADE; WHENEVER SQLERROR EXIT SQL.SQLCODE -CREATE USER &1 IDENTIFIED BY "hash" DEFAULT TABLESPACE "USERS" TEMPORARY TABLESPACE "TEMP" QUOTA UNLIMITED ON "USERS"; +CREATE USER &v_username. IDENTIFIED BY "&v_password." DEFAULT TABLESPACE "USERS" TEMPORARY TABLESPACE "TEMP" QUOTA UNLIMITED ON "USERS"; -GRANT CREATE SESSION TO &1.; -GRANT CREATE TABLE TO &1.; +GRANT CREATE SESSION TO &v_username.; +GRANT CREATE TABLE TO &v_username.; -- For unwrapper: -GRANT CREATE PROCEDURE TO &1.; \ No newline at end of file +GRANT CREATE PROCEDURE TO &v_username.; \ No newline at end of file From 07b846ac3477a7eea067bdd9fd55c00d40fff265 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 25 Mar 2022 15:44:58 -0300 Subject: [PATCH 059/229] Update main_loader_manual.yml --- tasks/main_loader_manual.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main_loader_manual.yml b/tasks/main_loader_manual.yml index 7cc4e5b..092f063 100644 --- a/tasks/main_loader_manual.yml +++ b/tasks/main_loader_manual.yml @@ -30,7 +30,7 @@ name: oci_object_storage_object_facts vars: object_action: "list" - oci_list_bucket: " {{ oci_manual_bucket }}" + oci_list_bucket: "{{ oci_manual_bucket }}" # Not working for whatever reason... From 40b4e584c20b23506a70ce1deac7bca16411a60c Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 25 Mar 2022 16:07:57 -0300 Subject: [PATCH 060/229] Directory name is now a variable --- config_oci.yml | 7 +++---- tasks/impdp_file.yml | 4 ++-- tasks/patch_main.yml | 2 +- tasks/patch_main_11g.yml | 2 +- user_scripts/externalDir.sql | 10 +++++---- user_scripts/externalDir.yml | 2 +- .../odbfcl/sh_extractor/cleanUser.sql | 5 +++-- .../odbfcl/sh_extractor/dumpCreate.sh | 21 ++++++++++--------- 8 files changed, 28 insertions(+), 25 deletions(-) diff --git a/config_oci.yml b/config_oci.yml index a5938b0..9783ce1 100644 --- a/config_oci.yml +++ b/config_oci.yml @@ -27,7 +27,7 @@ user_expdp_pre : - { file : "fileGet.yml" , folder : "user_scripts/odbfcl/extract" , type : "yml", task_action : "Generate chksum for ORACLE_HOME" } - { file : "fileCollect.yml" , folder : "user_scripts/odbfcl/extract" , type : "yml", task_action : "Collect non-binary files from ORACLE_HOME" } - { file : "symbolGet.yml" , folder : "user_scripts/odbfcl/extract" , type : "yml", task_action : "Get all symbols on ORACLE_HOME binaries and libs" } -- { file : "tables_recreate.sql" , folder : "user_scripts/odbfcl" , type : "sql" , task_action : "Recreate tables" } +- { file : "tables_recreate.yml" , folder : "user_scripts/odbfcl" , type : "yml" , task_action : "Recreate tables" } - { file : "hashGet.yml" , folder : "user_scripts/odbfcl/extract" , type : "yml", task_action : "Collect Database Info" } - { file : "externalDir.yml" , type : "yml" , task_action : "Create External Directory" } @@ -42,11 +42,10 @@ user_expdp_post : - { file : "exchange_tables_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Exchange loaded table in the correct partition position" } - { file : "diff_calculate.yml" , folder : "user_scripts/odbfcl/diff_calculate" , type : "yml", task_action : "Generate differences between 2 releases" } -# User that will hold your tables outputs and be exported after each execution. If the database is CDB, "C##" will be automatically inserted if not there. +# User that will hold your tables outputs and be exported after each execution. If the database is CDB, "C##" will be automatically be appended. dump_user : hash - -# User pass dump_pass : hash +dump_dir_name : expdir_hash # OCI Information to deploy VM oci_compartment_id : ocid1.compartment.oc1..xxx diff --git a/tasks/impdp_file.yml b/tasks/impdp_file.yml index fe53acc..be4eca3 100644 --- a/tasks/impdp_file.yml +++ b/tasks/impdp_file.yml @@ -21,7 +21,7 @@ - name: Import Database Tables shell: | - {{ dbhome_locl }}/bin/impdp userid={{ dump_user_int }}/{{ dump_pass }} directory=expdir dumpfile={{ dump_file_prefix }}.dmp logfile={{ dump_file_prefix }}.log table_exists_action=append remap_schema={{ dump_user }}:{{ dump_user_int }} + {{ dbhome_locl }}/bin/impdp userid={{ dump_user_int }}/{{ dump_pass }} directory={{ dump_dir_name }} dumpfile={{ dump_file_prefix }}.dmp logfile={{ dump_file_prefix }}.log table_exists_action=append remap_schema={{ dump_user }}:{{ dump_user_int }} environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" @@ -33,7 +33,7 @@ - name: Import Database Tables shell: | - {{ dbhome_locl }}/bin/impdp userid={{ dump_user_int }}/{{ dump_pass }} directory=expdir dumpfile={{ dump_file_prefix }}.dmp logfile={{ dump_file_prefix }}.log table_exists_action=append + {{ dbhome_locl }}/bin/impdp userid={{ dump_user_int }}/{{ dump_pass }} directory={{ dump_dir_name }} dumpfile={{ dump_file_prefix }}.dmp logfile={{ dump_file_prefix }}.log table_exists_action=append environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" diff --git a/tasks/patch_main.yml b/tasks/patch_main.yml index cbe6722..5c0c423 100644 --- a/tasks/patch_main.yml +++ b/tasks/patch_main.yml @@ -79,7 +79,7 @@ - name: Export Database Tables shell: | - {{ dbhome_locl }}/bin/expdp userid={{ dump_user_int }}/{{ dump_pass }} directory=expdir compression=all dumpfile={{ dump_file_prefix }}.dmp logfile={{ dump_file_prefix }}.log content=data_only schemas={{ dump_user_int }} {{ expdp_version }} + {{ dbhome_locl }}/bin/expdp userid={{ dump_user_int }}/{{ dump_pass }} directory={{ dump_dir_name }} compression=all dumpfile={{ dump_file_prefix }}.dmp logfile={{ dump_file_prefix }}.log content=data_only schemas={{ dump_user_int }} {{ expdp_version }} environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" diff --git a/tasks/patch_main_11g.yml b/tasks/patch_main_11g.yml index 90bb739..825bf0e 100644 --- a/tasks/patch_main_11g.yml +++ b/tasks/patch_main_11g.yml @@ -115,7 +115,7 @@ - name: Export Database Tables shell: | - {{ dbhome_locl }}/bin/expdp userid={{ dump_user_int }}/{{ dump_pass }} directory=expdir compression=all dumpfile={{ dump_file_prefix }}.dmp logfile={{ dump_file_prefix }}.log content=data_only schemas={{ dump_user_int }} + {{ dbhome_locl }}/bin/expdp userid={{ dump_user_int }}/{{ dump_pass }} directory={{ dump_dir_name }} compression=all dumpfile={{ dump_file_prefix }}.dmp logfile={{ dump_file_prefix }}.log content=data_only schemas={{ dump_user_int }} environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" diff --git a/user_scripts/externalDir.sql b/user_scripts/externalDir.sql index 70d70f3..3feb3b2 100644 --- a/user_scripts/externalDir.sql +++ b/user_scripts/externalDir.sql @@ -1,10 +1,12 @@ --- This code is called just before the expdp. EXPDIR is used by expdp and must exist. +-- This code is called just before the expdp. The DB directory is used by expdp and must exist. WHENEVER SQLERROR EXIT SQL.SQLCODE -CREATE OR REPLACE DIRECTORY expdir AS '&1'; - +def v_path='&1.' def v_username='&2.' +def v_dir_name='&3.' + +CREATE OR REPLACE DIRECTORY &v_dir_name. AS '&v_path.'; -GRANT READ,WRITE ON DIRECTORY expdir to &v_username.; +GRANT READ,WRITE ON DIRECTORY &v_dir_name. to &v_username.; EXIT 0 \ No newline at end of file diff --git a/user_scripts/externalDir.yml b/user_scripts/externalDir.yml index 88b8f2c..97437ac 100644 --- a/user_scripts/externalDir.yml +++ b/user_scripts/externalDir.yml @@ -1,3 +1,3 @@ - include: tasks/run_sql.yml vars: - sql_param : { file : "externalDir.sql" , task_action : "Create External Directory" , params : "'{{ VM_folder }}' '{{ dump_user_int }}'" } + sql_param : { file : "externalDir.sql" , task_action : "Create External Directory" , params : "'{{ VM_folder }}' '{{ dump_user_int }}' '{{ dump_dir_name }}'" } diff --git a/user_scripts/odbfcl/sh_extractor/cleanUser.sql b/user_scripts/odbfcl/sh_extractor/cleanUser.sql index 5a5f435..aa0e3f7 100644 --- a/user_scripts/odbfcl/sh_extractor/cleanUser.sql +++ b/user_scripts/odbfcl/sh_extractor/cleanUser.sql @@ -1,9 +1,10 @@ -- This code will clean the created objects. WHENEVER SQLERROR EXIT SQL.SQLCODE -DROP DIRECTORY expdir; - def v_username='&1.' +def v_directory='&2.' + +DROP DIRECTORY &v_directory.; DROP USER &v_username. CASCADE; diff --git a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh index 2fc792c..f681b05 100644 --- a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh @@ -27,8 +27,9 @@ v_output_file="$(basename "${v_output}")" v_output_full="${v_output_fdr}/${v_output_file}" -v_user='hash' -v_pass='hash' +v_dump_user='hash' +v_dump_pass='HhAaSsHh..135' +v_dump_dir_name='expdir_hash' v_thisdir="$(cd "$(dirname "$0")"; pwd)" @@ -57,37 +58,37 @@ fi echo "Check if common user. Please wait.." v_common_user=$($ORACLE_HOME/bin/sqlplus -L -S "/ as sysdba" @get_user_prefix.sql) -[ -n "${v_common_user}" ] && v_user="${v_common_user}${v_user}" +[ -n "${v_common_user}" ] && v_dump_user="${v_common_user}${v_dump_user}" echo "Generating table export. Please wait.." cd "${v_thisdir}"/../ $ORACLE_HOME/bin/sqlplus "/ as sysdba" < Date: Wed, 11 May 2022 18:18:48 -0300 Subject: [PATCH 061/229] Removing ORAVERSION / ORASERIES / ORAPATCH from exporter --- user_scripts/odbfcl/exchange_tables_adb.sql | 20 ++ user_scripts/odbfcl/extract/hashGet.sql | 9 +- user_scripts/odbfcl/extract/hashGet.yml | 2 +- user_scripts/odbfcl/extract/load_code.sql | 7 +- user_scripts/odbfcl/extract/load_custom.sql | 8 +- .../odbfcl/extract/load_database_vault.sql | 8 +- user_scripts/odbfcl/extract/load_dba_cdb.sql | 9 +- user_scripts/odbfcl/extract/load_source.sql | 4 - user_scripts/odbfcl/extract/load_v_dollar.sql | 9 +- user_scripts/odbfcl/extract/load_view.sql | 3 - user_scripts/odbfcl/extract/load_x_dollar.sql | 15 +- .../load_underscore_11.2.0.4.sql | 10 +- .../load_underscore_12.1.0.1.sql | 10 +- .../load_underscore_12.1.0.2.sql | 10 +- .../load_underscore_12.2.0.1.sql | 10 +- .../load_underscore_18.0.0.0.sql | 10 +- .../load_underscore_vv_11.2.0.4.sql | 10 +- .../load_underscore_vv_12.1.0.1.sql | 10 +- .../load_underscore_vv_12.1.0.2.sql | 10 +- user_scripts/odbfcl/tables_create.sql | 265 ++++-------------- user_scripts/odbfcl/tables_recreate_adb.sql | 16 ++ 21 files changed, 128 insertions(+), 327 deletions(-) diff --git a/user_scripts/odbfcl/exchange_tables_adb.sql b/user_scripts/odbfcl/exchange_tables_adb.sql index 45613a0..f0e7550 100644 --- a/user_scripts/odbfcl/exchange_tables_adb.sql +++ b/user_scripts/odbfcl/exchange_tables_adb.sql @@ -26,6 +26,24 @@ END; / SET SERVEROUT ON + +-- BRING PARTITION COLUMNS BACK TO NOT NULL +DECLARE + V_CMD CLOB; +BEGIN + FOR I IN (select table_name from sys.user_tables where table_name like 'T_\%' escape '\') + LOOP + V_CMD := 'ALTER TABLE ' || DBMS_ASSERT.SQL_OBJECT_NAME(I.TABLE_NAME) || ' + MODIFY ( "ORAVERSION" NOT NULL, + "ORASERIES" NOT NULL, + "ORAPATCH" NOT NULL )'; + DBMS_OUTPUT.PUT_LINE(V_CMD || ';'); + EXECUTE IMMEDIATE V_CMD; + END LOOP; +END; +/ + +-- EXCHANGE TABLES DECLARE V_OWNER VARCHAR2(30) := UPPER('&P_OWNER'); V_ORAVERSION T_PARAMETER.ORAVERSION%TYPE := '&P_VERS.'; @@ -156,6 +174,8 @@ BEGIN THEN -- Add here any optional code to do after the exchange. NULL; + &P_OWNER..X_ORAERR.RELOAD_PARTITION_INT (V_ORAVERSION, V_ORASERIES, V_ORAPATCH); + &P_OWNER..X_REFRESH_MVS; ELSE DBMS_OUTPUT.PUT_LINE('---'); DBMS_OUTPUT.PUT_LINE('--- ATTENTION: ALL TABLES ARE EMPTY'); diff --git a/user_scripts/odbfcl/extract/hashGet.sql b/user_scripts/odbfcl/extract/hashGet.sql index 7009a2b..570a002 100644 --- a/user_scripts/odbfcl/extract/hashGet.sql +++ b/user_scripts/odbfcl/extract/hashGet.sql @@ -7,15 +7,16 @@ set serverout on DEF V_USERNAME = '&1' -DEF P_VERS = '&2' -DEF P_SER = '&3' -DEF P_PATCH = '&4' - -- Convert to uppercase col v_username new_v v_username nopri SELECT UPPER('&V_USERNAME.') V_USERNAME FROM DUAL; col v_username clear +col p_vers new_v p_vers nopri +select substr(version,1,instr(version,'.',1,4)-1) p_vers +from (select version from v$instance); +col p_vers clear + DECLARE V_ORA_VER_MAJOR NUMBER; V_ORA_VERSION VARCHAR2(20); diff --git a/user_scripts/odbfcl/extract/hashGet.yml b/user_scripts/odbfcl/extract/hashGet.yml index f693c02..69d1c0a 100644 --- a/user_scripts/odbfcl/extract/hashGet.yml +++ b/user_scripts/odbfcl/extract/hashGet.yml @@ -1,4 +1,4 @@ - include: tasks/run_sql.yml vars: - sql_param : { file : "hashGet.sql" , folder : "user_scripts/odbfcl/extract" , task_action : "Calculate Hash" , params : "{{ dump_user_int }} {{ db_version }} {{ patch.base_ru | default('') }}{{ patch.type }} {{ patch.id }}" } + sql_param : { file : "hashGet.sql" , folder : "user_scripts/odbfcl/extract" , task_action : "Calculate Hash" , params : "{{ dump_user_int }}" } # patch.base_ru will only be populated for RURs \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/load_code.sql b/user_scripts/odbfcl/extract/load_code.sql index dd2b218..577b24a 100644 --- a/user_scripts/odbfcl/extract/load_code.sql +++ b/user_scripts/odbfcl/extract/load_code.sql @@ -21,17 +21,14 @@ from ( where col_ind=1; insert /*+ append */ - into &v_username..T_HASH (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_HASH, SHA1_HASH, ORAVERSION, ORASERIES, ORAPATCH) + into &v_username..T_HASH (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_HASH, SHA1_HASH) select OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_HASH, - SHA1_HASH, - '&P_VERS.' oraversion, - '&P_SER.' oraseries, - &P_PATCH. orapatch + SHA1_HASH from &v_username..T_HASH_LOAD; commit; diff --git a/user_scripts/odbfcl/extract/load_custom.sql b/user_scripts/odbfcl/extract/load_custom.sql index 0a5339b..a1951bc 100644 --- a/user_scripts/odbfcl/extract/load_custom.sql +++ b/user_scripts/odbfcl/extract/load_custom.sql @@ -1,7 +1,5 @@ DECLARE VVERS VARCHAR2(20) := '&P_VERS.'; - VSER VARCHAR2(10) := '&P_SER.'; - VPATCH NUMBER := &P_PATCH.; PROCEDURE RUN_INSERT (IN_TAB_NAME VARCHAR2, OUT_TAB_NAME VARCHAR2, IN_WHERE_CLAUSE_12 VARCHAR2 DEFAULT NULL, IN_WHERE_CLAUSE_11 VARCHAR2 DEFAULT NULL) AS @@ -28,11 +26,11 @@ DECLARE and c1.owner = '&v_username.' and c2.owner(+) = 'SYS' and c1.column_name = c2.column_name (+) - and c1.column_name not in ('CON_ID', 'ORASERIES', 'ORAVERSION', 'ORAPATCH'); + and c1.column_name not in ('CON_ID'); - V_SQL := 'INSERT /*+ APPEND */ INTO &v_username..' || OUT_TAB_NAME || '(' || V_TAB_COLS || V_CDB_CLAUSE || ', ORAVERSION, ORASERIES, ORAPATCH) SELECT '; + V_SQL := 'INSERT /*+ APPEND */ INTO &v_username..' || OUT_TAB_NAME || '(' || V_TAB_COLS || V_CDB_CLAUSE || ') SELECT '; - V_SQL := V_SQL || V_INS_COLS || V_CDB_CLAUSE || ', ' || SYS.DBMS_ASSERT.enquote_literal(VVERS) || ', ' || SYS.DBMS_ASSERT.enquote_literal(VSER) || ', ' || SYS.DBMS_ASSERT.enquote_literal(VPATCH); + V_SQL := V_SQL || V_INS_COLS || V_CDB_CLAUSE; IF VVERS = '11.2.0.4' THEN V_SQL := V_SQL || ' FROM ' || IN_TAB_NAME; diff --git a/user_scripts/odbfcl/extract/load_database_vault.sql b/user_scripts/odbfcl/extract/load_database_vault.sql index dfcecbe..fb594db 100644 --- a/user_scripts/odbfcl/extract/load_database_vault.sql +++ b/user_scripts/odbfcl/extract/load_database_vault.sql @@ -1,7 +1,5 @@ DECLARE VVERS VARCHAR2(20) := '&P_VERS.'; - VSER VARCHAR2(10) := '&P_SER.'; - VPSU NUMBER := &P_PSU.; VUSER VARCHAR2(30) := '&v_username.'; PROCEDURE RUN_INSERT (IN_TAB_NAME VARCHAR2, @@ -28,11 +26,11 @@ DECLARE and c1.owner = VUSER and c2.owner(+) = 'DVSYS' and c1.column_name = c2.column_name (+) - and c1.column_name not in ('CON_ID', 'SERIES', 'ORAVERSION', 'PSU'); + and c1.column_name not in ('CON_ID'); - V_SQL := 'INSERT /*+ APPEND */ INTO ' || VUSER || '.' || OUT_TAB_NAME || '(' || V_TAB_COLS || V_CDB_CLAUSE || ', ORAVERSION, ORASERIES, ORAPATCH) SELECT '; + V_SQL := 'INSERT /*+ APPEND */ INTO ' || VUSER || '.' || OUT_TAB_NAME || '(' || V_TAB_COLS || V_CDB_CLAUSE || ') SELECT '; - V_SQL := V_SQL || V_INS_COLS || V_CDB_CLAUSE || ', ' || SYS.DBMS_ASSERT.enquote_literal(VSER) || ', ' || SYS.DBMS_ASSERT.enquote_literal(VVERS) || ', ' || SYS.DBMS_ASSERT.enquote_literal(VPSU); + V_SQL := V_SQL || V_INS_COLS || V_CDB_CLAUSE; IF VVERS = '11.2.0.4' THEN V_SQL := V_SQL || ' FROM DVSYS.' || IN_TAB_NAME; diff --git a/user_scripts/odbfcl/extract/load_dba_cdb.sql b/user_scripts/odbfcl/extract/load_dba_cdb.sql index b99d1ac..c258779 100644 --- a/user_scripts/odbfcl/extract/load_dba_cdb.sql +++ b/user_scripts/odbfcl/extract/load_dba_cdb.sql @@ -1,7 +1,5 @@ DECLARE VVERS VARCHAR2(20) := '&P_VERS.'; - VSER VARCHAR2(10) := '&P_SER.'; - VPATCH NUMBER := &P_PATCH.; VUSER VARCHAR2(30) := '&V_USERNAME.'; PROCEDURE RUN_INSERT (IN_TAB_NAME VARCHAR2, @@ -38,12 +36,11 @@ DECLARE AND C2.TABLE_NAME (+) = V_PREFIX || IN_TAB_NAME AND C1.OWNER = VUSER AND C2.OWNER(+) = 'SYS' - AND C1.COLUMN_NAME = C2.COLUMN_NAME (+) - AND C1.COLUMN_NAME NOT IN ('ORAVERSION', 'ORASERIES', 'ORAPATCH'); + AND C1.COLUMN_NAME = C2.COLUMN_NAME (+); - V_SQL := 'INSERT /*+ APPEND */ INTO ' || VUSER || '.T_' || IN_TAB_NAME || '(' || V_TAB_COLS || ', ORAVERSION, ORASERIES, ORAPATCH) SELECT '; + V_SQL := 'INSERT /*+ APPEND */ INTO ' || VUSER || '.T_' || IN_TAB_NAME || '(' || V_TAB_COLS || ') SELECT '; - V_SQL := V_SQL || V_INS_COLS || ', ' || SYS.DBMS_ASSERT.ENQUOTE_LITERAL(VVERS) || ', ' || SYS.DBMS_ASSERT.ENQUOTE_LITERAL(VSER) || ', ' || SYS.DBMS_ASSERT.ENQUOTE_LITERAL(VPATCH); + V_SQL := V_SQL || V_INS_COLS; V_SQL := V_SQL || ' FROM ' || V_PREFIX || IN_TAB_NAME; diff --git a/user_scripts/odbfcl/extract/load_source.sql b/user_scripts/odbfcl/extract/load_source.sql index 9d656fd..a085966 100644 --- a/user_scripts/odbfcl/extract/load_source.sql +++ b/user_scripts/odbfcl/extract/load_source.sql @@ -1,10 +1,6 @@ DECLARE VCODE CLOB; - VVERS VARCHAR2(20) := '&P_VERS.'; - VSER VARCHAR2(10) := '&P_SER.'; - VPATCH NUMBER := &P_PATCH.; - $IF DBMS_DB_VERSION.VER_LE_11 $THEN CURSOR OBJS IS diff --git a/user_scripts/odbfcl/extract/load_v_dollar.sql b/user_scripts/odbfcl/extract/load_v_dollar.sql index f78e8c0..dcbf1c2 100644 --- a/user_scripts/odbfcl/extract/load_v_dollar.sql +++ b/user_scripts/odbfcl/extract/load_v_dollar.sql @@ -1,7 +1,5 @@ DECLARE VVERS VARCHAR2(20) := '&P_VERS.'; - VSER VARCHAR2(10) := '&P_SER.'; - VPATCH NUMBER := &P_PATCH.; PROCEDURE RUN_INSERT (OUT_TAB_NAME VARCHAR2, IN_TAB_NAME VARCHAR2, @@ -21,12 +19,11 @@ DECLARE and c2.table_name (+) = IN_TAB_NAME and c1.owner = '&v_username.' and c2.owner(+) = 'SYS' - and c1.column_name = c2.column_name (+) - and c1.column_name not in ('ORASERIES', 'ORAVERSION', 'ORAPATCH'); + and c1.column_name = c2.column_name (+); - V_SQL := 'INSERT /*+ APPEND */ INTO &v_username..' || OUT_TAB_NAME || '(' || V_TAB_COLS || ', ORAVERSION, ORASERIES, ORAPATCH) SELECT '; + V_SQL := 'INSERT /*+ APPEND */ INTO &v_username..' || OUT_TAB_NAME || '(' || V_TAB_COLS || ') SELECT '; - V_SQL := V_SQL || V_INS_COLS || ', ' || SYS.DBMS_ASSERT.enquote_literal(VVERS) || ', ' || SYS.DBMS_ASSERT.enquote_literal(VSER) || ', ' || SYS.DBMS_ASSERT.enquote_literal(VPATCH); + V_SQL := V_SQL || V_INS_COLS; V_SQL := V_SQL || ' FROM ' || IN_TAB_NAME; diff --git a/user_scripts/odbfcl/extract/load_view.sql b/user_scripts/odbfcl/extract/load_view.sql index a866b5d..f7e27b1 100644 --- a/user_scripts/odbfcl/extract/load_view.sql +++ b/user_scripts/odbfcl/extract/load_view.sql @@ -1,8 +1,5 @@ DECLARE VCODE CLOB; - VVERS VARCHAR2(20) := '&P_VERS.'; - VSER VARCHAR2(10) := '&P_SER.'; - VPATCH NUMBER := &P_PATCH.; VSID VARCHAR2(30) := 'VIEW_TESTE'; CURSOR OBJS IS SELECT OBJECT_OWNER OWNER, diff --git a/user_scripts/odbfcl/extract/load_x_dollar.sql b/user_scripts/odbfcl/extract/load_x_dollar.sql index fe4008f..7e70a91 100644 --- a/user_scripts/odbfcl/extract/load_x_dollar.sql +++ b/user_scripts/odbfcl/extract/load_x_dollar.sql @@ -14,17 +14,11 @@ INSERT INTO &v_username..T_XTABCOLS ( "TABLE_NAME", "COLUMN_NAME", - "COLUMN_TYPE", - "ORAVERSION", - "ORASERIES", - "ORAPATCH" + "COLUMN_TYPE" ) select t.kqftanam table_name, c.kqfconam column_name, - c.kqfcodty column_type, - '&P_VERS.', - '&P_SER.', - &P_PATCH. + c.kqfcodty column_type from x$kqfta t, x$kqfco c, x$kqfta divider where divider.kqftanam = 'X$KSXPTESTTBL' and t.indx < divider.indx @@ -32,10 +26,7 @@ and t.indx = c.kqfcotab union all select t.kqftanam table_name, c.kqfconam column_name, - c.kqfcodty column_type, - '&P_VERS.', - '&P_SER.', - &P_PATCH. + c.kqfcodty column_type from x$kqfta t, x$kqfco c, x$kqfta divider where divider.kqftanam = 'X$KSXPTESTTBL' and t.indx >= divider.indx diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.4.sql b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.4.sql index 9886816..05db86f 100644 --- a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.4.sql +++ b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.4.sql @@ -16,10 +16,7 @@ INSERT INTO &v_username..T_PARAMETER "ISDEPRECATED", "ISBASIC", "DESCRIPTION", - "CON_ID", - "ORAVERSION", - "ORASERIES", - "ORAPATCH" + "CON_ID" ) WITH T1 AS ( SELECT @@ -65,8 +62,5 @@ SELECT "NAME", "ISDEPRECATED", "ISBASIC", "DESCRIPTION", - NULL "CON_ID", - '&P_VERS.' "ORAVERSION", - '&P_SER.' "ORASERIES", - &P_PATCH. "ORAPATCH" + NULL "CON_ID" FROM T1; \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.1.0.1.sql b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.1.0.1.sql index 1eabe52..f36ae68 100644 --- a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.1.0.1.sql +++ b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.1.0.1.sql @@ -14,10 +14,7 @@ INSERT INTO &v_username..T_PARAMETER "ISDEPRECATED", "ISBASIC", "DESCRIPTION", - "CON_ID", - "ORAVERSION", - "ORASERIES", - "ORAPATCH" + "CON_ID" ) WITH T1 AS ( SELECT @@ -65,8 +62,5 @@ SELECT "NAME", "ISDEPRECATED", "ISBASIC", "DESCRIPTION", - "CON_ID", - '&P_VERS.' "ORAVERSION", - '&P_SER.' "ORASERIES", - &P_PATCH. "ORAPATCH" + "CON_ID" FROM T1; \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.1.0.2.sql b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.1.0.2.sql index 3fa11ff..2cc6214 100644 --- a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.1.0.2.sql +++ b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.1.0.2.sql @@ -14,10 +14,7 @@ INSERT INTO &v_username..T_PARAMETER "ISDEPRECATED", "ISBASIC", "DESCRIPTION", - "CON_ID", - "ORAVERSION", - "ORASERIES", - "ORAPATCH" + "CON_ID" ) WITH T1 AS ( SELECT @@ -66,8 +63,5 @@ SELECT "NAME", "ISDEPRECATED", "ISBASIC", "DESCRIPTION", - "CON_ID", - '&P_VERS.' "ORAVERSION", - '&P_SER.' "ORASERIES", - &P_PATCH. "ORAPATCH" + "CON_ID" FROM T1; \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.2.0.1.sql b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.2.0.1.sql index 5ff962b..0c0d03b 100644 --- a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.2.0.1.sql +++ b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.2.0.1.sql @@ -14,10 +14,7 @@ INSERT INTO &v_username..T_PARAMETER "ISDEPRECATED", "ISBASIC", "DESCRIPTION", - "CON_ID", - "ORAVERSION", - "ORASERIES", - "ORAPATCH" + "CON_ID" ) WITH T1 AS ( SELECT @@ -66,8 +63,5 @@ SELECT "NAME", "ISDEPRECATED", "ISBASIC", "DESCRIPTION", - "CON_ID", - '&P_VERS.' "ORAVERSION", - '&P_SER.' "ORASERIES", - &P_PATCH. "ORAPATCH" + "CON_ID" FROM T1; \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_18.0.0.0.sql b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_18.0.0.0.sql index 2d024e0..eae149e 100644 --- a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_18.0.0.0.sql +++ b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_18.0.0.0.sql @@ -14,10 +14,7 @@ INSERT INTO &v_username..T_PARAMETER "ISDEPRECATED", "ISBASIC", "DESCRIPTION", - "CON_ID", - "ORAVERSION", - "ORASERIES", - "ORAPATCH" + "CON_ID" ) WITH T1 AS ( SELECT /*+ use_hash(x y) */ @@ -66,8 +63,5 @@ SELECT "NAME", "ISDEPRECATED", "ISBASIC", "DESCRIPTION", - "CON_ID", - '&P_VERS.' "ORAVERSION", - '&P_SER.' "ORASERIES", - &P_PATCH. "ORAPATCH" + "CON_ID" FROM T1; \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.4.sql b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.4.sql index 332e327..f34dff3 100644 --- a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.4.sql +++ b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.4.sql @@ -8,10 +8,7 @@ INSERT INTO &v_username..T_PARAMETER_VALID_VALUES "ORDINAL", "VALUE", "ISDEFAULT", - "CON_ID", - "ORAVERSION", - "ORASERIES", - "ORAPATCH" + "CON_ID" ) WITH T1 AS ( SELECT @@ -30,10 +27,7 @@ SELECT "NAME", "ORDINAL", "VALUE", "ISDEFAULT", - NULL "CON_ID", - '&P_VERS.' "ORAVERSION", - '&P_SER.' "ORASERIES", - &P_PATCH. "ORAPATCH" + NULL "CON_ID" FROM T1; -- Add Default Value info into T_PARAMETER diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.1.0.1.sql b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.1.0.1.sql index a42cf86..d43f726 100644 --- a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.1.0.1.sql +++ b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.1.0.1.sql @@ -8,10 +8,7 @@ INSERT INTO &v_username..T_PARAMETER_VALID_VALUES "ORDINAL", "VALUE", "ISDEFAULT", - "CON_ID", - "ORAVERSION", - "ORASERIES", - "ORAPATCH" + "CON_ID" ) WITH T1 AS ( SELECT @@ -31,10 +28,7 @@ SELECT "NAME", "ORDINAL", "VALUE", "ISDEFAULT", - "CON_ID", - '&P_VERS.' "ORAVERSION", - '&P_SER.' "ORASERIES", - &P_PATCH. "ORAPATCH" + "CON_ID" FROM T1; -- Add Default Value info into T_PARAMETER diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.1.0.2.sql b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.1.0.2.sql index 60bb2d3..abb9a73 100644 --- a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.1.0.2.sql +++ b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.1.0.2.sql @@ -8,10 +8,7 @@ INSERT INTO &v_username..T_PARAMETER_VALID_VALUES "ORDINAL", "VALUE", "ISDEFAULT", - "CON_ID", - "ORAVERSION", - "ORASERIES", - "ORAPATCH" + "CON_ID" ) WITH T1 AS ( SELECT @@ -31,8 +28,5 @@ SELECT "NAME", "ORDINAL", "VALUE", "ISDEFAULT", - "CON_ID", - '&P_VERS.' "ORAVERSION", - '&P_SER.' "ORASERIES", - &P_PATCH. "ORAPATCH" + "CON_ID" FROM T1; \ No newline at end of file diff --git a/user_scripts/odbfcl/tables_create.sql b/user_scripts/odbfcl/tables_create.sql index a8c8fa8..454424e 100644 --- a/user_scripts/odbfcl/tables_create.sql +++ b/user_scripts/odbfcl/tables_create.sql @@ -68,10 +68,7 @@ CREATE TABLE "T_PARAMETER" "ISDEPRECATED" VARCHAR2(5 CHAR), "ISBASIC" VARCHAR2(5 CHAR), "DESCRIPTION" VARCHAR2(255 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -81,10 +78,7 @@ CREATE TABLE "T_PARAMETER_VALID_VALUES" "ORDINAL" NUMBER, "VALUE" VARCHAR2(255 CHAR) NOT NULL, "ISDEFAULT" VARCHAR2(64 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -94,10 +88,7 @@ CREATE TABLE "T_SYSSTAT" "NAME" VARCHAR2(64 CHAR), "CLASS" NUMBER, "STAT_ID" NUMBER NOT NULL, -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -105,10 +96,7 @@ CREATE TABLE "T_SYS_TIME_MODEL" ( "STAT_ID" NUMBER NOT NULL, "STAT_NAME" VARCHAR2(64 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -124,10 +112,7 @@ CREATE TABLE "T_EVENT_NAME" "WAIT_CLASS#" NUMBER, "WAIT_CLASS" VARCHAR2(64 CHAR), "DISPLAY_NAME" VARCHAR2(64 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -136,10 +121,7 @@ CREATE TABLE "T_XTABCOLS" "TABLE_NAME" VARCHAR2(128 CHAR) NOT NULL, "COLUMN_NAME" VARCHAR2(128 CHAR) NOT NULL, "COLUMN_TYPE" NUMBER, -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -161,10 +143,7 @@ CREATE TABLE "T_OBJECTS" "DEFAULT_COLLATION" VARCHAR2(100 CHAR), "DUPLICATED" VARCHAR2(1 CHAR), "SHARDED" VARCHAR2(1 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -188,10 +167,7 @@ CREATE TABLE "T_TAB_COLUMNS" "IDENTITY_COLUMN" VARCHAR2(3 CHAR), "SENSITIVE_COLUMN" VARCHAR2(3 CHAR), "COLLATION" VARCHAR2(100 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -199,10 +175,7 @@ CREATE TABLE "T_FIXED_TABLE" ( "NAME" VARCHAR2(128 CHAR) NOT NULL, "TYPE" VARCHAR2(5 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -211,10 +184,7 @@ CREATE TABLE "T_FIXED_VIEW_DEFINITION" "VIEW_NAME" VARCHAR2(128 CHAR) NOT NULL, "VIEW_DEFINITION" VARCHAR2(4000 CHAR), "VIEW_DEFINITION_CLOB" CLOB, -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -239,10 +209,7 @@ CREATE TABLE "T_USERS" "DEFAULT_COLLATION" VARCHAR2(100 CHAR), "IMPLICIT" VARCHAR2(3 CHAR), "ALL_SHARD" VARCHAR2(3 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -256,10 +223,7 @@ CREATE TABLE "T_ROLES" "INHERITED" VARCHAR2(3 CHAR), "IMPLICIT" VARCHAR2(3 CHAR), "EXTERNAL_NAME" VARCHAR2(4000 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -272,10 +236,7 @@ CREATE TABLE "T_RESERVED_WORDS" "RES_ATTR" VARCHAR2(1 CHAR), "RES_SEMI" VARCHAR2(1 CHAR), "DUPLICATE" VARCHAR2(1 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -288,10 +249,7 @@ CREATE TABLE "T_SYSTEM_FIX_CONTROL" "OPTIMIZER_FEATURE_ENABLE" VARCHAR2(25 CHAR), "EVENT" NUMBER, "IS_DEFAULT" NUMBER, -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -318,10 +276,7 @@ CREATE TABLE "T_TRIGGERS" "INSTEAD_OF_ROW" VARCHAR2(3 CHAR), "FIRE_ONCE" VARCHAR2(3 CHAR), "APPLY_SERVER_ONLY" VARCHAR2(3 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -331,10 +286,7 @@ CREATE TABLE "T_AUDIT_POLICY_COLUMNS" "OBJECT_NAME" VARCHAR2(128 CHAR), "POLICY_NAME" VARCHAR2(128 CHAR), "POLICY_COLUMN" VARCHAR2(128 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -350,10 +302,7 @@ CREATE TABLE "T_AUDIT_UNIFIED_POLICIES" "OBJECT_TYPE" VARCHAR2(23 CHAR) NOT NULL, "COMMON" VARCHAR2(3 CHAR), "INHERITED" VARCHAR2(3 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -368,10 +317,7 @@ CREATE TABLE "T_COL_PRIVS" "GRANTABLE" VARCHAR2(3 CHAR), "COMMON" VARCHAR2(3 CHAR), "INHERITED" VARCHAR2(3 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -393,10 +339,7 @@ CREATE TABLE "T_SCHEDULER_PROGRAMS" "HAS_CONSTRAINTS" VARCHAR2(5 CHAR), "NLS_ENV" VARCHAR2(4000 CHAR), "COMMENTS" VARCHAR2(4000 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -420,10 +363,7 @@ CREATE TABLE "T_JOBS" "NLS_ENV" VARCHAR2(4000 CHAR), "MISC_ENV" RAW(32), "INSTANCE" NUMBER, -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -439,10 +379,7 @@ CREATE TABLE "T_TAB_PRIVS" "COMMON" VARCHAR2(3 CHAR), "TYPE" VARCHAR2(24 CHAR), "INHERITED" VARCHAR2(3 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -453,10 +390,7 @@ CREATE TABLE "T_PRIV_AUDIT_OPTS" "PRIVILEGE" VARCHAR2(40 CHAR) NOT NULL, "SUCCESS" VARCHAR2(10 CHAR), "FAILURE" VARCHAR2(10 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -469,10 +403,7 @@ CREATE TABLE "T_TS_QUOTAS" "BLOCKS" NUMBER, "MAX_BLOCKS" NUMBER, "DROPPED" VARCHAR2(3 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -498,10 +429,7 @@ CREATE TABLE "T_OBJ_AUDIT_OPTS" "REA" VARCHAR2(3 CHAR), "WRI" VARCHAR2(3 CHAR), "FBK" VARCHAR2(3 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -512,10 +440,7 @@ CREATE TABLE "T_STMT_AUDIT_OPTS" "AUDIT_OPTION" VARCHAR2(40 CHAR) NOT NULL, "SUCCESS" VARCHAR2(10 CHAR), "FAILURE" VARCHAR2(10 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -540,10 +465,7 @@ CREATE TABLE "T_POLICIES" "LONG_PREDICATE" VARCHAR2(3 CHAR), "COMMON" VARCHAR2(3 CHAR), "INHERITED" VARCHAR2(3 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -556,10 +478,7 @@ CREATE TABLE "T_ROLE_PRIVS" "DEFAULT_ROLE" VARCHAR2(3 CHAR), "COMMON" VARCHAR2(3 CHAR), "INHERITED" VARCHAR2(3 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -573,10 +492,7 @@ CREATE TABLE "T_JAVA_POLICY" "ACTION" VARCHAR2(4000 CHAR), "ENABLED" VARCHAR2(8 CHAR), "SEQ" NUMBER, -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -650,10 +566,7 @@ CREATE TABLE "T_SCHEDULER_JOBS" "CONNECT_CREDENTIAL_OWNER" VARCHAR2(128 CHAR), "CONNECT_CREDENTIAL_NAME" VARCHAR2(128 CHAR), "FAIL_ON_SCRIPT_ERROR" VARCHAR2(5 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -677,10 +590,7 @@ CREATE TABLE "T_AUDIT_POLICIES" "POLICY_COLUMN_OPTIONS" VARCHAR2(11 CHAR), "COMMON" VARCHAR2(3 CHAR), "INHERITED" VARCHAR2(3 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -691,10 +601,7 @@ CREATE TABLE "T_SYS_PRIVS" "ADMIN_OPTION" VARCHAR2(3 CHAR), "COMMON" VARCHAR2(3 CHAR), "INHERITED" VARCHAR2(3 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -706,10 +613,7 @@ CREATE TABLE "T_SYNONYMS" "TABLE_NAME" VARCHAR2(128 CHAR), "DB_LINK" VARCHAR2(128 CHAR), "ORIGIN_CON_ID" NUMBER, -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -721,10 +625,7 @@ CREATE TABLE "T_HASH" "ORIGIN_CON_ID" NUMBER, "CON_ID" NUMBER, "MD5_HASH" RAW(16) NOT NULL, -"SHA1_HASH" RAW(20) NOT NULL, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"SHA1_HASH" RAW(20) NOT NULL ) COMPRESS NOLOGGING; @@ -734,10 +635,7 @@ CREATE TABLE "T_FILES" ( "PATH" VARCHAR2(500 CHAR) NOT NULL, "SHA256_HASH" RAW(32), -"FILE_TYPE" VARCHAR2(1 CHAR) NOT NULL, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"FILE_TYPE" VARCHAR2(1 CHAR) NOT NULL ) COMPRESS NOLOGGING; @@ -745,20 +643,14 @@ CREATE TABLE "T_SYMBOLS" ( "FILE_NAME" VARCHAR2(200 CHAR) NOT NULL, "SYMBOL_TYPE" VARCHAR2(1 CHAR) NOT NULL, -"SYMBOL_NAME" VARCHAR2(500 CHAR), -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"SYMBOL_NAME" VARCHAR2(500 CHAR) ) COMPRESS NOLOGGING; CREATE TABLE "T_TXTCOLLECTION" ( "PATH" VARCHAR2(500 CHAR) NOT NULL, -"MD5_HASH" RAW(16), -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"MD5_HASH" RAW(16) ) COMPRESS NOLOGGING; @@ -768,10 +660,7 @@ CREATE TABLE "T_BUGSFIXED" ( "BUG_ID" NUMBER NOT NULL, "PATCH_ID" NUMBER NOT NULL, -"BUG_DESC" VARCHAR2(1000 CHAR) NOT NULL, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"BUG_DESC" VARCHAR2(1000 CHAR) NOT NULL ) COMPRESS NOLOGGING; @@ -782,10 +671,7 @@ CREATE TABLE "T_ORAERR" "MESSAGE" VARCHAR2(4000 CHAR), "CAUSE" VARCHAR2(4000 CHAR), "ACTION" VARCHAR2(4000 CHAR), -"NOTE" VARCHAR2(4000 CHAR), -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"NOTE" VARCHAR2(4000 CHAR) ) COMPRESS NOLOGGING; @@ -795,10 +681,7 @@ CREATE TABLE "T_DIRECTORIES" "DIRECTORY_NAME" VARCHAR2(128) NOT NULL, "DIRECTORY_PATH" VARCHAR2(4000), "ORIGIN_CON_ID" NUMBER, -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -825,10 +708,7 @@ CREATE TABLE "T_PROCEDURES" "SQL_MACRO" VARCHAR2(6 CHAR), "BLOCKCHAIN" VARCHAR2(3 CHAR), "BLOCKCHAIN_MANDATORY_VOTES" VARCHAR2(4000 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -886,10 +766,7 @@ CREATE TABLE "T_REGISTRY" "STARTUP" VARCHAR2(8 CHAR), "PARENT_ID" VARCHAR2(30 CHAR), "OTHER_SCHEMAS" VARCHAR2(4000 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -901,10 +778,7 @@ CREATE TABLE "T_REGISTRY_BACKPORTS" "NAMESPACE" VARCHAR2(30 CHAR), "BACKPORT_TYPE" VARCHAR2(30 CHAR), "BACKPORT_TIME" TIMESTAMP (6), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -913,10 +787,7 @@ CREATE TABLE "T_REGISTRY_DATABASE" "PLATFORM_ID" NUMBER, "PLATFORM_NAME" VARCHAR2(101 CHAR), "EDITION" VARCHAR2(30 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -926,10 +797,7 @@ CREATE TABLE "T_REGISTRY_DEPENDENCIES" "NAMESPACE" VARCHAR2(30 CHAR), "REQ_COMP_ID" VARCHAR2(30 CHAR), "REQ_NAMESPACE" VARCHAR2(30 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -941,10 +809,7 @@ CREATE TABLE "T_REGISTRY_ERROR" "IDENTIFIER" VARCHAR2(256 CHAR), "MESSAGE" CLOB, "STATEMENT" CLOB, -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -956,10 +821,7 @@ CREATE TABLE "T_REGISTRY_HIERARCHY" "VERSION_FULL" VARCHAR2(30 CHAR), "STATUS" VARCHAR2(44 CHAR), "MODIFIED" VARCHAR2(29 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -972,10 +834,7 @@ CREATE TABLE "T_REGISTRY_HISTORY" "ID" NUMBER, "COMMENTS" VARCHAR2(255 CHAR), "BUNDLE_SERIES" VARCHAR2(30 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -986,10 +845,7 @@ CREATE TABLE "T_REGISTRY_LOG" "COMP_ID" VARCHAR2(30 CHAR), "OPERATION" VARCHAR2(11 CHAR), "MESSAGE" VARCHAR2(1000 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -1001,10 +857,7 @@ CREATE TABLE "T_REGISTRY_PROGRESS" "VALUE" VARCHAR2(255 CHAR), "STEP" NUMBER, "ACTION_TIME" TIMESTAMP (6), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -1013,10 +866,7 @@ CREATE TABLE "T_REGISTRY_SCHEMAS" "NAMESPACE" VARCHAR2(30 CHAR), "COMP_ID" VARCHAR2(30 CHAR), "SCHEMA" VARCHAR2(128 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -1041,10 +891,7 @@ CREATE TABLE "T_REGISTRY_SQLPATCH" "TARGET_VERSION" VARCHAR2(15 CHAR), "TARGET_BUILD_DESCRIPTION" VARCHAR2(80 CHAR), "TARGET_BUILD_TIMESTAMP" TIMESTAMP (6), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -1057,10 +904,7 @@ CREATE TABLE "T_REGISTRY_SQLPATCH_RU_INFO" "RU_BUILD_DESCRIPTION" VARCHAR2(80 CHAR), "RU_BUILD_TIMESTAMP" TIMESTAMP (6), --"PATCH_DIRECTORY" BLOB, -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -1078,10 +922,7 @@ CREATE TABLE "T_SERVER_REGISTRY" "STARTUP" VARCHAR2(8 CHAR), "PARENT_ID" VARCHAR2(30 CHAR), "OTHER_SCHEMAS" VARCHAR2(4000 CHAR), -"CON_ID" NUMBER, -"ORAVERSION" VARCHAR2(20 CHAR) NOT NULL, -"ORASERIES" VARCHAR2(10 CHAR) NOT NULL, -"ORAPATCH" NUMBER NOT NULL +"CON_ID" NUMBER ) COMPRESS NOLOGGING; diff --git a/user_scripts/odbfcl/tables_recreate_adb.sql b/user_scripts/odbfcl/tables_recreate_adb.sql index 8d630d8..72dc51e 100644 --- a/user_scripts/odbfcl/tables_recreate_adb.sql +++ b/user_scripts/odbfcl/tables_recreate_adb.sql @@ -32,3 +32,19 @@ BEGIN END LOOP; END; / + +-- As the datapump dump tables does not contain ORAVERSION / ORASERIES / ORAPATCH fields, keep it as null. +DECLARE + V_CMD CLOB; +BEGIN + FOR I IN (SELECT TABLE_NAME FROM SYS.USER_TABLES WHERE TABLE_NAME LIKE 'T_\%' ESCAPE '\') + LOOP + V_CMD := 'ALTER TABLE ' || DBMS_ASSERT.SQL_OBJECT_NAME(I.TABLE_NAME) || ' + MODIFY ( "ORAVERSION" NULL, + "ORASERIES" NULL, + "ORAPATCH" NULL )'; + DBMS_OUTPUT.PUT_LINE(V_CMD || ';'); + EXECUTE IMMEDIATE V_CMD; + END LOOP; +END; +/ \ No newline at end of file From a602fecdfb6068d2dab39a677ac1a8a5701f47e5 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 11 May 2022 22:38:45 -0300 Subject: [PATCH 062/229] Fix columns removal from exporter --- user_scripts/odbfcl/exchange_tables_adb.sql | 2 +- user_scripts/odbfcl/tables_recreate_adb.sql | 3 ++- user_scripts/odbfcl/update_table_keys_adb.sql | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/user_scripts/odbfcl/exchange_tables_adb.sql b/user_scripts/odbfcl/exchange_tables_adb.sql index f0e7550..281410b 100644 --- a/user_scripts/odbfcl/exchange_tables_adb.sql +++ b/user_scripts/odbfcl/exchange_tables_adb.sql @@ -31,7 +31,7 @@ SET SERVEROUT ON DECLARE V_CMD CLOB; BEGIN - FOR I IN (select table_name from sys.user_tables where table_name like 'T_\%' escape '\') + FOR I IN (select table_name from sys.user_tables where table_name like 'T\_%' escape '\') LOOP V_CMD := 'ALTER TABLE ' || DBMS_ASSERT.SQL_OBJECT_NAME(I.TABLE_NAME) || ' MODIFY ( "ORAVERSION" NOT NULL, diff --git a/user_scripts/odbfcl/tables_recreate_adb.sql b/user_scripts/odbfcl/tables_recreate_adb.sql index 72dc51e..4295009 100644 --- a/user_scripts/odbfcl/tables_recreate_adb.sql +++ b/user_scripts/odbfcl/tables_recreate_adb.sql @@ -34,10 +34,11 @@ END; / -- As the datapump dump tables does not contain ORAVERSION / ORASERIES / ORAPATCH fields, keep it as null. + DECLARE V_CMD CLOB; BEGIN - FOR I IN (SELECT TABLE_NAME FROM SYS.USER_TABLES WHERE TABLE_NAME LIKE 'T_\%' ESCAPE '\') + FOR I IN (SELECT TABLE_NAME FROM SYS.USER_TABLES WHERE TABLE_NAME LIKE 'T\_%' ESCAPE '\') LOOP V_CMD := 'ALTER TABLE ' || DBMS_ASSERT.SQL_OBJECT_NAME(I.TABLE_NAME) || ' MODIFY ( "ORAVERSION" NULL, diff --git a/user_scripts/odbfcl/update_table_keys_adb.sql b/user_scripts/odbfcl/update_table_keys_adb.sql index 738d0a4..99757c4 100644 --- a/user_scripts/odbfcl/update_table_keys_adb.sql +++ b/user_scripts/odbfcl/update_table_keys_adb.sql @@ -27,7 +27,7 @@ DECLARE WHERE NOT ( ORAVERSION = ''&P_VERSION.'' AND ORASERIES = ''&P_SERIES.'' AND ORAPATCH = &P_PATCH. - ) + ) OR ORAVERSION IS NULL OR ORASERIES IS NULL OR ORAPATCH IS NULL )'; -- DBMS_OUTPUT.PUT_LINE(V_CMD || ';'); EXECUTE IMMEDIATE V_CMD From e757b77ea260d70827539d485fdfea0ab47f5a14 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Sat, 28 May 2022 09:32:23 -0300 Subject: [PATCH 063/229] New variable oci_adb_use_wallet and oci_adb_connection_tns to allow wallets usage --- config_oci.yml | 1 + tasks/config_checks.yml | 7 +++- .../adb_load_bugs_fixed.yml | 6 ++-- .../odbfcl/adb_load_expdp/adb_load_expdp.yml | 8 ++--- .../adb_load_filechksum.yml | 6 ++-- .../adb_load_symbols/adb_load_symbols.yml | 6 ++-- .../adb_load_txtcollection_files.yml | 6 ++-- .../odbfcl/diff_calculate/diff_calculate.sql | 34 +++++++++++-------- .../odbfcl/diff_calculate/diff_calculate.yml | 12 ++++++- .../odbfcl/diff_calculate/diff_main.sql | 2 +- user_scripts/odbfcl/exchange_tables_adb.yml | 2 +- user_scripts/odbfcl/tables_recreate_adb.yml | 12 ++++++- user_scripts/odbfcl/update_table_keys_adb.yml | 2 +- 13 files changed, 67 insertions(+), 37 deletions(-) diff --git a/config_oci.yml b/config_oci.yml index 9783ce1..e34964a 100644 --- a/config_oci.yml +++ b/config_oci.yml @@ -60,6 +60,7 @@ oci_adb_pass: xxx oci_adb_tns: xxx_tp oci_adb_credential: XXX oci_adb_os_url_prefix: https://objectstorage.us-ashburn-1.oraclecloud.com/n/xxx/b/xxx/o +oci_adb_use_wallet: true ########################### ### For loader.yml only ### diff --git a/tasks/config_checks.yml b/tasks/config_checks.yml index b3f16e4..755a0d8 100644 --- a/tasks/config_checks.yml +++ b/tasks/config_checks.yml @@ -18,4 +18,9 @@ - name: Check patch_location_type variable fail: msg: 'patch_location_type must be "folder" or "bucket".' - when: patch_location_type != "folder" and patch_location_type != "bucket" \ No newline at end of file + when: patch_location_type != "folder" and patch_location_type != "bucket" + +- name: Check oci_adb_use_wallet variable + fail: + msg: 'oci_adb_use_wallet must be "true" or "false".' + when: oci_adb_use_wallet != true and oci_adb_use_wallet != false \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml b/user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml index 695aad6..71e1a06 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml @@ -14,7 +14,7 @@ - include: tasks/local_sqlplus.yml vars: sql_param : { task_action : "Create sqlldr table" , - cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + cred : "{{ oci_adb_connection_tns }}" , file : "create_sqlldr_bugs_fixed_table.sql" , folder : "user_scripts/odbfcl/adb_load_bugs_fixed" , params : "" @@ -37,7 +37,7 @@ cd "{{ bugs_fixed_folder }}" - sqlldr {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} \ + sqlldr {{ oci_adb_connection_tns }} \ control="${v_outpref}_load.ctl" \ errors=0 \ discardmax=0 \ @@ -55,7 +55,7 @@ - include: tasks/local_sqlplus.yml vars: sql_param : { task_action : "Load bugs_fixed table" , - cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + cred : "{{ oci_adb_connection_tns }}" , file : "load_bugs_fixed_table.sql" , folder : "user_scripts/odbfcl/adb_load_bugs_fixed" , params : "" diff --git a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml index 8e20332..69707ab 100644 --- a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml +++ b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml @@ -34,7 +34,7 @@ - include: tasks/local_sqlplus.yml vars: sql_param : { task_action : "Copy file from Bucket to Oracle Directory" , - cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + cred : "{{ oci_adb_connection_tns }}" , file : "adb_oradir_copy_file.sql" , folder : "user_scripts/odbfcl/adb_load_expdp" , params : "'{{ oci_adb_credential }}' '{{ oci_adb_os_url_prefix }}/{{ dump_file_prefix }}.dmp'" @@ -44,7 +44,7 @@ # - name: Import DB Tables # shell: | # impdp \ - # userid={{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} \ + # userid={{ oci_adb_connection_tns }} \ # directory=data_pump_dir \ # credential='{{ oci_adb_credential }}' \ # remap_schema='{{ dump_user_int }}:{{ oci_adb_transient_user }}' \ @@ -56,7 +56,7 @@ - name: Import DB Tables shell: | impdp \ - userid={{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} \ + userid={{ oci_adb_connection_tns }} \ directory=data_pump_dir \ remap_schema='{{ dump_user_int }}:{{ oci_adb_transient_user }}' \ parallel=16 \ @@ -71,7 +71,7 @@ - include: tasks/local_sqlplus.yml vars: sql_param : { task_action : "Remove file from Oracle Directory" , - cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + cred : "{{ oci_adb_connection_tns }}" , file : "adb_oradir_remove_file.sql" , folder : "user_scripts/odbfcl/adb_load_expdp" , params : "'{{ dump_file_prefix }}.dmp'" diff --git a/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml b/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml index d751130..f963d4a 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml +++ b/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml @@ -14,7 +14,7 @@ - include: tasks/local_sqlplus.yml vars: sql_param : { task_action : "Create sqlldr table" , - cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + cred : "{{ oci_adb_connection_tns }}" , file : "create_sqlldr_chksum_table.sql" , folder : "user_scripts/odbfcl/adb_load_filechksum" , params : "" @@ -37,7 +37,7 @@ cd "{{ chksum_folder }}" - sqlldr {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} \ + sqlldr {{ oci_adb_connection_tns }} \ control="${v_outpref}_load.ctl" \ errors=0 \ discardmax=0 \ @@ -55,7 +55,7 @@ - include: tasks/local_sqlplus.yml vars: sql_param : { task_action : "Load chksum table" , - cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + cred : "{{ oci_adb_connection_tns }}" , file : "load_chksum_table.sql" , folder : "user_scripts/odbfcl/adb_load_filechksum" , params : "" diff --git a/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml b/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml index c13ff54..135f137 100644 --- a/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml +++ b/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml @@ -14,7 +14,7 @@ - include: tasks/local_sqlplus.yml vars: sql_param : { task_action : "Create sqlldr table" , - cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + cred : "{{ oci_adb_connection_tns }}" , file : "create_sqlldr_symbols_table.sql" , folder : "user_scripts/odbfcl/adb_load_symbols" , params : "" @@ -40,7 +40,7 @@ # Remove empty lines or sqlldr will fail due to constant. sed -i '/^$/d' "${v_file}" - sqlldr {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} \ + sqlldr {{ oci_adb_connection_tns }} \ control="${v_outpref}_load.ctl" \ errors=0 \ discardmax=0 \ @@ -58,7 +58,7 @@ - include: tasks/local_sqlplus.yml vars: sql_param : { task_action : "Load symbols table" , - cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + cred : "{{ oci_adb_connection_tns }}" , file : "load_symbols_table.sql" , folder : "user_scripts/odbfcl/adb_load_symbols" , params : "" diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml b/user_scripts/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml index e81456f..9b9943e 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml @@ -14,7 +14,7 @@ - include: tasks/local_sqlplus.yml vars: sql_param : { task_action : "Create sqlldr table" , - cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + cred : "{{ oci_adb_connection_tns }}" , file : "create_sqlldr_txtcollection_table.sql" , folder : "user_scripts/odbfcl/adb_load_txtcollection_files" , params : "" @@ -46,7 +46,7 @@ cd "${v_outpref}_unzip" - sqlldr {{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} \ + sqlldr {{ oci_adb_connection_tns }} \ control="${v_outpref}_load.ctl" \ errors=0 \ discardmax=0 \ @@ -65,7 +65,7 @@ - include: tasks/local_sqlplus.yml vars: sql_param : { task_action : "Load txtcollection table" , - cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + cred : "{{ oci_adb_connection_tns }}" , file : "load_txtcollection_table.sql" , folder : "user_scripts/odbfcl/adb_load_txtcollection_files" , params : "" diff --git a/user_scripts/odbfcl/diff_calculate/diff_calculate.sql b/user_scripts/odbfcl/diff_calculate/diff_calculate.sql index 6050f82..7dbbb08 100644 --- a/user_scripts/odbfcl/diff_calculate/diff_calculate.sql +++ b/user_scripts/odbfcl/diff_calculate/diff_calculate.sql @@ -3,6 +3,10 @@ WHENEVER SQLERROR EXIT SQL.SQLCODE DEF V_CONN = '&1' DEF V_VERS_FROM = '&2' DEF V_VERS_TO = '&3' +DEF V_BRELEASE = '&4' + +DEF V_TABLE_NAME_CODES = 'DIFF_CODES_LOAD_&&V_BRELEASE.' +DEF V_TABLE_NAME_CONTENTS = 'DIFF_CONTENTS_LOAD_&&V_BRELEASE.' SET TERMOUT OFF ECHO OFF @@ -77,7 +81,7 @@ PRO ls -1 *_*.txt > "${v_file}" PRO PRO cat << EOF > "${v_outpref}_load.ctl" PRO LOAD -PRO INTO TABLE DIFF_CODES_LOAD +PRO INTO TABLE &&V_TABLE_NAME_CODES. PRO APPEND PRO FIELDS TERMINATED BY ',' PRO (file_name, @@ -111,7 +115,7 @@ PRO ls -1 *_*.txt > "${v_file}" PRO PRO cat << EOF > "${v_outpref}_load.ctl" PRO LOAD -PRO INTO TABLE DIFF_CONTENTS_LOAD +PRO INTO TABLE &&V_TABLE_NAME_CONTENTS. PRO APPEND PRO FIELDS TERMINATED BY ',' PRO (file_name, @@ -136,11 +140,11 @@ SPO OFF ! rm -f *_*.txt -- For Labels -BEGIN - ADMIN.INITAPEXFROMOUTSIDE(100,2,'XYZ') ; - APEX_UTIL.SET_SESSION_STATE('ALLOW_LABELS','Y'); -END; -/ +-- BEGIN +-- ADMIN.INITAPEXFROMOUTSIDE(100,2,'XYZ') ; +-- APEX_UTIL.SET_SESSION_STATE('ALLOW_LABELS','Y'); +-- END; +-- / ROLLBACK; EXEC L_HASH('&V_VERS_FROM','&V_VERS_TO'); @@ -171,7 +175,7 @@ SPOOL OFF @aaa.sql BEGIN - EXECUTE IMMEDIATE 'DROP TABLE DIFF_CODES_LOAD PURGE'; + EXECUTE IMMEDIATE 'DROP TABLE &&V_TABLE_NAME_CODES. PURGE'; EXCEPTION WHEN OTHERS THEN IF SQLCODE != -942 THEN @@ -180,7 +184,7 @@ EXCEPTION END; / -CREATE TABLE DIFF_CODES_LOAD +CREATE TABLE &&V_TABLE_NAME_CODES. ( FILE_NAME VARCHAR2(100) NOT NULL, CONTENTS CLOB NOT NULL @@ -194,11 +198,11 @@ insert /*+ append */ select substr(file_name,1,instr(file_name,'_',1,1)-1), substr(file_name,instr(file_name,'_',1,1)+1,instr(file_name,'.',1,1)-instr(file_name,'_',1,1)-1), CONTENTS -from DIFF_CODES_LOAD; +from &&V_TABLE_NAME_CODES.; commit; -DROP TABLE DIFF_CODES_LOAD PURGE; +DROP TABLE &&V_TABLE_NAME_CODES. PURGE; ! rm -f *_*.txt ! rm -f load_codes.sh @@ -235,7 +239,7 @@ SPOOL OFF @aaa.sql BEGIN - EXECUTE IMMEDIATE 'DROP TABLE DIFF_CONTENTS_LOAD PURGE'; + EXECUTE IMMEDIATE 'DROP TABLE &&V_TABLE_NAME_CONTENTS. PURGE'; EXCEPTION WHEN OTHERS THEN IF SQLCODE != -942 THEN @@ -244,7 +248,7 @@ EXCEPTION END; / -CREATE TABLE DIFF_CONTENTS_LOAD +CREATE TABLE &&V_TABLE_NAME_CONTENTS. ( FILE_NAME VARCHAR2(100) NOT NULL, CONTENTS CLOB NOT NULL @@ -258,11 +262,11 @@ insert /*+ append */ select substr(file_name,1,instr(file_name,'_',1,1)-1), substr(file_name,instr(file_name,'_',1,1)+1,instr(file_name,'.',1,1)-instr(file_name,'_',1,1)-1), CONTENTS -from DIFF_CONTENTS_LOAD; +from &&V_TABLE_NAME_CONTENTS.; commit; -DROP TABLE DIFF_CONTENTS_LOAD PURGE; +DROP TABLE &&V_TABLE_NAME_CONTENTS. PURGE; ! rm -f *_*.txt ! rm -f load_contents.sh diff --git a/user_scripts/odbfcl/diff_calculate/diff_calculate.yml b/user_scripts/odbfcl/diff_calculate/diff_calculate.yml index 2f3fa04..0006b44 100644 --- a/user_scripts/odbfcl/diff_calculate/diff_calculate.yml +++ b/user_scripts/odbfcl/diff_calculate/diff_calculate.yml @@ -1,5 +1,15 @@ # This must come after MV_VERSIONS is reloaded +- name: Define oci_adb_main_tns + set_fact: + oci_adb_main_tns: "{{ oci_adb_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" + when: oci_adb_use_wallet == false + +- name: Define oci_adb_main_tns + set_fact: + oci_adb_main_tns: "/@{{ oci_adb_user }}" + when: oci_adb_use_wallet == true + - name: "Load {{ oci_adb_transient_user }} diff code and contents" shell: | set -e @@ -7,7 +17,7 @@ rm -rf "${v_folder}" mkdir "${v_folder}" cd "${v_folder}" - sqlplus -L -S {{ oci_adb_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }} @{{ shared_folder }}/user_scripts/odbfcl/diff_calculate/diff_main.sql '{{ oci_adb_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}' '@{{ shared_folder }}/user_scripts/odbfcl/diff_calculate' {{ db_version }} {{ patch.base_ru | default('') }}{{ patch.type }} {{ patch.id }} + sqlplus -L -S {{ oci_adb_main_tns }} @{{ shared_folder }}/user_scripts/odbfcl/diff_calculate/diff_main.sql '{{ oci_adb_main_tns }}' '@{{ shared_folder }}/user_scripts/odbfcl/diff_calculate' {{ db_version }} {{ patch.base_ru | default('') }}{{ patch.type }} {{ patch.id }} #rm -rf "${v_folder}" register: sqloutput diff --git a/user_scripts/odbfcl/diff_calculate/diff_main.sql b/user_scripts/odbfcl/diff_calculate/diff_main.sql index 7951875..4ec8abf 100644 --- a/user_scripts/odbfcl/diff_calculate/diff_main.sql +++ b/user_scripts/odbfcl/diff_calculate/diff_main.sql @@ -40,7 +40,7 @@ set verify off col code for a10000 set termout off spo run_code.sql -select '@&P_FOLDER./diff_calculate.sql ''&P_CRED.'' ''' || v1.display_name_prev || ''' ''' || v1.display_name || '''' +select '@&P_FOLDER./diff_calculate.sql ''&P_CRED.'' ''' || v1.display_name_prev || ''' ''' || v1.display_name || ''' ''' || REPLACE('&P_VERS.','.','') || '''' from mv_versions v1, mv_versions v2 where v1.display_name_prev=v2.display_name and ((v1.oraversion='&P_VERS.' and v1.oraseries='&P_SER.' and v1.orapatch=&P_PATCH.) diff --git a/user_scripts/odbfcl/exchange_tables_adb.yml b/user_scripts/odbfcl/exchange_tables_adb.yml index 159b2a1..27b2cff 100644 --- a/user_scripts/odbfcl/exchange_tables_adb.yml +++ b/user_scripts/odbfcl/exchange_tables_adb.yml @@ -1,7 +1,7 @@ - include: tasks/local_sqlplus.yml vars: sql_param : { task_action : "Load {{ oci_adb_transient_user }} tables into {{ oci_adb_user }} schema" , - cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + cred : "{{ oci_adb_connection_tns }}" , file : "exchange_tables_adb.sql" , folder : "user_scripts/odbfcl" , params : "{{ oci_adb_user }} {{ db_version }} {{ patch.base_ru | default('') }}{{ patch.type }} {{ patch.id }}" diff --git a/user_scripts/odbfcl/tables_recreate_adb.yml b/user_scripts/odbfcl/tables_recreate_adb.yml index ba56654..25e2653 100644 --- a/user_scripts/odbfcl/tables_recreate_adb.yml +++ b/user_scripts/odbfcl/tables_recreate_adb.yml @@ -2,10 +2,20 @@ set_fact: oci_adb_transient_user: "{{ oci_adb_user }}_{{ db_version | replace('.', '') }}" +- name: Define oci_adb_connection_tns + set_fact: + oci_adb_connection_tns: "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" + when: oci_adb_use_wallet == false + +- name: Define oci_adb_connection_tns + set_fact: + oci_adb_connection_tns: "/@{{ oci_adb_transient_user }}" + when: oci_adb_use_wallet == true + - include: tasks/local_sqlplus.yml vars: sql_param : { task_action : "Run tables recreate ADB SQL" , - cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + cred : "{{ oci_adb_connection_tns }}" , file : "tables_recreate_adb.sql" , folder : "user_scripts/odbfcl" , params : "" diff --git a/user_scripts/odbfcl/update_table_keys_adb.yml b/user_scripts/odbfcl/update_table_keys_adb.yml index 4524efa..91fc62a 100644 --- a/user_scripts/odbfcl/update_table_keys_adb.yml +++ b/user_scripts/odbfcl/update_table_keys_adb.yml @@ -1,7 +1,7 @@ - include: tasks/local_sqlplus.yml vars: sql_param : { task_action : "Update {{ oci_adb_transient_user }} tables with new keys" , - cred : "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" , + cred : "{{ oci_adb_connection_tns }}" , file : "update_table_keys_adb.sql" , folder : "user_scripts/odbfcl" , params : "{{ db_version }} {{ patch.base_ru | default('') }}{{ patch.type }} {{ patch.id }}" From b6e5733fe66adba99bc7e6c39eacc3e84b8e8e5b Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Sat, 28 May 2022 09:35:25 -0300 Subject: [PATCH 064/229] April 22 Patches --- list_exceptions.yml | 2 ++ list_patches.yml | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/list_exceptions.yml b/list_exceptions.yml index b029f8e..6da31a1 100644 --- a/list_exceptions.yml +++ b/list_exceptions.yml @@ -45,3 +45,5 @@ list_retry_datapatch: - { version: "12.1.0.2" , type : "PSU" , id : 220118 , retries : 2 } - { version: "12.1.0.2" , type : "BP" , id : 220118 , retries : 2 } - { version: "12.2.0.1" , type : "RU" , id : 220118 , retries : 1 } + - { version: "12.1.0.2" , type : "PSU" , id : 220419 , retries : 2 } + - { version: "12.1.0.2" , type : "BP" , id : 220419 , retries : 2 } diff --git a/list_patches.yml b/list_patches.yml index 3aca155..5ab7a97 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -38,6 +38,7 @@ list_11204: - { type : "PSU" , id : 210720 , patch_number : 32758711 } - { type : "PSU" , id : 211019 , patch_number : 33128584 } - { type : "PSU" , id : 220118 , patch_number : 33477185 } + - { type : "PSU" , id : 220419 , patch_number : 33711103 } - { type : "OJVM" , id : 1 , patch_number : 19282021 } - { type : "OJVM" , id : 2 , patch_number : 19877440 } - { type : "OJVM" , id : 3 , patch_number : 20406239 } @@ -68,6 +69,7 @@ list_11204: - { type : "OJVM" , id : 210720 , patch_number : 32876451 } - { type : "OJVM" , id : 211019 , patch_number : 33192642 } - { type : "OJVM" , id : 220118 , patch_number : 33561250 } + - { type : "OJVM" , id : 220419 , patch_number : 33829826 } - { type : "BP" , id : 1 , patch_number : 17628025 , patch_folder : 17628006 } - { type : "BP" , id : 2 , patch_number : 17838803 , patch_folder : 17741631 } - { type : "BP" , id : 3 , patch_number : 17904156 , patch_folder : 17943261 } @@ -114,6 +116,7 @@ list_11204: - { type : "BP" , id : 210720 , patch_number : 32917411 , patch_folder : 32758732 } - { type : "BP" , id : 211019 , patch_number : 33248386 , patch_folder : 33128587 } - { type : "BP" , id : 220118 , patch_number : 33575241 , patch_folder : 33477193 } + - { type : "BP" , id : 220419 , patch_number : 33880541 , patch_folder : 33711121 } #################### @@ -184,6 +187,7 @@ list_12102: - { type : "PSU" , id : 210720 , patch_number : 32768233 } - { type : "PSU" , id : 211019 , patch_number : 33128590 } - { type : "PSU" , id : 220118 , patch_number : 33477199 } + - { type : "PSU" , id : 220419 , patch_number : 33711081 } - { type : "OJVM" , id : 1 , patch_number : 19282028 } - { type : "OJVM" , id : 2 , patch_number : 19877336 } - { type : "OJVM" , id : 3 , patch_number : 20415564 } @@ -214,6 +218,7 @@ list_12102: - { type : "OJVM" , id : 210720 , patch_number : 32876425 } - { type : "OJVM" , id : 211019 , patch_number : 33192628 } - { type : "OJVM" , id : 220118 , patch_number : 33561268 } + - { type : "OJVM" , id : 220419 , patch_number : 33808385 } - { type : "BP" , id : 1 , patch_number : 19404326 , patch_folder : 19189240 } - { type : "BP" , id : 2 , patch_number : 19774304 , patch_folder : 19649591 } - { type : "BP" , id : 3 , patch_number : 20026159 , patch_folder : 19878106 } @@ -253,7 +258,7 @@ list_12102: - { type : "BP" , id : 210720 , patch_number : 32917362 , patch_folder : 32768230 } - { type : "BP" , id : 211019 , patch_number : 33248411 , patch_folder : 33114885 } - { type : "BP" , id : 220118 , patch_number : 33575286 , patch_folder : 33465249 } - + - { type : "BP" , id : 220419 , patch_number : 33880550 , patch_folder : 33711072 } #################### ##### 12.2.0.1 ##### @@ -409,6 +414,7 @@ list_19000: - { type : "RU" , id : 12 , patch_number : 32904851 } - { type : "RU" , id : 13 , patch_number : 33192793 } - { type : "RU" , id : 14 , patch_number : 33515361 } + - { type : "RU" , id : 15 , patch_number : 33806152 } - { type : "RUR" , id : 1 , patch_number : 29799057 , base_ru : '19.3' } - { type : "RUR" , id : 2 , patch_number : 30087906 , base_ru : '19.3' } - { type : "RUR" , id : 1 , patch_number : 30080447 , base_ru : '19.4' } @@ -431,6 +437,8 @@ list_19000: - { type : "RUR" , id : 1 , patch_number : 33210889 , base_ru : '19.12' } - { type : "RUR" , id : 2 , patch_number : 33494256 , base_ru : '19.12' } - { type : "RUR" , id : 1 , patch_number : 33516456 , base_ru : '19.13' } + - { type : "RUR" , id : 2 , patch_number : 33783771 , base_ru : '19.13' } + - { type : "RUR" , id : 1 , patch_number : 33806138 , base_ru : '19.14' } - { type : "OJVM" , id : 190416 , patch_number : 29548437 } - { type : "OJVM" , id : 190716 , patch_number : 29774421 } - { type : "OJVM" , id : 191015 , patch_number : 30128191 } @@ -443,6 +451,7 @@ list_19000: - { type : "OJVM" , id : 210720 , patch_number : 32876380 } - { type : "OJVM" , id : 211019 , patch_number : 33192694 } - { type : "OJVM" , id : 220118 , patch_number : 33561310 } + - { type : "OJVM" , id : 220419 , patch_number : 33808367 } #################### ##### 21.0.0.0 ##### @@ -451,4 +460,5 @@ list_19000: list_21000: #- { type : "RU" , id : 3 , patch_number : 00000000 , base_snap : "21.2.0" } - { type : "RU" , id : 4 , patch_number : 33239276 } - - { type : "RU" , id : 5 , patch_number : 33516412 } \ No newline at end of file + - { type : "RU" , id : 5 , patch_number : 33516412 } + - { type : "RU" , id : 6 , patch_number : 33843745 } \ No newline at end of file From ce556b37357f4fcfbb817a92b5584c05bc9dad79 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 7 Jun 2022 13:21:19 -0300 Subject: [PATCH 065/229] Update impdp_file_adb.yml --- tasks/impdp_file_adb.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/impdp_file_adb.yml b/tasks/impdp_file_adb.yml index b8db366..9adcae8 100644 --- a/tasks/impdp_file_adb.yml +++ b/tasks/impdp_file_adb.yml @@ -27,6 +27,6 @@ when: - param_type is undefined or param_type == patch.type - - param_patch is undefined or (param_patch | int) == (patch.id | int) + - param_patch == -1 or (param_patch | int) == (patch.id | int) # Skip all is true when dump file is already generated and skip_dump_exists is true at config. \ No newline at end of file From a16fcc3180567f53f5308a5ecf5de44c83686ea1 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 19 Jul 2022 21:47:42 -0300 Subject: [PATCH 066/229] Small issues fix --- .../tasks/main.yml | 2 +- tasks/config_checks.yml | 17 +- tasks/impdp_file_adb.yml | 47 ++-- tasks/main_loader_adb.yml | 69 +++-- .../odbfcl/adb_load_expdp/adb_load_expdp.yml | 1 + .../odbfcl/diff_calculate/diff_calculate.sql | 8 + .../odbfcl/diff_calculate/diff_calculate.yml | 2 +- user_scripts/odbfcl/extract/load_code.sql | 255 +----------------- user_scripts/odbfcl/extract/unwrap_code.sql | 253 +++++++++++++++++ .../odbfcl/sh_extractor/dumpCreate.sh | 19 +- user_scripts/odbfcl/sh_extractor/exporter.sh | 29 +- .../odbfcl/sh_extractor/get_user_prefix.sql | 1 + 12 files changed, 355 insertions(+), 348 deletions(-) create mode 100644 user_scripts/odbfcl/extract/unwrap_code.sql diff --git a/roles/oci_object_storage_object_facts/tasks/main.yml b/roles/oci_object_storage_object_facts/tasks/main.yml index 9f2ba9b..bb19036 100644 --- a/roles/oci_object_storage_object_facts/tasks/main.yml +++ b/roles/oci_object_storage_object_facts/tasks/main.yml @@ -1,7 +1,7 @@ - name: Download file from object storage oci_object_storage_object_facts: namespace_name: "{{ oci_namespace }}" - bucket_name: "{{ oci_manual_bucket }}" + bucket_name: "{{ oci_download_bucket }}" object_name: "{{ oci_download_file }}" auth_type: instance_principal dest: "{{ oci_dest_file }}" diff --git a/tasks/config_checks.yml b/tasks/config_checks.yml index 755a0d8..f6c3742 100644 --- a/tasks/config_checks.yml +++ b/tasks/config_checks.yml @@ -1,8 +1,17 @@ -- name: Variables not provided +- name: Variable downloader_tool not provided fail: - msg: "Variables downloader_tool / downloader_user / downloader_pass must be defined when download_patch is true." - when: ( downloader_tool is undefined or downloader_user is undefined - or (downloader_tool|length == 0) or (downloader_user|length == 0)) and download_patch == true + msg: "Variable downloader_tool must be defined when download_patch is true." + when: download_patch == true and ( downloader_tool is undefined or (downloader_tool|length == 0)) + +- name: Variable downloader_user not provided + fail: + msg: "Variable downloader_user must be defined when download_patch is true." + when: download_patch == true and ( downloader_user is undefined or (downloader_user|length == 0)) + +- name: Variable downloader_pass not provided + fail: + msg: "Variable downloader_pass must be defined when download_patch is true." + when: download_patch == true and ( downloader_pass is undefined or (downloader_pass|length == 0)) - name: "Check if {{ downloader_tool }} exists" stat: diff --git a/tasks/impdp_file_adb.yml b/tasks/impdp_file_adb.yml index 9adcae8..3650e53 100644 --- a/tasks/impdp_file_adb.yml +++ b/tasks/impdp_file_adb.yml @@ -1,32 +1,25 @@ -# Skip processing only if param_patch and param_type filters are defined -- block: +- name: "Processing {{ db_version }} {{ patch.type }} {{ patch.id }}" + debug: msg="Processing {{ db_version }} {{ patch.type }} {{ patch.id }}" - - name: "Processing {{ db_version }} {{ patch.type }} {{ patch.id }}" - debug: msg="Processing {{ db_version }} {{ patch.type }} {{ patch.id }}" +# User custom pre-scripts +- include: run_script.yml + loop: "{{ user_impdp_pre | flatten(levels=1) }}" + loop_control: + loop_var: script_param + when: user_impdp_pre is defined - # User custom pre-scripts - - include: run_script.yml - loop: "{{ user_impdp_pre | flatten(levels=1) }}" - loop_control: - loop_var: script_param - when: user_impdp_pre is defined +# The impdp loader are the same steps executed after the expdp +- include: run_script.yml + loop: "{{ user_expdp_post | flatten(levels=1) }}" + loop_control: + loop_var: script_param + when: user_expdp_post is defined - # The impdp loader are the same steps executed after the expdp - - include: run_script.yml - loop: "{{ user_expdp_post | flatten(levels=1) }}" - loop_control: - loop_var: script_param - when: user_expdp_post is defined - - # User custom post-scripts - - include: run_script.yml - loop: "{{ user_impdp_post | flatten(levels=1) }}" - loop_control: - loop_var: script_param - when: user_impdp_post is defined - - when: - - param_type is undefined or param_type == patch.type - - param_patch == -1 or (param_patch | int) == (patch.id | int) +# User custom post-scripts +- include: run_script.yml + loop: "{{ user_impdp_post | flatten(levels=1) }}" + loop_control: + loop_var: script_param + when: user_impdp_post is defined # Skip all is true when dump file is already generated and skip_dump_exists is true at config. \ No newline at end of file diff --git a/tasks/main_loader_adb.yml b/tasks/main_loader_adb.yml index 798f615..380d137 100644 --- a/tasks/main_loader_adb.yml +++ b/tasks/main_loader_adb.yml @@ -33,23 +33,52 @@ vars: filter_qry: "[?type=='RU'].id" -# Execute for every PSU, BP and OJVM if has a single PSU -- include: "impdp_file_adb.yml patch={{ item }}" - with_items: - - { type : PSU , id : 0 } - - "{{ lookup('vars', patch_list) | flatten(levels=1) }}" - when: total_psus != "0" - -# Execute for base BP only. The others were included above. -- include: "impdp_file_adb.yml patch={{ item }}" - with_items: - - { type : BP , id : 0 } - when: total_bps != "0" - -# Execute for every RU, RUR and OJVM if has a single RU -- include: "impdp_file_adb.yml patch={{ item }}" - with_items: - - "{{ lookup('vars', patch_list) | flatten(levels=1) }}" - when: total_rus != "0" - -### \ No newline at end of file +############################### + +# Execute for base release if there is at least 1 PSU for that version +- include: "impdp_file_adb.yml" + vars: + patch : { type : PSU , id : 0, patch_number : 0 } + when: + - total_psus != "0" + - 0 == (param_patch | int) or param_patch == -1 + - 0 >= (param_patch_from | int) or param_patch_from == -1 + - 0 <= (param_patch_to | int) or param_patch_to == -1 + - param_type is undefined or param_type == "PSU" + +# Execute for base release if there is at least 1 BP for that version +- include: "impdp_file_adb.yml" + vars: + patch : { type : BP , id : 0, patch_number : 0 } + when: + - total_bps != "0" + - 0 == (param_patch | int) or param_patch == -1 + - 0 >= (param_patch_from | int) or param_patch_from == -1 + - 0 <= (param_patch_to | int) or param_patch_to == -1 + - param_type is undefined or param_type == "BP" + +# Execute for base release if there is at least 1 RU for that version +- include: "impdp_file_adb.yml" + vars: + patch : { type : RU , id : "{{ out_of_box_ru }}" , patch_number : 0 } + when: + - total_rus != "0" + - (out_of_box_ru | int) == (param_patch | int) or param_patch == -1 + - (out_of_box_ru | int) >= (param_patch_from | int) or param_patch_from == -1 + - (out_of_box_ru | int) <= (param_patch_to | int) or param_patch_to == -1 + - param_type is undefined or param_type == "RU" + +############################### + +# Execute for every PSU / BP / OJVM / RU / RUR +- include: "impdp_file_adb.yml" + loop: "{{ lookup('vars', patch_list) | flatten(levels=1) }}" + loop_control: + loop_var: patch + label: "{{ patch.id }}" + when: + - patch.id == (param_patch | int) or param_patch == -1 + - patch.id >= (param_patch_from | int) or param_patch_from == -1 + - patch.id <= (param_patch_to | int) or param_patch_to == -1 + - patch.id > (out_of_box_ru | int) or patch.type != "RU" # When RU, skip patch.id lower or equal to out_of_box_ru + - param_type is undefined or param_type == patch.type \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml index 69707ab..3d13beb 100644 --- a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml +++ b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml @@ -61,6 +61,7 @@ remap_schema='{{ dump_user_int }}:{{ oci_adb_transient_user }}' \ parallel=16 \ table_exists_action=truncate \ + content=data_only \ dumpfile={{ dump_file_prefix }}.dmp > "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.log" 2>&1 register: shell_output diff --git a/user_scripts/odbfcl/diff_calculate/diff_calculate.sql b/user_scripts/odbfcl/diff_calculate/diff_calculate.sql index 7dbbb08..a905c08 100644 --- a/user_scripts/odbfcl/diff_calculate/diff_calculate.sql +++ b/user_scripts/odbfcl/diff_calculate/diff_calculate.sql @@ -193,6 +193,8 @@ COMPRESS NOLOGGING; ! sh load_codes.sh +SET TERMOUT ON ECHO ON + insert /*+ append */ into DIFF_CODES (MD5_HASH_FROM, MD5_HASH_TO, DIFF_CODE) select substr(file_name,1,instr(file_name,'_',1,1)-1), @@ -204,6 +206,8 @@ commit; DROP TABLE &&V_TABLE_NAME_CODES. PURGE; +SET TERMOUT OFF ECHO OFF + ! rm -f *_*.txt ! rm -f load_codes.sh ! rm -f get_code.sql @@ -257,6 +261,8 @@ COMPRESS NOLOGGING; ! sh load_contents.sh +SET TERMOUT ON ECHO ON + insert /*+ append */ into DIFF_CONTENTS (MD5_HASH_FROM, MD5_HASH_TO, DIFF_CODE) select substr(file_name,1,instr(file_name,'_',1,1)-1), @@ -268,6 +274,8 @@ commit; DROP TABLE &&V_TABLE_NAME_CONTENTS. PURGE; +SET TERMOUT OFF ECHO OFF + ! rm -f *_*.txt ! rm -f load_contents.sh ! rm -f get_contents.sql diff --git a/user_scripts/odbfcl/diff_calculate/diff_calculate.yml b/user_scripts/odbfcl/diff_calculate/diff_calculate.yml index 0006b44..c87902e 100644 --- a/user_scripts/odbfcl/diff_calculate/diff_calculate.yml +++ b/user_scripts/odbfcl/diff_calculate/diff_calculate.yml @@ -18,7 +18,7 @@ mkdir "${v_folder}" cd "${v_folder}" sqlplus -L -S {{ oci_adb_main_tns }} @{{ shared_folder }}/user_scripts/odbfcl/diff_calculate/diff_main.sql '{{ oci_adb_main_tns }}' '@{{ shared_folder }}/user_scripts/odbfcl/diff_calculate' {{ db_version }} {{ patch.base_ru | default('') }}{{ patch.type }} {{ patch.id }} - #rm -rf "${v_folder}" + rm -rf "${v_folder}" register: sqloutput #- include: tasks/local_sqlplus.yml diff --git a/user_scripts/odbfcl/extract/load_code.sql b/user_scripts/odbfcl/extract/load_code.sql index 577b24a..7688d83 100644 --- a/user_scripts/odbfcl/extract/load_code.sql +++ b/user_scripts/odbfcl/extract/load_code.sql @@ -35,256 +35,11 @@ commit; drop table &v_username..T_HASH_LOAD purge; ---------------------------------------------- ------------- SECTION START ------------ ------------- UNWRAP WRAPPED CODE ------------ ---------------------------------------------- -set def ^ +-- BEGIN - Added to avoid "Java not installed" errors. +WHENEVER SQLERROR CONTINUE -create or replace java source named CUX_UNWRAPPER -as -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.Reader; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.SQLException; -import java.util.zip.Deflater; -import java.util.zip.InflaterInputStream; -import oracle.jdbc.OracleDriver; -import oracle.sql.CLOB; +@@unwrap_code.sql -public class UNWRAPPER { - //unzip - public static CLOB Inflate(CLOB src) throws IOException, SQLException { - StringBuffer sb = new StringBuffer(); - String s = src.stringValue(); - try{ - ByteArrayInputStream bis = - new ByteArrayInputStream(decodeHex(s.toCharArray())); - //ByteArrayInputStream bis = new ByteArrayInputStream(src); - InflaterInputStream iis = new InflaterInputStream(bis); - for (int c = iis.read(); c != -1; c = iis.read()) { - sb.append((char)c); - } - }catch (Exception e) - { - e.printStackTrace(); - } - - Connection conn = DriverManager.getConnection("jdbc:default:connection:"); - CLOB clob = CLOB.createTemporary(conn, false, CLOB.DURATION_SESSION); - clob.setString(1, sb.toString()); - return clob; - - } - - public static byte[] Deflate(String src, int quality) { - try { - byte[] tmp = new byte[src.length() + 100]; - Deflater defl = new Deflater(quality); - defl.setInput(src.getBytes("UTF-8")); - defl.finish(); - int cnt = defl.deflate(tmp); - byte[] res = new byte[cnt]; - for (int i = 0; i < cnt; i++) - res = tmp; - return res; - } catch (Exception e) { - } - return null; - } - - public static int toDigit(char ch, int index) { - int digit = Character.digit(ch, 16); - if (digit == -1) { - throw new RuntimeException("illegal hexadecimal character " + ch + - " at index " + index); - } - return digit; - } - - //16-ary string to byte array - public static byte[] decodeHex(char[] data) { - int len = data.length; - if ((len & 0x01) != 0) { - throw new RuntimeException("odd number of characters "); - } - - byte[] out = new byte[len >> 1]; - - for (int i = 0, j = 0; j < len; i++) { - int f = toDigit(data[j], j) << 4; - j++; - f = f | toDigit(data[j], j); - j++; - out[i] = (byte)(f & 0xFF); - } - - return out; - } -} -/ - -ALTER JAVA SOURCE CUX_UNWRAPPER COMPILE -/ - -CREATE OR REPLACE PACKAGE CUX_UNWRAPPER IS - FUNCTION UNWRAP(P_CLOB IN CLOB) RETURN CLOB; -END; -/ - -create or replace package body cux_unwrapper is - - --unzip - function inflate(src in clob) return clob as - language java name 'UNWRAPPER.Inflate( oracle.sql.CLOB ) return oracle.sql.CLOB'; - - --Decrypt the main program - function unwrap(p_clob IN CLOB) return clob AS - - l_wrap varchar2(32767); - - l_inf clob; - l_res clob; - l_src clob; - l_inflate varchar2(32767); - l_temp VARCHAR2(32767); - l_bt varchar2(32767); - l_text varchar2(32767); - l_char varchar2(2); - l_len number; - l_slen integer; - l_offset integer := 1; - l_chunk_len integer := 10080; - - --Decryption byte comparison dictionary table - l_dict varchar2(512) := '3D6585B318DBE287F152AB634BB5A05F' || - '7D687B9B24C228678ADEA4261E03EB17' || - '6F343E7A3FD2A96A0FE935561FB14D10' || - '78D975F6BC4104816106F9ADD6D5297E' || - '869E79E505BA84CC6E278EB05DA8F39F' || - 'D0A271B858DD2C38994C480755E4538C' || - '46B62DA5AF322240DC50C3A1258B9C16' || - '605CCFFD0C981CD4376D3C3A30E86C31' || - '47F533DA43C8E35E1994ECE6A39514E0' || - '9D64FA5915C52FCABB0BDFF297BF0A76' || - 'B449445A1DF0009621807F1A82394FC1' || - 'A7D70DD1D8FF139370EE5BEFBE09B977' || - '72E7B254B72AC7739066200E51EDF87C' || - '8F2EF412C62B83CDACCB3BC44EC06936' || - '6202AE88FCAA4208A64557D39ABDE123' || - '8D924A1189746B91FBFEC901EA1BF7CE'; - l_sl varchar2(512) := '000102030405060708090A0B0C0D0E0F' || - '101112131415161718191A1B1C1D1E1F' || - '202122232425262728292A2B2C2D2E2F' || - '303132333435363738393A3B3C3D3E3F' || - '404142434445464748494A4B4C4D4E4F' || - '505152535455565758595A5B5C5D5E5F' || - '606162636465666768696A6B6C6D6E6F' || - '707172737475767778797A7B7C7D7E7F' || - '808182838485868788898A8B8C8D8E8F' || - '909192939495969798999A9B9C9D9E9F' || - 'A0A1A2A3A4A5A6A7A8A9AAABACADAEAF' || - 'B0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF' || - 'C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF' || - 'D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF' || - 'E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF' || - 'F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF'; - BEGIN - dbms_lob.createtemporary(lob_loc => l_inf, - cache => TRUE, - dur => dbms_lob.session); - --Get package ciphertext - l_src := p_clob; - - --out_put('source:<'||l_src||'>'); - l_src := substr(l_src, regexp_instr(l_src, 'wrapped', 1, 1, 0, 'i')); - l_src := rtrim(substr(l_src, instr(l_src, chr(10), 1, 20) + 1), chr(10)); - l_src := replace(l_src, chr(10), ''); - --dbms_output.put_line('source:<'||l_src||'>'); - --l_src:=substr(l_src,41); - - --base64 decoding - l_len := dbms_lob.getlength(l_src); - while l_offset < l_len loop - if (l_len - l_offset) < 10080 then - l_chunk_len := (l_len - l_offset); - end if; - l_temp := dbms_lob.substr(l_src, l_chunk_len, l_offset); - l_bt := utl_encode.base64_decode(utl_raw.cast_to_raw(l_temp)); - - if l_bt is not null then - if l_offset = 1 then - -- Remove the first 40 hash strings - l_bt := substr(l_bt, 41); - end if; - -- l_wrap := l_wrap || l_bt; - -- dictionary table conversion - l_bt := utl_raw.translate(l_bt, l_sl, l_dict); - - l_offset := l_offset + l_chunk_len; - -- l_inflate := l_inflate || l_bt; - dbms_lob.writeappend(l_inf, length(l_bt), l_bt); - end if; - - end loop; - - /* dbms_output.put_line('base:' || l_wrap); - dbms_output.put_line('<' || l_inflate || '>');*/ - - --unzip - l_res := inflate(l_inf); - return l_res; - END unwrap; -END; -/ - -set def & - ---------------------------------------------- ------------- SECTION END ------------ ------------- UNWRAP WRAPPED CODE ------------ ---------------------------------------------- - --- Create unwrapped table -create table &v_username..DM_CODES_LOAD AS -select SYS.DBMS_CRYPTO.HASH(UNCODE,2) MD5_HASH, - MD5_HASH MD5_HASH_WRAPPED, - UNCODE CODE, - 'N' WRAPPED -from ( select cux_unwrapper.unwrap(code) uncode, MD5_HASH - from &v_username..DM_CODES - where WRAPPED='Y'); - --- Load back into DM_CODES -insert /*+ append */ - into &v_username..DM_CODES (MD5_HASH, CODE, WRAPPED) -select MD5_HASH, - CODE, - 'N' WRAPPED -from ( select MD5_HASH, - CODE, - RANK() over (partition by MD5_HASH order by rowid asc) col_ind - from &v_username..DM_CODES_LOAD -) -where col_ind=1; - -commit; - --- Update DM_CODES -update &v_username..DM_CODES T1 SET T1.MD5_HASH_UNWRAPPED = - (SELECT T2.MD5_HASH - FROM &v_username..DM_CODES_LOAD T2 - WHERE T2.MD5_HASH_WRAPPED=T1.MD5_HASH) -WHERE T1.WRAPPED = 'Y'; - -commit; - -drop table &v_username..DM_CODES_LOAD purge; - -drop package cux_unwrapper; - -drop java source CUX_UNWRAPPER; \ No newline at end of file +-- END - Added to avoid "Java not installed" errors. +WHENEVER SQLERROR EXIT SQL.SQLCODE \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/unwrap_code.sql b/user_scripts/odbfcl/extract/unwrap_code.sql new file mode 100644 index 0000000..729d63f --- /dev/null +++ b/user_scripts/odbfcl/extract/unwrap_code.sql @@ -0,0 +1,253 @@ +--------------------------------------------- +------------ SECTION START ------------ +------------ UNWRAP WRAPPED CODE ------------ +--------------------------------------------- + +set def ^ + +create or replace java source named CUX_UNWRAPPER +as +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.Reader; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.util.zip.Deflater; +import java.util.zip.InflaterInputStream; +import oracle.jdbc.OracleDriver; +import oracle.sql.CLOB; + +public class UNWRAPPER { + //unzip + public static CLOB Inflate(CLOB src) throws IOException, SQLException { + StringBuffer sb = new StringBuffer(); + String s = src.stringValue(); + try{ + ByteArrayInputStream bis = + new ByteArrayInputStream(decodeHex(s.toCharArray())); + //ByteArrayInputStream bis = new ByteArrayInputStream(src); + InflaterInputStream iis = new InflaterInputStream(bis); + for (int c = iis.read(); c != -1; c = iis.read()) { + sb.append((char)c); + } + }catch (Exception e) + { + e.printStackTrace(); + } + + Connection conn = DriverManager.getConnection("jdbc:default:connection:"); + CLOB clob = CLOB.createTemporary(conn, false, CLOB.DURATION_SESSION); + clob.setString(1, sb.toString()); + return clob; + + } + + public static byte[] Deflate(String src, int quality) { + try { + byte[] tmp = new byte[src.length() + 100]; + Deflater defl = new Deflater(quality); + defl.setInput(src.getBytes("UTF-8")); + defl.finish(); + int cnt = defl.deflate(tmp); + byte[] res = new byte[cnt]; + for (int i = 0; i < cnt; i++) + res = tmp; + return res; + } catch (Exception e) { + } + return null; + } + + public static int toDigit(char ch, int index) { + int digit = Character.digit(ch, 16); + if (digit == -1) { + throw new RuntimeException("illegal hexadecimal character " + ch + + " at index " + index); + } + return digit; + } + + //16-ary string to byte array + public static byte[] decodeHex(char[] data) { + int len = data.length; + if ((len & 0x01) != 0) { + throw new RuntimeException("odd number of characters "); + } + + byte[] out = new byte[len >> 1]; + + for (int i = 0, j = 0; j < len; i++) { + int f = toDigit(data[j], j) << 4; + j++; + f = f | toDigit(data[j], j); + j++; + out[i] = (byte)(f & 0xFF); + } + + return out; + } +} +/ + +ALTER JAVA SOURCE CUX_UNWRAPPER COMPILE +/ + +CREATE OR REPLACE PACKAGE CUX_UNWRAPPER IS + FUNCTION UNWRAP(P_CLOB IN CLOB) RETURN CLOB; +END; +/ + +create or replace package body cux_unwrapper is + + --unzip + function inflate(src in clob) return clob as + language java name 'UNWRAPPER.Inflate( oracle.sql.CLOB ) return oracle.sql.CLOB'; + + --Decrypt the main program + function unwrap(p_clob IN CLOB) return clob AS + + l_wrap varchar2(32767); + + l_inf clob; + l_res clob; + l_src clob; + l_inflate varchar2(32767); + l_temp VARCHAR2(32767); + l_bt varchar2(32767); + l_text varchar2(32767); + l_char varchar2(2); + l_len number; + l_slen integer; + l_offset integer := 1; + l_chunk_len integer := 10080; + + --Decryption byte comparison dictionary table + l_dict varchar2(512) := '3D6585B318DBE287F152AB634BB5A05F' || + '7D687B9B24C228678ADEA4261E03EB17' || + '6F343E7A3FD2A96A0FE935561FB14D10' || + '78D975F6BC4104816106F9ADD6D5297E' || + '869E79E505BA84CC6E278EB05DA8F39F' || + 'D0A271B858DD2C38994C480755E4538C' || + '46B62DA5AF322240DC50C3A1258B9C16' || + '605CCFFD0C981CD4376D3C3A30E86C31' || + '47F533DA43C8E35E1994ECE6A39514E0' || + '9D64FA5915C52FCABB0BDFF297BF0A76' || + 'B449445A1DF0009621807F1A82394FC1' || + 'A7D70DD1D8FF139370EE5BEFBE09B977' || + '72E7B254B72AC7739066200E51EDF87C' || + '8F2EF412C62B83CDACCB3BC44EC06936' || + '6202AE88FCAA4208A64557D39ABDE123' || + '8D924A1189746B91FBFEC901EA1BF7CE'; + l_sl varchar2(512) := '000102030405060708090A0B0C0D0E0F' || + '101112131415161718191A1B1C1D1E1F' || + '202122232425262728292A2B2C2D2E2F' || + '303132333435363738393A3B3C3D3E3F' || + '404142434445464748494A4B4C4D4E4F' || + '505152535455565758595A5B5C5D5E5F' || + '606162636465666768696A6B6C6D6E6F' || + '707172737475767778797A7B7C7D7E7F' || + '808182838485868788898A8B8C8D8E8F' || + '909192939495969798999A9B9C9D9E9F' || + 'A0A1A2A3A4A5A6A7A8A9AAABACADAEAF' || + 'B0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF' || + 'C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF' || + 'D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF' || + 'E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF' || + 'F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF'; + BEGIN + dbms_lob.createtemporary(lob_loc => l_inf, + cache => TRUE, + dur => dbms_lob.session); + --Get package ciphertext + l_src := p_clob; + + --out_put('source:<'||l_src||'>'); + l_src := substr(l_src, regexp_instr(l_src, 'wrapped', 1, 1, 0, 'i')); + l_src := rtrim(substr(l_src, instr(l_src, chr(10), 1, 20) + 1), chr(10)); + l_src := replace(l_src, chr(10), ''); + --dbms_output.put_line('source:<'||l_src||'>'); + --l_src:=substr(l_src,41); + + --base64 decoding + l_len := dbms_lob.getlength(l_src); + while l_offset < l_len loop + if (l_len - l_offset) < 10080 then + l_chunk_len := (l_len - l_offset); + end if; + l_temp := dbms_lob.substr(l_src, l_chunk_len, l_offset); + l_bt := utl_encode.base64_decode(utl_raw.cast_to_raw(l_temp)); + + if l_bt is not null then + if l_offset = 1 then + -- Remove the first 40 hash strings + l_bt := substr(l_bt, 41); + end if; + -- l_wrap := l_wrap || l_bt; + -- dictionary table conversion + l_bt := utl_raw.translate(l_bt, l_sl, l_dict); + + l_offset := l_offset + l_chunk_len; + -- l_inflate := l_inflate || l_bt; + dbms_lob.writeappend(l_inf, length(l_bt), l_bt); + end if; + + end loop; + + /* dbms_output.put_line('base:' || l_wrap); + dbms_output.put_line('<' || l_inflate || '>');*/ + + --unzip + l_res := inflate(l_inf); + return l_res; + END unwrap; +END; +/ + +set def & + +--------------------------------------------- +------------ SECTION END ------------ +------------ UNWRAP WRAPPED CODE ------------ +--------------------------------------------- + +-- Create unwrapped table +create table &v_username..DM_CODES_LOAD AS +select SYS.DBMS_CRYPTO.HASH(UNCODE,2) MD5_HASH, + MD5_HASH MD5_HASH_WRAPPED, + UNCODE CODE, + 'N' WRAPPED +from ( select cux_unwrapper.unwrap(code) uncode, MD5_HASH + from &v_username..DM_CODES + where WRAPPED='Y'); + +-- Load back into DM_CODES +insert /*+ append */ + into &v_username..DM_CODES (MD5_HASH, CODE, WRAPPED) +select MD5_HASH, + CODE, + 'N' WRAPPED +from ( select MD5_HASH, + CODE, + RANK() over (partition by MD5_HASH order by rowid asc) col_ind + from &v_username..DM_CODES_LOAD +) +where col_ind=1; + +commit; + +-- Update DM_CODES +update &v_username..DM_CODES T1 SET T1.MD5_HASH_UNWRAPPED = + (SELECT T2.MD5_HASH + FROM &v_username..DM_CODES_LOAD T2 + WHERE T2.MD5_HASH_WRAPPED=T1.MD5_HASH) +WHERE T1.WRAPPED = 'Y'; + +commit; + +drop table &v_username..DM_CODES_LOAD purge; + +drop package cux_unwrapper; + +drop java source CUX_UNWRAPPER; \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh index f681b05..4027173 100644 --- a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh @@ -35,26 +35,9 @@ v_thisdir="$(cd "$(dirname "$0")"; pwd)" v_output_file_noext="${v_output_file%.*}" -v_output_file_cnt=`awk -F"_" '{print NF-1}' <<< "${v_output_file_noext}"` -[ ${v_output_file_cnt} -ne 2 ] && exitError "File \"${v_output}\" must have 2 \"_\" on the name." - v_output_file_cnt=`awk -F" " '{print NF-1}' <<< "${v_output_file_noext}"` [ ${v_output_file_cnt} -ne 0 ] && exitError "File \"${v_output}\" must not have any spaces." -v_patch_version=`cut -d '_' -f 1 <<< "${v_output_file_noext}"` -v_patch_type=`cut -d '_' -f 2 <<< "${v_output_file_noext}"` -v_patch_id=`cut -d '_' -f 3 <<< "${v_output_file_noext}"` - -re='^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$' -if ! [[ $v_patch_version =~ $re ]] ; then - exitError "Version \"${v_patch_version}\" must be in \"X.X.X.X\" format." -fi - -re='^[0-9]+$' -if ! [[ $v_patch_id =~ $re ]] ; then - exitError "\"$v_patch_id\" must be a number." -fi - echo "Check if common user. Please wait.." v_common_user=$($ORACLE_HOME/bin/sqlplus -L -S "/ as sysdba" @get_user_prefix.sql) @@ -74,7 +57,7 @@ EOF cd odbfcl/extract/ $ORACLE_HOME/bin/sqlplus "/ as sysdba" < -First parameter is the file name pattern and cannot be null. - -The pattern is composed by 3 parts, divided by \"_\": -1st - Version, in the X.X.X.X format. -2nd - Type. Can be any string. -3rd - ID. Must be a number. +First parameter is the output file name and cannot be null. Eg: $0 ${v_example} The output is a zip file. " -v_pattern_cnt=`awk -F"_" '{print NF-1}' <<< "${v_pattern}"` -[ ${v_pattern_cnt} -ne 2 ] && exitError "Pattern \"${v_output}\" must have 2 \"_\" on it. Eg: ${v_example}" - v_pattern_cnt=`awk -F" " '{print NF-1}' <<< "${v_pattern}"` [ ${v_pattern_cnt} -ne 0 ] && exitError "Pattern \"${v_output}\" must not have any spaces. Eg: ${v_example}" -v_patch_version=`cut -d '_' -f 1 <<< "${v_pattern}"` -v_patch_type=`cut -d '_' -f 2 <<< "${v_pattern}"` -v_patch_id=`cut -d '_' -f 3 <<< "${v_pattern}"` - -# v_pattern_cnt=`awk -F"." '{print NF-1}' <<< "${v_patch_version}"` -# [ ${v_pattern_cnt} -ne 3 ] && exitError "Version \"${v_patch_version}\" must be in \"X.X.X.X\" format. Eg: ${v_example}" - -re='^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$' -if ! [[ $v_patch_version =~ $re ]] ; then - exitError "Version \"${v_patch_version}\" must be in \"X.X.X.X\" format. Eg: ${v_example}" -fi - -re='^[0-9]+$' -if ! [[ $v_patch_id =~ $re ]] ; then - exitError "\"$v_patch_id\" must be a number. Eg: ${v_example}" -fi - v_thisdir="$(cd "$(dirname "$0")"; pwd)" v_zip=${v_pattern}.zip diff --git a/user_scripts/odbfcl/sh_extractor/get_user_prefix.sql b/user_scripts/odbfcl/sh_extractor/get_user_prefix.sql index 6bc101a..91f7a07 100644 --- a/user_scripts/odbfcl/sh_extractor/get_user_prefix.sql +++ b/user_scripts/odbfcl/sh_extractor/get_user_prefix.sql @@ -1,3 +1,4 @@ +WHENEVER SQLERROR EXIT SQL.SQLCODE SET SERVEROUT ON ECHO OFF FEED OFF DECLARE V_RESULT NUMBER; From d10b30bd75e4a0689e01d03b399749dfc5ae2181 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 4 Aug 2022 14:20:04 -0300 Subject: [PATCH 067/229] New features --- .gitignore | 3 + config_oci.yml | 3 +- tasks/main_loader_manual.yml | 34 +++++++---- .../odbfcl/adb_load_expdp/adb_load_expdp.yml | 59 ++++++++++++++----- user_scripts/odbfcl/sh_extractor/build_zip.sh | 37 ++++++------ user_scripts/odbfcl/sh_extractor/exporter.sh | 2 +- 6 files changed, 89 insertions(+), 49 deletions(-) diff --git a/.gitignore b/.gitignore index 816cc27..5b38ee3 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ main.retry *.log /user_scripts/report/* user_scripts/odbfcl/sh_extractor/exporter.zip +loader_labels.yml +tasks/main_loader_labels.yml +loader_labels.sh diff --git a/config_oci.yml b/config_oci.yml index e34964a..307a059 100644 --- a/config_oci.yml +++ b/config_oci.yml @@ -5,6 +5,7 @@ patch_location_type : bucket patch_location_path : oradiff_patches # Folder in RW mode on local compute and shared with the VM. It is used to move the patches to the VMs and also to copy back the expdp output. +stage_folder : "/u01/patch_automation/stage" shared_folder : "/u02" # Path of the folder mounted within the VM. This is the path of the "shared_folder" in the VM. @@ -18,7 +19,7 @@ output_folder : "/u01/patch_automation/output" # Download utility info, if you are using one. # wget https://github.com/MarisElsins/getMOSPatch/raw/master/getMOSPatch.jar -downloader_tool : "/u01/patch_automation/patches/getMOSPatch.jar" +downloader_tool : "/u01/patch_automation/getMOSPatch.jar" downloader_user : "" downloader_pass : "" # Files in "user_scripts" folder that will run before and after the final expdp. script_types can be "shell", "sql" or "yml". diff --git a/tasks/main_loader_manual.yml b/tasks/main_loader_manual.yml index 092f063..41a7e94 100644 --- a/tasks/main_loader_manual.yml +++ b/tasks/main_loader_manual.yml @@ -10,10 +10,11 @@ - name : Define db_version set_fact: - db_version: "{{ input_version }}" - param_type: "{{ input_series }}" - param_patch: "{{ input_patch }}" - output_folder: "{{ stage_folder }}/temp_load" + db_version: "{{ input_version }}" + param_type: "{{ input_series }}" + param_patch: "{{ input_patch }}" + output_folder: "{{ stage_folder }}/temp_load" + input_file_name: "{{ input_file | basename }}" - name: Delete content & directory file: @@ -30,7 +31,8 @@ name: oci_object_storage_object_facts vars: object_action: "list" - oci_list_bucket: "{{ oci_manual_bucket }}" + oci_list_bucket: "{{ input_bucket }}" + when: not (input_bucket is undefined or (input_bucket|length == 0)) # Not working for whatever reason... @@ -38,24 +40,30 @@ # include_role: # name: oci_object_storage_object_facts # vars: -# oci_download_file: "{{ input_file }}" -# oci_dest_file: "{{ output_folder }}/{{ input_file }}" +# oci_download_file: "{{ input_file_name }}" +# oci_download_bucket: "{{ input_bucket }}" +# oci_dest_file: "{{ output_folder }}/{{ input_file_name }}" # object_action: "download" - name: Download file from OCI Bucket shell: | export LC_ALL=C.UTF-8 export LANG=C.UTF-8 - oci os object get --bucket-name {{ oci_manual_bucket }} --name {{ input_file }} --file {{ output_folder }}/{{ input_file }} + oci os object get --bucket-name {{ input_bucket }} --name {{ input_file }} --file {{ output_folder }}/{{ input_file_name }} register: shoutput + when: not (input_bucket is undefined or (input_bucket|length == 0)) -- name: "Check if {{ output_folder }}/{{ input_file }} exists" +- name: Move file to folder + command: mv "{{ input_file }}" "{{ output_folder }}/{{ input_file_name }}" + when: input_bucket is undefined or (input_bucket|length == 0) + +- name: "Check if {{ output_folder }}/{{ input_file_name }} exists" stat: - path: "{{ output_folder }}/{{ input_file }}" + path: "{{ output_folder }}/{{ input_file_name }}" register: ifile_stat_result - fail: - msg: "Could not find {{ output_folder }}/{{ input_file }} file." + msg: "Could not find {{ output_folder }}/{{ input_file_name }} file." when: ifile_stat_result.stat.exists == false - name: Creates directory @@ -70,9 +78,9 @@ - "{{ output_folder }}/symbols" - "{{ output_folder }}/expdp" -- name: "Extract {{ output_folder }}/{{ input_file }} into {{ output_folder }}" +- name: "Extract {{ output_folder }}/{{ input_file_name }} into {{ output_folder }}" unarchive: - src: "{{ output_folder }}/{{ input_file }}" + src: "{{ output_folder }}/{{ input_file_name }}" dest: "{{ output_folder }}" ##################################################################### diff --git a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml index 3d13beb..95737f1 100644 --- a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml +++ b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml @@ -15,9 +15,9 @@ include_role: name: oci_object_storage_object vars: - oci_upload_file: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" - oci_object_name: "{{ oci_upload_file | basename }}" oci_upload_bucket: "{{ oci_adb_bucket }}" + oci_object_name: "{{ oci_upload_file | basename }}" + oci_upload_file: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" object_action: "create" - name : Define source schema @@ -40,6 +40,14 @@ params : "'{{ oci_adb_credential }}' '{{ oci_adb_os_url_prefix }}/{{ dump_file_prefix }}.dmp'" } + - name: Remove expdp from OCI Bucket + include_role: + name: oci_object_storage_object + vars: + oci_upload_bucket: "{{ oci_adb_bucket }}" + oci_object_name: "{{ dump_file_prefix }}.dmp" + object_action: "remove" + # This is done because expdp/impdp still can't handle Credential using oracle native authentication (instance principal, tenancy id, etc), only swift. # - name: Import DB Tables # shell: | @@ -58,33 +66,52 @@ impdp \ userid={{ oci_adb_connection_tns }} \ directory=data_pump_dir \ - remap_schema='{{ dump_user_int }}:{{ oci_adb_transient_user }}' \ + remap_schema='{{ dump_user }}:{{ oci_adb_transient_user }},c##{{ dump_user }}:{{ oci_adb_transient_user }}' \ parallel=16 \ table_exists_action=truncate \ content=data_only \ + logfile={{ dump_file_prefix }}.log \ dumpfile={{ dump_file_prefix }}.dmp > "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.log" 2>&1 register: shell_output + ignore_errors: yes - - name: Import Output - debug: msg="{{ shell_output.stderr_lines }}" - - # This is done because expdp/impdp still can't handle Credential using oracle native authentication (instance principal, tenancy id, etc), only swift. - include: tasks/local_sqlplus.yml vars: - sql_param : { task_action : "Remove file from Oracle Directory" , + sql_param : { task_action : "Remove dumpfile from Oracle Directory" , cred : "{{ oci_adb_connection_tns }}" , file : "adb_oradir_remove_file.sql" , folder : "user_scripts/odbfcl/adb_load_expdp" , params : "'{{ dump_file_prefix }}.dmp'" } - - - name: Remove expdp from OCI Bucket - include_role: - name: oci_object_storage_object + + - include: tasks/local_sqlplus.yml vars: - oci_upload_file: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" - oci_object_name: "{{ oci_upload_file | basename }}" - oci_upload_bucket: "{{ oci_adb_bucket }}" - object_action: "remove" + sql_param : { task_action : "Remove logfile from Oracle Directory" , + cred : "{{ oci_adb_connection_tns }}" , + file : "adb_oradir_remove_file.sql" , + folder : "user_scripts/odbfcl/adb_load_expdp" , + params : "'{{ dump_file_prefix }}.log'" + } + + - name: Import error output + debug: msg="{{ shell_output.stderr_lines }}" + when: shell_output.rc != 0 + + - name: impdp error + fail: + msg: "Check {{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.log." + when: shell_output.rc != 0 and shell_output.rc != 5 + + - name: Check impdp error + shell: | + set -e +o pipefail + v_tot=$(cat "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.log" | grep 'ORA-' | grep -v 'ORA-39146' | wc -l) + if [ $v_tot -ne 0 ] + then + exit 1 + else + exit 0 + fi + when: shell_output.rc == 5 when: dump_stat_result.stat.exists \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/build_zip.sh b/user_scripts/odbfcl/sh_extractor/build_zip.sh index e8c213b..e9d8916 100644 --- a/user_scripts/odbfcl/sh_extractor/build_zip.sh +++ b/user_scripts/odbfcl/sh_extractor/build_zip.sh @@ -1,25 +1,26 @@ set -eo pipefail -mkdir exporter -cp -a ../extract/ exporter/ -cp -a ../createUser.sql exporter/ -cp -a ../tables_recreate.sql exporter/ -cp -a ../tables_create.sql exporter/ -cp -a ../../externalDir.sql exporter/ -cp -a *.sh *.sql exporter/ -# mv exporter/dumpCreate_forzip.sh exporter/dumpCreate.sh -sed '/^cd /d' exporter/dumpCreate.sh > exporter/dumpCreate.sh.tmp -mv exporter/dumpCreate.sh.tmp exporter/dumpCreate.sh -find exporter/ -name "*.yml" -delete -find exporter/ -name ".DS_Store" -delete -rm -f exporter/build_zip.sh -rm -f exporter.zip +v_folder_name="oradiff_exporter" +mkdir ${v_folder_name} +cp -a ../extract/ ${v_folder_name} +cp -a ../createUser.sql ${v_folder_name} +cp -a ../tables_recreate.sql ${v_folder_name} +cp -a ../tables_create.sql ${v_folder_name} +cp -a ../../externalDir.sql ${v_folder_name} +cp -a *.sh *.sql *.txt ${v_folder_name} +# mv ${v_folder_name}/dumpCreate_forzip.sh ${v_folder_name}/dumpCreate.sh +sed '/^cd /d' ${v_folder_name}/dumpCreate.sh > ${v_folder_name}/dumpCreate.sh.tmp +mv ${v_folder_name}/dumpCreate.sh.tmp ${v_folder_name}/dumpCreate.sh +find ${v_folder_name} -name "*.yml" -delete +find ${v_folder_name} -name ".DS_Store" -delete +rm -f ${v_folder_name}/build_zip.sh +rm -f ${v_folder_name}.zip # Put all files at the same stamp to create a deterministic zip. -find exporter/ -exec touch -t 202201010000 {} + +find ${v_folder_name} -exec touch -t 202201010000 {} + -zip -rmXD exporter.zip exporter/ -rmdir exporter/* -rmdir exporter/ +zip -rmXD ${v_folder_name}.zip ${v_folder_name} +rmdir ${v_folder_name}/* +rmdir ${v_folder_name} exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/exporter.sh b/user_scripts/odbfcl/sh_extractor/exporter.sh index df4c5e2..dc3a569 100644 --- a/user_scripts/odbfcl/sh_extractor/exporter.sh +++ b/user_scripts/odbfcl/sh_extractor/exporter.sh @@ -1,7 +1,7 @@ #!/bin/bash # Script to collect all info needed for ORAdiff # Created by Rodrigo Jorge -# v1.0.0.2 +# v1.0.0.3 set -eo pipefail From 739f8413cfd11e30f883689720a55c7d45edff4d Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 4 Aug 2022 14:21:06 -0300 Subject: [PATCH 068/229] Update .gitignore --- .gitignore | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 5b38ee3..65370db 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,11 @@ main.retry *.txt *.log /user_scripts/report/* -user_scripts/odbfcl/sh_extractor/exporter.zip -loader_labels.yml -tasks/main_loader_labels.yml -loader_labels.sh +user_scripts/odbfcl/sh_extractor/*.zip +config_oci_stg.yml +config_oci_prd.yml +config_oci_leg.yml +config_oci_dev.yml +tasks/main_loader_uploads.yml +tasks/main_loader_uploads.yml.old +loader_uploads.yml \ No newline at end of file From f5afc99a28f444600ff0acc41c007251bb61d63c Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 4 Aug 2022 18:36:04 -0300 Subject: [PATCH 069/229] Add logic to mark files as loaded --- tasks/impdp_file_adb.yml | 44 +++++++++++-------- tasks/patch_tasks_post.yml | 5 +++ .../adb_load_expdp/check_dump_file_loaded.yml | 8 ++++ .../adb_load_expdp/mark_dump_file_loaded.yml | 9 ++++ 4 files changed, 48 insertions(+), 18 deletions(-) create mode 100644 user_scripts/odbfcl/adb_load_expdp/check_dump_file_loaded.yml create mode 100644 user_scripts/odbfcl/adb_load_expdp/mark_dump_file_loaded.yml diff --git a/tasks/impdp_file_adb.yml b/tasks/impdp_file_adb.yml index 3650e53..a94788f 100644 --- a/tasks/impdp_file_adb.yml +++ b/tasks/impdp_file_adb.yml @@ -1,25 +1,33 @@ - name: "Processing {{ db_version }} {{ patch.type }} {{ patch.id }}" debug: msg="Processing {{ db_version }} {{ patch.type }} {{ patch.id }}" -# User custom pre-scripts +# This task will populate loaded_stat_result - include: run_script.yml - loop: "{{ user_impdp_pre | flatten(levels=1) }}" - loop_control: - loop_var: script_param - when: user_impdp_pre is defined + vars: + script_param: { file : "check_dump_file_loaded.yml" , folder : "user_scripts/odbfcl/adb_load_expdp" , type : "yml", task_action : "Check if file was already loaded" } -# The impdp loader are the same steps executed after the expdp -- include: run_script.yml - loop: "{{ user_expdp_post | flatten(levels=1) }}" - loop_control: - loop_var: script_param - when: user_expdp_post is defined +- block: -# User custom post-scripts -- include: run_script.yml - loop: "{{ user_impdp_post | flatten(levels=1) }}" - loop_control: - loop_var: script_param - when: user_impdp_post is defined + # User custom pre-scripts + - include: run_script.yml + loop: "{{ user_impdp_pre | flatten(levels=1) }}" + loop_control: + loop_var: script_param + when: user_impdp_pre is defined + + # The impdp loader are the same steps executed after the expdp + - include: run_script.yml + loop: "{{ user_expdp_post | flatten(levels=1) }}" + loop_control: + loop_var: script_param + when: user_expdp_post is defined + + # User custom post-scripts + - include: run_script.yml + loop: "{{ user_impdp_post | flatten(levels=1) }}" + loop_control: + loop_var: script_param + when: user_impdp_post is defined -# Skip all is true when dump file is already generated and skip_dump_exists is true at config. \ No newline at end of file + when: not loaded_stat_result.stat.exists + # Skip all is true when dump file is already generated and skip_dump_exists is true at config. diff --git a/tasks/patch_tasks_post.yml b/tasks/patch_tasks_post.yml index e897fe4..1739f43 100644 --- a/tasks/patch_tasks_post.yml +++ b/tasks/patch_tasks_post.yml @@ -21,6 +21,11 @@ state: absent path: "{{ shared_folder }}/{{ dump_file_prefix }}.log" + # This task will mark file as loaded + - include: run_script.yml + vars: + script_param: { file : "mark_dump_file_loaded.yml" , folder : "user_scripts/odbfcl/adb_load_expdp" , type : "yml", task_action : "Mark dpfile as loaded." } + when: not only_deploy_patch - name : Remove unzipped patch folder diff --git a/user_scripts/odbfcl/adb_load_expdp/check_dump_file_loaded.yml b/user_scripts/odbfcl/adb_load_expdp/check_dump_file_loaded.yml new file mode 100644 index 0000000..ce4f36f --- /dev/null +++ b/user_scripts/odbfcl/adb_load_expdp/check_dump_file_loaded.yml @@ -0,0 +1,8 @@ +- name : Define check filename + set_fact: + loaded_file_prefix: "tables_{{ db_version }}_{{ patch.base_ru | default('')}}{{ patch.type }}_{{ patch.id }}_loaded_{{ oci_adb_tns }}" + +- name: "Check if {{ output_folder }}/expdp/{{ loaded_file_prefix }} exists" + stat: + path: "{{ output_folder }}/expdp/{{ loaded_file_prefix }}" + register: loaded_stat_result \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_expdp/mark_dump_file_loaded.yml b/user_scripts/odbfcl/adb_load_expdp/mark_dump_file_loaded.yml new file mode 100644 index 0000000..fae68a5 --- /dev/null +++ b/user_scripts/odbfcl/adb_load_expdp/mark_dump_file_loaded.yml @@ -0,0 +1,9 @@ +- name : Define check filename + set_fact: + loaded_file_prefix: "tables_{{ db_version }}_{{ patch.base_ru | default('')}}{{ patch.type }}_{{ patch.id }}_loaded_{{ oci_adb_tns }}" + +- name: "Create {{ output_folder }}/expdp/{{ loaded_file_prefix }}." + shell: | + set -eo pipefail + touch {{ output_folder }}/expdp/{{ loaded_file_prefix }} + register: shell_output \ No newline at end of file From 96beb23423b5f75caf5cdbecd6b71b852dec6bde Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 18 Aug 2022 18:17:19 -0300 Subject: [PATCH 070/229] Small adjustments. --- tasks/impdp_file_adb.yml | 3 ++- user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tasks/impdp_file_adb.yml b/tasks/impdp_file_adb.yml index a94788f..c95a767 100644 --- a/tasks/impdp_file_adb.yml +++ b/tasks/impdp_file_adb.yml @@ -27,7 +27,8 @@ loop: "{{ user_impdp_post | flatten(levels=1) }}" loop_control: loop_var: script_param - when: user_impdp_post is defined + when: user_impdp_post is defined and dump_stat_result.stat.exists + # Won't execute user_impdp_post when no dumpfile to avoid marking file as processed. when: not loaded_stat_result.stat.exists # Skip all is true when dump file is already generated and skip_dump_exists is true at config. diff --git a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml index 95737f1..d8aba6c 100644 --- a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml +++ b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml @@ -58,7 +58,7 @@ # remap_schema='{{ dump_user_int }}:{{ oci_adb_transient_user }}' \ # parallel=16 \ # table_exists_action=truncate \ - # dumpfile={{ oci_adb_os_url_prefix }}/{{ dump_file_prefix }}.dmp > "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.log" 2>&1 + # dumpfile={{ oci_adb_os_url_prefix }}/{{ dump_file_prefix }}.dmp > "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.{{ oci_adb_tns }}.log" 2>&1 # register: shell_output - name: Import DB Tables @@ -71,7 +71,7 @@ table_exists_action=truncate \ content=data_only \ logfile={{ dump_file_prefix }}.log \ - dumpfile={{ dump_file_prefix }}.dmp > "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.log" 2>&1 + dumpfile={{ dump_file_prefix }}.dmp > "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.{{ oci_adb_tns }}.log" 2>&1 register: shell_output ignore_errors: yes @@ -99,13 +99,13 @@ - name: impdp error fail: - msg: "Check {{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.log." + msg: "Check {{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.{{ oci_adb_tns }}.log." when: shell_output.rc != 0 and shell_output.rc != 5 - name: Check impdp error shell: | set -e +o pipefail - v_tot=$(cat "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.log" | grep 'ORA-' | grep -v 'ORA-39146' | wc -l) + v_tot=$(cat "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.{{ oci_adb_tns }}.log" | grep 'ORA-' | grep -v 'ORA-39146' | wc -l) if [ $v_tot -ne 0 ] then exit 1 From 826adb957d0e2cd8c474fd30261e215a437551fb Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 22 Nov 2022 12:03:55 -0300 Subject: [PATCH 071/229] Add 23c and MRP support --- README.md | 4 +- list_exceptions.yml | 4 + list_patches.yml | 61 ++++- loader_adb.yml | 3 + main.yml | 7 +- .../tasks/main.yml | 1 + .../oci_object_storage_object/tasks/main.yml | 14 +- .../tasks/main.yml | 14 +- set_version.yml | 6 +- tasks/clean_ojvm_dumps.yml | 1 - tasks/config_checks.yml | 46 ++-- tasks/download_patch.yml | 1 - tasks/find_patch.yml | 23 +- tasks/impdp_file.yml | 2 - tasks/lvm_list.yml | 9 + tasks/main_PSU_BP.yml | 18 +- tasks/main_RU_RUR.yml | 41 ++- tasks/main_loader_adb.yml | 2 +- tasks/main_loader_manual.yml | 1 - tasks/patch_main.yml | 126 +++++---- tasks/patch_main_11g.yml | 13 +- tasks/patch_tasks_post.yml | 7 +- tasks/patch_tasks_pre.yml | 257 +++++++++++------- tasks/prepare_dependency.yml | 49 ++++ tasks/setup_database.yml | 31 ++- tasks/setup_env.yml | 2 +- tasks/setup_opatch.yml | 1 - user_scripts/gen/fileGet.yml | 2 - .../adb_load_expdp/mark_dump_file_loaded.yml | 1 - .../adb_load_symbols/adb_load_symbols.yml | 2 +- user_scripts/odbfcl/extract/bugsGet.yml | 1 - user_scripts/odbfcl/extract/fileGet.yml | 2 - user_scripts/odbfcl/extract/hashGet.sql | 5 +- user_scripts/odbfcl/extract/hashGet.yml | 2 +- user_scripts/odbfcl/extract/load_dba_cdb.sql | 9 +- .../load_underscore_23.0.0.0.sql | 6 + .../load_underscore_vv_23.0.0.0.sql | 6 + .../odbfcl/sh_extractor/dumpCreate.sh | 2 +- user_scripts/odbfcl/sh_extractor/exporter.sh | 2 +- user_scripts/odbfcl/tables_create.sql | 8 +- user_scripts/odbfcl/tables_recreate_adb.yml | 8 +- 41 files changed, 551 insertions(+), 249 deletions(-) create mode 100644 tasks/lvm_list.yml create mode 100644 tasks/prepare_dependency.yml create mode 100644 user_scripts/odbfcl/extract/underscore_parameters/load_underscore_23.0.0.0.sql create mode 100644 user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_23.0.0.0.sql diff --git a/README.md b/README.md index 535081d..01cd1fc 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Using VirtualBox VM snapshots, the playbook will loop over a list of the availab ## Available version ## -The playbook was tested and is currently working for all PSUs, OJVM PSUs, Bundle Patches, RUs or RURs for the following versions: +The playbook was tested and is currently working for all PSUs, OJVM PSUs, Bundle Patches, RUs, RURs and MRPs for the following versions: - 11.2.0.4 - 12.1.0.1 @@ -22,6 +22,8 @@ The playbook was tested and is currently working for all PSUs, OJVM PSUs, Bundle - 12.2.0.1 - 18 - 19 +- 21 +- 23 _P.S: For details of versions and patches that are processed, check list_versions.yml and list_patches.yml files._ diff --git a/list_exceptions.yml b/list_exceptions.yml index 6da31a1..9f39cf2 100644 --- a/list_exceptions.yml +++ b/list_exceptions.yml @@ -47,3 +47,7 @@ list_retry_datapatch: - { version: "12.2.0.1" , type : "RU" , id : 220118 , retries : 1 } - { version: "12.1.0.2" , type : "PSU" , id : 220419 , retries : 2 } - { version: "12.1.0.2" , type : "BP" , id : 220419 , retries : 2 } + - { version: "12.1.0.2" , type : "PSU" , id : 220719 , retries : 2 } + - { version: "12.1.0.2" , type : "BP" , id : 220719 , retries : 2 } + - { version: "12.1.0.2" , type : "PSU" , id : 221018 , retries : 2 } + - { version: "12.1.0.2" , type : "BP" , id : 221018 , retries : 3 } diff --git a/list_patches.yml b/list_patches.yml index 5ab7a97..7e4cff5 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -39,6 +39,8 @@ list_11204: - { type : "PSU" , id : 211019 , patch_number : 33128584 } - { type : "PSU" , id : 220118 , patch_number : 33477185 } - { type : "PSU" , id : 220419 , patch_number : 33711103 } + - { type : "PSU" , id : 220719 , patch_number : 34057724 } + - { type : "PSU" , id : 221018 , patch_number : 34386237 } - { type : "OJVM" , id : 1 , patch_number : 19282021 } - { type : "OJVM" , id : 2 , patch_number : 19877440 } - { type : "OJVM" , id : 3 , patch_number : 20406239 } @@ -64,12 +66,14 @@ list_11204: - { type : "OJVM" , id : 200414 , patch_number : 30805543 } - { type : "OJVM" , id : 200714 , patch_number : 31219953 } - { type : "OJVM" , id : 201020 , patch_number : 31668908 } -# - { type : "OJVM" , id : 210119 , patch_number : } +# - { type : "OJVM" , id : 210119 , patch_number : } # NOTHING TO FIX - NO PATCH CREATED - { type : "OJVM" , id : 210420 , patch_number : 32671980 } - { type : "OJVM" , id : 210720 , patch_number : 32876451 } - { type : "OJVM" , id : 211019 , patch_number : 33192642 } - { type : "OJVM" , id : 220118 , patch_number : 33561250 } - { type : "OJVM" , id : 220419 , patch_number : 33829826 } + - { type : "OJVM" , id : 220719 , patch_number : 34085652 } + - { type : "OJVM" , id : 221018 , patch_number : 34412266 } - { type : "BP" , id : 1 , patch_number : 17628025 , patch_folder : 17628006 } - { type : "BP" , id : 2 , patch_number : 17838803 , patch_folder : 17741631 } - { type : "BP" , id : 3 , patch_number : 17904156 , patch_folder : 17943261 } @@ -117,6 +121,8 @@ list_11204: - { type : "BP" , id : 211019 , patch_number : 33248386 , patch_folder : 33128587 } - { type : "BP" , id : 220118 , patch_number : 33575241 , patch_folder : 33477193 } - { type : "BP" , id : 220419 , patch_number : 33880541 , patch_folder : 33711121 } + - { type : "BP" , id : 220719 , patch_number : 34204546 , patch_folder : 34057719 } + - { type : "BP" , id : 221018 , patch_number : 34536785 , patch_folder : 34383800 } #################### @@ -188,6 +194,8 @@ list_12102: - { type : "PSU" , id : 211019 , patch_number : 33128590 } - { type : "PSU" , id : 220118 , patch_number : 33477199 } - { type : "PSU" , id : 220419 , patch_number : 33711081 } + - { type : "PSU" , id : 220719 , patch_number : 34057742 } + - { type : "PSU" , id : 221018 , patch_number : 34386266 } - { type : "OJVM" , id : 1 , patch_number : 19282028 } - { type : "OJVM" , id : 2 , patch_number : 19877336 } - { type : "OJVM" , id : 3 , patch_number : 20415564 } @@ -219,6 +227,8 @@ list_12102: - { type : "OJVM" , id : 211019 , patch_number : 33192628 } - { type : "OJVM" , id : 220118 , patch_number : 33561268 } - { type : "OJVM" , id : 220419 , patch_number : 33808385 } + - { type : "OJVM" , id : 220719 , patch_number : 34086863 } + - { type : "OJVM" , id : 221018 , patch_number : 34412250 } - { type : "BP" , id : 1 , patch_number : 19404326 , patch_folder : 19189240 } - { type : "BP" , id : 2 , patch_number : 19774304 , patch_folder : 19649591 } - { type : "BP" , id : 3 , patch_number : 20026159 , patch_folder : 19878106 } @@ -259,6 +269,8 @@ list_12102: - { type : "BP" , id : 211019 , patch_number : 33248411 , patch_folder : 33114885 } - { type : "BP" , id : 220118 , patch_number : 33575286 , patch_folder : 33465249 } - { type : "BP" , id : 220419 , patch_number : 33880550 , patch_folder : 33711072 } + - { type : "BP" , id : 220719 , patch_number : 34204559 , patch_folder : 34057733 } + - { type : "BP" , id : 221018 , patch_number : 34536908 , patch_folder : 34386250 } #################### ##### 12.2.0.1 ##### @@ -287,6 +299,9 @@ list_12201: - { type : "RU" , id : 210720 , patch_number : 32916808 } - { type : "RU" , id : 211019 , patch_number : 33261817 } - { type : "RU" , id : 220118 , patch_number : 33587128 } +# - { type : "RU" , id : 220419 , patch_number : 33878460 } # NOT AVAILABLE TO DOWNLOAD +# - { type : "RU" , id : 220719 , patch_number : 34219726 } # NOT AVAILABLE TO DOWNLOAD +# - { type : "RU" , id : 221018 , patch_number : 34518562 } # NOT AVAILABLE TO DOWNLOAD - { type : "RUR" , id : 171017 , patch_number : 26518812 , base_ru : JUL2017 } - { type : "RUR" , id : 180116 , patch_number : 27013506 , base_ru : JUL2017 } - { type : "RUR" , id : 180116 , patch_number : 27013510 , base_ru : OCT2017 } @@ -331,6 +346,9 @@ list_12201: - { type : "OJVM" , id : 210720 , patch_number : 32876409 } - { type : "OJVM" , id : 211019 , patch_number : 33192662 } - { type : "OJVM" , id : 220118 , patch_number : 33561275 } +# - { type : "OJVM" , id : 220419 , patch_number : 33829783 } # NOT AVAILABLE TO DOWNLOAD +# - { type : "OJVM" , id : 220719 , patch_number : 34086867 } # NOT AVAILABLE TO DOWNLOAD +# - { type : "OJVM" , id : 221018 , patch_number : 34412174 } # NOT AVAILABLE TO DOWNLOAD #################### ##### 18.0.0.0 ##### @@ -354,9 +372,14 @@ list_18000: - { type : "RU" , id : 12 , patch_number : 31730250 } - { type : "RU" , id : 13 , patch_number : 32204699 } - { type : "RU" , id : 14 , patch_number : 32524155 } +# - { type : "RU" , id : 15 , patch_number : 32907484 } # NOT AVAILABLE TO DOWNLOAD +# - { type : "RU" , id : 16 , patch_number : 33339024 } # NOT AVAILABLE TO DOWNLOAD - { type : "RU" , id : 17 , patch_number : 33583960 } - # - { type : "RUR" , id : 1 , patch_number : 28346593 , base_ru : '18.2' } - # - { type : "RUR" , id : 2 , patch_number : 28601267 , base_ru : '18.2' } +# - { type : "RU" , id : 18 , patch_number : 33878468 } # NOT AVAILABLE TO DOWNLOAD +# - { type : "RU" , id : 19 , patch_number : 34219743 } # NOT AVAILABLE TO DOWNLOAD +# - { type : "RU" , id : 20 , patch_number : 34518577 } # NOT AVAILABLE TO DOWNLOAD +# - { type : "RUR" , id : 1 , patch_number : 28346593 , base_ru : '18.2' } +# - { type : "RUR" , id : 2 , patch_number : 28601267 , base_ru : '18.2' } - { type : "RUR" , id : 1 , patch_number : 28507480 , base_ru : '18.3' } - { type : "RUR" , id : 2 , patch_number : 28790643 , base_ru : '18.3' } - { type : "RUR" , id : 1 , patch_number : 28822587 , base_ru : '18.4' } @@ -391,7 +414,13 @@ list_18000: - { type : "OJVM" , id : 201020 , patch_number : 31668892 } - { type : "OJVM" , id : 210119 , patch_number : 32119939 } - { type : "OJVM" , id : 210420 , patch_number : 32552752 } +# - { type : "OJVM" , id : 210720 , patch_number : 32876373 } # NOT AVAILABLE TO DOWNLOAD +# - { type : "OJVM" , id : 211019 , patch_number : 33192684 } # NOT AVAILABLE TO DOWNLOAD - { type : "OJVM" , id : 220118 , patch_number : 33549631 } +# - { type : "OJVM" , id : 220419 , patch_number : 33829896 } # NOT AVAILABLE TO DOWNLOAD +# - { type : "OJVM" , id : 220719 , patch_number : 34086894 } # NOT AVAILABLE TO DOWNLOAD +# - { type : "OJVM" , id : 221018 , patch_number : 34411878 } # NOT AVAILABLE TO DOWNLOAD + # No more updates on this one. @@ -415,6 +444,8 @@ list_19000: - { type : "RU" , id : 13 , patch_number : 33192793 } - { type : "RU" , id : 14 , patch_number : 33515361 } - { type : "RU" , id : 15 , patch_number : 33806152 } + - { type : "RU" , id : 16 , patch_number : 34133642 } + - { type : "RU" , id : 17 , patch_number : 34419443 } - { type : "RUR" , id : 1 , patch_number : 29799057 , base_ru : '19.3' } - { type : "RUR" , id : 2 , patch_number : 30087906 , base_ru : '19.3' } - { type : "RUR" , id : 1 , patch_number : 30080447 , base_ru : '19.4' } @@ -439,6 +470,11 @@ list_19000: - { type : "RUR" , id : 1 , patch_number : 33516456 , base_ru : '19.13' } - { type : "RUR" , id : 2 , patch_number : 33783771 , base_ru : '19.13' } - { type : "RUR" , id : 1 , patch_number : 33806138 , base_ru : '19.14' } + - { type : "RUR" , id : 2 , patch_number : 34110559 , base_ru : '19.14' } + - { type : "RUR" , id : 1 , patch_number : 34119532 , base_ru : '19.15' } + - { type : "RUR" , id : 2 , patch_number : 34429835 , base_ru : '19.15' } + - { type : "RUR" , id : 1 , patch_number : 34444812 , base_ru : '19.16' } + - { type : "MRP" , id : 221115 , patch_number : 34737974 , base_ru : '19.17' , dep_type : 'RU' , dep_id : 17 , apply_method : "opatchauto" } - { type : "OJVM" , id : 190416 , patch_number : 29548437 } - { type : "OJVM" , id : 190716 , patch_number : 29774421 } - { type : "OJVM" , id : 191015 , patch_number : 30128191 } @@ -449,9 +485,11 @@ list_19000: - { type : "OJVM" , id : 210119 , patch_number : 32067171 } - { type : "OJVM" , id : 210420 , patch_number : 32399816 } - { type : "OJVM" , id : 210720 , patch_number : 32876380 } - - { type : "OJVM" , id : 211019 , patch_number : 33192694 } - - { type : "OJVM" , id : 220118 , patch_number : 33561310 } - - { type : "OJVM" , id : 220419 , patch_number : 33808367 } + - { type : "OJVM" , id : 211019 , patch_number : 33192694 } + - { type : "OJVM" , id : 220118 , patch_number : 33561310 } + - { type : "OJVM" , id : 220419 , patch_number : 33808367 } + - { type : "OJVM" , id : 220719 , patch_number : 34086870 } + - { type : "OJVM" , id : 221018 , patch_number : 34411846 } #################### ##### 21.0.0.0 ##### @@ -461,4 +499,13 @@ list_21000: #- { type : "RU" , id : 3 , patch_number : 00000000 , base_snap : "21.2.0" } - { type : "RU" , id : 4 , patch_number : 33239276 } - { type : "RU" , id : 5 , patch_number : 33516412 } - - { type : "RU" , id : 6 , patch_number : 33843745 } \ No newline at end of file + - { type : "RU" , id : 6 , patch_number : 33843745 } + - { type : "RU" , id : 7 , patch_number : 34160444 } + - { type : "RU" , id : 8 , patch_number : 34527084 } + +#################### +##### 23.0.0.0 ##### +#################### + +list_23000: + - { type : "RU" , id : 3 , patch_number : 00000000 , base_snap : "23.2.0" } \ No newline at end of file diff --git a/loader_adb.yml b/loader_adb.yml index de023cb..b07ffed 100644 --- a/loader_adb.yml +++ b/loader_adb.yml @@ -55,3 +55,6 @@ - include: tasks/main_loader_adb.yml db_version="21.0.0.0" when: param_version is undefined or param_version == "21.0.0.0" + + - include: tasks/main_loader_adb.yml db_version="23.0.0.0" + when: param_version is undefined or param_version == "23.0.0.0" diff --git a/main.yml b/main.yml index c42b217..7981a51 100644 --- a/main.yml +++ b/main.yml @@ -33,10 +33,10 @@ tasks: - include_vars: config_vbox.yml - when: oci_mode == false + when: not oci_mode - include_vars: config_oci.yml - when: oci_mode == true + when: oci_mode - import_tasks: tasks/config_checks.yml - import_tasks: tasks/setup_env.yml @@ -61,3 +61,6 @@ - include: tasks/main_RU_RUR.yml db_version="21.0.0.0" when: param_version is undefined or param_version == "21.0.0.0" + + - include: tasks/main_RU_RUR.yml db_version="23.0.0.0" + when: param_version is undefined or param_version == "23.0.0.0" diff --git a/roles/oci_compute_instance_actions/tasks/main.yml b/roles/oci_compute_instance_actions/tasks/main.yml index d80ef99..e4ab524 100644 --- a/roles/oci_compute_instance_actions/tasks/main.yml +++ b/roles/oci_compute_instance_actions/tasks/main.yml @@ -16,6 +16,7 @@ oci_network_vnic_facts: id: "{{ result.vnic_attachments[0].vnic_id }}" register: result + - set_fact: vm_ip_address: "{{result.vnic.private_ip}}" diff --git a/roles/oci_object_storage_object/tasks/main.yml b/roles/oci_object_storage_object/tasks/main.yml index 963c9b1..9717d1e 100644 --- a/roles/oci_object_storage_object/tasks/main.yml +++ b/roles/oci_object_storage_object/tasks/main.yml @@ -5,14 +5,22 @@ object_name: "{{ oci_object_name }}" src: "{{ oci_upload_file }}" state: present - register: oci_action + register: tmp_oci_action_result when: object_action == "create" +# Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" +- set_fact: oci_action="{{tmp_oci_action_result}}" + when: tmp_oci_action_result is not skipped + - name: Remove file from object storage oci_object_storage_object: namespace_name: "{{ oci_namespace }}" bucket_name: "{{ oci_upload_bucket }}" object_name: "{{ oci_object_name }}" state: absent - register: oci_action - when: object_action == "remove" \ No newline at end of file + register: tmp_oci_action_result + when: object_action == "remove" + +# Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" +- set_fact: oci_action="{{tmp_oci_action_result}}" + when: tmp_oci_action_result is not skipped diff --git a/roles/oci_object_storage_object_facts/tasks/main.yml b/roles/oci_object_storage_object_facts/tasks/main.yml index bb19036..56a1008 100644 --- a/roles/oci_object_storage_object_facts/tasks/main.yml +++ b/roles/oci_object_storage_object_facts/tasks/main.yml @@ -5,12 +5,20 @@ object_name: "{{ oci_download_file }}" auth_type: instance_principal dest: "{{ oci_dest_file }}" - register: oci_action + register: tmp_oci_action_result when: object_action == "download" +# Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" +- set_fact: oci_action="{{tmp_oci_action_result}}" + when: tmp_oci_action_result is not skipped + - name: List files from object storage oci_object_storage_object_facts: namespace_name: "{{ oci_namespace }}" bucket_name: "{{ oci_list_bucket }}" - register: oci_action - when: object_action == "list" \ No newline at end of file + register: tmp_oci_action_result + when: object_action == "list" + +# Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" +- set_fact: oci_action="{{tmp_oci_action_result}}" + when: tmp_oci_action_result is not skipped diff --git a/set_version.yml b/set_version.yml index 27c29c7..a2f756d 100644 --- a/set_version.yml +++ b/set_version.yml @@ -33,10 +33,10 @@ tasks: - include_vars: config_vbox.yml - when: oci_mode == false + when: not oci_mode - include_vars: config_oci.yml - when: oci_mode == true + when: oci_mode - import_tasks: tasks/setup_env.yml @@ -54,4 +54,4 @@ when: param_version == "11.2.0.4" or param_version == "12.1.0.1" or param_version == "12.1.0.2" - include: tasks/main_RU_RUR.yml db_version="{{ param_version }}" - when: param_version == "12.2.0.1" or param_version == "18.0.0.0" or param_version == "19.0.0.0" + when: not(param_version == "11.2.0.4" or param_version == "12.1.0.1" or param_version == "12.1.0.2") diff --git a/tasks/clean_ojvm_dumps.yml b/tasks/clean_ojvm_dumps.yml index 6d12376..16e131a 100644 --- a/tasks/clean_ojvm_dumps.yml +++ b/tasks/clean_ojvm_dumps.yml @@ -20,4 +20,3 @@ # rm -f ${v_ojvm_path}/${v_ojvm_pref}_* echo "{{ base_id }}" > "${v_ojvm_base_file}" fi - register: shell_output \ No newline at end of file diff --git a/tasks/config_checks.yml b/tasks/config_checks.yml index f6c3742..26f031f 100644 --- a/tasks/config_checks.yml +++ b/tasks/config_checks.yml @@ -1,28 +1,32 @@ -- name: Variable downloader_tool not provided - fail: - msg: "Variable downloader_tool must be defined when download_patch is true." - when: download_patch == true and ( downloader_tool is undefined or (downloader_tool|length == 0)) +- block: + # download_patch == true -- name: Variable downloader_user not provided - fail: - msg: "Variable downloader_user must be defined when download_patch is true." - when: download_patch == true and ( downloader_user is undefined or (downloader_user|length == 0)) + - name: Variable downloader_tool not provided + fail: + msg: "Variable downloader_tool must be defined when download_patch is true." + when: downloader_tool is undefined or (downloader_tool|length == 0) -- name: Variable downloader_pass not provided - fail: - msg: "Variable downloader_pass must be defined when download_patch is true." - when: download_patch == true and ( downloader_pass is undefined or (downloader_pass|length == 0)) + - name: Variable downloader_user not provided + fail: + msg: "Variable downloader_user must be defined when download_patch is true." + when: downloader_user is undefined or (downloader_user|length == 0) -- name: "Check if {{ downloader_tool }} exists" - stat: - path: "{{ downloader_tool }}" - register: downloader_tool_result - when: download_patch == true + - name: Variable downloader_pass not provided + fail: + msg: "Variable downloader_pass must be defined when download_patch is true." + when: downloader_pass is undefined or (downloader_pass|length == 0) -- name: Tool does not exist - fail: - msg: "{{ downloader_tool }} must exist when download_patch is true." - when: download_patch == true and downloader_tool_result.stat.exists == false + - name: "Check if {{ downloader_tool }} exists" + stat: + path: "{{ downloader_tool }}" + register: downloader_tool_result + + - name: Tool does not exist + fail: + msg: "{{ downloader_tool }} must exist when download_patch is true." + when: downloader_tool_result.stat.exists == false + + when: download_patch == true - name: Check patch_location_type variable fail: diff --git a/tasks/download_patch.yml b/tasks/download_patch.yml index ae493a3..3c4f31d 100644 --- a/tasks/download_patch.yml +++ b/tasks/download_patch.yml @@ -26,7 +26,6 @@ MOSPass='{{ downloader_pass }}' args: chdir: "{{ patch_location_path }}" - register: shell_output # If block storage: - block: diff --git a/tasks/find_patch.yml b/tasks/find_patch.yml index e9015f1..58bf7e8 100644 --- a/tasks/find_patch.yml +++ b/tasks/find_patch.yml @@ -19,7 +19,6 @@ export LC_ALL=C.UTF-8 export LANG=C.UTF-8 oci os object get --bucket-name {{ patch_location_bucket }} --name {{ oci_download_file }} --file {{ patch_location_path }}/{{ oci_download_file | basename }} - register: shoutput vars: my_query: "p{{ patch.patch_number }}" oci_download_file: "{{ oci_action.objects | map(attribute='name') | select('search', my_query) | list | first }}" @@ -33,9 +32,27 @@ patterns: "p{{ patch.patch_number }}_{{ db_version | regex_replace('\\.','') }}0_Linux-x86-64.zip" recurse: "yes" file_type: "file" - register: find_result + register: tmp_find_result + when: patch.type != "MRP" + +# Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" +- set_fact: find_result="{{tmp_find_result}}" + when: tmp_find_result is not skipped + +- name: Finding Patch File + find: + paths: "{{ patch_location_path }}" + patterns: "p{{ patch.patch_number }}_*DBRU_Linux-x86-64.zip" + recurse: "yes" + file_type: "file" + register: tmp_find_result + when: patch.type == "MRP" + +# Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" +- set_fact: find_result="{{tmp_find_result}}" + when: tmp_find_result is not skipped - name : Define patch_file_path set_fact: patch_file_path: "{{ find_result.files[0].path }}" - when: find_result.files[0] is defined \ No newline at end of file + when: find_result.files[0] is defined diff --git a/tasks/impdp_file.yml b/tasks/impdp_file.yml index be4eca3..29dcabc 100644 --- a/tasks/impdp_file.yml +++ b/tasks/impdp_file.yml @@ -25,7 +25,6 @@ environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" - register: sqloutput become: true become_user: oracle delegate_to: "{{ vm_ip_address }}" @@ -37,7 +36,6 @@ environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" - register: sqloutput become: true become_user: oracle delegate_to: "{{ vm_ip_address }}" diff --git a/tasks/lvm_list.yml b/tasks/lvm_list.yml new file mode 100644 index 0000000..06d628b --- /dev/null +++ b/tasks/lvm_list.yml @@ -0,0 +1,9 @@ +## This code will list all the logical volumes on the VM. + +- name: "Get LVM list." + shell: | + lvs --noheadings -o lv_name + become: true + become_user: root + delegate_to: "{{ vm_ip_address }}" + register: lvs_output \ No newline at end of file diff --git a/tasks/main_PSU_BP.yml b/tasks/main_PSU_BP.yml index 0aa97f8..dbb04d0 100644 --- a/tasks/main_PSU_BP.yml +++ b/tasks/main_PSU_BP.yml @@ -14,14 +14,14 @@ vm_ip_address: "{{ item.ip }}" patch_base: "{{ item.base_snap }}" with_items: "{{ list_info_vbox }}" - when: item.id == db_version and oci_mode == false + when: item.id == db_version and not oci_mode - name : Define Cloud params set_fact: oci_instance_id: "{{ item.oci_instance_id }}" patch_base: "{{ item.base_snap }}" with_items: "{{ list_info_oci }}" - when: item.id == db_version and oci_mode == true + when: item.id == db_version and oci_mode # reload is called before every patch is applied to rollback the VM to the snapshot image. - name : Define snapshot base version to rollback when reload is called. @@ -72,23 +72,23 @@ set_fact: vm_snapshot: "{{ db_version }} PSU {{ latest_psu_id }}" latest_psu_line: "{{ db_version }}.PSU.{{ latest_psu_id }}" - when: oci_mode == false + when: not oci_mode - name : Generate Snapshot Name - LVM Mode set_fact: vm_snapshot: "PSU_{{ latest_psu_id }}" latest_psu_line: "{{ db_version }}.PSU.{{ latest_psu_id }}" - when: oci_mode == true + when: oci_mode - name: "Latest PSU" debug: msg="Latest PSU ID - {{ latest_psu_line }}" # Save lastest PSU as a new snapshot - Also changes vm_snapshot variable to it (for OJVM). - include: vbox_savestate.yml - when: latest_psu_line == latest_processed and oci_mode == false + when: latest_psu_line == latest_processed and not oci_mode - include: lvm_savestate.yml - when: latest_psu_line == latest_processed and oci_mode == true + when: latest_psu_line == latest_processed and oci_mode - include: clean_ojvm_dumps.yml base_id="PSU_{{ latest_psu_id }}" @@ -107,12 +107,12 @@ - name : Generate Snapshot Name - VBox Mode set_fact: vm_snapshot: "{{ db_version }} PSU {{ latest_psu_id }}" - when: oci_mode == false + when: not oci_mode - name : Generate Snapshot Name - LVM Mode set_fact: vm_snapshot: "PSU_{{ latest_psu_id }}" - when: oci_mode == true + when: oci_mode - name: "Base Snapshot will be {{ vm_snapshot }}" debug: msg="Base Snapshot will be {{ vm_snapshot }}" @@ -179,4 +179,4 @@ name: oci_compute_instance_actions vars: compute_action: stop - when: oci_mode == true and not only_deploy_patch and database_started \ No newline at end of file + when: oci_mode and not only_deploy_patch and database_started \ No newline at end of file diff --git a/tasks/main_RU_RUR.yml b/tasks/main_RU_RUR.yml index 1675ab7..eb36cb9 100644 --- a/tasks/main_RU_RUR.yml +++ b/tasks/main_RU_RUR.yml @@ -1,4 +1,4 @@ -### Will Run RU + OJVM + RUR for given version +### Will Run RU + OJVM + RUR + MRP for given version - name : Define version set_fact: @@ -14,7 +14,7 @@ vm_ip_address: "{{ item.ip }}" patch_base: "{{ item.base_snap }}" with_items: "{{ list_info_vbox }}" - when: item.id == db_version and oci_mode == false + when: item.id == db_version and not oci_mode - name : Define Cloud params set_fact: @@ -22,7 +22,7 @@ patch_base: "{{ item.base_snap }}" out_of_box_ru: "{{ item.out_of_box_ru | default(0) }}" with_items: "{{ list_info_oci }}" - when: item.id == db_version and oci_mode == true + when: item.id == db_version and oci_mode # reload is called before every patch is applied to rollback the VM to the snapshot image. - name : Define snapshot base version to rollback when reload is called. @@ -74,23 +74,23 @@ set_fact: vm_snapshot: "{{ db_version }} RU {{ latest_RU_id }}" latest_RU_line: "{{ db_version }}.RU.{{ latest_RU_id }}" - when: oci_mode == false + when: not oci_mode - name : Generate Snapshot Name - LVM Mode set_fact: vm_snapshot: "RU_{{ latest_RU_id }}" latest_RU_line: "{{ db_version }}.RU.{{ latest_RU_id }}" - when: oci_mode == true + when: oci_mode - name: "Latest RU" debug: msg="Latest RU ID - {{ latest_RU_line }}" # Save lastest RU as a new snapshot - Also changes vm_snapshot variable to it (for OJVM). - include: vbox_savestate.yml - when: latest_RU_line == latest_processed and oci_mode == false + when: latest_RU_line == latest_processed and not oci_mode - include: lvm_savestate.yml - when: latest_RU_line == latest_processed and oci_mode == true + when: latest_RU_line == latest_processed and oci_mode - include: clean_ojvm_dumps.yml base_id="RU_{{ latest_RU_id }}" @@ -109,12 +109,12 @@ - name : Generate Snapshot Name - VBox Mode set_fact: vm_snapshot: "{{ db_version }} RU {{ latest_RU_id }}" - when: oci_mode == false + when: not oci_mode - name : Generate Snapshot Name - LVM Mode set_fact: vm_snapshot: "RU_{{ latest_RU_id }}" - when: oci_mode == true + when: oci_mode - name: "Base Snapshot will be {{ vm_snapshot }}" debug: msg="Base Snapshot will be {{ vm_snapshot }}" @@ -159,10 +159,31 @@ when: param_type is undefined or param_type == "RUR" +### MRP +- block: + + - name : Define snapshot base version to rollback when reload is called. + set_fact: + vm_snapshot: "{{ patch_base }}" + + # Execute for every MRP + - include: "{{ patch_file }}" + loop: "{{ lookup('vars', patch_list) | flatten(levels=1) }}" + loop_control: + loop_var: patch + label: "{{ patch.id }}" + when: + - patch.type == "MRP" + - patch.id == (param_patch | int) or param_patch == -1 + - patch.id >= (param_patch_from | int) or param_patch_from == -1 + - patch.id <= (param_patch_to | int) or param_patch_to == -1 + + when: param_type is undefined or param_type == "MRP" + # Stop OCI VM - name: Call role to stop OCI VM include_role: name: oci_compute_instance_actions vars: compute_action: stop - when: oci_mode == true and not only_deploy_patch and database_started \ No newline at end of file + when: oci_mode and not only_deploy_patch and database_started \ No newline at end of file diff --git a/tasks/main_loader_adb.yml b/tasks/main_loader_adb.yml index 380d137..508f882 100644 --- a/tasks/main_loader_adb.yml +++ b/tasks/main_loader_adb.yml @@ -70,7 +70,7 @@ ############################### -# Execute for every PSU / BP / OJVM / RU / RUR +# Execute for every PSU / BP / OJVM / RU / RUR / MRP - include: "impdp_file_adb.yml" loop: "{{ lookup('vars', patch_list) | flatten(levels=1) }}" loop_control: diff --git a/tasks/main_loader_manual.yml b/tasks/main_loader_manual.yml index 41a7e94..633c443 100644 --- a/tasks/main_loader_manual.yml +++ b/tasks/main_loader_manual.yml @@ -50,7 +50,6 @@ export LC_ALL=C.UTF-8 export LANG=C.UTF-8 oci os object get --bucket-name {{ input_bucket }} --name {{ input_file }} --file {{ output_folder }}/{{ input_file_name }} - register: shoutput when: not (input_bucket is undefined or (input_bucket|length == 0)) - name: Move file to folder diff --git a/tasks/patch_main.yml b/tasks/patch_main.yml index 5c0c423..5340fbe 100644 --- a/tasks/patch_main.yml +++ b/tasks/patch_main.yml @@ -3,65 +3,98 @@ - block: - # Stop the database - - include: run_sql.yml - vars: - sql_param : { file : "shutdown.sql" , folder : "patch_sql" , task_action : "Stop Database for OPatch" } - when: oci_mode == false - - - name: Run OPatch - shell: | - export ORACLE_HOME ORACLE_SID - ./opatch apply -silent {{ VM_folder }}/{{ patch.patch_number }} - environment: - ORACLE_HOME: "{{ dbhome_locl }}" - ORACLE_SID: "{{ mysid }}" - args: - chdir: "{{ dbhome_locl }}/OPatch" - register: shell_output - become: true - become_user: oracle - when: patch.patch_number != 0 - delegate_to: "{{ vm_ip_address }}" - - - name: Opatch Output - debug: msg="{{ shell_output.stdout_lines }}" - when: shell_output.stdout_lines is defined + # If needs to perform patch actions + - block: - # Start the database - - include: run_sql.yml - vars: - sql_param : { file : "startupCDB.sql" , folder : "patch_sql" , task_action : "Start Database for sqlpatch" } - when: patch.type != "OJVM" + # Stop the database + - include: run_sql.yml + vars: + sql_param : { file : "shutdown.sql" , folder : "patch_sql" , task_action : "Stop Database for OPatch" } + when: not oci_mode - # Start the database (in OJVM, it must be in upgrade mode) - - include: run_sql.yml - vars: - sql_param : { file : "startupCDBOJVM.sql" , folder : "patch_sql" , task_action : "Start Database for OJVM sqlpatch" } - when: patch.type == "OJVM" + - name: Run OPatch/opatch + shell: | + export ORACLE_HOME ORACLE_SID + ./opatch apply -silent {{ VM_folder }}/{{ patch.patch_number }} OPatch.SKIP_VERIFY_SPACE=true + environment: + ORACLE_HOME: "{{ dbhome_locl }}" + ORACLE_SID: "{{ mysid }}" + args: + chdir: "{{ dbhome_locl }}/OPatch" + register: tmp_shell_output + become: true + become_user: oracle + when: patch.apply_method is not defined or patch.apply_method != "opatchauto" + delegate_to: "{{ vm_ip_address }}" - # Run Datapatch - - name: Set datapatch try variable - set_fact: datapatch_try=0 + # Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" + - set_fact: shell_output="{{tmp_shell_output}}" + when: tmp_shell_output is not skipped - - name: Run Datapatch - include: datapatch.yml - when: patch.patch_number != 0 + - name: Run OPatch/opatchauto + shell: | + export ORACLE_HOME ORACLE_SID + ./opatchauto apply -binary {{ VM_folder }}/{{ patch.patch_number }} -oh $ORACLE_HOME -target_type oracle_database + environment: + ORACLE_HOME: "{{ dbhome_locl }}" + ORACLE_SID: "{{ mysid }}" + args: + chdir: "{{ dbhome_locl }}/OPatch" + register: tmp_shell_output + become: true + become_user: oracle + when: patch.apply_method is defined and patch.apply_method == "opatchauto" + delegate_to: "{{ vm_ip_address }}" - # Evaluate if it's needed to reexecute datapatch on 12.1.1 due to bug. + # Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" + - set_fact: shell_output="{{tmp_shell_output}}" + when: tmp_shell_output is not skipped - # Bounce instance on OJVM to remove "upgrade" mode - - block: + - name: Opatch Output + debug: msg="{{ shell_output.stdout_lines }}" + when: shell_output.stdout_lines is defined + # Start the database - include: run_sql.yml vars: - sql_param : { file : "shutdown.sql" , folder : "patch_sql" , task_action : "Stop Database" } + sql_param : { file : "startupCDB.sql" , folder : "patch_sql" , task_action : "Start Database for sqlpatch" } + when: patch.type != "OJVM" + # Start the database (in OJVM, it must be in upgrade mode) - include: run_sql.yml vars: - sql_param : { file : "startupCDB.sql" , folder : "patch_sql" , task_action : "Start Database" } + sql_param : { file : "startupCDBOJVM.sql" , folder : "patch_sql" , task_action : "Start Database for OJVM sqlpatch" } + when: patch.type == "OJVM" + + # Run Datapatch + - name: Set datapatch try variable + set_fact: datapatch_try=0 + + - name: Run Datapatch + include: datapatch.yml - when: patch.type == "OJVM" + # Evaluate if it's needed to reexecute datapatch on 12.1.1 due to bug. + + # Bounce instance on OJVM to remove "upgrade" mode + - block: + + - include: run_sql.yml + vars: + sql_param : { file : "shutdown.sql" , folder : "patch_sql" , task_action : "Stop Database" } + + - include: run_sql.yml + vars: + sql_param : { file : "startupCDB.sql" , folder : "patch_sql" , task_action : "Start Database" } + + when: patch.type == "OJVM" + + when: perform_patch_actions + + # Start the database + - include: run_sql.yml + vars: + sql_param : { file : "startupCDB.sql" , folder : "patch_sql" , task_action : "Start Database for expdp" } + when: not only_deploy_patch and not perform_patch_actions # We only start the DB if not started on prev the block and needed for the next. # When only_deploy_patch is false (most common case) - block: @@ -83,7 +116,6 @@ environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" - register: shell_output become: true become_user: oracle delegate_to: "{{ vm_ip_address }}" diff --git a/tasks/patch_main_11g.yml b/tasks/patch_main_11g.yml index 825bf0e..73f1aeb 100644 --- a/tasks/patch_main_11g.yml +++ b/tasks/patch_main_11g.yml @@ -34,11 +34,10 @@ environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" - register: shell_output become: true become_user: oracle delegate_to: "{{ vm_ip_address }}" - when: dbvault_enabled == true + when: dbvault_enabled # Start the database - include: run_sql.yml @@ -81,7 +80,7 @@ - include: run_sql.yml vars: sql_param : { file : "shutdown.sql" , folder : "patch_sql" , task_action : "Stop Database to re-enable DB Vault" } - when: dbvault_enabled == true + when: dbvault_enabled - name: Enable Database Vault shell: | @@ -89,19 +88,18 @@ environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" - register: shell_output become: true become_user: oracle delegate_to: "{{ vm_ip_address }}" - when: dbvault_enabled == true + when: dbvault_enabled - when: patch.patch_number != 0 + when: perform_patch_actions # This start is only required if database was never stopped. - include: run_sql.yml vars: sql_param : { file : "startup.sql" , folder : "patch_sql" , task_action : "Start Database" } - when: patch.patch_number == 0 or (patch.patch_number != 0 and dbvault_enabled == true) + when: not perform_patch_actions or (perform_patch_actions and dbvault_enabled) # When only_deploy_patch is false (most common case) - block: @@ -119,7 +117,6 @@ environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" - register: shell_output become: true become_user: oracle delegate_to: "{{ vm_ip_address }}" diff --git a/tasks/patch_tasks_post.yml b/tasks/patch_tasks_post.yml index 1739f43..8680e5e 100644 --- a/tasks/patch_tasks_post.yml +++ b/tasks/patch_tasks_post.yml @@ -32,19 +32,20 @@ file: state: absent path: "{{ unzip_patch_folder }}" - when: patch.patch_number != 0 + when: perform_patch_actions +# Here I don't check for perform_patch_actions as in some cases (like for LVM image usage) the patch will still be downloaded. - name: Remove file downloaded from OCI Bucket file: state: absent path: "{{ db_patch }}" - when: patch_location_type == "bucket" and db_patch is defined + when: patch_location_type == "bucket" and db_patch != "" - name : Remove PatchSearch.xml file: state: absent path: "{{ shared_folder }}/PatchSearch.xml" - when: patch.patch_number != 0 + when: perform_patch_actions - name : Define latest processed set_fact: diff --git a/tasks/patch_tasks_pre.yml b/tasks/patch_tasks_pre.yml index 461f068..dee0d3c 100644 --- a/tasks/patch_tasks_pre.yml +++ b/tasks/patch_tasks_pre.yml @@ -8,80 +8,157 @@ fix_datapatch_retries: 0 expdp_version: "" patch_file_path: "" + db_patch: "" + perform_patch_actions: true # If opatch / datapatch / patch download / etc are needed or not. -# Ignore dumpfile checks when only_deploy_patch is true +# Immediatly stop when skip_all becomes true - block: - - name: "Check if {{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp exists" - stat: - path: "{{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp" - register: dump_stat_result - - # Will skip all the rest if the dump file exists - - name : Define skip_all + # Skip patch actions + - name: Base Release will skip patch actions set_fact: - skip_all: "{{ dump_stat_result.stat.exists }}" - when: skip_dump_exists + perform_patch_actions: false + when: patch.patch_number == 0 - - name : Remove dump file if exists - file: - state: absent - path: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" - when: not skip_all + # Ignore dumpfile checks when only_deploy_patch is true + - block: - when: not only_deploy_patch + - name: "Check if {{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp exists" + stat: + path: "{{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp" + register: dump_stat_result -# Check if patch will need to reexecute datapatch -- name : Check datapatch reexecution - set_fact: - fix_datapatch_retries: "{{ err_list.retries }}" - loop: "{{ list_retry_datapatch | flatten(levels=1) }}" - loop_control: - loop_var: err_list - when: - - err_list.version == db_version - - err_list.type == patch.type - - err_list.id == patch.id - -# When not processing base release. i.e patch.patch_number != 0 -- block: + # Will skip all the rest if the dump file exists + - name : Define skip_all + set_fact: + skip_all: "{{ dump_stat_result.stat.exists }}" + when: skip_dump_exists - # Place patch file on the shared folder - - name: Finding Patch File - include: find_patch.yml + - name : Remove dump file if exists + file: + state: absent + path: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" - # Call downloader when download_patch is defined and could not find the patch - - block: + when: not only_deploy_patch - - name: Call downloader - include: download_patch.yml + # Check if patch will need to reexecute datapatch + - name : Check datapatch reexecution + set_fact: + fix_datapatch_retries: "{{ err_list.retries }}" + loop: "{{ list_retry_datapatch | flatten(levels=1) }}" + loop_control: + loop_var: err_list + when: + - err_list.version == db_version + - err_list.type == patch.type + - err_list.id == patch.id + + # When processing processing something, or perform_patch_actions = true + - block: - # Try again after downloader was called - - name: Finding Patch File Again + # Place patch file on the shared folder + - name: Finding Patch File include: find_patch.yml - when: (patch_file_path|length == 0) and download_patch + # Call downloader when download_patch is defined and could not find the patch (patch_file_path|length == 0) + - block: - # If still can't find the patch but ignore flag is set, jump to the next. - - name : Patch is not there, but ignoring... - set_fact: - skip_all: true - when: (patch_file_path|length == 0) and error_on_no_patch == false + - name: Call downloader + include: download_patch.yml - - block: + # Try again after downloader was called + - name: Finding Patch File Again + include: find_patch.yml + + when: (patch_file_path|length == 0) and download_patch - - fail: - msg: "Could not find patch file. Check if patch folder is correct." - when: (patch_file_path|length == 0) + # If still can't find the patch but ignore flag is set, jump to the next. + - name : Patch is not there, but ignoring... + set_fact: + skip_all: true + when: (patch_file_path|length == 0) and error_on_no_patch == false - - name: "Patch File" - debug: msg="{{ patch_file_path }}" + - name : Check Patch File + assert: + that: (patch_file_path|length > 0) + fail_msg: "Could not find patch file. Check if patch folder is correct." + success_msg: "Patch File: {{ patch_file_path }}" - name : Define Patch file name set_fact: db_patch: "{{ patch_file_path }}" unzip_patch_folder: "{{ shared_folder }}/{{ patch.patch_number }}" + when: perform_patch_actions + + # Trigger database start command for the first time if never started + - block: + + - name: Call role to start OCI VM + include_role: + name: oci_compute_instance_actions + vars: + compute_action: start + when: oci_mode + + - include: vbox_reload.yml + when: not oci_mode + +# Changed to see if peforms better +# - include: lvm_reload.yml +# when: oci_mode + + - include: setup_opatch.yml + - include: setup_database.yml + + - name : Define database_started variable to true. + set_fact: + database_started: true + + when: not database_started + + # Check if there is an image of the requested patch. + # If this is the case, we can skip the patch operations (set perform_patch_actions to false). + - block: + + - name: Get LVM list + include: lvm_list.yml + + - name: Check output + set_fact: + found_lvm_entry: "{{ lvm_search }}" + vars: + my_query: "lv_u01_{{ patch.type }}_{{ patch.id }}" + lvm_search: "{{ lvs_output.stdout_lines | select('search', my_query) | list | length > 0 }}" + + - block: + + # Skip patch actions + - name: LVM image found. Will skip patch actions. + set_fact: + perform_patch_actions: false + + - name : Save old VM Snap + set_fact: + prev_vm_snapshot: "{{ vm_snapshot }}" + + - name : Set new VM Snap + set_fact: + vm_snapshot: "{{ patch.type }}_{{ patch.id }}" + + when: found_lvm_entry + +# DEBUG: +# - name: Stop +# fail: +# msg: "Stop." + + when: oci_mode + + # This part was together with the block before the lvm_check. + # It was put here together as we don't need to unzip the patch if using the VM. + - block: + - name: Remove unzipped patch folder file: state: absent @@ -108,66 +185,46 @@ when: patch.patch_folder is defined - # This is required as skip_all may be set by error_on_no_patch == false - when: not skip_all + when: perform_patch_actions - when: patch.patch_number != 0 and not skip_all - -# Trigger database start command for the first time if never started -- block: - - - name: Call role to start OCI VM - include_role: - name: oci_compute_instance_actions - vars: - compute_action: start - when: oci_mode + # Trigger database refresh command. + # This must be executed even if the "not database_started" block was just executed because of setup_database.yml script. - include: vbox_reload.yml when: not oci_mode - include: lvm_reload.yml - when: oci_mode + when: oci_mode and patch.dep_type is not defined - - include: setup_opatch.yml - - include: setup_database.yml - - - name : Define database_started variable to true. + - name : Restore old VM Snap set_fact: - database_started: true + vm_snapshot: "{{ prev_vm_snapshot }}" + when: oci_mode and found_lvm_entry - when: not database_started and not skip_all + # When patch has a pre-req, call the prepare_dependency script to setup. + - include: prepare_dependency.yml + when: patch.dep_type is defined -# Trigger database refresh command. -# This must be executed even if the "not database_started" block was just executed because of setup_database.yml script. -- block: - - - include: vbox_reload.yml - when: not oci_mode + # Replace opatch with latest version, when perform_patch_actions + - block: - - include: lvm_reload.yml - when: oci_mode + - name: Remove OPatch folder + file: + state: absent + path: "{{ dbhome_locl }}/OPatch" + become: true + become_user: oracle + delegate_to: "{{ vm_ip_address }}" - when: not skip_all + - name : Unzip OPatch from VM shared folder + unarchive: + src: "{{ db_opatch }}" + dest: "{{ dbhome_locl }}" + become: true + become_user: oracle + delegate_to: "{{ vm_ip_address }}" -# Replace opatch with latest version, when not processing base release. i.e patch.patch_number != 0 -- block: + # skip_all must come first as db_opatch may not yet be declared + when: db_opatch|length > 0 and perform_patch_actions - - name: Remove OPatch folder - file: - state: absent - path: "{{ dbhome_locl }}/OPatch" - become: true - become_user: oracle - delegate_to: "{{ vm_ip_address }}" - - - name : Unzip OPatch from VM shared folder - unarchive: - src: "{{ db_opatch }}" - dest: "{{ dbhome_locl }}" - become: true - become_user: oracle - delegate_to: "{{ vm_ip_address }}" - - # skip_all must come first as db_opatch may not yet be declared - when: not skip_all and db_opatch|length > 0 and patch.patch_number != 0 \ No newline at end of file + when: not skip_all \ No newline at end of file diff --git a/tasks/prepare_dependency.yml b/tasks/prepare_dependency.yml new file mode 100644 index 0000000..7ccb315 --- /dev/null +++ b/tasks/prepare_dependency.yml @@ -0,0 +1,49 @@ +- name : Cascade dependencies not supported + fail: + msg: "Cascade dependencies not supported." + when: bkp_patch is defined and bkp_patch != None + +- name : Backup Variables + set_fact: + bkp_patch: "{{ patch }}" + bkp_skip_dump_exists: "{{ skip_dump_exists }}" + bkp_only_deploy_patch: "{{ only_deploy_patch }}" + bkp_dump_file_prefix: "{{ dump_file_prefix }}" + bkp_skip_all: "{{ skip_all }}" + bkp_fix_datapatch_retries: "{{ fix_datapatch_retries }}" + bkp_expdp_version: "{{ expdp_version }}" + bkp_db_patch: "{{ db_patch }}" + bkp_unzip_patch_folder: "{{ unzip_patch_folder }}" + bkp_perform_patch_actions: "{{ perform_patch_actions }}" + +- name : Replace settings + set_fact: + skip_dump_exists: false + only_deploy_patch: true + +# Execute dependency +- include: "{{ patch_file }}" + loop: "{{ lookup('vars', patch_list) | flatten(levels=1) }}" + loop_control: + loop_var: patch + label: "{{ patch.id }}" + when: + - patch.type == bkp_patch.dep_type + - patch.id == bkp_patch.dep_id + +- name : Restore Variables + set_fact: + skip_dump_exists: "{{ bkp_skip_dump_exists }}" + only_deploy_patch: "{{ bkp_only_deploy_patch }}" + patch: "{{ bkp_patch }}" + dump_file_prefix: "{{ bkp_dump_file_prefix }}" + skip_all: "{{ bkp_skip_all }}" + fix_datapatch_retries: "{{ bkp_fix_datapatch_retries }}" + expdp_version: "{{ bkp_expdp_version }}" + db_patch: "{{ bkp_db_patch }}" + unzip_patch_folder: "{{ bkp_unzip_patch_folder }}" + perform_patch_actions: "{{ bkp_perform_patch_actions }}" + +- name : Clean bkp_patch + set_fact: + bkp_patch: diff --git a/tasks/setup_database.yml b/tasks/setup_database.yml index ee6d0dd..a501114 100644 --- a/tasks/setup_database.yml +++ b/tasks/setup_database.yml @@ -1,5 +1,5 @@ - name: Find the location of DB Home from the SID - shell: 'grep {{ mysid }} /etc/oratab |grep -v ^[#] | cut -d: -f2|head -1' + shell: 'grep {{ mysid }} /etc/oratab | grep -v ^[#] | cut -d: -f2 | head -1' register: dbhomeoutput delegate_to: "{{ vm_ip_address }}" @@ -45,7 +45,7 @@ include: run_sql.yml vars: sql_param : { file : "startup.sql" , folder : "patch_sql" , task_action : "Start Database" } - when: oci_mode == true + when: oci_mode - name: "Check if CDB is enabled" shell: | @@ -72,8 +72,35 @@ set_fact: db_iscdb: "{{ shell_output.stdout | bool }}" + # If any error happens in this block, will trigger a LVM refresh and try again. + rescue: + + - name: Already tried that before error. No other chance. + fail: + msg: "Failed to get some database information." + when: db_start_retried is defined and db_start_retried + + - name: Print when errors + debug: + msg: 'I caught an error. Trying to lvm reload..' + + - name : Set db_start_retried variable + set_fact: + db_start_retried: true + + - include: lvm_reload.yml + when: oci_mode + + - include: setup_database.yml + + # If the previous include succeeded, reset variable. + - name : Clean db_start_retried variable + set_fact: + db_start_retried: false + when: db_version != "11.2.0.4" + - name : Define CDB variable set_fact: db_iscdb: false diff --git a/tasks/setup_env.yml b/tasks/setup_env.yml index 1d07227..11e0ae8 100644 --- a/tasks/setup_env.yml +++ b/tasks/setup_env.yml @@ -9,7 +9,7 @@ fi become: true become_user: root - when: oci_mode == true + when: oci_mode - name: Copy patch SQL to shared folder synchronize: diff --git a/tasks/setup_opatch.yml b/tasks/setup_opatch.yml index 460d8fe..5d7db55 100644 --- a/tasks/setup_opatch.yml +++ b/tasks/setup_opatch.yml @@ -13,7 +13,6 @@ export LC_ALL=C.UTF-8 export LANG=C.UTF-8 oci os object get --bucket-name {{ patch_location_bucket }} --name {{ oci_download_file }} --file {{ patch_location_path }}/{{ oci_download_file | basename }} - register: shoutput vars: my_query: "{{ opatch_file }}" oci_download_file: "{{ oci_action.objects | map(attribute='name') | select('search', my_query) | list | first }}" diff --git a/user_scripts/gen/fileGet.yml b/user_scripts/gen/fileGet.yml index e3e24af..795b12b 100644 --- a/user_scripts/gen/fileGet.yml +++ b/user_scripts/gen/fileGet.yml @@ -21,7 +21,6 @@ find -type f -exec sha256sum "{}" + > {{ VM_folder }}/{{ sha256_file }} args: chdir: "{{ dbhome_locl }}" - register: sqloutput become: true become_user: root delegate_to: "{{ vm_ip_address }}" @@ -47,7 +46,6 @@ done args: chdir: "{{ dbhome_locl }}" - register: sqloutput become: true become_user: root delegate_to: "{{ vm_ip_address }}" diff --git a/user_scripts/odbfcl/adb_load_expdp/mark_dump_file_loaded.yml b/user_scripts/odbfcl/adb_load_expdp/mark_dump_file_loaded.yml index fae68a5..a8a49e6 100644 --- a/user_scripts/odbfcl/adb_load_expdp/mark_dump_file_loaded.yml +++ b/user_scripts/odbfcl/adb_load_expdp/mark_dump_file_loaded.yml @@ -6,4 +6,3 @@ shell: | set -eo pipefail touch {{ output_folder }}/expdp/{{ loaded_file_prefix }} - register: shell_output \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml b/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml index 135f137..d2eab54 100644 --- a/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml +++ b/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml @@ -32,7 +32,7 @@ INTO TABLE T_SYMBOLS_LOAD APPEND FIELDS TERMINATED BY '|' - (source_file constant "${v_file}",file_name,symbol_type,symbol_name) + (source_file constant "${v_file}",file_name,symbol_type,symbol_name char(4000)) EOF cd "{{ symbols_folder }}" diff --git a/user_scripts/odbfcl/extract/bugsGet.yml b/user_scripts/odbfcl/extract/bugsGet.yml index 3b55dd4..574b4a0 100644 --- a/user_scripts/odbfcl/extract/bugsGet.yml +++ b/user_scripts/odbfcl/extract/bugsGet.yml @@ -44,7 +44,6 @@ ORACLE_SID: "{{ mysid }}" args: chdir: "{{ dbhome_locl }}/OPatch" - register: shell_output become: true become_user: oracle delegate_to: "{{ vm_ip_address }}" diff --git a/user_scripts/odbfcl/extract/fileGet.yml b/user_scripts/odbfcl/extract/fileGet.yml index f8cb8e9..8dadb6b 100644 --- a/user_scripts/odbfcl/extract/fileGet.yml +++ b/user_scripts/odbfcl/extract/fileGet.yml @@ -25,7 +25,6 @@ sed -i 's/$/ F/' {{ VM_folder }}/{{ sha256_file }} args: chdir: "{{ dbhome_locl }}" - register: sqloutput become: true become_user: root delegate_to: "{{ vm_ip_address }}" @@ -52,7 +51,6 @@ done args: chdir: "{{ dbhome_locl }}" - register: sqloutput become: true become_user: root delegate_to: "{{ vm_ip_address }}" diff --git a/user_scripts/odbfcl/extract/hashGet.sql b/user_scripts/odbfcl/extract/hashGet.sql index 570a002..caadc48 100644 --- a/user_scripts/odbfcl/extract/hashGet.sql +++ b/user_scripts/odbfcl/extract/hashGet.sql @@ -6,11 +6,14 @@ set tab off set serverout on DEF V_USERNAME = '&1' +DEF V_DIRECTORY = '&2' -- Convert to uppercase col v_username new_v v_username nopri -SELECT UPPER('&V_USERNAME.') V_USERNAME FROM DUAL; +col v_directory new_v v_directory nopri +SELECT UPPER('&V_USERNAME.') V_USERNAME, UPPER('&V_DIRECTORY.') V_DIRECTORY FROM DUAL; col v_username clear +col v_directory clear col p_vers new_v p_vers nopri select substr(version,1,instr(version,'.',1,4)-1) p_vers diff --git a/user_scripts/odbfcl/extract/hashGet.yml b/user_scripts/odbfcl/extract/hashGet.yml index 69d1c0a..39ca963 100644 --- a/user_scripts/odbfcl/extract/hashGet.yml +++ b/user_scripts/odbfcl/extract/hashGet.yml @@ -1,4 +1,4 @@ - include: tasks/run_sql.yml vars: - sql_param : { file : "hashGet.sql" , folder : "user_scripts/odbfcl/extract" , task_action : "Calculate Hash" , params : "{{ dump_user_int }}" } + sql_param : { file : "hashGet.sql" , folder : "user_scripts/odbfcl/extract" , task_action : "Calculate Hash" , params : "'{{ dump_user_int }}' '{{ dump_dir_name }}'" } # patch.base_ru will only be populated for RURs \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/load_dba_cdb.sql b/user_scripts/odbfcl/extract/load_dba_cdb.sql index c258779..4ec33a1 100644 --- a/user_scripts/odbfcl/extract/load_dba_cdb.sql +++ b/user_scripts/odbfcl/extract/load_dba_cdb.sql @@ -110,7 +110,10 @@ BEGIN RUN_INSERT ('AUDIT_POLICY_COLUMNS'); - RUN_INSERT ('DIRECTORIES'); + RUN_INSERT ('DIRECTORIES', + q'[DIRECTORY_NAME != '&V_DIRECTORY.']', + q'[DIRECTORY_NAME != '&V_DIRECTORY.']' + ); RUN_INSERT ('PROCEDURES'); @@ -127,8 +130,8 @@ BEGIN RUN_INSERT ('ROLES'); RUN_INSERT ('OBJECTS', - q'[OWNER != '&V_USERNAME.']', - q'[OWNER != '&V_USERNAME.']' + q'[OWNER != '&V_USERNAME.' AND NOT (OWNER='SYS' AND OBJECT_NAME='&V_DIRECTORY.' AND OBJECT_TYPE='DIRECTORY')]', + q'[OWNER != '&V_USERNAME.' AND NOT (OWNER='SYS' AND OBJECT_NAME='&V_DIRECTORY.' AND OBJECT_TYPE='DIRECTORY')]' ); RUN_INSERT ('TAB_COLUMNS', diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_23.0.0.0.sql b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_23.0.0.0.sql new file mode 100644 index 0000000..e29390f --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_23.0.0.0.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 23.0.0.0 +-------------------------------------- + +-- The code is the same as 18c in V$FIXED_VIEW_DEFINITION +@@load_underscore_18.0.0.0.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_23.0.0.0.sql b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_23.0.0.0.sql new file mode 100644 index 0000000..39e99b8 --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_23.0.0.0.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 23.0.0.0 +-------------------------------------- + +-- The code is the same as 12.1.0.2 in V$FIXED_VIEW_DEFINITION +@@load_underscore_vv_12.1.0.2.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh index 4027173..e4d8128 100644 --- a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh @@ -57,7 +57,7 @@ EOF cd odbfcl/extract/ $ORACLE_HOME/bin/sqlplus "/ as sysdba" < -# v1.0.0.3 +# v1.0.0.4 set -eo pipefail diff --git a/user_scripts/odbfcl/tables_create.sql b/user_scripts/odbfcl/tables_create.sql index 454424e..5c596a8 100644 --- a/user_scripts/odbfcl/tables_create.sql +++ b/user_scripts/odbfcl/tables_create.sql @@ -513,7 +513,7 @@ CREATE TABLE "T_SCHEDULER_JOBS" "SCHEDULE_OWNER" VARCHAR2(4000 CHAR), "SCHEDULE_NAME" VARCHAR2(4000 CHAR), "SCHEDULE_TYPE" VARCHAR2(12 CHAR), -"START_DATE" TIMESTAMP (6) WITH TIME ZONE, +-- "START_DATE" TIMESTAMP (6) WITH TIME ZONE, "REPEAT_INTERVAL" VARCHAR2(4000 CHAR), "EVENT_QUEUE_OWNER" VARCHAR2(128 CHAR), "EVENT_QUEUE_NAME" VARCHAR2(128 CHAR), @@ -522,7 +522,7 @@ CREATE TABLE "T_SCHEDULER_JOBS" "EVENT_RULE" VARCHAR2(261 CHAR), "FILE_WATCHER_OWNER" VARCHAR2(261 CHAR), "FILE_WATCHER_NAME" VARCHAR2(261 CHAR), -"END_DATE" TIMESTAMP (6) WITH TIME ZONE, +-- "END_DATE" TIMESTAMP (6) WITH TIME ZONE, "JOB_CLASS" VARCHAR2(128 CHAR), "ENABLED" VARCHAR2(5 CHAR), "AUTO_DROP" VARCHAR2(5 CHAR), @@ -537,9 +537,9 @@ CREATE TABLE "T_SCHEDULER_JOBS" "UPTIME_FAILURE_COUNT" NUMBER, "MAX_FAILURES" NUMBER, "RETRY_COUNT" NUMBER, -"LAST_START_DATE" TIMESTAMP (6) WITH TIME ZONE, +-- "LAST_START_DATE" TIMESTAMP (6) WITH TIME ZONE, "LAST_RUN_DURATION" INTERVAL DAY (9) TO SECOND (6), -"NEXT_RUN_DATE" TIMESTAMP (6) WITH TIME ZONE, +-- "NEXT_RUN_DATE" TIMESTAMP (6) WITH TIME ZONE, "SCHEDULE_LIMIT" INTERVAL DAY (3) TO SECOND (0), "MAX_RUN_DURATION" INTERVAL DAY (3) TO SECOND (0), "LOGGING_LEVEL" VARCHAR2(11 CHAR), diff --git a/user_scripts/odbfcl/tables_recreate_adb.yml b/user_scripts/odbfcl/tables_recreate_adb.yml index 25e2653..7d2df02 100644 --- a/user_scripts/odbfcl/tables_recreate_adb.yml +++ b/user_scripts/odbfcl/tables_recreate_adb.yml @@ -1,6 +1,12 @@ -- name: Define oci_adb_transient_user +- name: Generate oci_adb_transient_user set_fact: oci_adb_transient_user: "{{ oci_adb_user }}_{{ db_version | replace('.', '') }}" + when: oci_adb_force_transient_user is undefined or (oci_adb_force_transient_user|length == 0) + +- name: Force oci_adb_transient_user + set_fact: + oci_adb_transient_user: "{{ oci_adb_force_transient_user }}" + when: not (oci_adb_force_transient_user is undefined or (oci_adb_force_transient_user|length == 0)) - name: Define oci_adb_connection_tns set_fact: From 38fb0598c3a6d080c87a0531936d3c80b0354d98 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 4 Jan 2023 11:31:12 -0300 Subject: [PATCH 072/229] Change file perms --- examples.sh | 0 files/ocm.rsp | Bin patch_sql/applySQLPatch.sql | 0 patch_sql/applySQLPatchOJVM.sql | 0 patch_sql/shutdown.sql | 0 patch_sql/startup.sql | 0 user_scripts/load/change_all_hash_code.sql | 0 user_scripts/load/change_all_privs_code.sql | 0 user_scripts/load/fileLoad.sh | 0 user_scripts/load/insert_all_hash.sql | 0 user_scripts/load/insert_all_privs.sql | 0 user_scripts/load/insert_all_privs_clean.sql | 0 user_scripts/load/insert_all_privs_code.sql | 0 user_scripts/load/insert_all_privs_spool.sql | 0 14 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 examples.sh mode change 100755 => 100644 files/ocm.rsp mode change 100755 => 100644 patch_sql/applySQLPatch.sql mode change 100755 => 100644 patch_sql/applySQLPatchOJVM.sql mode change 100755 => 100644 patch_sql/shutdown.sql mode change 100755 => 100644 patch_sql/startup.sql mode change 100755 => 100644 user_scripts/load/change_all_hash_code.sql mode change 100755 => 100644 user_scripts/load/change_all_privs_code.sql mode change 100755 => 100644 user_scripts/load/fileLoad.sh mode change 100755 => 100644 user_scripts/load/insert_all_hash.sql mode change 100755 => 100644 user_scripts/load/insert_all_privs.sql mode change 100755 => 100644 user_scripts/load/insert_all_privs_clean.sql mode change 100755 => 100644 user_scripts/load/insert_all_privs_code.sql mode change 100755 => 100644 user_scripts/load/insert_all_privs_spool.sql diff --git a/examples.sh b/examples.sh old mode 100755 new mode 100644 diff --git a/files/ocm.rsp b/files/ocm.rsp old mode 100755 new mode 100644 diff --git a/patch_sql/applySQLPatch.sql b/patch_sql/applySQLPatch.sql old mode 100755 new mode 100644 diff --git a/patch_sql/applySQLPatchOJVM.sql b/patch_sql/applySQLPatchOJVM.sql old mode 100755 new mode 100644 diff --git a/patch_sql/shutdown.sql b/patch_sql/shutdown.sql old mode 100755 new mode 100644 diff --git a/patch_sql/startup.sql b/patch_sql/startup.sql old mode 100755 new mode 100644 diff --git a/user_scripts/load/change_all_hash_code.sql b/user_scripts/load/change_all_hash_code.sql old mode 100755 new mode 100644 diff --git a/user_scripts/load/change_all_privs_code.sql b/user_scripts/load/change_all_privs_code.sql old mode 100755 new mode 100644 diff --git a/user_scripts/load/fileLoad.sh b/user_scripts/load/fileLoad.sh old mode 100755 new mode 100644 diff --git a/user_scripts/load/insert_all_hash.sql b/user_scripts/load/insert_all_hash.sql old mode 100755 new mode 100644 diff --git a/user_scripts/load/insert_all_privs.sql b/user_scripts/load/insert_all_privs.sql old mode 100755 new mode 100644 diff --git a/user_scripts/load/insert_all_privs_clean.sql b/user_scripts/load/insert_all_privs_clean.sql old mode 100755 new mode 100644 diff --git a/user_scripts/load/insert_all_privs_code.sql b/user_scripts/load/insert_all_privs_code.sql old mode 100755 new mode 100644 diff --git a/user_scripts/load/insert_all_privs_spool.sql b/user_scripts/load/insert_all_privs_spool.sql old mode 100755 new mode 100644 From 4595c1dae27b4d6e6e66148ef3f0d2d901f3ec43 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 4 Jan 2023 12:10:56 -0300 Subject: [PATCH 073/229] Update exchange_tables_adb.sql --- user_scripts/odbfcl/exchange_tables_adb.sql | 2 -- 1 file changed, 2 deletions(-) diff --git a/user_scripts/odbfcl/exchange_tables_adb.sql b/user_scripts/odbfcl/exchange_tables_adb.sql index 281410b..02b3c02 100644 --- a/user_scripts/odbfcl/exchange_tables_adb.sql +++ b/user_scripts/odbfcl/exchange_tables_adb.sql @@ -174,8 +174,6 @@ BEGIN THEN -- Add here any optional code to do after the exchange. NULL; - &P_OWNER..X_ORAERR.RELOAD_PARTITION_INT (V_ORAVERSION, V_ORASERIES, V_ORAPATCH); - &P_OWNER..X_REFRESH_MVS; ELSE DBMS_OUTPUT.PUT_LINE('---'); DBMS_OUTPUT.PUT_LINE('--- ATTENTION: ALL TABLES ARE EMPTY'); From 453273b7abfc5dbde892f7e14eb58d0715e82f25 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 21 Apr 2023 19:13:16 -0300 Subject: [PATCH 074/229] New file_suffix variable New file_suffix variable --- tasks/impdp_file.yml | 3 ++- tasks/patch_tasks_pre.yml | 3 ++- tasks/prepare_dependency.yml | 2 ++ user_scripts/gen/fileGet.yml | 2 +- .../odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml | 2 +- user_scripts/odbfcl/adb_load_expdp/check_dump_file_loaded.yml | 2 +- user_scripts/odbfcl/adb_load_expdp/mark_dump_file_loaded.yml | 2 +- user_scripts/odbfcl/adb_load_expdp/pre_prepare_dump_file.yml | 3 ++- .../odbfcl/adb_load_filechksum/adb_load_filechksum.yml | 2 +- user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml | 2 +- .../adb_load_txtcollection_files.yml | 2 +- user_scripts/odbfcl/extract/bugsGet.yml | 2 +- user_scripts/odbfcl/extract/fileCollect.yml | 2 +- user_scripts/odbfcl/extract/fileGet.yml | 2 +- user_scripts/odbfcl/extract/symbolGet.yml | 2 +- 15 files changed, 19 insertions(+), 14 deletions(-) diff --git a/tasks/impdp_file.yml b/tasks/impdp_file.yml index 29dcabc..b81c20b 100644 --- a/tasks/impdp_file.yml +++ b/tasks/impdp_file.yml @@ -3,7 +3,8 @@ - name : Define file names set_fact: - dump_file_prefix: "tables_{{ db_version }}_{{ patch.base_ru | default('')}}{{ patch.type }}_{{ patch.id }}" + # file_suffix: "{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}" + dump_file_prefix: "tables_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}" - name: "Check if {{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp exists" stat: diff --git a/tasks/patch_tasks_pre.yml b/tasks/patch_tasks_pre.yml index dee0d3c..dff20c0 100644 --- a/tasks/patch_tasks_pre.yml +++ b/tasks/patch_tasks_pre.yml @@ -3,7 +3,8 @@ - name : Define dump file name and parameters set_fact: - dump_file_prefix: "tables_{{ db_version }}_{{ patch.base_ru | default('')}}{{ patch.type }}_{{ patch.id }}" + file_suffix: "{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}" + dump_file_prefix: "tables_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}" skip_all: false fix_datapatch_retries: 0 expdp_version: "" diff --git a/tasks/prepare_dependency.yml b/tasks/prepare_dependency.yml index 7ccb315..d63ff19 100644 --- a/tasks/prepare_dependency.yml +++ b/tasks/prepare_dependency.yml @@ -8,6 +8,7 @@ bkp_patch: "{{ patch }}" bkp_skip_dump_exists: "{{ skip_dump_exists }}" bkp_only_deploy_patch: "{{ only_deploy_patch }}" + bkp_file_suffix: "{{ file_suffix }}" bkp_dump_file_prefix: "{{ dump_file_prefix }}" bkp_skip_all: "{{ skip_all }}" bkp_fix_datapatch_retries: "{{ fix_datapatch_retries }}" @@ -36,6 +37,7 @@ skip_dump_exists: "{{ bkp_skip_dump_exists }}" only_deploy_patch: "{{ bkp_only_deploy_patch }}" patch: "{{ bkp_patch }}" + file_suffix: "{{ bkp_file_suffix }}" dump_file_prefix: "{{ bkp_dump_file_prefix }}" skip_all: "{{ bkp_skip_all }}" fix_datapatch_retries: "{{ bkp_fix_datapatch_retries }}" diff --git a/user_scripts/gen/fileGet.yml b/user_scripts/gen/fileGet.yml index 795b12b..6f13c51 100644 --- a/user_scripts/gen/fileGet.yml +++ b/user_scripts/gen/fileGet.yml @@ -5,7 +5,7 @@ - name : Define chksum file names set_fact: - sha256_file: "sha256sum_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}.chk" + sha256_file: "sha256sum_{{ file_suffix }}.chk" - name: "Check if {{ chksum_folder }}/{{ sha256_file }} exists" stat: diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml b/user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml index 71e1a06..c9faf7c 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml @@ -1,6 +1,6 @@ - name : Define bugs_fixed filename and folder set_fact: - bugs_fixed_file: "bugs_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}.txt" + bugs_fixed_file: "bugs_{{ file_suffix }}.txt" bugs_fixed_folder: "{{ output_folder }}/bugsfixed" - name: "Check if {{ bugs_fixed_folder }}/{{ bugs_fixed_file }} exists" diff --git a/user_scripts/odbfcl/adb_load_expdp/check_dump_file_loaded.yml b/user_scripts/odbfcl/adb_load_expdp/check_dump_file_loaded.yml index ce4f36f..6271a51 100644 --- a/user_scripts/odbfcl/adb_load_expdp/check_dump_file_loaded.yml +++ b/user_scripts/odbfcl/adb_load_expdp/check_dump_file_loaded.yml @@ -1,6 +1,6 @@ - name : Define check filename set_fact: - loaded_file_prefix: "tables_{{ db_version }}_{{ patch.base_ru | default('')}}{{ patch.type }}_{{ patch.id }}_loaded_{{ oci_adb_tns }}" + loaded_file_prefix: "tables_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}_loaded_{{ oci_adb_tns }}" - name: "Check if {{ output_folder }}/expdp/{{ loaded_file_prefix }} exists" stat: diff --git a/user_scripts/odbfcl/adb_load_expdp/mark_dump_file_loaded.yml b/user_scripts/odbfcl/adb_load_expdp/mark_dump_file_loaded.yml index a8a49e6..cb52e93 100644 --- a/user_scripts/odbfcl/adb_load_expdp/mark_dump_file_loaded.yml +++ b/user_scripts/odbfcl/adb_load_expdp/mark_dump_file_loaded.yml @@ -1,6 +1,6 @@ - name : Define check filename set_fact: - loaded_file_prefix: "tables_{{ db_version }}_{{ patch.base_ru | default('')}}{{ patch.type }}_{{ patch.id }}_loaded_{{ oci_adb_tns }}" + loaded_file_prefix: "tables_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}_loaded_{{ oci_adb_tns }}" - name: "Create {{ output_folder }}/expdp/{{ loaded_file_prefix }}." shell: | diff --git a/user_scripts/odbfcl/adb_load_expdp/pre_prepare_dump_file.yml b/user_scripts/odbfcl/adb_load_expdp/pre_prepare_dump_file.yml index abe655e..d8e659e 100644 --- a/user_scripts/odbfcl/adb_load_expdp/pre_prepare_dump_file.yml +++ b/user_scripts/odbfcl/adb_load_expdp/pre_prepare_dump_file.yml @@ -1,6 +1,7 @@ - name : Define expdp filename set_fact: - dump_file_prefix: "tables_{{ db_version }}_{{ patch.base_ru | default('')}}{{ patch.type }}_{{ patch.id }}" + file_suffix: "{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}" + dump_file_prefix: "tables_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}" - name: "Check if {{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp exists" stat: diff --git a/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml b/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml index f963d4a..70b657f 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml +++ b/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml @@ -1,6 +1,6 @@ - name : Define chksum filename and folder set_fact: - chksum_file: "sha256sum_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}.chk" + chksum_file: "sha256sum_{{ file_suffix }}.chk" chksum_folder: "{{ output_folder }}/binsum" - name: "Check if {{ chksum_folder }}/{{ chksum_file }} exists" diff --git a/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml b/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml index d2eab54..22af80d 100644 --- a/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml +++ b/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml @@ -1,6 +1,6 @@ - name : Define symbols filename and folder set_fact: - symbols_file: "symbols_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}.csv" + symbols_file: "symbols_{{ file_suffix }}.csv" symbols_folder: "{{ output_folder }}/symbols" - name: "Check if {{ symbols_folder }}/{{ symbols_file }} exists" diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml b/user_scripts/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml index 9b9943e..9f67b71 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml @@ -1,6 +1,6 @@ - name : Define txtcollection filename and folder set_fact: - txtcollection_file: "txtcol_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}.tar.gz" + txtcollection_file: "txtcol_{{ file_suffix }}.tar.gz" txtcollection_folder: "{{ output_folder }}/txtcollect" - name: "Check if {{ txtcollection_folder }}/{{ txtcollection_file }} exists" diff --git a/user_scripts/odbfcl/extract/bugsGet.yml b/user_scripts/odbfcl/extract/bugsGet.yml index 574b4a0..6ae901b 100644 --- a/user_scripts/odbfcl/extract/bugsGet.yml +++ b/user_scripts/odbfcl/extract/bugsGet.yml @@ -1,6 +1,6 @@ - name : Define bugs_fixed filename and folder set_fact: - bugs_fixed_file: "bugs_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}.txt" + bugs_fixed_file: "bugs_{{ file_suffix }}.txt" bugs_fixed_folder: "{{ output_folder }}/bugsfixed" - name: "Check if {{ bugs_fixed_folder }}/{{ bugs_fixed_file }} exists" diff --git a/user_scripts/odbfcl/extract/fileCollect.yml b/user_scripts/odbfcl/extract/fileCollect.yml index 1333a9b..bf6ea33 100644 --- a/user_scripts/odbfcl/extract/fileCollect.yml +++ b/user_scripts/odbfcl/extract/fileCollect.yml @@ -5,7 +5,7 @@ - name : Define txtcollect file names set_fact: - txtcollect_file: "txtcol_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}.tar.gz" + txtcollect_file: "txtcol_{{ file_suffix }}.tar.gz" - name: "Check if {{ txtcollect_folder }}/{{ txtcollect_file }} exists" stat: diff --git a/user_scripts/odbfcl/extract/fileGet.yml b/user_scripts/odbfcl/extract/fileGet.yml index 8dadb6b..17b8b15 100644 --- a/user_scripts/odbfcl/extract/fileGet.yml +++ b/user_scripts/odbfcl/extract/fileGet.yml @@ -5,7 +5,7 @@ - name : Define file names set_fact: - sha256_file: "sha256sum_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}.chk" + sha256_file: "sha256sum_{{ file_suffix }}.chk" - name: "Check if {{ chksum_folder }}/{{ sha256_file }} exists" stat: diff --git a/user_scripts/odbfcl/extract/symbolGet.yml b/user_scripts/odbfcl/extract/symbolGet.yml index ba70794..bc30b7d 100644 --- a/user_scripts/odbfcl/extract/symbolGet.yml +++ b/user_scripts/odbfcl/extract/symbolGet.yml @@ -5,7 +5,7 @@ - name : Define symbols file names set_fact: - symbols_file: "symbols_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}.csv" + symbols_file: "symbols_{{ file_suffix }}.csv" - name: "Check if {{ symbols_folder }}/{{ symbols_file }} exists" stat: From aaed2ae3f788e8813163d0efbcf6a874a0cc92e7 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 21 Apr 2023 19:16:02 -0300 Subject: [PATCH 075/229] diff_calculate change Changing diff_calculate calls to support patches just loaded, still not loaded on MVs --- .../odbfcl/diff_calculate/diff_calculate.sql | 31 ++++++++++--------- .../odbfcl/diff_calculate/diff_main.sql | 13 ++++++-- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/user_scripts/odbfcl/diff_calculate/diff_calculate.sql b/user_scripts/odbfcl/diff_calculate/diff_calculate.sql index a905c08..f8e8d1f 100644 --- a/user_scripts/odbfcl/diff_calculate/diff_calculate.sql +++ b/user_scripts/odbfcl/diff_calculate/diff_calculate.sql @@ -1,9 +1,13 @@ WHENEVER SQLERROR EXIT SQL.SQLCODE -DEF V_CONN = '&1' -DEF V_VERS_FROM = '&2' -DEF V_VERS_TO = '&3' -DEF V_BRELEASE = '&4' +DEF V_CONN = '&1' +DEF V_ORAVERSION_FROM = '&2' +DEF V_ORASERIES_FROM = '&3' +DEF V_ORAPATCH_FROM = '&4' +DEF V_ORAVERSION_TO = '&5' +DEF V_ORASERIES_TO = '&6' +DEF V_ORAPATCH_TO = '&7' +DEF V_BRELEASE = '&8' DEF V_TABLE_NAME_CODES = 'DIFF_CODES_LOAD_&&V_BRELEASE.' DEF V_TABLE_NAME_CONTENTS = 'DIFF_CONTENTS_LOAD_&&V_BRELEASE.' @@ -134,27 +138,24 @@ PRO rm -f "${v_outpref}_load.log" "${v_outpref}_load.ctl" "${v_file}" SPO OFF -------------------------- -------- LOAD CODES ------- +-------- PREPARE --------- -------------------------- ! rm -f *_*.txt --- For Labels --- BEGIN --- ADMIN.INITAPEXFROMOUTSIDE(100,2,'XYZ') ; --- APEX_UTIL.SET_SESSION_STATE('ALLOW_LABELS','Y'); --- END; --- / +-------------------------- +------- LOAD CODES ------- +-------------------------- ROLLBACK; -EXEC L_HASH('&V_VERS_FROM','&V_VERS_TO'); +EXEC R_HASH.L('&&V_ORAVERSION_FROM.','&&V_ORASERIES_FROM.',&&V_ORAPATCH_FROM.,'&&V_ORAVERSION_TO.','&&V_ORASERIES_TO.',&&V_ORAPATCH_TO.); set serverout on lines 10000 trims on verify off feed off SPOOL aaa.sql BEGIN FOR I IN (SELECT NVL(D1.MD5_HASH_UNWRAPPED,D1.MD5_HASH) OLD_VALUE, NVL(D2.MD5_HASH_UNWRAPPED,D2.MD5_HASH) NEW_VALUE - FROM P_HASH.F('&V_VERS_TO') D0, DM_CODES D1, DM_CODES D2 + FROM R_HASH.F('&&V_ORAVERSION_TO.','&&V_ORASERIES_TO.',&&V_ORAPATCH_TO.) D0, DM_CODES D1, DM_CODES D2 WHERE D0.COMPARE_COLUMN_NAME='MD5_HASH' AND D1.MD5_HASH = D0.OLD_VALUE AND D2.MD5_HASH = D0.NEW_VALUE @@ -217,14 +218,14 @@ SET TERMOUT OFF ECHO OFF ----------------------------- ROLLBACK; -EXEC L_TXTCOLLECTION('&V_VERS_FROM','&V_VERS_TO'); +EXEC R_TXTCOLLECTION.L('&&V_ORAVERSION_FROM.','&&V_ORASERIES_FROM.',&&V_ORAPATCH_FROM.,'&&V_ORAVERSION_TO.','&&V_ORASERIES_TO.',&&V_ORAPATCH_TO.); set serverout on lines 10000 trims on verify off feed off SPOOL aaa.sql BEGIN FOR I IN (SELECT HEXTORAW(D0.OLD_VALUE) OLD_VALUE, HEXTORAW(D0.NEW_VALUE) NEW_VALUE - FROM P_TXTCOLLECTION.F('&V_VERS_TO') D0 + FROM R_TXTCOLLECTION.F('&&V_ORAVERSION_TO.','&&V_ORASERIES_TO.',&&V_ORAPATCH_TO.) D0 WHERE D0.COMPARE_COLUMN_NAME='MD5_HASH' MINUS SELECT MD5_HASH_FROM, MD5_HASH_TO diff --git a/user_scripts/odbfcl/diff_calculate/diff_main.sql b/user_scripts/odbfcl/diff_calculate/diff_main.sql index 4ec8abf..aa95186 100644 --- a/user_scripts/odbfcl/diff_calculate/diff_main.sql +++ b/user_scripts/odbfcl/diff_calculate/diff_main.sql @@ -40,8 +40,17 @@ set verify off col code for a10000 set termout off spo run_code.sql -select '@&P_FOLDER./diff_calculate.sql ''&P_CRED.'' ''' || v1.display_name_prev || ''' ''' || v1.display_name || ''' ''' || REPLACE('&P_VERS.','.','') || '''' -from mv_versions v1, mv_versions v2 +with versions as (select /*+ materialize */ * from ld_versions) +select '@&P_FOLDER./diff_calculate.sql ' || + '''&P_CRED.'' ' || -- P1 + '''' || v2.oraversion || ''' ' || -- P2 + '''' || v2.oraseries || ''' ' || -- P3 + '''' || v2.orapatch || ''' ' || -- P4 + '''' || v1.oraversion || ''' ' || -- P5 + '''' || v1.oraseries || ''' ' || -- P6 + '''' || v1.orapatch || ''' ' || -- P7 + '''' || REPLACE('&P_VERS.','.','') || '''' -- P8 +from versions v1, versions v2 where v1.display_name_prev=v2.display_name and ((v1.oraversion='&P_VERS.' and v1.oraseries='&P_SER.' and v1.orapatch=&P_PATCH.) or (v2.oraversion='&P_VERS.' and v2.oraseries='&P_SER.' and v2.orapatch=&P_PATCH.)); From 51071f9ab2d879e753c8c6513adff50cc5515b0f Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 21 Apr 2023 19:18:00 -0300 Subject: [PATCH 076/229] Support patch files with same name but a suffix Adding suffix string for patch files with the same patch ID, when patch is superseded --- tasks/download_patch.yml | 4 ++-- tasks/find_patch.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tasks/download_patch.yml b/tasks/download_patch.yml index 3c4f31d..1672eb8 100644 --- a/tasks/download_patch.yml +++ b/tasks/download_patch.yml @@ -17,7 +17,7 @@ [ ! -d "{{ db_version }}/{{ patch.type }}" ] && mkdir -p "{{ db_version }}/{{ patch.type }}" cd "{{ db_version }}/{{ patch.type }}" $ORACLE_HOME/jdk/bin/java -jar {{ downloader_tool }} \ - patch={{ patch.patch_number }} \ + patch={{ patch.patch_number }}{{ patch.file_suf | default('') }} \ platform=226P \ download=all \ silent=yes \ @@ -33,7 +33,7 @@ - name: Get patch file name to upload to OS find: paths: "{{ patch_location_path }}" - patterns: "p{{ patch.patch_number }}_{{ db_version | regex_replace('\\.','') }}0_Linux-x86-64.zip" + patterns: "p{{ patch.patch_number }}_{{ db_version | regex_replace('\\.','') }}0_Linux-x86-64{{ patch.file_suf | default('') }}.zip" file_type: "file" register: get_name diff --git a/tasks/find_patch.yml b/tasks/find_patch.yml index 58bf7e8..e972915 100644 --- a/tasks/find_patch.yml +++ b/tasks/find_patch.yml @@ -21,7 +21,7 @@ oci os object get --bucket-name {{ patch_location_bucket }} --name {{ oci_download_file }} --file {{ patch_location_path }}/{{ oci_download_file | basename }} vars: my_query: "p{{ patch.patch_number }}" - oci_download_file: "{{ oci_action.objects | map(attribute='name') | select('search', my_query) | list | first }}" + oci_download_file: "{{ oci_action.objects | map(attribute='name') | select('search',(patch.file_suf | default('')) ~ '.zip') | select('search', my_query) | list | first }}" when: oci_action.objects | map(attribute='name') | select('search', my_query) | list | length > 0 when: patch_location_type == "bucket" @@ -29,7 +29,7 @@ - name: Finding Patch File find: paths: "{{ patch_location_path }}" - patterns: "p{{ patch.patch_number }}_{{ db_version | regex_replace('\\.','') }}0_Linux-x86-64.zip" + patterns: "p{{ patch.patch_number }}_{{ db_version | regex_replace('\\.','') }}0_Linux-x86-64{{ patch.file_suf | default('') }}.zip" recurse: "yes" file_type: "file" register: tmp_find_result @@ -42,7 +42,7 @@ - name: Finding Patch File find: paths: "{{ patch_location_path }}" - patterns: "p{{ patch.patch_number }}_*DBRU_Linux-x86-64.zip" + patterns: "p{{ patch.patch_number }}_*DBRU_Linux-x86-64{{ patch.file_suf | default('') }}.zip" recurse: "yes" file_type: "file" register: tmp_find_result From ecf7a016d318b682342a91a9019d30af45e409f4 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 21 Apr 2023 20:07:23 -0300 Subject: [PATCH 077/229] Decimal notation in patch number Added support for decimal notation in patch number --- tasks/main_PSU_BP.yml | 34 +++++++++--------- tasks/main_RU_RUR.yml | 36 +++++++++---------- tasks/main_loader_adb.yml | 26 +++++++------- tasks/patch_tasks_post.yml | 2 +- .../load_bugs_fixed_table.sql | 3 +- .../adb_load_filechksum/load_chksum_table.sql | 3 +- .../adb_load_symbols/load_symbols_table.sql | 3 +- .../load_txtcollection_table.sql | 3 +- 8 files changed, 57 insertions(+), 53 deletions(-) diff --git a/tasks/main_PSU_BP.yml b/tasks/main_PSU_BP.yml index dbb04d0..e588049 100644 --- a/tasks/main_PSU_BP.yml +++ b/tasks/main_PSU_BP.yml @@ -41,9 +41,9 @@ vars: patch : { type : PSU , id : 0, patch_number : 0 } when: - - 0 == (param_patch | int) or param_patch == -1 - - 0 >= (param_patch_from | int) or param_patch_from == -1 - - 0 <= (param_patch_to | int) or param_patch_to == -1 + - 0 == (param_patch | float) or param_patch == -1 + - 0 >= (param_patch_from | float) or param_patch_from == -1 + - 0 <= (param_patch_to | float) or param_patch_to == -1 # Execute for every PSU - include: "{{ patch_file }}" @@ -53,9 +53,9 @@ label: "{{ patch.id }}" when: - patch.type == "PSU" - - patch.id == (param_patch | int) or param_patch == -1 - - patch.id >= (param_patch_from | int) or param_patch_from == -1 - - patch.id <= (param_patch_to | int) or param_patch_to == -1 + - patch.id == (param_patch | float) or param_patch == -1 + - patch.id >= (param_patch_from | float) or param_patch_from == -1 + - patch.id <= (param_patch_to | float) or param_patch_to == -1 when: param_type is undefined or param_type == "PSU" @@ -71,13 +71,13 @@ - name : Generate Snapshot Name - VBox Mode set_fact: vm_snapshot: "{{ db_version }} PSU {{ latest_psu_id }}" - latest_psu_line: "{{ db_version }}.PSU.{{ latest_psu_id }}" + latest_psu_line: "{{ db_version }}|PSU|{{ latest_psu_id }}" when: not oci_mode - name : Generate Snapshot Name - LVM Mode set_fact: vm_snapshot: "PSU_{{ latest_psu_id }}" - latest_psu_line: "{{ db_version }}.PSU.{{ latest_psu_id }}" + latest_psu_line: "{{ db_version }}|PSU|{{ latest_psu_id }}" when: oci_mode - name: "Latest PSU" @@ -130,9 +130,9 @@ label: "{{ patch.id }}" when: - patch.type == "OJVM" - - patch.id == (param_patch | int) or param_patch == -1 - - patch.id >= (param_patch_from | int) or param_patch_from == -1 - - patch.id <= (param_patch_to | int) or param_patch_to == -1 + - patch.id == (param_patch | float) or param_patch == -1 + - patch.id >= (param_patch_from | float) or param_patch_from == -1 + - patch.id <= (param_patch_to | float) or param_patch_to == -1 when: param_type is undefined or param_type == "OJVM" @@ -155,9 +155,9 @@ patch : { type : BP , id : 0, patch_number : 0 } when: - total_bps != "0" - - 0 == (param_patch | int) or param_patch == -1 - - 0 >= (param_patch_from | int) or param_patch_from == -1 - - 0 <= (param_patch_to | int) or param_patch_to == -1 + - 0 == (param_patch | float) or param_patch == -1 + - 0 >= (param_patch_from | float) or param_patch_from == -1 + - 0 <= (param_patch_to | float) or param_patch_to == -1 # Execute for every BP - include: "{{ patch_file }}" @@ -167,9 +167,9 @@ label: "{{ patch.id }}" when: - patch.type == "BP" - - patch.id == (param_patch | int) or param_patch == -1 - - patch.id >= (param_patch_from | int) or param_patch_from == -1 - - patch.id <= (param_patch_to | int) or param_patch_to == -1 + - patch.id == (param_patch | float) or param_patch == -1 + - patch.id >= (param_patch_from | float) or param_patch_from == -1 + - patch.id <= (param_patch_to | float) or param_patch_to == -1 when: param_type is undefined or param_type == "BP" diff --git a/tasks/main_RU_RUR.yml b/tasks/main_RU_RUR.yml index eb36cb9..4ff18b0 100644 --- a/tasks/main_RU_RUR.yml +++ b/tasks/main_RU_RUR.yml @@ -42,9 +42,9 @@ vars: patch : { type : RU , id : "{{ out_of_box_ru }}" , patch_number : 0 } when: - - (out_of_box_ru | int) == (param_patch | int) or param_patch == -1 - - (out_of_box_ru | int) >= (param_patch_from | int) or param_patch_from == -1 - - (out_of_box_ru | int) <= (param_patch_to | int) or param_patch_to == -1 + - (out_of_box_ru | float) == (param_patch | float) or param_patch == -1 + - (out_of_box_ru | float) >= (param_patch_from | float) or param_patch_from == -1 + - (out_of_box_ru | float) <= (param_patch_to | float) or param_patch_to == -1 # Execute for every RU - include: "{{ patch_file }}" @@ -54,10 +54,10 @@ label: "{{ patch.id }}" when: - patch.type == "RU" - - patch.id == (param_patch | int) or param_patch == -1 - - patch.id >= (param_patch_from | int) or param_patch_from == -1 - - patch.id <= (param_patch_to | int) or param_patch_to == -1 - - patch.id > (out_of_box_ru | int) + - patch.id == (param_patch | float) or param_patch == -1 + - patch.id >= (param_patch_from | float) or param_patch_from == -1 + - patch.id <= (param_patch_to | float) or param_patch_to == -1 + - patch.id > (out_of_box_ru | float) when: param_type is undefined or param_type == "RU" @@ -73,13 +73,13 @@ - name : Generate Snapshot Name - VBox Mode set_fact: vm_snapshot: "{{ db_version }} RU {{ latest_RU_id }}" - latest_RU_line: "{{ db_version }}.RU.{{ latest_RU_id }}" + latest_RU_line: "{{ db_version }}|RU|{{ latest_RU_id }}" when: not oci_mode - name : Generate Snapshot Name - LVM Mode set_fact: vm_snapshot: "RU_{{ latest_RU_id }}" - latest_RU_line: "{{ db_version }}.RU.{{ latest_RU_id }}" + latest_RU_line: "{{ db_version }}|RU|{{ latest_RU_id }}" when: oci_mode - name: "Latest RU" @@ -132,9 +132,9 @@ label: "{{ patch.id }}" when: - patch.type == "OJVM" - - patch.id == (param_patch | int) or param_patch == -1 - - patch.id >= (param_patch_from | int) or param_patch_from == -1 - - patch.id <= (param_patch_to | int) or param_patch_to == -1 + - patch.id == (param_patch | float) or param_patch == -1 + - patch.id >= (param_patch_from | float) or param_patch_from == -1 + - patch.id <= (param_patch_to | float) or param_patch_to == -1 when: param_type is undefined or param_type == "OJVM" @@ -153,9 +153,9 @@ label: "{{ patch.id }}" when: - patch.type == "RUR" - - patch.id == (param_patch | int) or param_patch == -1 - - patch.id >= (param_patch_from | int) or param_patch_from == -1 - - patch.id <= (param_patch_to | int) or param_patch_to == -1 + - patch.id == (param_patch | float) or param_patch == -1 + - patch.id >= (param_patch_from | float) or param_patch_from == -1 + - patch.id <= (param_patch_to | float) or param_patch_to == -1 when: param_type is undefined or param_type == "RUR" @@ -174,9 +174,9 @@ label: "{{ patch.id }}" when: - patch.type == "MRP" - - patch.id == (param_patch | int) or param_patch == -1 - - patch.id >= (param_patch_from | int) or param_patch_from == -1 - - patch.id <= (param_patch_to | int) or param_patch_to == -1 + - patch.id == (param_patch | float) or param_patch == -1 + - patch.id >= (param_patch_from | float) or param_patch_from == -1 + - patch.id <= (param_patch_to | float) or param_patch_to == -1 when: param_type is undefined or param_type == "MRP" diff --git a/tasks/main_loader_adb.yml b/tasks/main_loader_adb.yml index 508f882..e10f7b5 100644 --- a/tasks/main_loader_adb.yml +++ b/tasks/main_loader_adb.yml @@ -41,9 +41,9 @@ patch : { type : PSU , id : 0, patch_number : 0 } when: - total_psus != "0" - - 0 == (param_patch | int) or param_patch == -1 - - 0 >= (param_patch_from | int) or param_patch_from == -1 - - 0 <= (param_patch_to | int) or param_patch_to == -1 + - 0 == (param_patch | float) or param_patch == -1 + - 0 >= (param_patch_from | float) or param_patch_from == -1 + - 0 <= (param_patch_to | float) or param_patch_to == -1 - param_type is undefined or param_type == "PSU" # Execute for base release if there is at least 1 BP for that version @@ -52,9 +52,9 @@ patch : { type : BP , id : 0, patch_number : 0 } when: - total_bps != "0" - - 0 == (param_patch | int) or param_patch == -1 - - 0 >= (param_patch_from | int) or param_patch_from == -1 - - 0 <= (param_patch_to | int) or param_patch_to == -1 + - 0 == (param_patch | float) or param_patch == -1 + - 0 >= (param_patch_from | float) or param_patch_from == -1 + - 0 <= (param_patch_to | float) or param_patch_to == -1 - param_type is undefined or param_type == "BP" # Execute for base release if there is at least 1 RU for that version @@ -63,9 +63,9 @@ patch : { type : RU , id : "{{ out_of_box_ru }}" , patch_number : 0 } when: - total_rus != "0" - - (out_of_box_ru | int) == (param_patch | int) or param_patch == -1 - - (out_of_box_ru | int) >= (param_patch_from | int) or param_patch_from == -1 - - (out_of_box_ru | int) <= (param_patch_to | int) or param_patch_to == -1 + - (out_of_box_ru | float) == (param_patch | float) or param_patch == -1 + - (out_of_box_ru | float) >= (param_patch_from | float) or param_patch_from == -1 + - (out_of_box_ru | float) <= (param_patch_to | float) or param_patch_to == -1 - param_type is undefined or param_type == "RU" ############################### @@ -77,8 +77,8 @@ loop_var: patch label: "{{ patch.id }}" when: - - patch.id == (param_patch | int) or param_patch == -1 - - patch.id >= (param_patch_from | int) or param_patch_from == -1 - - patch.id <= (param_patch_to | int) or param_patch_to == -1 - - patch.id > (out_of_box_ru | int) or patch.type != "RU" # When RU, skip patch.id lower or equal to out_of_box_ru + - patch.id == (param_patch | float) or param_patch == -1 + - patch.id >= (param_patch_from | float) or param_patch_from == -1 + - patch.id <= (param_patch_to | float) or param_patch_to == -1 + - patch.id > (out_of_box_ru | float) or patch.type != "RU" # When RU, skip patch.id lower or equal to out_of_box_ru - param_type is undefined or param_type == patch.type \ No newline at end of file diff --git a/tasks/patch_tasks_post.yml b/tasks/patch_tasks_post.yml index 8680e5e..f81d034 100644 --- a/tasks/patch_tasks_post.yml +++ b/tasks/patch_tasks_post.yml @@ -49,4 +49,4 @@ - name : Define latest processed set_fact: - latest_processed: "{{ db_version }}.{{ patch.type }}.{{ patch.id }}" \ No newline at end of file + latest_processed: "{{ db_version }}|{{ patch.type }}|{{ patch.id }}" \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql b/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql index 2d153ee..fddf40c 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql @@ -7,7 +7,8 @@ select BUG_ID, BUG_DESC, substr(file_name,instr(file_name,'_',1,1)+1,instr(file_name,'_',1,2)-instr(file_name,'_',1,1)-1) oraversion, substr(file_name,instr(file_name,'_',1,2)+1,instr(file_name,'_',1,3)-instr(file_name,'_',1,2)-1) oraseries, - to_number(substr(file_name,instr(file_name,'_',1,3)+1,instr(file_name,'.',-1)-instr(file_name,'_',1,3)-1)) orapatch + -- to_number(substr(file_name,instr(file_name,'_',1,3)+1,instr(file_name,'.',-1)-instr(file_name,'_',1,3)-1)) orapatch + to_number(regexp_substr(file_name,'(\d+\.)?\d+',instr(file_name,'_',1,3)+1,1), 'TM9', 'NLS_NUMERIC_CHARACTERS = .,') orapatch from T_BUGSFIXED_LOAD; commit; diff --git a/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql b/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql index 01d1786..1ae74c6 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql +++ b/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql @@ -6,7 +6,8 @@ select path, file_type, substr(file_name,instr(file_name,'_',1,1)+1,instr(file_name,'_',1,2)-instr(file_name,'_',1,1)-1) oraversion, substr(file_name,instr(file_name,'_',1,2)+1,instr(file_name,'_',1,3)-instr(file_name,'_',1,2)-1) oraseries, - to_number(substr(file_name,instr(file_name,'_',1,3)+1,instr(file_name,'.',-1)-instr(file_name,'_',1,3)-1)) orapatch + -- to_number(substr(file_name,instr(file_name,'_',1,3)+1,instr(file_name,'.',-1)-instr(file_name,'_',1,3)-1)) orapatch + to_number(regexp_substr(file_name,'(\d+\.)?\d+',instr(file_name,'_',1,3)+1,1), 'TM9', 'NLS_NUMERIC_CHARACTERS = .,') orapatch from T_FILES_LOAD; commit; diff --git a/user_scripts/odbfcl/adb_load_symbols/load_symbols_table.sql b/user_scripts/odbfcl/adb_load_symbols/load_symbols_table.sql index 86cbb1e..21c5966 100644 --- a/user_scripts/odbfcl/adb_load_symbols/load_symbols_table.sql +++ b/user_scripts/odbfcl/adb_load_symbols/load_symbols_table.sql @@ -6,7 +6,8 @@ select file_name, symbol_name, substr(source_file,instr(source_file,'_',1,1)+1,instr(source_file,'_',1,2)-instr(source_file,'_',1,1)-1) oraversion, substr(source_file,instr(source_file,'_',1,2)+1,instr(source_file,'_',1,3)-instr(source_file,'_',1,2)-1) oraseries, - to_number(substr(source_file,instr(source_file,'_',1,3)+1,instr(source_file,'.',-1)-instr(source_file,'_',1,3)-1)) orapatch + -- to_number(substr(source_file,instr(source_file,'_',1,3)+1,instr(source_file,'.',-1)-instr(source_file,'_',1,3)-1)) orapatch + to_number(regexp_substr(file_name,'(\d+\.)?\d+',instr(file_name,'_',1,3)+1,1), 'TM9', 'NLS_NUMERIC_CHARACTERS = .,') orapatch from T_SYMBOLS_LOAD; commit; diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql b/user_scripts/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql index 69d56c2..7f960a7 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql @@ -21,7 +21,8 @@ select PATH, MD5_HASH, substr(file_name,instr(file_name,'_',1,1)+1,instr(file_name,'_',1,2)-instr(file_name,'_',1,1)-1) oraversion, substr(file_name,instr(file_name,'_',1,2)+1,instr(file_name,'_',1,3)-instr(file_name,'_',1,2)-1) oraseries, - to_number(substr(file_name,instr(file_name,'_',1,3)+1,instr(file_name,'.',-1,2)-instr(file_name,'_',1,3)-1)) orapatch + -- to_number(substr(file_name,instr(file_name,'_',1,3)+1,instr(file_name,'.',-1,2)-instr(file_name,'_',1,3)-1)) orapatch + to_number(regexp_substr(file_name,'(\d+\.)?\d+',instr(file_name,'_',1,3)+1,1), 'TM9', 'NLS_NUMERIC_CHARACTERS = .,') orapatch from T_TXTCOLLECTION_LOAD; commit; From f881e40a5f365d1c0749927c436555b61d5f0dc6 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Sat, 22 Apr 2023 09:01:06 -0300 Subject: [PATCH 078/229] Decimal notation fix Decimal notation fix --- .../odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql | 2 +- user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql | 2 +- user_scripts/odbfcl/adb_load_symbols/load_symbols_table.sql | 2 +- .../adb_load_txtcollection_files/load_txtcollection_table.sql | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql b/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql index fddf40c..9363e38 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql @@ -8,7 +8,7 @@ select BUG_ID, substr(file_name,instr(file_name,'_',1,1)+1,instr(file_name,'_',1,2)-instr(file_name,'_',1,1)-1) oraversion, substr(file_name,instr(file_name,'_',1,2)+1,instr(file_name,'_',1,3)-instr(file_name,'_',1,2)-1) oraseries, -- to_number(substr(file_name,instr(file_name,'_',1,3)+1,instr(file_name,'.',-1)-instr(file_name,'_',1,3)-1)) orapatch - to_number(regexp_substr(file_name,'(\d+\.)?\d+',instr(file_name,'_',1,3)+1,1), 'TM9', 'NLS_NUMERIC_CHARACTERS = .,') orapatch + to_number(regexp_substr(file_name,'(\d+\.)?\d+',instr(file_name,'_',1,3)+1,1), '99999999D99', 'NLS_NUMERIC_CHARACTERS = .,') orapatch from T_BUGSFIXED_LOAD; commit; diff --git a/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql b/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql index 1ae74c6..e626f4d 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql +++ b/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql @@ -7,7 +7,7 @@ select path, substr(file_name,instr(file_name,'_',1,1)+1,instr(file_name,'_',1,2)-instr(file_name,'_',1,1)-1) oraversion, substr(file_name,instr(file_name,'_',1,2)+1,instr(file_name,'_',1,3)-instr(file_name,'_',1,2)-1) oraseries, -- to_number(substr(file_name,instr(file_name,'_',1,3)+1,instr(file_name,'.',-1)-instr(file_name,'_',1,3)-1)) orapatch - to_number(regexp_substr(file_name,'(\d+\.)?\d+',instr(file_name,'_',1,3)+1,1), 'TM9', 'NLS_NUMERIC_CHARACTERS = .,') orapatch + to_number(regexp_substr(file_name,'(\d+\.)?\d+',instr(file_name,'_',1,3)+1,1), '99999999D99', 'NLS_NUMERIC_CHARACTERS = .,') orapatch from T_FILES_LOAD; commit; diff --git a/user_scripts/odbfcl/adb_load_symbols/load_symbols_table.sql b/user_scripts/odbfcl/adb_load_symbols/load_symbols_table.sql index 21c5966..790382f 100644 --- a/user_scripts/odbfcl/adb_load_symbols/load_symbols_table.sql +++ b/user_scripts/odbfcl/adb_load_symbols/load_symbols_table.sql @@ -7,7 +7,7 @@ select file_name, substr(source_file,instr(source_file,'_',1,1)+1,instr(source_file,'_',1,2)-instr(source_file,'_',1,1)-1) oraversion, substr(source_file,instr(source_file,'_',1,2)+1,instr(source_file,'_',1,3)-instr(source_file,'_',1,2)-1) oraseries, -- to_number(substr(source_file,instr(source_file,'_',1,3)+1,instr(source_file,'.',-1)-instr(source_file,'_',1,3)-1)) orapatch - to_number(regexp_substr(file_name,'(\d+\.)?\d+',instr(file_name,'_',1,3)+1,1), 'TM9', 'NLS_NUMERIC_CHARACTERS = .,') orapatch + to_number(regexp_substr(file_name,'(\d+\.)?\d+',instr(file_name,'_',1,3)+1,1), '99999999D99', 'NLS_NUMERIC_CHARACTERS = .,') orapatch from T_SYMBOLS_LOAD; commit; diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql b/user_scripts/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql index 7f960a7..ec4b662 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql @@ -22,7 +22,7 @@ select PATH, substr(file_name,instr(file_name,'_',1,1)+1,instr(file_name,'_',1,2)-instr(file_name,'_',1,1)-1) oraversion, substr(file_name,instr(file_name,'_',1,2)+1,instr(file_name,'_',1,3)-instr(file_name,'_',1,2)-1) oraseries, -- to_number(substr(file_name,instr(file_name,'_',1,3)+1,instr(file_name,'.',-1,2)-instr(file_name,'_',1,3)-1)) orapatch - to_number(regexp_substr(file_name,'(\d+\.)?\d+',instr(file_name,'_',1,3)+1,1), 'TM9', 'NLS_NUMERIC_CHARACTERS = .,') orapatch + to_number(regexp_substr(file_name,'(\d+\.)?\d+',instr(file_name,'_',1,3)+1,1), '99999999D99', 'NLS_NUMERIC_CHARACTERS = .,') orapatch from T_TXTCOLLECTION_LOAD; commit; From 697a91ba9a9dd6753d5acf2fb041a4eee9d7141f Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 24 Apr 2023 20:35:35 -0300 Subject: [PATCH 079/229] napply support --- tasks/lvm_reload.yml | 6 ++--- tasks/patch_main.yml | 30 +++++++++++++++++++-- user_scripts/odbfcl/extract/fileCollect.yml | 2 ++ 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/tasks/lvm_reload.yml b/tasks/lvm_reload.yml index c17e8ce..83dfd2d 100644 --- a/tasks/lvm_reload.yml +++ b/tasks/lvm_reload.yml @@ -1,8 +1,8 @@ - name: "Load base snapshot {{ vm_snapshot }}" shell: | - set -e + set -e -x v_snapshot="{{ vm_snapshot }}" - v_disk='/dev/mapper/vg_u01-lv_u01' + v_disk="/dev/mapper/vg_u01-lv_u01" pkill -9 -U oracle || true sleep 5 umount -l -f /u01 || true @@ -23,7 +23,7 @@ v_size=$(lvs --noheadings -o seg_size ${v_disk}) lvcreate --size ${v_size} --snapshot --name lv_u01_${v_snapshot} ${v_disk} mount /u01 || true - mount | grep -q -F ' /u01 ' + mount | grep -q -F " /u01 " become: true become_user: root delegate_to: "{{ vm_ip_address }}" diff --git a/tasks/patch_main.yml b/tasks/patch_main.yml index 5340fbe..a3dc51f 100644 --- a/tasks/patch_main.yml +++ b/tasks/patch_main.yml @@ -10,7 +10,10 @@ - include: run_sql.yml vars: sql_param : { file : "shutdown.sql" , folder : "patch_sql" , task_action : "Stop Database for OPatch" } - when: not oci_mode + when: not oci_mode or patch.dep_type is defined + # When patch has a dependency, if the dependency is loaded running the full patch process instead of loading from lvm, the DB will be left online. + + ## APPLY ## - name: Run OPatch/opatch shell: | @@ -24,13 +27,36 @@ register: tmp_shell_output become: true become_user: oracle - when: patch.apply_method is not defined or patch.apply_method != "opatchauto" + when: patch.apply_method is not defined or patch.apply_method == "opatch" delegate_to: "{{ vm_ip_address }}" # Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" - set_fact: shell_output="{{tmp_shell_output}}" when: tmp_shell_output is not skipped + ## NAPPLY ## + + - name: Run OPatch/opatch NAPPLY + shell: | + export ORACLE_HOME ORACLE_SID + ./opatch napply -silent {{ VM_folder }}/{{ patch.patch_number }} OPatch.SKIP_VERIFY_SPACE=true + environment: + ORACLE_HOME: "{{ dbhome_locl }}" + ORACLE_SID: "{{ mysid }}" + args: + chdir: "{{ dbhome_locl }}/OPatch" + register: tmp_shell_output + become: true + become_user: oracle + when: patch.apply_method is defined and patch.apply_method == "napply" + delegate_to: "{{ vm_ip_address }}" + + # Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" + - set_fact: shell_output="{{tmp_shell_output}}" + when: tmp_shell_output is not skipped + + ## OPATCHAUTO ## + - name: Run OPatch/opatchauto shell: | export ORACLE_HOME ORACLE_SID diff --git a/user_scripts/odbfcl/extract/fileCollect.yml b/user_scripts/odbfcl/extract/fileCollect.yml index bf6ea33..5d03950 100644 --- a/user_scripts/odbfcl/extract/fileCollect.yml +++ b/user_scripts/odbfcl/extract/fileCollect.yml @@ -16,6 +16,8 @@ - block : + # TODO: Fix: tar: ./rdbms/log/stout_orcl_17338.txt: Cannot stat: No such file or directory + # SOLUTION: Stop DB before collection, or add flag to make tar ignore missing files - name: Collect text files from ORACLE_HOME shell: | find -type f -not -path "./.patch_storage/*" -not -name "tfa_setup" -print0 | xargs -0 grep -Il '.' | tar -czf {{ VM_folder }}/{{ txtcollect_file }} -T - From d1c5215295bf581953a7e1bea5a8e53cdd8e3cc7 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 25 Apr 2023 19:06:38 -0300 Subject: [PATCH 080/229] Diff calculate fix parallel issue --- .../odbfcl/diff_calculate/diff_calculate.sql | 54 ++++++++++++------- .../odbfcl/diff_calculate/diff_main.sql | 22 +++++--- 2 files changed, 48 insertions(+), 28 deletions(-) diff --git a/user_scripts/odbfcl/diff_calculate/diff_calculate.sql b/user_scripts/odbfcl/diff_calculate/diff_calculate.sql index f8e8d1f..a2dee8a 100644 --- a/user_scripts/odbfcl/diff_calculate/diff_calculate.sql +++ b/user_scripts/odbfcl/diff_calculate/diff_calculate.sql @@ -54,18 +54,18 @@ SPO gen_diff.sh PRO set -e PRO v_file_1="$1" PRO v_file_2="$2" -PRO +PRO PRO v_size=$(diff -t -bB "${v_file_1}.sql" "${v_file_2}.sql" | awk '{ print length }' | sort -n | tail -1) -PRO +PRO PRO # -2 to remove '> ' or '< ' PRO # +3 to include ' | ' -PRO if [ -z ${v_size} ] +PRO if [ -z ${v_size} ] PRO then PRO touch "${v_file_1}_${v_file_2}.txt" PRO exit 0 PRO fi PRO v_size=$(((v_size-2)*2+3)) -PRO +PRO PRO sdiff -w ${v_size} -bB -t -l "${v_file_1}.sql" "${v_file_2}.sql" | cat -n | grep -v -e '($' > "${v_file_1}_${v_file_2}.txt" SPO OFF @@ -196,14 +196,21 @@ COMPRESS NOLOGGING; SET TERMOUT ON ECHO ON -insert /*+ append */ - into DIFF_CODES (MD5_HASH_FROM, MD5_HASH_TO, DIFF_CODE) -select substr(file_name,1,instr(file_name,'_',1,1)-1), - substr(file_name,instr(file_name,'_',1,1)+1,instr(file_name,'.',1,1)-instr(file_name,'_',1,1)-1), - CONTENTS -from &&V_TABLE_NAME_CODES.; - -commit; +INSERT /*+ APPEND */ + INTO DIFF_CODES (MD5_HASH_FROM, MD5_HASH_TO, DIFF_CODE) +SELECT T1.HASH_FROM, + T1.HASH_TO, + T1.CONTENTS +FROM ( SELECT SUBSTR(FILE_NAME,1,INSTR(FILE_NAME,'_',1,1)-1) HASH_FROM, + SUBSTR(FILE_NAME,INSTR(FILE_NAME,'_',1,1)+1,INSTR(FILE_NAME,'.',1,1)-INSTR(FILE_NAME,'_',1,1)-1) HASH_TO, + CONTENTS + FROM &&V_TABLE_NAME_CODES. ) T1 +-- We need this as some other sessions in parallel can end up inserting the same row. +WHERE NOT EXISTS (SELECT 1 + FROM DIFF_CODES D + WHERE D.MD5_HASH_FROM = T1.HASH_FROM AND D.MD5_HASH_TO = T1.HASH_TO); + +COMMIT; DROP TABLE &&V_TABLE_NAME_CODES. PURGE; @@ -264,14 +271,21 @@ COMPRESS NOLOGGING; SET TERMOUT ON ECHO ON -insert /*+ append */ - into DIFF_CONTENTS (MD5_HASH_FROM, MD5_HASH_TO, DIFF_CODE) -select substr(file_name,1,instr(file_name,'_',1,1)-1), - substr(file_name,instr(file_name,'_',1,1)+1,instr(file_name,'.',1,1)-instr(file_name,'_',1,1)-1), - CONTENTS -from &&V_TABLE_NAME_CONTENTS.; - -commit; +INSERT /*+ APPEND */ + INTO DIFF_CONTENTS (MD5_HASH_FROM, MD5_HASH_TO, DIFF_CODE) +SELECT T1.HASH_FROM, + T1.HASH_TO, + T1.CONTENTS +FROM ( SELECT SUBSTR(FILE_NAME,1,INSTR(FILE_NAME,'_',1,1)-1) HASH_FROM, + SUBSTR(FILE_NAME,INSTR(FILE_NAME,'_',1,1)+1,INSTR(FILE_NAME,'.',1,1)-INSTR(FILE_NAME,'_',1,1)-1) HASH_TO, + CONTENTS + FROM &&V_TABLE_NAME_CONTENTS. ) T1 +-- We need this as some other sessions in parallel can end up inserting the same row. +WHERE NOT EXISTS (SELECT 1 + FROM DIFF_CONTENTS D + WHERE D.MD5_HASH_FROM = T1.HASH_FROM AND D.MD5_HASH_TO = T1.HASH_TO); + +COMMIT; DROP TABLE &&V_TABLE_NAME_CONTENTS. PURGE; diff --git a/user_scripts/odbfcl/diff_calculate/diff_main.sql b/user_scripts/odbfcl/diff_calculate/diff_main.sql index aa95186..ca6ad37 100644 --- a/user_scripts/odbfcl/diff_calculate/diff_main.sql +++ b/user_scripts/odbfcl/diff_calculate/diff_main.sql @@ -4,24 +4,30 @@ CREATE TABLE "DIFF_CODES" ( "MD5_HASH_FROM" RAW(16) NOT NULL, "MD5_HASH_TO" RAW(16) NOT NULL, - "DIFF_CODE" CLOB NOT NULL, - CONSTRAINT DIFF_CODES_PK PRIMARY KEY ("MD5_HASH_FROM", "MD5_HASH_TO"), - CONSTRAINT DIFF_CODES_FK_1 FOREIGN KEY ("MD5_HASH_FROM") REFERENCES DM_CODES ("MD5_HASH"), - CONSTRAINT DIFF_CODES_FK_2 FOREIGN KEY ("MD5_HASH_TO") REFERENCES DM_CODES ("MD5_HASH") + "DIFF_CODE" CLOB NOT NULL, + CONSTRAINT DIFF_CODES_PK PRIMARY KEY ("MD5_HASH_FROM", "MD5_HASH_TO"), + CONSTRAINT DIFF_CODES_F1 FOREIGN KEY ("MD5_HASH_FROM") REFERENCES DM_CODES ("MD5_HASH") ON DELETE CASCADE, + CONSTRAINT DIFF_CODES_F2 FOREIGN KEY ("MD5_HASH_TO") REFERENCES DM_CODES ("MD5_HASH") ON DELETE CASCADE ) COMPRESS NOLOGGING; +CREATE INDEX "DIFF_CODES_F1" ON "DIFF_CODES" ("MD5_HASH_FROM"); +CREATE INDEX "DIFF_CODES_F2" ON "DIFF_CODES" ("MD5_HASH_TO"); + CREATE TABLE "DIFF_CONTENTS" ( "MD5_HASH_FROM" RAW(16) NOT NULL, "MD5_HASH_TO" RAW(16) NOT NULL, - "DIFF_CODE" CLOB NOT NULL, - CONSTRAINT DIFF_CONTENTS_PK PRIMARY KEY ("MD5_HASH_FROM", "MD5_HASH_TO"), - CONSTRAINT DIFF_CONTENTS_FK_1 FOREIGN KEY ("MD5_HASH_FROM") REFERENCES DM_CONTENTS ("MD5_HASH"), - CONSTRAINT DIFF_CONTENTS_FK_2 FOREIGN KEY ("MD5_HASH_TO") REFERENCES DM_CONTENTS ("MD5_HASH") + "DIFF_CODE" CLOB NOT NULL, + CONSTRAINT DIFF_CONTENTS_PK PRIMARY KEY ("MD5_HASH_FROM", "MD5_HASH_TO"), + CONSTRAINT DIFF_CONTENTS_F1 FOREIGN KEY ("MD5_HASH_FROM") REFERENCES DM_CONTENTS ("MD5_HASH") ON DELETE CASCADE, + CONSTRAINT DIFF_CONTENTS_F2 FOREIGN KEY ("MD5_HASH_TO") REFERENCES DM_CONTENTS ("MD5_HASH") ON DELETE CASCADE ) COMPRESS NOLOGGING; +CREATE INDEX "DIFF_CONTENTS_F1" ON "DIFF_CONTENTS" ("MD5_HASH_FROM"); +CREATE INDEX "DIFF_CONTENTS_F2" ON "DIFF_CONTENTS" ("MD5_HASH_TO"); + WHENEVER SQLERROR EXIT SQL.SQLCODE DEF P_CRED = '&1' From ee00ee5ac25b8c3ec4ce7f03d8f51b9df61c021c Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 31 May 2023 18:14:23 -0300 Subject: [PATCH 081/229] New extractor version --- config_main.yml | 4 +- user_scripts/odbfcl/sh_extractor/bugsLoad.sh | 48 +++++++++++ user_scripts/odbfcl/sh_extractor/build_zip.sh | 2 +- user_scripts/odbfcl/sh_extractor/chksumGet.sh | 61 ++++++++++++++ .../odbfcl/sh_extractor/chksumLoad.sh | 48 +++++++++++ .../odbfcl/sh_extractor/cleanUser.sql | 2 +- .../odbfcl/sh_extractor/dumpCreate.sh | 21 ++--- user_scripts/odbfcl/sh_extractor/exporter.sh | 54 ++++++++++-- .../odbfcl/sh_extractor/fileCollect.sh | 36 -------- user_scripts/odbfcl/sh_extractor/fileGet.sh | 35 ++------ user_scripts/odbfcl/sh_extractor/fileLoad.sh | 82 +++++++++++++++++++ .../odbfcl/sh_extractor/get_user_prefix.sql | 2 +- .../odbfcl/sh_extractor/schemaCreate.sh | 36 ++++++++ .../odbfcl/sh_extractor/symbolLoad.sh | 48 +++++++++++ 14 files changed, 385 insertions(+), 94 deletions(-) create mode 100644 user_scripts/odbfcl/sh_extractor/bugsLoad.sh create mode 100644 user_scripts/odbfcl/sh_extractor/chksumGet.sh create mode 100644 user_scripts/odbfcl/sh_extractor/chksumLoad.sh delete mode 100644 user_scripts/odbfcl/sh_extractor/fileCollect.sh create mode 100644 user_scripts/odbfcl/sh_extractor/fileLoad.sh create mode 100644 user_scripts/odbfcl/sh_extractor/schemaCreate.sh create mode 100644 user_scripts/odbfcl/sh_extractor/symbolLoad.sh diff --git a/config_main.yml b/config_main.yml index 2c166e2..68be7a3 100644 --- a/config_main.yml +++ b/config_main.yml @@ -10,8 +10,8 @@ only_deploy_patch: false # Target DB version where dumps will be imported target_db_version: 19 # Used to check if version parameter will be required on expdp -download_patch : false # Download Mode? If true, script will try to download the patch listed in list_patches.yml if not found in "patch_location_path". +download_patch : false # Stop when patch zip is not found? Control if the code will fail or just skip that patch. -error_on_no_patch : true \ No newline at end of file +error_on_no_patch : true diff --git a/user_scripts/odbfcl/sh_extractor/bugsLoad.sh b/user_scripts/odbfcl/sh_extractor/bugsLoad.sh new file mode 100644 index 0000000..9c20344 --- /dev/null +++ b/user_scripts/odbfcl/sh_extractor/bugsLoad.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# Script to load all bugs on database +# Created by Rodrigo Jorge + +set -eo pipefail + +function echoError () +{ + (>&2 echo "$1") +} + +function exitError () +{ + echoError "$1" + exit 1 +} + +v_dump_user="$1" +v_file="$2" +v_outpref="${v_file}" + +[ -z "$v_file" ] && exitError "First parameter is the source file and cannot be null." +[ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." +[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." +[ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." + +echo "Loading bugs list. Please wait.." + +cat << EOF > "${v_outpref}_load.ctl" +LOAD +INTO TABLE ${v_dump_user}.T_BUGSFIXED +APPEND +FIELDS TERMINATED BY x'09' +(bug_id, patch_id, bug_desc) +EOF + +sqlldr \ +userid=\'/ as sysdba\' \ +control="${v_outpref}_load.ctl" \ +errors=0 \ +discardmax=0 \ +direct=Y \ +data="${v_file}" \ +log="${v_outpref}_load.log" + +rm -f "${v_outpref}_load.log" "${v_outpref}_load.ctl" + +exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/build_zip.sh b/user_scripts/odbfcl/sh_extractor/build_zip.sh index e9d8916..38df1d4 100644 --- a/user_scripts/odbfcl/sh_extractor/build_zip.sh +++ b/user_scripts/odbfcl/sh_extractor/build_zip.sh @@ -19,7 +19,7 @@ rm -f ${v_folder_name}.zip # Put all files at the same stamp to create a deterministic zip. find ${v_folder_name} -exec touch -t 202201010000 {} + -zip -rmXD ${v_folder_name}.zip ${v_folder_name} +zip -qrmXD ${v_folder_name}.zip ${v_folder_name} -x "*/.*" rmdir ${v_folder_name}/* rmdir ${v_folder_name} diff --git a/user_scripts/odbfcl/sh_extractor/chksumGet.sh b/user_scripts/odbfcl/sh_extractor/chksumGet.sh new file mode 100644 index 0000000..8be3709 --- /dev/null +++ b/user_scripts/odbfcl/sh_extractor/chksumGet.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# Script to get the sha256sum of all ORACLE_HOME files and libraries +# Created by Rodrigo Jorge + +set -eo pipefail + +function echoError () +{ + (>&2 echo "$1") +} + +function exitError () +{ + echoError "$1" + exit 1 +} + +v_output="$1" + +[ -z "$v_output" ] && exitError "First parameter is the target file and cannot be null." +[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." +[ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." + +v_output_fdr="$(cd "$(dirname "${v_output}")"; pwd)" +v_output_file="$(basename "${v_output}")" + +v_output_full="${v_output_fdr}/${v_output_file}" + +echo "Generating sha256sum list. Please wait.." + +cd "$ORACLE_HOME" +set +e +find -type f -exec sha256sum "{}" + > "${v_output_full}" +set -eo pipefail +cd - > /dev/null + +sed -i 's/$/ F/' "${v_output_full}" + +v_libs=$(find "$ORACLE_HOME" -type f -name "*.a") + +v_ext_fold=`mktemp -d` +v_out_file=`mktemp` + +IFS=$'\n' +for v_lib in ${v_libs} +do + rm -rf "${v_ext_fold}" + mkdir "${v_ext_fold}" + cd "${v_ext_fold}" + set +e + ar x "${v_lib}" + set -eo pipefail + find -type f -exec sha256sum "{}" + > "${v_out_file}" + cd - > /dev/null + sed -i "s| \.| ${v_lib}|" "${v_out_file}" + sed -i 's/$/ L/' "${v_out_file}" + cat "${v_out_file}" >> "${v_output}" + rm -rf "${v_ext_fold}" "${v_out_file}" +done + +exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/chksumLoad.sh b/user_scripts/odbfcl/sh_extractor/chksumLoad.sh new file mode 100644 index 0000000..88e0ee6 --- /dev/null +++ b/user_scripts/odbfcl/sh_extractor/chksumLoad.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# Script to load all sha256sum on database +# Created by Rodrigo Jorge + +set -eo pipefail + +function echoError () +{ + (>&2 echo "$1") +} + +function exitError () +{ + echoError "$1" + exit 1 +} + +v_dump_user="$1" +v_file="$2" +v_outpref="${v_file}" + +[ -z "$v_file" ] && exitError "First parameter is the source file and cannot be null." +[ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." +[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." +[ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." + +echo "Loading sha256sum list. Please wait.." + +cat << EOF > "${v_outpref}_load.ctl" +LOAD +INTO TABLE ${v_dump_user}.T_FILES +APPEND +FIELDS TERMINATED BY ' ' +(sha256_hash, path, file_type) +EOF + +sqlldr \ +userid=\'/ as sysdba\' \ +control="${v_outpref}_load.ctl" \ +errors=0 \ +discardmax=0 \ +direct=Y \ +data="${v_file}" \ +log="${v_outpref}_load.log" + +rm -f "${v_outpref}_load.log" "${v_outpref}_load.ctl" + +exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/cleanUser.sql b/user_scripts/odbfcl/sh_extractor/cleanUser.sql index aa0e3f7..b0aca93 100644 --- a/user_scripts/odbfcl/sh_extractor/cleanUser.sql +++ b/user_scripts/odbfcl/sh_extractor/cleanUser.sql @@ -1,5 +1,5 @@ -- This code will clean the created objects. -WHENEVER SQLERROR EXIT SQL.SQLCODE +WHENEVER SQLERROR EXIT FAILURE ROLLBACK def v_username='&1.' def v_directory='&2.' diff --git a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh index e4d8128..3e2320d 100644 --- a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh @@ -15,7 +15,8 @@ function exitError () exit 1 } -v_output="$1" +v_dump_user="$1" +v_output="$2" [ -z "$v_output" ] && exitError "First parameter is the target file and cannot be null." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." @@ -27,7 +28,6 @@ v_output_file="$(basename "${v_output}")" v_output_full="${v_output_fdr}/${v_output_file}" -v_dump_user='hash' v_dump_pass='HhAaSsHh..135' v_dump_dir_name='expdir_hash' @@ -38,25 +38,15 @@ v_output_file_noext="${v_output_file%.*}" v_output_file_cnt=`awk -F" " '{print NF-1}' <<< "${v_output_file_noext}"` [ ${v_output_file_cnt} -ne 0 ] && exitError "File \"${v_output}\" must not have any spaces." -echo "Check if common user. Please wait.." -v_common_user=$($ORACLE_HOME/bin/sqlplus -L -S "/ as sysdba" @get_user_prefix.sql) - -[ -n "${v_common_user}" ] && v_dump_user="${v_common_user}${v_dump_user}" - echo "Generating table export. Please wait.." cd "${v_thisdir}"/../ -$ORACLE_HOME/bin/sqlplus "/ as sysdba" < -# v1.0.0.4 +# v1.0.0.5 set -eo pipefail @@ -29,6 +29,9 @@ Eg: $0 ${v_example} The output is a zip file. " +# Check if ORADIFF_ONE_DUMP was exported +[ "$ORADIFF_ONE_DUMP" == "0" ] && v_one_dump=0 || v_one_dump=1 + v_pattern_cnt=`awk -F" " '{print NF-1}' <<< "${v_pattern}"` [ ${v_pattern_cnt} -ne 0 ] && exitError "Pattern \"${v_output}\" must not have any spaces. Eg: ${v_example}" @@ -36,26 +39,61 @@ v_thisdir="$(cd "$(dirname "$0")"; pwd)" v_zip=${v_pattern}.zip +################## +# Check dump user +v_dump_user='hash' + +[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." +[ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." + +echo "Check if common user. Please wait.." +v_common_user=$($ORACLE_HOME/bin/sqlplus -L -S "/ as sysdba" @get_user_prefix.sql) +[ -n "${v_common_user}" ] && v_dump_user="${v_common_user}${v_dump_user}" +################## + v_file=bugs_${v_pattern}.txt sh "${v_thisdir}/bugsGet.sh" ${v_file} -zip -m ${v_zip} ${v_file} +[ ${v_one_dump} -eq 0 ] && zip -m ${v_zip} ${v_file} v_file=sha256sum_${v_pattern}.chk -sh "${v_thisdir}/fileGet.sh" ${v_file} -zip -m ${v_zip} ${v_file} +sh "${v_thisdir}/chksumGet.sh" ${v_file} +[ ${v_one_dump} -eq 0 ] && zip -m ${v_zip} ${v_file} v_file=txtcol_${v_pattern}.tar.gz -sh "${v_thisdir}/fileCollect.sh" ${v_file} -zip -m ${v_zip} ${v_file} +sh "${v_thisdir}/fileGet.sh" ${v_file} +[ ${v_one_dump} -eq 0 ] && zip -m ${v_zip} ${v_file} v_file=symbols_${v_pattern}.csv sh "${v_thisdir}/symbolGet.sh" ${v_file} -zip -m ${v_zip} ${v_file} +[ ${v_one_dump} -eq 0 ] && zip -m ${v_zip} ${v_file} -sh "${v_thisdir}/dumpCreate.sh" ${v_pattern}.dmp +sh "${v_thisdir}/schemaCreate.sh" ${v_dump_user} + +if [ ${v_one_dump} -eq 1 ] +then + v_file=bugs_${v_pattern}.txt + sh "${v_thisdir}/bugsLoad.sh" ${v_dump_user} ${v_file} + rm -f ${v_file} + + v_file=sha256sum_${v_pattern}.chk + sh "${v_thisdir}/chksumLoad.sh" ${v_dump_user} ${v_file} + rm -f ${v_file} + + v_file=txtcol_${v_pattern}.tar.gz + sh "${v_thisdir}/fileLoad.sh" ${v_dump_user} ${v_file} + rm -f ${v_file} + + v_file=symbols_${v_pattern}.csv + sh "${v_thisdir}/symbolLoad.sh" ${v_dump_user} ${v_file} + rm -f ${v_file} +fi + +sh "${v_thisdir}/dumpCreate.sh" ${v_dump_user} ${v_pattern}.dmp mv ${v_pattern}.dmp tables_${v_pattern}.dmp mv ${v_pattern}.log tables_${v_pattern}.log zip -m ${v_pattern}.zip tables_${v_pattern}.dmp zip -m ${v_pattern}.zip tables_${v_pattern}.log +echo "Script Finished." + exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/fileCollect.sh b/user_scripts/odbfcl/sh_extractor/fileCollect.sh deleted file mode 100644 index 005133e..0000000 --- a/user_scripts/odbfcl/sh_extractor/fileCollect.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# Script to get all non-binary files in ORACLE_HOME -# Created by Rodrigo Jorge - -set -eo pipefail - -function echoError () -{ - (>&2 echo "$1") -} - -function exitError () -{ - echoError "$1" - exit 1 -} - -v_output="$1" - -[ -z "$v_output" ] && exitError "First parameter is the target file and cannot be null." -[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." -[ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." - -v_output_fdr="$(cd "$(dirname "${v_output}")"; pwd)" -v_output_file="$(basename "${v_output}")" - -v_output_full="${v_output_fdr}/${v_output_file}" - -echo "Generating ORACLE_HOME non-binary files list. Please wait.." - -cd "$ORACLE_HOME" - -set +e # grep may return "Permission denied" -find -type f -not -path "./.patch_storage/*" -not -name "tfa_setup" -print0 | xargs -0 grep -Il '.' | tar -czf "${v_output_full}" -T - - -exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/fileGet.sh b/user_scripts/odbfcl/sh_extractor/fileGet.sh index 8be3709..005133e 100644 --- a/user_scripts/odbfcl/sh_extractor/fileGet.sh +++ b/user_scripts/odbfcl/sh_extractor/fileGet.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Script to get the sha256sum of all ORACLE_HOME files and libraries +# Script to get all non-binary files in ORACLE_HOME # Created by Rodrigo Jorge set -eo pipefail @@ -26,36 +26,11 @@ v_output_file="$(basename "${v_output}")" v_output_full="${v_output_fdr}/${v_output_file}" -echo "Generating sha256sum list. Please wait.." +echo "Generating ORACLE_HOME non-binary files list. Please wait.." cd "$ORACLE_HOME" -set +e -find -type f -exec sha256sum "{}" + > "${v_output_full}" -set -eo pipefail -cd - > /dev/null - -sed -i 's/$/ F/' "${v_output_full}" - -v_libs=$(find "$ORACLE_HOME" -type f -name "*.a") - -v_ext_fold=`mktemp -d` -v_out_file=`mktemp` - -IFS=$'\n' -for v_lib in ${v_libs} -do - rm -rf "${v_ext_fold}" - mkdir "${v_ext_fold}" - cd "${v_ext_fold}" - set +e - ar x "${v_lib}" - set -eo pipefail - find -type f -exec sha256sum "{}" + > "${v_out_file}" - cd - > /dev/null - sed -i "s| \.| ${v_lib}|" "${v_out_file}" - sed -i 's/$/ L/' "${v_out_file}" - cat "${v_out_file}" >> "${v_output}" - rm -rf "${v_ext_fold}" "${v_out_file}" -done + +set +e # grep may return "Permission denied" +find -type f -not -path "./.patch_storage/*" -not -name "tfa_setup" -print0 | xargs -0 grep -Il '.' | tar -czf "${v_output_full}" -T - exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/fileLoad.sh b/user_scripts/odbfcl/sh_extractor/fileLoad.sh new file mode 100644 index 0000000..e1a2ea8 --- /dev/null +++ b/user_scripts/odbfcl/sh_extractor/fileLoad.sh @@ -0,0 +1,82 @@ +#!/bin/bash +# Script to load all non-binary files on database +# Created by Rodrigo Jorge + +set -eo pipefail + +function echoError () +{ + (>&2 echo "$1") +} + +function exitError () +{ + echoError "$1" + exit 1 +} + +v_dump_user="$1" +v_file="$2" +v_outpref="${v_file}" + +[ -z "$v_file" ] && exitError "First parameter is the source file and cannot be null." +[ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." +[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." +[ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." + +echo "Loading ORACLE_HOME non-binary files. Please wait.." + +rm -rf "${v_outpref}_unzip" +mkdir "${v_outpref}_unzip" +tar -tvf "${v_file}" | grep -o '\./.*' > "${v_outpref}_unzip/${v_file}_files.txt" +tar -xf "${v_file}" -C "${v_outpref}_unzip" + +cd "${v_outpref}_unzip" + +$ORACLE_HOME/bin/sqlplus -L -S "/ as sysdba" < "${v_outpref}_load.ctl" +LOAD +INTO TABLE ${v_dump_user}.T_TXTCOLLECTION_LOAD +APPEND +FIELDS TERMINATED BY ',' +( path, contents lobfile(path) terminated by eof) +EOF + +sqlldr \ +userid=\'/ as sysdba\' \ +control="${v_outpref}_load.ctl" \ +errors=0 \ +discardmax=0 \ +direct=Y \ +data="${v_file}_files.txt" \ +log="${v_outpref}_load.log" + +cd .. +rm -rf "${v_outpref}_unzip" + +$ORACLE_HOME/bin/sqlplus -L -S "/ as sysdba" < + +set -eo pipefail + +function echoError () +{ + (>&2 echo "$1") +} + +function exitError () +{ + echoError "$1" + exit 1 +} + +v_dump_user="$1" + +[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." +[ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." + +v_dump_pass='HhAaSsHh..135' + +v_thisdir="$(cd "$(dirname "$0")"; pwd)" + +echo "Generating export user. Please wait.." + +cd "${v_thisdir}" +$ORACLE_HOME/bin/sqlplus "/ as sysdba" < + +set -eo pipefail + +function echoError () +{ + (>&2 echo "$1") +} + +function exitError () +{ + echoError "$1" + exit 1 +} + +v_dump_user="$1" +v_file="$2" +v_outpref="${v_file}" + +[ -z "$v_file" ] && exitError "First parameter is the source file and cannot be null." +[ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." +[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." +[ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." + +echo "Loading symbols list. Please wait.." + +cat << EOF > "${v_outpref}_load.ctl" +LOAD +INTO TABLE ${v_dump_user}.T_SYMBOLS +APPEND +FIELDS TERMINATED BY '|' +(file_name, symbol_type, symbol_name char(4000)) +EOF + +sqlldr \ +userid=\'/ as sysdba\' \ +control="${v_outpref}_load.ctl" \ +errors=0 \ +discardmax=0 \ +direct=Y \ +data="${v_file}" \ +log="${v_outpref}_load.log" + +rm -f "${v_outpref}_load.log" "${v_outpref}_load.ctl" + +exit 0 \ No newline at end of file From 2f5c335b49da160e1c02675ce2869a68b42ebc5c Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 1 Jun 2023 11:15:19 -0300 Subject: [PATCH 082/229] Update exporter scripts --- user_scripts/odbfcl/sh_extractor/dumpCreate.sh | 13 ++++++++++++- user_scripts/odbfcl/sh_extractor/exporter.sh | 8 ++++---- user_scripts/odbfcl/sh_extractor/fileLoad.sh | 7 +++++-- user_scripts/odbfcl/sh_extractor/get_db_version.sql | 13 +++++++++++++ 4 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 user_scripts/odbfcl/sh_extractor/get_db_version.sql diff --git a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh index 3e2320d..8773f9e 100644 --- a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh @@ -50,10 +50,21 @@ $ORACLE_HOME/bin/sqlplus -L -S "/ as sysdba" < "${v_outpref}_load.ctl" @@ -60,7 +62,8 @@ rm -rf "${v_outpref}_unzip" $ORACLE_HOME/bin/sqlplus -L -S "/ as sysdba" < Date: Thu, 1 Jun 2023 11:17:45 -0300 Subject: [PATCH 083/229] Update config_oci.yml --- config_oci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_oci.yml b/config_oci.yml index 307a059..f41edad 100644 --- a/config_oci.yml +++ b/config_oci.yml @@ -2,7 +2,7 @@ # Patch location path: Can be the local folder path or the bucket name. # Folder where the database patches are placed. The patches can also be placed in sub-folders of the directory specified below. patch_location_type : bucket -patch_location_path : oradiff_patches +patch_location_path : patches # Folder in RW mode on local compute and shared with the VM. It is used to move the patches to the VMs and also to copy back the expdp output. stage_folder : "/u01/patch_automation/stage" From c28546fa60694f3bbe9bafa803a5c4afab3a5b5f Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 1 Jun 2023 11:18:38 -0300 Subject: [PATCH 084/229] Update build_zip.sh --- user_scripts/odbfcl/sh_extractor/build_zip.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_scripts/odbfcl/sh_extractor/build_zip.sh b/user_scripts/odbfcl/sh_extractor/build_zip.sh index 38df1d4..d878d0b 100644 --- a/user_scripts/odbfcl/sh_extractor/build_zip.sh +++ b/user_scripts/odbfcl/sh_extractor/build_zip.sh @@ -1,6 +1,6 @@ set -eo pipefail -v_folder_name="oradiff_exporter" +v_folder_name="db_exporter" mkdir ${v_folder_name} cp -a ../extract/ ${v_folder_name} cp -a ../createUser.sql ${v_folder_name} From 6105824dd02a48811adad773ee0cf17c835d9cd1 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 1 Jun 2023 11:21:07 -0300 Subject: [PATCH 085/229] Update exporter.sh --- user_scripts/odbfcl/sh_extractor/exporter.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/user_scripts/odbfcl/sh_extractor/exporter.sh b/user_scripts/odbfcl/sh_extractor/exporter.sh index c967cb0..e4536cb 100644 --- a/user_scripts/odbfcl/sh_extractor/exporter.sh +++ b/user_scripts/odbfcl/sh_extractor/exporter.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Script to collect all info needed for ORAdiff +# Script to collect all info needed from the DB # Created by Rodrigo Jorge # v1.0.0.5 @@ -48,28 +48,28 @@ v_common_user=$($ORACLE_HOME/bin/sqlplus -L -S "/ as sysdba" @get_user_prefix.sq [ -n "${v_common_user}" ] && v_dump_user="${v_common_user}${v_dump_user}" ################## -# Check if ORADIFF_ONE_DUMP was exported -[ "$ORADIFF_ONE_DUMP" == "0" ] && v_one_dump=0 || v_one_dump=1 +# Check if EXPORT_ONLY_DUMP was exported +[ "$EXPORT_ONLY_DUMP" == "0" ] && v_only_dump=0 || v_only_dump=1 v_file=bugs_${v_pattern}.txt sh "${v_thisdir}/bugsGet.sh" ${v_file} -[ ${v_one_dump} -eq 0 ] && zip -m ${v_zip} ${v_file} +[ ${v_only_dump} -eq 0 ] && zip -m ${v_zip} ${v_file} v_file=sha256sum_${v_pattern}.chk sh "${v_thisdir}/chksumGet.sh" ${v_file} -[ ${v_one_dump} -eq 0 ] && zip -m ${v_zip} ${v_file} +[ ${v_only_dump} -eq 0 ] && zip -m ${v_zip} ${v_file} v_file=txtcol_${v_pattern}.tar.gz sh "${v_thisdir}/fileGet.sh" ${v_file} -[ ${v_one_dump} -eq 0 ] && zip -m ${v_zip} ${v_file} +[ ${v_only_dump} -eq 0 ] && zip -m ${v_zip} ${v_file} v_file=symbols_${v_pattern}.csv sh "${v_thisdir}/symbolGet.sh" ${v_file} -[ ${v_one_dump} -eq 0 ] && zip -m ${v_zip} ${v_file} +[ ${v_only_dump} -eq 0 ] && zip -m ${v_zip} ${v_file} sh "${v_thisdir}/schemaCreate.sh" ${v_dump_user} -if [ ${v_one_dump} -eq 1 ] +if [ ${v_only_dump} -eq 1 ] then v_file=bugs_${v_pattern}.txt sh "${v_thisdir}/bugsLoad.sh" ${v_dump_user} ${v_file} From 34e5ed9b29aff3c4665d15f36d825cb3d8631837 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 1 Jun 2023 11:21:22 -0300 Subject: [PATCH 086/229] Update .gitignore --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 65370db..b889aa7 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,6 @@ config_oci_leg.yml config_oci_dev.yml tasks/main_loader_uploads.yml tasks/main_loader_uploads.yml.old -loader_uploads.yml \ No newline at end of file +loader_uploads.yml +config_oci.yml +user_scripts/odbfcl/sh_extractor/build_zip.sh From 91d4cdedae22112535ab8e7962ae134a5dd78eff Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 1 Jun 2023 11:25:50 -0300 Subject: [PATCH 087/229] Update .gitignore --- .gitignore | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index b889aa7..30626ce 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,15 @@ .DS_Store -main.retry -*.txt *.log +*.txt /user_scripts/report/* -user_scripts/odbfcl/sh_extractor/*.zip -config_oci_stg.yml -config_oci_prd.yml -config_oci_leg.yml config_oci_dev.yml +config_oci_leg.yml +config_oci_prd.yml +config_oci_stg.yml +config_oci.yml +loader_uploads.yml +main.retry tasks/main_loader_uploads.yml tasks/main_loader_uploads.yml.old -loader_uploads.yml -config_oci.yml +user_scripts/odbfcl/sh_extractor/*.zip user_scripts/odbfcl/sh_extractor/build_zip.sh From 514d3e87c8b2be4bddd41e39c4a31de33951d1cc Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 1 Jun 2023 11:45:02 -0300 Subject: [PATCH 088/229] Update exporter.sh --- user_scripts/odbfcl/sh_extractor/exporter.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/user_scripts/odbfcl/sh_extractor/exporter.sh b/user_scripts/odbfcl/sh_extractor/exporter.sh index e4536cb..c8f6cc9 100644 --- a/user_scripts/odbfcl/sh_extractor/exporter.sh +++ b/user_scripts/odbfcl/sh_extractor/exporter.sh @@ -48,8 +48,9 @@ v_common_user=$($ORACLE_HOME/bin/sqlplus -L -S "/ as sysdba" @get_user_prefix.sq [ -n "${v_common_user}" ] && v_dump_user="${v_common_user}${v_dump_user}" ################## -# Check if EXPORT_ONLY_DUMP was exported -[ "$EXPORT_ONLY_DUMP" == "0" ] && v_only_dump=0 || v_only_dump=1 +# Check if EXPORT_MERGE_DUMP was exported. +# If EXPORT_MERGE_DUMP=0, then the generated ORACLE_HOME related files (bugs, symbols, chksum, etc) won't be loaded on a table, but added to zip as separate files. +[ "$EXPORT_MERGE_DUMP" == "0" ] && v_only_dump=0 || v_only_dump=1 v_file=bugs_${v_pattern}.txt sh "${v_thisdir}/bugsGet.sh" ${v_file} From f62785b7b1417992cfb6046a0031816e1b28dc0e Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 1 Jun 2023 13:59:56 -0300 Subject: [PATCH 089/229] Move files --- config_oci.yml | 8 ++++---- .../odbfcl/{extract => adb_load_bugs_fixed}/bugsGet.yml | 0 .../odbfcl/{extract => adb_load_filechksum}/fileGet.yml | 0 .../odbfcl/{extract => adb_load_symbols}/symbolGet.yml | 0 .../fileCollect.yml | 0 5 files changed, 4 insertions(+), 4 deletions(-) rename user_scripts/odbfcl/{extract => adb_load_bugs_fixed}/bugsGet.yml (100%) rename user_scripts/odbfcl/{extract => adb_load_filechksum}/fileGet.yml (100%) rename user_scripts/odbfcl/{extract => adb_load_symbols}/symbolGet.yml (100%) rename user_scripts/odbfcl/{extract => adb_load_txtcollection_files}/fileCollect.yml (100%) diff --git a/config_oci.yml b/config_oci.yml index f41edad..3da7aed 100644 --- a/config_oci.yml +++ b/config_oci.yml @@ -24,10 +24,10 @@ downloader_user : "" downloader_pass : "" # Files in "user_scripts" folder that will run before and after the final expdp. script_types can be "shell", "sql" or "yml". user_expdp_pre : -- { file : "bugsGet.yml" , folder : "user_scripts/odbfcl/extract" , type : "yml", task_action : "Generate fixed bugs list for ORACLE_HOME" } -- { file : "fileGet.yml" , folder : "user_scripts/odbfcl/extract" , type : "yml", task_action : "Generate chksum for ORACLE_HOME" } -- { file : "fileCollect.yml" , folder : "user_scripts/odbfcl/extract" , type : "yml", task_action : "Collect non-binary files from ORACLE_HOME" } -- { file : "symbolGet.yml" , folder : "user_scripts/odbfcl/extract" , type : "yml", task_action : "Get all symbols on ORACLE_HOME binaries and libs" } +- { file : "bugsGet.yml" , folder : "user_scripts/odbfcl/adb_load_bugs_fixed" , type : "yml", task_action : "Generate fixed bugs list for ORACLE_HOME" } +- { file : "fileGet.yml" , folder : "user_scripts/odbfcl/adb_load_filechksum" , type : "yml", task_action : "Generate chksum for ORACLE_HOME" } +- { file : "fileCollect.yml" , folder : "user_scripts/odbfcl/adb_load_txtcollection_files" , type : "yml", task_action : "Collect non-binary files from ORACLE_HOME" } +- { file : "symbolGet.yml" , folder : "user_scripts/adb_load_symbols" , type : "yml", task_action : "Get all symbols on ORACLE_HOME binaries and libs" } - { file : "tables_recreate.yml" , folder : "user_scripts/odbfcl" , type : "yml" , task_action : "Recreate tables" } - { file : "hashGet.yml" , folder : "user_scripts/odbfcl/extract" , type : "yml", task_action : "Collect Database Info" } - { file : "externalDir.yml" , type : "yml" , task_action : "Create External Directory" } diff --git a/user_scripts/odbfcl/extract/bugsGet.yml b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.yml similarity index 100% rename from user_scripts/odbfcl/extract/bugsGet.yml rename to user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.yml diff --git a/user_scripts/odbfcl/extract/fileGet.yml b/user_scripts/odbfcl/adb_load_filechksum/fileGet.yml similarity index 100% rename from user_scripts/odbfcl/extract/fileGet.yml rename to user_scripts/odbfcl/adb_load_filechksum/fileGet.yml diff --git a/user_scripts/odbfcl/extract/symbolGet.yml b/user_scripts/odbfcl/adb_load_symbols/symbolGet.yml similarity index 100% rename from user_scripts/odbfcl/extract/symbolGet.yml rename to user_scripts/odbfcl/adb_load_symbols/symbolGet.yml diff --git a/user_scripts/odbfcl/extract/fileCollect.yml b/user_scripts/odbfcl/adb_load_txtcollection_files/fileCollect.yml similarity index 100% rename from user_scripts/odbfcl/extract/fileCollect.yml rename to user_scripts/odbfcl/adb_load_txtcollection_files/fileCollect.yml From 1fc843edc3e057063647cf0bf9cbf73a46d0ab1c Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 1 Jun 2023 15:09:15 -0300 Subject: [PATCH 090/229] Reorg files --- .../bugsGet.sh | 3 +- .../odbfcl/adb_load_bugs_fixed/bugsGet.yml | 28 +------- .../bugsLoad.sh | 0 .../chksumGet.sh | 5 +- .../odbfcl/adb_load_filechksum/chksumGet.yml | 37 ++++++++++ .../chksumLoad.sh | 0 .../odbfcl/adb_load_filechksum/fileGet.yml | 68 ------------------- .../symbolGet.sh | 5 +- .../odbfcl/adb_load_symbols/symbolGet.yml | 31 ++------- .../symbolLoad.sh | 0 .../fileGet.sh | 6 +- .../{fileCollect.yml => fileGet.yml} | 20 +++--- .../fileLoad.sh | 0 13 files changed, 68 insertions(+), 135 deletions(-) rename user_scripts/odbfcl/{sh_extractor => adb_load_bugs_fixed}/bugsGet.sh (99%) rename user_scripts/odbfcl/{sh_extractor => adb_load_bugs_fixed}/bugsLoad.sh (100%) rename user_scripts/odbfcl/{sh_extractor => adb_load_filechksum}/chksumGet.sh (95%) create mode 100644 user_scripts/odbfcl/adb_load_filechksum/chksumGet.yml rename user_scripts/odbfcl/{sh_extractor => adb_load_filechksum}/chksumLoad.sh (100%) delete mode 100644 user_scripts/odbfcl/adb_load_filechksum/fileGet.yml rename user_scripts/odbfcl/{sh_extractor => adb_load_symbols}/symbolGet.sh (98%) rename user_scripts/odbfcl/{sh_extractor => adb_load_symbols}/symbolLoad.sh (100%) rename user_scripts/odbfcl/{sh_extractor => adb_load_txtcollection_files}/fileGet.sh (83%) rename user_scripts/odbfcl/adb_load_txtcollection_files/{fileCollect.yml => fileGet.yml} (65%) rename user_scripts/odbfcl/{sh_extractor => adb_load_txtcollection_files}/fileLoad.sh (100%) diff --git a/user_scripts/odbfcl/sh_extractor/bugsGet.sh b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh similarity index 99% rename from user_scripts/odbfcl/sh_extractor/bugsGet.sh rename to user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh index f44dfd0..b9ed14c 100644 --- a/user_scripts/odbfcl/sh_extractor/bugsGet.sh +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh @@ -18,9 +18,10 @@ function exitError () v_output="$1" [ -z "$v_output" ] && exitError "First parameter is the target file and cannot be null." -[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." +[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." + echo "Generating bugs list. Please wait.." "${ORACLE_HOME}"/OPatch/opatch lsinv -bugs_fixed | diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.yml b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.yml index 6ae901b..709dfe6 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.yml +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.yml @@ -15,35 +15,11 @@ shell: | set -eo pipefail - export ORACLE_HOME ORACLE_SID - - ./opatch lsinv -bugs_fixed | - # Remove lines before this entry (inclusive) - sed '1,/^List of Bugs fixed by Installed Patches/d' | - # Remove lines before this entry (inclusive) - sed '1,/^---/d' | - # Remove lines after this entry (inclusive) - sed '/^---/Q' | - # Remove empty lines - sed '/^$/d' | - # Remove breaks from lines not starting with number - sed ':a $!{N; ba}; s/\n\+/\n/g; s/\n\([^0-9]\)/\1/g' | - # Remove double spaces - sed -E 's/[[:space:]]+/ /g' | - # Remove date columns - awk '{$3=$4=$5=$6=$7=$8=""; print $0}' | - # Remove double spaces again after column removal - sed -E 's/[[:space:]]+/ /g' | - # Replace first space per tab - sed 's/ /'$'\t''/' | - # Replace first space per tab (that was the second) - sed 's/ /'$'\t''/' > {{ VM_folder }}/{{ bugs_fixed_file }} + export ORACLE_HOME + {{ VM_folder }}/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh "{{ VM_folder }}/{{ bugs_fixed_file }}" environment: ORACLE_HOME: "{{ dbhome_locl }}" - ORACLE_SID: "{{ mysid }}" - args: - chdir: "{{ dbhome_locl }}/OPatch" become: true become_user: oracle delegate_to: "{{ vm_ip_address }}" diff --git a/user_scripts/odbfcl/sh_extractor/bugsLoad.sh b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh similarity index 100% rename from user_scripts/odbfcl/sh_extractor/bugsLoad.sh rename to user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh diff --git a/user_scripts/odbfcl/sh_extractor/chksumGet.sh b/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh similarity index 95% rename from user_scripts/odbfcl/sh_extractor/chksumGet.sh rename to user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh index 8be3709..c841a75 100644 --- a/user_scripts/odbfcl/sh_extractor/chksumGet.sh +++ b/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh @@ -18,9 +18,10 @@ function exitError () v_output="$1" [ -z "$v_output" ] && exitError "First parameter is the target file and cannot be null." -[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." +[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." + v_output_fdr="$(cd "$(dirname "${v_output}")"; pwd)" v_output_file="$(basename "${v_output}")" @@ -41,6 +42,8 @@ v_libs=$(find "$ORACLE_HOME" -type f -name "*.a") v_ext_fold=`mktemp -d` v_out_file=`mktemp` +echo "Generate files checksum for static libs. Please wait.." + IFS=$'\n' for v_lib in ${v_libs} do diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumGet.yml b/user_scripts/odbfcl/adb_load_filechksum/chksumGet.yml new file mode 100644 index 0000000..5831a16 --- /dev/null +++ b/user_scripts/odbfcl/adb_load_filechksum/chksumGet.yml @@ -0,0 +1,37 @@ +- name : Define chksum filename and folder + set_fact: + sha256_file: "sha256sum_{{ file_suffix }}.chk" + chksum_folder: "{{ output_folder }}/binsum" + +- name: "Check if {{ chksum_folder }}/{{ sha256_file }} exists" + stat: + path: "{{ chksum_folder }}/{{ sha256_file }}" + register: chksum_stat_result + +# Will skip all the rest if the chksum file exists +- block : + + - name: Generate files checksum + shell: | + set -eo pipefail + + export ORACLE_HOME + + {{ VM_folder }}/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh "{{ VM_folder }}/{{ sha256_file }}" + environment: + ORACLE_HOME: "{{ dbhome_locl }}" + become: true + become_user: root + delegate_to: "{{ vm_ip_address }}" + + - name: Copy {{ sha256_file }} to repository + copy: + src: "{{ shared_folder }}/{{ sha256_file }}" + dest: "{{ chksum_folder }}" + + - name : "Remove file {{ sha256_file }}" + file: + state: absent + path: "{{ shared_folder }}/{{ sha256_file }}" + + when: not chksum_stat_result.stat.exists \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/chksumLoad.sh b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh similarity index 100% rename from user_scripts/odbfcl/sh_extractor/chksumLoad.sh rename to user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh diff --git a/user_scripts/odbfcl/adb_load_filechksum/fileGet.yml b/user_scripts/odbfcl/adb_load_filechksum/fileGet.yml deleted file mode 100644 index 17b8b15..0000000 --- a/user_scripts/odbfcl/adb_load_filechksum/fileGet.yml +++ /dev/null @@ -1,68 +0,0 @@ -# Folder to store the final generated ORACLE_HOME checksum -- name : Define folder name - set_fact: - chksum_folder: "{{ output_folder }}/binsum" - -- name : Define file names - set_fact: - sha256_file: "sha256sum_{{ file_suffix }}.chk" - -- name: "Check if {{ chksum_folder }}/{{ sha256_file }} exists" - stat: - path: "{{ chksum_folder }}/{{ sha256_file }}" - register: chksum_stat_result - -# Will skip all the rest if the chksum file exists -- name : Define exists_chksum - set_fact: - exists_chksum: "{{ chksum_stat_result.stat.exists }}" - -- block : - - - name: Generate files checksum - shell: | - find -type f -exec sha256sum "{}" + > {{ VM_folder }}/{{ sha256_file }} - sed -i 's/$/ F/' {{ VM_folder }}/{{ sha256_file }} - args: - chdir: "{{ dbhome_locl }}" - become: true - become_user: root - delegate_to: "{{ vm_ip_address }}" - - - name: Generate files checksum for static libs - shell: | - v_libs=$(find {{ dbhome_locl }} -type f -name "*.a") - - v_ext_fold=/tmp/statlib - v_out_file=/tmp/statlib_list.txt - - IFS=$'\n' - for v_lib in ${v_libs} - do - rm -rf ${v_ext_fold} - mkdir ${v_ext_fold} - cd ${v_ext_fold} - ar x "${v_lib}" - find -type f -exec sha256sum "{}" + > ${v_out_file} - sed -i "s| \.| ${v_lib}|" ${v_out_file} - sed -i 's/$/ L/' ${v_out_file} - cat ${v_out_file} >> {{ VM_folder }}/{{ sha256_file }} - rm -rf ${v_ext_fold} ${v_out_file} - done - args: - chdir: "{{ dbhome_locl }}" - become: true - become_user: root - delegate_to: "{{ vm_ip_address }}" - - - name: Copy {{ sha256_file }} to repository - copy: - src: "{{ shared_folder }}/{{ sha256_file }}" - dest: "{{ chksum_folder }}" - - - name : "Remove file {{ sha256_file }}" - file: - state: absent - path: "{{ shared_folder }}/{{ sha256_file }}" - - when: exists_chksum == false \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/symbolGet.sh b/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh similarity index 98% rename from user_scripts/odbfcl/sh_extractor/symbolGet.sh rename to user_scripts/odbfcl/adb_load_symbols/symbolGet.sh index 9823c30..af65cac 100644 --- a/user_scripts/odbfcl/sh_extractor/symbolGet.sh +++ b/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh @@ -2,6 +2,8 @@ # Script to list all symbols in ORACLE_HOME # Created by Rodrigo Jorge +# Thanks Frits Hooglang + # set -eo pipefail set -e # grep can return 0 lines @@ -19,9 +21,10 @@ function exitError () v_output="$1" [ -z "$v_output" ] && exitError "First parameter is the target file and cannot be null." -[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." +[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." + echo > "${v_output}" echo "Generating symbols list. Please wait.." diff --git a/user_scripts/odbfcl/adb_load_symbols/symbolGet.yml b/user_scripts/odbfcl/adb_load_symbols/symbolGet.yml index bc30b7d..261530a 100644 --- a/user_scripts/odbfcl/adb_load_symbols/symbolGet.yml +++ b/user_scripts/odbfcl/adb_load_symbols/symbolGet.yml @@ -1,11 +1,7 @@ -# Folder to store the collected ORACLE_HOME text files -- name : Define symbols folder name - set_fact: - symbols_folder: "{{ output_folder }}/symbols" - -- name : Define symbols file names +- name : Define symbols filename and folder set_fact: symbols_file: "symbols_{{ file_suffix }}.csv" + symbols_folder: "{{ output_folder }}/symbols" - name: "Check if {{ symbols_folder }}/{{ symbols_file }} exists" stat: @@ -13,32 +9,15 @@ register: symbols_stat_result # Will skip the rest if the symbols file exists - - block : - # Thanks Frits Hooglang - name: Collect symbols from ORACLE_HOME shell: | - echo > "{{ VM_folder }}/{{ symbols_file }}" - - # Extract Symbols from Oracle archives (.a) - for ARCHIVE in $(ls $ORACLE_HOME/lib/*.a $ORACLE_HOME/rdbms/lib/*.a); do - nm -A $ARCHIVE | grep ' [Tt] ' | tr ':' ' ' | cut -d" " -f1,2,4,5 | sort -u | awk '{ if ( $4 != "" ) { file=$1; sub(".*/","", file); printf "%s/%s|%s|%s\n", file, $2, $3, $4 } }' >> "{{ VM_folder }}/{{ symbols_file }}" - done - - # Extract Symbols from Oracle objects (.o) - for OBJECT in $(ls $ORACLE_HOME/lib/*.o $ORACLE_HOME/rdbms/lib/*.o); do - nm -A $OBJECT | grep ' [Tt] ' | tr ':' ' ' | cut -d" " -f1,3,4 | sort -u | awk '{ if ( $3 != "" ) { file=$1; sub(".*/","", file); printf "%s|%s|%s\n", file, $2, $3 } }' >> "{{ VM_folder }}/{{ symbols_file }}" - done - - # Extract Symbols from Oracle executable - nm -A -C $ORACLE_HOME/bin/oracle | grep ' [TtDdRrVv] ' | tr ':' ' ' | cut -d" " -f1,3,4 | sort -u | awk '{ if ( $3 != "" ) { file=$1; sub(".*/","", file); printf "%s|%s|%s\n", file, $2, $3 } }' >> "{{ VM_folder }}/{{ symbols_file }}" + set -eo pipefail - # Remove empty lines or sqlldr will fail due to constant. - sed -i '/^$/d' "{{ VM_folder }}/{{ symbols_file }}" + export ORACLE_HOME - args: - chdir: "{{ dbhome_locl }}" + {{ VM_folder }}/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh "{{ VM_folder }}/{{ symbols_file }}" environment: ORACLE_HOME: "{{ dbhome_locl }}" become: true diff --git a/user_scripts/odbfcl/sh_extractor/symbolLoad.sh b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh similarity index 100% rename from user_scripts/odbfcl/sh_extractor/symbolLoad.sh rename to user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh diff --git a/user_scripts/odbfcl/sh_extractor/fileGet.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh similarity index 83% rename from user_scripts/odbfcl/sh_extractor/fileGet.sh rename to user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh index 005133e..a0aebb5 100644 --- a/user_scripts/odbfcl/sh_extractor/fileGet.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh @@ -2,6 +2,9 @@ # Script to get all non-binary files in ORACLE_HOME # Created by Rodrigo Jorge +# TODO: Fix: tar: ./rdbms/log/stout_orcl_17338.txt: Cannot stat: No such file or directory +# SOLUTION: Stop DB before collection, or add flag to make tar ignore missing files + set -eo pipefail function echoError () @@ -18,9 +21,10 @@ function exitError () v_output="$1" [ -z "$v_output" ] && exitError "First parameter is the target file and cannot be null." -[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." +[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." + v_output_fdr="$(cd "$(dirname "${v_output}")"; pwd)" v_output_file="$(basename "${v_output}")" diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileCollect.yml b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.yml similarity index 65% rename from user_scripts/odbfcl/adb_load_txtcollection_files/fileCollect.yml rename to user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.yml index 5d03950..f68a2d7 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileCollect.yml +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.yml @@ -1,11 +1,8 @@ # Folder to store the collected ORACLE_HOME text files -- name : Define txtcollect folder name - set_fact: - txtcollect_folder: "{{ output_folder }}/txtcollect" - -- name : Define txtcollect file names +- name : Define txtcollect filename and folder set_fact: txtcollect_file: "txtcol_{{ file_suffix }}.tar.gz" + txtcollect_folder: "{{ output_folder }}/txtcollect" - name: "Check if {{ txtcollect_folder }}/{{ txtcollect_file }} exists" stat: @@ -13,16 +10,17 @@ register: txtcollect_stat_result # Will skip the rest if the txtcollect file exists - - block : - # TODO: Fix: tar: ./rdbms/log/stout_orcl_17338.txt: Cannot stat: No such file or directory - # SOLUTION: Stop DB before collection, or add flag to make tar ignore missing files - name: Collect text files from ORACLE_HOME shell: | - find -type f -not -path "./.patch_storage/*" -not -name "tfa_setup" -print0 | xargs -0 grep -Il '.' | tar -czf {{ VM_folder }}/{{ txtcollect_file }} -T - - args: - chdir: "{{ dbhome_locl }}" + set -eo pipefail + + export ORACLE_HOME + + {{ VM_folder }}/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh "{{ VM_folder }}/{{ txtcollect_file }}" + environment: + ORACLE_HOME: "{{ dbhome_locl }}" become: true become_user: root delegate_to: "{{ vm_ip_address }}" diff --git a/user_scripts/odbfcl/sh_extractor/fileLoad.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh similarity index 100% rename from user_scripts/odbfcl/sh_extractor/fileLoad.sh rename to user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh From 7c3af91a244917d4721cefa6110194d1cf581a51 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 1 Jun 2023 15:10:12 -0300 Subject: [PATCH 091/229] Fix exporter scripts --- user_scripts/odbfcl/sh_extractor/build_zip.sh | 11 +++- .../odbfcl/sh_extractor/dictionaryGet.sh | 35 +++++++++++++ .../odbfcl/sh_extractor/dumpCreate.sh | 11 ++-- user_scripts/odbfcl/sh_extractor/exporter.sh | 50 +++++++++++++------ .../odbfcl/sh_extractor/schemaCreate.sh | 2 +- 5 files changed, 84 insertions(+), 25 deletions(-) create mode 100644 user_scripts/odbfcl/sh_extractor/dictionaryGet.sh diff --git a/user_scripts/odbfcl/sh_extractor/build_zip.sh b/user_scripts/odbfcl/sh_extractor/build_zip.sh index d878d0b..04503e1 100644 --- a/user_scripts/odbfcl/sh_extractor/build_zip.sh +++ b/user_scripts/odbfcl/sh_extractor/build_zip.sh @@ -7,10 +7,19 @@ cp -a ../createUser.sql ${v_folder_name} cp -a ../tables_recreate.sql ${v_folder_name} cp -a ../tables_create.sql ${v_folder_name} cp -a ../../externalDir.sql ${v_folder_name} +cp -a ../adb_load_bugs_fixed/*.sh ${v_folder_name} +cp -a ../adb_load_symbols/*.sh ${v_folder_name} +cp -a ../adb_load_txtcollection_files/*.sh ${v_folder_name} +cp -a ../adb_load_filechksum/*.sh ${v_folder_name} cp -a *.sh *.sql *.txt ${v_folder_name} -# mv ${v_folder_name}/dumpCreate_forzip.sh ${v_folder_name}/dumpCreate.sh +sed '/^cd /d' ${v_folder_name}/schemaCreate.sh > ${v_folder_name}/schemaCreate.sh.tmp +mv ${v_folder_name}/schemaCreate.sh.tmp ${v_folder_name}/schemaCreate.sh sed '/^cd /d' ${v_folder_name}/dumpCreate.sh > ${v_folder_name}/dumpCreate.sh.tmp mv ${v_folder_name}/dumpCreate.sh.tmp ${v_folder_name}/dumpCreate.sh +sed '/^cd /d' ${v_folder_name}/dictionaryGet.sh > ${v_folder_name}/dictionaryGet.sh.tmp +mv ${v_folder_name}/dictionaryGet.sh.tmp ${v_folder_name}/dictionaryGet.sh +sed '/# REMOVE_IF_ZIP$/d' ${v_folder_name}/exporter.sh > ${v_folder_name}/exporter.sh.tmp +mv ${v_folder_name}/exporter.sh.tmp ${v_folder_name}/exporter.sh find ${v_folder_name} -name "*.yml" -delete find ${v_folder_name} -name ".DS_Store" -delete rm -f ${v_folder_name}/build_zip.sh diff --git a/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh b/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh new file mode 100644 index 0000000..4af25aa --- /dev/null +++ b/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# Script to collect dictionary tables +# Created by Rodrigo Jorge + +set -eo pipefail + +function echoError () +{ + (>&2 echo "$1") +} + +function exitError () +{ + echoError "$1" + exit 1 +} + +v_dump_user="$1" + +[ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." +[ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." + +v_dump_dir_name='expdir_hash' + +v_thisdir="$(cd "$(dirname "$0")"; pwd)" + +echo "Generating table export. Please wait.." + +cd "${v_thisdir}"/../extract +$ORACLE_HOME/bin/sqlplus -L -S "/ as sysdba" < Date: Thu, 1 Jun 2023 18:22:43 -0300 Subject: [PATCH 092/229] Minor fixes --- .../odbfcl/adb_load_bugs_fixed/bugsGet.sh | 2 +- .../odbfcl/adb_load_bugs_fixed/bugsLoad.sh | 3 ++- .../odbfcl/adb_load_filechksum/chksumGet.sh | 4 ++-- .../odbfcl/adb_load_filechksum/chksumLoad.sh | 3 ++- .../odbfcl/adb_load_symbols/symbolLoad.sh | 3 ++- .../adb_load_txtcollection_files/fileLoad.sh | 3 ++- user_scripts/odbfcl/runExtractor.yml | 15 +++++++++++++++ 7 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 user_scripts/odbfcl/runExtractor.yml diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh index b9ed14c..38d809b 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh @@ -24,7 +24,7 @@ v_output="$1" echo "Generating bugs list. Please wait.." -"${ORACLE_HOME}"/OPatch/opatch lsinv -bugs_fixed | +"$ORACLE_HOME"/OPatch/opatch lsinv -bugs_fixed | # Remove lines before this entry (inclusive) sed '1,/^List of Bugs fixed by Installed Patches/d' | # Remove lines before this entry (inclusive) diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh index 9c20344..2a10cdc 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh @@ -21,6 +21,7 @@ v_outpref="${v_file}" [ -z "$v_file" ] && exitError "First parameter is the source file and cannot be null." [ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." + [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." @@ -34,7 +35,7 @@ FIELDS TERMINATED BY x'09' (bug_id, patch_id, bug_desc) EOF -sqlldr \ +$ORACLE_HOME/bin/sqlldr \ userid=\'/ as sysdba\' \ control="${v_outpref}_load.ctl" \ errors=0 \ diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh b/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh index c841a75..cf373eb 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh +++ b/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh @@ -27,7 +27,7 @@ v_output_file="$(basename "${v_output}")" v_output_full="${v_output_fdr}/${v_output_file}" -echo "Generating sha256sum list. Please wait.." +echo "Generating sha256sum for \$ORACLE_HOME files. Please wait.." cd "$ORACLE_HOME" set +e @@ -42,7 +42,7 @@ v_libs=$(find "$ORACLE_HOME" -type f -name "*.a") v_ext_fold=`mktemp -d` v_out_file=`mktemp` -echo "Generate files checksum for static libs. Please wait.." +echo "Generating sha256sum for static libs. Please wait.." IFS=$'\n' for v_lib in ${v_libs} diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh index 88e0ee6..0d30fd4 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh +++ b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh @@ -21,6 +21,7 @@ v_outpref="${v_file}" [ -z "$v_file" ] && exitError "First parameter is the source file and cannot be null." [ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." + [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." @@ -34,7 +35,7 @@ FIELDS TERMINATED BY ' ' (sha256_hash, path, file_type) EOF -sqlldr \ +$ORACLE_HOME/bin/sqlldr \ userid=\'/ as sysdba\' \ control="${v_outpref}_load.ctl" \ errors=0 \ diff --git a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh index 54a680b..10b46f7 100644 --- a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh +++ b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh @@ -21,6 +21,7 @@ v_outpref="${v_file}" [ -z "$v_file" ] && exitError "First parameter is the source file and cannot be null." [ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." + [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." @@ -34,7 +35,7 @@ FIELDS TERMINATED BY '|' (file_name, symbol_type, symbol_name char(4000)) EOF -sqlldr \ +$ORACLE_HOME/bin/sqlldr \ userid=\'/ as sysdba\' \ control="${v_outpref}_load.ctl" \ errors=0 \ diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh index 59ad96d..2d8b9d0 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh @@ -21,6 +21,7 @@ v_outpref="${v_file}" [ -z "$v_file" ] && exitError "First parameter is the source file and cannot be null." [ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." + [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." @@ -48,7 +49,7 @@ FIELDS TERMINATED BY ',' ( path, contents lobfile(path) terminated by eof) EOF -sqlldr \ +$ORACLE_HOME/bin/sqlldr \ userid=\'/ as sysdba\' \ control="${v_outpref}_load.ctl" \ errors=0 \ diff --git a/user_scripts/odbfcl/runExtractor.yml b/user_scripts/odbfcl/runExtractor.yml new file mode 100644 index 0000000..393eca0 --- /dev/null +++ b/user_scripts/odbfcl/runExtractor.yml @@ -0,0 +1,15 @@ +## This code will call the extractor process. + +- name: "Run database extractor" + shell: | + set -eo pipefail + export ORACLE_HOME + export ORACLE_SID + export DB_EXP_GEN_DUMP=0 + sh "{{ VM_folder }}/user_scripts/odbfcl/sh_extractor/exporter.sh" db + environment: + ORACLE_HOME: "{{ dbhome_locl }}" + ORACLE_SID: "{{ mysid }}" + become: true + become_user: oracle + delegate_to: "{{ vm_ip_address }}" From 943d550ec574fb52f6c37cd89f05e96234be1746 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 1 Jun 2023 18:47:00 -0300 Subject: [PATCH 093/229] Minor fixes --- config_oci.yml | 29 +++++++------- config_vbox.yml | 2 +- tasks/patch_main.yml | 38 ++++++++++++++++++- user_scripts/odbfcl/runExtractor.yml | 1 + .../odbfcl/sh_extractor/dumpCreate.sh | 4 +- user_scripts/odbfcl/sh_extractor/exporter.sh | 16 ++++---- .../odbfcl/sh_extractor/schemaCreate.sh | 3 +- 7 files changed, 67 insertions(+), 26 deletions(-) diff --git a/config_oci.yml b/config_oci.yml index 3da7aed..5e9112e 100644 --- a/config_oci.yml +++ b/config_oci.yml @@ -22,23 +22,25 @@ output_folder : "/u01/patch_automation/output" downloader_tool : "/u01/patch_automation/getMOSPatch.jar" downloader_user : "" downloader_pass : "" + # Files in "user_scripts" folder that will run before and after the final expdp. script_types can be "shell", "sql" or "yml". user_expdp_pre : -- { file : "bugsGet.yml" , folder : "user_scripts/odbfcl/adb_load_bugs_fixed" , type : "yml", task_action : "Generate fixed bugs list for ORACLE_HOME" } -- { file : "fileGet.yml" , folder : "user_scripts/odbfcl/adb_load_filechksum" , type : "yml", task_action : "Generate chksum for ORACLE_HOME" } -- { file : "fileCollect.yml" , folder : "user_scripts/odbfcl/adb_load_txtcollection_files" , type : "yml", task_action : "Collect non-binary files from ORACLE_HOME" } -- { file : "symbolGet.yml" , folder : "user_scripts/adb_load_symbols" , type : "yml", task_action : "Get all symbols on ORACLE_HOME binaries and libs" } -- { file : "tables_recreate.yml" , folder : "user_scripts/odbfcl" , type : "yml" , task_action : "Recreate tables" } -- { file : "hashGet.yml" , folder : "user_scripts/odbfcl/extract" , type : "yml", task_action : "Collect Database Info" } -- { file : "externalDir.yml" , type : "yml" , task_action : "Create External Directory" } +# - { file : "bugsGet.yml" , folder : "user_scripts/odbfcl/adb_load_bugs_fixed" , type : "yml", task_action : "Generate fixed bugs list for ORACLE_HOME" } +# - { file : "chksumGet.yml" , folder : "user_scripts/odbfcl/adb_load_filechksum" , type : "yml", task_action : "Generate chksum for ORACLE_HOME" } +# - { file : "fileGet.yml" , folder : "user_scripts/odbfcl/adb_load_txtcollection_files" , type : "yml", task_action : "Collect non-binary files from ORACLE_HOME" } +# - { file : "symbolGet.yml" , folder : "user_scripts/odbfcl/adb_load_symbols" , type : "yml", task_action : "Get all symbols on ORACLE_HOME binaries and libs" } +# - { file : "tables_recreate.yml" , folder : "user_scripts/odbfcl" , type : "yml" , task_action : "Recreate tables" } +# - { file : "hashGet.yml" , folder : "user_scripts/odbfcl/extract" , type : "yml", task_action : "Collect Database Info" } +# - { file : "externalDir.yml" , type : "yml" , task_action : "Create External Directory" } +- { file : "runExtractor.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Collect DB Info" } user_expdp_post : - { file : "tables_recreate_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Recreate tables in ADB" } -- { file : "adb_load_expdp.yml" , folder : "user_scripts/odbfcl/adb_load_expdp" , type : "yml", task_action : "impdp files from OS to ADB" } -- { file : "adb_load_bugs_fixed.yml" , folder : "user_scripts/odbfcl/adb_load_bugs_fixed" , type : "yml", task_action : "Load fixed bugs list for ORACLE_HOME in ADB" } -- { file : "adb_load_filechksum.yml" , folder : "user_scripts/odbfcl/adb_load_filechksum" , type : "yml", task_action : "Load chksum for ORACLE_HOME in ADB" } -- { file : "adb_load_symbols.yml" , folder : "user_scripts/odbfcl/adb_load_symbols" , type : "yml", task_action : "Load chksum for ORACLE_HOME in ADB" } -- { file : "adb_load_txtcollection_files.yml" , folder : "user_scripts/odbfcl/adb_load_txtcollection_files" , type : "yml", task_action : "Load non-binary files from ORACLE_HOME in ADB" } +# - { file : "adb_load_expdp.yml" , folder : "user_scripts/odbfcl/adb_load_expdp" , type : "yml", task_action : "impdp files from OS to ADB" } +# - { file : "adb_load_bugs_fixed.yml" , folder : "user_scripts/odbfcl/adb_load_bugs_fixed" , type : "yml", task_action : "Load fixed bugs list for ORACLE_HOME in ADB" } +# - { file : "adb_load_filechksum.yml" , folder : "user_scripts/odbfcl/adb_load_filechksum" , type : "yml", task_action : "Load chksum for ORACLE_HOME in ADB" } +# - { file : "adb_load_symbols.yml" , folder : "user_scripts/odbfcl/adb_load_symbols" , type : "yml", task_action : "Load chksum for ORACLE_HOME in ADB" } +# - { file : "adb_load_txtcollection_files.yml" , folder : "user_scripts/odbfcl/adb_load_txtcollection_files" , type : "yml", task_action : "Load non-binary files from ORACLE_HOME in ADB" } - { file : "update_table_keys_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Update table keys to reflect correct partition name" } - { file : "exchange_tables_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Exchange loaded table in the correct partition position" } - { file : "diff_calculate.yml" , folder : "user_scripts/odbfcl/diff_calculate" , type : "yml", task_action : "Generate differences between 2 releases" } @@ -72,4 +74,5 @@ user_impdp_pre : - { file : "pre_prepare_dump_file.yml" , folder : "user_scripts/odbfcl/adb_load_expdp" , type : "yml", task_action : "Prepare files for impdp" } user_impdp_post : -- { file : "post_remove_dump_file.yml" , folder : "user_scripts/odbfcl/adb_load_expdp" , type : "yml", task_action : "Clean files used for impdp" } \ No newline at end of file +- { file : "post_remove_dump_file.yml" , folder : "user_scripts/odbfcl/adb_load_expdp" , type : "yml", task_action : "Clean files used for impdp" } +- { file : "mark_dump_file_loaded.yml" , folder : "user_scripts/odbfcl/adb_load_expdp" , type : "yml", task_action : "Mark dpfile as loaded." } diff --git a/config_vbox.yml b/config_vbox.yml index ef96d7b..c53aebb 100644 --- a/config_vbox.yml +++ b/config_vbox.yml @@ -16,7 +16,7 @@ output_folder : "/Volumes/Samsung_T3/OraSum/files" # Files in "user_scripts" folder that will run before and after the final expdp. script_types can be "shell", "sql" or "yml". user_expdp_pre : -- { file : "fileGet.yml" , folder : "user_scripts/gen" , type : "yml", task_action : "Collect OS Info" } +- { file : "chksumGet.yml" , folder : "user_scripts/gen" , type : "yml", task_action : "Collect OS Info" } - { file : "tables_recreate.sql" , type : "sql" , task_action : "Recreate Tables" } - { file : "hashGet.yml" , folder : "user_scripts/gen" , type : "yml", task_action : "Collect DB Info" } - { file : "externalDir.yml" , type : "yml" , task_action : "Create External Directory" } diff --git a/tasks/patch_main.yml b/tasks/patch_main.yml index a3dc51f..6e33e25 100644 --- a/tasks/patch_main.yml +++ b/tasks/patch_main.yml @@ -113,9 +113,43 @@ sql_param : { file : "startupCDB.sql" , folder : "patch_sql" , task_action : "Start Database" } when: patch.type == "OJVM" - + when: perform_patch_actions + # If apply method is UNTAR + - block: + + # Stop the database + - include: run_sql.yml + vars: + sql_param : { file : "shutdown.sql" , folder : "patch_sql" , task_action : "Stop Database for OPatch" } + when: not oci_mode or patch.dep_type is defined + # When patch has a dependency, if the dependency is loaded running the full patch process instead of loading from lvm, the DB will be left online. + + ## TAR ## + + - name: UNTAR full Oracle + shell: | + rm -rf /u01/* + tar -xzf {{ patch.apply_file }} + args: + chdir: "/" + register: tmp_shell_output + become: true + become_user: root + when: + delegate_to: "{{ vm_ip_address }}" + + # Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" + - set_fact: shell_output="{{tmp_shell_output}}" + when: tmp_shell_output is not skipped + + - name: TAR Output + debug: msg="{{ shell_output.stdout_lines }}" + when: shell_output.stdout_lines is defined + + when: patch.apply_method is defined and patch.apply_method == "tar" + # Start the database - include: run_sql.yml vars: @@ -138,7 +172,7 @@ - name: Export Database Tables shell: | - {{ dbhome_locl }}/bin/expdp userid={{ dump_user_int }}/{{ dump_pass }} directory={{ dump_dir_name }} compression=all dumpfile={{ dump_file_prefix }}.dmp logfile={{ dump_file_prefix }}.log content=data_only schemas={{ dump_user_int }} {{ expdp_version }} + {{ dbhome_locl }}/bin/expdp userid={{ dump_user_int }}/{{ dump_pass }} directory={{ dump_dir_name }} compression=all compression_algorithm=high metrics=yes dumpfile={{ dump_file_prefix }}.dmp logfile={{ dump_file_prefix }}.log content=data_only schemas={{ dump_user_int }} {{ expdp_version }} environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" diff --git a/user_scripts/odbfcl/runExtractor.yml b/user_scripts/odbfcl/runExtractor.yml index 393eca0..8afe401 100644 --- a/user_scripts/odbfcl/runExtractor.yml +++ b/user_scripts/odbfcl/runExtractor.yml @@ -6,6 +6,7 @@ export ORACLE_HOME export ORACLE_SID export DB_EXP_GEN_DUMP=0 + export DB_EXP_DUMP_PASS="{{ dump_pass }}" sh "{{ VM_folder }}/user_scripts/odbfcl/sh_extractor/exporter.sh" db environment: ORACLE_HOME: "{{ dbhome_locl }}" diff --git a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh index 887c9b8..566104e 100644 --- a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh @@ -28,7 +28,9 @@ v_output_file="$(basename "${v_output}")" v_output_full="${v_output_fdr}/${v_output_file}" -v_dump_pass='HhAaSsHh..135' +# If DB_EXP_DUMP_PASS is exported, use it as the password. +[ -n "$DB_EXP_DUMP_PASS" ] && v_dump_pass="$DB_EXP_DUMP_PASS" || v_dump_pass='HhAaSsHh..135' + v_dump_dir_name='expdir_hash' v_thisdir="$(cd "$(dirname "$0")"; pwd)" diff --git a/user_scripts/odbfcl/sh_extractor/exporter.sh b/user_scripts/odbfcl/sh_extractor/exporter.sh index c87dd0d..6b739b0 100644 --- a/user_scripts/odbfcl/sh_extractor/exporter.sh +++ b/user_scripts/odbfcl/sh_extractor/exporter.sh @@ -58,22 +58,22 @@ v_common_user=$($ORACLE_HOME/bin/sqlplus -L -S "/ as sysdba" @${v_thisdir}/get_u v_thisdir_bkp="${v_thisdir}" # REMOVE_IF_ZIP [ -f "${v_thisdir}/bugsGet.sh" ] && v_sh_from_zip=1 || v_sh_from_zip=0 # REMOVE_IF_ZIP -[ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir}/../adb_load_bugs_fixed" # REMOVE_IF_ZIP +[ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir_bkp}/../adb_load_bugs_fixed" # REMOVE_IF_ZIP v_file=bugs_${v_pattern}.txt sh "${v_thisdir}/bugsGet.sh" ${v_file} [ ${v_load_file} -eq 0 ] && zip -m ${v_zip} ${v_file} -[ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir}/../adb_load_filechksum" # REMOVE_IF_ZIP +[ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir_bkp}/../adb_load_filechksum" # REMOVE_IF_ZIP v_file=sha256sum_${v_pattern}.chk sh "${v_thisdir}/chksumGet.sh" ${v_file} [ ${v_load_file} -eq 0 ] && zip -m ${v_zip} ${v_file} -[ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir}/../adb_load_txtcollection_files" # REMOVE_IF_ZIP +[ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir_bkp}/../adb_load_txtcollection_files" # REMOVE_IF_ZIP v_file=txtcol_${v_pattern}.tar.gz sh "${v_thisdir}/fileGet.sh" ${v_file} [ ${v_load_file} -eq 0 ] && zip -m ${v_zip} ${v_file} -[ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir}/../adb_load_symbols" # REMOVE_IF_ZIP +[ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir_bkp}/../adb_load_symbols" # REMOVE_IF_ZIP v_file=symbols_${v_pattern}.csv sh "${v_thisdir}/symbolGet.sh" ${v_file} [ ${v_load_file} -eq 0 ] && zip -m ${v_zip} ${v_file} @@ -83,22 +83,22 @@ sh "${v_thisdir}/schemaCreate.sh" ${v_dump_user} if [ ${v_load_file} -eq 1 ] then - [ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir}/../adb_load_bugs_fixed" # REMOVE_IF_ZIP + [ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir_bkp}/../adb_load_bugs_fixed" # REMOVE_IF_ZIP v_file=bugs_${v_pattern}.txt sh "${v_thisdir}/bugsLoad.sh" ${v_dump_user} ${v_file} rm -f ${v_file} - [ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir}/../adb_load_filechksum" # REMOVE_IF_ZIP + [ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir_bkp}/../adb_load_filechksum" # REMOVE_IF_ZIP v_file=sha256sum_${v_pattern}.chk sh "${v_thisdir}/chksumLoad.sh" ${v_dump_user} ${v_file} rm -f ${v_file} - [ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir}/../adb_load_txtcollection_files" # REMOVE_IF_ZIP + [ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir_bkp}/../adb_load_txtcollection_files" # REMOVE_IF_ZIP v_file=txtcol_${v_pattern}.tar.gz sh "${v_thisdir}/fileLoad.sh" ${v_dump_user} ${v_file} rm -f ${v_file} - [ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir}/../adb_load_symbols" # REMOVE_IF_ZIP + [ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir_bkp}/../adb_load_symbols" # REMOVE_IF_ZIP v_file=symbols_${v_pattern}.csv sh "${v_thisdir}/symbolLoad.sh" ${v_dump_user} ${v_file} rm -f ${v_file} diff --git a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh index e6de14c..5ebcabe 100644 --- a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh @@ -20,7 +20,8 @@ v_dump_user="$1" [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." -v_dump_pass='HhAaSsHh..135' +# If DB_EXP_DUMP_PASS is exported, use it as the password. +[ -n "$DB_EXP_DUMP_PASS" ] && v_dump_pass="$DB_EXP_DUMP_PASS" || v_dump_pass='HhAaSsHh..135' v_thisdir="$(cd "$(dirname "$0")"; pwd)" From 6fbf9aceefb27dda4f2acb3b94e332796ec6b277 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 1 Jun 2023 21:00:33 -0300 Subject: [PATCH 094/229] Minor fixes --- config_vbox.yml | 2 +- user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.yml | 2 -- user_scripts/odbfcl/adb_load_filechksum/chksumGet.yml | 2 -- user_scripts/odbfcl/adb_load_symbols/symbolGet.yml | 2 -- user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.yml | 2 -- 5 files changed, 1 insertion(+), 9 deletions(-) diff --git a/config_vbox.yml b/config_vbox.yml index c53aebb..ef96d7b 100644 --- a/config_vbox.yml +++ b/config_vbox.yml @@ -16,7 +16,7 @@ output_folder : "/Volumes/Samsung_T3/OraSum/files" # Files in "user_scripts" folder that will run before and after the final expdp. script_types can be "shell", "sql" or "yml". user_expdp_pre : -- { file : "chksumGet.yml" , folder : "user_scripts/gen" , type : "yml", task_action : "Collect OS Info" } +- { file : "fileGet.yml" , folder : "user_scripts/gen" , type : "yml", task_action : "Collect OS Info" } - { file : "tables_recreate.sql" , type : "sql" , task_action : "Recreate Tables" } - { file : "hashGet.yml" , folder : "user_scripts/gen" , type : "yml", task_action : "Collect DB Info" } - { file : "externalDir.yml" , type : "yml" , task_action : "Create External Directory" } diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.yml b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.yml index 709dfe6..ac9d029 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.yml +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.yml @@ -14,9 +14,7 @@ - name: Collect bugs from ORACLE_HOME shell: | set -eo pipefail - export ORACLE_HOME - {{ VM_folder }}/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh "{{ VM_folder }}/{{ bugs_fixed_file }}" environment: ORACLE_HOME: "{{ dbhome_locl }}" diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumGet.yml b/user_scripts/odbfcl/adb_load_filechksum/chksumGet.yml index 5831a16..6e71434 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/chksumGet.yml +++ b/user_scripts/odbfcl/adb_load_filechksum/chksumGet.yml @@ -14,9 +14,7 @@ - name: Generate files checksum shell: | set -eo pipefail - export ORACLE_HOME - {{ VM_folder }}/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh "{{ VM_folder }}/{{ sha256_file }}" environment: ORACLE_HOME: "{{ dbhome_locl }}" diff --git a/user_scripts/odbfcl/adb_load_symbols/symbolGet.yml b/user_scripts/odbfcl/adb_load_symbols/symbolGet.yml index 261530a..0c82372 100644 --- a/user_scripts/odbfcl/adb_load_symbols/symbolGet.yml +++ b/user_scripts/odbfcl/adb_load_symbols/symbolGet.yml @@ -14,9 +14,7 @@ - name: Collect symbols from ORACLE_HOME shell: | set -eo pipefail - export ORACLE_HOME - {{ VM_folder }}/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh "{{ VM_folder }}/{{ symbols_file }}" environment: ORACLE_HOME: "{{ dbhome_locl }}" diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.yml b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.yml index f68a2d7..8248068 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.yml +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.yml @@ -15,9 +15,7 @@ - name: Collect text files from ORACLE_HOME shell: | set -eo pipefail - export ORACLE_HOME - {{ VM_folder }}/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh "{{ VM_folder }}/{{ txtcollect_file }}" environment: ORACLE_HOME: "{{ dbhome_locl }}" From e550ef9653b3901b840902fc5e11803869369e0d Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 1 Jun 2023 21:00:57 -0300 Subject: [PATCH 095/229] Update config_oci.yml --- config_oci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config_oci.yml b/config_oci.yml index 5e9112e..63283e1 100644 --- a/config_oci.yml +++ b/config_oci.yml @@ -31,12 +31,12 @@ user_expdp_pre : # - { file : "symbolGet.yml" , folder : "user_scripts/odbfcl/adb_load_symbols" , type : "yml", task_action : "Get all symbols on ORACLE_HOME binaries and libs" } # - { file : "tables_recreate.yml" , folder : "user_scripts/odbfcl" , type : "yml" , task_action : "Recreate tables" } # - { file : "hashGet.yml" , folder : "user_scripts/odbfcl/extract" , type : "yml", task_action : "Collect Database Info" } -# - { file : "externalDir.yml" , type : "yml" , task_action : "Create External Directory" } - { file : "runExtractor.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Collect DB Info" } +- { file : "externalDir.yml" , type : "yml" , task_action : "Create External Directory" } user_expdp_post : - { file : "tables_recreate_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Recreate tables in ADB" } -# - { file : "adb_load_expdp.yml" , folder : "user_scripts/odbfcl/adb_load_expdp" , type : "yml", task_action : "impdp files from OS to ADB" } +- { file : "adb_load_expdp.yml" , folder : "user_scripts/odbfcl/adb_load_expdp" , type : "yml", task_action : "impdp files from OS to ADB" } # - { file : "adb_load_bugs_fixed.yml" , folder : "user_scripts/odbfcl/adb_load_bugs_fixed" , type : "yml", task_action : "Load fixed bugs list for ORACLE_HOME in ADB" } # - { file : "adb_load_filechksum.yml" , folder : "user_scripts/odbfcl/adb_load_filechksum" , type : "yml", task_action : "Load chksum for ORACLE_HOME in ADB" } # - { file : "adb_load_symbols.yml" , folder : "user_scripts/odbfcl/adb_load_symbols" , type : "yml", task_action : "Load chksum for ORACLE_HOME in ADB" } From d922b240d8929589e27c2e14be7488380944740e Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 1 Jun 2023 21:01:12 -0300 Subject: [PATCH 096/229] Update list_exceptions.yml --- list_exceptions.yml | 70 ++++++++++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 29 deletions(-) diff --git a/list_exceptions.yml b/list_exceptions.yml index 9f39cf2..abb3951 100644 --- a/list_exceptions.yml +++ b/list_exceptions.yml @@ -8,46 +8,58 @@ list_retry_datapatch: - { version: "12.1.0.2" , type : "BP" , id : 8 , retries : 2 } - { version: "12.1.0.2" , type : "BP" , id : 9 , retries : 2 } - { version: "12.1.0.2" , type : "BP" , id : 190115 , retries : 2 } - - { version: "12.2.0.1" , type : "RUR" , id : 180717 , retries : 1 } - - { version: "12.2.0.1" , type : "RUR" , id : 181016 , retries : 1 } - { version: "12.1.0.2" , type : "BP" , id : 190716 , retries : 2 } - - { version: "12.2.0.1" , type : "RU" , id : 190716 , retries : 1 } - - { version: "12.2.0.1" , type : "RUR" , id : 190716 , retries : 1 } - { version: "12.1.0.2" , type : "BP" , id : 191015 , retries : 2 } - - { version: "12.2.0.1" , type : "RU" , id : 191015 , retries : 1 } - - { version: "12.2.0.1" , type : "RUR" , id : 191015 , retries : 1 } - { version: "12.1.0.2" , type : "BP" , id : 200114 , retries : 2 } - - { version: "12.2.0.1" , type : "RU" , id : 200114 , retries : 1 } - - { version: "12.2.0.1" , type : "RUR" , id : 200114 , retries : 1 } - { version: "12.1.0.2" , type : "BP" , id : 200414 , retries : 2 } - - { version: "12.2.0.1" , type : "RU" , id : 200414 , retries : 1 } - - { version: "12.2.0.1" , type : "RUR" , id : 200414 , retries : 1 } - - { version: "12.1.0.2" , type : "PSU" , id : 200714 , retries : 2 } - { version: "12.1.0.2" , type : "BP" , id : 200714 , retries : 2 } - - { version: "12.2.0.1" , type : "RU" , id : 200714 , retries : 1 } - - { version: "12.2.0.1" , type : "RUR" , id : 200714 , retries : 1 } - - { version: "12.1.0.2" , type : "PSU" , id : 201020 , retries : 2 } - { version: "12.1.0.2" , type : "BP" , id : 201020 , retries : 2 } - - { version: "12.2.0.1" , type : "RU" , id : 201020 , retries : 1 } - - { version: "12.2.0.1" , type : "RUR" , id : 201020 , retries : 1 } - - { version: "12.1.0.2" , type : "PSU" , id : 210119 , retries : 2 } - { version: "12.1.0.2" , type : "BP" , id : 210119 , retries : 2 } - - { version: "12.2.0.1" , type : "RU" , id : 210119 , retries : 1 } - - { version: "12.1.0.2" , type : "PSU" , id : 210420 , retries : 2 } - { version: "12.1.0.2" , type : "BP" , id : 210420 , retries : 2 } - - { version: "12.2.0.1" , type : "RU" , id : 210420 , retries : 1 } - - { version: "12.1.0.2" , type : "PSU" , id : 210720 , retries : 2 } - { version: "12.1.0.2" , type : "BP" , id : 210720 , retries : 2 } - - { version: "12.2.0.1" , type : "RU" , id : 210720 , retries : 1 } - - { version: "12.1.0.2" , type : "PSU" , id : 211019 , retries : 2 } - { version: "12.1.0.2" , type : "BP" , id : 211019 , retries : 2 } - - { version: "12.2.0.1" , type : "RU" , id : 211019 , retries : 1 } - - { version: "12.1.0.2" , type : "PSU" , id : 220118 , retries : 2 } - { version: "12.1.0.2" , type : "BP" , id : 220118 , retries : 2 } - - { version: "12.2.0.1" , type : "RU" , id : 220118 , retries : 1 } - - { version: "12.1.0.2" , type : "PSU" , id : 220419 , retries : 2 } - { version: "12.1.0.2" , type : "BP" , id : 220419 , retries : 2 } - - { version: "12.1.0.2" , type : "PSU" , id : 220719 , retries : 2 } - { version: "12.1.0.2" , type : "BP" , id : 220719 , retries : 2 } - - { version: "12.1.0.2" , type : "PSU" , id : 221018 , retries : 2 } - { version: "12.1.0.2" , type : "BP" , id : 221018 , retries : 3 } + - { version: "12.1.0.2" , type : "BP" , id : 230117 , retries : 3 } + - { version: "12.1.0.2" , type : "BP" , id : 230418 , retries : 3 } +###### + - { version: "12.1.0.2" , type : "PSU" , id : 200714 , retries : 2 } + - { version: "12.1.0.2" , type : "PSU" , id : 201020 , retries : 2 } + - { version: "12.1.0.2" , type : "PSU" , id : 210119 , retries : 2 } + - { version: "12.1.0.2" , type : "PSU" , id : 210420 , retries : 2 } + - { version: "12.1.0.2" , type : "PSU" , id : 210720 , retries : 2 } + - { version: "12.1.0.2" , type : "PSU" , id : 211019 , retries : 2 } + - { version: "12.1.0.2" , type : "PSU" , id : 220118 , retries : 2 } + - { version: "12.1.0.2" , type : "PSU" , id : 220419 , retries : 2 } + - { version: "12.1.0.2" , type : "PSU" , id : 220719 , retries : 2 } + - { version: "12.1.0.2" , type : "PSU" , id : 221018 , retries : 2 } + - { version: "12.1.0.2" , type : "PSU" , id : 230117 , retries : 2 } + - { version: "12.1.0.2" , type : "PSU" , id : 230418 , retries : 2 } +###### + - { version: "12.2.0.1" , type : "RU" , id : 190716 , retries : 1 } + - { version: "12.2.0.1" , type : "RU" , id : 191015 , retries : 1 } + - { version: "12.2.0.1" , type : "RU" , id : 200114 , retries : 1 } + - { version: "12.2.0.1" , type : "RU" , id : 200414 , retries : 1 } + - { version: "12.2.0.1" , type : "RU" , id : 200714 , retries : 1 } + - { version: "12.2.0.1" , type : "RU" , id : 201020 , retries : 1 } + - { version: "12.2.0.1" , type : "RU" , id : 210119 , retries : 1 } + - { version: "12.2.0.1" , type : "RU" , id : 210420 , retries : 1 } + - { version: "12.2.0.1" , type : "RU" , id : 210720 , retries : 1 } + - { version: "12.2.0.1" , type : "RU" , id : 211019 , retries : 1 } + - { version: "12.2.0.1" , type : "RU" , id : 220118 , retries : 1 } + - { version: "12.2.0.1" , type : "RU" , id : 220419 , retries : 1 } + - { version: "12.2.0.1" , type : "RU" , id : 220719 , retries : 1 } + - { version: "12.2.0.1" , type : "RU" , id : 221018 , retries : 1 } + - { version: "12.2.0.1" , type : "RU" , id : 230117 , retries : 1 } + - { version: "12.2.0.1" , type : "RU" , id : 230418 , retries : 1 } +###### + - { version: "12.2.0.1" , type : "RUR" , id : 180717 , retries : 1 } + - { version: "12.2.0.1" , type : "RUR" , id : 181016 , retries : 1 } + - { version: "12.2.0.1" , type : "RUR" , id : 190716 , retries : 1 } + - { version: "12.2.0.1" , type : "RUR" , id : 191015 , retries : 1 } + - { version: "12.2.0.1" , type : "RUR" , id : 200114 , retries : 1 } + - { version: "12.2.0.1" , type : "RUR" , id : 200414 , retries : 1 } + - { version: "12.2.0.1" , type : "RUR" , id : 200714 , retries : 1 } + - { version: "12.2.0.1" , type : "RUR" , id : 201020 , retries : 1 } From 5787af22f3558a87e917cc19efc7825bde77f1c7 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 2 Jun 2023 10:20:47 -0300 Subject: [PATCH 097/229] Update adb_load_expdp.yml --- user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml index d8aba6c..a88b6d7 100644 --- a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml +++ b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml @@ -105,7 +105,7 @@ - name: Check impdp error shell: | set -e +o pipefail - v_tot=$(cat "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.{{ oci_adb_tns }}.log" | grep 'ORA-' | grep -v 'ORA-39146' | wc -l) + v_tot=$(cat "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.{{ oci_adb_tns }}.log" | grep 'ORA-' | grep -v -E 'ORA-39146|ORA-28002' | wc -l) if [ $v_tot -ne 0 ] then exit 1 From 5bc953f432342451babb3dcd492138de4d245f9a Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 6 Jun 2023 11:29:52 -0300 Subject: [PATCH 098/229] New extractors --- user_scripts/odbfcl/extract/load_custom.sql | 4 ++ user_scripts/odbfcl/extract/load_v_dollar.sql | 2 + user_scripts/odbfcl/tables_create.sql | 43 +++++++++++++++++++ 3 files changed, 49 insertions(+) diff --git a/user_scripts/odbfcl/extract/load_custom.sql b/user_scripts/odbfcl/extract/load_custom.sql index a1951bc..8b6bb7a 100644 --- a/user_scripts/odbfcl/extract/load_custom.sql +++ b/user_scripts/odbfcl/extract/load_custom.sql @@ -59,7 +59,11 @@ BEGIN IF VVERS != '11.2.0.4' THEN RUN_INSERT ('AUDIT_UNIFIED_POLICIES','T_AUDIT_UNIFIED_POLICIES'); + RUN_INSERT ('AUDIT_UNIFIED_ENABLED_POLICIES','T_AUD_UNIFIED_ENABLED_POLICIES'); + RUN_INSERT ('AUDIT_UNIFIED_POLICY_COMMENTS','T_AUD_UNIFIED_POLICY_COMMENTS'); END IF; + RUN_INSERT ('OPTSTAT_HIST_CONTROL$','T_OPTSTAT_HIST_CONTROL'); + END; / \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/load_v_dollar.sql b/user_scripts/odbfcl/extract/load_v_dollar.sql index dcbf1c2..abb30f7 100644 --- a/user_scripts/odbfcl/extract/load_v_dollar.sql +++ b/user_scripts/odbfcl/extract/load_v_dollar.sql @@ -62,6 +62,8 @@ BEGIN RUN_INSERT ('T_SYSTEM_FIX_CONTROL','V_$SYSTEM_FIX_CONTROL'); + RUN_INSERT ('T_OBSOLETE_PARAMETER','V_$OBSOLETE_PARAMETER'); + END; / diff --git a/user_scripts/odbfcl/tables_create.sql b/user_scripts/odbfcl/tables_create.sql index 5c596a8..68768e7 100644 --- a/user_scripts/odbfcl/tables_create.sql +++ b/user_scripts/odbfcl/tables_create.sql @@ -306,6 +306,26 @@ CREATE TABLE "T_AUDIT_UNIFIED_POLICIES" ) COMPRESS NOLOGGING; +CREATE TABLE "T_AUD_UNIFIED_ENABLED_POLICIES" +( +"POLICY_NAME" VARCHAR2(128), +"ENABLED_OPTION" VARCHAR2(15), +"ENTITY_NAME" VARCHAR2(128), +"ENTITY_TYPE" VARCHAR2(7), +"SUCCESS" VARCHAR2(3), +"FAILURE" VARCHAR2(3), +"CON_ID" NUMBER +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_AUD_UNIFIED_POLICY_COMMENTS" +( +"POLICY_NAME" VARCHAR2(128) NOT NULL ENABLE, +"COMMENTS" VARCHAR2(4000), +"CON_ID" NUMBER +) +COMPRESS NOLOGGING; + CREATE TABLE "T_COL_PRIVS" ( "GRANTEE" VARCHAR2(128 CHAR) NOT NULL, @@ -712,6 +732,29 @@ CREATE TABLE "T_PROCEDURES" ) COMPRESS NOLOGGING; +CREATE TABLE "T_OBSOLETE_PARAMETER" +( +"NAME" VARCHAR2(64), +"ISSPECIFIED" VARCHAR2(5), +"CON_ID" NUMBER +) +COMPRESS NOLOGGING; + +CREATE TABLE "T_OPTSTAT_HIST_CONTROL" +( +"SNAME" VARCHAR2(30), +"SVAL1" NUMBER, +-- "SVAL2" TIMESTAMP (6) WITH TIME ZONE, +"SPARE1" NUMBER, +"SPARE2" NUMBER, +"SPARE3" NUMBER, +"SPARE4" VARCHAR2(1000), +"SPARE5" VARCHAR2(1000), +-- "SPARE6" TIMESTAMP (6) WITH TIME ZONE, +"CON_ID" NUMBER +) +COMPRESS NOLOGGING; + ----------------------------------------------------- ----------------------------------------------------- ----------------------------------------------------- From d189906a72afec0f11dfd2832d93437065dbd1ce Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 6 Jun 2023 11:31:50 -0300 Subject: [PATCH 099/229] Adapt to new load model --- config_oci.yml | 7 +- .../odbfcl/adb_load_expdp/adb_load_expdp.yml | 101 ++++++++++-------- .../adb_load_expdp/adb_process_dp_dump.sql | 13 +++ user_scripts/odbfcl/def_adb_variables.yml | 29 +++++ .../odbfcl/diff_calculate/diff_calculate.yml | 10 -- user_scripts/odbfcl/tables_recreate_adb.yml | 20 ---- 6 files changed, 101 insertions(+), 79 deletions(-) create mode 100644 user_scripts/odbfcl/adb_load_expdp/adb_process_dp_dump.sql create mode 100644 user_scripts/odbfcl/def_adb_variables.yml diff --git a/config_oci.yml b/config_oci.yml index 63283e1..11da06d 100644 --- a/config_oci.yml +++ b/config_oci.yml @@ -35,14 +35,15 @@ user_expdp_pre : - { file : "externalDir.yml" , type : "yml" , task_action : "Create External Directory" } user_expdp_post : -- { file : "tables_recreate_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Recreate tables in ADB" } +- { file : "def_adb_variables.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Define ansible ADB variables" } +# - { file : "tables_recreate_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Recreate tables in ADB" } - { file : "adb_load_expdp.yml" , folder : "user_scripts/odbfcl/adb_load_expdp" , type : "yml", task_action : "impdp files from OS to ADB" } # - { file : "adb_load_bugs_fixed.yml" , folder : "user_scripts/odbfcl/adb_load_bugs_fixed" , type : "yml", task_action : "Load fixed bugs list for ORACLE_HOME in ADB" } # - { file : "adb_load_filechksum.yml" , folder : "user_scripts/odbfcl/adb_load_filechksum" , type : "yml", task_action : "Load chksum for ORACLE_HOME in ADB" } # - { file : "adb_load_symbols.yml" , folder : "user_scripts/odbfcl/adb_load_symbols" , type : "yml", task_action : "Load chksum for ORACLE_HOME in ADB" } # - { file : "adb_load_txtcollection_files.yml" , folder : "user_scripts/odbfcl/adb_load_txtcollection_files" , type : "yml", task_action : "Load non-binary files from ORACLE_HOME in ADB" } -- { file : "update_table_keys_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Update table keys to reflect correct partition name" } -- { file : "exchange_tables_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Exchange loaded table in the correct partition position" } +# - { file : "update_table_keys_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Update table keys to reflect correct partition name" } +# - { file : "exchange_tables_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Exchange loaded table in the correct partition position" } - { file : "diff_calculate.yml" , folder : "user_scripts/odbfcl/diff_calculate" , type : "yml", task_action : "Generate differences between 2 releases" } # User that will hold your tables outputs and be exported after each execution. If the database is CDB, "C##" will be automatically be appended. diff --git a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml index a88b6d7..228e254 100644 --- a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml +++ b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml @@ -20,21 +20,21 @@ oci_upload_file: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" object_action: "create" - - name : Define source schema - set_fact: - dump_user_int: "{{ dump_user }}" - when: db_version == "11.2.0.4" - - - name : Define source schema - set_fact: - dump_user_int: "c##{{ dump_user }}" - when: db_version != "11.2.0.4" +# - name : Define source schema +# set_fact: +# dump_user_int: "{{ dump_user }}" +# when: db_version == "11.2.0.4" +# +# - name : Define source schema +# set_fact: +# dump_user_int: "c##{{ dump_user }}" +# when: db_version != "11.2.0.4" # This is done because expdp/impdp still can't handle Credential using oracle native authentication (instance principal, tenancy id, etc), only swift. - include: tasks/local_sqlplus.yml vars: sql_param : { task_action : "Copy file from Bucket to Oracle Directory" , - cred : "{{ oci_adb_connection_tns }}" , + cred : "{{ oci_adb_main_tns }}" , file : "adb_oradir_copy_file.sql" , folder : "user_scripts/odbfcl/adb_load_expdp" , params : "'{{ oci_adb_credential }}' '{{ oci_adb_os_url_prefix }}/{{ dump_file_prefix }}.dmp'" @@ -61,57 +61,66 @@ # dumpfile={{ oci_adb_os_url_prefix }}/{{ dump_file_prefix }}.dmp > "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.{{ oci_adb_tns }}.log" 2>&1 # register: shell_output - - name: Import DB Tables - shell: | - impdp \ - userid={{ oci_adb_connection_tns }} \ - directory=data_pump_dir \ - remap_schema='{{ dump_user }}:{{ oci_adb_transient_user }},c##{{ dump_user }}:{{ oci_adb_transient_user }}' \ - parallel=16 \ - table_exists_action=truncate \ - content=data_only \ - logfile={{ dump_file_prefix }}.log \ - dumpfile={{ dump_file_prefix }}.dmp > "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.{{ oci_adb_tns }}.log" 2>&1 - register: shell_output - ignore_errors: yes + - include: tasks/local_sqlplus.yml + vars: + sql_param : { task_action : "Call import process" , + cred : "{{ oci_adb_main_tns }}" , + file : "adb_process_dp_dump.sql" , + folder : "user_scripts/odbfcl/adb_load_expdp" , + params : "'{{ db_version }}' '{{ patch.base_ru | default('') }}{{ patch.type }}' '{{ patch.id }}' '{{ dump_file_prefix }}.dmp'" + } + +# - name: Import DB Tables +# shell: | +# impdp \ +# userid={{ oci_adb_connection_tns }} \ +# directory=data_pump_dir \ +# remap_schema='{{ dump_user }}:{{ oci_adb_transient_user }},c##{{ dump_user }}:{{ oci_adb_transient_user }}' \ +# parallel=16 \ +# table_exists_action=truncate \ +# content=data_only \ +# logfile={{ dump_file_prefix }}.log \ +# dumpfile={{ dump_file_prefix }}.dmp > "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.{{ oci_adb_tns }}.log" 2>&1 +# register: shell_output +# ignore_errors: yes - include: tasks/local_sqlplus.yml vars: sql_param : { task_action : "Remove dumpfile from Oracle Directory" , - cred : "{{ oci_adb_connection_tns }}" , + cred : "{{ oci_adb_main_tns }}" , file : "adb_oradir_remove_file.sql" , folder : "user_scripts/odbfcl/adb_load_expdp" , params : "'{{ dump_file_prefix }}.dmp'" } - + - include: tasks/local_sqlplus.yml vars: sql_param : { task_action : "Remove logfile from Oracle Directory" , - cred : "{{ oci_adb_connection_tns }}" , + cred : "{{ oci_adb_main_tns }}" , file : "adb_oradir_remove_file.sql" , folder : "user_scripts/odbfcl/adb_load_expdp" , params : "'{{ dump_file_prefix }}.log'" } - - name: Import error output - debug: msg="{{ shell_output.stderr_lines }}" - when: shell_output.rc != 0 - - - name: impdp error - fail: - msg: "Check {{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.{{ oci_adb_tns }}.log." - when: shell_output.rc != 0 and shell_output.rc != 5 - - - name: Check impdp error - shell: | - set -e +o pipefail - v_tot=$(cat "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.{{ oci_adb_tns }}.log" | grep 'ORA-' | grep -v -E 'ORA-39146|ORA-28002' | wc -l) - if [ $v_tot -ne 0 ] - then - exit 1 - else - exit 0 - fi - when: shell_output.rc == 5 +# - name: Import error output +# debug: msg="{{ shell_output.stderr_lines }}" +# when: shell_output.rc != 0 +# +# - name: impdp error +# fail: +# msg: "Check {{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.{{ oci_adb_tns }}.log." +# when: shell_output.rc != 0 and shell_output.rc != 5 +# +# - name: Check impdp error +# shell: | +# set -e +o pipefail +# v_tot=$(cat "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.{{ oci_adb_tns }}.log" | grep 'ORA-' | grep -v -E 'ORA-39146|ORA-28002' | wc -l) +# if [ $v_tot -ne 0 ] +# then +# exit 1 +# else +# exit 0 +# fi +# when: shell_output.rc == 5 when: dump_stat_result.stat.exists \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_expdp/adb_process_dp_dump.sql b/user_scripts/odbfcl/adb_load_expdp/adb_process_dp_dump.sql new file mode 100644 index 0000000..4215191 --- /dev/null +++ b/user_scripts/odbfcl/adb_load_expdp/adb_process_dp_dump.sql @@ -0,0 +1,13 @@ +WHENEVER SQLERROR EXIT SQL.SQLCODE + +BEGIN + X_PC_DUMP_LOAD.ADD_PROCESS + ( + P_ORAVERSION => '&1', + P_ORASERIES => '&2', + P_ORAPATCH => &3, + P_FILE_NAME => '&4', + P_EXECUTE => TRUE + ); +END; +/ diff --git a/user_scripts/odbfcl/def_adb_variables.yml b/user_scripts/odbfcl/def_adb_variables.yml new file mode 100644 index 0000000..14bec4c --- /dev/null +++ b/user_scripts/odbfcl/def_adb_variables.yml @@ -0,0 +1,29 @@ +- name: Define oci_adb_main_tns + set_fact: + oci_adb_main_tns: "{{ oci_adb_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" + when: oci_adb_use_wallet == false + +- name: Define oci_adb_main_tns + set_fact: + oci_adb_main_tns: "/@{{ oci_adb_user }}" + when: oci_adb_use_wallet == true + +- name: Generate oci_adb_transient_user + set_fact: + oci_adb_transient_user: "{{ oci_adb_user }}_{{ db_version | replace('.', '') }}" + when: oci_adb_force_transient_user is undefined or (oci_adb_force_transient_user|length == 0) + +- name: Force oci_adb_transient_user + set_fact: + oci_adb_transient_user: "{{ oci_adb_force_transient_user }}" + when: not (oci_adb_force_transient_user is undefined or (oci_adb_force_transient_user|length == 0)) + +- name: Define oci_adb_connection_tns + set_fact: + oci_adb_connection_tns: "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" + when: oci_adb_use_wallet == false + +- name: Define oci_adb_connection_tns + set_fact: + oci_adb_connection_tns: "/@{{ oci_adb_transient_user }}" + when: oci_adb_use_wallet == true diff --git a/user_scripts/odbfcl/diff_calculate/diff_calculate.yml b/user_scripts/odbfcl/diff_calculate/diff_calculate.yml index c87902e..2f8b393 100644 --- a/user_scripts/odbfcl/diff_calculate/diff_calculate.yml +++ b/user_scripts/odbfcl/diff_calculate/diff_calculate.yml @@ -1,15 +1,5 @@ # This must come after MV_VERSIONS is reloaded -- name: Define oci_adb_main_tns - set_fact: - oci_adb_main_tns: "{{ oci_adb_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" - when: oci_adb_use_wallet == false - -- name: Define oci_adb_main_tns - set_fact: - oci_adb_main_tns: "/@{{ oci_adb_user }}" - when: oci_adb_use_wallet == true - - name: "Load {{ oci_adb_transient_user }} diff code and contents" shell: | set -e diff --git a/user_scripts/odbfcl/tables_recreate_adb.yml b/user_scripts/odbfcl/tables_recreate_adb.yml index 7d2df02..b5f8d01 100644 --- a/user_scripts/odbfcl/tables_recreate_adb.yml +++ b/user_scripts/odbfcl/tables_recreate_adb.yml @@ -1,23 +1,3 @@ -- name: Generate oci_adb_transient_user - set_fact: - oci_adb_transient_user: "{{ oci_adb_user }}_{{ db_version | replace('.', '') }}" - when: oci_adb_force_transient_user is undefined or (oci_adb_force_transient_user|length == 0) - -- name: Force oci_adb_transient_user - set_fact: - oci_adb_transient_user: "{{ oci_adb_force_transient_user }}" - when: not (oci_adb_force_transient_user is undefined or (oci_adb_force_transient_user|length == 0)) - -- name: Define oci_adb_connection_tns - set_fact: - oci_adb_connection_tns: "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" - when: oci_adb_use_wallet == false - -- name: Define oci_adb_connection_tns - set_fact: - oci_adb_connection_tns: "/@{{ oci_adb_transient_user }}" - when: oci_adb_use_wallet == true - - include: tasks/local_sqlplus.yml vars: sql_param : { task_action : "Run tables recreate ADB SQL" , From 643e17f6789d8777f723df99b501cd3e00272659 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 21 Jun 2023 16:46:20 -0300 Subject: [PATCH 100/229] Update adb_process_dp_dump.sql --- user_scripts/odbfcl/adb_load_expdp/adb_process_dp_dump.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_scripts/odbfcl/adb_load_expdp/adb_process_dp_dump.sql b/user_scripts/odbfcl/adb_load_expdp/adb_process_dp_dump.sql index 4215191..f1ba972 100644 --- a/user_scripts/odbfcl/adb_load_expdp/adb_process_dp_dump.sql +++ b/user_scripts/odbfcl/adb_load_expdp/adb_process_dp_dump.sql @@ -1,7 +1,7 @@ WHENEVER SQLERROR EXIT SQL.SQLCODE BEGIN - X_PC_DUMP_LOAD.ADD_PROCESS + PC_DUMP_LOAD.ADD_PROCESS ( P_ORAVERSION => '&1', P_ORASERIES => '&2', From b0be9b61ef11274b4de7efd41d1561df8b6aa582 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 27 Jun 2023 09:26:18 -0300 Subject: [PATCH 101/229] Fix lvm list and allowing path > 255 bytes --- tasks/lvm_list.yml | 2 +- tasks/patch_tasks_pre.yml | 5 +++-- user_scripts/load/fileLoad.sh | 2 +- .../odbfcl/adb_load_filechksum/adb_load_filechksum.yml | 2 +- user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh | 2 +- user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tasks/lvm_list.yml b/tasks/lvm_list.yml index 06d628b..b23da04 100644 --- a/tasks/lvm_list.yml +++ b/tasks/lvm_list.yml @@ -2,7 +2,7 @@ - name: "Get LVM list." shell: | - lvs --noheadings -o lv_name + lvs --noheadings -o lv_name | sed 's/ *//g' become: true become_user: root delegate_to: "{{ vm_ip_address }}" diff --git a/tasks/patch_tasks_pre.yml b/tasks/patch_tasks_pre.yml index dff20c0..1d7892f 100644 --- a/tasks/patch_tasks_pre.yml +++ b/tasks/patch_tasks_pre.yml @@ -129,8 +129,9 @@ set_fact: found_lvm_entry: "{{ lvm_search }}" vars: - my_query: "lv_u01_{{ patch.type }}_{{ patch.id }}" - lvm_search: "{{ lvs_output.stdout_lines | select('search', my_query) | list | length > 0 }}" + my_query: "lv_u01_{{ patch.type }}_{{ patch.id }}$" + lvm_search: "{{ lvs_output.stdout_lines | select('match', my_query) | list | length > 0 }}" +# lvm_search: "{{ lvs_output.stdout_lines | select('search', my_query) | list | length > 0 }}" - block: diff --git a/user_scripts/load/fileLoad.sh b/user_scripts/load/fileLoad.sh index 498ce9f..44078f4 100644 --- a/user_scripts/load/fileLoad.sh +++ b/user_scripts/load/fileLoad.sh @@ -39,7 +39,7 @@ LOAD INTO TABLE T_FILES_LOAD APPEND FIELDS TERMINATED BY ' ' -(file_name constant "$i",hash,path) +(file_name constant "$i", hash, path char(4000)) EOF echo $i sqlldr ${username}/hash control=${curdir}/load.ctl errors=0 discardmax=0 direct=true data=${filesdir}/${i} log=${filesdir}/${i}.log diff --git a/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml b/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml index 70b657f..a51173b 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml +++ b/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml @@ -32,7 +32,7 @@ INTO TABLE T_FILES_LOAD APPEND FIELDS TERMINATED BY ' ' - (file_name constant "${v_file}",hash,path,file_type) + (file_name constant "${v_file}", hash, path char(4000), file_type) EOF cd "{{ chksum_folder }}" diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh index 0d30fd4..24b21c8 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh +++ b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh @@ -32,7 +32,7 @@ LOAD INTO TABLE ${v_dump_user}.T_FILES APPEND FIELDS TERMINATED BY ' ' -(sha256_hash, path, file_type) +(sha256_hash, path char(4000), file_type) EOF $ORACLE_HOME/bin/sqlldr \ diff --git a/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml b/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml index 22af80d..ac2ab15 100644 --- a/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml +++ b/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml @@ -32,7 +32,7 @@ INTO TABLE T_SYMBOLS_LOAD APPEND FIELDS TERMINATED BY '|' - (source_file constant "${v_file}",file_name,symbol_type,symbol_name char(4000)) + (source_file constant "${v_file}", file_name, symbol_type, symbol_name char(4000)) EOF cd "{{ symbols_folder }}" From 4d511b5a54cedb6dec5aabaa10800d86c5cf7ba9 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 27 Jun 2023 09:32:49 -0300 Subject: [PATCH 102/229] Allowing path > 255 bytes --- user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml | 2 +- .../adb_load_txtcollection_files.yml | 2 +- user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml b/user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml index c9faf7c..0410714 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml @@ -32,7 +32,7 @@ INTO TABLE T_BUGSFIXED_LOAD APPEND FIELDS TERMINATED BY x'09' - (file_name constant "${v_file}",bug_id, patch_id, bug_desc) + (file_name constant "${v_file}", bug_id, patch_id, bug_desc) EOF cd "{{ bugs_fixed_folder }}" diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml b/user_scripts/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml index 9f67b71..115ffd8 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml @@ -40,7 +40,7 @@ APPEND FIELDS TERMINATED BY ',' (file_name constant "${v_file}", - path, + path char(4000), contents lobfile(path) terminated by eof) EOF diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh index 2d8b9d0..098ddc9 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh @@ -46,7 +46,7 @@ LOAD INTO TABLE ${v_dump_user}.T_TXTCOLLECTION_LOAD APPEND FIELDS TERMINATED BY ',' -( path, contents lobfile(path) terminated by eof) +(path char(4000), contents lobfile(path) terminated by eof) EOF $ORACLE_HOME/bin/sqlldr \ From 1c9b57a80ef3f686094c09573f69d66c03d5d2e9 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 11 Jul 2023 14:42:23 -0300 Subject: [PATCH 103/229] Add base_ojvm capability --- tasks/lvm_savestate.yml | 6 +-- tasks/main_PSU_BP.yml | 93 +++++++++++++++----------------------- tasks/main_RU_RUR.yml | 93 +++++++++++++++----------------------- tasks/patch_tasks_post.yml | 23 +++++++++- tasks/vbox_savestate.yml | 4 +- 5 files changed, 101 insertions(+), 118 deletions(-) diff --git a/tasks/lvm_savestate.yml b/tasks/lvm_savestate.yml index 95de59b..7fe53c3 100644 --- a/tasks/lvm_savestate.yml +++ b/tasks/lvm_savestate.yml @@ -3,7 +3,7 @@ # Drop old machine image if exists - name: "Drop old LVM snapshots for previous RU or PSU if exists." shell: | - v_snapshot="{{ vm_snapshot }}" + v_snapshot="{{ save_snapshot }}" v_disk_vg='/dev/mapper/vg_u01' for lv_name in `lvs --noheadings -o lv_name | grep -E 'PSU|RU' | grep -v ${v_snapshot}` do @@ -14,9 +14,9 @@ delegate_to: "{{ vm_ip_address }}" # Save latest machine image if not already -- name: "Create new LVM snapshot \"{{ vm_snapshot }}\" if not exists." +- name: "Create new LVM snapshot \"{{ save_snapshot }}\" if not exists." shell: | - v_snapshot="{{ vm_snapshot }}" + v_snapshot="{{ save_snapshot }}" v_disk='/dev/mapper/vg_u01-lv_u01' if ! $(lvs -a | grep -q "${v_snapshot}") then diff --git a/tasks/main_PSU_BP.yml b/tasks/main_PSU_BP.yml index e588049..8ece8f8 100644 --- a/tasks/main_PSU_BP.yml +++ b/tasks/main_PSU_BP.yml @@ -23,19 +23,44 @@ with_items: "{{ list_info_oci }}" when: item.id == db_version and oci_mode -# reload is called before every patch is applied to rollback the VM to the snapshot image. -- name : Define snapshot base version to rollback when reload is called. - set_fact: - vm_snapshot: "{{ patch_base }}" - # This parameter will control if database start command was ever called. - name : Define database_started variable to false. set_fact: database_started: false +### For PSU or OJVM +- block: + + # Define base_OJVM_line. This is used by patch_task_post to save the snapshot. + - name: Get latest PSU ID + set_fact: + latest_PSU_id: "{{ lookup('vars', patch_list) | json_query(filter_qry_1) | max }}" + base_OJVM_id: "{{ ( ( lookup('vars', patch_list) | json_query(filter_qry_2) ) + [0] ) | max }}" + vars: + filter_qry_1: "[? type == 'PSU' ].id" + filter_qry_2: "[? type == 'PSU' && base_ojvm != null ].id" + + - name : Set base OJVM ID + set_fact: + base_OJVM_id: "{{ latest_PSU_id }}" + when: (base_OJVM_id | int) == 0 + + - name : Generate base_OJVM_line + set_fact: + base_OJVM_line: "{{ db_version }}|PSU|{{ base_OJVM_id }}" + + - name: "Base OJVM" + debug: msg="Base OJVM ID - {{ base_OJVM_line }}" + + when: param_type is undefined or param_type == "PSU" or param_type == "OJVM" + ### PSU - block: + - name : Define snapshot base version to rollback when reload is called. + set_fact: + vm_snapshot: "{{ patch_base }}" + # Execute for base release - include: "{{ patch_file }}" vars: @@ -59,69 +84,25 @@ when: param_type is undefined or param_type == "PSU" -### Save latest applied PSU as Base Snapshot for OJVM. Why? OJVM can't be appied over base release. They requires a DB PSU. -- block: - - - name: Get latest PSU ID - set_fact: - latest_psu_id: "{{ lookup('vars', patch_list) | json_query(filter_qry) | max }}" - vars: - filter_qry: "[?type=='PSU'].id" - - - name : Generate Snapshot Name - VBox Mode - set_fact: - vm_snapshot: "{{ db_version }} PSU {{ latest_psu_id }}" - latest_psu_line: "{{ db_version }}|PSU|{{ latest_psu_id }}" - when: not oci_mode - - - name : Generate Snapshot Name - LVM Mode - set_fact: - vm_snapshot: "PSU_{{ latest_psu_id }}" - latest_psu_line: "{{ db_version }}|PSU|{{ latest_psu_id }}" - when: oci_mode - - - name: "Latest PSU" - debug: msg="Latest PSU ID - {{ latest_psu_line }}" - - # Save lastest PSU as a new snapshot - Also changes vm_snapshot variable to it (for OJVM). - - include: vbox_savestate.yml - when: latest_psu_line == latest_processed and not oci_mode - - - include: lvm_savestate.yml - when: latest_psu_line == latest_processed and oci_mode - - - include: clean_ojvm_dumps.yml base_id="PSU_{{ latest_psu_id }}" - - when: param_type is undefined or param_type == "PSU" - -### OJVM define base Snapshot -# Will define it if not already done by the PSU above task. i.e: param_type is defined and "OJVM" +### OJVM - block: - - name: Get latest PSU ID - set_fact: - latest_psu_id: "{{ lookup('vars', patch_list) | json_query(filter_qry) | max }}" - vars: - filter_qry: "[?type=='PSU'].id" + ### Clean OJVM dumps if base_OJVM_id is different from the last. + - include: clean_ojvm_dumps.yml base_id="PSU_{{ base_OJVM_id }}" - - name : Generate Snapshot Name - VBox Mode + - name : Change Base Snapshot Name - VBox Mode set_fact: - vm_snapshot: "{{ db_version }} PSU {{ latest_psu_id }}" + vm_snapshot: "{{ db_version }} PSU {{ base_OJVM_id }}" when: not oci_mode - - name : Generate Snapshot Name - LVM Mode + - name : Change Base Snapshot Name - LVM Mode set_fact: - vm_snapshot: "PSU_{{ latest_psu_id }}" + vm_snapshot: "PSU_{{ base_OJVM_id }}" when: oci_mode - name: "Base Snapshot will be {{ vm_snapshot }}" debug: msg="Base Snapshot will be {{ vm_snapshot }}" - when: param_type is defined and param_type == "OJVM" - -### OJVM -- block: - # Execute for every OJVM - include: "{{ patch_file }}" loop: "{{ lookup('vars', patch_list) | flatten(levels=1) }}" diff --git a/tasks/main_RU_RUR.yml b/tasks/main_RU_RUR.yml index 4ff18b0..32b5690 100644 --- a/tasks/main_RU_RUR.yml +++ b/tasks/main_RU_RUR.yml @@ -24,19 +24,44 @@ with_items: "{{ list_info_oci }}" when: item.id == db_version and oci_mode -# reload is called before every patch is applied to rollback the VM to the snapshot image. -- name : Define snapshot base version to rollback when reload is called. - set_fact: - vm_snapshot: "{{ patch_base }}" - # This parameter will control if database start command was ever called. - name : Define database_started variable to false. set_fact: database_started: false +### For RU or OJVM +- block: + + # Define base_OJVM_line. This is used by patch_task_post to save the snapshot. + - name: Get latest RU ID + set_fact: + latest_RU_id: "{{ lookup('vars', patch_list) | json_query(filter_qry_1) | max }}" + base_OJVM_id: "{{ ( ( lookup('vars', patch_list) | json_query(filter_qry_2) ) + [0] ) | max }}" + vars: + filter_qry_1: "[? type == 'RU' ].id" + filter_qry_2: "[? type == 'RU' && base_ojvm != null ].id" + + - name : Set base OJVM ID + set_fact: + base_OJVM_id: "{{ latest_RU_id }}" + when: (base_OJVM_id | int) == 0 + + - name : Generate base_OJVM_line + set_fact: + base_OJVM_line: "{{ db_version }}|RU|{{ base_OJVM_id }}" + + - name: "Base OJVM" + debug: msg="Base OJVM ID - {{ base_OJVM_line }}" + + when: param_type is undefined or param_type == "RU" or param_type == "OJVM" + ### RU - block: + - name : Define snapshot base version to rollback when reload is called. + set_fact: + vm_snapshot: "{{ patch_base }}" + # Execute for base release - include: "{{ patch_file }}" vars: @@ -61,69 +86,25 @@ when: param_type is undefined or param_type == "RU" -### Save latest applied RU as Base Snapshot for OJVM. Why? OJVM can't be appied over base release. They requires a DB RU. -- block: - - - name: Get latest RU ID - set_fact: - latest_RU_id: "{{ lookup('vars', patch_list) | json_query(filter_qry) | max }}" - vars: - filter_qry: "[?type=='RU'].id" - - - name : Generate Snapshot Name - VBox Mode - set_fact: - vm_snapshot: "{{ db_version }} RU {{ latest_RU_id }}" - latest_RU_line: "{{ db_version }}|RU|{{ latest_RU_id }}" - when: not oci_mode - - - name : Generate Snapshot Name - LVM Mode - set_fact: - vm_snapshot: "RU_{{ latest_RU_id }}" - latest_RU_line: "{{ db_version }}|RU|{{ latest_RU_id }}" - when: oci_mode - - - name: "Latest RU" - debug: msg="Latest RU ID - {{ latest_RU_line }}" - - # Save lastest RU as a new snapshot - Also changes vm_snapshot variable to it (for OJVM). - - include: vbox_savestate.yml - when: latest_RU_line == latest_processed and not oci_mode - - - include: lvm_savestate.yml - when: latest_RU_line == latest_processed and oci_mode - - - include: clean_ojvm_dumps.yml base_id="RU_{{ latest_RU_id }}" - - when: param_type is undefined or param_type == "RU" - -### OJVM define base Snapshot -# Will define it if not already done by the RU above task. i.e: param_type is defined and "OJVM" +### OJVM - block: - - name: Get latest RU ID - set_fact: - latest_RU_id: "{{ lookup('vars', patch_list) | json_query(filter_qry) | max }}" - vars: - filter_qry: "[?type=='RU'].id" + ### Clean OJVM dumps if base_OJVM_id is different from the last. + - include: clean_ojvm_dumps.yml base_id="RU_{{ base_OJVM_id }}" - - name : Generate Snapshot Name - VBox Mode + - name : Change Base Snapshot Name - VBox Mode set_fact: - vm_snapshot: "{{ db_version }} RU {{ latest_RU_id }}" + vm_snapshot: "{{ db_version }} RU {{ base_OJVM_id }}" when: not oci_mode - - name : Generate Snapshot Name - LVM Mode + - name : Change Base Snapshot Name - LVM Mode set_fact: - vm_snapshot: "RU_{{ latest_RU_id }}" + vm_snapshot: "RU_{{ base_OJVM_id }}" when: oci_mode - name: "Base Snapshot will be {{ vm_snapshot }}" debug: msg="Base Snapshot will be {{ vm_snapshot }}" - when: param_type is defined and param_type == "OJVM" - -### OJVM -- block: - # Execute for every OJVM - include: "{{ patch_file }}" loop: "{{ lookup('vars', patch_list) | flatten(levels=1) }}" diff --git a/tasks/patch_tasks_post.yml b/tasks/patch_tasks_post.yml index f81d034..9f29e31 100644 --- a/tasks/patch_tasks_post.yml +++ b/tasks/patch_tasks_post.yml @@ -49,4 +49,25 @@ - name : Define latest processed set_fact: - latest_processed: "{{ db_version }}|{{ patch.type }}|{{ patch.id }}" \ No newline at end of file + latest_processed: "{{ db_version }}|{{ patch.type }}|{{ patch.id }}" + +### Save latest applied PSU/RU as Base Snapshot for OJVM. +- block: + + - name : Generate Snapshot Name - VBox Mode + set_fact: + save_snapshot: "{{ db_version }} {{ patch.type }} {{ base_OJVM_id }}" + when: not oci_mode + + - include: vbox_savestate.yml + when: not oci_mode + + - name : Generate Snapshot Name - LVM Mode + set_fact: + save_snapshot: "{{ patch.type }}_{{ base_OJVM_id }}" + when: oci_mode + + - include: lvm_savestate.yml + when: oci_mode + + when: ( patch.type == "PSU" or patch.type == "RU" ) and base_OJVM_line == latest_processed \ No newline at end of file diff --git a/tasks/vbox_savestate.yml b/tasks/vbox_savestate.yml index 71f86c6..987c34b 100644 --- a/tasks/vbox_savestate.yml +++ b/tasks/vbox_savestate.yml @@ -1,10 +1,10 @@ ## This code will take a snapshot named "vm_snapshot" for the VM. It will later be used as a base release for OJVMs. # Save latest machine image if not already -- name: "Create new VM snapshot \"{{ vm_snapshot }}\" if not exists." +- name: "Create new VM snapshot \"{{ save_snapshot }}\" if not exists." shell: | MACHINE="{{ vm_machine }}" - SNAPSHOT="{{ vm_snapshot }}" + SNAPSHOT="{{ save_snapshot }}" if ! $(VBoxManage showvminfo --machinereadable "$MACHINE" | grep -q "^SnapshotName.*=\"$SNAPSHOT\"") then VBoxManage snapshot "$MACHINE" take "$SNAPSHOT" From e3d885c64713d6675542ff68fee7ec109a805aff Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 12 Jul 2023 20:28:04 -0300 Subject: [PATCH 104/229] Fixes --- tasks/main_PSU_BP.yml | 10 ---------- user_scripts/odbfcl/tables_create.sql | 8 ++++---- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/tasks/main_PSU_BP.yml b/tasks/main_PSU_BP.yml index 8ece8f8..ad04384 100644 --- a/tasks/main_PSU_BP.yml +++ b/tasks/main_PSU_BP.yml @@ -130,16 +130,6 @@ vars: filter_qry: "[?type=='BP'].id" - # Execute for base release if there is at least 1 BP for that version - - include: "{{ patch_file }}" - vars: - patch : { type : BP , id : 0, patch_number : 0 } - when: - - total_bps != "0" - - 0 == (param_patch | float) or param_patch == -1 - - 0 >= (param_patch_from | float) or param_patch_from == -1 - - 0 <= (param_patch_to | float) or param_patch_to == -1 - # Execute for every BP - include: "{{ patch_file }}" loop: "{{ lookup('vars', patch_list) | flatten(levels=1) }}" diff --git a/user_scripts/odbfcl/tables_create.sql b/user_scripts/odbfcl/tables_create.sql index 68768e7..4e61043 100644 --- a/user_scripts/odbfcl/tables_create.sql +++ b/user_scripts/odbfcl/tables_create.sql @@ -308,7 +308,7 @@ COMPRESS NOLOGGING; CREATE TABLE "T_AUD_UNIFIED_ENABLED_POLICIES" ( -"POLICY_NAME" VARCHAR2(128), +"POLICY_NAME" VARCHAR2(128) NOT NULL, "ENABLED_OPTION" VARCHAR2(15), "ENTITY_NAME" VARCHAR2(128), "ENTITY_TYPE" VARCHAR2(7), @@ -320,7 +320,7 @@ COMPRESS NOLOGGING; CREATE TABLE "T_AUD_UNIFIED_POLICY_COMMENTS" ( -"POLICY_NAME" VARCHAR2(128) NOT NULL ENABLE, +"POLICY_NAME" VARCHAR2(128) NOT NULL, "COMMENTS" VARCHAR2(4000), "CON_ID" NUMBER ) @@ -734,8 +734,8 @@ COMPRESS NOLOGGING; CREATE TABLE "T_OBSOLETE_PARAMETER" ( -"NAME" VARCHAR2(64), -"ISSPECIFIED" VARCHAR2(5), +"NAME" VARCHAR2(64) NOT NULL, +-- "ISSPECIFIED" VARCHAR2(5), "CON_ID" NUMBER ) COMPRESS NOLOGGING; From 73359683f9c56769d9afcd5159d78376d85118a0 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 19 Jul 2023 13:46:42 -0300 Subject: [PATCH 105/229] Update list_patches.yml --- list_patches.yml | 132 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 93 insertions(+), 39 deletions(-) diff --git a/list_patches.yml b/list_patches.yml index 7e4cff5..8f3b6da 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -32,8 +32,8 @@ list_11204: - { type : "PSU" , id : 200114 , patch_number : 30298532 } - { type : "PSU" , id : 200414 , patch_number : 30670774 } - { type : "PSU" , id : 200714 , patch_number : 31103343 } - - { type : "PSU" , id : 201020 , patch_number : 31537677 } - - { type : "PSU" , id : 210119 , patch_number : 31983472 } + - { type : "PSU" , id : 201020 , patch_number : 31537677 } # LAST PUBLIC - END OF EXTENDED + - { type : "PSU" , id : 210119 , patch_number : 31983472 } # START TIER 1 - { type : "PSU" , id : 210420 , patch_number : 32328626 } - { type : "PSU" , id : 210720 , patch_number : 32758711 } - { type : "PSU" , id : 211019 , patch_number : 33128584 } @@ -41,6 +41,9 @@ list_11204: - { type : "PSU" , id : 220419 , patch_number : 33711103 } - { type : "PSU" , id : 220719 , patch_number : 34057724 } - { type : "PSU" , id : 221018 , patch_number : 34386237 } + - { type : "PSU" , id : 230117 , patch_number : 34677698 } + - { type : "PSU" , id : 230418 , patch_number : 34998337 } + - { type : "PSU" , id : 230718 , patch_number : 35269283 } - { type : "OJVM" , id : 1 , patch_number : 19282021 } - { type : "OJVM" , id : 2 , patch_number : 19877440 } - { type : "OJVM" , id : 3 , patch_number : 20406239 } @@ -65,15 +68,18 @@ list_11204: - { type : "OJVM" , id : 200114 , patch_number : 30503372 } - { type : "OJVM" , id : 200414 , patch_number : 30805543 } - { type : "OJVM" , id : 200714 , patch_number : 31219953 } - - { type : "OJVM" , id : 201020 , patch_number : 31668908 } -# - { type : "OJVM" , id : 210119 , patch_number : } # NOTHING TO FIX - NO PATCH CREATED - - { type : "OJVM" , id : 210420 , patch_number : 32671980 } + - { type : "OJVM" , id : 201020 , patch_number : 31668908 } # LAST PUBLIC - END OF EXTENDED +# - { type : "OJVM" , id : 210119 , patch_number : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED + - { type : "OJVM" , id : 210420 , patch_number : 32671980 } # START TIER 1 - { type : "OJVM" , id : 210720 , patch_number : 32876451 } - { type : "OJVM" , id : 211019 , patch_number : 33192642 } - { type : "OJVM" , id : 220118 , patch_number : 33561250 } - { type : "OJVM" , id : 220419 , patch_number : 33829826 } - { type : "OJVM" , id : 220719 , patch_number : 34085652 } - { type : "OJVM" , id : 221018 , patch_number : 34412266 } + - { type : "OJVM" , id : 230117 , patch_number : 34763334 } + - { type : "OJVM" , id : 230418 , patch_number : 35039831 } + - { type : "OJVM" , id : 230718 , patch_number : 35349843 } - { type : "BP" , id : 1 , patch_number : 17628025 , patch_folder : 17628006 } - { type : "BP" , id : 2 , patch_number : 17838803 , patch_folder : 17741631 } - { type : "BP" , id : 3 , patch_number : 17904156 , patch_folder : 17943261 } @@ -114,8 +120,8 @@ list_11204: - { type : "BP" , id : 200114 , patch_number : 30501894 , patch_folder : 30310975 } - { type : "BP" , id : 200414 , patch_number : 30805507 , patch_folder : 30691206 } - { type : "BP" , id : 200714 , patch_number : 31220011 , patch_folder : 31103314 } - - { type : "BP" , id : 201020 , patch_number : 31718644 , patch_folder : 31537652 } - - { type : "BP" , id : 210119 , patch_number : 32131241 , patch_folder : 31983477 } + - { type : "BP" , id : 201020 , patch_number : 31718644 , patch_folder : 31537652 } # LAST PUBLIC - END OF EXTENDED + - { type : "BP" , id : 210119 , patch_number : 32131241 , patch_folder : 31983477 } # START TIER 1 - { type : "BP" , id : 210420 , patch_number : 32537095 , patch_folder : 32328629 } - { type : "BP" , id : 210720 , patch_number : 32917411 , patch_folder : 32758732 } - { type : "BP" , id : 211019 , patch_number : 33248386 , patch_folder : 33128587 } @@ -123,7 +129,8 @@ list_11204: - { type : "BP" , id : 220419 , patch_number : 33880541 , patch_folder : 33711121 } - { type : "BP" , id : 220719 , patch_number : 34204546 , patch_folder : 34057719 } - { type : "BP" , id : 221018 , patch_number : 34536785 , patch_folder : 34383800 } - + - { type : "BP" , id : 230117 , patch_number : 34774400 , patch_folder : 34677707 } + - { type : "BP" , id : 230418 , patch_number : 35058326 , patch_folder : 34998345 } #################### ##### 12.1.0.1 ##### @@ -174,7 +181,7 @@ list_12102: - { type : "PSU" , id : 170117 , patch_number : 24732082 } - { type : "PSU" , id : 170418 , patch_number : 25171037 } - { type : "PSU" , id : 170718 , patch_number : 25755742 } - - { type : "PSU" , id : 170814 , patch_number : 26609783 } + - { type : "PSU" , id : 170814 , patch_number : 26609783 } # EXTRA PSU - { type : "PSU" , id : 171017 , patch_number : 26713565 } - { type : "PSU" , id : 180116 , patch_number : 26925311 } - { type : "PSU" , id : 180417 , patch_number : 27338041 } @@ -194,8 +201,11 @@ list_12102: - { type : "PSU" , id : 211019 , patch_number : 33128590 } - { type : "PSU" , id : 220118 , patch_number : 33477199 } - { type : "PSU" , id : 220419 , patch_number : 33711081 } - - { type : "PSU" , id : 220719 , patch_number : 34057742 } + - { type : "PSU" , id : 220719 , patch_number : 34057742 } # LAST PUBLIC - END OF EXTENDED - { type : "PSU" , id : 221018 , patch_number : 34386266 } + - { type : "PSU" , id : 230117 , patch_number : 34677720 } # START TIER 1 + - { type : "PSU" , id : 230418 , patch_number : 34998358 } + - { type : "PSU" , id : 230718 , patch_number : 35269262 } - { type : "OJVM" , id : 1 , patch_number : 19282028 } - { type : "OJVM" , id : 2 , patch_number : 19877336 } - { type : "OJVM" , id : 3 , patch_number : 20415564 } @@ -227,8 +237,11 @@ list_12102: - { type : "OJVM" , id : 211019 , patch_number : 33192628 } - { type : "OJVM" , id : 220118 , patch_number : 33561268 } - { type : "OJVM" , id : 220419 , patch_number : 33808385 } - - { type : "OJVM" , id : 220719 , patch_number : 34086863 } + - { type : "OJVM" , id : 220719 , patch_number : 34086863 } # LAST PUBLIC - END OF EXTENDED - { type : "OJVM" , id : 221018 , patch_number : 34412250 } + - { type : "OJVM" , id : 230117 , patch_number : 34763317 } # START TIER 1 + - { type : "OJVM" , id : 230418 , patch_number : 35077439 } + - { type : "OJVM" , id : 230718 , patch_number : 35354391 } - { type : "BP" , id : 1 , patch_number : 19404326 , patch_folder : 19189240 } - { type : "BP" , id : 2 , patch_number : 19774304 , patch_folder : 19649591 } - { type : "BP" , id : 3 , patch_number : 20026159 , patch_folder : 19878106 } @@ -269,8 +282,10 @@ list_12102: - { type : "BP" , id : 211019 , patch_number : 33248411 , patch_folder : 33114885 } - { type : "BP" , id : 220118 , patch_number : 33575286 , patch_folder : 33465249 } - { type : "BP" , id : 220419 , patch_number : 33880550 , patch_folder : 33711072 } - - { type : "BP" , id : 220719 , patch_number : 34204559 , patch_folder : 34057733 } + - { type : "BP" , id : 220719 , patch_number : 34204559 , patch_folder : 34057733 } # LAST PUBLIC - END OF EXTENDED - { type : "BP" , id : 221018 , patch_number : 34536908 , patch_folder : 34386250 } + - { type : "BP" , id : 230117 , patch_number : 34774411 , patch_folder : 34677708 } # START TIER 1 + - { type : "BP" , id : 230418 , patch_number : 35058289 , patch_folder : 34998350 } #################### ##### 12.2.0.1 ##### @@ -298,10 +313,13 @@ list_12201: - { type : "RU" , id : 210420 , patch_number : 32507738 } - { type : "RU" , id : 210720 , patch_number : 32916808 } - { type : "RU" , id : 211019 , patch_number : 33261817 } - - { type : "RU" , id : 220118 , patch_number : 33587128 } -# - { type : "RU" , id : 220419 , patch_number : 33878460 } # NOT AVAILABLE TO DOWNLOAD -# - { type : "RU" , id : 220719 , patch_number : 34219726 } # NOT AVAILABLE TO DOWNLOAD -# - { type : "RU" , id : 221018 , patch_number : 34518562 } # NOT AVAILABLE TO DOWNLOAD + - { type : "RU" , id : 220118 , patch_number : 33587128 , base_ojvm: true } # LAST PATCH + - { type : "RU" , id : 220419 , patch_number : 33878460 } # PASSWORD PROTECTED + - { type : "RU" , id : 220719 , patch_number : 34219726 } # PASSWORD PROTECTED + - { type : "RU" , id : 221018 , patch_number : 34518562 } # PASSWORD PROTECTED + - { type : "RU" , id : 230117 , patch_number : 34850184 } # PASSWORD PROTECTED + - { type : "RU" , id : 230418 , patch_number : 35115783 } # PASSWORD PROTECTED + - { type : "RU" , id : 230718 , patch_number : 35407080 } # PASSWORD PROTECTED - { type : "RUR" , id : 171017 , patch_number : 26518812 , base_ru : JUL2017 } - { type : "RUR" , id : 180116 , patch_number : 27013506 , base_ru : JUL2017 } - { type : "RUR" , id : 180116 , patch_number : 27013510 , base_ru : OCT2017 } @@ -345,10 +363,13 @@ list_12201: - { type : "OJVM" , id : 210420 , patch_number : 32473172 } - { type : "OJVM" , id : 210720 , patch_number : 32876409 } - { type : "OJVM" , id : 211019 , patch_number : 33192662 } - - { type : "OJVM" , id : 220118 , patch_number : 33561275 } -# - { type : "OJVM" , id : 220419 , patch_number : 33829783 } # NOT AVAILABLE TO DOWNLOAD -# - { type : "OJVM" , id : 220719 , patch_number : 34086867 } # NOT AVAILABLE TO DOWNLOAD -# - { type : "OJVM" , id : 221018 , patch_number : 34412174 } # NOT AVAILABLE TO DOWNLOAD + - { type : "OJVM" , id : 220118 , patch_number : 33561275 } # LAST PATCH + - { type : "OJVM" , id : 220419 , patch_number : 33829783 } # PASSWORD PROTECTED + - { type : "OJVM" , id : 220719 , patch_number : 34086867 } # PASSWORD PROTECTED + - { type : "OJVM" , id : 221018 , patch_number : 34412174 } # PASSWORD PROTECTED + - { type : "OJVM" , id : 230117 , patch_number : 34763276 } # PASSWORD PROTECTED + - { type : "OJVM" , id : 230418 , patch_number : 35058256 } # PASSWORD PROTECTED + - { type : "OJVM" , id : 230718 , patch_number : 35348984 } # PASSWORD PROTECTED #################### ##### 18.0.0.0 ##### @@ -372,12 +393,15 @@ list_18000: - { type : "RU" , id : 12 , patch_number : 31730250 } - { type : "RU" , id : 13 , patch_number : 32204699 } - { type : "RU" , id : 14 , patch_number : 32524155 } -# - { type : "RU" , id : 15 , patch_number : 32907484 } # NOT AVAILABLE TO DOWNLOAD -# - { type : "RU" , id : 16 , patch_number : 33339024 } # NOT AVAILABLE TO DOWNLOAD - - { type : "RU" , id : 17 , patch_number : 33583960 } -# - { type : "RU" , id : 18 , patch_number : 33878468 } # NOT AVAILABLE TO DOWNLOAD -# - { type : "RU" , id : 19 , patch_number : 34219743 } # NOT AVAILABLE TO DOWNLOAD -# - { type : "RU" , id : 20 , patch_number : 34518577 } # NOT AVAILABLE TO DOWNLOAD + - { type : "RU" , id : 15 , patch_number : 32907484 } # NOT AVAILABLE TO DOWNLOAD + - { type : "RU" , id : 16 , patch_number : 33339024 } # NOT AVAILABLE TO DOWNLOAD + - { type : "RU" , id : 17 , patch_number : 33583960 , base_ojvm: true } # LAST PATCH + - { type : "RU" , id : 18 , patch_number : 33878468 } # NOT AVAILABLE TO DOWNLOAD + - { type : "RU" , id : 19 , patch_number : 34219743 } # NOT AVAILABLE TO DOWNLOAD + - { type : "RU" , id : 20 , patch_number : 34518577 } # NOT AVAILABLE TO DOWNLOAD + - { type : "RU" , id : 21 , patch_number : 34854019 } # NOT AVAILABLE TO DOWNLOAD + - { type : "RU" , id : 22 , patch_number : 35114260 } # NOT AVAILABLE TO DOWNLOAD + - { type : "RU" , id : 23 , patch_number : 35411347 } # NOT AVAILABLE TO DOWNLOAD # - { type : "RUR" , id : 1 , patch_number : 28346593 , base_ru : '18.2' } # - { type : "RUR" , id : 2 , patch_number : 28601267 , base_ru : '18.2' } - { type : "RUR" , id : 1 , patch_number : 28507480 , base_ru : '18.3' } @@ -413,14 +437,16 @@ list_18000: - { type : "OJVM" , id : 200714 , patch_number : 31219909 } - { type : "OJVM" , id : 201020 , patch_number : 31668892 } - { type : "OJVM" , id : 210119 , patch_number : 32119939 } - - { type : "OJVM" , id : 210420 , patch_number : 32552752 } -# - { type : "OJVM" , id : 210720 , patch_number : 32876373 } # NOT AVAILABLE TO DOWNLOAD -# - { type : "OJVM" , id : 211019 , patch_number : 33192684 } # NOT AVAILABLE TO DOWNLOAD + - { type : "OJVM" , id : 210420 , patch_number : 32552752 } # LAST PATCH + - { type : "OJVM" , id : 210720 , patch_number : 32876373 } # PASSWORD PROTECTED + - { type : "OJVM" , id : 211019 , patch_number : 33192684 } # NOT AVAILABLE TO DOWNLOAD - { type : "OJVM" , id : 220118 , patch_number : 33549631 } -# - { type : "OJVM" , id : 220419 , patch_number : 33829896 } # NOT AVAILABLE TO DOWNLOAD -# - { type : "OJVM" , id : 220719 , patch_number : 34086894 } # NOT AVAILABLE TO DOWNLOAD -# - { type : "OJVM" , id : 221018 , patch_number : 34411878 } # NOT AVAILABLE TO DOWNLOAD - + - { type : "OJVM" , id : 220419 , patch_number : 33829896 } # NOT AVAILABLE TO DOWNLOAD + - { type : "OJVM" , id : 220719 , patch_number : 34086894 } # NOT AVAILABLE TO DOWNLOAD # 18.19 + - { type : "OJVM" , id : 221018 , patch_number : 34411878 } # NOT AVAILABLE TO DOWNLOAD # 18.20 + - { type : "OJVM" , id : 230117 , patch_number : 34763258 } # NOT AVAILABLE TO DOWNLOAD # 18.21 + - { type : "OJVM" , id : 230418 , patch_number : 35058238 } # NOT AVAILABLE TO DOWNLOAD # 18.22 + - { type : "OJVM" , id : 230718 , patch_number : 35354394 } # NOT AVAILABLE TO DOWNLOAD # 18.23 # No more updates on this one. @@ -446,6 +472,10 @@ list_19000: - { type : "RU" , id : 15 , patch_number : 33806152 } - { type : "RU" , id : 16 , patch_number : 34133642 } - { type : "RU" , id : 17 , patch_number : 34419443 } + - { type : "RU" , id : 18 , patch_number : 34765931 , aru : 25078403 , file_suf : '_v0' } + - { type : "RU" , id : 18.1 , patch_number : 34765931 , aru : 25098466 } + - { type : "RU" , id : 19 , patch_number : 35042068 } + - { type : "RU" , id : 20 , patch_number : 35320081 } - { type : "RUR" , id : 1 , patch_number : 29799057 , base_ru : '19.3' } - { type : "RUR" , id : 2 , patch_number : 30087906 , base_ru : '19.3' } - { type : "RUR" , id : 1 , patch_number : 30080447 , base_ru : '19.4' } @@ -474,7 +504,22 @@ list_19000: - { type : "RUR" , id : 1 , patch_number : 34119532 , base_ru : '19.15' } - { type : "RUR" , id : 2 , patch_number : 34429835 , base_ru : '19.15' } - { type : "RUR" , id : 1 , patch_number : 34444812 , base_ru : '19.16' } + - { type : "RUR" , id : 2 , patch_number : 34771828 , base_ru : '19.16' } - { type : "MRP" , id : 221115 , patch_number : 34737974 , base_ru : '19.17' , dep_type : 'RU' , dep_id : 17 , apply_method : "opatchauto" } + - { type : "MRP" , id : 221220 , patch_number : 34819700 , base_ru : '19.17' , dep_type : 'RU' , dep_id : 17 , apply_method : "opatchauto" } + - { type : "MRP" , id : 230117 , patch_number : 34935010 , base_ru : '19.17' , dep_type : 'RU' , dep_id : 17 , apply_method : "opatchauto" } + - { type : "MRP" , id : 230221 , patch_number : 35011213 , base_ru : '19.17' , dep_type : 'RU' , dep_id : 17 , apply_method : "napply" } + - { type : "MRP" , id : 230321 , patch_number : 35154667 , base_ru : '19.17' , dep_type : 'RU' , dep_id : 17 , apply_method : "napply" } + - { type : "MRP" , id : 230418 , patch_number : 35237165 , base_ru : '19.17' , dep_type : 'RU' , dep_id : 17 , apply_method : "napply" } + - { type : "MRP" , id : 230221 , patch_number : 35011316 , base_ru : '19.18' , dep_type : 'RU' , dep_id : 18 , apply_method : "napply" } + - { type : "MRP" , id : 230321 , patch_number : 35155358 , base_ru : '19.18' , dep_type : 'RU' , dep_id : 18 , apply_method : "napply" } + - { type : "MRP" , id : 230418 , patch_number : 35237121 , base_ru : '19.18' , dep_type : 'RU' , dep_id : 18 , apply_method : "napply" } + - { type : "MRP" , id : 230516 , patch_number : 35333818 , base_ru : '19.18' , dep_type : 'RU' , dep_id : 18 , apply_method : "napply" } + - { type : "MRP" , id : 230620 , patch_number : 35449858 , base_ru : '19.18' , dep_type : 'RU' , dep_id : 18 , apply_method : "napply" } + - { type : "MRP" , id : 230718 , patch_number : 35573556 , base_ru : '19.18' , dep_type : 'RU' , dep_id : 18 , apply_method : "napply" } + - { type : "MRP" , id : 230516 , patch_number : 35333937 , base_ru : '19.19' , dep_type : 'RU' , dep_id : 18 , apply_method : "napply" } + - { type : "MRP" , id : 230620 , patch_number : 35449803 , base_ru : '19.19' , dep_type : 'RU' , dep_id : 18 , apply_method : "napply" } + - { type : "MRP" , id : 230718 , patch_number : 35573506 , base_ru : '19.19' , dep_type : 'RU' , dep_id : 18 , apply_method : "napply" } - { type : "OJVM" , id : 190416 , patch_number : 29548437 } - { type : "OJVM" , id : 190716 , patch_number : 29774421 } - { type : "OJVM" , id : 191015 , patch_number : 30128191 } @@ -490,6 +535,9 @@ list_19000: - { type : "OJVM" , id : 220419 , patch_number : 33808367 } - { type : "OJVM" , id : 220719 , patch_number : 34086870 } - { type : "OJVM" , id : 221018 , patch_number : 34411846 } + - { type : "OJVM" , id : 230117 , patch_number : 34786990 } + - { type : "OJVM" , id : 230418 , patch_number : 35050341 } + - { type : "OJVM" , id : 230718 , patch_number : 35354406 } #################### ##### 21.0.0.0 ##### @@ -497,15 +545,21 @@ list_19000: list_21000: #- { type : "RU" , id : 3 , patch_number : 00000000 , base_snap : "21.2.0" } - - { type : "RU" , id : 4 , patch_number : 33239276 } - - { type : "RU" , id : 5 , patch_number : 33516412 } - - { type : "RU" , id : 6 , patch_number : 33843745 } - - { type : "RU" , id : 7 , patch_number : 34160444 } - - { type : "RU" , id : 8 , patch_number : 34527084 } + - { type : "RU" , id : 4 , patch_number : 33239276 } + - { type : "RU" , id : 5 , patch_number : 33516412 } + - { type : "RU" , id : 6 , patch_number : 33843745 } + - { type : "RU" , id : 7 , patch_number : 34160444 } + - { type : "RU" , id : 8 , patch_number : 34527084 } + - { type : "RU" , id : 9 , patch_number : 34839741 } + - { type : "RU" , id : 10 , patch_number : 35134934 } + - { type : "RU" , id : 11 , patch_number : 35428978 } #################### ##### 23.0.0.0 ##### #################### list_23000: - - { type : "RU" , id : 3 , patch_number : 00000000 , base_snap : "23.2.0" } \ No newline at end of file + - { type : "RU" , id : 1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta1.tar.gz" } + - { type : "RU" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta2.tar.gz" } + - { type : "RU" , id : 2.1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.DevRel.tar.gz" } +# - { type : "RU" , id : 3 , patch_number : 00000000 , base_snap : "23.2.0" } \ No newline at end of file From b235b1ac8f6138df5c34341d7139e3020e153e30 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 19 Jul 2023 13:53:34 -0300 Subject: [PATCH 106/229] Update list_patches.yml --- list_patches.yml | 188 +++++++++++++++++++++++------------------------ 1 file changed, 94 insertions(+), 94 deletions(-) diff --git a/list_patches.yml b/list_patches.yml index 8f3b6da..b24cdde 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -380,51 +380,51 @@ list_12201: # No more updates on this one. list_18000: -# - { type : "RU" , id : 2 , patch_number : 27676517 , base_snap : "18.1.0" } - - { type : "RU" , id : 3 , patch_number : 28090523 , base_snap : "18.1.0" } - - { type : "RU" , id : 4 , patch_number : 28655784 } - - { type : "RU" , id : 5 , patch_number : 28822489 } - - { type : "RU" , id : 6 , patch_number : 29301631 } - - { type : "RU" , id : 7 , patch_number : 29757256 } - - { type : "RU" , id : 8 , patch_number : 30112122 } - - { type : "RU" , id : 9 , patch_number : 30480385 } - - { type : "RU" , id : 10 , patch_number : 30872794 } - - { type : "RU" , id : 11 , patch_number : 31308624 } - - { type : "RU" , id : 12 , patch_number : 31730250 } - - { type : "RU" , id : 13 , patch_number : 32204699 } - - { type : "RU" , id : 14 , patch_number : 32524155 } - - { type : "RU" , id : 15 , patch_number : 32907484 } # NOT AVAILABLE TO DOWNLOAD - - { type : "RU" , id : 16 , patch_number : 33339024 } # NOT AVAILABLE TO DOWNLOAD - - { type : "RU" , id : 17 , patch_number : 33583960 , base_ojvm: true } # LAST PATCH - - { type : "RU" , id : 18 , patch_number : 33878468 } # NOT AVAILABLE TO DOWNLOAD - - { type : "RU" , id : 19 , patch_number : 34219743 } # NOT AVAILABLE TO DOWNLOAD - - { type : "RU" , id : 20 , patch_number : 34518577 } # NOT AVAILABLE TO DOWNLOAD - - { type : "RU" , id : 21 , patch_number : 34854019 } # NOT AVAILABLE TO DOWNLOAD - - { type : "RU" , id : 22 , patch_number : 35114260 } # NOT AVAILABLE TO DOWNLOAD - - { type : "RU" , id : 23 , patch_number : 35411347 } # NOT AVAILABLE TO DOWNLOAD -# - { type : "RUR" , id : 1 , patch_number : 28346593 , base_ru : '18.2' } -# - { type : "RUR" , id : 2 , patch_number : 28601267 , base_ru : '18.2' } - - { type : "RUR" , id : 1 , patch_number : 28507480 , base_ru : '18.3' } - - { type : "RUR" , id : 2 , patch_number : 28790643 , base_ru : '18.3' } - - { type : "RUR" , id : 1 , patch_number : 28822587 , base_ru : '18.4' } - - { type : "RUR" , id : 2 , patch_number : 29230809 , base_ru : '18.4' } - - { type : "RUR" , id : 1 , patch_number : 29230887 , base_ru : '18.5' } - - { type : "RUR" , id : 2 , patch_number : 29708437 , base_ru : '18.5' } - - { type : "RUR" , id : 1 , patch_number : 29708235 , base_ru : '18.6' } - - { type : "RUR" , id : 2 , patch_number : 30087881 , base_ru : '18.6' } - - { type : "RUR" , id : 1 , patch_number : 30080518 , base_ru : '18.7' } - - { type : "RUR" , id : 2 , patch_number : 30446239 , base_ru : '18.7' } - - { type : "RUR" , id : 1 , patch_number : 30445895 , base_ru : '18.8' } - - { type : "RUR" , id : 2 , patch_number : 30830887 , base_ru : '18.8' } - - { type : "RUR" , id : 1 , patch_number : 30798089 , base_ru : '18.9' } - - { type : "RUR" , id : 2 , patch_number : 31212186 , base_ru : '18.9' } - - { type : "RUR" , id : 1 , patch_number : 31211410 , base_ru : '18.10' } - - { type : "RUR" , id : 2 , patch_number : 31667173 , base_ru : '18.10' } - - { type : "RUR" , id : 1 , patch_number : 31666917 , base_ru : '18.11' } - - { type : "RUR" , id : 2 , patch_number : 32066686 , base_ru : '18.11' } - - { type : "RUR" , id : 1 , patch_number : 32072459 , base_ru : '18.12' } - - { type : "RUR" , id : 2 , patch_number : 32421478 , base_ru : '18.12' } - - { type : "RUR" , id : 1 , patch_number : 32451079 , base_ru : '18.13' } +# - { type : "RU" , id : 2 , patch_number : 27676517 , base_snap : "18.1.0" } + - { type : "RU" , id : 3 , patch_number : 28090523 , base_snap : "18.1.0" } + - { type : "RU" , id : 4 , patch_number : 28655784 } + - { type : "RU" , id : 5 , patch_number : 28822489 } + - { type : "RU" , id : 6 , patch_number : 29301631 } + - { type : "RU" , id : 7 , patch_number : 29757256 } + - { type : "RU" , id : 8 , patch_number : 30112122 } + - { type : "RU" , id : 9 , patch_number : 30480385 } + - { type : "RU" , id : 10 , patch_number : 30872794 } + - { type : "RU" , id : 11 , patch_number : 31308624 } + - { type : "RU" , id : 12 , patch_number : 31730250 } + - { type : "RU" , id : 13 , patch_number : 32204699 } + - { type : "RU" , id : 14 , patch_number : 32524155 } + - { type : "RU" , id : 15 , patch_number : 32907484 } # NOT AVAILABLE TO DOWNLOAD + - { type : "RU" , id : 16 , patch_number : 33339024 } # NOT AVAILABLE TO DOWNLOAD + - { type : "RU" , id : 17 , patch_number : 33583960 , base_ojvm: true } # LAST PATCH + - { type : "RU" , id : 18 , patch_number : 33878468 } # NOT AVAILABLE TO DOWNLOAD + - { type : "RU" , id : 19 , patch_number : 34219743 } # NOT AVAILABLE TO DOWNLOAD + - { type : "RU" , id : 20 , patch_number : 34518577 } # NOT AVAILABLE TO DOWNLOAD + - { type : "RU" , id : 21 , patch_number : 34854019 } # NOT AVAILABLE TO DOWNLOAD + - { type : "RU" , id : 22 , patch_number : 35114260 } # NOT AVAILABLE TO DOWNLOAD + - { type : "RU" , id : 23 , patch_number : 35411347 } # NOT AVAILABLE TO DOWNLOAD +# - { type : "RUR" , id : 1 , patch_number : 28346593 , base_ru : '18.2' } +# - { type : "RUR" , id : 2 , patch_number : 28601267 , base_ru : '18.2' } + - { type : "RUR" , id : 1 , patch_number : 28507480 , base_ru : '18.3' } + - { type : "RUR" , id : 2 , patch_number : 28790643 , base_ru : '18.3' } + - { type : "RUR" , id : 1 , patch_number : 28822587 , base_ru : '18.4' } + - { type : "RUR" , id : 2 , patch_number : 29230809 , base_ru : '18.4' } + - { type : "RUR" , id : 1 , patch_number : 29230887 , base_ru : '18.5' } + - { type : "RUR" , id : 2 , patch_number : 29708437 , base_ru : '18.5' } + - { type : "RUR" , id : 1 , patch_number : 29708235 , base_ru : '18.6' } + - { type : "RUR" , id : 2 , patch_number : 30087881 , base_ru : '18.6' } + - { type : "RUR" , id : 1 , patch_number : 30080518 , base_ru : '18.7' } + - { type : "RUR" , id : 2 , patch_number : 30446239 , base_ru : '18.7' } + - { type : "RUR" , id : 1 , patch_number : 30445895 , base_ru : '18.8' } + - { type : "RUR" , id : 2 , patch_number : 30830887 , base_ru : '18.8' } + - { type : "RUR" , id : 1 , patch_number : 30798089 , base_ru : '18.9' } + - { type : "RUR" , id : 2 , patch_number : 31212186 , base_ru : '18.9' } + - { type : "RUR" , id : 1 , patch_number : 31211410 , base_ru : '18.10' } + - { type : "RUR" , id : 2 , patch_number : 31667173 , base_ru : '18.10' } + - { type : "RUR" , id : 1 , patch_number : 31666917 , base_ru : '18.11' } + - { type : "RUR" , id : 2 , patch_number : 32066686 , base_ru : '18.11' } + - { type : "RUR" , id : 1 , patch_number : 32072459 , base_ru : '18.12' } + - { type : "RUR" , id : 2 , patch_number : 32421478 , base_ru : '18.12' } + - { type : "RUR" , id : 1 , patch_number : 32451079 , base_ru : '18.13' } - { type : "OJVM" , id : 180417 , patch_number : 27636900 } - { type : "OJVM" , id : 180717 , patch_number : 27923415 } - { type : "OJVM" , id : 181016 , patch_number : 28502229 } @@ -457,54 +457,54 @@ list_18000: # Oracle Database 19c Proactive Patch Information (Doc ID 2521164.1) list_19000: - - { type : "RU" , id : 3 , patch_number : 29517242 , base_snap : "19.2.0" } - - { type : "RU" , id : 4 , patch_number : 29834717 } - - { type : "RU" , id : 5 , patch_number : 30125133 } - - { type : "RU" , id : 6 , patch_number : 30557433 } - - { type : "RU" , id : 7 , patch_number : 30869156 } - - { type : "RU" , id : 8 , patch_number : 31281355 } - - { type : "RU" , id : 9 , patch_number : 31771877 } - - { type : "RU" , id : 10 , patch_number : 32218454 } - - { type : "RU" , id : 11 , patch_number : 32545013 } - - { type : "RU" , id : 12 , patch_number : 32904851 } - - { type : "RU" , id : 13 , patch_number : 33192793 } - - { type : "RU" , id : 14 , patch_number : 33515361 } - - { type : "RU" , id : 15 , patch_number : 33806152 } - - { type : "RU" , id : 16 , patch_number : 34133642 } - - { type : "RU" , id : 17 , patch_number : 34419443 } - - { type : "RU" , id : 18 , patch_number : 34765931 , aru : 25078403 , file_suf : '_v0' } - - { type : "RU" , id : 18.1 , patch_number : 34765931 , aru : 25098466 } - - { type : "RU" , id : 19 , patch_number : 35042068 } - - { type : "RU" , id : 20 , patch_number : 35320081 } - - { type : "RUR" , id : 1 , patch_number : 29799057 , base_ru : '19.3' } - - { type : "RUR" , id : 2 , patch_number : 30087906 , base_ru : '19.3' } - - { type : "RUR" , id : 1 , patch_number : 30080447 , base_ru : '19.4' } - - { type : "RUR" , id : 2 , patch_number : 30446228 , base_ru : '19.4' } - - { type : "RUR" , id : 1 , patch_number : 30446054 , base_ru : '19.5' } - - { type : "RUR" , id : 2 , patch_number : 30830913 , base_ru : '19.5' } - - { type : "RUR" , id : 1 , patch_number : 30797938 , base_ru : '19.6' } - - { type : "RUR" , id : 2 , patch_number : 31212138 , base_ru : '19.6' } - - { type : "RUR" , id : 1 , patch_number : 31204483 , base_ru : '19.7' } - - { type : "RUR" , id : 2 , patch_number : 31667176 , base_ru : '19.7' } - - { type : "RUR" , id : 1 , patch_number : 31666885 , base_ru : '19.8' } - - { type : "RUR" , id : 2 , patch_number : 32066676 , base_ru : '19.8' } - - { type : "RUR" , id : 1 , patch_number : 32072711 , base_ru : '19.9' } - - { type : "RUR" , id : 2 , patch_number : 32421507 , base_ru : '19.9' } - - { type : "RUR" , id : 1 , patch_number : 32441092 , base_ru : '19.10' } - - { type : "RUR" , id : 2 , patch_number : 32819074 , base_ru : '19.10' } - - { type : "RUR" , id : 3 , patch_number : 32923627 , base_ru : '19.10' } - - { type : "RUR" , id : 1 , patch_number : 32844504 , base_ru : '19.11' } - - { type : "RUR" , id : 2 , patch_number : 33153989 , base_ru : '19.11' } - - { type : "RUR" , id : 1 , patch_number : 33210889 , base_ru : '19.12' } - - { type : "RUR" , id : 2 , patch_number : 33494256 , base_ru : '19.12' } - - { type : "RUR" , id : 1 , patch_number : 33516456 , base_ru : '19.13' } - - { type : "RUR" , id : 2 , patch_number : 33783771 , base_ru : '19.13' } - - { type : "RUR" , id : 1 , patch_number : 33806138 , base_ru : '19.14' } - - { type : "RUR" , id : 2 , patch_number : 34110559 , base_ru : '19.14' } - - { type : "RUR" , id : 1 , patch_number : 34119532 , base_ru : '19.15' } - - { type : "RUR" , id : 2 , patch_number : 34429835 , base_ru : '19.15' } - - { type : "RUR" , id : 1 , patch_number : 34444812 , base_ru : '19.16' } - - { type : "RUR" , id : 2 , patch_number : 34771828 , base_ru : '19.16' } + - { type : "RU" , id : 3 , patch_number : 29517242 , base_snap : "19.2.0" } + - { type : "RU" , id : 4 , patch_number : 29834717 } + - { type : "RU" , id : 5 , patch_number : 30125133 } + - { type : "RU" , id : 6 , patch_number : 30557433 } + - { type : "RU" , id : 7 , patch_number : 30869156 } + - { type : "RU" , id : 8 , patch_number : 31281355 } + - { type : "RU" , id : 9 , patch_number : 31771877 } + - { type : "RU" , id : 10 , patch_number : 32218454 } + - { type : "RU" , id : 11 , patch_number : 32545013 } + - { type : "RU" , id : 12 , patch_number : 32904851 } + - { type : "RU" , id : 13 , patch_number : 33192793 } + - { type : "RU" , id : 14 , patch_number : 33515361 } + - { type : "RU" , id : 15 , patch_number : 33806152 } + - { type : "RU" , id : 16 , patch_number : 34133642 } + - { type : "RU" , id : 17 , patch_number : 34419443 } + - { type : "RU" , id : 18 , patch_number : 34765931 , aru : 25078403 , file_suf : '_v0' } + - { type : "RU" , id : 18.1 , patch_number : 34765931 , aru : 25098466 } + - { type : "RU" , id : 19 , patch_number : 35042068 } + - { type : "RU" , id : 20 , patch_number : 35320081 } + - { type : "RUR" , id : 1 , patch_number : 29799057 , base_ru : '19.3' } + - { type : "RUR" , id : 2 , patch_number : 30087906 , base_ru : '19.3' } + - { type : "RUR" , id : 1 , patch_number : 30080447 , base_ru : '19.4' } + - { type : "RUR" , id : 2 , patch_number : 30446228 , base_ru : '19.4' } + - { type : "RUR" , id : 1 , patch_number : 30446054 , base_ru : '19.5' } + - { type : "RUR" , id : 2 , patch_number : 30830913 , base_ru : '19.5' } + - { type : "RUR" , id : 1 , patch_number : 30797938 , base_ru : '19.6' } + - { type : "RUR" , id : 2 , patch_number : 31212138 , base_ru : '19.6' } + - { type : "RUR" , id : 1 , patch_number : 31204483 , base_ru : '19.7' } + - { type : "RUR" , id : 2 , patch_number : 31667176 , base_ru : '19.7' } + - { type : "RUR" , id : 1 , patch_number : 31666885 , base_ru : '19.8' } + - { type : "RUR" , id : 2 , patch_number : 32066676 , base_ru : '19.8' } + - { type : "RUR" , id : 1 , patch_number : 32072711 , base_ru : '19.9' } + - { type : "RUR" , id : 2 , patch_number : 32421507 , base_ru : '19.9' } + - { type : "RUR" , id : 1 , patch_number : 32441092 , base_ru : '19.10' } + - { type : "RUR" , id : 2 , patch_number : 32819074 , base_ru : '19.10' } + - { type : "RUR" , id : 3 , patch_number : 32923627 , base_ru : '19.10' } + - { type : "RUR" , id : 1 , patch_number : 32844504 , base_ru : '19.11' } + - { type : "RUR" , id : 2 , patch_number : 33153989 , base_ru : '19.11' } + - { type : "RUR" , id : 1 , patch_number : 33210889 , base_ru : '19.12' } + - { type : "RUR" , id : 2 , patch_number : 33494256 , base_ru : '19.12' } + - { type : "RUR" , id : 1 , patch_number : 33516456 , base_ru : '19.13' } + - { type : "RUR" , id : 2 , patch_number : 33783771 , base_ru : '19.13' } + - { type : "RUR" , id : 1 , patch_number : 33806138 , base_ru : '19.14' } + - { type : "RUR" , id : 2 , patch_number : 34110559 , base_ru : '19.14' } + - { type : "RUR" , id : 1 , patch_number : 34119532 , base_ru : '19.15' } + - { type : "RUR" , id : 2 , patch_number : 34429835 , base_ru : '19.15' } + - { type : "RUR" , id : 1 , patch_number : 34444812 , base_ru : '19.16' } + - { type : "RUR" , id : 2 , patch_number : 34771828 , base_ru : '19.16' } - { type : "MRP" , id : 221115 , patch_number : 34737974 , base_ru : '19.17' , dep_type : 'RU' , dep_id : 17 , apply_method : "opatchauto" } - { type : "MRP" , id : 221220 , patch_number : 34819700 , base_ru : '19.17' , dep_type : 'RU' , dep_id : 17 , apply_method : "opatchauto" } - { type : "MRP" , id : 230117 , patch_number : 34935010 , base_ru : '19.17' , dep_type : 'RU' , dep_id : 17 , apply_method : "opatchauto" } @@ -544,7 +544,7 @@ list_19000: #################### list_21000: - #- { type : "RU" , id : 3 , patch_number : 00000000 , base_snap : "21.2.0" } +# - { type : "RU" , id : 3 , patch_number : 00000000 , base_snap : "21.2.0" } - { type : "RU" , id : 4 , patch_number : 33239276 } - { type : "RU" , id : 5 , patch_number : 33516412 } - { type : "RU" , id : 6 , patch_number : 33843745 } From 86f32cf2a5b6278726ddf1b13fea7d4e85116aa9 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 19 Jul 2023 14:03:08 -0300 Subject: [PATCH 107/229] Update list_patches.yml --- list_patches.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/list_patches.yml b/list_patches.yml index b24cdde..ea62580 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -131,6 +131,7 @@ list_11204: - { type : "BP" , id : 221018 , patch_number : 34536785 , patch_folder : 34383800 } - { type : "BP" , id : 230117 , patch_number : 34774400 , patch_folder : 34677707 } - { type : "BP" , id : 230418 , patch_number : 35058326 , patch_folder : 34998345 } + - { type : "BP" , id : 230718 , patch_number : 35369924 , patch_folder : 35269278 } #################### ##### 12.1.0.1 ##### @@ -286,6 +287,7 @@ list_12102: - { type : "BP" , id : 221018 , patch_number : 34536908 , patch_folder : 34386250 } - { type : "BP" , id : 230117 , patch_number : 34774411 , patch_folder : 34677708 } # START TIER 1 - { type : "BP" , id : 230418 , patch_number : 35058289 , patch_folder : 34998350 } + - { type : "BP" , id : 230718 , patch_number : 35369903 , patch_folder : 35269270 } #################### ##### 12.2.0.1 ##### From 3eaed2ad9485e643d2b68508da706c29bf6b56a1 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 19 Jul 2023 16:46:57 -0300 Subject: [PATCH 108/229] Update adb_oradir_remove_file.sql --- .../odbfcl/adb_load_expdp/adb_oradir_remove_file.sql | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/user_scripts/odbfcl/adb_load_expdp/adb_oradir_remove_file.sql b/user_scripts/odbfcl/adb_load_expdp/adb_oradir_remove_file.sql index ece33f6..048bc7e 100644 --- a/user_scripts/odbfcl/adb_load_expdp/adb_oradir_remove_file.sql +++ b/user_scripts/odbfcl/adb_load_expdp/adb_oradir_remove_file.sql @@ -1,8 +1,14 @@ WHENEVER SQLERROR EXIT SQL.SQLCODE +DECLARE + FILE_DOES_NOT_EXIST EXCEPTION; + PRAGMA EXCEPTION_INIT ( FILE_DOES_NOT_EXIST, -20019 ); BEGIN - DBMS_CLOUD.DELETE_FILE ( - directory_name => 'DATA_PUMP_DIR', - file_name => '&1.'); + DBMS_CLOUD.DELETE_FILE ( + directory_name => 'ORADIFF_DIR', + file_name => '&1.'); + EXCEPTION + WHEN FILE_DOES_NOT_EXIST THEN + NULL; END; / \ No newline at end of file From bd92275427cb5ca8bdc063dfdb6d3f3da376a568 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 20 Jul 2023 19:34:32 -0300 Subject: [PATCH 109/229] Update list_exceptions.yml --- list_exceptions.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/list_exceptions.yml b/list_exceptions.yml index abb3951..aa3635c 100644 --- a/list_exceptions.yml +++ b/list_exceptions.yml @@ -24,6 +24,7 @@ list_retry_datapatch: - { version: "12.1.0.2" , type : "BP" , id : 221018 , retries : 3 } - { version: "12.1.0.2" , type : "BP" , id : 230117 , retries : 3 } - { version: "12.1.0.2" , type : "BP" , id : 230418 , retries : 3 } + - { version: "12.1.0.2" , type : "BP" , id : 230718 , retries : 3 } ###### - { version: "12.1.0.2" , type : "PSU" , id : 200714 , retries : 2 } - { version: "12.1.0.2" , type : "PSU" , id : 201020 , retries : 2 } @@ -37,6 +38,7 @@ list_retry_datapatch: - { version: "12.1.0.2" , type : "PSU" , id : 221018 , retries : 2 } - { version: "12.1.0.2" , type : "PSU" , id : 230117 , retries : 2 } - { version: "12.1.0.2" , type : "PSU" , id : 230418 , retries : 2 } + - { version: "12.1.0.2" , type : "PSU" , id : 230718 , retries : 2 } ###### - { version: "12.2.0.1" , type : "RU" , id : 190716 , retries : 1 } - { version: "12.2.0.1" , type : "RU" , id : 191015 , retries : 1 } @@ -54,6 +56,7 @@ list_retry_datapatch: - { version: "12.2.0.1" , type : "RU" , id : 221018 , retries : 1 } - { version: "12.2.0.1" , type : "RU" , id : 230117 , retries : 1 } - { version: "12.2.0.1" , type : "RU" , id : 230418 , retries : 1 } + - { version: "12.2.0.1" , type : "RU" , id : 230718 , retries : 1 } ###### - { version: "12.2.0.1" , type : "RUR" , id : 180717 , retries : 1 } - { version: "12.2.0.1" , type : "RUR" , id : 181016 , retries : 1 } From 13a92bbf560623390b4df0a78bed4d5d758e7b68 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 21 Jul 2023 09:09:45 -0300 Subject: [PATCH 110/229] Update list_patches.yml --- list_patches.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/list_patches.yml b/list_patches.yml index ea62580..684ce36 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -519,9 +519,9 @@ list_19000: - { type : "MRP" , id : 230516 , patch_number : 35333818 , base_ru : '19.18' , dep_type : 'RU' , dep_id : 18 , apply_method : "napply" } - { type : "MRP" , id : 230620 , patch_number : 35449858 , base_ru : '19.18' , dep_type : 'RU' , dep_id : 18 , apply_method : "napply" } - { type : "MRP" , id : 230718 , patch_number : 35573556 , base_ru : '19.18' , dep_type : 'RU' , dep_id : 18 , apply_method : "napply" } - - { type : "MRP" , id : 230516 , patch_number : 35333937 , base_ru : '19.19' , dep_type : 'RU' , dep_id : 18 , apply_method : "napply" } - - { type : "MRP" , id : 230620 , patch_number : 35449803 , base_ru : '19.19' , dep_type : 'RU' , dep_id : 18 , apply_method : "napply" } - - { type : "MRP" , id : 230718 , patch_number : 35573506 , base_ru : '19.19' , dep_type : 'RU' , dep_id : 18 , apply_method : "napply" } + - { type : "MRP" , id : 230516 , patch_number : 35333937 , base_ru : '19.19' , dep_type : 'RU' , dep_id : 19 , apply_method : "napply" } + - { type : "MRP" , id : 230620 , patch_number : 35449803 , base_ru : '19.19' , dep_type : 'RU' , dep_id : 19 , apply_method : "napply" } + - { type : "MRP" , id : 230718 , patch_number : 35573506 , base_ru : '19.19' , dep_type : 'RU' , dep_id : 19 , apply_method : "napply" } - { type : "OJVM" , id : 190416 , patch_number : 29548437 } - { type : "OJVM" , id : 190716 , patch_number : 29774421 } - { type : "OJVM" , id : 191015 , patch_number : 30128191 } From 83ee9eed2401deebbe49c3097f546f95fb825205 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 5 Oct 2023 14:32:33 -0300 Subject: [PATCH 111/229] Enable diff SID option and disable compression for flag --- config_oci.yml | 2 +- config_vbox.yml | 2 +- list_patches.yml | 5 +++-- tasks/patch_main.yml | 17 +++++++++++++++-- tasks/patch_main_11g.yml | 9 ++++++++- tasks/patch_tasks_pre.yml | 3 ++- tasks/prepare_dependency.yml | 6 ++++-- 7 files changed, 34 insertions(+), 10 deletions(-) diff --git a/config_oci.yml b/config_oci.yml index 11da06d..c9e47b2 100644 --- a/config_oci.yml +++ b/config_oci.yml @@ -12,7 +12,7 @@ shared_folder : "/u02" VM_folder : "/u02" # Oracle SID of the database that we are collecting data from. Must be included in /etc/oratab for oraenv utility. -mysid : "orcl" +default_sid : "orcl" # Folder to store the final generated files. output_folder : "/u01/patch_automation/output" diff --git a/config_vbox.yml b/config_vbox.yml index ef96d7b..5cced11 100644 --- a/config_vbox.yml +++ b/config_vbox.yml @@ -9,7 +9,7 @@ shared_folder : "/Users/rodrigo.jorge/Desktop/extract" VM_folder : "/media/sf_Patch/" # Oracle SID. Must be included in /etc/oratab for oraenv utility. -mysid : "orcl" +default_sid : "orcl" # Folder to store the final generated files. It must contain the subfolder expdp output_folder : "/Volumes/Samsung_T3/OraSum/files" diff --git a/list_patches.yml b/list_patches.yml index 684ce36..e1b7bb4 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -563,5 +563,6 @@ list_21000: list_23000: - { type : "RU" , id : 1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta1.tar.gz" } - { type : "RU" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta2.tar.gz" } - - { type : "RU" , id : 2.1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.DevRel.tar.gz" } -# - { type : "RU" , id : 3 , patch_number : 00000000 , base_snap : "23.2.0" } \ No newline at end of file + - { type : "RU" , id : 2.1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel1_Beta2.tar.gz" , oracle_sid : "FREE" } + - { type : "RU" , id : 3.1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel2_Beta3.tar.gz" , oracle_sid : "FREE" , expdp_comp : false } +# - { type : "RU" , id : 3 , patch_number : 00000000 , base_snap : "23.2.0" } \ No newline at end of file diff --git a/tasks/patch_main.yml b/tasks/patch_main.yml index 6e33e25..768afca 100644 --- a/tasks/patch_main.yml +++ b/tasks/patch_main.yml @@ -137,7 +137,6 @@ register: tmp_shell_output become: true become_user: root - when: delegate_to: "{{ vm_ip_address }}" # Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" @@ -170,9 +169,23 @@ expdp_version: "version={{ target_db_version }}" when: (db_version.split('.')[0] | int) > target_db_version + - name: Set compression parameter for expdp + set_fact: + expdp_compression: "compression=all compression_algorithm=high" + when: patch.expdp_comp | default(true) + - name: Export Database Tables shell: | - {{ dbhome_locl }}/bin/expdp userid={{ dump_user_int }}/{{ dump_pass }} directory={{ dump_dir_name }} compression=all compression_algorithm=high metrics=yes dumpfile={{ dump_file_prefix }}.dmp logfile={{ dump_file_prefix }}.log content=data_only schemas={{ dump_user_int }} {{ expdp_version }} + {{ dbhome_locl }}/bin/expdp \ + userid={{ dump_user_int }}/{{ dump_pass }} \ + directory={{ dump_dir_name }} \ + {{ expdp_compression | default('') }} \ + metrics=yes \ + dumpfile={{ dump_file_prefix }}.dmp \ + logfile={{ dump_file_prefix }}.log \ + content=data_only \ + schemas={{ dump_user_int }} \ + {{ expdp_version | default('') }} environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" diff --git a/tasks/patch_main_11g.yml b/tasks/patch_main_11g.yml index 73f1aeb..1878fdd 100644 --- a/tasks/patch_main_11g.yml +++ b/tasks/patch_main_11g.yml @@ -113,7 +113,14 @@ - name: Export Database Tables shell: | - {{ dbhome_locl }}/bin/expdp userid={{ dump_user_int }}/{{ dump_pass }} directory={{ dump_dir_name }} compression=all dumpfile={{ dump_file_prefix }}.dmp logfile={{ dump_file_prefix }}.log content=data_only schemas={{ dump_user_int }} + {{ dbhome_locl }}/bin/expdp \ + userid={{ dump_user_int }}/{{ dump_pass }} \ + directory={{ dump_dir_name }} \ + compression=all \ + dumpfile={{ dump_file_prefix }}.dmp \ + logfile={{ dump_file_prefix }}.log \ + content=data_only \ + schemas={{ dump_user_int }} environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" diff --git a/tasks/patch_tasks_pre.yml b/tasks/patch_tasks_pre.yml index 1d7892f..4e35f26 100644 --- a/tasks/patch_tasks_pre.yml +++ b/tasks/patch_tasks_pre.yml @@ -5,9 +5,10 @@ set_fact: file_suffix: "{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}" dump_file_prefix: "tables_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}" + mysid: "{{ patch.oracle_sid | default(default_sid) }}" skip_all: false fix_datapatch_retries: 0 - expdp_version: "" + # expdp_version: "" patch_file_path: "" db_patch: "" perform_patch_actions: true # If opatch / datapatch / patch download / etc are needed or not. diff --git a/tasks/prepare_dependency.yml b/tasks/prepare_dependency.yml index d63ff19..e09e5a6 100644 --- a/tasks/prepare_dependency.yml +++ b/tasks/prepare_dependency.yml @@ -11,8 +11,9 @@ bkp_file_suffix: "{{ file_suffix }}" bkp_dump_file_prefix: "{{ dump_file_prefix }}" bkp_skip_all: "{{ skip_all }}" + bkp_mysid: "{{ mysid }}" bkp_fix_datapatch_retries: "{{ fix_datapatch_retries }}" - bkp_expdp_version: "{{ expdp_version }}" + # bkp_expdp_version: "{{ expdp_version }}" bkp_db_patch: "{{ db_patch }}" bkp_unzip_patch_folder: "{{ unzip_patch_folder }}" bkp_perform_patch_actions: "{{ perform_patch_actions }}" @@ -40,8 +41,9 @@ file_suffix: "{{ bkp_file_suffix }}" dump_file_prefix: "{{ bkp_dump_file_prefix }}" skip_all: "{{ bkp_skip_all }}" + mysid: "{{ bkp_mysid }}" fix_datapatch_retries: "{{ bkp_fix_datapatch_retries }}" - expdp_version: "{{ bkp_expdp_version }}" + # expdp_version: "{{ bkp_expdp_version }}" db_patch: "{{ bkp_db_patch }}" unzip_patch_folder: "{{ bkp_unzip_patch_folder }}" perform_patch_actions: "{{ bkp_perform_patch_actions }}" From d4f3d24b2c35af7ce194fc84c573612607b0123e Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 5 Oct 2023 14:33:49 -0300 Subject: [PATCH 112/229] Update list_patches.yml --- list_patches.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/list_patches.yml b/list_patches.yml index e1b7bb4..10a8cf2 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -563,6 +563,7 @@ list_21000: list_23000: - { type : "RU" , id : 1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta1.tar.gz" } - { type : "RU" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta2.tar.gz" } + - { type : "RU" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta3.tar.gz" } - { type : "RU" , id : 2.1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel1_Beta2.tar.gz" , oracle_sid : "FREE" } - { type : "RU" , id : 3.1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel2_Beta3.tar.gz" , oracle_sid : "FREE" , expdp_comp : false } # - { type : "RU" , id : 3 , patch_number : 00000000 , base_snap : "23.2.0" } \ No newline at end of file From 75db797ba4489c413208a5a1f4e53dd518aa7d38 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 5 Oct 2023 14:34:36 -0300 Subject: [PATCH 113/229] Update list_versions.yml --- list_versions.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/list_versions.yml b/list_versions.yml index 8d841f6..75396fd 100644 --- a/list_versions.yml +++ b/list_versions.yml @@ -14,6 +14,7 @@ list_versions: - { id : "18.0.0.0" , patch_list : "list_18000" , main_file : "patch_main.yml" , opatch_file : "p6880880_210000_Linux-x86-64.zip" } - { id : "19.0.0.0" , patch_list : "list_19000" , main_file : "patch_main.yml" , opatch_file : "p6880880_210000_Linux-x86-64.zip" } - { id : "21.0.0.0" , patch_list : "list_21000" , main_file : "patch_main.yml" , opatch_file : "p6880880_210000_Linux-x86-64.zip" } + - { id : "23.0.0.0" , patch_list : "list_23000" , main_file : "patch_main.yml" , opatch_file : "p6880880_210000_Linux-x86-64.zip" } list_info_vbox: - { id : "11.2.0.4" , vmachine : "Oracle Linux 6.8" , base_snap : "11.2.0.4 Ready" , ip : "xxx" } @@ -32,3 +33,4 @@ list_info_oci: - { id : "18.0.0.0" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" , out_of_box_ru : 3 } - { id : "19.0.0.0" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" , out_of_box_ru : 3 } - { id : "21.0.0.0" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" , out_of_box_ru : 3 } + - { id : "23.0.0.0" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" , out_of_box_ru : 1 } From 22be2ee0c257ce6074dbcc83cef827605df24b83 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Sun, 8 Oct 2023 18:58:14 -0300 Subject: [PATCH 114/229] Update datapatch.yml --- tasks/datapatch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/datapatch.yml b/tasks/datapatch.yml index d7fc8f3..b725159 100644 --- a/tasks/datapatch.yml +++ b/tasks/datapatch.yml @@ -1,7 +1,7 @@ - name: Run Datapatch shell: | export ORACLE_HOME ORACLE_SID - ./datapatch -verbose >> /tmp/datapatch.log 2>&1 + ./datapatch -verbose >> /tmp/datapatch.{{ file_suffix }}_{{ datapatch_try }}.log 2>&1 environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" From d1f136f2e7c849d6b60b4c89d017b94b69b4700b Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Sun, 8 Oct 2023 18:58:56 -0300 Subject: [PATCH 115/229] Update patch_tasks_post.yml --- tasks/patch_tasks_post.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/patch_tasks_post.yml b/tasks/patch_tasks_post.yml index 9f29e31..c44a91a 100644 --- a/tasks/patch_tasks_post.yml +++ b/tasks/patch_tasks_post.yml @@ -70,4 +70,4 @@ - include: lvm_savestate.yml when: oci_mode - when: ( patch.type == "PSU" or patch.type == "RU" ) and base_OJVM_line == latest_processed \ No newline at end of file + when: base_OJVM_line is defined and ( patch.type == "PSU" or patch.type == "RU" ) and base_OJVM_line == latest_processed \ No newline at end of file From 77d7cf51d148d3d7d6fda8977f29fe8383f1e802 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 10 Oct 2023 15:27:22 -0300 Subject: [PATCH 116/229] DPBP support --- list_exceptions.yml | 12 ++++++++++++ list_patches.yml | 12 ++++++++++++ tasks/find_patch.yml | 11 ++++++++++- tasks/main_RU_RUR.yml | 8 ++++---- 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/list_exceptions.yml b/list_exceptions.yml index aa3635c..3eca70e 100644 --- a/list_exceptions.yml +++ b/list_exceptions.yml @@ -66,3 +66,15 @@ list_retry_datapatch: - { version: "12.2.0.1" , type : "RUR" , id : 200414 , retries : 1 } - { version: "12.2.0.1" , type : "RUR" , id : 200714 , retries : 1 } - { version: "12.2.0.1" , type : "RUR" , id : 201020 , retries : 1 } +###### + - { version: "19.0.0.0" , type : "DPBP" , id : 10 , retries : 1 } + - { version: "19.0.0.0" , type : "DPBP" , id : 11 , retries : 1 } + - { version: "19.0.0.0" , type : "DPBP" , id : 12 , retries : 1 } + - { version: "19.0.0.0" , type : "DPBP" , id : 13 , retries : 1 } + - { version: "19.0.0.0" , type : "DPBP" , id : 14 , retries : 1 } + - { version: "19.0.0.0" , type : "DPBP" , id : 15 , retries : 1 } + - { version: "19.0.0.0" , type : "DPBP" , id : 16 , retries : 1 } + - { version: "19.0.0.0" , type : "DPBP" , id : 17 , retries : 1 } + - { version: "19.0.0.0" , type : "DPBP" , id : 18 , retries : 1 } + - { version: "19.0.0.0" , type : "DPBP" , id : 19 , retries : 1 } + - { version: "19.0.0.0" , type : "DPBP" , id : 20 , retries : 1 } \ No newline at end of file diff --git a/list_patches.yml b/list_patches.yml index 10a8cf2..2f28113 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -540,6 +540,18 @@ list_19000: - { type : "OJVM" , id : 230117 , patch_number : 34786990 } - { type : "OJVM" , id : 230418 , patch_number : 35050341 } - { type : "OJVM" , id : 230718 , patch_number : 35354406 } +# 19c DPBP + - { type : "DPBP" , id : 10 , patch_number : 32583144 , dep_type : 'RU' , dep_id : 10 } + - { type : "DPBP" , id : 11 , patch_number : 32958059 , dep_type : 'RU' , dep_id : 11 } + - { type : "DPBP" , id : 12 , patch_number : 33590062 , dep_type : 'RU' , dep_id : 12 } + - { type : "DPBP" , id : 13 , patch_number : 33952087 , dep_type : 'RU' , dep_id : 13 } + - { type : "DPBP" , id : 14 , patch_number : 34423086 , dep_type : 'RU' , dep_id : 14 } + - { type : "DPBP" , id : 15 , patch_number : 34547013 , dep_type : 'RU' , dep_id : 15 } + - { type : "DPBP" , id : 16 , patch_number : 34620690 , dep_type : 'RU' , dep_id : 16 } + - { type : "DPBP" , id : 17 , patch_number : 34734035 , dep_type : 'RU' , dep_id : 17 } + - { type : "DPBP" , id : 18 , patch_number : 34972375 , dep_type : 'RU' , dep_id : 18 } + - { type : "DPBP" , id : 19 , patch_number : 35261302 , dep_type : 'RU' , dep_id : 19 } + - { type : "DPBP" , id : 20 , patch_number : 35512813 , dep_type : 'RU' , dep_id : 20 } #################### ##### 21.0.0.0 ##### diff --git a/tasks/find_patch.yml b/tasks/find_patch.yml index e972915..a2a1a4a 100644 --- a/tasks/find_patch.yml +++ b/tasks/find_patch.yml @@ -33,7 +33,7 @@ recurse: "yes" file_type: "file" register: tmp_find_result - when: patch.type != "MRP" + when: patch.type != "MRP" and patch.type != "DPBP" # Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" - set_fact: find_result="{{tmp_find_result}}" @@ -48,6 +48,15 @@ register: tmp_find_result when: patch.type == "MRP" +- name: Finding Patch File + find: + paths: "{{ patch_location_path }}" + patterns: "p{{ patch.patch_number }}_*DBRU_Generic{{ patch.file_suf | default('') }}.zip" + recurse: "yes" + file_type: "file" + register: tmp_find_result + when: patch.type == "DPBP" + # Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" - set_fact: find_result="{{tmp_find_result}}" when: tmp_find_result is not skipped diff --git a/tasks/main_RU_RUR.yml b/tasks/main_RU_RUR.yml index 32b5690..312746d 100644 --- a/tasks/main_RU_RUR.yml +++ b/tasks/main_RU_RUR.yml @@ -1,4 +1,4 @@ -### Will Run RU + OJVM + RUR + MRP for given version +### Will Run RU + OJVM + RUR + MRP + DPBP for given version - name : Define version set_fact: @@ -140,7 +140,7 @@ when: param_type is undefined or param_type == "RUR" -### MRP +### MRP & DPBP - block: - name : Define snapshot base version to rollback when reload is called. @@ -154,12 +154,12 @@ loop_var: patch label: "{{ patch.id }}" when: - - patch.type == "MRP" + - (param_type is undefined and (patch.type == "MRP" or patch.type == "DPBP")) or patch.type == param_type - patch.id == (param_patch | float) or param_patch == -1 - patch.id >= (param_patch_from | float) or param_patch_from == -1 - patch.id <= (param_patch_to | float) or param_patch_to == -1 - when: param_type is undefined or param_type == "MRP" + when: param_type is undefined or param_type == "MRP" or param_type == "DPBP" # Stop OCI VM - name: Call role to stop OCI VM From 73bf66c25132ec63f3df64fdf80b2588d6bb1bef Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 19 Oct 2023 10:15:16 -0300 Subject: [PATCH 117/229] Update list_patches.yml --- list_patches.yml | 117 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) diff --git a/list_patches.yml b/list_patches.yml index 2f28113..c6b10a3 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -1,3 +1,82 @@ +#################### +##### 11.2.0.X ##### +#################### + +# 11.2.0.1 Patch Set Updates - List of Fixes in each PSU (Doc ID 1340010.1) +# 11.2.0.2 Patch Set Updates - List of Fixes in each PSU (Doc ID 1340011.1) +# 11.2.0.3 Patch Set Updates - List of Fixes in each PSU (Doc ID 1449750.1) + +list_1120X: +# 11.2.0.1 + - { version : "11.2.0.1" , type : "PSU" , id : 1 , patch_number : 9352237 } + - { version : "11.2.0.1" , type : "PSU" , id : 2 , patch_number : 9654983 } + - { version : "11.2.0.1" , type : "PSU" , id : 3 , patch_number : 9952216 } + - { version : "11.2.0.1" , type : "PSU" , id : 4 , patch_number : 10248516 } + - { version : "11.2.0.1" , type : "PSU" , id : 5 , patch_number : 11724930 } + - { version : "11.2.0.1" , type : "PSU" , id : 6 , patch_number : 12419378 } + - { version : "11.2.0.1" , type : "CPU" , id : 1 , patch_number : 9369797 } + - { version : "11.2.0.1" , type : "CPU" , id : 2 , patch_number : 9655013 } + - { version : "11.2.0.1" , type : "CPU" , id : 3 , patch_number : 9952260 } + - { version : "11.2.0.1" , type : "CPU" , id : 4 , patch_number : 10249532 } + - { version : "11.2.0.1" , type : "CPU" , id : 5 , patch_number : 11724991 } + - { version : "11.2.0.1" , type : "CPU" , id : 6 , patch_number : 12419278 } +# 11.2.0.2 + - { version : "11.2.0.2" , type : "PSU" , id : 1 , patch_number : 10248523 } + - { version : "11.2.0.2" , type : "PSU" , id : 2 , patch_number : 11724916 } + - { version : "11.2.0.2" , type : "PSU" , id : 3 , patch_number : 12419331 } + - { version : "11.2.0.2" , type : "PSU" , id : 4 , patch_number : 12827726 } + - { version : "11.2.0.2" , type : "PSU" , id : 5 , patch_number : 13343424 } + - { version : "11.2.0.2" , type : "PSU" , id : 6 , patch_number : 13696224 } + - { version : "11.2.0.2" , type : "PSU" , id : 7 , patch_number : 13923804 } + - { version : "11.2.0.2" , type : "PSU" , id : 8 , patch_number : 14275621 } + - { version : "11.2.0.2" , type : "PSU" , id : 9 , patch_number : 14727315 } + - { version : "11.2.0.2" , type : "PSU" , id : 10 , patch_number : 16056267 } + - { version : "11.2.0.2" , type : "PSU" , id : 11 , patch_number : 16619893 } + - { version : "11.2.0.2" , type : "PSU" , id : 12 , patch_number : 17082367 } +# - { version : "11.2.0.2" , type : "CPU" , id : 1 , patch_number : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED + - { version : "11.2.0.2" , type : "CPU" , id : 2 , patch_number : 11724984 } + - { version : "11.2.0.2" , type : "CPU" , id : 3 , patch_number : 12419321 } + - { version : "11.2.0.2" , type : "CPU" , id : 4 , patch_number : 12828071 } + - { version : "11.2.0.2" , type : "CPU" , id : 5 , patch_number : 13343244 } + - { version : "11.2.0.2" , type : "CPU" , id : 6 , patch_number : 13632725 } + - { version : "11.2.0.2" , type : "CPU" , id : 7 , patch_number : 14038791 } + - { version : "11.2.0.2" , type : "CPU" , id : 8 , patch_number : 14390377 } + - { version : "11.2.0.2" , type : "CPU" , id : 9 , patch_number : 14841437 } + - { version : "11.2.0.2" , type : "CPU" , id : 10 , patch_number : 16294412 } + - { version : "11.2.0.2" , type : "CPU" , id : 11 , patch_number : 16742100 } + - { version : "11.2.0.2" , type : "CPU" , id : 12 , patch_number : 17082375 } +# 11.2.0.3 + - { version : "11.2.0.3" , type : "PSU" , id : 1 , patch_number : 13343438 } + - { version : "11.2.0.3" , type : "PSU" , id : 2 , patch_number : 13696216 } + - { version : "11.2.0.3" , type : "PSU" , id : 3 , patch_number : 13923374 } + - { version : "11.2.0.3" , type : "PSU" , id : 4 , patch_number : 14275605 } + - { version : "11.2.0.3" , type : "PSU" , id : 5 , patch_number : 14727310 } + - { version : "11.2.0.3" , type : "PSU" , id : 6 , patch_number : 16056266 } + - { version : "11.2.0.3" , type : "PSU" , id : 7 , patch_number : 16619892 } + - { version : "11.2.0.3" , type : "PSU" , id : 8 , patch_number : 16902043 } + - { version : "11.2.0.3" , type : "PSU" , id : 9 , patch_number : 17540582 } + - { version : "11.2.0.3" , type : "PSU" , id : 10 , patch_number : 18031683 } + - { version : "11.2.0.3" , type : "PSU" , id : 11 , patch_number : 18522512 } + - { version : "11.2.0.3" , type : "PSU" , id : 12 , patch_number : 19121548 } + - { version : "11.2.0.3" , type : "PSU" , id : 13 , patch_number : 19769496 } + - { version : "11.2.0.3" , type : "PSU" , id : 14 , patch_number : 20299017 } + - { version : "11.2.0.3" , type : "PSU" , id : 15 , patch_number : 20760997 } + - { version : "11.2.0.3" , type : "CPU" , id : 1 , patch_number : 13466801 } + - { version : "11.2.0.3" , type : "CPU" , id : 2 , patch_number : 13632717 } + - { version : "11.2.0.3" , type : "CPU" , id : 3 , patch_number : 14038787 } + - { version : "11.2.0.3" , type : "CPU" , id : 4 , patch_number : 14390252 } + - { version : "11.2.0.3" , type : "CPU" , id : 5 , patch_number : 14841409 } + - { version : "11.2.0.3" , type : "CPU" , id : 6 , patch_number : 16294378 } + - { version : "11.2.0.3" , type : "CPU" , id : 7 , patch_number : 16742095 } + - { version : "11.2.0.3" , type : "CPU" , id : 8 , patch_number : 17082364 } + - { version : "11.2.0.3" , type : "CPU" , id : 9 , patch_number : 17478415 } + - { version : "11.2.0.3" , type : "CPU" , id : 10 , patch_number : 18139695 } + - { version : "11.2.0.3" , type : "CPU" , id : 11 , patch_number : 18681866 } + - { version : "11.2.0.3" , type : "CPU" , id : 12 , patch_number : 19271438 } + - { version : "11.2.0.3" , type : "CPU" , id : 13 , patch_number : 19854461 } + - { version : "11.2.0.3" , type : "CPU" , id : 14 , patch_number : 20299010 } + - { version : "11.2.0.3" , type : "CPU" , id : 15 , patch_number : 20803576 } + #################### ##### 11.2.0.4 ##### #################### @@ -5,6 +84,7 @@ # Database 11.2.0.4 Proactive Patch Information (Doc ID 2285559.1) list_11204: +# 11.2.0.4 PSU - { type : "PSU" , id : 1 , patch_number : 17478514 } - { type : "PSU" , id : 2 , patch_number : 18031668 } - { type : "PSU" , id : 3 , patch_number : 18522509 } @@ -44,6 +124,8 @@ list_11204: - { type : "PSU" , id : 230117 , patch_number : 34677698 } - { type : "PSU" , id : 230418 , patch_number : 34998337 } - { type : "PSU" , id : 230718 , patch_number : 35269283 } + - { type : "PSU" , id : 231017 , patch_number : 35574075 } +# 11.2.0.4 OJVM - { type : "OJVM" , id : 1 , patch_number : 19282021 } - { type : "OJVM" , id : 2 , patch_number : 19877440 } - { type : "OJVM" , id : 3 , patch_number : 20406239 } @@ -80,6 +162,8 @@ list_11204: - { type : "OJVM" , id : 230117 , patch_number : 34763334 } - { type : "OJVM" , id : 230418 , patch_number : 35039831 } - { type : "OJVM" , id : 230718 , patch_number : 35349843 } + - { type : "OJVM" , id : 231017 , patch_number : 35685663 } +# 11.2.0.4 BP - { type : "BP" , id : 1 , patch_number : 17628025 , patch_folder : 17628006 } - { type : "BP" , id : 2 , patch_number : 17838803 , patch_folder : 17741631 } - { type : "BP" , id : 3 , patch_number : 17904156 , patch_folder : 17943261 } @@ -132,6 +216,7 @@ list_11204: - { type : "BP" , id : 230117 , patch_number : 34774400 , patch_folder : 34677707 } - { type : "BP" , id : 230418 , patch_number : 35058326 , patch_folder : 34998345 } - { type : "BP" , id : 230718 , patch_number : 35369924 , patch_folder : 35269278 } + - { type : "BP" , id : 231017 , patch_number : 35685705 , patch_folder : 35574089 } #################### ##### 12.1.0.1 ##### @@ -140,6 +225,7 @@ list_11204: # No more updates on this one. list_12101: +# 12.1.0.1 PSU - { type : "PSU" , id : 1 , patch_number : 17027533 } - { type : "PSU" , id : 2 , patch_number : 17552800 } - { type : "PSU" , id : 3 , patch_number : 18031528 } @@ -152,6 +238,7 @@ list_12101: - { type : "PSU" , id : 160119 , patch_number : 21951844 } - { type : "PSU" , id : 160419 , patch_number : 22291141 } - { type : "PSU" , id : 160719 , patch_number : 23054354 } +# 12.1.0.1 OJVM - { type : "OJVM" , id : 1 , patch_number : 19282024 } - { type : "OJVM" , id : 2 , patch_number : 19877342 } - { type : "OJVM" , id : 3 , patch_number : 20406245 } @@ -170,6 +257,7 @@ list_12101: # Database 12.1.0.2 Proactive Patch Information (Doc ID 2285558.1) list_12102: +# 12.1.0.2 PSU - { type : "PSU" , id : 1 , patch_number : 19303936 } - { type : "PSU" , id : 2 , patch_number : 19769480 } - { type : "PSU" , id : 3 , patch_number : 20299023 } @@ -207,6 +295,8 @@ list_12102: - { type : "PSU" , id : 230117 , patch_number : 34677720 } # START TIER 1 - { type : "PSU" , id : 230418 , patch_number : 34998358 } - { type : "PSU" , id : 230718 , patch_number : 35269262 } + - { type : "PSU" , id : 231017 , patch_number : 35564645 } +# 12.1.0.2 OJVM - { type : "OJVM" , id : 1 , patch_number : 19282028 } - { type : "OJVM" , id : 2 , patch_number : 19877336 } - { type : "OJVM" , id : 3 , patch_number : 20415564 } @@ -243,6 +333,8 @@ list_12102: - { type : "OJVM" , id : 230117 , patch_number : 34763317 } # START TIER 1 - { type : "OJVM" , id : 230418 , patch_number : 35077439 } - { type : "OJVM" , id : 230718 , patch_number : 35354391 } + - { type : "OJVM" , id : 231017 , patch_number : 35685666 } +# 12.1.0.2 BP - { type : "BP" , id : 1 , patch_number : 19404326 , patch_folder : 19189240 } - { type : "BP" , id : 2 , patch_number : 19774304 , patch_folder : 19649591 } - { type : "BP" , id : 3 , patch_number : 20026159 , patch_folder : 19878106 } @@ -288,6 +380,7 @@ list_12102: - { type : "BP" , id : 230117 , patch_number : 34774411 , patch_folder : 34677708 } # START TIER 1 - { type : "BP" , id : 230418 , patch_number : 35058289 , patch_folder : 34998350 } - { type : "BP" , id : 230718 , patch_number : 35369903 , patch_folder : 35269270 } + - { type : "BP" , id : 231017 , patch_number : 35685744 , patch_folder : 35564676 } #################### ##### 12.2.0.1 ##### @@ -296,6 +389,7 @@ list_12102: # Database 12.2.0.1 Proactive Patch Information (Doc ID 2285557.1) list_12201: +# 12.2.0.1 RU - { type : "RU" , id : 170718 , patch_number : 26123830 } - { type : "RU" , id : 170814 , patch_number : 26609817 } - { type : "RU" , id : 171017 , patch_number : 26710464 } @@ -322,6 +416,8 @@ list_12201: - { type : "RU" , id : 230117 , patch_number : 34850184 } # PASSWORD PROTECTED - { type : "RU" , id : 230418 , patch_number : 35115783 } # PASSWORD PROTECTED - { type : "RU" , id : 230718 , patch_number : 35407080 } # PASSWORD PROTECTED + - { type : "RU" , id : 231017 , patch_number : 35746058 } # PASSWORD PROTECTED +# 12.2.0.1 RUR - { type : "RUR" , id : 171017 , patch_number : 26518812 , base_ru : JUL2017 } - { type : "RUR" , id : 180116 , patch_number : 27013506 , base_ru : JUL2017 } - { type : "RUR" , id : 180116 , patch_number : 27013510 , base_ru : OCT2017 } @@ -347,6 +443,7 @@ list_12201: - { type : "RUR" , id : 200714 , patch_number : 31199988 , base_ru : APR2020 } - { type : "RUR" , id : 201020 , patch_number : 31667168 , base_ru : APR2020 } - { type : "RUR" , id : 201020 , patch_number : 31666944 , base_ru : JUL2020 } +# 12.2.0.1 OJVM - { type : "OJVM" , id : 170718 , patch_number : 25811364 } - { type : "OJVM" , id : 171017 , patch_number : 26635944 } - { type : "OJVM" , id : 180116 , patch_number : 27001739 } @@ -372,6 +469,7 @@ list_12201: - { type : "OJVM" , id : 230117 , patch_number : 34763276 } # PASSWORD PROTECTED - { type : "OJVM" , id : 230418 , patch_number : 35058256 } # PASSWORD PROTECTED - { type : "OJVM" , id : 230718 , patch_number : 35348984 } # PASSWORD PROTECTED + - { type : "OJVM" , id : 231017 , patch_number : 35685669 } # PASSWORD PROTECTED #################### ##### 18.0.0.0 ##### @@ -382,6 +480,7 @@ list_12201: # No more updates on this one. list_18000: +# 18c RU # - { type : "RU" , id : 2 , patch_number : 27676517 , base_snap : "18.1.0" } - { type : "RU" , id : 3 , patch_number : 28090523 , base_snap : "18.1.0" } - { type : "RU" , id : 4 , patch_number : 28655784 } @@ -404,6 +503,8 @@ list_18000: - { type : "RU" , id : 21 , patch_number : 34854019 } # NOT AVAILABLE TO DOWNLOAD - { type : "RU" , id : 22 , patch_number : 35114260 } # NOT AVAILABLE TO DOWNLOAD - { type : "RU" , id : 23 , patch_number : 35411347 } # NOT AVAILABLE TO DOWNLOAD + - { type : "RU" , id : 24 , patch_number : 35744266 } # NOT AVAILABLE TO DOWNLOAD +# 18c RUR # - { type : "RUR" , id : 1 , patch_number : 28346593 , base_ru : '18.2' } # - { type : "RUR" , id : 2 , patch_number : 28601267 , base_ru : '18.2' } - { type : "RUR" , id : 1 , patch_number : 28507480 , base_ru : '18.3' } @@ -427,6 +528,7 @@ list_18000: - { type : "RUR" , id : 1 , patch_number : 32072459 , base_ru : '18.12' } - { type : "RUR" , id : 2 , patch_number : 32421478 , base_ru : '18.12' } - { type : "RUR" , id : 1 , patch_number : 32451079 , base_ru : '18.13' } +# 18c OJVM - { type : "OJVM" , id : 180417 , patch_number : 27636900 } - { type : "OJVM" , id : 180717 , patch_number : 27923415 } - { type : "OJVM" , id : 181016 , patch_number : 28502229 } @@ -449,6 +551,7 @@ list_18000: - { type : "OJVM" , id : 230117 , patch_number : 34763258 } # NOT AVAILABLE TO DOWNLOAD # 18.21 - { type : "OJVM" , id : 230418 , patch_number : 35058238 } # NOT AVAILABLE TO DOWNLOAD # 18.22 - { type : "OJVM" , id : 230718 , patch_number : 35354394 } # NOT AVAILABLE TO DOWNLOAD # 18.23 + - { type : "OJVM" , id : 231017 , patch_number : 35685672 } # NOT AVAILABLE TO DOWNLOAD # 18.24 # No more updates on this one. @@ -459,6 +562,7 @@ list_18000: # Oracle Database 19c Proactive Patch Information (Doc ID 2521164.1) list_19000: +# 19c RU - { type : "RU" , id : 3 , patch_number : 29517242 , base_snap : "19.2.0" } - { type : "RU" , id : 4 , patch_number : 29834717 } - { type : "RU" , id : 5 , patch_number : 30125133 } @@ -478,6 +582,8 @@ list_19000: - { type : "RU" , id : 18.1 , patch_number : 34765931 , aru : 25098466 } - { type : "RU" , id : 19 , patch_number : 35042068 } - { type : "RU" , id : 20 , patch_number : 35320081 } + - { type : "RU" , id : 21 , patch_number : 35643107 } +# 19c RUR - { type : "RUR" , id : 1 , patch_number : 29799057 , base_ru : '19.3' } - { type : "RUR" , id : 2 , patch_number : 30087906 , base_ru : '19.3' } - { type : "RUR" , id : 1 , patch_number : 30080447 , base_ru : '19.4' } @@ -507,6 +613,7 @@ list_19000: - { type : "RUR" , id : 2 , patch_number : 34429835 , base_ru : '19.15' } - { type : "RUR" , id : 1 , patch_number : 34444812 , base_ru : '19.16' } - { type : "RUR" , id : 2 , patch_number : 34771828 , base_ru : '19.16' } +# 19c MRP - { type : "MRP" , id : 221115 , patch_number : 34737974 , base_ru : '19.17' , dep_type : 'RU' , dep_id : 17 , apply_method : "opatchauto" } - { type : "MRP" , id : 221220 , patch_number : 34819700 , base_ru : '19.17' , dep_type : 'RU' , dep_id : 17 , apply_method : "opatchauto" } - { type : "MRP" , id : 230117 , patch_number : 34935010 , base_ru : '19.17' , dep_type : 'RU' , dep_id : 17 , apply_method : "opatchauto" } @@ -522,6 +629,13 @@ list_19000: - { type : "MRP" , id : 230516 , patch_number : 35333937 , base_ru : '19.19' , dep_type : 'RU' , dep_id : 19 , apply_method : "napply" } - { type : "MRP" , id : 230620 , patch_number : 35449803 , base_ru : '19.19' , dep_type : 'RU' , dep_id : 19 , apply_method : "napply" } - { type : "MRP" , id : 230718 , patch_number : 35573506 , base_ru : '19.19' , dep_type : 'RU' , dep_id : 19 , apply_method : "napply" } + - { type : "MRP" , id : 230815 , patch_number : 35656804 , base_ru : '19.19' , dep_type : 'RU' , dep_id : 19 , apply_method : "napply" } + - { type : "MRP" , id : 230919 , patch_number : 35755595 , base_ru : '19.19' , dep_type : 'RU' , dep_id : 19 , apply_method : "napply" } + - { type : "MRP" , id : 231017 , patch_number : 35869728 , base_ru : '19.19' , dep_type : 'RU' , dep_id : 19 , apply_method : "napply" } + - { type : "MRP" , id : 230815 , patch_number : 35656870 , base_ru : '19.20' , dep_type : 'RU' , dep_id : 20 , apply_method : "napply" } + - { type : "MRP" , id : 230919 , patch_number : 35755640 , base_ru : '19.20' , dep_type : 'RU' , dep_id : 20 , apply_method : "napply" } + - { type : "MRP" , id : 231017 , patch_number : 35870130 , base_ru : '19.20' , dep_type : 'RU' , dep_id : 20 , apply_method : "napply" } +# 19c OJVM - { type : "OJVM" , id : 190416 , patch_number : 29548437 } - { type : "OJVM" , id : 190716 , patch_number : 29774421 } - { type : "OJVM" , id : 191015 , patch_number : 30128191 } @@ -540,6 +654,7 @@ list_19000: - { type : "OJVM" , id : 230117 , patch_number : 34786990 } - { type : "OJVM" , id : 230418 , patch_number : 35050341 } - { type : "OJVM" , id : 230718 , patch_number : 35354406 } + - { type : "OJVM" , id : 231017 , patch_number : 35648110 } # 19c DPBP - { type : "DPBP" , id : 10 , patch_number : 32583144 , dep_type : 'RU' , dep_id : 10 } - { type : "DPBP" , id : 11 , patch_number : 32958059 , dep_type : 'RU' , dep_id : 11 } @@ -552,6 +667,7 @@ list_19000: - { type : "DPBP" , id : 18 , patch_number : 34972375 , dep_type : 'RU' , dep_id : 18 } - { type : "DPBP" , id : 19 , patch_number : 35261302 , dep_type : 'RU' , dep_id : 19 } - { type : "DPBP" , id : 20 , patch_number : 35512813 , dep_type : 'RU' , dep_id : 20 } + - { type : "DPBP" , id : 21 , patch_number : 35787077 , dep_type : 'RU' , dep_id : 21 } #################### ##### 21.0.0.0 ##### @@ -567,6 +683,7 @@ list_21000: - { type : "RU" , id : 9 , patch_number : 34839741 } - { type : "RU" , id : 10 , patch_number : 35134934 } - { type : "RU" , id : 11 , patch_number : 35428978 } + - { type : "RU" , id : 12 , patch_number : 35740258 } #################### ##### 23.0.0.0 ##### From b9f3340299ab655e81d85139fb177e86fa742825 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 19 Oct 2023 10:38:50 -0300 Subject: [PATCH 118/229] Update list_exceptions.yml --- list_exceptions.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/list_exceptions.yml b/list_exceptions.yml index 3eca70e..b0b1b38 100644 --- a/list_exceptions.yml +++ b/list_exceptions.yml @@ -25,6 +25,7 @@ list_retry_datapatch: - { version: "12.1.0.2" , type : "BP" , id : 230117 , retries : 3 } - { version: "12.1.0.2" , type : "BP" , id : 230418 , retries : 3 } - { version: "12.1.0.2" , type : "BP" , id : 230718 , retries : 3 } + - { version: "12.1.0.2" , type : "BP" , id : 231017 , retries : 3 } ###### - { version: "12.1.0.2" , type : "PSU" , id : 200714 , retries : 2 } - { version: "12.1.0.2" , type : "PSU" , id : 201020 , retries : 2 } @@ -39,6 +40,7 @@ list_retry_datapatch: - { version: "12.1.0.2" , type : "PSU" , id : 230117 , retries : 2 } - { version: "12.1.0.2" , type : "PSU" , id : 230418 , retries : 2 } - { version: "12.1.0.2" , type : "PSU" , id : 230718 , retries : 2 } + - { version: "12.1.0.2" , type : "PSU" , id : 231017 , retries : 2 } ###### - { version: "12.2.0.1" , type : "RU" , id : 190716 , retries : 1 } - { version: "12.2.0.1" , type : "RU" , id : 191015 , retries : 1 } @@ -57,6 +59,7 @@ list_retry_datapatch: - { version: "12.2.0.1" , type : "RU" , id : 230117 , retries : 1 } - { version: "12.2.0.1" , type : "RU" , id : 230418 , retries : 1 } - { version: "12.2.0.1" , type : "RU" , id : 230718 , retries : 1 } + - { version: "12.2.0.1" , type : "RU" , id : 231017 , retries : 1 } ###### - { version: "12.2.0.1" , type : "RUR" , id : 180717 , retries : 1 } - { version: "12.2.0.1" , type : "RUR" , id : 181016 , retries : 1 } @@ -77,4 +80,5 @@ list_retry_datapatch: - { version: "19.0.0.0" , type : "DPBP" , id : 17 , retries : 1 } - { version: "19.0.0.0" , type : "DPBP" , id : 18 , retries : 1 } - { version: "19.0.0.0" , type : "DPBP" , id : 19 , retries : 1 } - - { version: "19.0.0.0" , type : "DPBP" , id : 20 , retries : 1 } \ No newline at end of file + - { version: "19.0.0.0" , type : "DPBP" , id : 20 , retries : 1 } + - { version: "19.0.0.0" , type : "DPBP" , id : 21 , retries : 1 } \ No newline at end of file From 44648f405d3a35274192a024f3ff197d6bc8c7ad Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 20 Oct 2023 13:59:00 -0300 Subject: [PATCH 119/229] Update find_patch.yml --- tasks/find_patch.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tasks/find_patch.yml b/tasks/find_patch.yml index a2a1a4a..b980bba 100644 --- a/tasks/find_patch.yml +++ b/tasks/find_patch.yml @@ -48,6 +48,10 @@ register: tmp_find_result when: patch.type == "MRP" +# Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" +- set_fact: find_result="{{tmp_find_result}}" + when: tmp_find_result is not skipped + - name: Finding Patch File find: paths: "{{ patch_location_path }}" From 060c4d9cd9621e75fb428bac323d49ad88a0492b Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 4 Jan 2024 16:17:35 -0300 Subject: [PATCH 120/229] New V_$SQL_HINT table --- user_scripts/odbfcl/extract/load_v_dollar.sql | 2 ++ user_scripts/odbfcl/tables_create.sql | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/user_scripts/odbfcl/extract/load_v_dollar.sql b/user_scripts/odbfcl/extract/load_v_dollar.sql index abb30f7..7bfff45 100644 --- a/user_scripts/odbfcl/extract/load_v_dollar.sql +++ b/user_scripts/odbfcl/extract/load_v_dollar.sql @@ -64,6 +64,8 @@ BEGIN RUN_INSERT ('T_OBSOLETE_PARAMETER','V_$OBSOLETE_PARAMETER'); + RUN_INSERT ('T_SQL_HINT','V_$SQL_HINT'); + END; / diff --git a/user_scripts/odbfcl/tables_create.sql b/user_scripts/odbfcl/tables_create.sql index 4e61043..67453aa 100644 --- a/user_scripts/odbfcl/tables_create.sql +++ b/user_scripts/odbfcl/tables_create.sql @@ -755,6 +755,20 @@ CREATE TABLE "T_OPTSTAT_HIST_CONTROL" ) COMPRESS NOLOGGING; +CREATE TABLE "T_SQL_HINT" +( +"NAME" VARCHAR2(64), +"SQL_FEATURE" VARCHAR2(64), +"CLASS" VARCHAR2(64), +"INVERSE" VARCHAR2(64), +"TARGET_LEVEL" NUMBER, +"PROPERTY" NUMBER, +"VERSION" VARCHAR2(25), +"VERSION_OUTLINE" VARCHAR2(25), +"CON_ID" NUMBER +) +COMPRESS NOLOGGING; + ----------------------------------------------------- ----------------------------------------------------- ----------------------------------------------------- From 24c36f06a2df24e5d62dd502857a2144c0f6c4c7 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 8 Jan 2024 12:07:20 -0300 Subject: [PATCH 121/229] Removed obsolete files --- config_oci.yml | 2 - user_scripts/odbfcl/exchange_tables_adb.sql | 186 ------------------ user_scripts/odbfcl/exchange_tables_adb.yml | 8 - user_scripts/odbfcl/update_table_keys_adb.sql | 70 ------- user_scripts/odbfcl/update_table_keys_adb.yml | 8 - 5 files changed, 274 deletions(-) delete mode 100644 user_scripts/odbfcl/exchange_tables_adb.sql delete mode 100644 user_scripts/odbfcl/exchange_tables_adb.yml delete mode 100644 user_scripts/odbfcl/update_table_keys_adb.sql delete mode 100644 user_scripts/odbfcl/update_table_keys_adb.yml diff --git a/config_oci.yml b/config_oci.yml index c9e47b2..794a9d1 100644 --- a/config_oci.yml +++ b/config_oci.yml @@ -42,8 +42,6 @@ user_expdp_post : # - { file : "adb_load_filechksum.yml" , folder : "user_scripts/odbfcl/adb_load_filechksum" , type : "yml", task_action : "Load chksum for ORACLE_HOME in ADB" } # - { file : "adb_load_symbols.yml" , folder : "user_scripts/odbfcl/adb_load_symbols" , type : "yml", task_action : "Load chksum for ORACLE_HOME in ADB" } # - { file : "adb_load_txtcollection_files.yml" , folder : "user_scripts/odbfcl/adb_load_txtcollection_files" , type : "yml", task_action : "Load non-binary files from ORACLE_HOME in ADB" } -# - { file : "update_table_keys_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Update table keys to reflect correct partition name" } -# - { file : "exchange_tables_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Exchange loaded table in the correct partition position" } - { file : "diff_calculate.yml" , folder : "user_scripts/odbfcl/diff_calculate" , type : "yml", task_action : "Generate differences between 2 releases" } # User that will hold your tables outputs and be exported after each execution. If the database is CDB, "C##" will be automatically be appended. diff --git a/user_scripts/odbfcl/exchange_tables_adb.sql b/user_scripts/odbfcl/exchange_tables_adb.sql deleted file mode 100644 index 02b3c02..0000000 --- a/user_scripts/odbfcl/exchange_tables_adb.sql +++ /dev/null @@ -1,186 +0,0 @@ -WHENEVER SQLERROR EXIT SQL.SQLCODE - -SET LINES 1000 - -DEF P_OWNER = '&1' -DEF P_VERS = '&2' -DEF P_SER = '&3' -DEF P_PATCH = '&4' - -CREATE OR REPLACE FUNCTION GET_HIGH_VALUE_AS_STRING ( - P_OWNER IN VARCHAR2, - P_TABLENAME IN VARCHAR2, - P_PATITIONNAME IN VARCHAR2 -) RETURN VARCHAR2 -IS - V_LONGVAL LONG; -BEGIN - SELECT HIGH_VALUE INTO V_LONGVAL - FROM ALL_TAB_PARTITIONS - WHERE TABLE_OWNER = P_OWNER - AND TABLE_NAME = P_TABLENAME - AND PARTITION_NAME = P_PATITIONNAME; - - RETURN SUBSTR(V_LONGVAL, 1, 200); -END; -/ - -SET SERVEROUT ON - --- BRING PARTITION COLUMNS BACK TO NOT NULL -DECLARE - V_CMD CLOB; -BEGIN - FOR I IN (select table_name from sys.user_tables where table_name like 'T\_%' escape '\') - LOOP - V_CMD := 'ALTER TABLE ' || DBMS_ASSERT.SQL_OBJECT_NAME(I.TABLE_NAME) || ' - MODIFY ( "ORAVERSION" NOT NULL, - "ORASERIES" NOT NULL, - "ORAPATCH" NOT NULL )'; - DBMS_OUTPUT.PUT_LINE(V_CMD || ';'); - EXECUTE IMMEDIATE V_CMD; - END LOOP; -END; -/ - --- EXCHANGE TABLES -DECLARE - V_OWNER VARCHAR2(30) := UPPER('&P_OWNER'); - V_ORAVERSION T_PARAMETER.ORAVERSION%TYPE := '&P_VERS.'; - V_ORASERIES T_PARAMETER.ORASERIES%TYPE := '&P_SER.'; - V_ORAPATCH T_PARAMETER.ORAPATCH%TYPE := &P_PATCH.; - --- - V_PNAME VARCHAR2(100); - V_HV VARCHAR2(100); - V_OWNER_TNAME VARCHAR2(100); - V_DID_SMTG BOOLEAN := FALSE; - - -------------------------------------------- - - FUNCTION IS_EMPTY ( - P_OWNER IN VARCHAR2, - P_TABLENAME IN VARCHAR2 - ) RETURN BOOLEAN - IS - V_RES NUMBER; - BEGIN - -- DBMS_OUTPUT.PUT_LINE('SELECT 1 FROM DUAL WHERE EXISTS (SELECT 1 FROM ' || DBMS_ASSERT.ENQUOTE_NAME(P_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(P_TABLENAME) || ')'); - EXECUTE IMMEDIATE 'SELECT 1 FROM DUAL WHERE EXISTS (SELECT 1 FROM ' || DBMS_ASSERT.ENQUOTE_NAME(P_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(P_TABLENAME) || ')' - INTO V_RES; - RETURN FALSE; - EXCEPTION - WHEN NO_DATA_FOUND THEN - RETURN TRUE; - END; - - -------------------------------------------- - - FUNCTION GEN_PART_HV ( - P_OWNER IN VARCHAR2, - P_TABLE_NAME IN VARCHAR2 - ) RETURN VARCHAR2 - IS - V_HV VARCHAR2(50); - BEGIN - SELECT LISTAGG(DECODE(COLUMN_NAME,'ORASERIES',DBMS_ASSERT.ENQUOTE_LITERAL(V_ORASERIES),'ORAVERSION',DBMS_ASSERT.ENQUOTE_LITERAL(V_ORAVERSION),'ORAPATCH',V_ORAPATCH),', ') WITHIN GROUP(ORDER BY COLUMN_POSITION) - INTO V_HV - FROM ALL_PART_KEY_COLUMNS - WHERE OWNER=P_OWNER - AND NAME=P_TABLE_NAME - AND OBJECT_TYPE='TABLE'; - - RETURN V_HV; - EXCEPTION - WHEN NO_DATA_FOUND THEN - RETURN ''; - END; - - -------------------------------------------- - - FUNCTION GET_PART_NAME ( - P_OWNER IN VARCHAR2, - P_TABLE_NAME IN VARCHAR2, - P_HV IN VARCHAR2 - ) RETURN VARCHAR2 - IS - V_PART_NAME VARCHAR2(30); - BEGIN - SELECT PARTITION_NAME - INTO V_PART_NAME - FROM ALL_TAB_PARTITIONS - WHERE TABLE_OWNER=P_OWNER - AND TABLE_NAME=P_TABLE_NAME - AND GET_HIGH_VALUE_AS_STRING(TABLE_OWNER,TABLE_NAME,PARTITION_NAME) = '( ' || P_HV || ' )'; - - RETURN V_PART_NAME; - EXCEPTION - WHEN NO_DATA_FOUND THEN - RETURN ''; - END; - - -------------------------------------------- - - PROCEDURE RUN_CMD (P_CMD CLOB) - IS - BEGIN - DBMS_OUTPUT.PUT_LINE(P_CMD || ';'); - EXECUTE IMMEDIATE P_CMD; - V_DID_SMTG := TRUE; - END; - - -------------------------------------------- - -BEGIN - FOR I IN (SELECT TABLE_NAME FROM USER_TABLES ORDER BY TABLE_NAME) - LOOP - - IF IS_EMPTY(USER,I.TABLE_NAME) - THEN - DBMS_OUTPUT.PUT_LINE( '--- ' || I.TABLE_NAME || ' - EMPTY'); - CONTINUE; - END IF; - - V_OWNER_TNAME := DBMS_ASSERT.ENQUOTE_NAME(V_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME); - - V_HV := GEN_PART_HV(V_OWNER,I.TABLE_NAME); - -- DBMS_OUTPUT.PUT_LINE('V_HV: ' || V_HV); - - -- NULL V_HV = Non-partitioned table. - - IF V_HV IS NULL - THEN - IF I.TABLE_NAME = 'DM_CONTENTS' - THEN - RUN_CMD('INSERT /*+ APPEND */ INTO ' || V_OWNER_TNAME || ' SELECT * FROM ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' A WHERE NOT EXISTS (SELECT 1 FROM ' || V_OWNER_TNAME || ' B WHERE A.MD5_HASH = B.MD5_HASH)'); - ELSIF I.TABLE_NAME = 'DM_CODES' - THEN - RUN_CMD('INSERT /*+ APPEND */ INTO ' || V_OWNER_TNAME || ' SELECT * FROM ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' A WHERE NOT EXISTS (SELECT 1 FROM ' || V_OWNER_TNAME || ' B WHERE A.MD5_HASH = B.MD5_HASH)'); - ELSE - RAISE_APPLICATION_ERROR(-20000,'Unknown Table'); - END IF; - ELSE - V_PNAME := GET_PART_NAME(V_OWNER,I.TABLE_NAME,V_HV); - IF V_PNAME IS NOT NULL - THEN - RUN_CMD('ALTER TABLE ' || V_OWNER_TNAME || ' EXCHANGE PARTITION ' || DBMS_ASSERT.ENQUOTE_NAME(V_PNAME) || ' WITH TABLE ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' INCLUDING INDEXES WITH VALIDATION'); - ELSE - RUN_CMD('ALTER TABLE ' || V_OWNER_TNAME || ' ADD PARTITION VALUES ( ' || V_HV || ' )'); - V_PNAME := GET_PART_NAME(V_OWNER,I.TABLE_NAME,V_HV); - RUN_CMD('ALTER TABLE ' || V_OWNER_TNAME || ' EXCHANGE PARTITION ' || DBMS_ASSERT.ENQUOTE_NAME(V_PNAME) || ' WITH TABLE ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' INCLUDING INDEXES WITH VALIDATION'); - END IF; - END IF; - END LOOP; - IF V_DID_SMTG - THEN - -- Add here any optional code to do after the exchange. - NULL; - ELSE - DBMS_OUTPUT.PUT_LINE('---'); - DBMS_OUTPUT.PUT_LINE('--- ATTENTION: ALL TABLES ARE EMPTY'); - END IF; -END; -/ - -DROP FUNCTION GET_HIGH_VALUE_AS_STRING; - -EXIT 0 diff --git a/user_scripts/odbfcl/exchange_tables_adb.yml b/user_scripts/odbfcl/exchange_tables_adb.yml deleted file mode 100644 index 27b2cff..0000000 --- a/user_scripts/odbfcl/exchange_tables_adb.yml +++ /dev/null @@ -1,8 +0,0 @@ -- include: tasks/local_sqlplus.yml - vars: - sql_param : { task_action : "Load {{ oci_adb_transient_user }} tables into {{ oci_adb_user }} schema" , - cred : "{{ oci_adb_connection_tns }}" , - file : "exchange_tables_adb.sql" , - folder : "user_scripts/odbfcl" , - params : "{{ oci_adb_user }} {{ db_version }} {{ patch.base_ru | default('') }}{{ patch.type }} {{ patch.id }}" - } \ No newline at end of file diff --git a/user_scripts/odbfcl/update_table_keys_adb.sql b/user_scripts/odbfcl/update_table_keys_adb.sql deleted file mode 100644 index 99757c4..0000000 --- a/user_scripts/odbfcl/update_table_keys_adb.sql +++ /dev/null @@ -1,70 +0,0 @@ -WHENEVER SQLERROR EXIT SQL.SQLCODE - -SET LINES 1000 - -DEF P_VERSION = '&1' -DEF P_SERIES = '&2' -DEF P_PATCH = '&3' - -SET SERVEROUT ON -DECLARE - - -------------------------------------------- - - FUNCTION IS_READY ( - P_OWNER IN VARCHAR2, - P_TABLENAME IN VARCHAR2 - ) RETURN BOOLEAN - IS - V_RES NUMBER; - V_CMD CLOB; - BEGIN - -- BE READY = FIND LINES TO UPDATE - V_CMD := ' - SELECT 1 FROM DUAL - WHERE EXISTS - ( SELECT 1 FROM ' || DBMS_ASSERT.ENQUOTE_NAME(P_OWNER) || '.' || DBMS_ASSERT.ENQUOTE_NAME(P_TABLENAME) || ' - WHERE NOT ( ORAVERSION = ''&P_VERSION.'' AND - ORASERIES = ''&P_SERIES.'' AND - ORAPATCH = &P_PATCH. - ) OR ORAVERSION IS NULL OR ORASERIES IS NULL OR ORAPATCH IS NULL - )'; - -- DBMS_OUTPUT.PUT_LINE(V_CMD || ';'); - EXECUTE IMMEDIATE V_CMD - INTO V_RES; - RETURN TRUE; - EXCEPTION - WHEN NO_DATA_FOUND THEN - RETURN FALSE; - END; - - -------------------------------------------- - - PROCEDURE RUN_CMD (P_CMD CLOB) - IS - BEGIN - DBMS_OUTPUT.PUT_LINE(P_CMD || ';'); - EXECUTE IMMEDIATE P_CMD; - END; - - -------------------------------------------- - -BEGIN - FOR I IN (SELECT TABLE_NAME FROM USER_TABLES WHERE TABLE_NAME LIKE 'T\_%' ESCAPE '\' ORDER BY TABLE_NAME) - LOOP - - IF NOT IS_READY(USER,I.TABLE_NAME) - THEN - DBMS_OUTPUT.PUT_LINE( '--- ' || I.TABLE_NAME || ' - NOTHING TO DO'); - CONTINUE; - END IF; - - RUN_CMD('UPDATE ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' SET ORAVERSION = ''&P_VERSION.'', ORASERIES = ''&P_SERIES.'', ORAPATCH = &P_PATCH.'); - DBMS_OUTPUT.PUT_LINE(TO_CHAR(SQL%ROWCOUNT) || ' rows affected.'); - RUN_CMD('ALTER TABLE ' || DBMS_ASSERT.ENQUOTE_NAME(I.TABLE_NAME) || ' MOVE ONLINE'); - - END LOOP; -END; -/ - -EXIT 0 diff --git a/user_scripts/odbfcl/update_table_keys_adb.yml b/user_scripts/odbfcl/update_table_keys_adb.yml deleted file mode 100644 index 91fc62a..0000000 --- a/user_scripts/odbfcl/update_table_keys_adb.yml +++ /dev/null @@ -1,8 +0,0 @@ -- include: tasks/local_sqlplus.yml - vars: - sql_param : { task_action : "Update {{ oci_adb_transient_user }} tables with new keys" , - cred : "{{ oci_adb_connection_tns }}" , - file : "update_table_keys_adb.sql" , - folder : "user_scripts/odbfcl" , - params : "{{ db_version }} {{ patch.base_ru | default('') }}{{ patch.type }} {{ patch.id }}" - } \ No newline at end of file From 3f60f53d9af08ca2998e4d928cc7fbdf8625d1d0 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 11 Jan 2024 10:41:59 -0300 Subject: [PATCH 122/229] Update main_RU_RUR.yml --- tasks/main_RU_RUR.yml | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/tasks/main_RU_RUR.yml b/tasks/main_RU_RUR.yml index 312746d..962e332 100644 --- a/tasks/main_RU_RUR.yml +++ b/tasks/main_RU_RUR.yml @@ -35,7 +35,7 @@ # Define base_OJVM_line. This is used by patch_task_post to save the snapshot. - name: Get latest RU ID set_fact: - latest_RU_id: "{{ lookup('vars', patch_list) | json_query(filter_qry_1) | max }}" + latest_RU_id: "{{ ( ( lookup('vars', patch_list) | json_query(filter_qry_1) ) + [0] ) | max }}" base_OJVM_id: "{{ ( ( lookup('vars', patch_list) | json_query(filter_qry_2) ) + [0] ) | max }}" vars: filter_qry_1: "[? type == 'RU' ].id" @@ -119,47 +119,26 @@ when: param_type is undefined or param_type == "OJVM" -### RUR +### RUR & MRP & DPBP & OTHERS - block: - name : Define snapshot base version to rollback when reload is called. set_fact: vm_snapshot: "{{ patch_base }}" - # Execute for every RUR + # Execute for every patch - include: "{{ patch_file }}" loop: "{{ lookup('vars', patch_list) | flatten(levels=1) }}" loop_control: loop_var: patch label: "{{ patch.id }}" when: - - patch.type == "RUR" + - (param_type is undefined and (patch.type != "RU" and patch.type != "OJVM")) or patch.type == param_type - patch.id == (param_patch | float) or param_patch == -1 - patch.id >= (param_patch_from | float) or param_patch_from == -1 - patch.id <= (param_patch_to | float) or param_patch_to == -1 - when: param_type is undefined or param_type == "RUR" - -### MRP & DPBP -- block: - - - name : Define snapshot base version to rollback when reload is called. - set_fact: - vm_snapshot: "{{ patch_base }}" - - # Execute for every MRP - - include: "{{ patch_file }}" - loop: "{{ lookup('vars', patch_list) | flatten(levels=1) }}" - loop_control: - loop_var: patch - label: "{{ patch.id }}" - when: - - (param_type is undefined and (patch.type == "MRP" or patch.type == "DPBP")) or patch.type == param_type - - patch.id == (param_patch | float) or param_patch == -1 - - patch.id >= (param_patch_from | float) or param_patch_from == -1 - - patch.id <= (param_patch_to | float) or param_patch_to == -1 - - when: param_type is undefined or param_type == "MRP" or param_type == "DPBP" + when: param_type is undefined or (param_type != "RU" and param_type != "OJVM") # Stop OCI VM - name: Call role to stop OCI VM From d66e07e15e734e06423a7a6527549f50183ee288 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 11 Jan 2024 10:42:03 -0300 Subject: [PATCH 123/229] Update lvm_reload.yml --- tasks/lvm_reload.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tasks/lvm_reload.yml b/tasks/lvm_reload.yml index 83dfd2d..b44452f 100644 --- a/tasks/lvm_reload.yml +++ b/tasks/lvm_reload.yml @@ -3,14 +3,27 @@ set -e -x v_snapshot="{{ vm_snapshot }}" v_disk="/dev/mapper/vg_u01-lv_u01" + # Kill all oracle sessions pkill -9 -U oracle || true sleep 5 + # Try to umount the disk umount -l -f /u01 || true sleep 5 - lvchange -a n ${v_disk} -f + # Try to deactivate the disk + lvchange -a n ${v_disk} -f && v_ret=$? || v_ret=$? + # If not deactivating, try again in 1 minute.. + if [ $v_ret -ne 0 ] + then + sleep 60 + umount -l -f /u01 || true + sleep 5 + lvchange -a n ${v_disk} -f + fi + # Restore target snapshot lvconvert --merge -i 1 -v ${v_disk}_${v_snapshot} lvchange -a n ${v_disk} lvchange -a y ${v_disk} + # Wait until snapshot is ready while : do if ! lvs -a | grep lv_u01_${v_snapshot} From 9d3b5be4be64708c5f1f97de2255a7ab2cbae7b7 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 11 Jan 2024 10:42:15 -0300 Subject: [PATCH 124/229] Update exporter.sh --- user_scripts/odbfcl/sh_extractor/exporter.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/user_scripts/odbfcl/sh_extractor/exporter.sh b/user_scripts/odbfcl/sh_extractor/exporter.sh index 6b739b0..40a2075 100644 --- a/user_scripts/odbfcl/sh_extractor/exporter.sh +++ b/user_scripts/odbfcl/sh_extractor/exporter.sh @@ -1,7 +1,7 @@ #!/bin/bash # Script to collect all info needed from the DB # Created by Rodrigo Jorge -# v1.0.0.5 +# v1.0.0.6 set -eo pipefail @@ -52,7 +52,14 @@ v_dump_user='hash' [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." echo "Checking if common user. Please wait.." -v_common_user=$($ORACLE_HOME/bin/sqlplus -L -S "/ as sysdba" @${v_thisdir}/get_user_prefix.sql) +v_common_user=$($ORACLE_HOME/bin/sqlplus -L -S "/ as sysdba" @${v_thisdir}/get_user_prefix.sql) && v_ret=$? || v_ret=$? + +if [ $v_ret -ne 0 ] +then + echoError "Failed to get required information." + exitError "${v_common_user}" +fi + [ -n "${v_common_user}" ] && v_dump_user="${v_common_user}${v_dump_user}" ################## v_thisdir_bkp="${v_thisdir}" # REMOVE_IF_ZIP From 5200e91827995752a384b629ce9fe57b7ac2d703 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 11 Jan 2024 14:15:41 -0300 Subject: [PATCH 125/229] Updates --- list_patches.yml | 10 +++++----- list_versions.yml | 2 +- tasks/main_RU_RUR.yml | 3 ++- tasks/main_loader_adb.yml | 10 ++-------- tasks/main_loader_manual.yml | 2 +- user_scripts/odbfcl/tables_create.sql | 4 ++-- 6 files changed, 13 insertions(+), 18 deletions(-) diff --git a/list_patches.yml b/list_patches.yml index c6b10a3..9bbcc22 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -690,9 +690,9 @@ list_21000: #################### list_23000: - - { type : "RU" , id : 1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta1.tar.gz" } - - { type : "RU" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta2.tar.gz" } - - { type : "RU" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta3.tar.gz" } - - { type : "RU" , id : 2.1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel1_Beta2.tar.gz" , oracle_sid : "FREE" } - - { type : "RU" , id : 3.1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel2_Beta3.tar.gz" , oracle_sid : "FREE" , expdp_comp : false } + - { type : "BETA" , id : 1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta1.tar.gz" } + - { type : "BETA" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta2.tar.gz" } + - { type : "BETA" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta3.tar.gz" } + - { type : "FREE" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel1_Beta2.tar.gz" , oracle_sid : "FREE" , expdp_comp : false } + - { type : "FREE" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel2_Beta3.tar.gz" , oracle_sid : "FREE" , expdp_comp : false } # - { type : "RU" , id : 3 , patch_number : 00000000 , base_snap : "23.2.0" } \ No newline at end of file diff --git a/list_versions.yml b/list_versions.yml index 75396fd..ddb855f 100644 --- a/list_versions.yml +++ b/list_versions.yml @@ -33,4 +33,4 @@ list_info_oci: - { id : "18.0.0.0" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" , out_of_box_ru : 3 } - { id : "19.0.0.0" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" , out_of_box_ru : 3 } - { id : "21.0.0.0" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" , out_of_box_ru : 3 } - - { id : "23.0.0.0" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" , out_of_box_ru : 1 } + - { id : "23.0.0.0" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" , out_of_box_ru : null } diff --git a/tasks/main_RU_RUR.yml b/tasks/main_RU_RUR.yml index 962e332..9cb5f3c 100644 --- a/tasks/main_RU_RUR.yml +++ b/tasks/main_RU_RUR.yml @@ -20,7 +20,7 @@ set_fact: oci_instance_id: "{{ item.oci_instance_id }}" patch_base: "{{ item.base_snap }}" - out_of_box_ru: "{{ item.out_of_box_ru | default(0) }}" + out_of_box_ru: "{{ item.out_of_box_ru | default(-1, true) }}" with_items: "{{ list_info_oci }}" when: item.id == db_version and oci_mode @@ -67,6 +67,7 @@ vars: patch : { type : RU , id : "{{ out_of_box_ru }}" , patch_number : 0 } when: + - (out_of_box_ru | float) != -1 - (out_of_box_ru | float) == (param_patch | float) or param_patch == -1 - (out_of_box_ru | float) >= (param_patch_from | float) or param_patch_from == -1 - (out_of_box_ru | float) <= (param_patch_to | float) or param_patch_to == -1 diff --git a/tasks/main_loader_adb.yml b/tasks/main_loader_adb.yml index e10f7b5..7d72a99 100644 --- a/tasks/main_loader_adb.yml +++ b/tasks/main_loader_adb.yml @@ -8,7 +8,7 @@ - name : Define Cloud params set_fact: - out_of_box_ru: "{{ item.out_of_box_ru | default(0) }}" + out_of_box_ru: "{{ item.out_of_box_ru | default(-1, true) }}" with_items: "{{ list_info_oci }}" when: item.id == db_version @@ -27,12 +27,6 @@ vars: filter_qry: "[?type=='BP'].id" -- name : Check if there is any RU - set_fact: - total_rus: "{{ lookup('vars', patch_list) | json_query(filter_qry) | count }}" - vars: - filter_qry: "[?type=='RU'].id" - ############################### # Execute for base release if there is at least 1 PSU for that version @@ -62,7 +56,7 @@ vars: patch : { type : RU , id : "{{ out_of_box_ru }}" , patch_number : 0 } when: - - total_rus != "0" + - (out_of_box_ru | float) != -1 - (out_of_box_ru | float) == (param_patch | float) or param_patch == -1 - (out_of_box_ru | float) >= (param_patch_from | float) or param_patch_from == -1 - (out_of_box_ru | float) <= (param_patch_to | float) or param_patch_to == -1 diff --git a/tasks/main_loader_manual.yml b/tasks/main_loader_manual.yml index 633c443..00d1941 100644 --- a/tasks/main_loader_manual.yml +++ b/tasks/main_loader_manual.yml @@ -162,7 +162,7 @@ - name : Define Cloud params set_fact: - out_of_box_ru: "{{ item.out_of_box_ru | default(0) }}" + out_of_box_ru: "{{ item.out_of_box_ru | default(-1, true) }}" with_items: "{{ list_info_oci }}" when: item.id == db_version diff --git a/user_scripts/odbfcl/tables_create.sql b/user_scripts/odbfcl/tables_create.sql index 67453aa..b894c15 100644 --- a/user_scripts/odbfcl/tables_create.sql +++ b/user_scripts/odbfcl/tables_create.sql @@ -742,7 +742,7 @@ COMPRESS NOLOGGING; CREATE TABLE "T_OPTSTAT_HIST_CONTROL" ( -"SNAME" VARCHAR2(30), +"SNAME" VARCHAR2(30) NOT NULL, "SVAL1" NUMBER, -- "SVAL2" TIMESTAMP (6) WITH TIME ZONE, "SPARE1" NUMBER, @@ -757,7 +757,7 @@ COMPRESS NOLOGGING; CREATE TABLE "T_SQL_HINT" ( -"NAME" VARCHAR2(64), +"NAME" VARCHAR2(64) NOT NULL, "SQL_FEATURE" VARCHAR2(64), "CLASS" VARCHAR2(64), "INVERSE" VARCHAR2(64), From 9d78ba0144bf7a5eff7d5aa8697bab7c8c0eb7f8 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 12 Jan 2024 16:56:03 -0300 Subject: [PATCH 126/229] Change base release patch type name --- tasks/main_PSU_BP.yml | 8 +------- tasks/main_RU_RUR.yml | 2 +- tasks/main_loader_adb.yml | 21 ++------------------- 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/tasks/main_PSU_BP.yml b/tasks/main_PSU_BP.yml index ad04384..5d45797 100644 --- a/tasks/main_PSU_BP.yml +++ b/tasks/main_PSU_BP.yml @@ -64,7 +64,7 @@ # Execute for base release - include: "{{ patch_file }}" vars: - patch : { type : PSU , id : 0, patch_number : 0 } + patch : { type : BASE , id : 0, patch_number : 0 } when: - 0 == (param_patch | float) or param_patch == -1 - 0 >= (param_patch_from | float) or param_patch_from == -1 @@ -124,12 +124,6 @@ set_fact: vm_snapshot: "{{ patch_base }}" - - name : Check if there is any BP - set_fact: - total_bps: "{{ lookup('vars', patch_list) | json_query(filter_qry) | count }}" - vars: - filter_qry: "[?type=='BP'].id" - # Execute for every BP - include: "{{ patch_file }}" loop: "{{ lookup('vars', patch_list) | flatten(levels=1) }}" diff --git a/tasks/main_RU_RUR.yml b/tasks/main_RU_RUR.yml index 9cb5f3c..d30530e 100644 --- a/tasks/main_RU_RUR.yml +++ b/tasks/main_RU_RUR.yml @@ -65,7 +65,7 @@ # Execute for base release - include: "{{ patch_file }}" vars: - patch : { type : RU , id : "{{ out_of_box_ru }}" , patch_number : 0 } + patch : { type : BASE , id : "{{ out_of_box_ru }}" , patch_number : 0 } when: - (out_of_box_ru | float) != -1 - (out_of_box_ru | float) == (param_patch | float) or param_patch == -1 diff --git a/tasks/main_loader_adb.yml b/tasks/main_loader_adb.yml index 7d72a99..54bea94 100644 --- a/tasks/main_loader_adb.yml +++ b/tasks/main_loader_adb.yml @@ -21,18 +21,12 @@ vars: filter_qry: "[?type=='PSU'].id" -- name : Check if there is any BP - set_fact: - total_bps: "{{ lookup('vars', patch_list) | json_query(filter_qry) | count }}" - vars: - filter_qry: "[?type=='BP'].id" - ############################### # Execute for base release if there is at least 1 PSU for that version - include: "impdp_file_adb.yml" vars: - patch : { type : PSU , id : 0, patch_number : 0 } + patch : { type : BASE , id : 0, patch_number : 0 } when: - total_psus != "0" - 0 == (param_patch | float) or param_patch == -1 @@ -40,21 +34,10 @@ - 0 <= (param_patch_to | float) or param_patch_to == -1 - param_type is undefined or param_type == "PSU" -# Execute for base release if there is at least 1 BP for that version -- include: "impdp_file_adb.yml" - vars: - patch : { type : BP , id : 0, patch_number : 0 } - when: - - total_bps != "0" - - 0 == (param_patch | float) or param_patch == -1 - - 0 >= (param_patch_from | float) or param_patch_from == -1 - - 0 <= (param_patch_to | float) or param_patch_to == -1 - - param_type is undefined or param_type == "BP" - # Execute for base release if there is at least 1 RU for that version - include: "impdp_file_adb.yml" vars: - patch : { type : RU , id : "{{ out_of_box_ru }}" , patch_number : 0 } + patch : { type : BASE , id : "{{ out_of_box_ru }}" , patch_number : 0 } when: - (out_of_box_ru | float) != -1 - (out_of_box_ru | float) == (param_patch | float) or param_patch == -1 From 005e9497ce75335b2e334c929a42c212c67d8bf9 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 15 Jan 2024 11:36:04 -0300 Subject: [PATCH 127/229] Update list_patches.yml --- list_patches.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/list_patches.yml b/list_patches.yml index 9bbcc22..772033e 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -563,7 +563,7 @@ list_18000: list_19000: # 19c RU - - { type : "RU" , id : 3 , patch_number : 29517242 , base_snap : "19.2.0" } +# - { type : "RU" , id : 3 , patch_number : 29517242 , base_snap : "19.2.0" } - { type : "RU" , id : 4 , patch_number : 29834717 } - { type : "RU" , id : 5 , patch_number : 30125133 } - { type : "RU" , id : 6 , patch_number : 30557433 } From e9189fb16bedfeb6c66721d77a44504423cdcc9f Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 16 Jan 2024 15:11:49 -0300 Subject: [PATCH 128/229] Updating extractor files --- .../odbfcl/adb_load_bugs_fixed/bugsGet.sh | 10 ++++++ .../odbfcl/adb_load_bugs_fixed/bugsLoad.sh | 4 ++- .../odbfcl/adb_load_filechksum/chksumGet.sh | 14 ++++++-- .../odbfcl/adb_load_filechksum/chksumLoad.sh | 4 ++- .../odbfcl/adb_load_symbols/symbolLoad.sh | 4 ++- .../adb_load_txtcollection_files/fileGet.sh | 8 ++++- .../adb_load_txtcollection_files/fileLoad.sh | 8 +++-- .../odbfcl/sh_extractor/dictionaryGet.sh | 4 ++- .../odbfcl/sh_extractor/dumpCreate.sh | 34 +++++++++++++++---- user_scripts/odbfcl/sh_extractor/exporter.sh | 20 +++++++---- .../odbfcl/sh_extractor/schemaCreate.sh | 4 ++- 11 files changed, 89 insertions(+), 25 deletions(-) diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh index 38d809b..d8d16bb 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh @@ -24,6 +24,16 @@ v_output="$1" echo "Generating bugs list. Please wait.." +# Check if opatch command works +v_out=$("$ORACLE_HOME"/OPatch/opatch lsinv 2>&1) && v_ret=$? || v_ret=$? +if [ ${v_ret} -ne 0 ] +then + echoError "Unable to run opatch. Error was:" + echoError "${v_out}" + echoError "Skipping opatch collection." + exit ${v_ret} +fi + "$ORACLE_HOME"/OPatch/opatch lsinv -bugs_fixed | # Remove lines before this entry (inclusive) sed '1,/^List of Bugs fixed by Installed Patches/d' | diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh index 2a10cdc..eabb039 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh @@ -25,6 +25,8 @@ v_outpref="${v_file}" [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." +[ -z "${v_sysdba_connect}" ] && v_sysdba_connect='/ as sysdba' + echo "Loading bugs list. Please wait.." cat << EOF > "${v_outpref}_load.ctl" @@ -36,7 +38,7 @@ FIELDS TERMINATED BY x'09' EOF $ORACLE_HOME/bin/sqlldr \ -userid=\'/ as sysdba\' \ +userid=\'"${v_sysdba_connect}"\' \ control="${v_outpref}_load.ctl" \ errors=0 \ discardmax=0 \ diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh b/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh index cf373eb..4935b17 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh +++ b/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh @@ -24,20 +24,26 @@ v_output="$1" v_output_fdr="$(cd "$(dirname "${v_output}")"; pwd)" v_output_file="$(basename "${v_output}")" +v_output_file_noext="${v_output_file%.*}" v_output_full="${v_output_fdr}/${v_output_file}" +v_output_error="${v_output_fdr}/${v_output_file_noext}.err" + +[ -f "${v_output_error}" ] && rm -f "${v_output_error}" echo "Generating sha256sum for \$ORACLE_HOME files. Please wait.." cd "$ORACLE_HOME" set +e -find -type f -exec sha256sum "{}" + > "${v_output_full}" +find -type f -exec sha256sum "{}" + > "${v_output_full}" 2>> "${v_output_error}" set -eo pipefail cd - > /dev/null sed -i 's/$/ F/' "${v_output_full}" -v_libs=$(find "$ORACLE_HOME" -type f -name "*.a") +set +e +v_libs=$(find "$ORACLE_HOME" -type f -name "*.a" 2>> "${v_output_error}") +set -eo pipefail v_ext_fold=`mktemp -d` v_out_file=`mktemp` @@ -51,7 +57,7 @@ do mkdir "${v_ext_fold}" cd "${v_ext_fold}" set +e - ar x "${v_lib}" + ar x "${v_lib}" 2>> "${v_output_error}" set -eo pipefail find -type f -exec sha256sum "{}" + > "${v_out_file}" cd - > /dev/null @@ -61,4 +67,6 @@ do rm -rf "${v_ext_fold}" "${v_out_file}" done +[ -f "${v_output_error}" ] && echo "Total errors detected: $(wc -l < "${v_output_error}")" + exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh index 24b21c8..c10c1f4 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh +++ b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh @@ -25,6 +25,8 @@ v_outpref="${v_file}" [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." +[ -z "${v_sysdba_connect}" ] && v_sysdba_connect='/ as sysdba' + echo "Loading sha256sum list. Please wait.." cat << EOF > "${v_outpref}_load.ctl" @@ -36,7 +38,7 @@ FIELDS TERMINATED BY ' ' EOF $ORACLE_HOME/bin/sqlldr \ -userid=\'/ as sysdba\' \ +userid=\'"${v_sysdba_connect}"\' \ control="${v_outpref}_load.ctl" \ errors=0 \ discardmax=0 \ diff --git a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh index 10b46f7..2c577e0 100644 --- a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh +++ b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh @@ -25,6 +25,8 @@ v_outpref="${v_file}" [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." +[ -z "${v_sysdba_connect}" ] && v_sysdba_connect='/ as sysdba' + echo "Loading symbols list. Please wait.." cat << EOF > "${v_outpref}_load.ctl" @@ -36,7 +38,7 @@ FIELDS TERMINATED BY '|' EOF $ORACLE_HOME/bin/sqlldr \ -userid=\'/ as sysdba\' \ +userid=\'"${v_sysdba_connect}"\' \ control="${v_outpref}_load.ctl" \ errors=0 \ discardmax=0 \ diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh index a0aebb5..f465a17 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh @@ -27,14 +27,20 @@ v_output="$1" v_output_fdr="$(cd "$(dirname "${v_output}")"; pwd)" v_output_file="$(basename "${v_output}")" +v_output_file_noext="${v_output_file%.*}" v_output_full="${v_output_fdr}/${v_output_file}" +v_output_error="${v_output_fdr}/${v_output_file_noext}.err" + +[ -f "${v_output_error}" ] && rm -f "${v_output_error}" echo "Generating ORACLE_HOME non-binary files list. Please wait.." cd "$ORACLE_HOME" set +e # grep may return "Permission denied" -find -type f -not -path "./.patch_storage/*" -not -name "tfa_setup" -print0 | xargs -0 grep -Il '.' | tar -czf "${v_output_full}" -T - +find -type f -not -path "./.patch_storage/*" -not -name "tfa_setup" -print0 2>> "${v_output_error}" | xargs -0 grep -Il '.' 2>> "${v_output_error}" | tar -czf "${v_output_full}" -T - + +[ -f "${v_output_error}" ] && echo "Total errors detected: $(wc -l < "${v_output_error}")" exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh index 098ddc9..4d653f0 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh @@ -25,6 +25,8 @@ v_outpref="${v_file}" [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." +[ -z "${v_sysdba_connect}" ] && v_sysdba_connect='/ as sysdba' + echo "Loading ORACLE_HOME non-binary files. Please wait.." rm -rf "${v_outpref}_unzip" @@ -34,7 +36,7 @@ tar -xf "${v_file}" -C "${v_outpref}_unzip" cd "${v_outpref}_unzip" -$ORACLE_HOME/bin/sqlplus -L -S "/ as sysdba" <&1 >&3. This sends the stderr of expdp +# to the same place as the current stdout, which is the pipe, then sends the stdout +# to fd 3, the original output. The pipe feeds the original stderr of expdp to tee, +# which saves it in a file and sends it to the screen. +exec 3>&1 + +set +e $ORACLE_HOME/bin/expdp \ userid="${v_dump_user}/${v_dump_pass}" \ directory=${v_dump_dir_name} \ @@ -65,10 +75,22 @@ compression=all "${v_compress_alg}" \ dumpfile="${v_output_file}" \ logfile="${v_output_file_noext}.log" \ content=data_only \ -schemas="${v_dump_user}" +schemas="${v_dump_user}" 2>&1 >&3 | tee "${v_output_error}" +v_ret=$? +set -eo pipefail + +if [ ${v_ret} -ne 0 ] +then + if grep -q 'ORA-39070: Unable to open the log file' "${v_output_error}" + then + exitError "Error, check if the Oracle DB has access to this directory: ${v_output_fdr}" + else + exitError 'Error when generating dump file.' + fi +fi cd odbfcl/sh_extractor/ -$ORACLE_HOME/bin/sqlplus -L -S "/ as sysdba" < -# v1.0.0.6 +# v1.0.0.7 set -eo pipefail +# Change this if you need to provide a password to connect as sysdba +export v_sysdba_connect='/ as sysdba' + function echoError () { (>&2 echo "$1") @@ -52,7 +55,7 @@ v_dump_user='hash' [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." echo "Checking if common user. Please wait.." -v_common_user=$($ORACLE_HOME/bin/sqlplus -L -S "/ as sysdba" @${v_thisdir}/get_user_prefix.sql) && v_ret=$? || v_ret=$? +v_common_user=$($ORACLE_HOME/bin/sqlplus -L -S "${v_sysdba_connect}" @${v_thisdir}/get_user_prefix.sql) && v_ret=$? || v_ret=$? if [ $v_ret -ne 0 ] then @@ -67,7 +70,7 @@ v_thisdir_bkp="${v_thisdir}" # REMOVE_IF_ZIP [ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir_bkp}/../adb_load_bugs_fixed" # REMOVE_IF_ZIP v_file=bugs_${v_pattern}.txt -sh "${v_thisdir}/bugsGet.sh" ${v_file} +sh "${v_thisdir}/bugsGet.sh" ${v_file} && v_bugs_ret=$? || v_bugs_ret=$? [ ${v_load_file} -eq 0 ] && zip -m ${v_zip} ${v_file} [ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir_bkp}/../adb_load_filechksum" # REMOVE_IF_ZIP @@ -90,10 +93,13 @@ sh "${v_thisdir}/schemaCreate.sh" ${v_dump_user} if [ ${v_load_file} -eq 1 ] then - [ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir_bkp}/../adb_load_bugs_fixed" # REMOVE_IF_ZIP - v_file=bugs_${v_pattern}.txt - sh "${v_thisdir}/bugsLoad.sh" ${v_dump_user} ${v_file} - rm -f ${v_file} + if [ ${v_bugs_ret} -eq 0 ] + then + [ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir_bkp}/../adb_load_bugs_fixed" # REMOVE_IF_ZIP + v_file=bugs_${v_pattern}.txt + sh "${v_thisdir}/bugsLoad.sh" ${v_dump_user} ${v_file} + rm -f ${v_file} + fi [ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir_bkp}/../adb_load_filechksum" # REMOVE_IF_ZIP v_file=sha256sum_${v_pattern}.chk diff --git a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh index 5ebcabe..78eb10b 100644 --- a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh @@ -25,10 +25,12 @@ v_dump_user="$1" v_thisdir="$(cd "$(dirname "$0")"; pwd)" +[ -z "${v_sysdba_connect}" ] && v_sysdba_connect='/ as sysdba' + echo "Generating export user. Please wait.." cd "${v_thisdir}"/../ -$ORACLE_HOME/bin/sqlplus "/ as sysdba" < Date: Tue, 16 Jan 2024 15:12:51 -0300 Subject: [PATCH 129/229] Update list_patches.yml --- list_patches.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/list_patches.yml b/list_patches.yml index 772033e..4ad5685 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -482,7 +482,7 @@ list_12201: list_18000: # 18c RU # - { type : "RU" , id : 2 , patch_number : 27676517 , base_snap : "18.1.0" } - - { type : "RU" , id : 3 , patch_number : 28090523 , base_snap : "18.1.0" } +# - { type : "RU" , id : 3 , patch_number : 28090523 , base_snap : "18.1.0" } - { type : "RU" , id : 4 , patch_number : 28655784 } - { type : "RU" , id : 5 , patch_number : 28822489 } - { type : "RU" , id : 6 , patch_number : 29301631 } From 7779071a00705cd27727545cc9fc9eeaee36e953 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 16 Jan 2024 18:15:50 -0300 Subject: [PATCH 130/229] Update exporter --- .../odbfcl/sh_extractor/dumpCreate.sh | 2 +- user_scripts/odbfcl/sh_extractor/exporter.sh | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh index e2fd81e..cb31a2e 100644 --- a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh @@ -28,7 +28,7 @@ v_output_file="$(basename "${v_output}")" v_output_file_noext="${v_output_file%.*}" v_output_full="${v_output_fdr}/${v_output_file}" -v_output_error="${v_output_fdr}/${v_output_file_noext}" +v_output_error="${v_output_fdr}/${v_output_file_noext}.err" # If DB_EXP_DUMP_PASS is exported, use it as the password. [ -n "$DB_EXP_DUMP_PASS" ] && v_dump_pass="$DB_EXP_DUMP_PASS" || v_dump_pass='HhAaSsHh..135' diff --git a/user_scripts/odbfcl/sh_extractor/exporter.sh b/user_scripts/odbfcl/sh_extractor/exporter.sh index 10780d5..2de6872 100644 --- a/user_scripts/odbfcl/sh_extractor/exporter.sh +++ b/user_scripts/odbfcl/sh_extractor/exporter.sh @@ -40,6 +40,10 @@ The output is a zip file. # If DB_EXP_GEN_DUMP=0, then nothing will be exported. Only the schema populated. [ "$DB_EXP_GEN_DUMP" == "0" ] && v_gen_dump=0 || v_gen_dump=1 +# Check if DB_EXP_CRED was exported. +# If DB_EXP_CRED is exported, then connect using this string instead of '/ as sysdba'. +[ -n "$DB_EXP_CRED" ] && v_sysdba_connect="$DB_EXP_CRED" + v_pattern_cnt=`awk -F" " '{print NF-1}' <<< "${v_pattern}"` [ ${v_pattern_cnt} -ne 0 ] && exitError "Pattern \"${v_output}\" must not have any spaces. Eg: ${v_example}" @@ -122,10 +126,19 @@ sh "${v_thisdir}/dictionaryGet.sh" ${v_dump_user} if [ ${v_gen_dump} -eq 1 ] then - sh "${v_thisdir}/dumpCreate.sh" ${v_dump_user} ${v_pattern}.dmp - mv ${v_pattern}.dmp tables_${v_pattern}.dmp - mv ${v_pattern}.log tables_${v_pattern}.log + sh "${v_thisdir}/dumpCreate.sh" ${v_dump_user} tables_${v_pattern}.dmp + set +e zip -m ${v_pattern}.zip tables_${v_pattern}.dmp tables_${v_pattern}.log + v_ret=$? + set -eo pipefail + if [ $v_ret -ne 0 ] + then + echoError "Script failed to zip tables_${v_pattern}.dmp in ${v_pattern}.zip". + echoError "1 - Try to rerun as user: $(stat -c '%U' tables_${v_pattern}.dmp)". + echoError "2 - Check permissions on tables_${v_pattern}.dmp, make it readeable and run:". + echoError "$ zip ${v_pattern}.zip tables_${v_pattern}.dmp" + exit $v_ret + fi fi echo "Script Finished." From 17fb7ff10dcc7bd953ac06958097f167384f21ce Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 16 Jan 2024 22:34:37 -0300 Subject: [PATCH 131/229] Update exporter --- user_scripts/odbfcl/sh_extractor/dumpCreate.sh | 3 ++- user_scripts/odbfcl/sh_extractor/exporter.sh | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh index cb31a2e..fa5f25b 100644 --- a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh @@ -83,7 +83,8 @@ if [ ${v_ret} -ne 0 ] then if grep -q 'ORA-39070: Unable to open the log file' "${v_output_error}" then - exitError "Error, check if the Oracle DB has access to this directory: ${v_output_fdr}" + v_ora_user=$(stat -c '%U' $ORACLE_HOME/bin/expdp) + exitError "Error, check if the Oracle Database ('${v_ora_user}' user) has access to this directory: ${v_output_fdr}" else exitError 'Error when generating dump file.' fi diff --git a/user_scripts/odbfcl/sh_extractor/exporter.sh b/user_scripts/odbfcl/sh_extractor/exporter.sh index 2de6872..f01a0c5 100644 --- a/user_scripts/odbfcl/sh_extractor/exporter.sh +++ b/user_scripts/odbfcl/sh_extractor/exporter.sh @@ -134,8 +134,9 @@ then if [ $v_ret -ne 0 ] then echoError "Script failed to zip tables_${v_pattern}.dmp in ${v_pattern}.zip". - echoError "1 - Try to rerun as user: $(stat -c '%U' tables_${v_pattern}.dmp)". - echoError "2 - Check permissions on tables_${v_pattern}.dmp, make it readeable and run:". + v_file_user=$(stat -c '%U' tables_${v_pattern}.dmp) + echoError "1 - Try to rerun as '${v_file_user}' user." + echoError "2 - Check file 'tables_${v_pattern}.dmp' permissions, make it readeable and run:". echoError "$ zip ${v_pattern}.zip tables_${v_pattern}.dmp" exit $v_ret fi From 5e7d46854006921be95412a97b4a07a96655f76d Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 17 Jan 2024 09:27:46 -0300 Subject: [PATCH 132/229] Update exporter scripts --- .../odbfcl/adb_load_bugs_fixed/bugsLoad.sh | 4 ++-- .../odbfcl/adb_load_filechksum/chksumLoad.sh | 4 ++-- .../odbfcl/adb_load_symbols/symbolLoad.sh | 4 ++-- .../adb_load_txtcollection_files/fileLoad.sh | 18 +++++++-------- user_scripts/odbfcl/createUser.sql | 8 ++++++- user_scripts/odbfcl/runExtractor.yml | 2 +- .../odbfcl/sh_extractor/dictionaryGet.sh | 4 ++-- .../odbfcl/sh_extractor/dumpCreate.sh | 14 +++++------ user_scripts/odbfcl/sh_extractor/exporter.sh | 23 ++++++++++--------- .../odbfcl/sh_extractor/schemaCreate.sh | 14 +++++++---- user_scripts/odbfcl/tables_recreate.sql | 4 +++- user_scripts/odbfcl/tables_recreate.yml | 2 +- 12 files changed, 58 insertions(+), 43 deletions(-) diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh index eabb039..a36a831 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh @@ -15,7 +15,7 @@ function exitError () exit 1 } -v_dump_user="$1" +v_dump_user_name="$1" v_file="$2" v_outpref="${v_file}" @@ -31,7 +31,7 @@ echo "Loading bugs list. Please wait.." cat << EOF > "${v_outpref}_load.ctl" LOAD -INTO TABLE ${v_dump_user}.T_BUGSFIXED +INTO TABLE ${v_dump_user_name}.T_BUGSFIXED APPEND FIELDS TERMINATED BY x'09' (bug_id, patch_id, bug_desc) diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh index c10c1f4..190c689 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh +++ b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh @@ -15,7 +15,7 @@ function exitError () exit 1 } -v_dump_user="$1" +v_dump_user_name="$1" v_file="$2" v_outpref="${v_file}" @@ -31,7 +31,7 @@ echo "Loading sha256sum list. Please wait.." cat << EOF > "${v_outpref}_load.ctl" LOAD -INTO TABLE ${v_dump_user}.T_FILES +INTO TABLE ${v_dump_user_name}.T_FILES APPEND FIELDS TERMINATED BY ' ' (sha256_hash, path char(4000), file_type) diff --git a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh index 2c577e0..a0f6012 100644 --- a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh +++ b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh @@ -15,7 +15,7 @@ function exitError () exit 1 } -v_dump_user="$1" +v_dump_user_name="$1" v_file="$2" v_outpref="${v_file}" @@ -31,7 +31,7 @@ echo "Loading symbols list. Please wait.." cat << EOF > "${v_outpref}_load.ctl" LOAD -INTO TABLE ${v_dump_user}.T_SYMBOLS +INTO TABLE ${v_dump_user_name}.T_SYMBOLS APPEND FIELDS TERMINATED BY '|' (file_name, symbol_type, symbol_name char(4000)) diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh index 4d653f0..24fdaab 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh @@ -15,7 +15,7 @@ function exitError () exit 1 } -v_dump_user="$1" +v_dump_user_name="$1" v_file="$2" v_outpref="${v_file}" @@ -38,14 +38,14 @@ cd "${v_outpref}_unzip" $ORACLE_HOME/bin/sqlplus -L -S "${v_sysdba_connect}" < "${v_outpref}_load.ctl" LOAD -INTO TABLE ${v_dump_user}.T_TXTCOLLECTION_LOAD +INTO TABLE ${v_dump_user_name}.T_TXTCOLLECTION_LOAD APPEND FIELDS TERMINATED BY ',' (path char(4000), contents lobfile(path) terminated by eof) @@ -65,24 +65,24 @@ rm -rf "${v_outpref}_unzip" $ORACLE_HOME/bin/sqlplus -L -S "${v_sysdba_connect}" <&1 set +e $ORACLE_HOME/bin/expdp \ -userid="${v_dump_user}/${v_dump_pass}" \ +userid="${v_dump_user_name}/${v_dump_user_pass}" \ directory=${v_dump_dir_name} \ compression=all "${v_compress_alg}" \ dumpfile="${v_output_file}" \ logfile="${v_output_file_noext}.log" \ content=data_only \ -schemas="${v_dump_user}" 2>&1 >&3 | tee "${v_output_error}" +schemas="${v_dump_user_name}" 2>&1 >&3 | tee "${v_output_error}" v_ret=$? set -eo pipefail @@ -93,7 +93,7 @@ fi cd odbfcl/sh_extractor/ $ORACLE_HOME/bin/sqlplus -L -S "${v_sysdba_connect}" < Date: Wed, 17 Jan 2024 09:29:29 -0300 Subject: [PATCH 133/229] Update schemaCreate.sh --- user_scripts/odbfcl/sh_extractor/schemaCreate.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh index 1a850de..3a33ffc 100644 --- a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh @@ -24,10 +24,10 @@ v_dump_user_name="$1" [ -n "$DB_EXP_USER_PASS" ] && v_dump_user_pass="$DB_EXP_USER_PASS" || v_dump_user_pass='HhAaSsHh..135' # If DB_EXP_USER_PASS is exported, use it as the password. -[ -n "$DB_EXP_USER_TBS" ] && v_dump_user_tbs="$DB_EXP_USER_TBS" || v_dump_user_pass='DATA' +[ -n "$DB_EXP_USER_TBS" ] && v_dump_user_tbs="$DB_EXP_USER_TBS" || v_dump_user_tbs='DATA' # If DB_EXP_USER_PASS is exported, use it as the password. -[ -n "$DB_EXP_USER_TEMP" ] && v_dump_user_temp="$DB_EXP_USER_TEMP" || v_dump_user_pass='TEMP' +[ -n "$DB_EXP_USER_TEMP" ] && v_dump_user_temp="$DB_EXP_USER_TEMP" || v_dump_user_temp='TEMP' v_thisdir="$(cd "$(dirname "$0")"; pwd)" From 3a1e2d1e93ce504dffb74573d994d7b670a80e48 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 17 Jan 2024 10:02:35 -0300 Subject: [PATCH 134/229] Improve exporter --- user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh | 10 +++++++++- user_scripts/odbfcl/sh_extractor/schemaCreate.sh | 2 +- user_scripts/odbfcl/tables_recreate.yml | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh index a0f6012..c11db58 100644 --- a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh +++ b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh @@ -34,9 +34,10 @@ LOAD INTO TABLE ${v_dump_user_name}.T_SYMBOLS APPEND FIELDS TERMINATED BY '|' -(file_name, symbol_type, symbol_name char(4000)) +(file_name, symbol_type, symbol_name char(4000) "substr(:symbol_name, 0, 500)") EOF +set +e $ORACLE_HOME/bin/sqlldr \ userid=\'"${v_sysdba_connect}"\' \ control="${v_outpref}_load.ctl" \ @@ -45,6 +46,13 @@ discardmax=0 \ direct=Y \ data="${v_file}" \ log="${v_outpref}_load.log" +v_ret=$? +set -eo pipefail + +if [ $v_ret -ne 0 ] +then + exitError "sqlldr failed to load '${v_file}'. Check also the 'bad' file for more information." +fi rm -f "${v_outpref}_load.log" "${v_outpref}_load.ctl" diff --git a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh index 3a33ffc..c5ccd9a 100644 --- a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh @@ -24,7 +24,7 @@ v_dump_user_name="$1" [ -n "$DB_EXP_USER_PASS" ] && v_dump_user_pass="$DB_EXP_USER_PASS" || v_dump_user_pass='HhAaSsHh..135' # If DB_EXP_USER_PASS is exported, use it as the password. -[ -n "$DB_EXP_USER_TBS" ] && v_dump_user_tbs="$DB_EXP_USER_TBS" || v_dump_user_tbs='DATA' +[ -n "$DB_EXP_USER_TBS" ] && v_dump_user_tbs="$DB_EXP_USER_TBS" || v_dump_user_tbs='USERS' # If DB_EXP_USER_PASS is exported, use it as the password. [ -n "$DB_EXP_USER_TEMP" ] && v_dump_user_temp="$DB_EXP_USER_TEMP" || v_dump_user_temp='TEMP' diff --git a/user_scripts/odbfcl/tables_recreate.yml b/user_scripts/odbfcl/tables_recreate.yml index b438648..e269725 100644 --- a/user_scripts/odbfcl/tables_recreate.yml +++ b/user_scripts/odbfcl/tables_recreate.yml @@ -1,3 +1,3 @@ - include: tasks/run_sql.yml vars: - sql_param : { file : "tables_recreate.sql" , folder : "user_scripts/odbfcl" , task_action : "Recreate tables" , params : "'{{ dump_user_int }}' '{{ dump_pass }}' 'DATA' 'TEMP'" } \ No newline at end of file + sql_param : { file : "tables_recreate.sql" , folder : "user_scripts/odbfcl" , task_action : "Recreate tables" , params : "'{{ dump_user_int }}' '{{ dump_pass }}' 'USERS' 'TEMP'" } \ No newline at end of file From cf68adcec6fe625d1ebcfbc40e6c7a53d493c5e4 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 2 Feb 2024 09:57:30 -0300 Subject: [PATCH 135/229] Update extractor for 11.2.0.3 --- user_scripts/odbfcl/extract/hashGet.sql | 24 +++++++++---------- user_scripts/odbfcl/extract/load_custom.sql | 12 +++++----- .../odbfcl/extract/load_database_vault.sql | 15 ++++++------ user_scripts/odbfcl/extract/load_dba_cdb.sql | 12 +++++----- user_scripts/odbfcl/extract/load_v_dollar.sql | 8 +++---- user_scripts/odbfcl/extract/load_x_dollar.sql | 4 ++-- .../load_underscore_11.2.0.3.sql | 6 +++++ .../load_underscore_vv_11.2.0.3.sql | 6 +++++ 8 files changed, 49 insertions(+), 38 deletions(-) create mode 100644 user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.3.sql create mode 100644 user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.3.sql diff --git a/user_scripts/odbfcl/extract/hashGet.sql b/user_scripts/odbfcl/extract/hashGet.sql index caadc48..8ce7dc8 100644 --- a/user_scripts/odbfcl/extract/hashGet.sql +++ b/user_scripts/odbfcl/extract/hashGet.sql @@ -15,25 +15,23 @@ SELECT UPPER('&V_USERNAME.') V_USERNAME, UPPER('&V_DIRECTORY.') V_DIRECTORY FROM col v_username clear col v_directory clear -col p_vers new_v p_vers nopri -select substr(version,1,instr(version,'.',1,4)-1) p_vers +col p_vers_4d new_v p_vers_4d nopri +col p_vers_1d new_v p_vers_1d nopri +select substr(version,1,instr(version,'.',1,4)-1) p_vers_4d, + substr(version,1,instr(version,'.',1,1)-1) p_vers_1d from (select version from v$instance); -col p_vers clear +col p_vers_4d clear +col p_vers_1d clear DECLARE - V_ORA_VER_MAJOR NUMBER; - V_ORA_VERSION VARCHAR2(20); + V_VERS_1D NUMBER := '&p_vers_1d.'; + V_VERS_4D VARCHAR2(20) := '&p_vers_4d.'; BEGIN - select substr(version,1,instr(version,'.',1,4)-1), - substr(version,1,instr(version,'.',1,1)-1) - into v_ora_version, - v_ora_ver_major - from (select '&P_VERS..0' version from dual); - IF v_ora_version = '12.1.0.1' THEN + IF V_VERS_4D = '12.1.0.1' THEN NULL; - ELSIF v_ora_version = '12.1.0.2' THEN + ELSIF V_VERS_4D = '12.1.0.2' THEN execute immediate 'alter session set exclude_seed_cdb_view=false'; - ELSIF v_ora_ver_major >= 12 THEN + ELSIF V_VERS_1D >= 12 THEN execute immediate 'alter session set "_exclude_seed_cdb_view"=false'; END IF; END; diff --git a/user_scripts/odbfcl/extract/load_custom.sql b/user_scripts/odbfcl/extract/load_custom.sql index 8b6bb7a..21ffa4f 100644 --- a/user_scripts/odbfcl/extract/load_custom.sql +++ b/user_scripts/odbfcl/extract/load_custom.sql @@ -1,5 +1,5 @@ DECLARE - VVERS VARCHAR2(20) := '&P_VERS.'; + V_VERS_1D NUMBER := '&P_VERS_1D.'; PROCEDURE RUN_INSERT (IN_TAB_NAME VARCHAR2, OUT_TAB_NAME VARCHAR2, IN_WHERE_CLAUSE_12 VARCHAR2 DEFAULT NULL, IN_WHERE_CLAUSE_11 VARCHAR2 DEFAULT NULL) AS @@ -9,7 +9,7 @@ DECLARE V_CDB_CLAUSE VARCHAR2(30); BEGIN - IF VVERS = '11.2.0.4' THEN + IF V_VERS_1D = 11 THEN V_CDB_CLAUSE := ''; else V_CDB_CLAUSE := ', CON_ID'; @@ -32,15 +32,15 @@ DECLARE V_SQL := V_SQL || V_INS_COLS || V_CDB_CLAUSE; - IF VVERS = '11.2.0.4' THEN + IF V_VERS_1D = 11 THEN V_SQL := V_SQL || ' FROM ' || IN_TAB_NAME; - ELSIF VVERS = '12.1.0.1' THEN + ELSIF V_VERS_1D = '12.1.0.1' THEN V_SQL := V_SQL || ' FROM CDB$VIEW("' || IN_TAB_NAME || '")'; ELSE V_SQL := V_SQL || ' FROM CONTAINERS(' || IN_TAB_NAME || ')'; END IF; - IF VVERS = '11.2.0.4' THEN + IF V_VERS_1D = 11 THEN IF IN_WHERE_CLAUSE_11 IS NOT NULL THEN V_SQL := V_SQL || ' WHERE ' || IN_WHERE_CLAUSE_11; END IF; @@ -57,7 +57,7 @@ DECLARE BEGIN DBMS_OUTPUT.ENABLE(NULL); - IF VVERS != '11.2.0.4' THEN + IF V_VERS_1D != 11 THEN RUN_INSERT ('AUDIT_UNIFIED_POLICIES','T_AUDIT_UNIFIED_POLICIES'); RUN_INSERT ('AUDIT_UNIFIED_ENABLED_POLICIES','T_AUD_UNIFIED_ENABLED_POLICIES'); RUN_INSERT ('AUDIT_UNIFIED_POLICY_COMMENTS','T_AUD_UNIFIED_POLICY_COMMENTS'); diff --git a/user_scripts/odbfcl/extract/load_database_vault.sql b/user_scripts/odbfcl/extract/load_database_vault.sql index fb594db..9709268 100644 --- a/user_scripts/odbfcl/extract/load_database_vault.sql +++ b/user_scripts/odbfcl/extract/load_database_vault.sql @@ -1,6 +1,7 @@ DECLARE - VVERS VARCHAR2(20) := '&P_VERS.'; - VUSER VARCHAR2(30) := '&v_username.'; + V_VERS_1D NUMBER := '&P_VERS_1D.'; + V_VERS_4D VARCHAR2(20) := '&P_VERS_4D.'; + V_USER VARCHAR2(30) := '&v_username.'; PROCEDURE RUN_INSERT (IN_TAB_NAME VARCHAR2, OUT_TAB_NAME VARCHAR2) @@ -11,7 +12,7 @@ DECLARE V_CDB_CLAUSE VARCHAR2(30); BEGIN - IF VVERS = '11.2.0.4' THEN + IF V_VERS_1D = 11 THEN V_CDB_CLAUSE := ''; else V_CDB_CLAUSE := ', CON_ID'; @@ -23,18 +24,18 @@ DECLARE from dba_tab_columns c1, dba_tab_columns c2 where c1.table_name = OUT_TAB_NAME and c2.table_name (+) = IN_TAB_NAME - and c1.owner = VUSER + and c1.owner = V_USER and c2.owner(+) = 'DVSYS' and c1.column_name = c2.column_name (+) and c1.column_name not in ('CON_ID'); - V_SQL := 'INSERT /*+ APPEND */ INTO ' || VUSER || '.' || OUT_TAB_NAME || '(' || V_TAB_COLS || V_CDB_CLAUSE || ') SELECT '; + V_SQL := 'INSERT /*+ APPEND */ INTO ' || V_USER || '.' || OUT_TAB_NAME || '(' || V_TAB_COLS || V_CDB_CLAUSE || ') SELECT '; V_SQL := V_SQL || V_INS_COLS || V_CDB_CLAUSE; - IF VVERS = '11.2.0.4' THEN + IF V_VERS_1D = 11 THEN V_SQL := V_SQL || ' FROM DVSYS.' || IN_TAB_NAME; - ELSIF VVERS = '12.1.0.1' THEN + ELSIF V_VERS_4D = '12.1.0.1' THEN V_SQL := V_SQL || ' FROM CDB$VIEW("DVSYS"."' || IN_TAB_NAME || '")'; ELSE V_SQL := V_SQL || ' FROM CONTAINERS(DVSYS.' || IN_TAB_NAME || ')'; diff --git a/user_scripts/odbfcl/extract/load_dba_cdb.sql b/user_scripts/odbfcl/extract/load_dba_cdb.sql index 4ec33a1..fee3b31 100644 --- a/user_scripts/odbfcl/extract/load_dba_cdb.sql +++ b/user_scripts/odbfcl/extract/load_dba_cdb.sql @@ -1,6 +1,6 @@ DECLARE - VVERS VARCHAR2(20) := '&P_VERS.'; - VUSER VARCHAR2(30) := '&V_USERNAME.'; + V_VERS_1D NUMBER := '&P_VERS_1D.'; + V_USER VARCHAR2(30) := '&V_USERNAME.'; PROCEDURE RUN_INSERT (IN_TAB_NAME VARCHAR2, IN_WHERE_CLAUSE_12 VARCHAR2 DEFAULT NULL, @@ -12,7 +12,7 @@ DECLARE V_SQL CLOB; V_OBJ_EXISTS NUMBER; BEGIN - IF VVERS = '11.2.0.4' THEN + IF V_VERS_1D = 11 THEN V_PREFIX := 'DBA_'; else V_PREFIX := 'CDB_'; @@ -34,17 +34,17 @@ DECLARE FROM DBA_TAB_COLUMNS C1, DBA_TAB_COLUMNS C2 WHERE C1.TABLE_NAME = 'T_' || IN_TAB_NAME AND C2.TABLE_NAME (+) = V_PREFIX || IN_TAB_NAME - AND C1.OWNER = VUSER + AND C1.OWNER = V_USER AND C2.OWNER(+) = 'SYS' AND C1.COLUMN_NAME = C2.COLUMN_NAME (+); - V_SQL := 'INSERT /*+ APPEND */ INTO ' || VUSER || '.T_' || IN_TAB_NAME || '(' || V_TAB_COLS || ') SELECT '; + V_SQL := 'INSERT /*+ APPEND */ INTO ' || V_USER || '.T_' || IN_TAB_NAME || '(' || V_TAB_COLS || ') SELECT '; V_SQL := V_SQL || V_INS_COLS; V_SQL := V_SQL || ' FROM ' || V_PREFIX || IN_TAB_NAME; - IF VVERS = '11.2.0.4' THEN + IF V_VERS_1D = 11 THEN IF IN_WHERE_CLAUSE_11 IS NOT NULL THEN V_SQL := V_SQL || ' WHERE ' || IN_WHERE_CLAUSE_11; END IF; diff --git a/user_scripts/odbfcl/extract/load_v_dollar.sql b/user_scripts/odbfcl/extract/load_v_dollar.sql index 7bfff45..508cec0 100644 --- a/user_scripts/odbfcl/extract/load_v_dollar.sql +++ b/user_scripts/odbfcl/extract/load_v_dollar.sql @@ -1,5 +1,5 @@ DECLARE - VVERS VARCHAR2(20) := '&P_VERS.'; + V_VERS_1D NUMBER := '&P_VERS_1D.'; PROCEDURE RUN_INSERT (OUT_TAB_NAME VARCHAR2, IN_TAB_NAME VARCHAR2, @@ -27,7 +27,7 @@ DECLARE V_SQL := V_SQL || ' FROM ' || IN_TAB_NAME; - IF VVERS = '11.2.0.4' THEN + IF V_VERS_1D = 11 THEN IF IN_WHERE_CLAUSE_11 IS NOT NULL THEN V_SQL := V_SQL || ' WHERE ' || IN_WHERE_CLAUSE_11; END IF; @@ -75,9 +75,9 @@ commit; DECLARE l_clob CLOB; - VVERS VARCHAR2(20) := '&P_VERS.'; + V_VERS_1D NUMBER := '&P_VERS_1D.'; BEGIN - IF VVERS = '11.2.0.4' THEN + IF V_VERS_1D = 11 THEN RETURN; END IF; $IF NOT DBMS_DB_VERSION.VER_LE_11 diff --git a/user_scripts/odbfcl/extract/load_x_dollar.sql b/user_scripts/odbfcl/extract/load_x_dollar.sql index 7e70a91..1991171 100644 --- a/user_scripts/odbfcl/extract/load_x_dollar.sql +++ b/user_scripts/odbfcl/extract/load_x_dollar.sql @@ -1,8 +1,8 @@ -@@underscore_parameters/load_underscore_&P_VERS..sql +@@underscore_parameters/load_underscore_&P_VERS_4D..sql -- -@@underscore_valid_values/load_underscore_vv_&P_VERS..sql +@@underscore_valid_values/load_underscore_vv_&P_VERS_4D..sql -- diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.3.sql b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.3.sql new file mode 100644 index 0000000..0b0672d --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.3.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 11.2.0.3 +-------------------------------------- + +-- The code is the same as 11.2.0.4 in V$FIXED_VIEW_DEFINITION +@@load_underscore_11.2.0.4.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.3.sql b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.3.sql new file mode 100644 index 0000000..0598d53 --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.3.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 11.2.0.3 +-------------------------------------- + +-- The code is the same as 11.2.0.4 in V$FIXED_VIEW_DEFINITION +@@load_underscore_vv_11.2.0.4.sql \ No newline at end of file From cafb376325c976983f3cf22ac94bd473fa56cc99 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 2 Feb 2024 15:38:52 -0300 Subject: [PATCH 136/229] Extract for 11.2.0.1 and 11.2.0.2 --- .../underscore_parameters/load_underscore_11.2.0.1.sql | 6 ++++++ .../underscore_parameters/load_underscore_11.2.0.2.sql | 6 ++++++ .../underscore_valid_values/load_underscore_vv_11.2.0.1.sql | 6 ++++++ .../underscore_valid_values/load_underscore_vv_11.2.0.2.sql | 6 ++++++ 4 files changed, 24 insertions(+) create mode 100644 user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.1.sql create mode 100644 user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.2.sql create mode 100644 user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.1.sql create mode 100644 user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.2.sql diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.1.sql b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.1.sql new file mode 100644 index 0000000..0653470 --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.1.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 11.2.0.1 +-------------------------------------- + +-- The code is the same as 11.2.0.4 in V$FIXED_VIEW_DEFINITION +@@load_underscore_11.2.0.4.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.2.sql b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.2.sql new file mode 100644 index 0000000..b621589 --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.2.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 11.2.0.2 +-------------------------------------- + +-- The code is the same as 11.2.0.4 in V$FIXED_VIEW_DEFINITION +@@load_underscore_11.2.0.4.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.1.sql b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.1.sql new file mode 100644 index 0000000..6ab58ed --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.1.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 11.2.0.1 +-------------------------------------- + +-- The code is the same as 11.2.0.4 in V$FIXED_VIEW_DEFINITION +@@load_underscore_vv_11.2.0.4.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.2.sql b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.2.sql new file mode 100644 index 0000000..2a2437c --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.2.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 11.2.0.2 +-------------------------------------- + +-- The code is the same as 11.2.0.4 in V$FIXED_VIEW_DEFINITION +@@load_underscore_vv_11.2.0.4.sql \ No newline at end of file From 6e5967f2c69b8b4eeee90010fc4886bf897261ad Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 2 Feb 2024 15:39:47 -0300 Subject: [PATCH 137/229] New Jan 2024 patches and fix 11.2.0.3 --- list_patches.yml | 149 ++++++++++++++++++++++++++--------------------- 1 file changed, 83 insertions(+), 66 deletions(-) diff --git a/list_patches.yml b/list_patches.yml index 4ad5685..2660bb7 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -8,74 +8,75 @@ list_1120X: # 11.2.0.1 - - { version : "11.2.0.1" , type : "PSU" , id : 1 , patch_number : 9352237 } - - { version : "11.2.0.1" , type : "PSU" , id : 2 , patch_number : 9654983 } - - { version : "11.2.0.1" , type : "PSU" , id : 3 , patch_number : 9952216 } - - { version : "11.2.0.1" , type : "PSU" , id : 4 , patch_number : 10248516 } - - { version : "11.2.0.1" , type : "PSU" , id : 5 , patch_number : 11724930 } - - { version : "11.2.0.1" , type : "PSU" , id : 6 , patch_number : 12419378 } - - { version : "11.2.0.1" , type : "CPU" , id : 1 , patch_number : 9369797 } - - { version : "11.2.0.1" , type : "CPU" , id : 2 , patch_number : 9655013 } - - { version : "11.2.0.1" , type : "CPU" , id : 3 , patch_number : 9952260 } - - { version : "11.2.0.1" , type : "CPU" , id : 4 , patch_number : 10249532 } - - { version : "11.2.0.1" , type : "CPU" , id : 5 , patch_number : 11724991 } - - { version : "11.2.0.1" , type : "CPU" , id : 6 , patch_number : 12419278 } + - { version : "11.2.0.1" , type : "PSU" , id : 1 , patch_number : 9352237 } + - { version : "11.2.0.1" , type : "PSU" , id : 2 , patch_number : 9654983 } + - { version : "11.2.0.1" , type : "PSU" , id : 3 , patch_number : 9952216 } + - { version : "11.2.0.1" , type : "PSU" , id : 4 , patch_number : 10248516 } + - { version : "11.2.0.1" , type : "PSU" , id : 5 , patch_number : 11724930 } + - { version : "11.2.0.1" , type : "PSU" , id : 6 , patch_number : 12419378 } + - { version : "11.2.0.1" , type : "CPU" , id : 1 , patch_number : 9369797 } + - { version : "11.2.0.1" , type : "CPU" , id : 2 , patch_number : 9655013 } + - { version : "11.2.0.1" , type : "CPU" , id : 3 , patch_number : 9952260 } + - { version : "11.2.0.1" , type : "CPU" , id : 4 , patch_number : 10249532 } + - { version : "11.2.0.1" , type : "CPU" , id : 5 , patch_number : 11724991 } + - { version : "11.2.0.1" , type : "CPU" , id : 6 , patch_number : 12419278 } # 11.2.0.2 - - { version : "11.2.0.2" , type : "PSU" , id : 1 , patch_number : 10248523 } - - { version : "11.2.0.2" , type : "PSU" , id : 2 , patch_number : 11724916 } - - { version : "11.2.0.2" , type : "PSU" , id : 3 , patch_number : 12419331 } - - { version : "11.2.0.2" , type : "PSU" , id : 4 , patch_number : 12827726 } - - { version : "11.2.0.2" , type : "PSU" , id : 5 , patch_number : 13343424 } - - { version : "11.2.0.2" , type : "PSU" , id : 6 , patch_number : 13696224 } - - { version : "11.2.0.2" , type : "PSU" , id : 7 , patch_number : 13923804 } - - { version : "11.2.0.2" , type : "PSU" , id : 8 , patch_number : 14275621 } - - { version : "11.2.0.2" , type : "PSU" , id : 9 , patch_number : 14727315 } - - { version : "11.2.0.2" , type : "PSU" , id : 10 , patch_number : 16056267 } - - { version : "11.2.0.2" , type : "PSU" , id : 11 , patch_number : 16619893 } - - { version : "11.2.0.2" , type : "PSU" , id : 12 , patch_number : 17082367 } -# - { version : "11.2.0.2" , type : "CPU" , id : 1 , patch_number : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED - - { version : "11.2.0.2" , type : "CPU" , id : 2 , patch_number : 11724984 } - - { version : "11.2.0.2" , type : "CPU" , id : 3 , patch_number : 12419321 } - - { version : "11.2.0.2" , type : "CPU" , id : 4 , patch_number : 12828071 } - - { version : "11.2.0.2" , type : "CPU" , id : 5 , patch_number : 13343244 } - - { version : "11.2.0.2" , type : "CPU" , id : 6 , patch_number : 13632725 } - - { version : "11.2.0.2" , type : "CPU" , id : 7 , patch_number : 14038791 } - - { version : "11.2.0.2" , type : "CPU" , id : 8 , patch_number : 14390377 } - - { version : "11.2.0.2" , type : "CPU" , id : 9 , patch_number : 14841437 } - - { version : "11.2.0.2" , type : "CPU" , id : 10 , patch_number : 16294412 } - - { version : "11.2.0.2" , type : "CPU" , id : 11 , patch_number : 16742100 } - - { version : "11.2.0.2" , type : "CPU" , id : 12 , patch_number : 17082375 } + - { version : "11.2.0.2" , type : "PSU" , id : 1 , patch_number : 10248523 } + - { version : "11.2.0.2" , type : "PSU" , id : 2 , patch_number : 11724916 } + - { version : "11.2.0.2" , type : "PSU" , id : 3 , patch_number : 12419331 } + - { version : "11.2.0.2" , type : "PSU" , id : 4 , patch_number : 12827726 } + - { version : "11.2.0.2" , type : "PSU" , id : 5 , patch_number : 13343424 } + - { version : "11.2.0.2" , type : "PSU" , id : 6 , patch_number : 13696224 } + - { version : "11.2.0.2" , type : "PSU" , id : 7 , patch_number : 13923804 } + - { version : "11.2.0.2" , type : "PSU" , id : 8 , patch_number : 14275621 } + - { version : "11.2.0.2" , type : "PSU" , id : 9 , patch_number : 14727315 } + - { version : "11.2.0.2" , type : "PSU" , id : 10 , patch_number : 16056267 } + - { version : "11.2.0.2" , type : "PSU" , id : 11 , patch_number : 16619893 } + - { version : "11.2.0.2" , type : "PSU" , id : 12 , patch_number : 17082367 } +# - { version : "11.2.0.2" , type : "CPU" , id : 1 , patch_number : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED + - { version : "11.2.0.2" , type : "CPU" , id : 2 , patch_number : 11724984 } + - { version : "11.2.0.2" , type : "CPU" , id : 3 , patch_number : 12419321 } + - { version : "11.2.0.2" , type : "CPU" , id : 4 , patch_number : 12828071 } + - { version : "11.2.0.2" , type : "CPU" , id : 5 , patch_number : 13343244 } + - { version : "11.2.0.2" , type : "CPU" , id : 6 , patch_number : 13632725 } + - { version : "11.2.0.2" , type : "CPU" , id : 7 , patch_number : 14038791 } + - { version : "11.2.0.2" , type : "CPU" , id : 8 , patch_number : 14390377 } + - { version : "11.2.0.2" , type : "CPU" , id : 9 , patch_number : 14841437 } + - { version : "11.2.0.2" , type : "CPU" , id : 10 , patch_number : 16294412 } + - { version : "11.2.0.2" , type : "CPU" , id : 11 , patch_number : 16742100 } + - { version : "11.2.0.2" , type : "CPU" , id : 12 , patch_number : 17082375 } # 11.2.0.3 - - { version : "11.2.0.3" , type : "PSU" , id : 1 , patch_number : 13343438 } - - { version : "11.2.0.3" , type : "PSU" , id : 2 , patch_number : 13696216 } - - { version : "11.2.0.3" , type : "PSU" , id : 3 , patch_number : 13923374 } - - { version : "11.2.0.3" , type : "PSU" , id : 4 , patch_number : 14275605 } - - { version : "11.2.0.3" , type : "PSU" , id : 5 , patch_number : 14727310 } - - { version : "11.2.0.3" , type : "PSU" , id : 6 , patch_number : 16056266 } - - { version : "11.2.0.3" , type : "PSU" , id : 7 , patch_number : 16619892 } - - { version : "11.2.0.3" , type : "PSU" , id : 8 , patch_number : 16902043 } - - { version : "11.2.0.3" , type : "PSU" , id : 9 , patch_number : 17540582 } - - { version : "11.2.0.3" , type : "PSU" , id : 10 , patch_number : 18031683 } - - { version : "11.2.0.3" , type : "PSU" , id : 11 , patch_number : 18522512 } - - { version : "11.2.0.3" , type : "PSU" , id : 12 , patch_number : 19121548 } - - { version : "11.2.0.3" , type : "PSU" , id : 13 , patch_number : 19769496 } - - { version : "11.2.0.3" , type : "PSU" , id : 14 , patch_number : 20299017 } - - { version : "11.2.0.3" , type : "PSU" , id : 15 , patch_number : 20760997 } - - { version : "11.2.0.3" , type : "CPU" , id : 1 , patch_number : 13466801 } - - { version : "11.2.0.3" , type : "CPU" , id : 2 , patch_number : 13632717 } - - { version : "11.2.0.3" , type : "CPU" , id : 3 , patch_number : 14038787 } - - { version : "11.2.0.3" , type : "CPU" , id : 4 , patch_number : 14390252 } - - { version : "11.2.0.3" , type : "CPU" , id : 5 , patch_number : 14841409 } - - { version : "11.2.0.3" , type : "CPU" , id : 6 , patch_number : 16294378 } - - { version : "11.2.0.3" , type : "CPU" , id : 7 , patch_number : 16742095 } - - { version : "11.2.0.3" , type : "CPU" , id : 8 , patch_number : 17082364 } - - { version : "11.2.0.3" , type : "CPU" , id : 9 , patch_number : 17478415 } - - { version : "11.2.0.3" , type : "CPU" , id : 10 , patch_number : 18139695 } - - { version : "11.2.0.3" , type : "CPU" , id : 11 , patch_number : 18681866 } - - { version : "11.2.0.3" , type : "CPU" , id : 12 , patch_number : 19271438 } - - { version : "11.2.0.3" , type : "CPU" , id : 13 , patch_number : 19854461 } - - { version : "11.2.0.3" , type : "CPU" , id : 14 , patch_number : 20299010 } - - { version : "11.2.0.3" , type : "CPU" , id : 15 , patch_number : 20803576 } + - { version : "11.2.0.3" , type : "BASE" , id : 0 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.11.2.0.3.tar.gz" } + - { version : "11.2.0.3" , type : "PSU" , id : 1 , patch_number : 13343438 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.3" , type : "PSU" , id : 2 , patch_number : 13696216 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.3" , type : "PSU" , id : 3 , patch_number : 13923374 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.3" , type : "PSU" , id : 4 , patch_number : 14275605 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.3" , type : "PSU" , id : 5 , patch_number : 14727310 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.3" , type : "PSU" , id : 6 , patch_number : 16056266 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.3" , type : "PSU" , id : 7 , patch_number : 16619892 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.3" , type : "PSU" , id : 8 , patch_number : 16902043 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.3" , type : "PSU" , id : 9 , patch_number : 17540582 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.3" , type : "PSU" , id : 10 , patch_number : 18031683 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.3" , type : "PSU" , id : 11 , patch_number : 18522512 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.3" , type : "PSU" , id : 12 , patch_number : 19121548 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.3" , type : "PSU" , id : 13 , patch_number : 19769496 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.3" , type : "PSU" , id : 14 , patch_number : 20299017 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.3" , type : "PSU" , id : 15 , patch_number : 20760997 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.3" , type : "CPU" , id : 1 , patch_number : 13466801 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.3" , type : "CPU" , id : 2 , patch_number : 13632717 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.3" , type : "CPU" , id : 3 , patch_number : 14038787 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.3" , type : "CPU" , id : 4 , patch_number : 14390252 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.3" , type : "CPU" , id : 5 , patch_number : 14841409 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.3" , type : "CPU" , id : 6 , patch_number : 16294378 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.3" , type : "CPU" , id : 7 , patch_number : 16742095 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.3" , type : "CPU" , id : 8 , patch_number : 17082364 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.3" , type : "CPU" , id : 9 , patch_number : 17478415 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.3" , type : "CPU" , id : 10 , patch_number : 18139695 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.3" , type : "CPU" , id : 11 , patch_number : 18681866 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.3" , type : "CPU" , id : 12 , patch_number : 19271438 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.3" , type : "CPU" , id : 13 , patch_number : 19854461 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.3" , type : "CPU" , id : 14 , patch_number : 20299010 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.3" , type : "CPU" , id : 15 , patch_number : 20803576 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } #################### ##### 11.2.0.4 ##### @@ -163,6 +164,7 @@ list_11204: - { type : "OJVM" , id : 230418 , patch_number : 35039831 } - { type : "OJVM" , id : 230718 , patch_number : 35349843 } - { type : "OJVM" , id : 231017 , patch_number : 35685663 } + - { type : "OJVM" , id : 240116 , patch_number : 35926733 } # 11.2.0.4 BP - { type : "BP" , id : 1 , patch_number : 17628025 , patch_folder : 17628006 } - { type : "BP" , id : 2 , patch_number : 17838803 , patch_folder : 17741631 } @@ -334,6 +336,7 @@ list_12102: - { type : "OJVM" , id : 230418 , patch_number : 35077439 } - { type : "OJVM" , id : 230718 , patch_number : 35354391 } - { type : "OJVM" , id : 231017 , patch_number : 35685666 } + - { type : "OJVM" , id : 240116 , patch_number : 35926723 } # 12.1.0.2 BP - { type : "BP" , id : 1 , patch_number : 19404326 , patch_folder : 19189240 } - { type : "BP" , id : 2 , patch_number : 19774304 , patch_folder : 19649591 } @@ -417,6 +420,7 @@ list_12201: - { type : "RU" , id : 230418 , patch_number : 35115783 } # PASSWORD PROTECTED - { type : "RU" , id : 230718 , patch_number : 35407080 } # PASSWORD PROTECTED - { type : "RU" , id : 231017 , patch_number : 35746058 } # PASSWORD PROTECTED + - { type : "RU" , id : 240116 , patch_number : 35966787 } # PASSWORD PROTECTED # 12.2.0.1 RUR - { type : "RUR" , id : 171017 , patch_number : 26518812 , base_ru : JUL2017 } - { type : "RUR" , id : 180116 , patch_number : 27013506 , base_ru : JUL2017 } @@ -470,6 +474,7 @@ list_12201: - { type : "OJVM" , id : 230418 , patch_number : 35058256 } # PASSWORD PROTECTED - { type : "OJVM" , id : 230718 , patch_number : 35348984 } # PASSWORD PROTECTED - { type : "OJVM" , id : 231017 , patch_number : 35685669 } # PASSWORD PROTECTED + - { type : "OJVM" , id : 240116 , patch_number : 35926712 } # PASSWORD PROTECTED #################### ##### 18.0.0.0 ##### @@ -504,6 +509,7 @@ list_18000: - { type : "RU" , id : 22 , patch_number : 35114260 } # NOT AVAILABLE TO DOWNLOAD - { type : "RU" , id : 23 , patch_number : 35411347 } # NOT AVAILABLE TO DOWNLOAD - { type : "RU" , id : 24 , patch_number : 35744266 } # NOT AVAILABLE TO DOWNLOAD + - { type : "RU" , id : 25 , patch_number : 35962880 } # NOT AVAILABLE TO DOWNLOAD # 18c RUR # - { type : "RUR" , id : 1 , patch_number : 28346593 , base_ru : '18.2' } # - { type : "RUR" , id : 2 , patch_number : 28601267 , base_ru : '18.2' } @@ -552,6 +558,7 @@ list_18000: - { type : "OJVM" , id : 230418 , patch_number : 35058238 } # NOT AVAILABLE TO DOWNLOAD # 18.22 - { type : "OJVM" , id : 230718 , patch_number : 35354394 } # NOT AVAILABLE TO DOWNLOAD # 18.23 - { type : "OJVM" , id : 231017 , patch_number : 35685672 } # NOT AVAILABLE TO DOWNLOAD # 18.24 + - { type : "OJVM" , id : 240116 , patch_number : 35926632 } # NOT AVAILABLE TO DOWNLOAD # 18.24 # No more updates on this one. @@ -583,6 +590,7 @@ list_19000: - { type : "RU" , id : 19 , patch_number : 35042068 } - { type : "RU" , id : 20 , patch_number : 35320081 } - { type : "RU" , id : 21 , patch_number : 35643107 } + - { type : "RU" , id : 22 , patch_number : 35943157 } # 19c RUR - { type : "RUR" , id : 1 , patch_number : 29799057 , base_ru : '19.3' } - { type : "RUR" , id : 2 , patch_number : 30087906 , base_ru : '19.3' } @@ -635,6 +643,12 @@ list_19000: - { type : "MRP" , id : 230815 , patch_number : 35656870 , base_ru : '19.20' , dep_type : 'RU' , dep_id : 20 , apply_method : "napply" } - { type : "MRP" , id : 230919 , patch_number : 35755640 , base_ru : '19.20' , dep_type : 'RU' , dep_id : 20 , apply_method : "napply" } - { type : "MRP" , id : 231017 , patch_number : 35870130 , base_ru : '19.20' , dep_type : 'RU' , dep_id : 20 , apply_method : "napply" } + - { type : "MRP" , id : 231121 , patch_number : 35972850 , base_ru : '19.20' , dep_type : 'RU' , dep_id : 20 , apply_method : "napply" } + - { type : "MRP" , id : 231219 , patch_number : 36062341 , base_ru : '19.20' , dep_type : 'RU' , dep_id : 20 , apply_method : "napply" } + - { type : "MRP" , id : 240116 , patch_number : 36155960 , base_ru : '19.20' , dep_type : 'RU' , dep_id : 20 , apply_method : "napply" } + - { type : "MRP" , id : 231121 , patch_number : 35972882 , base_ru : '19.21' , dep_type : 'RU' , dep_id : 21 , apply_method : "napply" } + - { type : "MRP" , id : 231219 , patch_number : 36062320 , base_ru : '19.21' , dep_type : 'RU' , dep_id : 21 , apply_method : "napply" } + - { type : "MRP" , id : 240116 , patch_number : 36155925 , base_ru : '19.21' , dep_type : 'RU' , dep_id : 21 , apply_method : "napply" } # 19c OJVM - { type : "OJVM" , id : 190416 , patch_number : 29548437 } - { type : "OJVM" , id : 190716 , patch_number : 29774421 } @@ -655,6 +669,7 @@ list_19000: - { type : "OJVM" , id : 230418 , patch_number : 35050341 } - { type : "OJVM" , id : 230718 , patch_number : 35354406 } - { type : "OJVM" , id : 231017 , patch_number : 35648110 } + - { type : "OJVM" , id : 240116 , patch_number : 35926646 } # 19c DPBP - { type : "DPBP" , id : 10 , patch_number : 32583144 , dep_type : 'RU' , dep_id : 10 } - { type : "DPBP" , id : 11 , patch_number : 32958059 , dep_type : 'RU' , dep_id : 11 } @@ -668,6 +683,7 @@ list_19000: - { type : "DPBP" , id : 19 , patch_number : 35261302 , dep_type : 'RU' , dep_id : 19 } - { type : "DPBP" , id : 20 , patch_number : 35512813 , dep_type : 'RU' , dep_id : 20 } - { type : "DPBP" , id : 21 , patch_number : 35787077 , dep_type : 'RU' , dep_id : 21 } + - { type : "DPBP" , id : 22 , patch_number : 36092868 , dep_type : 'RU' , dep_id : 22 } #################### ##### 21.0.0.0 ##### @@ -684,6 +700,7 @@ list_21000: - { type : "RU" , id : 10 , patch_number : 35134934 } - { type : "RU" , id : 11 , patch_number : 35428978 } - { type : "RU" , id : 12 , patch_number : 35740258 } + - { type : "RU" , id : 13 , patch_number : 36041222 } #################### ##### 23.0.0.0 ##### From 934e32045a09910d6723e29a37168a9a2584431f Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 2 Feb 2024 15:41:07 -0300 Subject: [PATCH 138/229] Update list_versions.yml --- list_versions.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/list_versions.yml b/list_versions.yml index ddb855f..16bb49a 100644 --- a/list_versions.yml +++ b/list_versions.yml @@ -7,6 +7,7 @@ # IP Address: For local SSH connection. list_versions: + - { id : "11.2.0.3" , patch_list : "list_1120X" , main_file : "patch_main_11g.yml" , opatch_file : "p6880880_112000_Linux-x86-64.zip" } - { id : "11.2.0.4" , patch_list : "list_11204" , main_file : "patch_main_11g.yml" , opatch_file : "p6880880_112000_Linux-x86-64.zip" } - { id : "12.1.0.1" , patch_list : "list_12101" , main_file : "patch_main.yml" , opatch_file : "p6880880_210000_Linux-x86-64.zip" } - { id : "12.1.0.2" , patch_list : "list_12102" , main_file : "patch_main.yml" , opatch_file : "p6880880_210000_Linux-x86-64.zip" } @@ -26,11 +27,12 @@ list_info_vbox: - { id : "21.0.0.0" , vmachine : "Oracle Linux 8" , base_snap : "21.0.0.0 Ready" , ip : "xxx" } list_info_oci: - - { id : "11.2.0.4" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" } - - { id : "12.1.0.1" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" } - - { id : "12.1.0.2" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" } - - { id : "12.2.0.1" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" } - - { id : "18.0.0.0" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" , out_of_box_ru : 3 } - - { id : "19.0.0.0" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" , out_of_box_ru : 3 } - - { id : "21.0.0.0" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" , out_of_box_ru : 3 } - - { id : "23.0.0.0" , oci_instance_id : "ocid1.instance.oc1.iad.xxx" , base_snap : "base" , out_of_box_ru : null } + - { id : "11.2.0.3" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } + - { id : "11.2.0.4" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" } + - { id : "12.1.0.1" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" } + - { id : "12.1.0.2" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" } + - { id : "12.2.0.1" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" } + - { id : "18.0.0.0" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : 3 } + - { id : "19.0.0.0" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : 3 } + - { id : "21.0.0.0" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : 3 } + - { id : "23.0.0.0" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } From 49e1b7e24b3b6a1c0bf8f75fd6fcca0d4e208b79 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 2 Feb 2024 15:46:21 -0300 Subject: [PATCH 139/229] Add full 11.2.0.3 support --- loader.yml | 3 ++ loader_adb.yml | 3 ++ main.yml | 3 ++ set_version.yml | 4 +- tasks/impdp_file.yml | 4 +- tasks/main_PSU_BP.yml | 8 +++- tasks/main_RU_RUR.yml | 14 +++--- tasks/main_loader_adb.yml | 14 +++--- tasks/main_loader_manual.yml | 2 +- tasks/patch_main_11g.yml | 82 +++++++++++++++++++++++++++++++++--- tasks/setup_database.yml | 6 +-- 11 files changed, 113 insertions(+), 30 deletions(-) diff --git a/loader.yml b/loader.yml index db6425f..0160302 100644 --- a/loader.yml +++ b/loader.yml @@ -34,6 +34,9 @@ tasks: + - include: tasks/main_loader.yml db_version="11.2.0.3" + when: param_version is undefined or param_version == "11.2.0.3" + - include: tasks/main_loader.yml db_version="11.2.0.4" when: param_version is undefined or param_version == "11.2.0.4" diff --git a/loader_adb.yml b/loader_adb.yml index b07ffed..512fce4 100644 --- a/loader_adb.yml +++ b/loader_adb.yml @@ -35,6 +35,9 @@ tasks: + - include: tasks/main_loader_adb.yml db_version="11.2.0.3" + when: param_version is undefined or param_version == "11.2.0.3" + - include: tasks/main_loader_adb.yml db_version="11.2.0.4" when: param_version is undefined or param_version == "11.2.0.4" diff --git a/main.yml b/main.yml index 7981a51..22f74fa 100644 --- a/main.yml +++ b/main.yml @@ -41,6 +41,9 @@ - import_tasks: tasks/config_checks.yml - import_tasks: tasks/setup_env.yml + - include: tasks/main_PSU_BP.yml db_version="11.2.0.3" + when: param_version is undefined or param_version == "11.2.0.3" + - include: tasks/main_PSU_BP.yml db_version="11.2.0.4" when: param_version is undefined or param_version == "11.2.0.4" diff --git a/set_version.yml b/set_version.yml index a2f756d..d6cfc16 100644 --- a/set_version.yml +++ b/set_version.yml @@ -51,7 +51,7 @@ when: param_version is undefined or param_type is undefined or param_patch is undefined - include: tasks/main_PSU_BP.yml db_version="{{ param_version }}" - when: param_version == "11.2.0.4" or param_version == "12.1.0.1" or param_version == "12.1.0.2" + when: param_version == "11.2.0.3" or param_version == "11.2.0.4" or param_version == "12.1.0.1" or param_version == "12.1.0.2" - include: tasks/main_RU_RUR.yml db_version="{{ param_version }}" - when: not(param_version == "11.2.0.4" or param_version == "12.1.0.1" or param_version == "12.1.0.2") + when: not(param_version == "11.2.0.3" or param_version == "11.2.0.4" or param_version == "12.1.0.1" or param_version == "12.1.0.2") diff --git a/tasks/impdp_file.yml b/tasks/impdp_file.yml index b81c20b..22a4bf5 100644 --- a/tasks/impdp_file.yml +++ b/tasks/impdp_file.yml @@ -29,7 +29,7 @@ become: true become_user: oracle delegate_to: "{{ vm_ip_address }}" - when: db_version == "11.2.0.4" and dump_user != dump_user_int + when: (db_version == "11.2.0.3" or db_version == "11.2.0.4") and dump_user != dump_user_int - name: Import Database Tables shell: | @@ -40,7 +40,7 @@ become: true become_user: oracle delegate_to: "{{ vm_ip_address }}" - when: db_version != "11.2.0.4" + when: db_version != "11.2.0.3" and db_version != "11.2.0.4" - name : "Remove file {{ dump_file_prefix }}.dmp" file: diff --git a/tasks/main_PSU_BP.yml b/tasks/main_PSU_BP.yml index 5d45797..7c778ef 100644 --- a/tasks/main_PSU_BP.yml +++ b/tasks/main_PSU_BP.yml @@ -5,6 +5,7 @@ patch_file: "{{ item.main_file }}" patch_list: "{{ item.patch_list }}" opatch_file: "{{ item.opatch_file }}" +# db_version_1d: "{{ db_version.split(".")[0] }}" with_items: "{{ list_versions }}" when: item.id == db_version @@ -20,6 +21,7 @@ set_fact: oci_instance_id: "{{ item.oci_instance_id }}" patch_base: "{{ item.base_snap }}" + out_of_box_id: "{{ item.out_of_box_id | default(-1, true) }}" with_items: "{{ list_info_oci }}" when: item.id == db_version and oci_mode @@ -66,6 +68,7 @@ vars: patch : { type : BASE , id : 0, patch_number : 0 } when: + - (out_of_box_id | float) != -1 - 0 == (param_patch | float) or param_patch == -1 - 0 >= (param_patch_from | float) or param_patch_from == -1 - 0 <= (param_patch_to | float) or param_patch_to == -1 @@ -77,12 +80,13 @@ loop_var: patch label: "{{ patch.id }}" when: - - patch.type == "PSU" + - patch.type == "PSU" or patch.type == "CPU" or patch.type == "BASE" - patch.id == (param_patch | float) or param_patch == -1 - patch.id >= (param_patch_from | float) or param_patch_from == -1 - patch.id <= (param_patch_to | float) or param_patch_to == -1 + - patch.version == db_version - when: param_type is undefined or param_type == "PSU" + when: param_type is undefined or param_type == "PSU" or param_type == "CPU" or param_type == "BASE" ### OJVM - block: diff --git a/tasks/main_RU_RUR.yml b/tasks/main_RU_RUR.yml index d30530e..31f33fe 100644 --- a/tasks/main_RU_RUR.yml +++ b/tasks/main_RU_RUR.yml @@ -20,7 +20,7 @@ set_fact: oci_instance_id: "{{ item.oci_instance_id }}" patch_base: "{{ item.base_snap }}" - out_of_box_ru: "{{ item.out_of_box_ru | default(-1, true) }}" + out_of_box_id: "{{ item.out_of_box_id | default(-1, true) }}" with_items: "{{ list_info_oci }}" when: item.id == db_version and oci_mode @@ -65,12 +65,12 @@ # Execute for base release - include: "{{ patch_file }}" vars: - patch : { type : BASE , id : "{{ out_of_box_ru }}" , patch_number : 0 } + patch : { type : BASE , id : "{{ out_of_box_id }}" , patch_number : 0 } when: - - (out_of_box_ru | float) != -1 - - (out_of_box_ru | float) == (param_patch | float) or param_patch == -1 - - (out_of_box_ru | float) >= (param_patch_from | float) or param_patch_from == -1 - - (out_of_box_ru | float) <= (param_patch_to | float) or param_patch_to == -1 + - (out_of_box_id | float) != -1 + - (out_of_box_id | float) == (param_patch | float) or param_patch == -1 + - (out_of_box_id | float) >= (param_patch_from | float) or param_patch_from == -1 + - (out_of_box_id | float) <= (param_patch_to | float) or param_patch_to == -1 # Execute for every RU - include: "{{ patch_file }}" @@ -83,7 +83,7 @@ - patch.id == (param_patch | float) or param_patch == -1 - patch.id >= (param_patch_from | float) or param_patch_from == -1 - patch.id <= (param_patch_to | float) or param_patch_to == -1 - - patch.id > (out_of_box_ru | float) + - patch.id > (out_of_box_id | float) when: param_type is undefined or param_type == "RU" diff --git a/tasks/main_loader_adb.yml b/tasks/main_loader_adb.yml index 54bea94..6b0fbf9 100644 --- a/tasks/main_loader_adb.yml +++ b/tasks/main_loader_adb.yml @@ -8,7 +8,7 @@ - name : Define Cloud params set_fact: - out_of_box_ru: "{{ item.out_of_box_ru | default(-1, true) }}" + out_of_box_id: "{{ item.out_of_box_id | default(-1, true) }}" with_items: "{{ list_info_oci }}" when: item.id == db_version @@ -37,12 +37,12 @@ # Execute for base release if there is at least 1 RU for that version - include: "impdp_file_adb.yml" vars: - patch : { type : BASE , id : "{{ out_of_box_ru }}" , patch_number : 0 } + patch : { type : BASE , id : "{{ out_of_box_id }}" , patch_number : 0 } when: - - (out_of_box_ru | float) != -1 - - (out_of_box_ru | float) == (param_patch | float) or param_patch == -1 - - (out_of_box_ru | float) >= (param_patch_from | float) or param_patch_from == -1 - - (out_of_box_ru | float) <= (param_patch_to | float) or param_patch_to == -1 + - (out_of_box_id | float) != -1 + - (out_of_box_id | float) == (param_patch | float) or param_patch == -1 + - (out_of_box_id | float) >= (param_patch_from | float) or param_patch_from == -1 + - (out_of_box_id | float) <= (param_patch_to | float) or param_patch_to == -1 - param_type is undefined or param_type == "RU" ############################### @@ -57,5 +57,5 @@ - patch.id == (param_patch | float) or param_patch == -1 - patch.id >= (param_patch_from | float) or param_patch_from == -1 - patch.id <= (param_patch_to | float) or param_patch_to == -1 - - patch.id > (out_of_box_ru | float) or patch.type != "RU" # When RU, skip patch.id lower or equal to out_of_box_ru + - patch.id > (out_of_box_id | float) or patch.type != "RU" # When RU, skip patch.id lower or equal to out_of_box_id - param_type is undefined or param_type == patch.type \ No newline at end of file diff --git a/tasks/main_loader_manual.yml b/tasks/main_loader_manual.yml index 00d1941..2ebe571 100644 --- a/tasks/main_loader_manual.yml +++ b/tasks/main_loader_manual.yml @@ -162,7 +162,7 @@ - name : Define Cloud params set_fact: - out_of_box_ru: "{{ item.out_of_box_ru | default(-1, true) }}" + out_of_box_id: "{{ item.out_of_box_id | default(-1, true) }}" with_items: "{{ list_info_oci }}" when: item.id == db_version diff --git a/tasks/patch_main_11g.yml b/tasks/patch_main_11g.yml index 1878fdd..f3dce4a 100644 --- a/tasks/patch_main_11g.yml +++ b/tasks/patch_main_11g.yml @@ -3,31 +3,62 @@ - block: + # If needs to perform patch actions - block: # Stop the database - include: run_sql.yml vars: sql_param : { file : "shutdown.sql" , folder : "patch_sql" , task_action : "Stop Database for OPatch" } + when: not oci_mode or patch.dep_type is defined + # When patch has a dependency, if the dependency is loaded running the full patch process instead of loading from lvm, the DB will be left online. + + ## APPLY ## - name: Run OPatch shell: | - export ORACLE_HOME ORACLE_SID - ./opatch apply -silent {{ VM_folder }}/{{ patch.patch_number }} -ocmrf {{ VM_folder }}/ocm.rsp + export ORACLE_HOME ORACLE_SID + ./opatch apply -silent {{ VM_folder }}/{{ patch.patch_number }} -ocmrf {{ VM_folder }}/ocm.rsp environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" args: chdir: "{{ dbhome_locl }}/OPatch" - register: shell_output + register: tmp_shell_output become: true become_user: oracle + when: patch.apply_method is not defined or patch.apply_method == "opatch" delegate_to: "{{ vm_ip_address }}" - + + # Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" + - set_fact: shell_output="{{tmp_shell_output}}" + when: tmp_shell_output is not skipped + + ## NAPPLY ## + + - name: Run OPatch/opatch NAPPLY + shell: | + export ORACLE_HOME ORACLE_SID + ./opatch napply -silent {{ VM_folder }}/{{ patch.patch_number }} -ocmrf {{ VM_folder }}/ocm.rsp + environment: + ORACLE_HOME: "{{ dbhome_locl }}" + ORACLE_SID: "{{ mysid }}" + args: + chdir: "{{ dbhome_locl }}/OPatch" + register: tmp_shell_output + become: true + become_user: oracle + when: patch.apply_method is defined and patch.apply_method == "napply" + delegate_to: "{{ vm_ip_address }}" + + # Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" + - set_fact: shell_output="{{tmp_shell_output}}" + when: tmp_shell_output is not skipped + - name: Opatch Output debug: msg="{{ shell_output.stdout_lines }}" when: shell_output.stdout_lines is defined - + - name: Disable Database Vault shell: | {{ dbhome_locl }}/bin/chopt disable dv @@ -55,7 +86,13 @@ vars: sql_param : { file : "applySQLPatch.sql" , folder : "patch_sql" , task_action : "Apply Patch" , params : "exa" } when: patch.type == "BP" - + + # Apply patch changes on DB (if CPU) + - include: run_sql.yml + vars: + sql_param : { file : "applySQLPatch.sql" , folder : "patch_sql" , task_action : "Apply Patch" , params : "cpu" } + when: patch.type == "CPU" + # When the SQL Patch is for OJVM - block: @@ -95,6 +132,39 @@ when: perform_patch_actions + # If apply method is UNTAR + - block: + + # Stop the database + - include: run_sql.yml + vars: + sql_param : { file : "shutdown.sql" , folder : "patch_sql" , task_action : "Stop Database for OPatch" } + when: not oci_mode or patch.dep_type is defined + # When patch has a dependency, if the dependency is loaded running the full patch process instead of loading from lvm, the DB will be left online. + + ## TAR ## + + - name: UNTAR full Oracle + shell: | + rm -rf /u01/* + tar -xzf {{ patch.apply_file }} + args: + chdir: "/" + register: tmp_shell_output + become: true + become_user: root + delegate_to: "{{ vm_ip_address }}" + + # Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" + - set_fact: shell_output="{{tmp_shell_output}}" + when: tmp_shell_output is not skipped + + - name: TAR Output + debug: msg="{{ shell_output.stdout_lines }}" + when: shell_output.stdout_lines is defined + + when: patch.apply_method is defined and patch.apply_method == "tar" + # This start is only required if database was never stopped. - include: run_sql.yml vars: diff --git a/tasks/setup_database.yml b/tasks/setup_database.yml index a501114..64f27c7 100644 --- a/tasks/setup_database.yml +++ b/tasks/setup_database.yml @@ -35,7 +35,7 @@ - name : Print Database Vault value debug: msg="Database Vault Enabled - {{ dbvault_enabled }}" - when: db_version == "11.2.0.4" + when: db_version == "11.2.0.3" or db_version == "11.2.0.4" ### Check if CDB @@ -98,13 +98,13 @@ set_fact: db_start_retried: false - when: db_version != "11.2.0.4" + when: db_version != "11.2.0.3" and db_version != "11.2.0.4" - name : Define CDB variable set_fact: db_iscdb: false - when: db_version == "11.2.0.4" + when: db_version == "11.2.0.3" or db_version == "11.2.0.4" ### Adjust dump_user_int based on database type and provided value. From 98aa4d87343c02e0dc12095ee58f496d2bbaf14f Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 8 Feb 2024 13:46:29 -0300 Subject: [PATCH 140/229] Add 11.1.0.6 and 11.1.0.7 support --- README.md | 5 +++ loader.yml | 16 +++++++- loader_adb.yml | 16 +++++++- main.yml | 16 +++++++- set_version.yml | 16 ++++---- tasks/impdp_file.yml | 6 ++- tasks/lvm_reload.yml | 40 +++++++++++-------- tasks/main_PSU_BP.yml | 4 +- tasks/prepare_dependency.yml | 1 + tasks/setup_database.yml | 15 ++++--- .../odbfcl/adb_load_bugs_fixed/bugsGet.sh | 6 +-- user_scripts/odbfcl/extract/load_custom.sql | 39 +++++++++++++----- .../odbfcl/extract/load_database_vault.sql | 39 +++++++++++++----- user_scripts/odbfcl/extract/load_dba_cdb.sql | 18 +++++++++ user_scripts/odbfcl/extract/load_v_dollar.sql | 36 ++++++++++++----- .../load_underscore_11.1.0.6.sql | 6 +++ .../load_underscore_11.1.0.7.sql | 6 +++ .../load_underscore_vv_11.1.0.6.sql | 6 +++ .../load_underscore_vv_11.1.0.7.sql | 6 +++ 19 files changed, 226 insertions(+), 71 deletions(-) create mode 100644 user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.1.0.6.sql create mode 100644 user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.1.0.7.sql create mode 100644 user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.1.0.6.sql create mode 100644 user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.1.0.7.sql diff --git a/README.md b/README.md index 01cd1fc..0af54d2 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,11 @@ Using VirtualBox VM snapshots, the playbook will loop over a list of the availab The playbook was tested and is currently working for all PSUs, OJVM PSUs, Bundle Patches, RUs, RURs and MRPs for the following versions: +- 11.1.0.6 +- 11.1.0.7 +- 11.2.0.1 +- 11.2.0.2 +- 11.2.0.3 - 11.2.0.4 - 12.1.0.1 - 12.1.0.2 diff --git a/loader.yml b/loader.yml index 0160302..7348172 100644 --- a/loader.yml +++ b/loader.yml @@ -34,11 +34,23 @@ tasks: + - include: tasks/main_loader.yml db_version="11.1.0.6" + when: param_version is undefined or param_version == "11.1.0.6" or param_version == "11.1" + + - include: tasks/main_loader.yml db_version="11.1.0.7" + when: param_version is undefined or param_version == "11.1.0.7" or param_version == "11.1" + + - include: tasks/main_loader.yml db_version="11.2.0.1" + when: param_version is undefined or param_version == "11.2.0.1" or param_version == "11.2" + + - include: tasks/main_loader.yml db_version="11.2.0.2" + when: param_version is undefined or param_version == "11.2.0.2" or param_version == "11.2" + - include: tasks/main_loader.yml db_version="11.2.0.3" - when: param_version is undefined or param_version == "11.2.0.3" + when: param_version is undefined or param_version == "11.2.0.3" or param_version == "11.2" - include: tasks/main_loader.yml db_version="11.2.0.4" - when: param_version is undefined or param_version == "11.2.0.4" + when: param_version is undefined or param_version == "11.2.0.4" or param_version == "11.2" - include: tasks/main_loader.yml db_version="12.1.0.1" when: param_version is undefined or param_version == "12.1.0.1" diff --git a/loader_adb.yml b/loader_adb.yml index 512fce4..df0089b 100644 --- a/loader_adb.yml +++ b/loader_adb.yml @@ -35,11 +35,23 @@ tasks: + - include: tasks/main_loader_adb.yml db_version="11.1.0.6" + when: param_version is undefined or param_version == "11.1.0.6" or param_version == "11.1" + + - include: tasks/main_loader_adb.yml db_version="11.1.0.7" + when: param_version is undefined or param_version == "11.1.0.7" or param_version == "11.1" + + - include: tasks/main_loader_adb.yml db_version="11.2.0.1" + when: param_version is undefined or param_version == "11.2.0.1" or param_version == "11.2" + + - include: tasks/main_loader_adb.yml db_version="11.2.0.2" + when: param_version is undefined or param_version == "11.2.0.2" or param_version == "11.2" + - include: tasks/main_loader_adb.yml db_version="11.2.0.3" - when: param_version is undefined or param_version == "11.2.0.3" + when: param_version is undefined or param_version == "11.2.0.3" or param_version == "11.2" - include: tasks/main_loader_adb.yml db_version="11.2.0.4" - when: param_version is undefined or param_version == "11.2.0.4" + when: param_version is undefined or param_version == "11.2.0.4" or param_version == "11.2" - include: tasks/main_loader_adb.yml db_version="12.1.0.1" when: param_version is undefined or param_version == "12.1.0.1" diff --git a/main.yml b/main.yml index 22f74fa..0601c72 100644 --- a/main.yml +++ b/main.yml @@ -41,11 +41,23 @@ - import_tasks: tasks/config_checks.yml - import_tasks: tasks/setup_env.yml + - include: tasks/main_PSU_BP.yml db_version="11.1.0.6" + when: param_version is undefined or param_version == "11.1.0.6" or param_version == "11.1" + + - include: tasks/main_PSU_BP.yml db_version="11.1.0.7" + when: param_version is undefined or param_version == "11.1.0.7" or param_version == "11.1" + + - include: tasks/main_PSU_BP.yml db_version="11.2.0.1" + when: param_version is undefined or param_version == "11.2.0.1" or param_version == "11.2" + + - include: tasks/main_PSU_BP.yml db_version="11.2.0.2" + when: param_version is undefined or param_version == "11.2.0.2" or param_version == "11.2" + - include: tasks/main_PSU_BP.yml db_version="11.2.0.3" - when: param_version is undefined or param_version == "11.2.0.3" + when: param_version is undefined or param_version == "11.2.0.3" or param_version == "11.2" - include: tasks/main_PSU_BP.yml db_version="11.2.0.4" - when: param_version is undefined or param_version == "11.2.0.4" + when: param_version is undefined or param_version == "11.2.0.4" or param_version == "11.2" - include: tasks/main_PSU_BP.yml db_version="12.1.0.1" when: param_version is undefined or param_version == "12.1.0.1" diff --git a/set_version.yml b/set_version.yml index d6cfc16..12f4ed3 100644 --- a/set_version.yml +++ b/set_version.yml @@ -32,6 +32,11 @@ tasks: + - name: Variables not provided + fail: + msg: "Variables param_version / param_type / param_patch must be defined." + when: param_version is undefined or param_type is undefined or param_patch is undefined + - include_vars: config_vbox.yml when: not oci_mode @@ -45,13 +50,10 @@ skip_dump_exists: false only_deploy_patch: true - - name: Variables not provided - fail: - msg: "Variables param_version / param_type / param_patch must be defined." - when: param_version is undefined or param_type is undefined or param_patch is undefined - - include: tasks/main_PSU_BP.yml db_version="{{ param_version }}" - when: param_version == "11.2.0.3" or param_version == "11.2.0.4" or param_version == "12.1.0.1" or param_version == "12.1.0.2" +# when: param_version == "11.2.0.2" or param_version == "11.2.0.3" or param_version == "11.2.0.4" or param_version == "12.1.0.1" or param_version == "12.1.0.2" + when: ( param_version | regex_replace('^([^\.]+).*','\\1') | int ) <= 11 or param_version == "12.1.0.1" or param_version == "12.1.0.2" - include: tasks/main_RU_RUR.yml db_version="{{ param_version }}" - when: not(param_version == "11.2.0.3" or param_version == "11.2.0.4" or param_version == "12.1.0.1" or param_version == "12.1.0.2") +# when: not(param_version == "11.2.0.2" or param_version == "11.2.0.3" or param_version == "11.2.0.4" or param_version == "12.1.0.1" or param_version == "12.1.0.2") + when: not( ( param_version | regex_replace('^(^[\.]+).*','\\1') | int ) <= 11 or param_version == "12.1.0.1" or param_version == "12.1.0.2" ) \ No newline at end of file diff --git a/tasks/impdp_file.yml b/tasks/impdp_file.yml index 22a4bf5..fade863 100644 --- a/tasks/impdp_file.yml +++ b/tasks/impdp_file.yml @@ -29,7 +29,8 @@ become: true become_user: oracle delegate_to: "{{ vm_ip_address }}" - when: (db_version == "11.2.0.3" or db_version == "11.2.0.4") and dump_user != dump_user_int +# when: (db_version == "11.2.0.2" or db_version == "11.2.0.3" or db_version == "11.2.0.4") and dump_user != dump_user_int + when: ( db_version | regex_replace('^([^\.]+).*','\\1') | int ) <= 11 and dump_user != dump_user_int - name: Import Database Tables shell: | @@ -40,7 +41,8 @@ become: true become_user: oracle delegate_to: "{{ vm_ip_address }}" - when: db_version != "11.2.0.3" and db_version != "11.2.0.4" +# when: db_version != "11.2.0.2" and db_version != "11.2.0.3" and db_version != "11.2.0.4" + when: ( db_version | regex_replace('^([^\.]+).*','\\1') | int ) > 11 - name : "Remove file {{ dump_file_prefix }}.dmp" file: diff --git a/tasks/lvm_reload.yml b/tasks/lvm_reload.yml index b44452f..8d202a9 100644 --- a/tasks/lvm_reload.yml +++ b/tasks/lvm_reload.yml @@ -1,6 +1,7 @@ - name: "Load base snapshot {{ vm_snapshot }}" shell: | set -e -x + export PATH=$PATH:/sbin:/usr/sbin v_snapshot="{{ vm_snapshot }}" v_disk="/dev/mapper/vg_u01-lv_u01" # Kill all oracle sessions @@ -19,22 +20,29 @@ sleep 5 lvchange -a n ${v_disk} -f fi - # Restore target snapshot - lvconvert --merge -i 1 -v ${v_disk}_${v_snapshot} - lvchange -a n ${v_disk} - lvchange -a y ${v_disk} - # Wait until snapshot is ready - while : - do - if ! lvs -a | grep lv_u01_${v_snapshot} - then - break - fi - dmsetup status ${v_disk} - sleep 1 - done - v_size=$(lvs --noheadings -o seg_size ${v_disk}) - lvcreate --size ${v_size} --snapshot --name lv_u01_${v_snapshot} ${v_disk} + if grep -q 'release 5.' /etc/oracle-release + then + # There is no merge option on OL5, so we replace the current one with the last backup. + lvchange -a y ${v_disk} + dd if=${v_disk}_${v_snapshot} of=${v_disk} bs=8M iflag=direct oflag=direct + else + # Restore target snapshot + lvconvert --merge -i 1 -v ${v_disk}_${v_snapshot} + lvchange -a n ${v_disk} + lvchange -a y ${v_disk} + # Wait until snapshot is ready + while : + do + if ! lvs -a | grep lv_u01_${v_snapshot} + then + break + fi + dmsetup status ${v_disk} + sleep 1 + done + v_size=$(lvs --noheadings -o seg_size ${v_disk}) + lvcreate --size ${v_size} --snapshot --name lv_u01_${v_snapshot} ${v_disk} + fi mount /u01 || true mount | grep -q -F " /u01 " become: true diff --git a/tasks/main_PSU_BP.yml b/tasks/main_PSU_BP.yml index 7c778ef..b4ebc04 100644 --- a/tasks/main_PSU_BP.yml +++ b/tasks/main_PSU_BP.yml @@ -80,11 +80,11 @@ loop_var: patch label: "{{ patch.id }}" when: - - patch.type == "PSU" or patch.type == "CPU" or patch.type == "BASE" + - (param_type is undefined and (patch.type == "PSU" or patch.type == "CPU" or patch.type == "BASE")) or patch.type == param_type - patch.id == (param_patch | float) or param_patch == -1 - patch.id >= (param_patch_from | float) or param_patch_from == -1 - patch.id <= (param_patch_to | float) or param_patch_to == -1 - - patch.version == db_version + - (patch.version | default(db_version)) == db_version when: param_type is undefined or param_type == "PSU" or param_type == "CPU" or param_type == "BASE" diff --git a/tasks/prepare_dependency.yml b/tasks/prepare_dependency.yml index e09e5a6..7547d0e 100644 --- a/tasks/prepare_dependency.yml +++ b/tasks/prepare_dependency.yml @@ -30,6 +30,7 @@ loop_var: patch label: "{{ patch.id }}" when: + - (patch.version | default(db_version)) == (bkp_patch.version | default(db_version)) - patch.type == bkp_patch.dep_type - patch.id == bkp_patch.dep_id diff --git a/tasks/setup_database.yml b/tasks/setup_database.yml index 64f27c7..d72f927 100644 --- a/tasks/setup_database.yml +++ b/tasks/setup_database.yml @@ -22,7 +22,7 @@ src: files/ocm.rsp dest: "{{ shared_folder }}" mode: u=rw,g=r,o=r - + - name: Check if Database Vault is enabled shell: 'ar -t {{dbhome_locl}}/rdbms/lib/libknlopt.a | grep -q kzvidv.o && echo true || echo false' register: dbvaultoutput @@ -35,7 +35,8 @@ - name : Print Database Vault value debug: msg="Database Vault Enabled - {{ dbvault_enabled }}" - when: db_version == "11.2.0.3" or db_version == "11.2.0.4" +# when: db_version == "11.2.0.2" or db_version == "11.2.0.3" or db_version == "11.2.0.4" + when: ( db_version | regex_replace('^([^\.]+).*','\\1') | int ) <= 11 ### Check if CDB @@ -64,10 +65,10 @@ become: true become_user: oracle delegate_to: "{{ vm_ip_address }}" - + - name: SQL Output debug: msg="{{ shell_output.stdout_lines }}" - + - name : Define CDB variable set_fact: db_iscdb: "{{ shell_output.stdout | bool }}" @@ -98,13 +99,15 @@ set_fact: db_start_retried: false - when: db_version != "11.2.0.3" and db_version != "11.2.0.4" +# when: db_version != "11.2.0.2" and db_version != "11.2.0.3" and db_version != "11.2.0.4" + when: ( db_version | regex_replace('^([^\.]+).*','\\1') | int ) > 11 - name : Define CDB variable set_fact: db_iscdb: false - when: db_version == "11.2.0.3" or db_version == "11.2.0.4" +# when: db_version == "11.2.0.2" or db_version == "11.2.0.3" or db_version == "11.2.0.4" + when: ( db_version | regex_replace('^([^\.]+).*','\\1') | int ) <= 11 ### Adjust dump_user_int based on database type and provided value. diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh index d8d16bb..c99b1da 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh @@ -25,7 +25,7 @@ v_output="$1" echo "Generating bugs list. Please wait.." # Check if opatch command works -v_out=$("$ORACLE_HOME"/OPatch/opatch lsinv 2>&1) && v_ret=$? || v_ret=$? +v_out=$("$ORACLE_HOME"/OPatch/opatch lsinv -bugs_fixed 2>&1) && v_ret=$? || v_ret=$? if [ ${v_ret} -ne 0 ] then echoError "Unable to run opatch. Error was:" @@ -46,11 +46,11 @@ sed '/^$/d' | # Remove breaks from lines not starting with number sed ':a $!{N; ba}; s/\n\+/\n/g; s/\n\([^0-9]\)/\1/g' | # Remove double spaces -sed -E 's/[[:space:]]+/ /g' | +sed -r 's/[[:space:]]+/ /g' | # Remove date columns awk '{$3=$4=$5=$6=$7=$8=""; print $0}' | # Remove double spaces again after column removal -sed -E 's/[[:space:]]+/ /g' | +sed -r 's/[[:space:]]+/ /g' | # Replace first space per tab sed 's/ /'$'\t''/' | # Replace first space per tab (that was the second) diff --git a/user_scripts/odbfcl/extract/load_custom.sql b/user_scripts/odbfcl/extract/load_custom.sql index 21ffa4f..9fe4da4 100644 --- a/user_scripts/odbfcl/extract/load_custom.sql +++ b/user_scripts/odbfcl/extract/load_custom.sql @@ -17,16 +17,35 @@ DECLARE -- Bug 22168436 ORA-600 [kkdoilsn2] on select from CONTAINERS(...) - Using BLOB / ANYDATA / XMLTYPE. - select listagg(c1.column_name,', ') within group(order by c1.column_id), - listagg(nvl(c2.column_name,'NULL'),', ') within group(order by c1.column_id) - into V_TAB_COLS, V_INS_COLS - from dba_tab_columns c1, dba_tab_columns c2 - where c1.table_name = OUT_TAB_NAME - and c2.table_name (+) = IN_TAB_NAME - and c1.owner = '&v_username.' - and c2.owner(+) = 'SYS' - and c1.column_name = c2.column_name (+) - and c1.column_name not in ('CON_ID'); + $IF DBMS_DB_VERSION.VER_LE_11_1 + $THEN + select wm_concat(c1_column_name), + wm_concat(c2_column_name) + into v_tab_cols, v_ins_cols + from ( + select c1.column_name c1_column_name, + nvl(c2.column_name,'NULL') c2_column_name + from dba_tab_columns c1, dba_tab_columns c2 + where c1.table_name = OUT_TAB_NAME + and c2.table_name (+) = IN_TAB_NAME + and c1.owner = '&v_username.' + and c2.owner(+) = 'SYS' + and c1.column_name = c2.column_name (+) + and c1.column_name not in ('CON_ID') + order by c1.column_id + ); + $ELSE + select listagg(c1.column_name,', ') within group(order by c1.column_id), + listagg(nvl(c2.column_name,'NULL'),', ') within group(order by c1.column_id) + into V_TAB_COLS, V_INS_COLS + from dba_tab_columns c1, dba_tab_columns c2 + where c1.table_name = OUT_TAB_NAME + and c2.table_name (+) = IN_TAB_NAME + and c1.owner = '&v_username.' + and c2.owner(+) = 'SYS' + and c1.column_name = c2.column_name (+) + and c1.column_name not in ('CON_ID'); + $END V_SQL := 'INSERT /*+ APPEND */ INTO &v_username..' || OUT_TAB_NAME || '(' || V_TAB_COLS || V_CDB_CLAUSE || ') SELECT '; diff --git a/user_scripts/odbfcl/extract/load_database_vault.sql b/user_scripts/odbfcl/extract/load_database_vault.sql index 9709268..5cdfe4d 100644 --- a/user_scripts/odbfcl/extract/load_database_vault.sql +++ b/user_scripts/odbfcl/extract/load_database_vault.sql @@ -18,16 +18,35 @@ DECLARE V_CDB_CLAUSE := ', CON_ID'; END IF; - select listagg(c1.column_name,', ') within group(order by c1.column_id), - listagg(nvl(c2.column_name,'NULL'),', ') within group(order by c1.column_id) - into V_TAB_COLS, V_INS_COLS - from dba_tab_columns c1, dba_tab_columns c2 - where c1.table_name = OUT_TAB_NAME - and c2.table_name (+) = IN_TAB_NAME - and c1.owner = V_USER - and c2.owner(+) = 'DVSYS' - and c1.column_name = c2.column_name (+) - and c1.column_name not in ('CON_ID'); + $IF DBMS_DB_VERSION.VER_LE_11_1 + $THEN + select wm_concat(c1_column_name), + wm_concat(c2_column_name) + into v_tab_cols, v_ins_cols + from ( + select c1.column_name c1_column_name, + nvl(c2.column_name,'NULL') c2_column_name + from dba_tab_columns c1, dba_tab_columns c2 + where c1.table_name = OUT_TAB_NAME + and c2.table_name (+) = IN_TAB_NAME + and c1.owner = V_USER + and c2.owner(+) = 'DVSYS' + and c1.column_name = c2.column_name (+) + and c1.column_name not in ('CON_ID') + order by c1.column_id + ); + $ELSE + select listagg(c1.column_name,', ') within group(order by c1.column_id), + listagg(nvl(c2.column_name,'NULL'),', ') within group(order by c1.column_id) + into V_TAB_COLS, V_INS_COLS + from dba_tab_columns c1, dba_tab_columns c2 + where c1.table_name = OUT_TAB_NAME + and c2.table_name (+) = IN_TAB_NAME + and c1.owner = V_USER + and c2.owner(+) = 'DVSYS' + and c1.column_name = c2.column_name (+) + and c1.column_name not in ('CON_ID'); + $END V_SQL := 'INSERT /*+ APPEND */ INTO ' || V_USER || '.' || OUT_TAB_NAME || '(' || V_TAB_COLS || V_CDB_CLAUSE || ') SELECT '; diff --git a/user_scripts/odbfcl/extract/load_dba_cdb.sql b/user_scripts/odbfcl/extract/load_dba_cdb.sql index fee3b31..2cb8497 100644 --- a/user_scripts/odbfcl/extract/load_dba_cdb.sql +++ b/user_scripts/odbfcl/extract/load_dba_cdb.sql @@ -28,6 +28,23 @@ DECLARE -- ORA-00600: internal error code, arguments: [kkdlGetBaseUser2:authIdType], [0], [104], [_NEXT_USER], [], [], [], [], [], [], [], [] -- Bug 22168436 ORA-600 [kkdoilsn2] on select from CONTAINERS(...) - Using BLOB / ANYDATA / XMLTYPE. + $IF DBMS_DB_VERSION.VER_LE_11_1 + $THEN + SELECT WM_CONCAT(C1_COLUMN_NAME), + WM_CONCAT(C2_COLUMN_NAME) + INTO V_TAB_COLS, V_INS_COLS + FROM ( + SELECT C1.COLUMN_NAME C1_COLUMN_NAME, + NVL(C2.COLUMN_NAME,'NULL') C2_COLUMN_NAME + FROM DBA_TAB_COLUMNS C1, DBA_TAB_COLUMNS C2 + WHERE C1.TABLE_NAME = 'T_' || IN_TAB_NAME + AND C2.TABLE_NAME (+) = V_PREFIX || IN_TAB_NAME + AND C1.OWNER = V_USER + AND C2.OWNER(+) = 'SYS' + AND C1.COLUMN_NAME = C2.COLUMN_NAME (+) + ORDER BY C1.COLUMN_ID + ); + $ELSE SELECT LISTAGG(C1.COLUMN_NAME,', ') WITHIN GROUP(ORDER BY C1.COLUMN_ID), LISTAGG(NVL(C2.COLUMN_NAME,'NULL'),', ') WITHIN GROUP(ORDER BY C1.COLUMN_ID) INTO V_TAB_COLS, V_INS_COLS @@ -37,6 +54,7 @@ DECLARE AND C1.OWNER = V_USER AND C2.OWNER(+) = 'SYS' AND C1.COLUMN_NAME = C2.COLUMN_NAME (+); + $END V_SQL := 'INSERT /*+ APPEND */ INTO ' || V_USER || '.T_' || IN_TAB_NAME || '(' || V_TAB_COLS || ') SELECT '; diff --git a/user_scripts/odbfcl/extract/load_v_dollar.sql b/user_scripts/odbfcl/extract/load_v_dollar.sql index 508cec0..3bb72bf 100644 --- a/user_scripts/odbfcl/extract/load_v_dollar.sql +++ b/user_scripts/odbfcl/extract/load_v_dollar.sql @@ -11,15 +11,33 @@ DECLARE V_SQL CLOB; BEGIN - select listagg(c1.column_name,', ') within group(order by c1.column_id), - listagg(nvl(c2.column_name,'NULL'),', ') within group(order by c1.column_id) - into V_TAB_COLS, V_INS_COLS - from dba_tab_columns c1, dba_tab_columns c2 - where c1.table_name = OUT_TAB_NAME - and c2.table_name (+) = IN_TAB_NAME - and c1.owner = '&v_username.' - and c2.owner(+) = 'SYS' - and c1.column_name = c2.column_name (+); + $IF DBMS_DB_VERSION.VER_LE_11_1 + $THEN + select wm_concat(c1_column_name), + wm_concat(c2_column_name) + into v_tab_cols, v_ins_cols + from ( + select c1.column_name c1_column_name, + nvl(c2.column_name,'NULL') c2_column_name + from dba_tab_columns c1, dba_tab_columns c2 + where c1.table_name = OUT_TAB_NAME + and c2.table_name (+) = IN_TAB_NAME + and c1.owner = '&v_username.' + and c2.owner(+) = 'SYS' + and c1.column_name = c2.column_name (+) + order by c1.column_id + ); + $ELSE + select listagg(c1.column_name,', ') within group(order by c1.column_id), + listagg(nvl(c2.column_name,'NULL'),', ') within group(order by c1.column_id) + into V_TAB_COLS, V_INS_COLS + from dba_tab_columns c1, dba_tab_columns c2 + where c1.table_name = OUT_TAB_NAME + and c2.table_name (+) = IN_TAB_NAME + and c1.owner = '&v_username.' + and c2.owner(+) = 'SYS' + and c1.column_name = c2.column_name (+); + $END V_SQL := 'INSERT /*+ APPEND */ INTO &v_username..' || OUT_TAB_NAME || '(' || V_TAB_COLS || ') SELECT '; diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.1.0.6.sql b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.1.0.6.sql new file mode 100644 index 0000000..397437c --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.1.0.6.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 11.1.0.6 +-------------------------------------- + +-- The code is the same as 11.2.0.4 in V$FIXED_VIEW_DEFINITION +@@load_underscore_11.2.0.4.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.1.0.7.sql b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.1.0.7.sql new file mode 100644 index 0000000..a290f05 --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.1.0.7.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 11.1.0.7 +-------------------------------------- + +-- The code is the same as 11.2.0.4 in V$FIXED_VIEW_DEFINITION +@@load_underscore_11.2.0.4.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.1.0.6.sql b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.1.0.6.sql new file mode 100644 index 0000000..d35fcaf --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.1.0.6.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 11.1.0.6 +-------------------------------------- + +-- The code is the same as 11.2.0.4 in V$FIXED_VIEW_DEFINITION +@@load_underscore_vv_11.2.0.4.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.1.0.7.sql b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.1.0.7.sql new file mode 100644 index 0000000..5289fbc --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.1.0.7.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 11.1.0.7 +-------------------------------------- + +-- The code is the same as 11.2.0.4 in V$FIXED_VIEW_DEFINITION +@@load_underscore_vv_11.2.0.4.sql \ No newline at end of file From 0f633b5330c028b9dc031338cc742b0d4d71e37c Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 8 Feb 2024 13:48:18 -0300 Subject: [PATCH 141/229] Update list_versions.yml --- list_versions.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/list_versions.yml b/list_versions.yml index 16bb49a..870d270 100644 --- a/list_versions.yml +++ b/list_versions.yml @@ -5,8 +5,13 @@ # Base Snap: Snapshot on machine that will be used as a base to rollback before every patch apply (must be unique name for each VM). # OPatch File: Filename for OPatch Update. # IP Address: For local SSH connection. +# Out of box ID: What is the ID of the base snap. Null means the base snap is not to be used. list_versions: + - { id : "11.1.0.6" , patch_list : "list_1110X" , main_file : "patch_main_11g.yml" , opatch_file : "p6880880_111000_Linux-x86-64.zip" } + - { id : "11.1.0.7" , patch_list : "list_1110X" , main_file : "patch_main_11g.yml" , opatch_file : "p6880880_111000_Linux-x86-64.zip" } + - { id : "11.2.0.1" , patch_list : "list_1120X" , main_file : "patch_main_11g.yml" , opatch_file : "p6880880_112000_Linux-x86-64.zip" } + - { id : "11.2.0.2" , patch_list : "list_1120X" , main_file : "patch_main_11g.yml" , opatch_file : "p6880880_112000_Linux-x86-64.zip" } - { id : "11.2.0.3" , patch_list : "list_1120X" , main_file : "patch_main_11g.yml" , opatch_file : "p6880880_112000_Linux-x86-64.zip" } - { id : "11.2.0.4" , patch_list : "list_11204" , main_file : "patch_main_11g.yml" , opatch_file : "p6880880_112000_Linux-x86-64.zip" } - { id : "12.1.0.1" , patch_list : "list_12101" , main_file : "patch_main.yml" , opatch_file : "p6880880_210000_Linux-x86-64.zip" } @@ -36,3 +41,7 @@ list_info_oci: - { id : "19.0.0.0" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : 3 } - { id : "21.0.0.0" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : 3 } - { id : "23.0.0.0" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } + - { id : "11.1.0.6" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } + - { id : "11.1.0.7" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } + - { id : "11.2.0.1" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } + - { id : "11.2.0.2" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } From d2bb2166f5a45faeec4a4fddcb7225487b560034 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 8 Feb 2024 13:50:13 -0300 Subject: [PATCH 142/229] Update list_versions.yml --- list_versions.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/list_versions.yml b/list_versions.yml index 870d270..1aae949 100644 --- a/list_versions.yml +++ b/list_versions.yml @@ -32,6 +32,10 @@ list_info_vbox: - { id : "21.0.0.0" , vmachine : "Oracle Linux 8" , base_snap : "21.0.0.0 Ready" , ip : "xxx" } list_info_oci: + - { id : "11.1.0.6" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } + - { id : "11.1.0.7" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } + - { id : "11.2.0.1" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } + - { id : "11.2.0.2" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } - { id : "11.2.0.3" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } - { id : "11.2.0.4" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" } - { id : "12.1.0.1" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" } @@ -41,7 +45,3 @@ list_info_oci: - { id : "19.0.0.0" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : 3 } - { id : "21.0.0.0" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : 3 } - { id : "23.0.0.0" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } - - { id : "11.1.0.6" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } - - { id : "11.1.0.7" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } - - { id : "11.2.0.1" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } - - { id : "11.2.0.2" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } From 6dee94224587732468c0d5519e9c6a80508b7539 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 9 Feb 2024 18:57:37 -0300 Subject: [PATCH 143/229] Add 11.1.0.6 and 11.1.0.7 support --- list_patches.yml | 150 ++++++++++++++++++++++++++--------- patch_sql/applySQLCustom.sql | 3 + tasks/lvm_list.yml | 3 +- tasks/lvm_reload.yml | 88 +++++++++++--------- tasks/main_PSU_BP.yml | 6 +- tasks/main_RU_RUR.yml | 4 +- tasks/patch_main_11g.yml | 9 ++- 7 files changed, 181 insertions(+), 82 deletions(-) create mode 100644 patch_sql/applySQLCustom.sql diff --git a/list_patches.yml b/list_patches.yml index 2660bb7..505cf1f 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -1,3 +1,75 @@ +#################### +##### 11.1.0.X ##### +#################### + +# 11.1.0.7 Patch Set Updates - List of Fixes in each PSU (Doc ID 1337836.1) + +list_1110X: +# 11.1.0.6 + - { version : "11.1.0.6" , type : "BASE" , id : 0 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.11.1.0.6.tar.gz" } + - { version : "11.1.0.6" , type : "CPU" , id : 200804 , patch_number : 6864063 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUApr2008/catcpu.sql"} + - { version : "11.1.0.6" , type : "CPU" , id : 200807 , patch_number : 7150417 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.6" , type : "CPU" , id : 200811 , patch_number : 7375639 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.6" , type : "CPU" , id : 200901 , patch_number : 7592335 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.6" , type : "CPU" , id : 200904 , patch_number : 8290402 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.6" , type : "CPU" , id : 200907 , patch_number : 8534378 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } +# 11.1.0.7 + - { version : "11.1.0.7" , type : "BASE" , id : 0 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.11.1.0.7.tar.gz" } + - { version : "11.1.0.7" , type : "PSU" , id : 1 , patch_number : 8833297 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "PSU" , id : 2 , patch_number : 9209238 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "PSU" , id : 3 , patch_number : 9352179 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "PSU" , id : 4 , patch_number : 9654987 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "PSU" , id : 5 , patch_number : 9952228 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "PSU" , id : 6 , patch_number : 10248531 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "PSU" , id : 7 , patch_number : 11724936 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "PSU" , id : 8 , patch_number : 12419384 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "PSU" , id : 9 , patch_number : 12827740 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "PSU" , id : 10 , patch_number : 13343461 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "PSU" , id : 11 , patch_number : 13621679 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "PSU" , id : 12 , patch_number : 13923474 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "PSU" , id : 13 , patch_number : 14275623 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "PSU" , id : 14 , patch_number : 14739378 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "PSU" , id : 15 , patch_number : 16056268 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "PSU" , id : 16 , patch_number : 16619896 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "PSU" , id : 17 , patch_number : 17082366 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "PSU" , id : 18 , patch_number : 17465583 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "PSU" , id : 19 , patch_number : 18031726 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "PSU" , id : 20 , patch_number : 18522513 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "PSU" , id : 21 , patch_number : 19152553 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "PSU" , id : 22 , patch_number : 19769499 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "PSU" , id : 23 , patch_number : 20299012 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "PSU" , id : 24 , patch_number : 20761024 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.1.0.7" , type : "CPU" , id : 200904 , patch_number : 8290478 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 200907 , patch_number : 8534338 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 200910 , patch_number : 8836375 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 201001 , patch_number : 9114072 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 201004 , patch_number : 9369783 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 201007 , patch_number : 9655014 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 201010 , patch_number : 9952269 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 201101 , patch_number : 10249534 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 201104 , patch_number : 11724999 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 201107 , patch_number : 12419265 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 201110 , patch_number : 12828097 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 201201 , patch_number : 13343453 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 201204 , patch_number : 13632731 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 201207 , patch_number : 14038803 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 201210 , patch_number : 14390384 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 201301 , patch_number : 14841452 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 201304 , patch_number : 16308394 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 201307 , patch_number : 16742110 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 201310 , patch_number : 17082374 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 201401 , patch_number : 17551415 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 201404 , patch_number : 18139703 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 201407 , patch_number : 18681875 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 201410 , patch_number : 19274522 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 201501 , patch_number : 19854433 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 201504 , patch_number : 20299020 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "CPU" , id : 201507 , patch_number : 20803573 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.7" , type : "OJVM" , id : 1 , patch_number : 19282002 } + - { version : "11.1.0.7" , type : "OJVM" , id : 2 , patch_number : 19877446 } + - { version : "11.1.0.7" , type : "OJVM" , id : 3 , patch_number : 20406213 } + - { version : "11.1.0.7" , type : "OJVM" , id : 4 , patch_number : 21068565 } + #################### ##### 11.2.0.X ##### #################### @@ -8,43 +80,45 @@ list_1120X: # 11.2.0.1 - - { version : "11.2.0.1" , type : "PSU" , id : 1 , patch_number : 9352237 } - - { version : "11.2.0.1" , type : "PSU" , id : 2 , patch_number : 9654983 } - - { version : "11.2.0.1" , type : "PSU" , id : 3 , patch_number : 9952216 } - - { version : "11.2.0.1" , type : "PSU" , id : 4 , patch_number : 10248516 } - - { version : "11.2.0.1" , type : "PSU" , id : 5 , patch_number : 11724930 } - - { version : "11.2.0.1" , type : "PSU" , id : 6 , patch_number : 12419378 } - - { version : "11.2.0.1" , type : "CPU" , id : 1 , patch_number : 9369797 } - - { version : "11.2.0.1" , type : "CPU" , id : 2 , patch_number : 9655013 } - - { version : "11.2.0.1" , type : "CPU" , id : 3 , patch_number : 9952260 } - - { version : "11.2.0.1" , type : "CPU" , id : 4 , patch_number : 10249532 } - - { version : "11.2.0.1" , type : "CPU" , id : 5 , patch_number : 11724991 } - - { version : "11.2.0.1" , type : "CPU" , id : 6 , patch_number : 12419278 } + - { version : "11.2.0.1" , type : "BASE" , id : 0 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.11.2.0.1.tar.gz" } + - { version : "11.2.0.1" , type : "PSU" , id : 1 , patch_number : 9352237 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.1" , type : "PSU" , id : 2 , patch_number : 9654983 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.1" , type : "PSU" , id : 3 , patch_number : 9952216 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.1" , type : "PSU" , id : 4 , patch_number : 10248516 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.1" , type : "PSU" , id : 5 , patch_number : 11724930 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.1" , type : "PSU" , id : 6 , patch_number : 12419378 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.1" , type : "CPU" , id : 1 , patch_number : 9369797 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.1" , type : "CPU" , id : 2 , patch_number : 9655013 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.1" , type : "CPU" , id : 3 , patch_number : 9952260 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.1" , type : "CPU" , id : 4 , patch_number : 10249532 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.1" , type : "CPU" , id : 5 , patch_number : 11724991 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.1" , type : "CPU" , id : 6 , patch_number : 12419278 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # 11.2.0.2 - - { version : "11.2.0.2" , type : "PSU" , id : 1 , patch_number : 10248523 } - - { version : "11.2.0.2" , type : "PSU" , id : 2 , patch_number : 11724916 } - - { version : "11.2.0.2" , type : "PSU" , id : 3 , patch_number : 12419331 } - - { version : "11.2.0.2" , type : "PSU" , id : 4 , patch_number : 12827726 } - - { version : "11.2.0.2" , type : "PSU" , id : 5 , patch_number : 13343424 } - - { version : "11.2.0.2" , type : "PSU" , id : 6 , patch_number : 13696224 } - - { version : "11.2.0.2" , type : "PSU" , id : 7 , patch_number : 13923804 } - - { version : "11.2.0.2" , type : "PSU" , id : 8 , patch_number : 14275621 } - - { version : "11.2.0.2" , type : "PSU" , id : 9 , patch_number : 14727315 } - - { version : "11.2.0.2" , type : "PSU" , id : 10 , patch_number : 16056267 } - - { version : "11.2.0.2" , type : "PSU" , id : 11 , patch_number : 16619893 } - - { version : "11.2.0.2" , type : "PSU" , id : 12 , patch_number : 17082367 } -# - { version : "11.2.0.2" , type : "CPU" , id : 1 , patch_number : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED - - { version : "11.2.0.2" , type : "CPU" , id : 2 , patch_number : 11724984 } - - { version : "11.2.0.2" , type : "CPU" , id : 3 , patch_number : 12419321 } - - { version : "11.2.0.2" , type : "CPU" , id : 4 , patch_number : 12828071 } - - { version : "11.2.0.2" , type : "CPU" , id : 5 , patch_number : 13343244 } - - { version : "11.2.0.2" , type : "CPU" , id : 6 , patch_number : 13632725 } - - { version : "11.2.0.2" , type : "CPU" , id : 7 , patch_number : 14038791 } - - { version : "11.2.0.2" , type : "CPU" , id : 8 , patch_number : 14390377 } - - { version : "11.2.0.2" , type : "CPU" , id : 9 , patch_number : 14841437 } - - { version : "11.2.0.2" , type : "CPU" , id : 10 , patch_number : 16294412 } - - { version : "11.2.0.2" , type : "CPU" , id : 11 , patch_number : 16742100 } - - { version : "11.2.0.2" , type : "CPU" , id : 12 , patch_number : 17082375 } + - { version : "11.2.0.2" , type : "BASE" , id : 0 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.11.2.0.2.tar.gz" } + - { version : "11.2.0.2" , type : "PSU" , id : 1 , patch_number : 10248523 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.2" , type : "PSU" , id : 2 , patch_number : 11724916 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.2" , type : "PSU" , id : 3 , patch_number : 12419331 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.2" , type : "PSU" , id : 4 , patch_number : 12827726 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.2" , type : "PSU" , id : 5 , patch_number : 13343424 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.2" , type : "PSU" , id : 6 , patch_number : 13696224 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.2" , type : "PSU" , id : 7 , patch_number : 13923804 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.2" , type : "PSU" , id : 8 , patch_number : 14275621 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.2" , type : "PSU" , id : 9 , patch_number : 14727315 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.2" , type : "PSU" , id : 10 , patch_number : 16056267 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.2" , type : "PSU" , id : 11 , patch_number : 16619893 , dep_type : 'BASE' , dep_id : 0 } + - { version : "11.2.0.2" , type : "PSU" , id : 12 , patch_number : 17082367 , dep_type : 'BASE' , dep_id : 0 } +# - { version : "11.2.0.2" , type : "CPU" , id : 1 , patch_number : xxxxxxxx , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NOTHING TO FIX - NO PATCH CREATED + - { version : "11.2.0.2" , type : "CPU" , id : 2 , patch_number : 11724984 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.2" , type : "CPU" , id : 3 , patch_number : 12419321 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.2" , type : "CPU" , id : 4 , patch_number : 12828071 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.2" , type : "CPU" , id : 5 , patch_number : 13343244 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.2" , type : "CPU" , id : 6 , patch_number : 13632725 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.2" , type : "CPU" , id : 7 , patch_number : 14038791 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.2" , type : "CPU" , id : 8 , patch_number : 14390377 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.2" , type : "CPU" , id : 9 , patch_number : 14841437 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.2" , type : "CPU" , id : 10 , patch_number : 16294412 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.2" , type : "CPU" , id : 11 , patch_number : 16742100 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.2" , type : "CPU" , id : 12 , patch_number : 17082375 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # 11.2.0.3 - { version : "11.2.0.3" , type : "BASE" , id : 0 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.11.2.0.3.tar.gz" } - { version : "11.2.0.3" , type : "PSU" , id : 1 , patch_number : 13343438 , dep_type : 'BASE' , dep_id : 0 } @@ -77,6 +151,10 @@ list_1120X: - { version : "11.2.0.3" , type : "CPU" , id : 13 , patch_number : 19854461 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - { version : "11.2.0.3" , type : "CPU" , id : 14 , patch_number : 20299010 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - { version : "11.2.0.3" , type : "CPU" , id : 15 , patch_number : 20803576 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.2.0.3" , type : "OJVM" , id : 1 , patch_number : 19282015 } + - { version : "11.2.0.3" , type : "OJVM" , id : 2 , patch_number : 19877443 } + - { version : "11.2.0.3" , type : "OJVM" , id : 3 , patch_number : 20406220 } + - { version : "11.2.0.3" , type : "OJVM" , id : 4 , patch_number : 21068553 } #################### ##### 11.2.0.4 ##### diff --git a/patch_sql/applySQLCustom.sql b/patch_sql/applySQLCustom.sql new file mode 100644 index 0000000..1ce5417 --- /dev/null +++ b/patch_sql/applySQLCustom.sql @@ -0,0 +1,3 @@ +-- Param 1 will be a custom string +@?/&1 +exit; diff --git a/tasks/lvm_list.yml b/tasks/lvm_list.yml index b23da04..a75b468 100644 --- a/tasks/lvm_list.yml +++ b/tasks/lvm_list.yml @@ -2,7 +2,8 @@ - name: "Get LVM list." shell: | - lvs --noheadings -o lv_name | sed 's/ *//g' + export PATH=$PATH:/sbin:/usr/sbin + lvs --noheadings -o lv_name | sed 's/ *//g' become: true become_user: root delegate_to: "{{ vm_ip_address }}" diff --git a/tasks/lvm_reload.yml b/tasks/lvm_reload.yml index 8d202a9..f72b632 100644 --- a/tasks/lvm_reload.yml +++ b/tasks/lvm_reload.yml @@ -1,50 +1,50 @@ - name: "Load base snapshot {{ vm_snapshot }}" shell: | - set -e -x - export PATH=$PATH:/sbin:/usr/sbin - v_snapshot="{{ vm_snapshot }}" - v_disk="/dev/mapper/vg_u01-lv_u01" - # Kill all oracle sessions - pkill -9 -U oracle || true - sleep 5 - # Try to umount the disk - umount -l -f /u01 || true - sleep 5 - # Try to deactivate the disk - lvchange -a n ${v_disk} -f && v_ret=$? || v_ret=$? - # If not deactivating, try again in 1 minute.. - if [ $v_ret -ne 0 ] - then - sleep 60 - umount -l -f /u01 || true - sleep 5 - lvchange -a n ${v_disk} -f - fi - if grep -q 'release 5.' /etc/oracle-release - then - # There is no merge option on OL5, so we replace the current one with the last backup. - lvchange -a y ${v_disk} - dd if=${v_disk}_${v_snapshot} of=${v_disk} bs=8M iflag=direct oflag=direct - else - # Restore target snapshot - lvconvert --merge -i 1 -v ${v_disk}_${v_snapshot} - lvchange -a n ${v_disk} - lvchange -a y ${v_disk} - # Wait until snapshot is ready - while : - do + set -e -x + export PATH=$PATH:/sbin:/usr/sbin + v_snapshot="{{ vm_snapshot }}" + v_disk="/dev/mapper/vg_u01-lv_u01" + # Kill all oracle sessions + pkill -9 -U oracle || true + sleep 5 + # Try to umount the disk + umount -l -f /u01 || true + sleep 5 + # Try to deactivate the disk + lvchange -a n ${v_disk} -f && v_ret=$? || v_ret=$? + # If not deactivating, try again in 1 minute.. + if [ $v_ret -ne 0 ] + then + sleep 60 + umount -l -f /u01 || true + sleep 5 + lvchange -a n ${v_disk} -f + fi + if grep -q 'release 5.' /etc/oracle-release + then + # There is no merge option on OL5, so we replace the current one with the last backup. + lvchange -a y ${v_disk} + dd if=${v_disk}_${v_snapshot} of=${v_disk} bs=8M iflag=direct oflag=direct + else + # Restore target snapshot + lvconvert --merge -i 1 -v ${v_disk}_${v_snapshot} + lvchange -a n ${v_disk} + lvchange -a y ${v_disk} + # Wait until snapshot is ready + while : + do if ! lvs -a | grep lv_u01_${v_snapshot} then break fi dmsetup status ${v_disk} sleep 1 - done - v_size=$(lvs --noheadings -o seg_size ${v_disk}) - lvcreate --size ${v_size} --snapshot --name lv_u01_${v_snapshot} ${v_disk} - fi - mount /u01 || true - mount | grep -q -F " /u01 " + done + v_size=$(lvs --noheadings -o seg_size ${v_disk}) + lvcreate --size ${v_size} --snapshot --name lv_u01_${v_snapshot} ${v_disk} + fi + mount /u01 || true + mount | grep -q -F " /u01 " become: true become_user: root delegate_to: "{{ vm_ip_address }}" @@ -55,4 +55,14 @@ ipcs -m | grep oracle | awk ' { print $2 } ' | xargs -I {} ipcrm -m {} become: true become_user: oracle + delegate_to: "{{ vm_ip_address }}" + +- name: "Free /dev/shm" + shell: | + set -e -x + # Free up space on /dev/shm + umount /dev/shm + mount /dev/shm + become: true + become_user: root delegate_to: "{{ vm_ip_address }}" \ No newline at end of file diff --git a/tasks/main_PSU_BP.yml b/tasks/main_PSU_BP.yml index b4ebc04..925135d 100644 --- a/tasks/main_PSU_BP.yml +++ b/tasks/main_PSU_BP.yml @@ -36,11 +36,11 @@ # Define base_OJVM_line. This is used by patch_task_post to save the snapshot. - name: Get latest PSU ID set_fact: - latest_PSU_id: "{{ lookup('vars', patch_list) | json_query(filter_qry_1) | max }}" + latest_PSU_id: "{{ ( ( lookup('vars', patch_list) | json_query(filter_qry_1) ) + [0] ) | max }}" base_OJVM_id: "{{ ( ( lookup('vars', patch_list) | json_query(filter_qry_2) ) + [0] ) | max }}" vars: - filter_qry_1: "[? type == 'PSU' ].id" - filter_qry_2: "[? type == 'PSU' && base_ojvm != null ].id" + filter_qry_1: "[? type == 'PSU' && (version == null || version == '{{ db_version }}') ].id" + filter_qry_2: "[? type == 'PSU' && base_ojvm != null && (version == null || version == '{{ db_version }}') ].id" - name : Set base OJVM ID set_fact: diff --git a/tasks/main_RU_RUR.yml b/tasks/main_RU_RUR.yml index 31f33fe..241069c 100644 --- a/tasks/main_RU_RUR.yml +++ b/tasks/main_RU_RUR.yml @@ -38,8 +38,8 @@ latest_RU_id: "{{ ( ( lookup('vars', patch_list) | json_query(filter_qry_1) ) + [0] ) | max }}" base_OJVM_id: "{{ ( ( lookup('vars', patch_list) | json_query(filter_qry_2) ) + [0] ) | max }}" vars: - filter_qry_1: "[? type == 'RU' ].id" - filter_qry_2: "[? type == 'RU' && base_ojvm != null ].id" + filter_qry_1: "[? type == 'RU' && (version == null || version == '{{ db_version }}') ].id" + filter_qry_2: "[? type == 'RU' && base_ojvm != null && (version == null || version == '{{ db_version }}') ].id" - name : Set base OJVM ID set_fact: diff --git a/tasks/patch_main_11g.yml b/tasks/patch_main_11g.yml index f3dce4a..f38a173 100644 --- a/tasks/patch_main_11g.yml +++ b/tasks/patch_main_11g.yml @@ -91,7 +91,14 @@ - include: run_sql.yml vars: sql_param : { file : "applySQLPatch.sql" , folder : "patch_sql" , task_action : "Apply Patch" , params : "cpu" } - when: patch.type == "CPU" + when: patch.type == "CPU" and patch.cat_script is not defined + + # Apply patch changes on DB (if Custom) + - include: run_sql.yml + vars: + sql_param : { file : "applySQLCustom.sql" , folder : "patch_sql" , task_action : "Apply Patch" , params : "{{ patch.cat_script }}" } + when: patch.type == "CPU" and patch.cat_script is defined + # When the SQL Patch is for OJVM - block: From 3aee511f98052fda5db28a70a59697df92496eb7 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Sun, 11 Feb 2024 10:28:16 -0300 Subject: [PATCH 144/229] Fix ID --- list_patches.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/list_patches.yml b/list_patches.yml index 505cf1f..2843bf4 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -9,7 +9,7 @@ list_1110X: - { version : "11.1.0.6" , type : "BASE" , id : 0 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.11.1.0.6.tar.gz" } - { version : "11.1.0.6" , type : "CPU" , id : 200804 , patch_number : 6864063 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUApr2008/catcpu.sql"} - { version : "11.1.0.6" , type : "CPU" , id : 200807 , patch_number : 7150417 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "11.1.0.6" , type : "CPU" , id : 200811 , patch_number : 7375639 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "11.1.0.6" , type : "CPU" , id : 200810 , patch_number : 7375639 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - { version : "11.1.0.6" , type : "CPU" , id : 200901 , patch_number : 7592335 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - { version : "11.1.0.6" , type : "CPU" , id : 200904 , patch_number : 8290402 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - { version : "11.1.0.6" , type : "CPU" , id : 200907 , patch_number : 8534378 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } From 5494d1c3d86dc9dc905dc9a1ccd0591fb361c62e Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Sun, 11 Feb 2024 10:29:07 -0300 Subject: [PATCH 145/229] Add DB Version to LVM snap name --- tasks/lvm_reload.yml | 2 +- tasks/lvm_savestate.yml | 34 +++++++++++++++++++++------------- tasks/main_PSU_BP.yml | 3 ++- tasks/main_RU_RUR.yml | 2 +- tasks/patch_tasks_post.yml | 2 +- tasks/patch_tasks_pre.yml | 4 ++-- 6 files changed, 28 insertions(+), 19 deletions(-) diff --git a/tasks/lvm_reload.yml b/tasks/lvm_reload.yml index f72b632..1548c3d 100644 --- a/tasks/lvm_reload.yml +++ b/tasks/lvm_reload.yml @@ -24,7 +24,7 @@ then # There is no merge option on OL5, so we replace the current one with the last backup. lvchange -a y ${v_disk} - dd if=${v_disk}_${v_snapshot} of=${v_disk} bs=8M iflag=direct oflag=direct + dd if=${v_disk}_${v_snapshot} of=${v_disk} bs=8M iflag=direct oflag=direct else # Restore target snapshot lvconvert --merge -i 1 -v ${v_disk}_${v_snapshot} diff --git a/tasks/lvm_savestate.yml b/tasks/lvm_savestate.yml index 7fe53c3..61d3e67 100644 --- a/tasks/lvm_savestate.yml +++ b/tasks/lvm_savestate.yml @@ -3,12 +3,13 @@ # Drop old machine image if exists - name: "Drop old LVM snapshots for previous RU or PSU if exists." shell: | - v_snapshot="{{ save_snapshot }}" - v_disk_vg='/dev/mapper/vg_u01' - for lv_name in `lvs --noheadings -o lv_name | grep -E 'PSU|RU' | grep -v ${v_snapshot}` - do - lvremove -f ${v_disk_vg}-${lv_name} - done + export PATH=$PATH:/sbin:/usr/sbin + v_snapshot="{{ save_snapshot }}" + v_disk_vg='/dev/mapper/vg_u01' + for lv_name in `lvs --noheadings -o lv_name | grep -E 'PSU|RU' | grep '{{ db_version }}' | grep -v ${v_snapshot}` + do + lvremove -f ${v_disk_vg}-${lv_name} + done become: true become_user: root delegate_to: "{{ vm_ip_address }}" @@ -16,13 +17,20 @@ # Save latest machine image if not already - name: "Create new LVM snapshot \"{{ save_snapshot }}\" if not exists." shell: | - v_snapshot="{{ save_snapshot }}" - v_disk='/dev/mapper/vg_u01-lv_u01' - if ! $(lvs -a | grep -q "${v_snapshot}") - then - v_size=$(lvs --noheadings -o seg_size ${v_disk}) - lvcreate --size ${v_size} --snapshot --name lv_u01_${v_snapshot} ${v_disk} - fi + export PATH=$PATH:/sbin:/usr/sbin + v_snapshot="{{ save_snapshot }}" + v_disk='/dev/mapper/vg_u01-lv_u01' + if ! $(lvs -a | grep -q "${v_snapshot}") + then + v_size=$(lvs --noheadings -o seg_size ${v_disk}) + if grep -q 'release 5.' /etc/oracle-release + then + lvcreate --size ${v_size} --name lv_u01_${v_snapshot} vg_u01 + dd if=${v_disk} of=${v_disk}_${v_snapshot} bs=8M iflag=direct oflag=direct + else + lvcreate --size ${v_size} --snapshot --name lv_u01_${v_snapshot} ${v_disk} + fi + fi become: true become_user: root delegate_to: "{{ vm_ip_address }}" \ No newline at end of file diff --git a/tasks/main_PSU_BP.yml b/tasks/main_PSU_BP.yml index 925135d..4707206 100644 --- a/tasks/main_PSU_BP.yml +++ b/tasks/main_PSU_BP.yml @@ -101,7 +101,7 @@ - name : Change Base Snapshot Name - LVM Mode set_fact: - vm_snapshot: "PSU_{{ base_OJVM_id }}" + vm_snapshot: "{{ db_version }}_PSU_{{ base_OJVM_id }}" when: oci_mode - name: "Base Snapshot will be {{ vm_snapshot }}" @@ -118,6 +118,7 @@ - patch.id == (param_patch | float) or param_patch == -1 - patch.id >= (param_patch_from | float) or param_patch_from == -1 - patch.id <= (param_patch_to | float) or param_patch_to == -1 + - (patch.version | default(db_version)) == db_version when: param_type is undefined or param_type == "OJVM" diff --git a/tasks/main_RU_RUR.yml b/tasks/main_RU_RUR.yml index 241069c..b66ea49 100644 --- a/tasks/main_RU_RUR.yml +++ b/tasks/main_RU_RUR.yml @@ -100,7 +100,7 @@ - name : Change Base Snapshot Name - LVM Mode set_fact: - vm_snapshot: "RU_{{ base_OJVM_id }}" + vm_snapshot: "{{ db_version }}_RU_{{ base_OJVM_id }}" when: oci_mode - name: "Base Snapshot will be {{ vm_snapshot }}" diff --git a/tasks/patch_tasks_post.yml b/tasks/patch_tasks_post.yml index c44a91a..3fc3e14 100644 --- a/tasks/patch_tasks_post.yml +++ b/tasks/patch_tasks_post.yml @@ -64,7 +64,7 @@ - name : Generate Snapshot Name - LVM Mode set_fact: - save_snapshot: "{{ patch.type }}_{{ base_OJVM_id }}" + save_snapshot: "{{ db_version }}_{{ patch.type }}_{{ base_OJVM_id }}" when: oci_mode - include: lvm_savestate.yml diff --git a/tasks/patch_tasks_pre.yml b/tasks/patch_tasks_pre.yml index 4e35f26..c19e4c3 100644 --- a/tasks/patch_tasks_pre.yml +++ b/tasks/patch_tasks_pre.yml @@ -130,7 +130,7 @@ set_fact: found_lvm_entry: "{{ lvm_search }}" vars: - my_query: "lv_u01_{{ patch.type }}_{{ patch.id }}$" + my_query: "lv_u01_{{ db_version }}_{{ patch.type }}_{{ patch.id }}$" lvm_search: "{{ lvs_output.stdout_lines | select('match', my_query) | list | length > 0 }}" # lvm_search: "{{ lvs_output.stdout_lines | select('search', my_query) | list | length > 0 }}" @@ -147,7 +147,7 @@ - name : Set new VM Snap set_fact: - vm_snapshot: "{{ patch.type }}_{{ patch.id }}" + vm_snapshot: "{{ db_version }}_{{ patch.type }}_{{ patch.id }}" when: found_lvm_entry From b43f58df7a05219cd9e693f61230b8696e2b8101 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 12 Feb 2024 09:47:38 -0300 Subject: [PATCH 146/229] Change snap name --- tasks/lvm_savestate.yml | 2 +- tasks/main_PSU_BP.yml | 10 +++++----- tasks/main_RU_RUR.yml | 9 +++++---- tasks/main_loader.yml | 5 +++-- tasks/main_loader_adb.yml | 3 ++- tasks/patch_tasks_post.yml | 2 +- tasks/patch_tasks_pre.yml | 4 ++-- 7 files changed, 19 insertions(+), 16 deletions(-) diff --git a/tasks/lvm_savestate.yml b/tasks/lvm_savestate.yml index 61d3e67..b769b7c 100644 --- a/tasks/lvm_savestate.yml +++ b/tasks/lvm_savestate.yml @@ -6,7 +6,7 @@ export PATH=$PATH:/sbin:/usr/sbin v_snapshot="{{ save_snapshot }}" v_disk_vg='/dev/mapper/vg_u01' - for lv_name in `lvs --noheadings -o lv_name | grep -E 'PSU|RU' | grep '{{ db_version }}' | grep -v ${v_snapshot}` + for lv_name in `lvs --noheadings -o lv_name | grep -E 'PSU|RU' | grep '{{ db_version_short }}' | grep -v ${v_snapshot}` do lvremove -f ${v_disk_vg}-${lv_name} done diff --git a/tasks/main_PSU_BP.yml b/tasks/main_PSU_BP.yml index 4707206..7f21f41 100644 --- a/tasks/main_PSU_BP.yml +++ b/tasks/main_PSU_BP.yml @@ -2,10 +2,10 @@ - name : Define version set_fact: - patch_file: "{{ item.main_file }}" - patch_list: "{{ item.patch_list }}" - opatch_file: "{{ item.opatch_file }}" -# db_version_1d: "{{ db_version.split(".")[0] }}" + patch_file: "{{ item.main_file }}" + patch_list: "{{ item.patch_list }}" + opatch_file: "{{ item.opatch_file }}" + db_version_short: "{{ db_version | replace('.','') }}" with_items: "{{ list_versions }}" when: item.id == db_version @@ -101,7 +101,7 @@ - name : Change Base Snapshot Name - LVM Mode set_fact: - vm_snapshot: "{{ db_version }}_PSU_{{ base_OJVM_id }}" + vm_snapshot: "{{ db_version_short }}_PSU_{{ base_OJVM_id }}" when: oci_mode - name: "Base Snapshot will be {{ vm_snapshot }}" diff --git a/tasks/main_RU_RUR.yml b/tasks/main_RU_RUR.yml index b66ea49..a90ce0c 100644 --- a/tasks/main_RU_RUR.yml +++ b/tasks/main_RU_RUR.yml @@ -2,9 +2,10 @@ - name : Define version set_fact: - patch_file: "{{ item.main_file }}" - patch_list: "{{ item.patch_list }}" - opatch_file: "{{ item.opatch_file }}" + patch_file: "{{ item.main_file }}" + patch_list: "{{ item.patch_list }}" + opatch_file: "{{ item.opatch_file }}" + db_version_short: "{{ db_version | replace('.','') }}" with_items: "{{ list_versions }}" when: item.id == db_version @@ -100,7 +101,7 @@ - name : Change Base Snapshot Name - LVM Mode set_fact: - vm_snapshot: "{{ db_version }}_RU_{{ base_OJVM_id }}" + vm_snapshot: "{{ db_version_short }}_RU_{{ base_OJVM_id }}" when: oci_mode - name: "Base Snapshot will be {{ vm_snapshot }}" diff --git a/tasks/main_loader.yml b/tasks/main_loader.yml index aaafe65..6e951a0 100644 --- a/tasks/main_loader.yml +++ b/tasks/main_loader.yml @@ -2,8 +2,9 @@ - name : Define version set_fact: - patch_base: "{{ item.base_snap }}" - patch_list: "{{ item.patch_list }}" + patch_base: "{{ item.base_snap }}" + patch_list: "{{ item.patch_list }}" + db_version_short: "{{ db_version | replace('.','') }}" with_items: "{{ list_versions }}" when: item.id == db_version diff --git a/tasks/main_loader_adb.yml b/tasks/main_loader_adb.yml index 6b0fbf9..597c4a1 100644 --- a/tasks/main_loader_adb.yml +++ b/tasks/main_loader_adb.yml @@ -2,7 +2,8 @@ - name : Define version set_fact: - patch_list: "{{ item.patch_list }}" + patch_list: "{{ item.patch_list }}" + db_version_short: "{{ db_version | replace('.','') }}" with_items: "{{ list_versions }}" when: item.id == db_version diff --git a/tasks/patch_tasks_post.yml b/tasks/patch_tasks_post.yml index 3fc3e14..3413ca9 100644 --- a/tasks/patch_tasks_post.yml +++ b/tasks/patch_tasks_post.yml @@ -64,7 +64,7 @@ - name : Generate Snapshot Name - LVM Mode set_fact: - save_snapshot: "{{ db_version }}_{{ patch.type }}_{{ base_OJVM_id }}" + save_snapshot: "{{ db_version_short }}_{{ patch.type }}_{{ base_OJVM_id }}" when: oci_mode - include: lvm_savestate.yml diff --git a/tasks/patch_tasks_pre.yml b/tasks/patch_tasks_pre.yml index c19e4c3..975d8dc 100644 --- a/tasks/patch_tasks_pre.yml +++ b/tasks/patch_tasks_pre.yml @@ -130,7 +130,7 @@ set_fact: found_lvm_entry: "{{ lvm_search }}" vars: - my_query: "lv_u01_{{ db_version }}_{{ patch.type }}_{{ patch.id }}$" + my_query: "lv_u01_{{ db_version_short }}_{{ patch.type }}_{{ patch.id }}$" lvm_search: "{{ lvs_output.stdout_lines | select('match', my_query) | list | length > 0 }}" # lvm_search: "{{ lvs_output.stdout_lines | select('search', my_query) | list | length > 0 }}" @@ -147,7 +147,7 @@ - name : Set new VM Snap set_fact: - vm_snapshot: "{{ db_version }}_{{ patch.type }}_{{ patch.id }}" + vm_snapshot: "{{ db_version_short }}_{{ patch.type }}_{{ patch.id }}" when: found_lvm_entry From 357fea952f0b939c381521a5f2140c3513d451f8 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 13 Feb 2024 17:56:48 -0300 Subject: [PATCH 147/229] Fix issues --- tasks/lvm_savestate.yml | 20 ++++++++++++++++++++ tasks/main_PSU_BP.yml | 4 ++-- tasks/main_RU_RUR.yml | 2 +- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/tasks/lvm_savestate.yml b/tasks/lvm_savestate.yml index b769b7c..0b05bf0 100644 --- a/tasks/lvm_savestate.yml +++ b/tasks/lvm_savestate.yml @@ -17,6 +17,7 @@ # Save latest machine image if not already - name: "Create new LVM snapshot \"{{ save_snapshot }}\" if not exists." shell: | + set -e -x export PATH=$PATH:/sbin:/usr/sbin v_snapshot="{{ save_snapshot }}" v_disk='/dev/mapper/vg_u01-lv_u01' @@ -25,8 +26,27 @@ v_size=$(lvs --noheadings -o seg_size ${v_disk}) if grep -q 'release 5.' /etc/oracle-release then + # Kill all oracle sessions + pkill -9 -U oracle || true + sleep 5 + # Try to umount the disk + umount -l -f /u01 || true + sleep 5 + # Try to deactivate the disk + lvchange -a n ${v_disk} -f && v_ret=$? || v_ret=$? + # If not deactivating, try again in 1 minute.. + if [ $v_ret -ne 0 ] + then + sleep 60 + umount -l -f /u01 || true + sleep 5 + lvchange -a n ${v_disk} -f + fi + lvchange -a y ${v_disk} lvcreate --size ${v_size} --name lv_u01_${v_snapshot} vg_u01 dd if=${v_disk} of=${v_disk}_${v_snapshot} bs=8M iflag=direct oflag=direct + mount /u01 || true + mount | grep -q -F " /u01 " else lvcreate --size ${v_size} --snapshot --name lv_u01_${v_snapshot} ${v_disk} fi diff --git a/tasks/main_PSU_BP.yml b/tasks/main_PSU_BP.yml index 7f21f41..383d855 100644 --- a/tasks/main_PSU_BP.yml +++ b/tasks/main_PSU_BP.yml @@ -37,7 +37,7 @@ - name: Get latest PSU ID set_fact: latest_PSU_id: "{{ ( ( lookup('vars', patch_list) | json_query(filter_qry_1) ) + [0] ) | max }}" - base_OJVM_id: "{{ ( ( lookup('vars', patch_list) | json_query(filter_qry_2) ) + [0] ) | max }}" + base_OJVM_id: "{{ ( ( lookup('vars', patch_list) | json_query(filter_qry_2) ) + [0] ) | max }}" vars: filter_qry_1: "[? type == 'PSU' && (version == null || version == '{{ db_version }}') ].id" filter_qry_2: "[? type == 'PSU' && base_ojvm != null && (version == null || version == '{{ db_version }}') ].id" @@ -80,7 +80,7 @@ loop_var: patch label: "{{ patch.id }}" when: - - (param_type is undefined and (patch.type == "PSU" or patch.type == "CPU" or patch.type == "BASE")) or patch.type == param_type + - (param_type is undefined and (patch.type == "PSU" or patch.type == "CPU" or patch.type == "BASE")) or (param_type is defined and patch.type == param_type) - patch.id == (param_patch | float) or param_patch == -1 - patch.id >= (param_patch_from | float) or param_patch_from == -1 - patch.id <= (param_patch_to | float) or param_patch_to == -1 diff --git a/tasks/main_RU_RUR.yml b/tasks/main_RU_RUR.yml index a90ce0c..eefb3d8 100644 --- a/tasks/main_RU_RUR.yml +++ b/tasks/main_RU_RUR.yml @@ -135,7 +135,7 @@ loop_var: patch label: "{{ patch.id }}" when: - - (param_type is undefined and (patch.type != "RU" and patch.type != "OJVM")) or patch.type == param_type + - (param_type is undefined and (patch.type != "RU" and patch.type != "OJVM")) or (param_type is defined and patch.type == param_type) - patch.id == (param_patch | float) or param_patch == -1 - patch.id >= (param_patch_from | float) or param_patch_from == -1 - patch.id <= (param_patch_to | float) or param_patch_to == -1 From 253c2b2fa518c437a5d55d537f038316afed695c Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 15 Feb 2024 11:59:23 -0300 Subject: [PATCH 148/229] Update exporters --- user_scripts/odbfcl/createUser.sql | 5 +- .../odbfcl/extract/create_hash_load_table.sql | 46 +++++----- user_scripts/odbfcl/extract/load_code.sql | 89 ++++++++++--------- user_scripts/odbfcl/sh_extractor/build_zip.sh | 21 ++++- .../odbfcl/sh_extractor/dictionaryGet.sh | 3 +- .../odbfcl/sh_extractor/dumpCreate.sh | 5 +- user_scripts/odbfcl/sh_extractor/exporter.sh | 2 +- .../odbfcl/sh_extractor/schemaCreate.sh | 5 +- 8 files changed, 99 insertions(+), 77 deletions(-) diff --git a/user_scripts/odbfcl/createUser.sql b/user_scripts/odbfcl/createUser.sql index a3bcb90..84109bd 100644 --- a/user_scripts/odbfcl/createUser.sql +++ b/user_scripts/odbfcl/createUser.sql @@ -1,4 +1,4 @@ --- Create HASH user +-- Create exporter user WHENEVER SQLERROR CONTINUE def v_username='&1.' @@ -18,5 +18,8 @@ CREATE USER &v_username. GRANT CREATE SESSION TO &v_username.; GRANT CREATE TABLE TO &v_username.; + +-- REMOVE_IF_ZIP_AFTER + -- For unwrapper: GRANT CREATE PROCEDURE TO &v_username.; \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/create_hash_load_table.sql b/user_scripts/odbfcl/extract/create_hash_load_table.sql index ec2d455..01da491 100644 --- a/user_scripts/odbfcl/extract/create_hash_load_table.sql +++ b/user_scripts/odbfcl/extract/create_hash_load_table.sql @@ -1,24 +1,24 @@ -WHENEVER SQLERROR EXIT SQL.SQLCODE - -BEGIN - EXECUTE IMMEDIATE 'DROP TABLE &v_username.."T_HASH_LOAD" PURGE'; -EXCEPTION - WHEN OTHERS THEN - IF SQLCODE != -942 THEN - RAISE; - END IF; -END; -/ - -CREATE TABLE &v_username.."T_HASH_LOAD" -( - "OWNER" VARCHAR2(128 CHAR), - "NAME" VARCHAR2(128 CHAR), - "TYPE" VARCHAR2(12 CHAR), - "ORIGIN_CON_ID" NUMBER, - "CON_ID" NUMBER, - "MD5_HASH" RAW(16) NOT NULL, - "SHA1_HASH" RAW(20) NOT NULL, - "CODE" CLOB NOT NULL -) +WHENEVER SQLERROR EXIT SQL.SQLCODE + +BEGIN + EXECUTE IMMEDIATE 'DROP TABLE &v_username.."T_HASH_LOAD" PURGE'; +EXCEPTION + WHEN OTHERS THEN + IF SQLCODE != -942 THEN + RAISE; + END IF; +END; +/ + +CREATE TABLE &v_username.."T_HASH_LOAD" +( + "OWNER" VARCHAR2(128 CHAR), + "NAME" VARCHAR2(128 CHAR), + "TYPE" VARCHAR2(12 CHAR), + "ORIGIN_CON_ID" NUMBER, + "CON_ID" NUMBER, + "MD5_HASH" RAW(16) NOT NULL, + "SHA1_HASH" RAW(20) NOT NULL, + "CODE" CLOB NOT NULL +) COMPRESS NOLOGGING; \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/load_code.sql b/user_scripts/odbfcl/extract/load_code.sql index 7688d83..3c457bc 100644 --- a/user_scripts/odbfcl/extract/load_code.sql +++ b/user_scripts/odbfcl/extract/load_code.sql @@ -1,45 +1,46 @@ -WHENEVER SQLERROR EXIT SQL.SQLCODE - --- TODO: CHANGE 2 QUERIES FOR 1 USING "INSERT ALL" - -insert /*+ append */ - into &v_username..DM_CODES (MD5_HASH, CODE, WRAPPED) -select MD5_HASH, - CODE, - CASE - WHEN REGEXP_INSTR(CODE, 'wrapped', 1, 1, 0, 'i') > 0 - AND REGEXP_INSTR(CODE, 'abcd', 1, 1, 0, 'i') > 0 - THEN 'Y' - ELSE 'N' - END WRAPPED -from ( - select MD5_HASH, - CODE, - RANK() over (partition by MD5_HASH order by rowid asc) col_ind - from &v_username..T_HASH_LOAD -) -where col_ind=1; - -insert /*+ append */ - into &v_username..T_HASH (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_HASH, SHA1_HASH) -select OWNER, - NAME, - TYPE, - ORIGIN_CON_ID, - CON_ID, - MD5_HASH, - SHA1_HASH -from &v_username..T_HASH_LOAD; - -commit; - -drop table &v_username..T_HASH_LOAD purge; - - --- BEGIN - Added to avoid "Java not installed" errors. -WHENEVER SQLERROR CONTINUE - -@@unwrap_code.sql - --- END - Added to avoid "Java not installed" errors. +WHENEVER SQLERROR EXIT SQL.SQLCODE + +-- TODO: CHANGE 2 QUERIES FOR 1 USING "INSERT ALL" + +insert /*+ append */ + into &v_username..DM_CODES (MD5_HASH, CODE, WRAPPED) +select MD5_HASH, + CODE, + CASE + WHEN REGEXP_INSTR(CODE, 'wrapped', 1, 1, 0, 'i') > 0 + AND REGEXP_INSTR(CODE, 'abcd', 1, 1, 0, 'i') > 0 + THEN 'Y' + ELSE 'N' + END WRAPPED +from ( + select MD5_HASH, + CODE, + RANK() over (partition by MD5_HASH order by rowid asc) col_ind + from &v_username..T_HASH_LOAD +) +where col_ind=1; + +insert /*+ append */ + into &v_username..T_HASH (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_HASH, SHA1_HASH) +select OWNER, + NAME, + TYPE, + ORIGIN_CON_ID, + CON_ID, + MD5_HASH, + SHA1_HASH +from &v_username..T_HASH_LOAD; + +commit; + +drop table &v_username..T_HASH_LOAD purge; + +-- REMOVE_IF_ZIP_AFTER + +-- BEGIN - Added to avoid "Java not installed" errors. +WHENEVER SQLERROR CONTINUE + +@@unwrap_code.sql + +-- END - Added to avoid "Java not installed" errors. WHENEVER SQLERROR EXIT SQL.SQLCODE \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/build_zip.sh b/user_scripts/odbfcl/sh_extractor/build_zip.sh index 04503e1..a2eb712 100644 --- a/user_scripts/odbfcl/sh_extractor/build_zip.sh +++ b/user_scripts/odbfcl/sh_extractor/build_zip.sh @@ -12,17 +12,32 @@ cp -a ../adb_load_symbols/*.sh ${v_folder_name} cp -a ../adb_load_txtcollection_files/*.sh ${v_folder_name} cp -a ../adb_load_filechksum/*.sh ${v_folder_name} cp -a *.sh *.sql *.txt ${v_folder_name} -sed '/^cd /d' ${v_folder_name}/schemaCreate.sh > ${v_folder_name}/schemaCreate.sh.tmp + +sed '/# REMOVE_IF_ZIP$/d' ${v_folder_name}/schemaCreate.sh > ${v_folder_name}/schemaCreate.sh.tmp mv ${v_folder_name}/schemaCreate.sh.tmp ${v_folder_name}/schemaCreate.sh -sed '/^cd /d' ${v_folder_name}/dumpCreate.sh > ${v_folder_name}/dumpCreate.sh.tmp + +sed '/# REMOVE_IF_ZIP$/d' ${v_folder_name}/dumpCreate.sh > ${v_folder_name}/dumpCreate.sh.tmp mv ${v_folder_name}/dumpCreate.sh.tmp ${v_folder_name}/dumpCreate.sh -sed '/^cd /d' ${v_folder_name}/dictionaryGet.sh > ${v_folder_name}/dictionaryGet.sh.tmp + +sed '/# REMOVE_IF_ZIP$/d' ${v_folder_name}/dictionaryGet.sh > ${v_folder_name}/dictionaryGet.sh.tmp mv ${v_folder_name}/dictionaryGet.sh.tmp ${v_folder_name}/dictionaryGet.sh + sed '/# REMOVE_IF_ZIP$/d' ${v_folder_name}/exporter.sh > ${v_folder_name}/exporter.sh.tmp mv ${v_folder_name}/exporter.sh.tmp ${v_folder_name}/exporter.sh + +sed "s/v_dump_user_name='hash'/v_dump_user_name='oradiff_exporter'/" ${v_folder_name}/exporter.sh > ${v_folder_name}/exporter.sh.tmp +mv ${v_folder_name}/exporter.sh.tmp ${v_folder_name}/exporter.sh + +sed '/^-- REMOVE_IF_ZIP_AFTER$/,$d' ${v_folder_name}/createUser.sql > ${v_folder_name}/createUser.sql.tmp +mv ${v_folder_name}/createUser.sql.tmp ${v_folder_name}/createUser.sql + +sed '/^-- REMOVE_IF_ZIP_AFTER$/,$d' ${v_folder_name}/load_code.sql > ${v_folder_name}/load_code.sql.tmp +mv ${v_folder_name}/load_code.sql.tmp ${v_folder_name}/load_code.sql + find ${v_folder_name} -name "*.yml" -delete find ${v_folder_name} -name ".DS_Store" -delete rm -f ${v_folder_name}/build_zip.sh +rm -f ${v_folder_name}/unwrap_code.sql rm -f ${v_folder_name}.zip # Put all files at the same stamp to create a deterministic zip. diff --git a/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh b/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh index f7f7764..f5b48bd 100644 --- a/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh +++ b/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh @@ -23,12 +23,13 @@ v_dump_user_name="$1" v_dump_dir_name='expdir_hash' v_thisdir="$(cd "$(dirname "$0")"; pwd)" +cd "${v_thisdir}" [ -z "${v_sysdba_connect}" ] && v_sysdba_connect='/ as sysdba' echo "Generating table export. Please wait.." -cd "${v_thisdir}"/../extract +cd "${v_thisdir}"/../extract # REMOVE_IF_ZIP $ORACLE_HOME/bin/sqlplus -L -S "${v_sysdba_connect}" < -# v1.0.0.7 +# v1.0.0.8 set -eo pipefail diff --git a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh index c5ccd9a..f2768aa 100644 --- a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh @@ -30,12 +30,13 @@ v_dump_user_name="$1" [ -n "$DB_EXP_USER_TEMP" ] && v_dump_user_temp="$DB_EXP_USER_TEMP" || v_dump_user_temp='TEMP' v_thisdir="$(cd "$(dirname "$0")"; pwd)" +cd "${v_thisdir}" [ -z "${v_sysdba_connect}" ] && v_sysdba_connect='/ as sysdba' -echo "Generating export user. Please wait.." +echo "Creating export user. Please wait.." -cd "${v_thisdir}"/../ +cd "${v_thisdir}"/../ # REMOVE_IF_ZIP $ORACLE_HOME/bin/sqlplus "${v_sysdba_connect}" < Date: Thu, 15 Feb 2024 12:24:56 -0300 Subject: [PATCH 149/229] Delete build_zip.sh --- user_scripts/odbfcl/sh_extractor/build_zip.sh | 50 ------------------- 1 file changed, 50 deletions(-) delete mode 100644 user_scripts/odbfcl/sh_extractor/build_zip.sh diff --git a/user_scripts/odbfcl/sh_extractor/build_zip.sh b/user_scripts/odbfcl/sh_extractor/build_zip.sh deleted file mode 100644 index a2eb712..0000000 --- a/user_scripts/odbfcl/sh_extractor/build_zip.sh +++ /dev/null @@ -1,50 +0,0 @@ -set -eo pipefail - -v_folder_name="db_exporter" -mkdir ${v_folder_name} -cp -a ../extract/ ${v_folder_name} -cp -a ../createUser.sql ${v_folder_name} -cp -a ../tables_recreate.sql ${v_folder_name} -cp -a ../tables_create.sql ${v_folder_name} -cp -a ../../externalDir.sql ${v_folder_name} -cp -a ../adb_load_bugs_fixed/*.sh ${v_folder_name} -cp -a ../adb_load_symbols/*.sh ${v_folder_name} -cp -a ../adb_load_txtcollection_files/*.sh ${v_folder_name} -cp -a ../adb_load_filechksum/*.sh ${v_folder_name} -cp -a *.sh *.sql *.txt ${v_folder_name} - -sed '/# REMOVE_IF_ZIP$/d' ${v_folder_name}/schemaCreate.sh > ${v_folder_name}/schemaCreate.sh.tmp -mv ${v_folder_name}/schemaCreate.sh.tmp ${v_folder_name}/schemaCreate.sh - -sed '/# REMOVE_IF_ZIP$/d' ${v_folder_name}/dumpCreate.sh > ${v_folder_name}/dumpCreate.sh.tmp -mv ${v_folder_name}/dumpCreate.sh.tmp ${v_folder_name}/dumpCreate.sh - -sed '/# REMOVE_IF_ZIP$/d' ${v_folder_name}/dictionaryGet.sh > ${v_folder_name}/dictionaryGet.sh.tmp -mv ${v_folder_name}/dictionaryGet.sh.tmp ${v_folder_name}/dictionaryGet.sh - -sed '/# REMOVE_IF_ZIP$/d' ${v_folder_name}/exporter.sh > ${v_folder_name}/exporter.sh.tmp -mv ${v_folder_name}/exporter.sh.tmp ${v_folder_name}/exporter.sh - -sed "s/v_dump_user_name='hash'/v_dump_user_name='oradiff_exporter'/" ${v_folder_name}/exporter.sh > ${v_folder_name}/exporter.sh.tmp -mv ${v_folder_name}/exporter.sh.tmp ${v_folder_name}/exporter.sh - -sed '/^-- REMOVE_IF_ZIP_AFTER$/,$d' ${v_folder_name}/createUser.sql > ${v_folder_name}/createUser.sql.tmp -mv ${v_folder_name}/createUser.sql.tmp ${v_folder_name}/createUser.sql - -sed '/^-- REMOVE_IF_ZIP_AFTER$/,$d' ${v_folder_name}/load_code.sql > ${v_folder_name}/load_code.sql.tmp -mv ${v_folder_name}/load_code.sql.tmp ${v_folder_name}/load_code.sql - -find ${v_folder_name} -name "*.yml" -delete -find ${v_folder_name} -name ".DS_Store" -delete -rm -f ${v_folder_name}/build_zip.sh -rm -f ${v_folder_name}/unwrap_code.sql -rm -f ${v_folder_name}.zip - -# Put all files at the same stamp to create a deterministic zip. -find ${v_folder_name} -exec touch -t 202201010000 {} + - -zip -qrmXD ${v_folder_name}.zip ${v_folder_name} -x "*/.*" -rmdir ${v_folder_name}/* -rmdir ${v_folder_name} - -exit 0 \ No newline at end of file From 86a488ea5d979fd36cbbc55a2914921d263dadc5 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 15 Feb 2024 13:14:36 -0300 Subject: [PATCH 150/229] Update main_loader_manual.yml --- tasks/main_loader_manual.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tasks/main_loader_manual.yml b/tasks/main_loader_manual.yml index 2ebe571..e831dc4 100644 --- a/tasks/main_loader_manual.yml +++ b/tasks/main_loader_manual.yml @@ -2,18 +2,19 @@ - name: Variables not provided fail: - msg: "Variables input_version / input_series / input_patch / input_file must be defined." + msg: "Variables input_version / input_series / input_patch / input_file / input_trail must be defined." when: input_version is undefined or (input_version|length == 0) or input_series is undefined or (input_series|length == 0) or input_patch is undefined or (input_patch|length == 0) or - input_file is undefined or (input_file|length == 0) + input_file is undefined or (input_file|length == 0) or + input_trail is undefined or (input_trail|length == 0) - name : Define db_version set_fact: db_version: "{{ input_version }}" param_type: "{{ input_series }}" param_patch: "{{ input_patch }}" - output_folder: "{{ stage_folder }}/temp_load" + output_folder: "{{ stage_folder }}/temp_load/{{ input_trail }}" input_file_name: "{{ input_file | basename }}" - name: Delete content & directory From 357d3ab46deb99ed63437cef2c639649ed9d7396 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 16 Feb 2024 14:37:10 -0300 Subject: [PATCH 151/229] Moving old files --- .../odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml.old | 0 .../odbfcl/adb_load_bugs_fixed/bugsGet.yml.old | 0 .../adb_load_bugs_fixed/create_sqlldr_bugs_fixed_table.sql.old | 0 .../odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql.old | 0 .../odbfcl/adb_load_filechksum/adb_load_filechksum.yml.old | 0 .../odbfcl/adb_load_filechksum/chksumGet.yml.old | 0 .../odbfcl/adb_load_filechksum/create_sqlldr_chksum_table.sql.old | 0 .../odbfcl/adb_load_filechksum/load_chksum_table.sql.old | 0 .../odbfcl/adb_load_filechksum/load_chksum_table_2.sql.old | 0 .../odbfcl/adb_load_symbols/adb_load_symbols.yml.old | 0 .../odbfcl/adb_load_symbols/create_sqlldr_symbols_table.sql.old | 0 .../odbfcl/adb_load_symbols/load_symbols_table.sql.old | 0 .../odbfcl/adb_load_symbols/symbolGet.yml.old | 0 .../adb_load_txtcollection_files.yml.old | 0 .../create_sqlldr_txtcollection_table.sql.old | 0 .../odbfcl/adb_load_txtcollection_files/fileGet.yml.old | 0 .../adb_load_txtcollection_files/load_txtcollection_table.sql.old | 0 .../odbfcl/extract/hashGet.yml.old | 0 .../odbfcl/tables_recreate.yml.old | 0 .../odbfcl/tables_recreate_adb.sql.old | 0 .../odbfcl/tables_recreate_adb.yml.old | 0 21 files changed, 0 insertions(+), 0 deletions(-) rename user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml => user_scripts_old/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml.old (100%) rename user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.yml => user_scripts_old/odbfcl/adb_load_bugs_fixed/bugsGet.yml.old (100%) rename user_scripts/odbfcl/adb_load_bugs_fixed/create_sqlldr_bugs_fixed_table.sql => user_scripts_old/odbfcl/adb_load_bugs_fixed/create_sqlldr_bugs_fixed_table.sql.old (100%) rename user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql => user_scripts_old/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql.old (100%) rename user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml => user_scripts_old/odbfcl/adb_load_filechksum/adb_load_filechksum.yml.old (100%) rename user_scripts/odbfcl/adb_load_filechksum/chksumGet.yml => user_scripts_old/odbfcl/adb_load_filechksum/chksumGet.yml.old (100%) rename user_scripts/odbfcl/adb_load_filechksum/create_sqlldr_chksum_table.sql => user_scripts_old/odbfcl/adb_load_filechksum/create_sqlldr_chksum_table.sql.old (100%) rename user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql => user_scripts_old/odbfcl/adb_load_filechksum/load_chksum_table.sql.old (100%) rename user_scripts/odbfcl/adb_load_filechksum/load_chksum_table_2.sql => user_scripts_old/odbfcl/adb_load_filechksum/load_chksum_table_2.sql.old (100%) rename user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml => user_scripts_old/odbfcl/adb_load_symbols/adb_load_symbols.yml.old (100%) rename user_scripts/odbfcl/adb_load_symbols/create_sqlldr_symbols_table.sql => user_scripts_old/odbfcl/adb_load_symbols/create_sqlldr_symbols_table.sql.old (100%) rename user_scripts/odbfcl/adb_load_symbols/load_symbols_table.sql => user_scripts_old/odbfcl/adb_load_symbols/load_symbols_table.sql.old (100%) rename user_scripts/odbfcl/adb_load_symbols/symbolGet.yml => user_scripts_old/odbfcl/adb_load_symbols/symbolGet.yml.old (100%) rename user_scripts/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml => user_scripts_old/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml.old (100%) rename user_scripts/odbfcl/adb_load_txtcollection_files/create_sqlldr_txtcollection_table.sql => user_scripts_old/odbfcl/adb_load_txtcollection_files/create_sqlldr_txtcollection_table.sql.old (100%) rename user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.yml => user_scripts_old/odbfcl/adb_load_txtcollection_files/fileGet.yml.old (100%) rename user_scripts/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql => user_scripts_old/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql.old (100%) rename user_scripts/odbfcl/extract/hashGet.yml => user_scripts_old/odbfcl/extract/hashGet.yml.old (100%) rename user_scripts/odbfcl/tables_recreate.yml => user_scripts_old/odbfcl/tables_recreate.yml.old (100%) rename user_scripts/odbfcl/tables_recreate_adb.sql => user_scripts_old/odbfcl/tables_recreate_adb.sql.old (100%) rename user_scripts/odbfcl/tables_recreate_adb.yml => user_scripts_old/odbfcl/tables_recreate_adb.yml.old (100%) diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml b/user_scripts_old/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml.old similarity index 100% rename from user_scripts/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml rename to user_scripts_old/odbfcl/adb_load_bugs_fixed/adb_load_bugs_fixed.yml.old diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.yml b/user_scripts_old/odbfcl/adb_load_bugs_fixed/bugsGet.yml.old similarity index 100% rename from user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.yml rename to user_scripts_old/odbfcl/adb_load_bugs_fixed/bugsGet.yml.old diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/create_sqlldr_bugs_fixed_table.sql b/user_scripts_old/odbfcl/adb_load_bugs_fixed/create_sqlldr_bugs_fixed_table.sql.old similarity index 100% rename from user_scripts/odbfcl/adb_load_bugs_fixed/create_sqlldr_bugs_fixed_table.sql rename to user_scripts_old/odbfcl/adb_load_bugs_fixed/create_sqlldr_bugs_fixed_table.sql.old diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql b/user_scripts_old/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql.old similarity index 100% rename from user_scripts/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql rename to user_scripts_old/odbfcl/adb_load_bugs_fixed/load_bugs_fixed_table.sql.old diff --git a/user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml b/user_scripts_old/odbfcl/adb_load_filechksum/adb_load_filechksum.yml.old similarity index 100% rename from user_scripts/odbfcl/adb_load_filechksum/adb_load_filechksum.yml rename to user_scripts_old/odbfcl/adb_load_filechksum/adb_load_filechksum.yml.old diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumGet.yml b/user_scripts_old/odbfcl/adb_load_filechksum/chksumGet.yml.old similarity index 100% rename from user_scripts/odbfcl/adb_load_filechksum/chksumGet.yml rename to user_scripts_old/odbfcl/adb_load_filechksum/chksumGet.yml.old diff --git a/user_scripts/odbfcl/adb_load_filechksum/create_sqlldr_chksum_table.sql b/user_scripts_old/odbfcl/adb_load_filechksum/create_sqlldr_chksum_table.sql.old similarity index 100% rename from user_scripts/odbfcl/adb_load_filechksum/create_sqlldr_chksum_table.sql rename to user_scripts_old/odbfcl/adb_load_filechksum/create_sqlldr_chksum_table.sql.old diff --git a/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql b/user_scripts_old/odbfcl/adb_load_filechksum/load_chksum_table.sql.old similarity index 100% rename from user_scripts/odbfcl/adb_load_filechksum/load_chksum_table.sql rename to user_scripts_old/odbfcl/adb_load_filechksum/load_chksum_table.sql.old diff --git a/user_scripts/odbfcl/adb_load_filechksum/load_chksum_table_2.sql b/user_scripts_old/odbfcl/adb_load_filechksum/load_chksum_table_2.sql.old similarity index 100% rename from user_scripts/odbfcl/adb_load_filechksum/load_chksum_table_2.sql rename to user_scripts_old/odbfcl/adb_load_filechksum/load_chksum_table_2.sql.old diff --git a/user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml b/user_scripts_old/odbfcl/adb_load_symbols/adb_load_symbols.yml.old similarity index 100% rename from user_scripts/odbfcl/adb_load_symbols/adb_load_symbols.yml rename to user_scripts_old/odbfcl/adb_load_symbols/adb_load_symbols.yml.old diff --git a/user_scripts/odbfcl/adb_load_symbols/create_sqlldr_symbols_table.sql b/user_scripts_old/odbfcl/adb_load_symbols/create_sqlldr_symbols_table.sql.old similarity index 100% rename from user_scripts/odbfcl/adb_load_symbols/create_sqlldr_symbols_table.sql rename to user_scripts_old/odbfcl/adb_load_symbols/create_sqlldr_symbols_table.sql.old diff --git a/user_scripts/odbfcl/adb_load_symbols/load_symbols_table.sql b/user_scripts_old/odbfcl/adb_load_symbols/load_symbols_table.sql.old similarity index 100% rename from user_scripts/odbfcl/adb_load_symbols/load_symbols_table.sql rename to user_scripts_old/odbfcl/adb_load_symbols/load_symbols_table.sql.old diff --git a/user_scripts/odbfcl/adb_load_symbols/symbolGet.yml b/user_scripts_old/odbfcl/adb_load_symbols/symbolGet.yml.old similarity index 100% rename from user_scripts/odbfcl/adb_load_symbols/symbolGet.yml rename to user_scripts_old/odbfcl/adb_load_symbols/symbolGet.yml.old diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml b/user_scripts_old/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml.old similarity index 100% rename from user_scripts/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml rename to user_scripts_old/odbfcl/adb_load_txtcollection_files/adb_load_txtcollection_files.yml.old diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/create_sqlldr_txtcollection_table.sql b/user_scripts_old/odbfcl/adb_load_txtcollection_files/create_sqlldr_txtcollection_table.sql.old similarity index 100% rename from user_scripts/odbfcl/adb_load_txtcollection_files/create_sqlldr_txtcollection_table.sql rename to user_scripts_old/odbfcl/adb_load_txtcollection_files/create_sqlldr_txtcollection_table.sql.old diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.yml b/user_scripts_old/odbfcl/adb_load_txtcollection_files/fileGet.yml.old similarity index 100% rename from user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.yml rename to user_scripts_old/odbfcl/adb_load_txtcollection_files/fileGet.yml.old diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql b/user_scripts_old/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql.old similarity index 100% rename from user_scripts/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql rename to user_scripts_old/odbfcl/adb_load_txtcollection_files/load_txtcollection_table.sql.old diff --git a/user_scripts/odbfcl/extract/hashGet.yml b/user_scripts_old/odbfcl/extract/hashGet.yml.old similarity index 100% rename from user_scripts/odbfcl/extract/hashGet.yml rename to user_scripts_old/odbfcl/extract/hashGet.yml.old diff --git a/user_scripts/odbfcl/tables_recreate.yml b/user_scripts_old/odbfcl/tables_recreate.yml.old similarity index 100% rename from user_scripts/odbfcl/tables_recreate.yml rename to user_scripts_old/odbfcl/tables_recreate.yml.old diff --git a/user_scripts/odbfcl/tables_recreate_adb.sql b/user_scripts_old/odbfcl/tables_recreate_adb.sql.old similarity index 100% rename from user_scripts/odbfcl/tables_recreate_adb.sql rename to user_scripts_old/odbfcl/tables_recreate_adb.sql.old diff --git a/user_scripts/odbfcl/tables_recreate_adb.yml b/user_scripts_old/odbfcl/tables_recreate_adb.yml.old similarity index 100% rename from user_scripts/odbfcl/tables_recreate_adb.yml rename to user_scripts_old/odbfcl/tables_recreate_adb.yml.old From d448d1bb2f87c31ae9c5c845588e51d49433b573 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 16 Feb 2024 16:55:14 -0300 Subject: [PATCH 152/229] Fix issues --- .gitignore | 3 +- tasks/main_loader_adb.yml | 1 + tasks/main_loader_manual.yml | 10 +- tasks/main_loader_uploads.yml.old | 203 ++++++++++++++++++ .../odbfcl/adb_load_expdp/adb_load_expdp.yml | 58 ----- user_scripts/odbfcl/def_adb_variables.yml | 32 +-- .../odbfcl/diff_calculate/diff_calculate.yml | 4 +- .../adb_load_expdp/adb_load_expdp.yml.old | 126 +++++++++++ 8 files changed, 354 insertions(+), 83 deletions(-) create mode 100644 tasks/main_loader_uploads.yml.old create mode 100644 user_scripts_old/odbfcl/adb_load_expdp/adb_load_expdp.yml.old diff --git a/.gitignore b/.gitignore index 30626ce..ea42fed 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,5 @@ config_oci.yml loader_uploads.yml main.retry tasks/main_loader_uploads.yml -tasks/main_loader_uploads.yml.old user_scripts/odbfcl/sh_extractor/*.zip -user_scripts/odbfcl/sh_extractor/build_zip.sh +user_scripts/odbfcl/sh_extractor/build_zip.sh \ No newline at end of file diff --git a/tasks/main_loader_adb.yml b/tasks/main_loader_adb.yml index 597c4a1..1b0b815 100644 --- a/tasks/main_loader_adb.yml +++ b/tasks/main_loader_adb.yml @@ -59,4 +59,5 @@ - patch.id >= (param_patch_from | float) or param_patch_from == -1 - patch.id <= (param_patch_to | float) or param_patch_to == -1 - patch.id > (out_of_box_id | float) or patch.type != "RU" # When RU, skip patch.id lower or equal to out_of_box_id + - (patch.version | default(db_version)) == db_version - param_type is undefined or param_type == patch.type \ No newline at end of file diff --git a/tasks/main_loader_manual.yml b/tasks/main_loader_manual.yml index e831dc4..4adad30 100644 --- a/tasks/main_loader_manual.yml +++ b/tasks/main_loader_manual.yml @@ -2,19 +2,18 @@ - name: Variables not provided fail: - msg: "Variables input_version / input_series / input_patch / input_file / input_trail must be defined." + msg: "Variables input_version / input_series / input_patch / input_file must be defined." when: input_version is undefined or (input_version|length == 0) or input_series is undefined or (input_series|length == 0) or input_patch is undefined or (input_patch|length == 0) or - input_file is undefined or (input_file|length == 0) or - input_trail is undefined or (input_trail|length == 0) + input_file is undefined or (input_file|length == 0) - name : Define db_version set_fact: db_version: "{{ input_version }}" param_type: "{{ input_series }}" param_patch: "{{ input_patch }}" - output_folder: "{{ stage_folder }}/temp_load/{{ input_trail }}" + output_folder: "{{ stage_folder }}/temp_load/{{ oci_adb_db_id }}" input_file_name: "{{ input_file | basename }}" - name: Delete content & directory @@ -157,7 +156,8 @@ - name : Define version set_fact: - patch_list: "{{ item.patch_list }}" + patch_list: "{{ item.patch_list }}" + db_version_short: "{{ db_version | replace('.','') }}" with_items: "{{ list_versions }}" when: item.id == db_version diff --git a/tasks/main_loader_uploads.yml.old b/tasks/main_loader_uploads.yml.old new file mode 100644 index 0000000..3626afb --- /dev/null +++ b/tasks/main_loader_uploads.yml.old @@ -0,0 +1,203 @@ +### Start +- name : Print d_uploads_id + debug: var=d_uploads_id + +- name : Define variables + set_fact: + #d_uploads_id: 42 + db_file_version: '' + db_file_type: '' + db_file_patch: '' + db_file_proc: '' + run_process: true + output_folder: '{{ stage_folder }}/temp_zip' + +- name : Define db_file_name + set_fact: + db_file_name: '{{output_folder}}/{{ d_uploads_id }}.zip' + +### Exit if check does not pass +- block: + + - name: Error + debug: + msg: 'd_uploads_id must be numeric.' + + - name : Exit + set_fact: + run_process: false + + when: d_uploads_id is not regex("^[0-9]+$") + +- block: + + ### Get data from database + - name: "Get data from D_UPLOADS table" + shell: | + set -eo pipefail + sqlplus -L -S {{ oci_adb_main_tns }} <<'EOF' + whenever sqlerror exit sql.sqlcode rollback + set pages 0 head off feed off echo off trim off trims on ver off term on serverout on + DECLARE + L_UPLOAD D_UPLOADS%ROWTYPE; + V_ID NUMBER := '{{ d_uploads_id }}'; + BEGIN + + -- Check if row can be processed. + SELECT * + INTO L_UPLOAD + FROM D_UPLOADS + WHERE ID = V_ID + AND STATUS = 3 + FOR UPDATE; + + -- Mark row as being processed. + UPDATE D_UPLOADS + SET + PROCESS_STARTED_ON = SYSTIMESTAMP + WHERE ID = L_UPLOAD.ID; + + COMMIT; + + -- Get info to process. + DBMS_OUTPUT.PUT_LINE(L_UPLOAD.ORAVERSION); + DBMS_OUTPUT.PUT_LINE(L_UPLOAD.ORASERIES); + DBMS_OUTPUT.PUT_LINE(L_UPLOAD.ORAPATCH); + EXCEPTION + WHEN NO_DATA_FOUND THEN + NULL; + END; + / + EOF + register: sql_output + + - name : Define variables from DB output + set_fact: + db_file_version: '{{ sql_output.stdout_lines[0] | trim }}' + db_file_type: '{{ sql_output.stdout_lines[1] | trim }}' + db_file_patch: '{{ sql_output.stdout_lines[2] | trim }}' + when: sql_output.stdout_lines[0] is defined + + - block: + + - name: Skipping + debug: + msg: "Skipping {{ d_uploads_id }}." + + - name : Exit + set_fact: + run_process: false + + when: db_file_version|length == 0 + + - name: Delete content & directory + file: + state: absent + path: "{{ output_folder }}" + + - name: Creates output folder + file: + path: "{{ output_folder }}" + state: directory + + - name: "Download BLOB" + shell: | + set -eo pipefail + cd "{{ output_folder }}" + sqlplus -L -S {{ oci_adb_main_tns }} <<'EOF' + whenever sqlerror exit sql.sqlcode rollback + set verify off feedback off heading off + set trimout on trimspool on pagesize 0 linesize 5000 long 100000000 longchunksize 32767 + set termout off + spool "{{ db_file_name }}.base64" + with function base64encode(p_blob in blob) return clob is + l_clob clob; + l_step pls_integer := 12000; -- make sure you set a multiple of 3 not higher than 24573 + begin + if dbms_lob.getlength(p_blob) = 0 then + return null; + end if; + for i in 0 .. trunc((dbms_lob.getlength(p_blob) - 1 )/l_step) loop + l_clob := l_clob || utl_raw.cast_to_varchar2(utl_encode.base64_encode(dbms_lob.substr(p_blob, l_step, i * l_step + 1))); + end loop; + return l_clob; + end; + select base64encode(blob_content) from d_uploads where id={{ d_uploads_id }}; + / + spool off + exit + EOF + base64 -d "{{ db_file_name }}.base64" > "{{ db_file_name }}" + rm -f "{{ db_file_name }}.base64" + register: sql_output + + ### Print call. + - name: "Calling loader_manual.yml" + debug: + msg: | + ansible-playbook ./loader_manual.yml \ + --extra-vars "input_version={{ db_file_version }} input_series={{ db_file_type }} input_patch={{ db_file_patch }} input_file={{ db_file_name }}" \ + >> /u01/patch_automation/auto_logs/run.log 2>> /u01/patch_automation/auto_logs/run.err + + ### Run manual loader for this file. + - name: "Run playbook loader_manual.yml" + shell: | + ansible-playbook ./loader_manual.yml \ + --extra-vars "input_version={{ db_file_version }} input_series={{ db_file_type }} input_patch={{ db_file_patch }} input_file={{ db_file_name }}" \ + >> /u01/patch_automation/auto_logs/run.{{ d_uploads_id }}.$(date '+%Y%m%d_%H%M%S').log 2>> /u01/patch_automation/auto_logs/run.{{ d_uploads_id }}.$(date '+%Y%m%d_%H%M%S').err + register: command_result + ignore_errors: yes + + ### Mark row as processed. + - name: "Update row for this label" + shell: | + set -eo pipefail + sqlplus -L -S {{ oci_adb_main_tns }} <<'EOF' + whenever sqlerror exit sql.sqlcode + + select * from d_uploads where id={{ d_uploads_id }} for update; + + -- Mark row as processed. + update d_uploads set process_finished_on=systimestamp where id={{ d_uploads_id }}; + + -- If delete was executed during the process, mark for re-execution. + update d_uploads set delete_finished_on=null where id={{ d_uploads_id }} and delete_finished_on is not null; + + commit; + + exit + EOF + register: sql_output + when: command_result.rc == 0 + + ### Mark row as processed. + - name: "Update row for this label" + shell: | + set -eo pipefail + sqlplus -L -S {{ oci_adb_main_tns }} <<'EOF' + whenever sqlerror exit sql.sqlcode + + select * from d_uploads where id={{ d_uploads_id }} for update; + + -- Mark row as processed. + update d_uploads set process_finished_on=systimestamp, failed_on=systimestamp where id={{ d_uploads_id }}; + + -- If delete was executed during the process, mark for re-execution. + update d_uploads set delete_finished_on=null where id={{ d_uploads_id }} and delete_finished_on is not null; + + commit; + + exit + EOF + register: sql_output + when: command_result.rc != 0 + + - name: Delete content & directory + file: + state: absent + path: "{{ output_folder }}" + when: command_result.rc == 0 + + when: run_process + +### \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml index 228e254..c90b9b0 100644 --- a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml +++ b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml @@ -20,16 +20,6 @@ oci_upload_file: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" object_action: "create" -# - name : Define source schema -# set_fact: -# dump_user_int: "{{ dump_user }}" -# when: db_version == "11.2.0.4" -# -# - name : Define source schema -# set_fact: -# dump_user_int: "c##{{ dump_user }}" -# when: db_version != "11.2.0.4" - # This is done because expdp/impdp still can't handle Credential using oracle native authentication (instance principal, tenancy id, etc), only swift. - include: tasks/local_sqlplus.yml vars: @@ -48,19 +38,6 @@ oci_object_name: "{{ dump_file_prefix }}.dmp" object_action: "remove" - # This is done because expdp/impdp still can't handle Credential using oracle native authentication (instance principal, tenancy id, etc), only swift. - # - name: Import DB Tables - # shell: | - # impdp \ - # userid={{ oci_adb_connection_tns }} \ - # directory=data_pump_dir \ - # credential='{{ oci_adb_credential }}' \ - # remap_schema='{{ dump_user_int }}:{{ oci_adb_transient_user }}' \ - # parallel=16 \ - # table_exists_action=truncate \ - # dumpfile={{ oci_adb_os_url_prefix }}/{{ dump_file_prefix }}.dmp > "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.{{ oci_adb_tns }}.log" 2>&1 - # register: shell_output - - include: tasks/local_sqlplus.yml vars: sql_param : { task_action : "Call import process" , @@ -70,20 +47,6 @@ params : "'{{ db_version }}' '{{ patch.base_ru | default('') }}{{ patch.type }}' '{{ patch.id }}' '{{ dump_file_prefix }}.dmp'" } -# - name: Import DB Tables -# shell: | -# impdp \ -# userid={{ oci_adb_connection_tns }} \ -# directory=data_pump_dir \ -# remap_schema='{{ dump_user }}:{{ oci_adb_transient_user }},c##{{ dump_user }}:{{ oci_adb_transient_user }}' \ -# parallel=16 \ -# table_exists_action=truncate \ -# content=data_only \ -# logfile={{ dump_file_prefix }}.log \ -# dumpfile={{ dump_file_prefix }}.dmp > "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.{{ oci_adb_tns }}.log" 2>&1 -# register: shell_output -# ignore_errors: yes - - include: tasks/local_sqlplus.yml vars: sql_param : { task_action : "Remove dumpfile from Oracle Directory" , @@ -102,25 +65,4 @@ params : "'{{ dump_file_prefix }}.log'" } -# - name: Import error output -# debug: msg="{{ shell_output.stderr_lines }}" -# when: shell_output.rc != 0 -# -# - name: impdp error -# fail: -# msg: "Check {{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.{{ oci_adb_tns }}.log." -# when: shell_output.rc != 0 and shell_output.rc != 5 -# -# - name: Check impdp error -# shell: | -# set -e +o pipefail -# v_tot=$(cat "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.{{ oci_adb_tns }}.log" | grep 'ORA-' | grep -v -E 'ORA-39146|ORA-28002' | wc -l) -# if [ $v_tot -ne 0 ] -# then -# exit 1 -# else -# exit 0 -# fi -# when: shell_output.rc == 5 - when: dump_stat_result.stat.exists \ No newline at end of file diff --git a/user_scripts/odbfcl/def_adb_variables.yml b/user_scripts/odbfcl/def_adb_variables.yml index 14bec4c..4fe7c5a 100644 --- a/user_scripts/odbfcl/def_adb_variables.yml +++ b/user_scripts/odbfcl/def_adb_variables.yml @@ -8,22 +8,22 @@ oci_adb_main_tns: "/@{{ oci_adb_user }}" when: oci_adb_use_wallet == true -- name: Generate oci_adb_transient_user - set_fact: - oci_adb_transient_user: "{{ oci_adb_user }}_{{ db_version | replace('.', '') }}" - when: oci_adb_force_transient_user is undefined or (oci_adb_force_transient_user|length == 0) +# - name: Generate oci_adb_transient_user +# set_fact: +# oci_adb_transient_user: "{{ oci_adb_user }}_{{ db_version | replace('.', '') }}" +# when: oci_adb_force_transient_user is undefined or (oci_adb_force_transient_user|length == 0) -- name: Force oci_adb_transient_user - set_fact: - oci_adb_transient_user: "{{ oci_adb_force_transient_user }}" - when: not (oci_adb_force_transient_user is undefined or (oci_adb_force_transient_user|length == 0)) +# - name: Force oci_adb_transient_user +# set_fact: +# oci_adb_transient_user: "{{ oci_adb_force_transient_user }}" +# when: not (oci_adb_force_transient_user is undefined or (oci_adb_force_transient_user|length == 0)) -- name: Define oci_adb_connection_tns - set_fact: - oci_adb_connection_tns: "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" - when: oci_adb_use_wallet == false +# - name: Define oci_adb_connection_tns +# set_fact: +# oci_adb_connection_tns: "{{ oci_adb_transient_user }}/{{ oci_adb_pass }}@{{ oci_adb_tns }}" +# when: oci_adb_use_wallet == false -- name: Define oci_adb_connection_tns - set_fact: - oci_adb_connection_tns: "/@{{ oci_adb_transient_user }}" - when: oci_adb_use_wallet == true +# - name: Define oci_adb_connection_tns +# set_fact: +# oci_adb_connection_tns: "/@{{ oci_adb_transient_user }}" +# when: oci_adb_use_wallet == true diff --git a/user_scripts/odbfcl/diff_calculate/diff_calculate.yml b/user_scripts/odbfcl/diff_calculate/diff_calculate.yml index 2f8b393..a422b9f 100644 --- a/user_scripts/odbfcl/diff_calculate/diff_calculate.yml +++ b/user_scripts/odbfcl/diff_calculate/diff_calculate.yml @@ -1,9 +1,9 @@ # This must come after MV_VERSIONS is reloaded -- name: "Load {{ oci_adb_transient_user }} diff code and contents" +- name: "Load {{ db_version_short }}_{{ oci_adb_db_id }} diff code and contents" shell: | set -e - v_folder="{{ stage_folder }}/temp_diff_{{ oci_adb_transient_user }}" + v_folder="{{ stage_folder }}/temp_diff_{{ db_version_short }}_{{ oci_adb_db_id }}" rm -rf "${v_folder}" mkdir "${v_folder}" cd "${v_folder}" diff --git a/user_scripts_old/odbfcl/adb_load_expdp/adb_load_expdp.yml.old b/user_scripts_old/odbfcl/adb_load_expdp/adb_load_expdp.yml.old new file mode 100644 index 0000000..228e254 --- /dev/null +++ b/user_scripts_old/odbfcl/adb_load_expdp/adb_load_expdp.yml.old @@ -0,0 +1,126 @@ +# For main.yml, the pre_prepare_dump_file.yml won't be called. +# So dump_stat_result may be false if the dump was created on this execution. +- name: "Check if {{ shared_folder }}/{{ dump_file_prefix }}.dmp exists" + stat: + path: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" + register: dump_stat_result + +# This dump_stat_result.stat.exists block is required only because this code is used +# for both the extraction (main.yml), where the file obviusly exists, but also on the +# loader_adb.yml. + +- block: + + - name: Upload expdp to OCI Bucket + include_role: + name: oci_object_storage_object + vars: + oci_upload_bucket: "{{ oci_adb_bucket }}" + oci_object_name: "{{ oci_upload_file | basename }}" + oci_upload_file: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" + object_action: "create" + +# - name : Define source schema +# set_fact: +# dump_user_int: "{{ dump_user }}" +# when: db_version == "11.2.0.4" +# +# - name : Define source schema +# set_fact: +# dump_user_int: "c##{{ dump_user }}" +# when: db_version != "11.2.0.4" + + # This is done because expdp/impdp still can't handle Credential using oracle native authentication (instance principal, tenancy id, etc), only swift. + - include: tasks/local_sqlplus.yml + vars: + sql_param : { task_action : "Copy file from Bucket to Oracle Directory" , + cred : "{{ oci_adb_main_tns }}" , + file : "adb_oradir_copy_file.sql" , + folder : "user_scripts/odbfcl/adb_load_expdp" , + params : "'{{ oci_adb_credential }}' '{{ oci_adb_os_url_prefix }}/{{ dump_file_prefix }}.dmp'" + } + + - name: Remove expdp from OCI Bucket + include_role: + name: oci_object_storage_object + vars: + oci_upload_bucket: "{{ oci_adb_bucket }}" + oci_object_name: "{{ dump_file_prefix }}.dmp" + object_action: "remove" + + # This is done because expdp/impdp still can't handle Credential using oracle native authentication (instance principal, tenancy id, etc), only swift. + # - name: Import DB Tables + # shell: | + # impdp \ + # userid={{ oci_adb_connection_tns }} \ + # directory=data_pump_dir \ + # credential='{{ oci_adb_credential }}' \ + # remap_schema='{{ dump_user_int }}:{{ oci_adb_transient_user }}' \ + # parallel=16 \ + # table_exists_action=truncate \ + # dumpfile={{ oci_adb_os_url_prefix }}/{{ dump_file_prefix }}.dmp > "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.{{ oci_adb_tns }}.log" 2>&1 + # register: shell_output + + - include: tasks/local_sqlplus.yml + vars: + sql_param : { task_action : "Call import process" , + cred : "{{ oci_adb_main_tns }}" , + file : "adb_process_dp_dump.sql" , + folder : "user_scripts/odbfcl/adb_load_expdp" , + params : "'{{ db_version }}' '{{ patch.base_ru | default('') }}{{ patch.type }}' '{{ patch.id }}' '{{ dump_file_prefix }}.dmp'" + } + +# - name: Import DB Tables +# shell: | +# impdp \ +# userid={{ oci_adb_connection_tns }} \ +# directory=data_pump_dir \ +# remap_schema='{{ dump_user }}:{{ oci_adb_transient_user }},c##{{ dump_user }}:{{ oci_adb_transient_user }}' \ +# parallel=16 \ +# table_exists_action=truncate \ +# content=data_only \ +# logfile={{ dump_file_prefix }}.log \ +# dumpfile={{ dump_file_prefix }}.dmp > "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.{{ oci_adb_tns }}.log" 2>&1 +# register: shell_output +# ignore_errors: yes + + - include: tasks/local_sqlplus.yml + vars: + sql_param : { task_action : "Remove dumpfile from Oracle Directory" , + cred : "{{ oci_adb_main_tns }}" , + file : "adb_oradir_remove_file.sql" , + folder : "user_scripts/odbfcl/adb_load_expdp" , + params : "'{{ dump_file_prefix }}.dmp'" + } + + - include: tasks/local_sqlplus.yml + vars: + sql_param : { task_action : "Remove logfile from Oracle Directory" , + cred : "{{ oci_adb_main_tns }}" , + file : "adb_oradir_remove_file.sql" , + folder : "user_scripts/odbfcl/adb_load_expdp" , + params : "'{{ dump_file_prefix }}.log'" + } + +# - name: Import error output +# debug: msg="{{ shell_output.stderr_lines }}" +# when: shell_output.rc != 0 +# +# - name: impdp error +# fail: +# msg: "Check {{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.{{ oci_adb_tns }}.log." +# when: shell_output.rc != 0 and shell_output.rc != 5 +# +# - name: Check impdp error +# shell: | +# set -e +o pipefail +# v_tot=$(cat "{{ output_folder }}/expdp/{{ dump_file_prefix }}.imp.{{ oci_adb_tns }}.log" | grep 'ORA-' | grep -v -E 'ORA-39146|ORA-28002' | wc -l) +# if [ $v_tot -ne 0 ] +# then +# exit 1 +# else +# exit 0 +# fi +# when: shell_output.rc == 5 + + when: dump_stat_result.stat.exists \ No newline at end of file From 72fe4b299b481051606d3cc5e5fe3a9e505e8698 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 13 Mar 2024 12:15:51 -0300 Subject: [PATCH 153/229] Including 10.2 release --- list_patches.yml | 128 ++++++++++++++++++++++++++++++++++++++++++++++ list_versions.yml | 10 ++++ 2 files changed, 138 insertions(+) diff --git a/list_patches.yml b/list_patches.yml index 2843bf4..06024a1 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -1,3 +1,131 @@ +#################### +##### 10.2.0.X ##### +#################### + +# 10.2.0.4 Patch Set Updates - List of Fixes in each PSU (Doc ID 1340024.1) +# 10.2.0.5 Patch Set Updates - List of Fixes in each PSU (Doc ID 1337394.1) + +list_1020X: +# 10.2.0.1 + - { version : "10.2.0.1" , type : "BASE" , id : 0 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.10.2.0.1.tar.gz" } + - { version : "10.2.0.1" , type : "CPU" , id : 200601 , patch_number : 4751931 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.1" , type : "CPU" , id : 200604 , patch_number : 5049080 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.1" , type : "CPU" , id : 200607 , patch_number : 5225798 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.1" , type : "CPU" , id : 200610 , patch_number : 5490846 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.1" , type : "CPU" , id : 200701 , patch_number : 5689937 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } +# - { version : "10.2.0.1" , type : "CPU" , id : 200704 , patch_number : 5901880 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX +# 10.2.0.2 + - { version : "10.2.0.2" , type : "BASE" , id : 0 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.10.2.0.2.tar.gz" } + - { version : "10.2.0.2" , type : "CPU" , id : 200604 , patch_number : 5079037 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.2" , type : "CPU" , id : 200607 , patch_number : 5225799 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.2" , type : "CPU" , id : 200610 , patch_number : 5490848 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.2" , type : "CPU" , id : 200701 , patch_number : 5689957 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.2" , type : "CPU" , id : 200704 , patch_number : 5901881 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.2" , type : "CPU" , id : 200707 , patch_number : 6079588 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.2" , type : "CPU" , id : 200710 , patch_number : 6394997 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.2" , type : "CPU" , id : 200801 , patch_number : 6646850 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } +# - { version : "10.2.0.2" , type : "CPU" , id : 200804 , patch_number : 6864071 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX +# - { version : "10.2.0.2" , type : "CPU" , id : 200807 , patch_number : 7154083 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX +# - { version : "10.2.0.2" , type : "CPU" , id : 200810 , patch_number : 7375660 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX +# - { version : "10.2.0.2" , type : "CPU" , id : 200901 , patch_number : 7592355 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX +# 10.2.0.3 + - { version : "10.2.0.3" , type : "BASE" , id : 0 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.10.2.0.3.tar.gz" } + - { version : "10.2.0.3" , type : "CPU" , id : 200701 , patch_number : 5881721 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.3" , type : "CPU" , id : 200704 , patch_number : 5901891 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.3" , type : "CPU" , id : 200707 , patch_number : 6079591 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.3" , type : "CPU" , id : 200710 , patch_number : 6394981 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.3" , type : "CPU" , id : 200801 , patch_number : 6646853 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.3" , type : "CPU" , id : 200804 , patch_number : 6864068 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.3" , type : "CPU" , id : 200807 , patch_number : 7150622 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.3" , type : "CPU" , id : 200810 , patch_number : 7369190 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.3" , type : "CPU" , id : 200901 , patch_number : 7592354 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } +# 10.2.0.4 + - { version : "10.2.0.4" , type : "BASE" , id : 0 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.10.2.0.4.tar.gz" } + - { version : "10.2.0.4" , type : "PSU" , id : 1 , patch_number : 8576156 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "PSU" , id : 2 , patch_number : 8833280 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "PSU" , id : 3 , patch_number : 9119284 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "PSU" , id : 4 , patch_number : 9352164 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "PSU" , id : 5 , patch_number : 9654991 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "PSU" , id : 6 , patch_number : 9952234 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "PSU" , id : 7 , patch_number : 10248636 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "PSU" , id : 8 , patch_number : 11724977 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "PSU" , id : 9 , patch_number : 12419397 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "PSU" , id : 10 , patch_number : 12827778 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "PSU" , id : 11 , patch_number : 12879929 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "PSU" , id : 12 , patch_number : 12879933 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } +# - { version : "10.2.0.4" , type : "PSU" , id : 13 , patch_number : 13923851 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX +# - { version : "10.2.0.4" , type : "PSU" , id : 14 , patch_number : 14275630 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX +# - { version : "10.2.0.4" , type : "PSU" , id : 15 , patch_number : 14736542 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX +# - { version : "10.2.0.4" , type : "PSU" , id : 16 , patch_number : 16056269 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX +# - { version : "10.2.0.4" , type : "PSU" , id : 17 , patch_number : 16619897 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX + - { version : "10.2.0.4" , type : "CPU" , id : 200807 , patch_number : 7150470 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "CPU" , id : 200810 , patch_number : 7375644 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "CPU" , id : 200901 , patch_number : 7592346 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "CPU" , id : 200904 , patch_number : 8290506 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "CPU" , id : 200907 , patch_number : 8534387 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "CPU" , id : 200910 , patch_number : 8836308 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "CPU" , id : 201001 , patch_number : 9119226 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "CPU" , id : 201004 , patch_number : 9352191 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "CPU" , id : 201007 , patch_number : 9655017 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "CPU" , id : 201010 , patch_number : 9952272 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "CPU" , id : 201101 , patch_number : 10249540 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "CPU" , id : 201104 , patch_number : 11725015 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "CPU" , id : 201107 , patch_number : 12419249 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "CPU" , id : 201110 , patch_number : 12828112 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "CPU" , id : 201201 , patch_number : 12879912 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "CPU" , id : 201204 , patch_number : 12879926 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } +# - { version : "10.2.0.4" , type : "CPU" , id : 201207 , patch_number : 14038814 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NOT AVAILABLE + - { version : "10.2.0.4" , type : "CPU" , id : 201207 , patch_number : 14038833 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # EXCEPTION - PASSWORD PROTECTED +# - { version : "10.2.0.4" , type : "CPU" , id : 201210 , patch_number : 14390410 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NOT AVAILABLE + - { version : "10.2.0.4" , type : "CPU" , id : 201210 , patch_number : 14038840 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # EXCEPTION - PASSWORD PROTECTED +# - { version : "10.2.0.4" , type : "CPU" , id : 201301 , patch_number : 14841471 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NOT AVAILABLE + - { version : "10.2.0.4" , type : "CPU" , id : 201301 , patch_number : 14038841 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # EXCEPTION - PASSWORD PROTECTED +# - { version : "10.2.0.4" , type : "CPU" , id : 201304 , patch_number : 16270931 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NOT AVAILABLE + - { version : "10.2.0.4" , type : "CPU" , id : 201304 , patch_number : 14038843 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # EXCEPTION - PASSWORD PROTECTED +# - { version : "10.2.0.4" , type : "CPU" , id : 201307 , patch_number : 16742253 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NOT AVAILABLE + - { version : "10.2.0.4" , type : "CPU" , id : 201307 , patch_number : 14038845 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # EXCEPTION - PASSWORD PROTECTED +# 10.2.0.5 + - { version : "10.2.0.5" , type : "BASE" , id : 0 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.10.2.0.5.tar.gz" } + - { version : "10.2.0.5" , type : "PSU" , id : 1 , patch_number : 9952230 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "PSU" , id : 2 , patch_number : 10248542 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "PSU" , id : 3 , patch_number : 11724962 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "PSU" , id : 4 , patch_number : 12419392 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "PSU" , id : 5 , patch_number : 12827745 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "PSU" , id : 6 , patch_number : 13343471 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "PSU" , id : 7 , patch_number : 13632743 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "PSU" , id : 8 , patch_number : 13923855 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "PSU" , id : 9 , patch_number : 14275629 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "PSU" , id : 10 , patch_number : 14727319 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "PSU" , id : 11 , patch_number : 16056270 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "PSU" , id : 12 , patch_number : 16619894 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "PSU" , id : 13 , patch_number : 17082365 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "PSU" , id : 14 , patch_number : 17465584 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "PSU" , id : 15 , patch_number : 18031728 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "PSU" , id : 16 , patch_number : 18522511 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "PSU" , id : 17 , patch_number : 19274523 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "PSU" , id : 18 , patch_number : 19769505 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "PSU" , id : 19 , patch_number : 20299014 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "CPU" , id : 201010 , patch_number : 9952270 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "CPU" , id : 201101 , patch_number : 10249537 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "CPU" , id : 201104 , patch_number : 11725006 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "CPU" , id : 201107 , patch_number : 12419258 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "CPU" , id : 201110 , patch_number : 12828105 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "CPU" , id : 201201 , patch_number : 13343467 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "CPU" , id : 201204 , patch_number : 13632738 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "CPU" , id : 201207 , patch_number : 14038805 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "CPU" , id : 201210 , patch_number : 14390396 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "CPU" , id : 201301 , patch_number : 14841459 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "CPU" , id : 201304 , patch_number : 16270946 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "CPU" , id : 201307 , patch_number : 16742123 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "CPU" , id : 201310 , patch_number : 17082371 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "CPU" , id : 201401 , patch_number : 17551414 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "CPU" , id : 201404 , patch_number : 18139709 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "CPU" , id : 201407 , patch_number : 18681879 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "CPU" , id : 201410 , patch_number : 19274521 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "CPU" , id : 201501 , patch_number : 19854436 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } +# - { version : "10.2.0.5" , type : "CPU" , id : 201504 , patch_number : x , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NOTHING TO FIX - NO PATCH CREATED + - { version : "10.2.0.5" , type : "CPU" , id : 201507 , patch_number : 20299021 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + #################### ##### 11.1.0.X ##### #################### diff --git a/list_versions.yml b/list_versions.yml index 1aae949..c4f17e2 100644 --- a/list_versions.yml +++ b/list_versions.yml @@ -8,6 +8,11 @@ # Out of box ID: What is the ID of the base snap. Null means the base snap is not to be used. list_versions: + - { id : "10.2.0.1" , patch_list : "list_1020X" , main_file : "patch_main_11g.yml" , opatch_file : "p6880880_102000_Linux-x86-64.zip" } + - { id : "10.2.0.2" , patch_list : "list_1020X" , main_file : "patch_main_11g.yml" , opatch_file : "p6880880_102000_Linux-x86-64.zip" } + - { id : "10.2.0.3" , patch_list : "list_1020X" , main_file : "patch_main_11g.yml" , opatch_file : "p6880880_102000_Linux-x86-64.zip" } + - { id : "10.2.0.4" , patch_list : "list_1020X" , main_file : "patch_main_11g.yml" , opatch_file : "p6880880_102000_Linux-x86-64.zip" } + - { id : "10.2.0.5" , patch_list : "list_1020X" , main_file : "patch_main_11g.yml" , opatch_file : "p6880880_102000_Linux-x86-64.zip" } - { id : "11.1.0.6" , patch_list : "list_1110X" , main_file : "patch_main_11g.yml" , opatch_file : "p6880880_111000_Linux-x86-64.zip" } - { id : "11.1.0.7" , patch_list : "list_1110X" , main_file : "patch_main_11g.yml" , opatch_file : "p6880880_111000_Linux-x86-64.zip" } - { id : "11.2.0.1" , patch_list : "list_1120X" , main_file : "patch_main_11g.yml" , opatch_file : "p6880880_112000_Linux-x86-64.zip" } @@ -32,6 +37,11 @@ list_info_vbox: - { id : "21.0.0.0" , vmachine : "Oracle Linux 8" , base_snap : "21.0.0.0 Ready" , ip : "xxx" } list_info_oci: + - { id : "10.2.0.1" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } + - { id : "10.2.0.2" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } + - { id : "10.2.0.3" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } + - { id : "10.2.0.4" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } + - { id : "10.2.0.5" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } - { id : "11.1.0.6" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } - { id : "11.1.0.7" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } - { id : "11.2.0.1" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } From 86f03053b9bc5f39d2def566cf976de008d22268 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 13 Mar 2024 14:51:49 -0300 Subject: [PATCH 154/229] 10.2 support --- loader.yml | 15 +++++++++++++++ loader_adb.yml | 15 +++++++++++++++ main.yml | 15 +++++++++++++++ 3 files changed, 45 insertions(+) diff --git a/loader.yml b/loader.yml index 7348172..42d112f 100644 --- a/loader.yml +++ b/loader.yml @@ -34,6 +34,21 @@ tasks: + - include: tasks/main_loader.yml db_version="10.2.0.1" + when: param_version is undefined or param_version == "10.2.0.1" or param_version == "10.2" + + - include: tasks/main_loader.yml db_version="10.2.0.2" + when: param_version is undefined or param_version == "10.2.0.2" or param_version == "10.2" + + - include: tasks/main_loader.yml db_version="10.2.0.3" + when: param_version is undefined or param_version == "10.2.0.3" or param_version == "10.2" + + - include: tasks/main_loader.yml db_version="10.2.0.4" + when: param_version is undefined or param_version == "10.2.0.4" or param_version == "10.2" + + - include: tasks/main_loader.yml db_version="10.2.0.5" + when: param_version is undefined or param_version == "10.2.0.5" or param_version == "10.2" + - include: tasks/main_loader.yml db_version="11.1.0.6" when: param_version is undefined or param_version == "11.1.0.6" or param_version == "11.1" diff --git a/loader_adb.yml b/loader_adb.yml index df0089b..05f03ca 100644 --- a/loader_adb.yml +++ b/loader_adb.yml @@ -35,6 +35,21 @@ tasks: + - include: tasks/main_loader_adb.yml db_version="10.2.0.1" + when: param_version is undefined or param_version == "10.2.0.1" or param_version == "10.2" + + - include: tasks/main_loader_adb.yml db_version="10.2.0.2" + when: param_version is undefined or param_version == "10.2.0.2" or param_version == "10.2" + + - include: tasks/main_loader_adb.yml db_version="10.2.0.3" + when: param_version is undefined or param_version == "10.2.0.3" or param_version == "10.2" + + - include: tasks/main_loader_adb.yml db_version="10.2.0.4" + when: param_version is undefined or param_version == "10.2.0.4" or param_version == "10.2" + + - include: tasks/main_loader_adb.yml db_version="10.2.0.5" + when: param_version is undefined or param_version == "10.2.0.5" or param_version == "10.2" + - include: tasks/main_loader_adb.yml db_version="11.1.0.6" when: param_version is undefined or param_version == "11.1.0.6" or param_version == "11.1" diff --git a/main.yml b/main.yml index 0601c72..209e2ff 100644 --- a/main.yml +++ b/main.yml @@ -41,6 +41,21 @@ - import_tasks: tasks/config_checks.yml - import_tasks: tasks/setup_env.yml + - include: tasks/main_PSU_BP.yml db_version="10.2.0.1" + when: param_version is undefined or param_version == "10.2.0.1" or param_version == "10.2" + + - include: tasks/main_PSU_BP.yml db_version="10.2.0.2" + when: param_version is undefined or param_version == "10.2.0.2" or param_version == "10.2" + + - include: tasks/main_PSU_BP.yml db_version="10.2.0.3" + when: param_version is undefined or param_version == "10.2.0.3" or param_version == "10.2" + + - include: tasks/main_PSU_BP.yml db_version="10.2.0.4" + when: param_version is undefined or param_version == "10.2.0.4" or param_version == "10.2" + + - include: tasks/main_PSU_BP.yml db_version="10.2.0.5" + when: param_version is undefined or param_version == "10.2.0.5" or param_version == "10.2" + - include: tasks/main_PSU_BP.yml db_version="11.1.0.6" when: param_version is undefined or param_version == "11.1.0.6" or param_version == "11.1" From 24512681d681283e6292080719c1b6d4b233f189 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 13 Mar 2024 14:53:21 -0300 Subject: [PATCH 155/229] Avoid conflicts between dev, stg, prd on shared folder --- config_oci.yml | 19 +++++-------------- .../tasks/main.yml | 6 +++--- set_version.yml | 2 +- tasks/setup_env.yml | 6 +++--- 4 files changed, 12 insertions(+), 21 deletions(-) diff --git a/config_oci.yml b/config_oci.yml index 794a9d1..2dcc2d5 100644 --- a/config_oci.yml +++ b/config_oci.yml @@ -6,10 +6,12 @@ patch_location_path : patches # Folder in RW mode on local compute and shared with the VM. It is used to move the patches to the VMs and also to copy back the expdp output. stage_folder : "/u01/patch_automation/stage" -shared_folder : "/u02" +shared_mount : "/u02" +shared_folder : "/u02/prd" # Path of the folder mounted within the VM. This is the path of the "shared_folder" in the VM. -VM_folder : "/u02" +VM_mount : "/u02" +VM_folder : "/u02/prd" # Oracle SID of the database that we are collecting data from. Must be included in /etc/oratab for oraenv utility. default_sid : "orcl" @@ -24,24 +26,13 @@ downloader_user : "" downloader_pass : "" # Files in "user_scripts" folder that will run before and after the final expdp. script_types can be "shell", "sql" or "yml". -user_expdp_pre : -# - { file : "bugsGet.yml" , folder : "user_scripts/odbfcl/adb_load_bugs_fixed" , type : "yml", task_action : "Generate fixed bugs list for ORACLE_HOME" } -# - { file : "chksumGet.yml" , folder : "user_scripts/odbfcl/adb_load_filechksum" , type : "yml", task_action : "Generate chksum for ORACLE_HOME" } -# - { file : "fileGet.yml" , folder : "user_scripts/odbfcl/adb_load_txtcollection_files" , type : "yml", task_action : "Collect non-binary files from ORACLE_HOME" } -# - { file : "symbolGet.yml" , folder : "user_scripts/odbfcl/adb_load_symbols" , type : "yml", task_action : "Get all symbols on ORACLE_HOME binaries and libs" } -# - { file : "tables_recreate.yml" , folder : "user_scripts/odbfcl" , type : "yml" , task_action : "Recreate tables" } -# - { file : "hashGet.yml" , folder : "user_scripts/odbfcl/extract" , type : "yml", task_action : "Collect Database Info" } +user_expdp_pre : - { file : "runExtractor.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Collect DB Info" } - { file : "externalDir.yml" , type : "yml" , task_action : "Create External Directory" } user_expdp_post : - { file : "def_adb_variables.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Define ansible ADB variables" } -# - { file : "tables_recreate_adb.yml" , folder : "user_scripts/odbfcl" , type : "yml", task_action : "Recreate tables in ADB" } - { file : "adb_load_expdp.yml" , folder : "user_scripts/odbfcl/adb_load_expdp" , type : "yml", task_action : "impdp files from OS to ADB" } -# - { file : "adb_load_bugs_fixed.yml" , folder : "user_scripts/odbfcl/adb_load_bugs_fixed" , type : "yml", task_action : "Load fixed bugs list for ORACLE_HOME in ADB" } -# - { file : "adb_load_filechksum.yml" , folder : "user_scripts/odbfcl/adb_load_filechksum" , type : "yml", task_action : "Load chksum for ORACLE_HOME in ADB" } -# - { file : "adb_load_symbols.yml" , folder : "user_scripts/odbfcl/adb_load_symbols" , type : "yml", task_action : "Load chksum for ORACLE_HOME in ADB" } -# - { file : "adb_load_txtcollection_files.yml" , folder : "user_scripts/odbfcl/adb_load_txtcollection_files" , type : "yml", task_action : "Load non-binary files from ORACLE_HOME in ADB" } - { file : "diff_calculate.yml" , folder : "user_scripts/odbfcl/diff_calculate" , type : "yml", task_action : "Generate differences between 2 releases" } # User that will hold your tables outputs and be exported after each execution. If the database is CDB, "C##" will be automatically be appended. diff --git a/roles/oci_compute_instance_actions/tasks/main.yml b/roles/oci_compute_instance_actions/tasks/main.yml index e4ab524..25cd54f 100644 --- a/roles/oci_compute_instance_actions/tasks/main.yml +++ b/roles/oci_compute_instance_actions/tasks/main.yml @@ -45,14 +45,14 @@ ansible_connection: local when: not oci_action.changed - - name: Ensure shared disk "{{ VM_folder }}" is mounted + - name: Ensure shared disk "{{ VM_mount }}" is mounted shell: | set -eo pipefail - if mount | grep -q -F ' {{ VM_folder }} ' + if mount | grep -q -F ' {{ VM_mount }} ' then echo ok else - mount {{ VM_folder }} + mount {{ VM_mount }} fi become: true become_user: root diff --git a/set_version.yml b/set_version.yml index 12f4ed3..494598e 100644 --- a/set_version.yml +++ b/set_version.yml @@ -56,4 +56,4 @@ - include: tasks/main_RU_RUR.yml db_version="{{ param_version }}" # when: not(param_version == "11.2.0.2" or param_version == "11.2.0.3" or param_version == "11.2.0.4" or param_version == "12.1.0.1" or param_version == "12.1.0.2") - when: not( ( param_version | regex_replace('^(^[\.]+).*','\\1') | int ) <= 11 or param_version == "12.1.0.1" or param_version == "12.1.0.2" ) \ No newline at end of file + when: ( param_version | regex_replace('^([^\.]+).*','\\1') | int ) > 12 and param_version != "12.1.0.1" and param_version != "12.1.0.2" \ No newline at end of file diff --git a/tasks/setup_env.yml b/tasks/setup_env.yml index 11e0ae8..ea96746 100644 --- a/tasks/setup_env.yml +++ b/tasks/setup_env.yml @@ -1,11 +1,11 @@ -- name: Ensure shared disk "{{ shared_folder }}" is mounted +- name: Ensure shared disk "{{ shared_mount }}" is mounted shell: | set -eo pipefail - if mount | grep -q -F ' {{ shared_folder }} ' + if mount | grep -q -F ' {{ shared_mount }} ' then echo ok else - mount {{ shared_folder }} + mount {{ shared_mount }} fi become: true become_user: root From 7485328f882a8be34267fb3571120b12ca1943ad Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 13 Mar 2024 14:54:12 -0300 Subject: [PATCH 156/229] Adapt exporter for 10.2 --- user_scripts/odbfcl/extract/load_custom.sql | 66 ++++++------ .../odbfcl/extract/load_database_vault.sql | 53 +++++----- user_scripts/odbfcl/extract/load_dba_cdb.sql | 100 +++++++++--------- user_scripts/odbfcl/extract/load_source.sql | 2 +- user_scripts/odbfcl/extract/load_v_dollar.sql | 95 +++++++++-------- user_scripts/odbfcl/extract/load_view.sql | 90 ++++++++-------- .../load_underscore_10.2.0.1.sql | 6 ++ .../load_underscore_10.2.0.2.sql | 6 ++ .../load_underscore_10.2.0.3.sql | 6 ++ .../load_underscore_10.2.0.4.sql | 6 ++ .../load_underscore_10.2.0.5.sql | 6 ++ .../load_underscore_vv_10.2.0.1.sql | 6 ++ .../load_underscore_vv_10.2.0.2.sql | 6 ++ .../load_underscore_vv_10.2.0.3.sql | 6 ++ .../load_underscore_vv_10.2.0.4.sql | 6 ++ .../load_underscore_vv_10.2.0.5.sql | 6 ++ .../odbfcl/sh_extractor/dumpCreate.sh | 18 +++- user_scripts/odbfcl/sh_extractor/exporter.sh | 2 +- 18 files changed, 282 insertions(+), 204 deletions(-) create mode 100644 user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.1.sql create mode 100644 user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.2.sql create mode 100644 user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.3.sql create mode 100644 user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.4.sql create mode 100644 user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.5.sql create mode 100644 user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.1.sql create mode 100644 user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.2.sql create mode 100644 user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.3.sql create mode 100644 user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.4.sql create mode 100644 user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.5.sql diff --git a/user_scripts/odbfcl/extract/load_custom.sql b/user_scripts/odbfcl/extract/load_custom.sql index 9fe4da4..45dca76 100644 --- a/user_scripts/odbfcl/extract/load_custom.sql +++ b/user_scripts/odbfcl/extract/load_custom.sql @@ -1,15 +1,16 @@ DECLARE V_VERS_1D NUMBER := '&P_VERS_1D.'; + V_VERS_4D VARCHAR2(20) := '&P_VERS_4D.'; PROCEDURE RUN_INSERT (IN_TAB_NAME VARCHAR2, OUT_TAB_NAME VARCHAR2, IN_WHERE_CLAUSE_12 VARCHAR2 DEFAULT NULL, IN_WHERE_CLAUSE_11 VARCHAR2 DEFAULT NULL) AS - V_TAB_COLS CLOB; - V_INS_COLS CLOB; - V_SQL CLOB; + V_TAB_COLS VARCHAR2(32767); + V_INS_COLS VARCHAR2(32767); + V_SQL VARCHAR2(32767); -- 10.2 does not support CLOB for EXECUTE IMMEDIATE V_CDB_CLAUSE VARCHAR2(30); BEGIN - IF V_VERS_1D = 11 THEN + IF V_VERS_1D <= 11 THEN V_CDB_CLAUSE := ''; else V_CDB_CLAUSE := ', CON_ID'; @@ -17,49 +18,46 @@ DECLARE -- Bug 22168436 ORA-600 [kkdoilsn2] on select from CONTAINERS(...) - Using BLOB / ANYDATA / XMLTYPE. - $IF DBMS_DB_VERSION.VER_LE_11_1 + $IF DBMS_DB_VERSION.VER_LE_10_2 $THEN - select wm_concat(c1_column_name), - wm_concat(c2_column_name) - into v_tab_cols, v_ins_cols - from ( - select c1.column_name c1_column_name, - nvl(c2.column_name,'NULL') c2_column_name - from dba_tab_columns c1, dba_tab_columns c2 - where c1.table_name = OUT_TAB_NAME - and c2.table_name (+) = IN_TAB_NAME - and c1.owner = '&v_username.' - and c2.owner(+) = 'SYS' - and c1.column_name = c2.column_name (+) - and c1.column_name not in ('CON_ID') - order by c1.column_id - ); + select wm_concat(c1_column_name), + wm_concat(c2_column_name) + $ELSIF DBMS_DB_VERSION.VER_LE_11_1 + $THEN + select wm_concat(c1_column_name), + wm_concat(c2_column_name) $ELSE - select listagg(c1.column_name,', ') within group(order by c1.column_id), - listagg(nvl(c2.column_name,'NULL'),', ') within group(order by c1.column_id) - into V_TAB_COLS, V_INS_COLS - from dba_tab_columns c1, dba_tab_columns c2 - where c1.table_name = OUT_TAB_NAME - and c2.table_name (+) = IN_TAB_NAME - and c1.owner = '&v_username.' - and c2.owner(+) = 'SYS' - and c1.column_name = c2.column_name (+) - and c1.column_name not in ('CON_ID'); + select listagg(c1_column_name,', ') within group(order by column_id), + listagg(c2_column_name,', ') within group(order by column_id) $END + into v_tab_cols, v_ins_cols + from ( + select c1.column_name c1_column_name, + nvl(c2.column_name,'NULL') c2_column_name, + c1.column_id + from dba_tab_columns c1, dba_tab_columns c2 + where c1.table_name = OUT_TAB_NAME + and c2.table_name (+) = IN_TAB_NAME + and c1.owner = '&v_username.' + and c2.owner(+) = 'SYS' + and c1.column_name = c2.column_name (+) + and c1.column_name not in ('CON_ID') + order by c1.column_id + ); V_SQL := 'INSERT /*+ APPEND */ INTO &v_username..' || OUT_TAB_NAME || '(' || V_TAB_COLS || V_CDB_CLAUSE || ') SELECT '; V_SQL := V_SQL || V_INS_COLS || V_CDB_CLAUSE; - IF V_VERS_1D = 11 THEN + IF V_VERS_1D <= 11 THEN V_SQL := V_SQL || ' FROM ' || IN_TAB_NAME; - ELSIF V_VERS_1D = '12.1.0.1' THEN + ELSIF V_VERS_4D = '12.1.0.1' THEN V_SQL := V_SQL || ' FROM CDB$VIEW("' || IN_TAB_NAME || '")'; ELSE V_SQL := V_SQL || ' FROM CONTAINERS(' || IN_TAB_NAME || ')'; END IF; - IF V_VERS_1D = 11 THEN + IF V_VERS_1D <= 11 THEN IF IN_WHERE_CLAUSE_11 IS NOT NULL THEN V_SQL := V_SQL || ' WHERE ' || IN_WHERE_CLAUSE_11; END IF; @@ -76,7 +74,7 @@ DECLARE BEGIN DBMS_OUTPUT.ENABLE(NULL); - IF V_VERS_1D != 11 THEN + IF V_VERS_1D > 11 THEN RUN_INSERT ('AUDIT_UNIFIED_POLICIES','T_AUDIT_UNIFIED_POLICIES'); RUN_INSERT ('AUDIT_UNIFIED_ENABLED_POLICIES','T_AUD_UNIFIED_ENABLED_POLICIES'); RUN_INSERT ('AUDIT_UNIFIED_POLICY_COMMENTS','T_AUD_UNIFIED_POLICY_COMMENTS'); diff --git a/user_scripts/odbfcl/extract/load_database_vault.sql b/user_scripts/odbfcl/extract/load_database_vault.sql index 5cdfe4d..c848684 100644 --- a/user_scripts/odbfcl/extract/load_database_vault.sql +++ b/user_scripts/odbfcl/extract/load_database_vault.sql @@ -12,47 +12,44 @@ DECLARE V_CDB_CLAUSE VARCHAR2(30); BEGIN - IF V_VERS_1D = 11 THEN + IF V_VERS_1D <= 11 THEN V_CDB_CLAUSE := ''; else V_CDB_CLAUSE := ', CON_ID'; END IF; - $IF DBMS_DB_VERSION.VER_LE_11_1 + $IF DBMS_DB_VERSION.VER_LE_10_2 $THEN - select wm_concat(c1_column_name), - wm_concat(c2_column_name) - into v_tab_cols, v_ins_cols - from ( - select c1.column_name c1_column_name, - nvl(c2.column_name,'NULL') c2_column_name - from dba_tab_columns c1, dba_tab_columns c2 - where c1.table_name = OUT_TAB_NAME - and c2.table_name (+) = IN_TAB_NAME - and c1.owner = V_USER - and c2.owner(+) = 'DVSYS' - and c1.column_name = c2.column_name (+) - and c1.column_name not in ('CON_ID') - order by c1.column_id - ); + select wm_concat(c1_column_name), + wm_concat(c2_column_name) + $ELSIF DBMS_DB_VERSION.VER_LE_11_1 + $THEN + select wm_concat(c1_column_name), + wm_concat(c2_column_name) $ELSE - select listagg(c1.column_name,', ') within group(order by c1.column_id), - listagg(nvl(c2.column_name,'NULL'),', ') within group(order by c1.column_id) - into V_TAB_COLS, V_INS_COLS - from dba_tab_columns c1, dba_tab_columns c2 - where c1.table_name = OUT_TAB_NAME - and c2.table_name (+) = IN_TAB_NAME - and c1.owner = V_USER - and c2.owner(+) = 'DVSYS' - and c1.column_name = c2.column_name (+) - and c1.column_name not in ('CON_ID'); + select listagg(c1_column_name,', ') within group(order by column_id), + listagg(c2_column_name,', ') within group(order by column_id) $END + into v_tab_cols, v_ins_cols + from ( + select c1.column_name c1_column_name, + nvl(c2.column_name,'NULL') c2_column_name, + c1.column_id + from dba_tab_columns c1, dba_tab_columns c2 + where c1.table_name = OUT_TAB_NAME + and c2.table_name (+) = IN_TAB_NAME + and c1.owner = V_USER + and c2.owner(+) = 'DVSYS' + and c1.column_name = c2.column_name (+) + and c1.column_name not in ('CON_ID') + order by c1.column_id + ); V_SQL := 'INSERT /*+ APPEND */ INTO ' || V_USER || '.' || OUT_TAB_NAME || '(' || V_TAB_COLS || V_CDB_CLAUSE || ') SELECT '; V_SQL := V_SQL || V_INS_COLS || V_CDB_CLAUSE; - IF V_VERS_1D = 11 THEN + IF V_VERS_1D <= 11 THEN V_SQL := V_SQL || ' FROM DVSYS.' || IN_TAB_NAME; ELSIF V_VERS_4D = '12.1.0.1' THEN V_SQL := V_SQL || ' FROM CDB$VIEW("DVSYS"."' || IN_TAB_NAME || '")'; diff --git a/user_scripts/odbfcl/extract/load_dba_cdb.sql b/user_scripts/odbfcl/extract/load_dba_cdb.sql index 2cb8497..2cdfc2b 100644 --- a/user_scripts/odbfcl/extract/load_dba_cdb.sql +++ b/user_scripts/odbfcl/extract/load_dba_cdb.sql @@ -1,18 +1,18 @@ DECLARE - V_VERS_1D NUMBER := '&P_VERS_1D.'; - V_USER VARCHAR2(30) := '&V_USERNAME.'; + V_VERS_1D NUMBER := '&&P_VERS_1D.'; + V_USER VARCHAR2(30) := '&&V_USERNAME.'; PROCEDURE RUN_INSERT (IN_TAB_NAME VARCHAR2, IN_WHERE_CLAUSE_12 VARCHAR2 DEFAULT NULL, IN_WHERE_CLAUSE_11 VARCHAR2 DEFAULT NULL) AS - V_TAB_COLS CLOB; - V_INS_COLS CLOB; + V_TAB_COLS VARCHAR2(32767); + V_INS_COLS VARCHAR2(32767); V_PREFIX VARCHAR2(4); - V_SQL CLOB; + V_SQL VARCHAR2(32767); -- 10.2 does not support CLOB for EXECUTE IMMEDIATE V_OBJ_EXISTS NUMBER; BEGIN - IF V_VERS_1D = 11 THEN + IF V_VERS_1D <= 11 THEN V_PREFIX := 'DBA_'; else V_PREFIX := 'CDB_'; @@ -28,33 +28,31 @@ DECLARE -- ORA-00600: internal error code, arguments: [kkdlGetBaseUser2:authIdType], [0], [104], [_NEXT_USER], [], [], [], [], [], [], [], [] -- Bug 22168436 ORA-600 [kkdoilsn2] on select from CONTAINERS(...) - Using BLOB / ANYDATA / XMLTYPE. - $IF DBMS_DB_VERSION.VER_LE_11_1 - $THEN - SELECT WM_CONCAT(C1_COLUMN_NAME), - WM_CONCAT(C2_COLUMN_NAME) - INTO V_TAB_COLS, V_INS_COLS - FROM ( - SELECT C1.COLUMN_NAME C1_COLUMN_NAME, - NVL(C2.COLUMN_NAME,'NULL') C2_COLUMN_NAME - FROM DBA_TAB_COLUMNS C1, DBA_TAB_COLUMNS C2 - WHERE C1.TABLE_NAME = 'T_' || IN_TAB_NAME - AND C2.TABLE_NAME (+) = V_PREFIX || IN_TAB_NAME - AND C1.OWNER = V_USER - AND C2.OWNER(+) = 'SYS' - AND C1.COLUMN_NAME = C2.COLUMN_NAME (+) - ORDER BY C1.COLUMN_ID + $IF DBMS_DB_VERSION.VER_LE_10_2 + $THEN + select wm_concat(c1_column_name), + wm_concat(c2_column_name) + $ELSIF DBMS_DB_VERSION.VER_LE_11_1 + $THEN + select wm_concat(c1_column_name), + wm_concat(c2_column_name) + $ELSE + select listagg(c1_column_name,', ') within group(order by column_id), + listagg(c2_column_name,', ') within group(order by column_id) + $END + into v_tab_cols, v_ins_cols + from ( + select c1.column_name c1_column_name, + nvl(c2.column_name,'NULL') c2_column_name, + c1.column_id + from dba_tab_columns c1, dba_tab_columns c2 + where c1.table_name = 'T_' || in_tab_name + and c2.table_name (+) = v_prefix || in_tab_name + and c1.owner = v_user + and c2.owner(+) = 'SYS' + and c1.column_name = c2.column_name (+) + order by c1.column_id ); - $ELSE - SELECT LISTAGG(C1.COLUMN_NAME,', ') WITHIN GROUP(ORDER BY C1.COLUMN_ID), - LISTAGG(NVL(C2.COLUMN_NAME,'NULL'),', ') WITHIN GROUP(ORDER BY C1.COLUMN_ID) - INTO V_TAB_COLS, V_INS_COLS - FROM DBA_TAB_COLUMNS C1, DBA_TAB_COLUMNS C2 - WHERE C1.TABLE_NAME = 'T_' || IN_TAB_NAME - AND C2.TABLE_NAME (+) = V_PREFIX || IN_TAB_NAME - AND C1.OWNER = V_USER - AND C2.OWNER(+) = 'SYS' - AND C1.COLUMN_NAME = C2.COLUMN_NAME (+); - $END V_SQL := 'INSERT /*+ APPEND */ INTO ' || V_USER || '.T_' || IN_TAB_NAME || '(' || V_TAB_COLS || ') SELECT '; @@ -62,7 +60,7 @@ DECLARE V_SQL := V_SQL || ' FROM ' || V_PREFIX || IN_TAB_NAME; - IF V_VERS_1D = 11 THEN + IF V_VERS_1D <= 11 THEN IF IN_WHERE_CLAUSE_11 IS NOT NULL THEN V_SQL := V_SQL || ' WHERE ' || IN_WHERE_CLAUSE_11; END IF; @@ -85,20 +83,20 @@ BEGIN DBMS_OUTPUT.ENABLE(NULL); RUN_INSERT ('TAB_PRIVS', - q'[GRANTEE != '&V_USERNAME.' AND NOT(TABLE_NAME LIKE '&V_USERNAME.' AND PRIVILEGE='INHERIT PRIVILEGES')]', - q'[GRANTEE != '&V_USERNAME.']' + q'[GRANTEE != '&&V_USERNAME.' AND NOT(TABLE_NAME LIKE '&&V_USERNAME.' AND PRIVILEGE='INHERIT PRIVILEGES')]', + q'[GRANTEE != '&&V_USERNAME.']' ); RUN_INSERT ('COL_PRIVS', - q'[GRANTEE != '&V_USERNAME.']', - q'[GRANTEE != '&V_USERNAME.']' + q'[GRANTEE != '&&V_USERNAME.']', + q'[GRANTEE != '&&V_USERNAME.']' ); RUN_INSERT ('SYS_PRIVS', - q'[GRANTEE != '&V_USERNAME.']', - q'[GRANTEE != '&V_USERNAME.']' + q'[GRANTEE != '&&V_USERNAME.']', + q'[GRANTEE != '&&V_USERNAME.']' ); RUN_INSERT ('ROLE_PRIVS', - q'[GRANTEE != '&V_USERNAME.']', - q'[GRANTEE != '&V_USERNAME.']' + q'[GRANTEE != '&&V_USERNAME.']', + q'[GRANTEE != '&&V_USERNAME.']' ); RUN_INSERT ('JAVA_POLICY'); @@ -106,8 +104,8 @@ BEGIN RUN_INSERT ('JOBS'); RUN_INSERT ('TS_QUOTAS', - q'[USERNAME != '&V_USERNAME.']', - q'[USERNAME != '&V_USERNAME.']' + q'[USERNAME != '&&V_USERNAME.']', + q'[USERNAME != '&&V_USERNAME.']' ); RUN_INSERT ('POLICIES'); @@ -129,8 +127,8 @@ BEGIN RUN_INSERT ('AUDIT_POLICY_COLUMNS'); RUN_INSERT ('DIRECTORIES', - q'[DIRECTORY_NAME != '&V_DIRECTORY.']', - q'[DIRECTORY_NAME != '&V_DIRECTORY.']' + q'[DIRECTORY_NAME != '&&V_DIRECTORY.']', + q'[DIRECTORY_NAME != '&&V_DIRECTORY.']' ); RUN_INSERT ('PROCEDURES'); @@ -141,20 +139,20 @@ BEGIN ); RUN_INSERT ('USERS', - q'[USERNAME != '&V_USERNAME.']', - q'[USERNAME != '&V_USERNAME.']' + q'[USERNAME != '&&V_USERNAME.']', + q'[USERNAME != '&&V_USERNAME.']' ); RUN_INSERT ('ROLES'); RUN_INSERT ('OBJECTS', - q'[OWNER != '&V_USERNAME.' AND NOT (OWNER='SYS' AND OBJECT_NAME='&V_DIRECTORY.' AND OBJECT_TYPE='DIRECTORY')]', - q'[OWNER != '&V_USERNAME.' AND NOT (OWNER='SYS' AND OBJECT_NAME='&V_DIRECTORY.' AND OBJECT_TYPE='DIRECTORY')]' + q'[OWNER != '&&V_USERNAME.' AND NOT (OWNER='SYS' AND OBJECT_NAME='&&V_DIRECTORY.' AND OBJECT_TYPE='DIRECTORY')]', + q'[OWNER != '&&V_USERNAME.' AND NOT (OWNER='SYS' AND OBJECT_NAME='&&V_DIRECTORY.' AND OBJECT_TYPE='DIRECTORY')]' ); RUN_INSERT ('TAB_COLUMNS', - q'[OWNER != '&V_USERNAME.']', - q'[OWNER != '&V_USERNAME.']' + q'[OWNER != '&&V_USERNAME.']', + q'[OWNER != '&&V_USERNAME.']' ); RUN_INSERT ('REGISTRY'); diff --git a/user_scripts/odbfcl/extract/load_source.sql b/user_scripts/odbfcl/extract/load_source.sql index a085966..7e164ac 100644 --- a/user_scripts/odbfcl/extract/load_source.sql +++ b/user_scripts/odbfcl/extract/load_source.sql @@ -1,7 +1,7 @@ DECLARE VCODE CLOB; - $IF DBMS_DB_VERSION.VER_LE_11 + $IF DBMS_DB_VERSION.VERSION <= 11 $THEN CURSOR OBJS IS SELECT OWNER, diff --git a/user_scripts/odbfcl/extract/load_v_dollar.sql b/user_scripts/odbfcl/extract/load_v_dollar.sql index 3bb72bf..ef0f835 100644 --- a/user_scripts/odbfcl/extract/load_v_dollar.sql +++ b/user_scripts/odbfcl/extract/load_v_dollar.sql @@ -6,38 +6,43 @@ DECLARE IN_WHERE_CLAUSE_12 VARCHAR2 DEFAULT NULL, IN_WHERE_CLAUSE_11 VARCHAR2 DEFAULT NULL) AS - V_TAB_COLS CLOB; - V_INS_COLS CLOB; - V_SQL CLOB; + V_TAB_COLS VARCHAR2(32767); + V_INS_COLS VARCHAR2(32767); + V_SQL VARCHAR2(32767); -- 10.2 does not support CLOB for EXECUTE IMMEDIATE + V_OBJ_EXISTS NUMBER; BEGIN - $IF DBMS_DB_VERSION.VER_LE_11_1 + SELECT COUNT(1) + INTO V_OBJ_EXISTS + FROM DBA_OBJECTS V1 + WHERE V1.OWNER = 'SYS' + AND V1.OBJECT_NAME = IN_TAB_NAME; + + $IF DBMS_DB_VERSION.VER_LE_10_2 + $THEN + select wm_concat(c1_column_name), + wm_concat(c2_column_name) + $ELSIF DBMS_DB_VERSION.VER_LE_11_1 $THEN - select wm_concat(c1_column_name), - wm_concat(c2_column_name) - into v_tab_cols, v_ins_cols - from ( - select c1.column_name c1_column_name, - nvl(c2.column_name,'NULL') c2_column_name - from dba_tab_columns c1, dba_tab_columns c2 - where c1.table_name = OUT_TAB_NAME - and c2.table_name (+) = IN_TAB_NAME - and c1.owner = '&v_username.' - and c2.owner(+) = 'SYS' - and c1.column_name = c2.column_name (+) - order by c1.column_id - ); + select wm_concat(c1_column_name), + wm_concat(c2_column_name) $ELSE - select listagg(c1.column_name,', ') within group(order by c1.column_id), - listagg(nvl(c2.column_name,'NULL'),', ') within group(order by c1.column_id) - into V_TAB_COLS, V_INS_COLS - from dba_tab_columns c1, dba_tab_columns c2 - where c1.table_name = OUT_TAB_NAME - and c2.table_name (+) = IN_TAB_NAME - and c1.owner = '&v_username.' - and c2.owner(+) = 'SYS' - and c1.column_name = c2.column_name (+); + select listagg(c1_column_name,', ') within group(order by column_id), + listagg(c2_column_name,', ') within group(order by column_id) $END + into v_tab_cols, v_ins_cols + from ( + select c1.column_name c1_column_name, + nvl(c2.column_name,'NULL') c2_column_name, + c1.column_id + from dba_tab_columns c1, dba_tab_columns c2 + where c1.table_name = OUT_TAB_NAME + and c2.table_name (+) = IN_TAB_NAME + and c1.owner = '&v_username.' + and c2.owner(+) = 'SYS' + and c1.column_name = c2.column_name (+) + order by c1.column_id + ); V_SQL := 'INSERT /*+ APPEND */ INTO &v_username..' || OUT_TAB_NAME || '(' || V_TAB_COLS || ') SELECT '; @@ -45,7 +50,7 @@ DECLARE V_SQL := V_SQL || ' FROM ' || IN_TAB_NAME; - IF V_VERS_1D = 11 THEN + IF V_VERS_1D <= 11 THEN IF IN_WHERE_CLAUSE_11 IS NOT NULL THEN V_SQL := V_SQL || ' WHERE ' || IN_WHERE_CLAUSE_11; END IF; @@ -54,9 +59,15 @@ DECLARE V_SQL := V_SQL || ' WHERE ' || IN_WHERE_CLAUSE_12; END IF; END IF; - DBMS_OUTPUT.PUT_LINE(V_SQL); - EXECUTE IMMEDIATE V_SQL; + IF V_OBJ_EXISTS = 1 + THEN + DBMS_OUTPUT.PUT_LINE(V_SQL); + EXECUTE IMMEDIATE V_SQL; + ELSE + DBMS_OUTPUT.PUT_LINE(IN_TAB_NAME || ' does not exist.'); + END IF; + END; BEGIN DBMS_OUTPUT.ENABLE(NULL); @@ -93,21 +104,19 @@ commit; DECLARE l_clob CLOB; - V_VERS_1D NUMBER := '&P_VERS_1D.'; BEGIN - IF V_VERS_1D = 11 THEN - RETURN; - END IF; - $IF NOT DBMS_DB_VERSION.VER_LE_11 + $IF DBMS_DB_VERSION.VERSION >= 12 $THEN - FOR I IN (select view_name from v_$fixed_view_definition t1 where length(t1.view_definition)=4000) - LOOP - DBMS_UTILITY.expand_sql_text ( - input_sql_text => 'select * from ' || i.view_name, - output_sql_text => l_clob - ); - update &v_username..t_fixed_view_definition t1 set t1.view_definition_clob=l_clob where t1.view_name=i.view_name; - END LOOP; + FOR I IN (select view_name from v_$fixed_view_definition t1 where length(t1.view_definition)=4000) + LOOP + DBMS_UTILITY.expand_sql_text ( + input_sql_text => 'select * from ' || i.view_name, + output_sql_text => l_clob + ); + update &v_username..t_fixed_view_definition t1 set t1.view_definition_clob=l_clob where t1.view_name=i.view_name; + END LOOP; + $ELSE + NULL; $END END; / diff --git a/user_scripts/odbfcl/extract/load_view.sql b/user_scripts/odbfcl/extract/load_view.sql index f7e27b1..c11ca30 100644 --- a/user_scripts/odbfcl/extract/load_view.sql +++ b/user_scripts/odbfcl/extract/load_view.sql @@ -1,47 +1,50 @@ DECLARE VCODE CLOB; VSID VARCHAR2(30) := 'VIEW_TESTE'; - CURSOR OBJS IS - SELECT OBJECT_OWNER OWNER, - OBJECT_NAME NAME, - OBJECT_TYPE TYPE, - ID CON_ID, - PARENT_ID ORIGIN_CON_ID, - OTHER_XML TEXT - FROM PLAN_TABLE - WHERE STATEMENT_ID = VSID-- and rownum < 1000; - ORDER BY 1,2; - FUNCTION replaceClob - ( srcClob IN CLOB, - replaceStr IN varchar2, - replaceWith IN varchar2 ) - RETURN CLOB - IS - l_buffer VARCHAR2 (32767); - l_amount BINARY_INTEGER := 32767; - l_pos INTEGER := 1; - l_clob_len INTEGER; - newClob clob := EMPTY_CLOB; - BEGIN - -- initalize the new clob - dbms_lob.CreateTemporary( newClob, TRUE ); - l_clob_len := DBMS_LOB.getlength (srcClob); - WHILE l_pos <= l_clob_len - LOOP - DBMS_LOB.READ (srcClob,l_amount,l_pos,l_buffer); - IF l_buffer IS NOT NULL - THEN - -- replace the text - l_buffer := regexp_replace(l_buffer,replaceStr,replaceWith); - -- write it to the new clob - DBMS_LOB.writeAppend(newClob, LENGTH(l_buffer), l_buffer); - END IF; - l_pos := l_pos + l_amount; - END LOOP; - RETURN newClob; - END; + + CURSOR OBJS IS + SELECT OBJECT_OWNER OWNER, + OBJECT_NAME NAME, + OBJECT_TYPE TYPE, + ID CON_ID, + PARENT_ID ORIGIN_CON_ID, + OTHER_XML TEXT + FROM PLAN_TABLE + WHERE STATEMENT_ID = VSID-- and rownum < 1000; + ORDER BY 1,2; + + FUNCTION replaceClob + ( srcClob IN CLOB, + replaceStr IN varchar2, + replaceWith IN varchar2 ) + RETURN CLOB + IS + l_buffer VARCHAR2 (32767); + l_amount BINARY_INTEGER := 32767; + l_pos INTEGER := 1; + l_clob_len INTEGER; + newClob clob := EMPTY_CLOB; + BEGIN + -- initalize the new clob + dbms_lob.CreateTemporary( newClob, TRUE ); + l_clob_len := DBMS_LOB.getlength (srcClob); + WHILE l_pos <= l_clob_len + LOOP + DBMS_LOB.READ (srcClob,l_amount,l_pos,l_buffer); + IF l_buffer IS NOT NULL + THEN + -- replace the text + l_buffer := regexp_replace(l_buffer,replaceStr,replaceWith); + -- write it to the new clob + DBMS_LOB.writeAppend(newClob, LENGTH(l_buffer), l_buffer); + END IF; + l_pos := l_pos + l_amount; + END LOOP; + RETURN newClob; + END replaceClob; BEGIN - $IF DBMS_DB_VERSION.VER_LE_11 + + $IF DBMS_DB_VERSION.VERSION <= 11 $THEN INSERT INTO PLAN_TABLE (STATEMENT_ID, OBJECT_OWNER, OBJECT_NAME, OBJECT_TYPE, ID, PARENT_ID, OTHER_XML) SELECT VSID, @@ -75,15 +78,18 @@ BEGIN WHERE CON_ID <> SYS_CONTEXT('USERENV','CON_ID') -- AND CON_ID IN (1,2) AND ORIGIN_CON_ID = CON_ID; $END + FOR I IN OBJS LOOP + VCODE := UPPER(I.TEXT); VCODE := replaceClob(VCODE,'[[:space:]]*',''); -- Remove all space characters VCODE := replaceClob(VCODE,'"',''); -- Remove all quotes - INSERT INTO &v_username..T_HASH_LOAD (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_HASH, SHA1_HASH, CODE) + INSERT INTO &v_username..T_HASH_LOAD + (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_HASH, SHA1_HASH, CODE) VALUES (I.OWNER, I.NAME, I.TYPE, I.ORIGIN_CON_ID, I.CON_ID, SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_MD5), SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_SH1), I.TEXT); - + END LOOP; DELETE FROM PLAN_TABLE WHERE STATEMENT_ID = VSID; END; diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.1.sql b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.1.sql new file mode 100644 index 0000000..b69b3c0 --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.1.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 10.2.0.1 +-------------------------------------- + +-- The code is the same as 11.2.0.4 in V$FIXED_VIEW_DEFINITION +@@load_underscore_11.2.0.4.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.2.sql b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.2.sql new file mode 100644 index 0000000..55212f0 --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.2.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 10.2.0.2 +-------------------------------------- + +-- The code is the same as 11.2.0.4 in V$FIXED_VIEW_DEFINITION +@@load_underscore_11.2.0.4.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.3.sql b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.3.sql new file mode 100644 index 0000000..d1f226d --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.3.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 10.2.0.3 +-------------------------------------- + +-- The code is the same as 11.2.0.4 in V$FIXED_VIEW_DEFINITION +@@load_underscore_11.2.0.4.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.4.sql b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.4.sql new file mode 100644 index 0000000..6d05d59 --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.4.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 10.2.0.4 +-------------------------------------- + +-- The code is the same as 11.2.0.4 in V$FIXED_VIEW_DEFINITION +@@load_underscore_11.2.0.4.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.5.sql b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.5.sql new file mode 100644 index 0000000..241532d --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.5.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 10.2.0.5 +-------------------------------------- + +-- The code is the same as 11.2.0.4 in V$FIXED_VIEW_DEFINITION +@@load_underscore_11.2.0.4.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.1.sql b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.1.sql new file mode 100644 index 0000000..66dab24 --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.1.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 10.2.0.1 +-------------------------------------- + +-- The code is the same as 11.2.0.4 in V$FIXED_VIEW_DEFINITION +@@load_underscore_vv_11.2.0.4.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.2.sql b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.2.sql new file mode 100644 index 0000000..74ff130 --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.2.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 10.2.0.2 +-------------------------------------- + +-- The code is the same as 11.2.0.4 in V$FIXED_VIEW_DEFINITION +@@load_underscore_vv_11.2.0.4.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.3.sql b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.3.sql new file mode 100644 index 0000000..1c1103c --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.3.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 10.2.0.3 +-------------------------------------- + +-- The code is the same as 11.2.0.4 in V$FIXED_VIEW_DEFINITION +@@load_underscore_vv_11.2.0.4.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.4.sql b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.4.sql new file mode 100644 index 0000000..a829ab9 --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.4.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 10.2.0.4 +-------------------------------------- + +-- The code is the same as 11.2.0.4 in V$FIXED_VIEW_DEFINITION +@@load_underscore_vv_11.2.0.4.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.5.sql b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.5.sql new file mode 100644 index 0000000..2142539 --- /dev/null +++ b/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.5.sql @@ -0,0 +1,6 @@ +-------------------------------------- +-- 10.2.0.5 +-------------------------------------- + +-- The code is the same as 11.2.0.4 in V$FIXED_VIEW_DEFINITION +@@load_underscore_vv_11.2.0.4.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh index 292df77..6bd9b63 100644 --- a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh @@ -54,11 +54,21 @@ EOF v_version=$($ORACLE_HOME/bin/sqlplus -L -S "${v_sysdba_connect}" @${v_thisdir}/get_db_version.sql) [ -z "${v_version}" ] && v_version=0 -if [ $v_version -lt 12 ] +if [ $v_version -eq 10 ] then v_compress_alg='' +elif [ $v_version -eq 11 ] +then + v_compress_alg='compression=all' +else + v_compress_alg='compression=all compression_algorithm=high' +fi + +if [ $v_version -gt 19 ] +then + v_version_param="version=19" else - v_compress_alg='compression_algorithm=high' + v_version_param='' fi # This makes file descriptor 3 be a copy of the current stdout (i.e. the screen), @@ -72,10 +82,10 @@ set +e $ORACLE_HOME/bin/expdp \ userid="${v_dump_user_name}/${v_dump_user_pass}" \ directory=${v_dump_dir_name} \ -compression=all "${v_compress_alg}" \ +"${v_compress_alg}" \ dumpfile="${v_output_file}" \ logfile="${v_output_file_noext}.log" \ -content=data_only \ +content=data_only "${v_version_param}" \ schemas="${v_dump_user_name}" 2>&1 >&3 | tee "${v_output_error}" v_ret=$? set -eo pipefail diff --git a/user_scripts/odbfcl/sh_extractor/exporter.sh b/user_scripts/odbfcl/sh_extractor/exporter.sh index ebf3a20..c20694b 100644 --- a/user_scripts/odbfcl/sh_extractor/exporter.sh +++ b/user_scripts/odbfcl/sh_extractor/exporter.sh @@ -1,7 +1,7 @@ #!/bin/bash # Script to collect all info needed from the DB # Created by Rodrigo Jorge -# v1.0.0.8 +# v1.0.0.9 set -eo pipefail From 81459f156426aaf6d2f2b9548c2d671b49fb8269 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 13 Mar 2024 17:30:08 -0300 Subject: [PATCH 157/229] Update patch_main_11g.yml --- tasks/patch_main_11g.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tasks/patch_main_11g.yml b/tasks/patch_main_11g.yml index f38a173..7912c6e 100644 --- a/tasks/patch_main_11g.yml +++ b/tasks/patch_main_11g.yml @@ -188,12 +188,22 @@ loop_control: loop_var: script_param + - name: Remove compression parameter from expdp + set_fact: + expdp_compression: "" + when: (db_version.split('.')[0] | int) <= 10 + + - name: Set compression parameter for expdp + set_fact: + expdp_compression: "compression=all" + when: (db_version.split('.')[0] | int) >= 11 + - name: Export Database Tables shell: | {{ dbhome_locl }}/bin/expdp \ userid={{ dump_user_int }}/{{ dump_pass }} \ directory={{ dump_dir_name }} \ - compression=all \ + {{ expdp_compression | default('') }} \ dumpfile={{ dump_file_prefix }}.dmp \ logfile={{ dump_file_prefix }}.log \ content=data_only \ From a63c7eed5841e65f58b6126eddbbc793266e6e51 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 14 Mar 2024 15:57:22 -0300 Subject: [PATCH 158/229] Changes tar restore logic --- tasks/find_patch.yml | 15 +++++++++++- tasks/patch_main.yml | 36 +++------------------------ tasks/patch_main_11g.yml | 51 ++++++++------------------------------- tasks/patch_tasks_pre.yml | 24 ++++++++++++++++-- tasks/run_sql.yml | 9 +++++-- tasks/tar_restore.yml | 46 +++++++++++++++++++++++++++++++++++ 6 files changed, 102 insertions(+), 79 deletions(-) create mode 100644 tasks/tar_restore.yml diff --git a/tasks/find_patch.yml b/tasks/find_patch.yml index b980bba..ebde9e3 100644 --- a/tasks/find_patch.yml +++ b/tasks/find_patch.yml @@ -26,6 +26,19 @@ when: patch_location_type == "bucket" +- name: Finding Patch File + find: + paths: "{{ patch_location_path }}" + patterns: "p{{ patch.patch_number }}_{{ db_version | regex_replace('\\.','') }}_Linux-x86-64{{ patch.file_suf | default('') }}.zip" + recurse: "yes" + file_type: "file" + register: tmp_find_result + when: ( db_version | regex_replace('^([^\.]+).*','\\1') | int ) <= 10 + +# Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" +- set_fact: find_result="{{tmp_find_result}}" + when: tmp_find_result is not skipped + - name: Finding Patch File find: paths: "{{ patch_location_path }}" @@ -33,7 +46,7 @@ recurse: "yes" file_type: "file" register: tmp_find_result - when: patch.type != "MRP" and patch.type != "DPBP" + when: patch.type != "MRP" and patch.type != "DPBP" and ( db_version | regex_replace('^([^\.]+).*','\\1') | int ) > 10 # Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" - set_fact: find_result="{{tmp_find_result}}" diff --git a/tasks/patch_main.yml b/tasks/patch_main.yml index 768afca..476a2c7 100644 --- a/tasks/patch_main.yml +++ b/tasks/patch_main.yml @@ -17,6 +17,7 @@ - name: Run OPatch/opatch shell: | + set -eo pipefail export ORACLE_HOME ORACLE_SID ./opatch apply -silent {{ VM_folder }}/{{ patch.patch_number }} OPatch.SKIP_VERIFY_SPACE=true environment: @@ -38,6 +39,7 @@ - name: Run OPatch/opatch NAPPLY shell: | + set -eo pipefail export ORACLE_HOME ORACLE_SID ./opatch napply -silent {{ VM_folder }}/{{ patch.patch_number }} OPatch.SKIP_VERIFY_SPACE=true environment: @@ -59,6 +61,7 @@ - name: Run OPatch/opatchauto shell: | + set -eo pipefail export ORACLE_HOME ORACLE_SID ./opatchauto apply -binary {{ VM_folder }}/{{ patch.patch_number }} -oh $ORACLE_HOME -target_type oracle_database environment: @@ -116,39 +119,6 @@ when: perform_patch_actions - # If apply method is UNTAR - - block: - - # Stop the database - - include: run_sql.yml - vars: - sql_param : { file : "shutdown.sql" , folder : "patch_sql" , task_action : "Stop Database for OPatch" } - when: not oci_mode or patch.dep_type is defined - # When patch has a dependency, if the dependency is loaded running the full patch process instead of loading from lvm, the DB will be left online. - - ## TAR ## - - - name: UNTAR full Oracle - shell: | - rm -rf /u01/* - tar -xzf {{ patch.apply_file }} - args: - chdir: "/" - register: tmp_shell_output - become: true - become_user: root - delegate_to: "{{ vm_ip_address }}" - - # Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" - - set_fact: shell_output="{{tmp_shell_output}}" - when: tmp_shell_output is not skipped - - - name: TAR Output - debug: msg="{{ shell_output.stdout_lines }}" - when: shell_output.stdout_lines is defined - - when: patch.apply_method is defined and patch.apply_method == "tar" - # Start the database - include: run_sql.yml vars: diff --git a/tasks/patch_main_11g.yml b/tasks/patch_main_11g.yml index 7912c6e..a6a31c3 100644 --- a/tasks/patch_main_11g.yml +++ b/tasks/patch_main_11g.yml @@ -17,6 +17,7 @@ - name: Run OPatch shell: | + set -eo pipefail export ORACLE_HOME ORACLE_SID ./opatch apply -silent {{ VM_folder }}/{{ patch.patch_number }} -ocmrf {{ VM_folder }}/ocm.rsp environment: @@ -38,6 +39,7 @@ - name: Run OPatch/opatch NAPPLY shell: | + set -eo pipefail export ORACLE_HOME ORACLE_SID ./opatch napply -silent {{ VM_folder }}/{{ patch.patch_number }} -ocmrf {{ VM_folder }}/ocm.rsp environment: @@ -61,6 +63,7 @@ - name: Disable Database Vault shell: | + set -eo pipefail {{ dbhome_locl }}/bin/chopt disable dv environment: ORACLE_HOME: "{{ dbhome_locl }}" @@ -78,27 +81,26 @@ # Apply patch changes on DB (if PSU) - include: run_sql.yml vars: - sql_param : { file : "applySQLPatch.sql" , folder : "patch_sql" , task_action : "Apply Patch" , params : "psu" } - when: patch.type == "PSU" + sql_param : { file : "catbundle.sql" , folder : "rdbms/admin" , task_action : "Apply PSU Patch" , params : "psu apply" , root_dir : "{{ dbhome_locl }}"} + when: patch.type == "PSU" and patch.cat_script is not defined # Apply patch changes on DB (if BP) - include: run_sql.yml vars: - sql_param : { file : "applySQLPatch.sql" , folder : "patch_sql" , task_action : "Apply Patch" , params : "exa" } - when: patch.type == "BP" + sql_param : { file : "catbundle.sql" , folder : "rdbms/admin" , task_action : "Apply BP Patch" , params : "exa apply" , root_dir : "{{ dbhome_locl }}"} + when: patch.type == "BP" and patch.cat_script is not defined # Apply patch changes on DB (if CPU) - include: run_sql.yml vars: - sql_param : { file : "applySQLPatch.sql" , folder : "patch_sql" , task_action : "Apply Patch" , params : "cpu" } + sql_param : { file : "catbundle.sql" , folder : "rdbms/admin" , task_action : "Apply CPU Patch" , params : "cpu apply" , root_dir : "{{ dbhome_locl }}"} when: patch.type == "CPU" and patch.cat_script is not defined # Apply patch changes on DB (if Custom) - include: run_sql.yml vars: - sql_param : { file : "applySQLCustom.sql" , folder : "patch_sql" , task_action : "Apply Patch" , params : "{{ patch.cat_script }}" } - when: patch.type == "CPU" and patch.cat_script is defined - + sql_param : { file : "{{ patch.cat_script | basename }}" , folder : "{{ patch.cat_script | dirname }}" , task_action : "Run: {{ patch.cat_script }}" , root_dir : "{{ dbhome_locl }}" } + when: patch.cat_script is defined # When the SQL Patch is for OJVM - block: @@ -139,39 +141,6 @@ when: perform_patch_actions - # If apply method is UNTAR - - block: - - # Stop the database - - include: run_sql.yml - vars: - sql_param : { file : "shutdown.sql" , folder : "patch_sql" , task_action : "Stop Database for OPatch" } - when: not oci_mode or patch.dep_type is defined - # When patch has a dependency, if the dependency is loaded running the full patch process instead of loading from lvm, the DB will be left online. - - ## TAR ## - - - name: UNTAR full Oracle - shell: | - rm -rf /u01/* - tar -xzf {{ patch.apply_file }} - args: - chdir: "/" - register: tmp_shell_output - become: true - become_user: root - delegate_to: "{{ vm_ip_address }}" - - # Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" - - set_fact: shell_output="{{tmp_shell_output}}" - when: tmp_shell_output is not skipped - - - name: TAR Output - debug: msg="{{ shell_output.stdout_lines }}" - when: shell_output.stdout_lines is defined - - when: patch.apply_method is defined and patch.apply_method == "tar" - # This start is only required if database was never stopped. - include: run_sql.yml vars: diff --git a/tasks/patch_tasks_pre.yml b/tasks/patch_tasks_pre.yml index 975d8dc..c0662f9 100644 --- a/tasks/patch_tasks_pre.yml +++ b/tasks/patch_tasks_pre.yml @@ -12,6 +12,8 @@ patch_file_path: "" db_patch: "" perform_patch_actions: true # If opatch / datapatch / patch download / etc are needed or not. + restore_from_lvm: false + restore_from_tar: false # Immediatly stop when skip_all becomes true - block: @@ -140,6 +142,7 @@ - name: LVM image found. Will skip patch actions. set_fact: perform_patch_actions: false + restore_from_lvm: true - name : Save old VM Snap set_fact: @@ -158,6 +161,13 @@ when: oci_mode + # Skip patch actions + - name: TAR file found. Will skip patch actions. + set_fact: + perform_patch_actions: false + restore_from_tar: true + when: patch.apply_method is defined and patch.apply_method == "tar" and not restore_from_lvm + # This part was together with the block before the lvm_check. # It was put here together as we don't need to unzip the patch if using the VM. - block: @@ -196,17 +206,27 @@ - include: vbox_reload.yml when: not oci_mode + # We will run the lvm reload if we found the LVM entry to restore or if we are not running - include: lvm_reload.yml - when: oci_mode and patch.dep_type is not defined + when: > + oci_mode and + ( + restore_from_lvm or + (patch.dep_type is not defined and not restore_from_tar) + ) - name : Restore old VM Snap set_fact: vm_snapshot: "{{ prev_vm_snapshot }}" when: oci_mode and found_lvm_entry + # It is not possible to have both restore_from_lvm and restore_from_tar as true + - include: tar_restore.yml + when: restore_from_tar + # When patch has a pre-req, call the prepare_dependency script to setup. - include: prepare_dependency.yml - when: patch.dep_type is defined + when: patch.dep_type is defined and not restore_from_tar and not restore_from_lvm # Replace opatch with latest version, when perform_patch_actions - block: diff --git a/tasks/run_sql.yml b/tasks/run_sql.yml index f98f08c..f15fbd6 100644 --- a/tasks/run_sql.yml +++ b/tasks/run_sql.yml @@ -5,17 +5,22 @@ # sql_param.params : Eventual parameters that may be provided to SQL script. # sql_param.termout : Boolean - print the SQL output. (Default: false) # sql_param.task_action : Task name to print. +# sql_param.root_dir : Where sql_param.folder is located. Default: VM_folder variable. + +- name: Set run_sql_chdir + set_fact: + run_sql_dir: "{{ sql_param.root_dir | default(VM_folder) }}/{{ sql_param.folder | default('user_scripts') }}" - name: "Run SQL - {{ sql_param.task_action }}" shell: | set -e export ORACLE_HOME ORACLE_SID - {{ dbhome_locl }}/bin/sqlplus -L -S "/ as sysdba" @{{ VM_folder }}/{{ sql_param.folder | default('user_scripts') }}/{{ sql_param.file }} {{ sql_param.params | default('') }} + {{ dbhome_locl }}/bin/sqlplus -L -S "/ as sysdba" @{{ run_sql_dir }}/{{ sql_param.file }} {{ sql_param.params | default('') }} environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" args: - chdir: "{{ VM_folder }}/{{ sql_param.folder | default('user_scripts') }}" + chdir: "{{ run_sql_dir }}" register: sqloutput become: true become_user: oracle diff --git a/tasks/tar_restore.yml b/tasks/tar_restore.yml new file mode 100644 index 0000000..cc9153b --- /dev/null +++ b/tasks/tar_restore.yml @@ -0,0 +1,46 @@ +# Stop the database +- include: run_sql.yml + vars: + sql_param : { file : "shutdown.sql" , folder : "patch_sql" , task_action : "Stop Database for UNTAR" } + # when: not oci_mode or patch.dep_type is defined + # When patch has a dependency, if the dependency is loaded running the full patch process instead of loading from lvm, the DB will be left online. + +## TAR ## + +- name: UNTAR full Oracle + shell: | + pkill -9 -U oracle || true + rm -rf /u01/* + tar -xzf {{ patch.apply_file }} + args: + chdir: "/" + register: tmp_shell_output + become: true + become_user: root + delegate_to: "{{ vm_ip_address }}" + +# Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" +- set_fact: shell_output="{{tmp_shell_output}}" + when: tmp_shell_output is not skipped + +- name: TAR Output + debug: msg="{{ shell_output.stdout_lines }}" + when: shell_output.stdout_lines is defined + +- name: "Clean oracle Shared Segments" + shell: | + # Clean Shared Segments (ORA-12547 TNS: Lost Contact) + ipcs -m | grep oracle | awk ' { print $2 } ' | xargs -I {} ipcrm -m {} + become: true + become_user: oracle + delegate_to: "{{ vm_ip_address }}" + +- name: "Free /dev/shm" + shell: | + set -e -x + # Free up space on /dev/shm + umount /dev/shm + mount /dev/shm + become: true + become_user: root + delegate_to: "{{ vm_ip_address }}" \ No newline at end of file From 29e7da6cbaa7c14bc9f23d8d981c28ba569be67f Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 19 Mar 2024 12:46:40 -0300 Subject: [PATCH 159/229] Fix issues on 10.2 load --- list_patches.yml | 64 +++++------ patch_sql/applySQLCustom.sql | 3 - patch_sql/applySQLPatch.sql | 3 - tasks/find_patch.yml | 18 ++- tasks/patch_tasks_pre.yml | 4 +- tasks/prepare_dependency.yml | 103 ++++++++++++------ tasks/run_sql.yml | 10 +- tasks/tar_restore.yml | 41 ++++--- .../adb_load_expdp/adb_process_dp_dump.sql | 2 + user_scripts/odbfcl/extract/load_x_dollar.sql | 14 ++- 10 files changed, 162 insertions(+), 100 deletions(-) delete mode 100644 patch_sql/applySQLCustom.sql delete mode 100644 patch_sql/applySQLPatch.sql diff --git a/list_patches.yml b/list_patches.yml index 06024a1..fe1847a 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -8,51 +8,53 @@ list_1020X: # 10.2.0.1 - { version : "10.2.0.1" , type : "BASE" , id : 0 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.10.2.0.1.tar.gz" } - - { version : "10.2.0.1" , type : "CPU" , id : 200601 , patch_number : 4751931 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.1" , type : "CPU" , id : 200604 , patch_number : 5049080 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.1" , type : "CPU" , id : 200607 , patch_number : 5225798 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.1" , type : "CPU" , id : 200610 , patch_number : 5490846 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.1" , type : "CPU" , id : 200701 , patch_number : 5689937 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.1" , type : "CPU" , id : 200601 , patch_number : 4751931 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUJan2006/catcpu.sql" } + - { version : "10.2.0.1" , type : "CPU" , id : 200604 , patch_number : 5049080 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUApr2006/catcpu.sql" } + - { version : "10.2.0.1" , type : "CPU" , id : 200607 , patch_number : 5225798 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUJul2006/catcpu.sql" } + - { version : "10.2.0.1" , type : "CPU" , id : 200610 , patch_number : 5490846 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUOct2006/catcpu.sql" } + - { version : "10.2.0.1" , type : "CPU" , id : 200701 , patch_number : 5689937 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUJan2007/catcpu.sql" } # - { version : "10.2.0.1" , type : "CPU" , id : 200704 , patch_number : 5901880 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX # 10.2.0.2 - { version : "10.2.0.2" , type : "BASE" , id : 0 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.10.2.0.2.tar.gz" } - - { version : "10.2.0.2" , type : "CPU" , id : 200604 , patch_number : 5079037 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.2" , type : "CPU" , id : 200607 , patch_number : 5225799 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.2" , type : "CPU" , id : 200610 , patch_number : 5490848 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.2" , type : "CPU" , id : 200701 , patch_number : 5689957 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.2" , type : "CPU" , id : 200704 , patch_number : 5901881 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.2" , type : "CPU" , id : 200707 , patch_number : 6079588 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.2" , type : "CPU" , id : 200710 , patch_number : 6394997 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.2" , type : "CPU" , id : 200801 , patch_number : 6646850 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.2" , type : "DEP" , id : 0 , patch_number : 5240469 , dep_type : 'BASE', dep_id : 0 } # Due to a bug, patches can only be applied after 5240469 fix + - { version : "10.2.0.2" , type : "CPU" , id : 200604 , patch_number : 5079037 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUApr2006/catcpu.sql" } + - { version : "10.2.0.2" , type : "CPU" , id : 200607 , patch_number : 5225799 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUJul2006/catcpu.sql" } + - { version : "10.2.0.2" , type : "CPU" , id : 200610 , patch_number : 5490848 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUOct2006/catcpu.sql" } + - { version : "10.2.0.2" , type : "CPU" , id : 200701 , patch_number : 5689957 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUJan2007/catcpu.sql" } + - { version : "10.2.0.2" , type : "CPU" , id : 200704 , patch_number : 5901881 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUApr2007/catcpu.sql" } + - { version : "10.2.0.2" , type : "CPU" , id : 200707 , patch_number : 6079588 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUJul2007/catcpu.sql" } + - { version : "10.2.0.2" , type : "CPU" , id : 200710 , patch_number : 6394997 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUOct2007/catcpu.sql" } + - { version : "10.2.0.2" , type : "CPU" , id : 200801 , patch_number : 6646850 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUJan2008/catcpu.sql" } # - { version : "10.2.0.2" , type : "CPU" , id : 200804 , patch_number : 6864071 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX # - { version : "10.2.0.2" , type : "CPU" , id : 200807 , patch_number : 7154083 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX # - { version : "10.2.0.2" , type : "CPU" , id : 200810 , patch_number : 7375660 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX # - { version : "10.2.0.2" , type : "CPU" , id : 200901 , patch_number : 7592355 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX # 10.2.0.3 - { version : "10.2.0.3" , type : "BASE" , id : 0 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.10.2.0.3.tar.gz" } - - { version : "10.2.0.3" , type : "CPU" , id : 200701 , patch_number : 5881721 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.3" , type : "CPU" , id : 200704 , patch_number : 5901891 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.3" , type : "CPU" , id : 200707 , patch_number : 6079591 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.3" , type : "CPU" , id : 200710 , patch_number : 6394981 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.3" , type : "CPU" , id : 200801 , patch_number : 6646853 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.3" , type : "CPU" , id : 200804 , patch_number : 6864068 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.3" , type : "CPU" , id : 200807 , patch_number : 7150622 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.3" , type : "CPU" , id : 200810 , patch_number : 7369190 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.3" , type : "CPU" , id : 200901 , patch_number : 7592354 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.3" , type : "DEP" , id : 0 , patch_number : 5240469 , dep_type : 'BASE', dep_id : 0 } # Due to a bug, patches can only be applied after 5240469 fix + - { version : "10.2.0.3" , type : "CPU" , id : 200701 , patch_number : 5881721 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUJan2007/catcpu.sql" } + - { version : "10.2.0.3" , type : "CPU" , id : 200704 , patch_number : 5901891 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUApr2007/catcpu.sql" } + - { version : "10.2.0.3" , type : "CPU" , id : 200707 , patch_number : 6079591 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUJul2007/catcpu.sql" } + - { version : "10.2.0.3" , type : "CPU" , id : 200710 , patch_number : 6394981 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUOct2007/catcpu.sql" } + - { version : "10.2.0.3" , type : "CPU" , id : 200801 , patch_number : 6646853 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUJan2008/catcpu.sql" } + - { version : "10.2.0.3" , type : "CPU" , id : 200804 , patch_number : 6864068 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUApr2008/catcpu.sql" } + - { version : "10.2.0.3" , type : "CPU" , id : 200807 , patch_number : 7150622 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUJul2008/catcpu.sql" } + - { version : "10.2.0.3" , type : "CPU" , id : 200810 , patch_number : 7369190 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUOct2008/catcpu.sql" } + - { version : "10.2.0.3" , type : "CPU" , id : 200901 , patch_number : 7592354 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUJan2009/catcpu.sql" } # 10.2.0.4 - { version : "10.2.0.4" , type : "BASE" , id : 0 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.10.2.0.4.tar.gz" } - { version : "10.2.0.4" , type : "PSU" , id : 1 , patch_number : 8576156 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - { version : "10.2.0.4" , type : "PSU" , id : 2 , patch_number : 8833280 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - { version : "10.2.0.4" , type : "PSU" , id : 3 , patch_number : 9119284 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - { version : "10.2.0.4" , type : "PSU" , id : 4 , patch_number : 9352164 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.4" , type : "PSU" , id : 5 , patch_number : 9654991 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.4" , type : "PSU" , id : 6 , patch_number : 9952234 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.4" , type : "PSU" , id : 7 , patch_number : 10248636 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.4" , type : "PSU" , id : 8 , patch_number : 11724977 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.4" , type : "PSU" , id : 9 , patch_number : 12419397 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.4" , type : "PSU" , id : 10 , patch_number : 12827778 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.4" , type : "PSU" , id : 11 , patch_number : 12879929 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.4" , type : "PSU" , id : 12 , patch_number : 12879933 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "PSU" , id : 5 , patch_number : 9654991 , dep_type : 'PSU' , dep_id : 4 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "PSU" , id : 6 , patch_number : 9952234 , dep_type : 'PSU' , dep_id : 4 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "PSU" , id : 7 , patch_number : 10248636 , dep_type : 'PSU' , dep_id : 4 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "PSU" , id : 8 , patch_number : 11724977 , dep_type : 'PSU' , dep_id : 4 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "PSU" , id : 9 , patch_number : 12419397 , dep_type : 'PSU' , dep_id : 4 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "PSU" , id : 10 , patch_number : 12827778 , dep_type : 'PSU' , dep_id : 4 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "PSU" , id : 11 , patch_number : 12879929 , dep_type : 'PSU' , dep_id : 4 , apply_method : "napply" } + - { version : "10.2.0.4" , type : "PSU" , id : 12 , patch_number : 12879933 , dep_type : 'PSU' , dep_id : 4 , apply_method : "napply" } # - { version : "10.2.0.4" , type : "PSU" , id : 13 , patch_number : 13923851 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX # - { version : "10.2.0.4" , type : "PSU" , id : 14 , patch_number : 14275630 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX # - { version : "10.2.0.4" , type : "PSU" , id : 15 , patch_number : 14736542 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX @@ -135,7 +137,7 @@ list_1020X: list_1110X: # 11.1.0.6 - { version : "11.1.0.6" , type : "BASE" , id : 0 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.11.1.0.6.tar.gz" } - - { version : "11.1.0.6" , type : "CPU" , id : 200804 , patch_number : 6864063 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUApr2008/catcpu.sql"} + - { version : "11.1.0.6" , type : "CPU" , id : 200804 , patch_number : 6864063 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUApr2008/catcpu.sql" } - { version : "11.1.0.6" , type : "CPU" , id : 200807 , patch_number : 7150417 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - { version : "11.1.0.6" , type : "CPU" , id : 200810 , patch_number : 7375639 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - { version : "11.1.0.6" , type : "CPU" , id : 200901 , patch_number : 7592335 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } diff --git a/patch_sql/applySQLCustom.sql b/patch_sql/applySQLCustom.sql deleted file mode 100644 index 1ce5417..0000000 --- a/patch_sql/applySQLCustom.sql +++ /dev/null @@ -1,3 +0,0 @@ --- Param 1 will be a custom string -@?/&1 -exit; diff --git a/patch_sql/applySQLPatch.sql b/patch_sql/applySQLPatch.sql deleted file mode 100644 index 100ee17..0000000 --- a/patch_sql/applySQLPatch.sql +++ /dev/null @@ -1,3 +0,0 @@ --- Param 1 will be "exa" for BP or "psu" for PSU -@?/rdbms/admin/catbundle.sql &1 apply -exit; diff --git a/tasks/find_patch.yml b/tasks/find_patch.yml index ebde9e3..001ea29 100644 --- a/tasks/find_patch.yml +++ b/tasks/find_patch.yml @@ -14,7 +14,19 @@ # vars: # my_query: "p{{ patch.patch_number }}" - - name: Download file from OCI Bucket + - name: Download file from OCI Bucket (Version filter included) + shell: | + export LC_ALL=C.UTF-8 + export LANG=C.UTF-8 + oci os object get --bucket-name {{ patch_location_bucket }} --name {{ oci_download_file }} --file {{ patch_location_path }}/{{ oci_download_file | basename }} + vars: + my_query: "p{{ patch.patch_number }}_{{ db_version | regex_replace('\\.','') }}" + oci_download_file: "{{ oci_action.objects | map(attribute='name') | select('search',(patch.file_suf | default('')) ~ '.zip') | select('search', my_query) | list | first }}" + when: + - oci_action.objects | map(attribute='name') | select('search', my_query) | list | length > 0 + - patch.type != "MRP" and patch.type != "DPBP" + + - name: Download file from OCI Bucket (Version filter excluded) shell: | export LC_ALL=C.UTF-8 export LANG=C.UTF-8 @@ -22,7 +34,9 @@ vars: my_query: "p{{ patch.patch_number }}" oci_download_file: "{{ oci_action.objects | map(attribute='name') | select('search',(patch.file_suf | default('')) ~ '.zip') | select('search', my_query) | list | first }}" - when: oci_action.objects | map(attribute='name') | select('search', my_query) | list | length > 0 + when: + - oci_action.objects | map(attribute='name') | select('search', my_query) | list | length > 0 + - patch.type == "MRP" and patch.type == "DPBP" when: patch_location_type == "bucket" diff --git a/tasks/patch_tasks_pre.yml b/tasks/patch_tasks_pre.yml index c0662f9..db379e3 100644 --- a/tasks/patch_tasks_pre.yml +++ b/tasks/patch_tasks_pre.yml @@ -248,6 +248,8 @@ delegate_to: "{{ vm_ip_address }}" # skip_all must come first as db_opatch may not yet be declared - when: db_opatch|length > 0 and perform_patch_actions + when: db_opatch|length > 0 # and perform_patch_actions + # place opatch even when there is no patch to be applied for the collector script. + # Some old versions of OPatch don't have the -bugs_fixed option. when: not skip_all \ No newline at end of file diff --git a/tasks/prepare_dependency.yml b/tasks/prepare_dependency.yml index 7547d0e..6d596c6 100644 --- a/tasks/prepare_dependency.yml +++ b/tasks/prepare_dependency.yml @@ -1,22 +1,36 @@ -- name : Cascade dependencies not supported +- name : Cascade dependencies not supported fail: - msg: "Cascade dependencies not supported." - when: bkp_patch is defined and bkp_patch != None + msg: "More than 2 cascade dependencies not supported." + when: bkp2_patch is defined and bkp2_patch != None -- name : Backup Variables +- name : Backup2 Variables set_fact: - bkp_patch: "{{ patch }}" - bkp_skip_dump_exists: "{{ skip_dump_exists }}" - bkp_only_deploy_patch: "{{ only_deploy_patch }}" - bkp_file_suffix: "{{ file_suffix }}" - bkp_dump_file_prefix: "{{ dump_file_prefix }}" - bkp_skip_all: "{{ skip_all }}" - bkp_mysid: "{{ mysid }}" - bkp_fix_datapatch_retries: "{{ fix_datapatch_retries }}" - # bkp_expdp_version: "{{ expdp_version }}" - bkp_db_patch: "{{ db_patch }}" - bkp_unzip_patch_folder: "{{ unzip_patch_folder }}" - bkp_perform_patch_actions: "{{ perform_patch_actions }}" + bkp2_patch: "{{ bkp1_patch }}" + bkp2_skip_dump_exists: "{{ bkp1_skip_dump_exists }}" + bkp2_only_deploy_patch: "{{ bkp1_only_deploy_patch }}" + bkp2_file_suffix: "{{ bkp1_file_suffix }}" + bkp2_dump_file_prefix: "{{ bkp1_dump_file_prefix }}" + bkp2_skip_all: "{{ bkp1_skip_all }}" + bkp2_mysid: "{{ bkp1_mysid }}" + bkp2_fix_datapatch_retries: "{{ bkp1_fix_datapatch_retries }}" + bkp2_db_patch: "{{ bkp1_db_patch }}" + bkp2_unzip_patch_folder: "{{ bkp1_unzip_patch_folder }}" + bkp2_perform_patch_actions: "{{ bkp1_perform_patch_actions }}" + when: bkp1_patch is defined and bkp1_patch != None + +- name : Backup1 Variables + set_fact: + bkp1_patch: "{{ patch }}" + bkp1_skip_dump_exists: "{{ skip_dump_exists }}" + bkp1_only_deploy_patch: "{{ only_deploy_patch }}" + bkp1_file_suffix: "{{ file_suffix }}" + bkp1_dump_file_prefix: "{{ dump_file_prefix }}" + bkp1_skip_all: "{{ skip_all }}" + bkp1_mysid: "{{ mysid }}" + bkp1_fix_datapatch_retries: "{{ fix_datapatch_retries }}" + bkp1_db_patch: "{{ db_patch }}" + bkp1_unzip_patch_folder: "{{ unzip_patch_folder }}" + bkp1_perform_patch_actions: "{{ perform_patch_actions }}" - name : Replace settings set_fact: @@ -30,25 +44,44 @@ loop_var: patch label: "{{ patch.id }}" when: - - (patch.version | default(db_version)) == (bkp_patch.version | default(db_version)) - - patch.type == bkp_patch.dep_type - - patch.id == bkp_patch.dep_id + - (patch.version | default(db_version)) == (bkp1_patch.version | default(db_version)) + - patch.type == bkp1_patch.dep_type + - patch.id == bkp1_patch.dep_id + +- name : Restore Main Variables + set_fact: + skip_dump_exists: "{{ bkp1_skip_dump_exists }}" + only_deploy_patch: "{{ bkp1_only_deploy_patch }}" + patch: "{{ bkp1_patch }}" + file_suffix: "{{ bkp1_file_suffix }}" + dump_file_prefix: "{{ bkp1_dump_file_prefix }}" + skip_all: "{{ bkp1_skip_all }}" + mysid: "{{ bkp1_mysid }}" + fix_datapatch_retries: "{{ bkp1_fix_datapatch_retries }}" + db_patch: "{{ bkp1_db_patch }}" + unzip_patch_folder: "{{ bkp1_unzip_patch_folder }}" + perform_patch_actions: "{{ bkp1_perform_patch_actions }}" -- name : Restore Variables +- name : Clean Backup1 Variables set_fact: - skip_dump_exists: "{{ bkp_skip_dump_exists }}" - only_deploy_patch: "{{ bkp_only_deploy_patch }}" - patch: "{{ bkp_patch }}" - file_suffix: "{{ bkp_file_suffix }}" - dump_file_prefix: "{{ bkp_dump_file_prefix }}" - skip_all: "{{ bkp_skip_all }}" - mysid: "{{ bkp_mysid }}" - fix_datapatch_retries: "{{ bkp_fix_datapatch_retries }}" - # expdp_version: "{{ bkp_expdp_version }}" - db_patch: "{{ bkp_db_patch }}" - unzip_patch_folder: "{{ bkp_unzip_patch_folder }}" - perform_patch_actions: "{{ bkp_perform_patch_actions }}" - -- name : Clean bkp_patch + bkp1_patch: + +- name : Restore Backup1 Variables + set_fact: + bkp1_skip_dump_exists: "{{ bkp2_skip_dump_exists }}" + bkp1_only_deploy_patch: "{{ bkp2_only_deploy_patch }}" + bkp1_patch: "{{ bkp2_patch }}" + bkp1_file_suffix: "{{ bkp2_file_suffix }}" + bkp1_dump_file_prefix: "{{ bkp2_dump_file_prefix }}" + bkp1_skip_all: "{{ bkp2_skip_all }}" + bkp1_mysid: "{{ bkp2_mysid }}" + bkp1_fix_datapatch_retries: "{{ bkp2_fix_datapatch_retries }}" + bkp1_db_patch: "{{ bkp2_db_patch }}" + bkp1_unzip_patch_folder: "{{ bkp2_unzip_patch_folder }}" + bkp1_perform_patch_actions: "{{ bkp2_perform_patch_actions }}" + when: bkp2_patch is defined and bkp2_patch != None + +- name : Clean Backup2 Variables set_fact: - bkp_patch: + bkp2_patch: + when: bkp2_patch is defined and bkp2_patch != None diff --git a/tasks/run_sql.yml b/tasks/run_sql.yml index f15fbd6..0cd8cdc 100644 --- a/tasks/run_sql.yml +++ b/tasks/run_sql.yml @@ -5,22 +5,18 @@ # sql_param.params : Eventual parameters that may be provided to SQL script. # sql_param.termout : Boolean - print the SQL output. (Default: false) # sql_param.task_action : Task name to print. -# sql_param.root_dir : Where sql_param.folder is located. Default: VM_folder variable. - -- name: Set run_sql_chdir - set_fact: - run_sql_dir: "{{ sql_param.root_dir | default(VM_folder) }}/{{ sql_param.folder | default('user_scripts') }}" +# sql_param.root_dir : Where sql_param.folder is located. (Default: VM_folder variable) - name: "Run SQL - {{ sql_param.task_action }}" shell: | set -e export ORACLE_HOME ORACLE_SID - {{ dbhome_locl }}/bin/sqlplus -L -S "/ as sysdba" @{{ run_sql_dir }}/{{ sql_param.file }} {{ sql_param.params | default('') }} + {{ dbhome_locl }}/bin/sqlplus -L -S "/ as sysdba" @{{ sql_param.root_dir | default(VM_folder) }}/{{ sql_param.folder | default('user_scripts') }}/{{ sql_param.file }} {{ sql_param.params | default('') }} environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" args: - chdir: "{{ run_sql_dir }}" + chdir: "{{ sql_param.root_dir | default(VM_folder) }}/{{ sql_param.folder | default('user_scripts') }}" register: sqloutput become: true become_user: oracle diff --git a/tasks/tar_restore.yml b/tasks/tar_restore.yml index cc9153b..49a6d4a 100644 --- a/tasks/tar_restore.yml +++ b/tasks/tar_restore.yml @@ -5,28 +5,14 @@ # when: not oci_mode or patch.dep_type is defined # When patch has a dependency, if the dependency is loaded running the full patch process instead of loading from lvm, the DB will be left online. -## TAR ## - -- name: UNTAR full Oracle +- name: "Kill all Oracle processes" shell: | + set -e -x pkill -9 -U oracle || true - rm -rf /u01/* - tar -xzf {{ patch.apply_file }} - args: - chdir: "/" - register: tmp_shell_output become: true become_user: root delegate_to: "{{ vm_ip_address }}" -# Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" -- set_fact: shell_output="{{tmp_shell_output}}" - when: tmp_shell_output is not skipped - -- name: TAR Output - debug: msg="{{ shell_output.stdout_lines }}" - when: shell_output.stdout_lines is defined - - name: "Clean oracle Shared Segments" shell: | # Clean Shared Segments (ORA-12547 TNS: Lost Contact) @@ -43,4 +29,25 @@ mount /dev/shm become: true become_user: root - delegate_to: "{{ vm_ip_address }}" \ No newline at end of file + delegate_to: "{{ vm_ip_address }}" + +## TAR ## + +- name: UNTAR full Oracle + shell: | + rm -rf /u01/* + tar -xzf {{ patch.apply_file }} + args: + chdir: "/" + register: tmp_shell_output + become: true + become_user: root + delegate_to: "{{ vm_ip_address }}" + +# Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" +- set_fact: shell_output="{{tmp_shell_output}}" + when: tmp_shell_output is not skipped + +- name: TAR Output + debug: msg="{{ shell_output.stdout_lines }}" + when: shell_output.stdout_lines is defined \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_expdp/adb_process_dp_dump.sql b/user_scripts/odbfcl/adb_load_expdp/adb_process_dp_dump.sql index f1ba972..5632b23 100644 --- a/user_scripts/odbfcl/adb_load_expdp/adb_process_dp_dump.sql +++ b/user_scripts/odbfcl/adb_load_expdp/adb_process_dp_dump.sql @@ -9,5 +9,7 @@ BEGIN P_FILE_NAME => '&4', P_EXECUTE => TRUE ); + -- Pause refresh for the next hours. + PC_REFRESH_MVS.QUICK_PAUSE; END; / diff --git a/user_scripts/odbfcl/extract/load_x_dollar.sql b/user_scripts/odbfcl/extract/load_x_dollar.sql index 1991171..8f39ab3 100644 --- a/user_scripts/odbfcl/extract/load_x_dollar.sql +++ b/user_scripts/odbfcl/extract/load_x_dollar.sql @@ -10,6 +10,8 @@ -- The field x$kqfco.kqfcotab should be subtracted by one to get the correct columns. -- Thanks David Kurtz and Frits Hoogland +-- Issue started with 11.2 and was fixed on 23c - 30492260 + INSERT INTO &v_username..T_XTABCOLS ( "TABLE_NAME", @@ -23,6 +25,7 @@ from x$kqfta t, x$kqfco c, x$kqfta divider where divider.kqftanam = 'X$KSXPTESTTBL' and t.indx < divider.indx and t.indx = c.kqfcotab +and &P_VERS_1D. between 11 and 21 union all select t.kqftanam table_name, c.kqfconam column_name, @@ -30,4 +33,13 @@ select t.kqftanam table_name, from x$kqfta t, x$kqfco c, x$kqfta divider where divider.kqftanam = 'X$KSXPTESTTBL' and t.indx >= divider.indx -and t.indx = c.kqfcotab-1; \ No newline at end of file +and t.indx = c.kqfcotab-1 +and &P_VERS_1D. between 11 and 21 +union all +-- Version < 11.2 or Version >= 23 +select t.kqftanam table_name, + c.kqfconam column_name, + c.kqfcodty column_type +from x$kqfta t, x$kqfco c +where t.indx = c.kqfcotab +and (not exists (select 1 from x$kqfta divider where divider.kqftanam = 'X$KSXPTESTTBL') or &P_VERS_1D. < 11 or &P_VERS_1D. > 21); \ No newline at end of file From ca6f49e7538c4ee38b963b0312adb65069ecd565 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 19 Mar 2024 15:27:04 -0300 Subject: [PATCH 160/229] Log opatch execution --- tasks/patch_main.yml | 6 ++++-- tasks/patch_main_11g.yml | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tasks/patch_main.yml b/tasks/patch_main.yml index 476a2c7..9f07594 100644 --- a/tasks/patch_main.yml +++ b/tasks/patch_main.yml @@ -19,7 +19,8 @@ shell: | set -eo pipefail export ORACLE_HOME ORACLE_SID - ./opatch apply -silent {{ VM_folder }}/{{ patch.patch_number }} OPatch.SKIP_VERIFY_SPACE=true + [ ! -d ~/opatch_logs ] && mkdir ~/opatch_logs + ./opatch apply -silent {{ VM_folder }}/{{ patch.patch_number }} OPatch.SKIP_VERIFY_SPACE=true 2>&1 | tee ~/opatch_logs/{{ patch.patch_number }}.log environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" @@ -41,7 +42,8 @@ shell: | set -eo pipefail export ORACLE_HOME ORACLE_SID - ./opatch napply -silent {{ VM_folder }}/{{ patch.patch_number }} OPatch.SKIP_VERIFY_SPACE=true + [ ! -d ~/opatch_logs ] && mkdir ~/opatch_logs + ./opatch napply -silent {{ VM_folder }}/{{ patch.patch_number }} OPatch.SKIP_VERIFY_SPACE=true 2>&1 | tee ~/opatch_logs/{{ patch.patch_number }}.log environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" diff --git a/tasks/patch_main_11g.yml b/tasks/patch_main_11g.yml index a6a31c3..d4d3b5f 100644 --- a/tasks/patch_main_11g.yml +++ b/tasks/patch_main_11g.yml @@ -19,7 +19,8 @@ shell: | set -eo pipefail export ORACLE_HOME ORACLE_SID - ./opatch apply -silent {{ VM_folder }}/{{ patch.patch_number }} -ocmrf {{ VM_folder }}/ocm.rsp + [ ! -d ~/opatch_logs ] && mkdir ~/opatch_logs + ./opatch apply -silent {{ VM_folder }}/{{ patch.patch_number }} -ocmrf {{ VM_folder }}/ocm.rsp 2>&1 | tee ~/opatch_logs/{{ patch.patch_number }}.log environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" @@ -41,7 +42,8 @@ shell: | set -eo pipefail export ORACLE_HOME ORACLE_SID - ./opatch napply -silent {{ VM_folder }}/{{ patch.patch_number }} -ocmrf {{ VM_folder }}/ocm.rsp + [ ! -d ~/opatch_logs ] && mkdir ~/opatch_logs + ./opatch napply -silent {{ VM_folder }}/{{ patch.patch_number }} -ocmrf {{ VM_folder }}/ocm.rsp 2>&1 | tee ~/opatch_logs/{{ patch.patch_number }}.log environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" From 81f737e3f9ddbee108dc219010371cbf6b4c7a30 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 20 Mar 2024 12:08:30 -0300 Subject: [PATCH 161/229] Update exporter --- .../odbfcl/adb_load_bugs_fixed/bugsGet.sh | 21 ++-- user_scripts/odbfcl/runExtractor.yml | 6 +- user_scripts/odbfcl/sh_extractor/exporter.sh | 95 ++++++++++++++----- 3 files changed, 89 insertions(+), 33 deletions(-) diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh index c99b1da..1ab888a 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh @@ -15,26 +15,33 @@ function exitError () exit 1 } -v_output="$1" +v_output_file="$1" -[ -z "$v_output" ] && exitError "First parameter is the target file and cannot be null." -[ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." +[ -z "${v_output_file}" ] && exitError "First parameter is the target file and cannot be null." +[ -f "${v_output_file}" ] && exitError "File \"${v_output_file}\" already exists. Remove it before rerunning." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." echo "Generating bugs list. Please wait.." # Check if opatch command works -v_out=$("$ORACLE_HOME"/OPatch/opatch lsinv -bugs_fixed 2>&1) && v_ret=$? || v_ret=$? +v_opatch_out=$("$ORACLE_HOME"/OPatch/opatch lsinv -bugs_fixed 2>&1) && v_ret=$? || v_ret=$? if [ ${v_ret} -ne 0 ] then echoError "Unable to run opatch. Error was:" - echoError "${v_out}" + echoError "${v_opatch_out}" echoError "Skipping opatch collection." exit ${v_ret} fi -"$ORACLE_HOME"/OPatch/opatch lsinv -bugs_fixed | +# When opatch runs again and too fast, it will fail as the lsinventory file name will have the exact same name (even the seconds part of it). +# Example: + +# Inventory load failed... OPatch cannot load inventory for the given Oracle Home. +# LsInventorySession failed: LsInventory cannot create the log directory /u01/app/oracle/product/database/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2024-03-20_13-56-38PM.txt + +# "$ORACLE_HOME"/OPatch/opatch lsinv -bugs_fixed | +echo "${v_opatch_out}" | # Remove lines before this entry (inclusive) sed '1,/^List of Bugs fixed by Installed Patches/d' | # Remove lines before this entry (inclusive) @@ -54,6 +61,6 @@ sed -r 's/[[:space:]]+/ /g' | # Replace first space per tab sed 's/ /'$'\t''/' | # Replace first space per tab (that was the second) -sed 's/ /'$'\t''/' > "${v_output}" +sed 's/ /'$'\t''/' > "${v_output_file}" exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/runExtractor.yml b/user_scripts/odbfcl/runExtractor.yml index fc6c38a..7b8f2fe 100644 --- a/user_scripts/odbfcl/runExtractor.yml +++ b/user_scripts/odbfcl/runExtractor.yml @@ -5,9 +5,11 @@ set -eo pipefail export ORACLE_HOME export ORACLE_SID - export DB_EXP_GEN_DUMP=0 + export DB_EXP_GEN_DUMP=false + export DB_EXP_IGNORE_ERROR=false export DB_EXP_USER_PASS="{{ dump_pass }}" - sh "{{ VM_folder }}/user_scripts/odbfcl/sh_extractor/exporter.sh" db + [ ! -d ~/exporter_logs ] && mkdir ~/exporter_logs + sh "{{ VM_folder }}/user_scripts/odbfcl/sh_extractor/exporter.sh" db 2>&1 | tee ~/exporter_logs/{{ file_suffix }}.log environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" diff --git a/user_scripts/odbfcl/sh_extractor/exporter.sh b/user_scripts/odbfcl/sh_extractor/exporter.sh index c20694b..9a98d87 100644 --- a/user_scripts/odbfcl/sh_extractor/exporter.sh +++ b/user_scripts/odbfcl/sh_extractor/exporter.sh @@ -1,13 +1,10 @@ #!/bin/bash # Script to collect all info needed from the DB # Created by Rodrigo Jorge -# v1.0.0.9 +# v1.1.0.0 set -eo pipefail -# Change this if you need to provide a password to connect as sysdba -export v_sysdba_connect='/ as sysdba' - function echoError () { (>&2 echo "$1") @@ -33,16 +30,63 @@ The output is a zip file. " # Check if DB_EXP_MERGE_DUMP was exported. -# If DB_EXP_MERGE_DUMP=0, then the generated ORACLE_HOME related files (bugs, symbols, chksum, etc) won't be loaded on a table, but added to zip as separate files. -[ "$DB_EXP_MERGE_DUMP" == "0" ] && v_load_file=0 || v_load_file=1 +# If DB_EXP_MERGE_DUMP=false, then the generated ORACLE_HOME related files (bugs, symbols, chksum, etc) won't be loaded on DB tables, but added to zip as separate files. +if [ -z "$DB_EXP_MERGE_DUMP" ] +then + v_load_file=true + # echo "Note: Variable 'DB_EXP_MERGE_DUMP' was not exported. Assigning DB_EXP_MERGE_DUMP=${v_load_file} (default)." +else + v_load_file=$(echo "${DB_EXP_MERGE_DUMP}" | tr '[:upper:]' '[:lower:]') + echo "Note: DB_EXP_MERGE_DUMP=${v_load_file} (provided)." +fi + +if [ "${v_load_file}" != "false" -a "${v_load_file}" != "true" ] +then + exitError "DB_EXP_MERGE_DUMP must be 'true' or 'false'." +fi # Check if DB_EXP_GEN_DUMP was exported. -# If DB_EXP_GEN_DUMP=0, then nothing will be exported. Only the schema populated. -[ "$DB_EXP_GEN_DUMP" == "0" ] && v_gen_dump=0 || v_gen_dump=1 +# If DB_EXP_GEN_DUMP=false, then nothing will be exported. Only the schema populated. +if [ -z "$DB_EXP_GEN_DUMP" ] +then + v_gen_dump=true + # echo "Note: Variable 'DB_EXP_GEN_DUMP' was not exported. Assigning DB_EXP_GEN_DUMP=${v_gen_dump} (default)." +else + v_gen_dump=$(echo "${DB_EXP_GEN_DUMP}" | tr '[:upper:]' '[:lower:]') + echo "Note: DB_EXP_GEN_DUMP=${v_gen_dump} (provided)." +fi + +if [ "${v_gen_dump}" != "false" -a "${v_gen_dump}" != "true" ] +then + exitError "DB_EXP_GEN_DUMP must be 'true' or 'false'." +fi + +# Check if DB_EXP_IGNORE_ERROR was exported. +# If DB_EXP_IGNORE_ERROR=false, the code will stop on some critical errors. +if [ -z "$DB_EXP_IGNORE_ERROR" ] +then + v_ignore_error=true + # echo "Note: Variable 'DB_EXP_IGNORE_ERROR' was not exported. Assigning DB_EXP_IGNORE_ERROR=${v_ignore_error} (default)." +else + v_ignore_error=$(echo "${DB_EXP_IGNORE_ERROR}" | tr '[:upper:]' '[:lower:]') + echo "Note: DB_EXP_IGNORE_ERROR=${v_ignore_error} (provided)." +fi + +if [ "${v_ignore_error}" != "false" -a "${v_ignore_error}" != "true" ] +then + exitError "DB_EXP_IGNORE_ERROR must be 'true' or 'false'." +fi # Check if DB_EXP_CRED was exported. # If DB_EXP_CRED is exported, then connect using this string instead of '/ as sysdba'. -[ -n "$DB_EXP_CRED" ] && v_sysdba_connect="$DB_EXP_CRED" +if [ -z "$DB_EXP_CRED" ] +then + v_sysdba_connect='/ as sysdba' + echo "Note: Variable 'DB_EXP_CRED' was not exported. Assigning DB_EXP_CRED='${v_sysdba_connect}' (default)." +else + v_sysdba_connect=$(echo "${DB_EXP_CRED}" | tr '[:upper:]' '[:lower:]') + echo "Note: DB_EXP_CRED (provided)." +fi v_pattern_cnt=`awk -F" " '{print NF-1}' <<< "${v_pattern}"` [ ${v_pattern_cnt} -ne 0 ] && exitError "Pattern \"${v_output}\" must not have any spaces. Eg: ${v_example}" @@ -71,52 +115,55 @@ fi [ -n "${v_common_user}" ] && v_dump_user_name="${v_common_user}${v_dump_user_name}" ################## v_thisdir_bkp="${v_thisdir}" # REMOVE_IF_ZIP -[ -f "${v_thisdir}/bugsGet.sh" ] && v_sh_from_zip=1 || v_sh_from_zip=0 # REMOVE_IF_ZIP -[ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir_bkp}/../adb_load_bugs_fixed" # REMOVE_IF_ZIP +v_thisdir="${v_thisdir_bkp}/../adb_load_bugs_fixed" # REMOVE_IF_ZIP v_file=bugs_${v_pattern}.txt sh "${v_thisdir}/bugsGet.sh" ${v_file} && v_bugs_ret=$? || v_bugs_ret=$? -[ ${v_load_file} -eq 0 ] && zip -m ${v_zip} ${v_file} +if ! ${v_ignore_error} && [ ${v_bugs_ret} -ne 0 ] +then + exitError "OPatch returned ${v_bugs_ret}." +fi +! ${v_load_file} && zip -m ${v_zip} ${v_file} -[ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir_bkp}/../adb_load_filechksum" # REMOVE_IF_ZIP +v_thisdir="${v_thisdir_bkp}/../adb_load_filechksum" # REMOVE_IF_ZIP v_file=sha256sum_${v_pattern}.chk sh "${v_thisdir}/chksumGet.sh" ${v_file} -[ ${v_load_file} -eq 0 ] && zip -m ${v_zip} ${v_file} +! ${v_load_file} && zip -m ${v_zip} ${v_file} -[ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir_bkp}/../adb_load_txtcollection_files" # REMOVE_IF_ZIP +v_thisdir="${v_thisdir_bkp}/../adb_load_txtcollection_files" # REMOVE_IF_ZIP v_file=txtcol_${v_pattern}.tar.gz sh "${v_thisdir}/fileGet.sh" ${v_file} -[ ${v_load_file} -eq 0 ] && zip -m ${v_zip} ${v_file} +! ${v_load_file} && zip -m ${v_zip} ${v_file} -[ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir_bkp}/../adb_load_symbols" # REMOVE_IF_ZIP +v_thisdir="${v_thisdir_bkp}/../adb_load_symbols" # REMOVE_IF_ZIP v_file=symbols_${v_pattern}.csv sh "${v_thisdir}/symbolGet.sh" ${v_file} -[ ${v_load_file} -eq 0 ] && zip -m ${v_zip} ${v_file} +! ${v_load_file} && zip -m ${v_zip} ${v_file} v_thisdir="${v_thisdir_bkp}" # REMOVE_IF_ZIP sh "${v_thisdir}/schemaCreate.sh" ${v_dump_user_name} -if [ ${v_load_file} -eq 1 ] +if ${v_load_file} then if [ ${v_bugs_ret} -eq 0 ] then - [ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir_bkp}/../adb_load_bugs_fixed" # REMOVE_IF_ZIP + v_thisdir="${v_thisdir_bkp}/../adb_load_bugs_fixed" # REMOVE_IF_ZIP v_file=bugs_${v_pattern}.txt sh "${v_thisdir}/bugsLoad.sh" ${v_dump_user_name} ${v_file} rm -f ${v_file} fi - [ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir_bkp}/../adb_load_filechksum" # REMOVE_IF_ZIP + v_thisdir="${v_thisdir_bkp}/../adb_load_filechksum" # REMOVE_IF_ZIP v_file=sha256sum_${v_pattern}.chk sh "${v_thisdir}/chksumLoad.sh" ${v_dump_user_name} ${v_file} rm -f ${v_file} - [ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir_bkp}/../adb_load_txtcollection_files" # REMOVE_IF_ZIP + v_thisdir="${v_thisdir_bkp}/../adb_load_txtcollection_files" # REMOVE_IF_ZIP v_file=txtcol_${v_pattern}.tar.gz sh "${v_thisdir}/fileLoad.sh" ${v_dump_user_name} ${v_file} rm -f ${v_file} - [ ${v_sh_from_zip} -eq 0 ] && v_thisdir="${v_thisdir_bkp}/../adb_load_symbols" # REMOVE_IF_ZIP + v_thisdir="${v_thisdir_bkp}/../adb_load_symbols" # REMOVE_IF_ZIP v_file=symbols_${v_pattern}.csv sh "${v_thisdir}/symbolLoad.sh" ${v_dump_user_name} ${v_file} rm -f ${v_file} @@ -125,7 +172,7 @@ fi v_thisdir="${v_thisdir_bkp}" # REMOVE_IF_ZIP sh "${v_thisdir}/dictionaryGet.sh" ${v_dump_user_name} -if [ ${v_gen_dump} -eq 1 ] +if ${v_gen_dump} then sh "${v_thisdir}/dumpCreate.sh" ${v_dump_user_name} tables_${v_pattern}.dmp set +e From 7dc73aae3d5797c7e7404b6d6409dbc01cc4c770 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 20 Mar 2024 12:24:54 -0300 Subject: [PATCH 162/229] Update exporter --- user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh | 8 ++++---- user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh | 2 +- user_scripts/odbfcl/adb_load_symbols/symbolGet.sh | 2 +- .../odbfcl/adb_load_txtcollection_files/fileGet.sh | 2 +- user_scripts/odbfcl/sh_extractor/dumpCreate.sh | 5 +++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh index 1ab888a..1594a8e 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh @@ -15,10 +15,10 @@ function exitError () exit 1 } -v_output_file="$1" +v_output="$1" -[ -z "${v_output_file}" ] && exitError "First parameter is the target file and cannot be null." -[ -f "${v_output_file}" ] && exitError "File \"${v_output_file}\" already exists. Remove it before rerunning." +[ -z "${v_output}" ] && exitError "First parameter is the target file and cannot be null." +[ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." @@ -61,6 +61,6 @@ sed -r 's/[[:space:]]+/ /g' | # Replace first space per tab sed 's/ /'$'\t''/' | # Replace first space per tab (that was the second) -sed 's/ /'$'\t''/' > "${v_output_file}" +sed 's/ /'$'\t''/' > "${v_output}" exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh b/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh index 4935b17..96507fd 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh +++ b/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh @@ -17,7 +17,7 @@ function exitError () v_output="$1" -[ -z "$v_output" ] && exitError "First parameter is the target file and cannot be null." +[ -z "${v_output}" ] && exitError "First parameter is the target file and cannot be null." [ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." diff --git a/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh b/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh index af65cac..f9a4319 100644 --- a/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh +++ b/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh @@ -20,7 +20,7 @@ function exitError () v_output="$1" -[ -z "$v_output" ] && exitError "First parameter is the target file and cannot be null." +[ -z "${v_output}" ] && exitError "First parameter is the target file and cannot be null." [ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh index f465a17..49df03b 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh @@ -20,7 +20,7 @@ function exitError () v_output="$1" -[ -z "$v_output" ] && exitError "First parameter is the target file and cannot be null." +[ -z "${v_output}" ] && exitError "First parameter is the target file and cannot be null." [ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." diff --git a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh index 6bd9b63..5f5e7b3 100644 --- a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh @@ -18,10 +18,11 @@ function exitError () v_dump_user_name="$1" v_output="$2" -[ -z "$v_output" ] && exitError "First parameter is the target file and cannot be null." +[ -z "${v_output}" ] && exitError "First parameter is the target file and cannot be null." +[ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." + [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." -[ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." v_output_fdr="$(cd "$(dirname "${v_output}")"; pwd)" v_output_file="$(basename "${v_output}")" From 30bd0ff041a7bfeb911e8f61dd78a3206c841e22 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 20 Mar 2024 12:34:06 -0300 Subject: [PATCH 163/229] Update exporter.sh --- user_scripts/odbfcl/sh_extractor/exporter.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/user_scripts/odbfcl/sh_extractor/exporter.sh b/user_scripts/odbfcl/sh_extractor/exporter.sh index 9a98d87..0bda64d 100644 --- a/user_scripts/odbfcl/sh_extractor/exporter.sh +++ b/user_scripts/odbfcl/sh_extractor/exporter.sh @@ -88,6 +88,9 @@ else echo "Note: DB_EXP_CRED (provided)." fi +# v_sysdba_connect needs to be exported +export v_sysdba_connect + v_pattern_cnt=`awk -F" " '{print NF-1}' <<< "${v_pattern}"` [ ${v_pattern_cnt} -ne 0 ] && exitError "Pattern \"${v_output}\" must not have any spaces. Eg: ${v_example}" From d8c54b6e00dfa0b4b9cfdd2946e098ddbfb0190c Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 20 Mar 2024 12:37:03 -0300 Subject: [PATCH 164/229] Small changes --- user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh | 2 +- user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh | 2 +- user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh | 2 +- user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh index a36a831..4414d89 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh @@ -19,7 +19,7 @@ v_dump_user_name="$1" v_file="$2" v_outpref="${v_file}" -[ -z "$v_file" ] && exitError "First parameter is the source file and cannot be null." +[ -z "${v_file}" ] && exitError "First parameter is the source file and cannot be null." [ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh index 190c689..6044195 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh +++ b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh @@ -19,7 +19,7 @@ v_dump_user_name="$1" v_file="$2" v_outpref="${v_file}" -[ -z "$v_file" ] && exitError "First parameter is the source file and cannot be null." +[ -z "${v_file}" ] && exitError "First parameter is the source file and cannot be null." [ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." diff --git a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh index c11db58..099bbec 100644 --- a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh +++ b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh @@ -19,7 +19,7 @@ v_dump_user_name="$1" v_file="$2" v_outpref="${v_file}" -[ -z "$v_file" ] && exitError "First parameter is the source file and cannot be null." +[ -z "${v_file}" ] && exitError "First parameter is the source file and cannot be null." [ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh index 24fdaab..95f1341 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh @@ -19,7 +19,7 @@ v_dump_user_name="$1" v_file="$2" v_outpref="${v_file}" -[ -z "$v_file" ] && exitError "First parameter is the source file and cannot be null." +[ -z "${v_file}" ] && exitError "First parameter is the source file and cannot be null." [ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." From 3c586e1a49ad2ce5e479c92280e28356b0ea35b7 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 20 Mar 2024 14:59:50 -0300 Subject: [PATCH 165/229] Remove "function" keyword --- user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh | 4 ++-- user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh | 4 ++-- user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh | 4 ++-- user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh | 4 ++-- user_scripts/odbfcl/adb_load_symbols/symbolGet.sh | 4 ++-- user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh | 4 ++-- user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh | 4 ++-- user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh | 4 ++-- user_scripts/odbfcl/sh_extractor/dictionaryGet.sh | 4 ++-- user_scripts/odbfcl/sh_extractor/dumpCreate.sh | 4 ++-- user_scripts/odbfcl/sh_extractor/exporter.sh | 4 ++-- user_scripts/odbfcl/sh_extractor/schemaCreate.sh | 4 ++-- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh index 1594a8e..7995e20 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh @@ -4,12 +4,12 @@ set -eo pipefail -function echoError () +echoError () { (>&2 echo "$1") } -function exitError () +exitError () { echoError "$1" exit 1 diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh index 4414d89..8ea4da5 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh @@ -4,12 +4,12 @@ set -eo pipefail -function echoError () +echoError () { (>&2 echo "$1") } -function exitError () +exitError () { echoError "$1" exit 1 diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh b/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh index 96507fd..de28be9 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh +++ b/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh @@ -4,12 +4,12 @@ set -eo pipefail -function echoError () +echoError () { (>&2 echo "$1") } -function exitError () +exitError () { echoError "$1" exit 1 diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh index 6044195..0d0a43f 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh +++ b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh @@ -4,12 +4,12 @@ set -eo pipefail -function echoError () +echoError () { (>&2 echo "$1") } -function exitError () +exitError () { echoError "$1" exit 1 diff --git a/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh b/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh index f9a4319..9bd4edf 100644 --- a/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh +++ b/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh @@ -7,12 +7,12 @@ # set -eo pipefail set -e # grep can return 0 lines -function echoError () +echoError () { (>&2 echo "$1") } -function exitError () +exitError () { echoError "$1" exit 1 diff --git a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh index 099bbec..9407aec 100644 --- a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh +++ b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh @@ -4,12 +4,12 @@ set -eo pipefail -function echoError () +echoError () { (>&2 echo "$1") } -function exitError () +exitError () { echoError "$1" exit 1 diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh index 49df03b..16eb712 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh @@ -7,12 +7,12 @@ set -eo pipefail -function echoError () +echoError () { (>&2 echo "$1") } -function exitError () +exitError () { echoError "$1" exit 1 diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh index 95f1341..6f7d7df 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh @@ -4,12 +4,12 @@ set -eo pipefail -function echoError () +echoError () { (>&2 echo "$1") } -function exitError () +exitError () { echoError "$1" exit 1 diff --git a/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh b/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh index f5b48bd..5a8e376 100644 --- a/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh +++ b/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh @@ -4,12 +4,12 @@ set -eo pipefail -function echoError () +echoError () { (>&2 echo "$1") } -function exitError () +exitError () { echoError "$1" exit 1 diff --git a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh index 5f5e7b3..793379a 100644 --- a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh @@ -4,12 +4,12 @@ set -eo pipefail -function echoError () +echoError () { (>&2 echo "$1") } -function exitError () +exitError () { echoError "$1" exit 1 diff --git a/user_scripts/odbfcl/sh_extractor/exporter.sh b/user_scripts/odbfcl/sh_extractor/exporter.sh index 0bda64d..35d72f3 100644 --- a/user_scripts/odbfcl/sh_extractor/exporter.sh +++ b/user_scripts/odbfcl/sh_extractor/exporter.sh @@ -5,12 +5,12 @@ set -eo pipefail -function echoError () +echoError () { (>&2 echo "$1") } -function exitError () +exitError () { echoError "$1" exit 1 diff --git a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh index f2768aa..15502a7 100644 --- a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh @@ -4,12 +4,12 @@ set -eo pipefail -function echoError () +echoError () { (>&2 echo "$1") } -function exitError () +exitError () { echoError "$1" exit 1 From 63814868bab52f82feaa72020879384018dd94fa Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 20 Mar 2024 15:24:15 -0300 Subject: [PATCH 166/229] Rename variables --- .../odbfcl/adb_load_bugs_fixed/bugsGet.sh | 8 ++--- .../odbfcl/adb_load_filechksum/chksumGet.sh | 30 ++++++++--------- .../odbfcl/adb_load_symbols/symbolGet.sh | 16 +++++----- .../adb_load_txtcollection_files/fileGet.sh | 22 ++++++------- .../odbfcl/sh_extractor/dumpCreate.sh | 32 +++++++++---------- 5 files changed, 54 insertions(+), 54 deletions(-) diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh index 7995e20..13cab5b 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh @@ -15,10 +15,10 @@ exitError () exit 1 } -v_output="$1" +v_out_file_param="$1" -[ -z "${v_output}" ] && exitError "First parameter is the target file and cannot be null." -[ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." +[ -z "${v_out_file_param}" ] && exitError "First parameter is the target file and cannot be null." +[ -f "${v_out_file_param}" ] && exitError "File \"${v_out_file_param}\" already exists. Remove it before rerunning." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." @@ -61,6 +61,6 @@ sed -r 's/[[:space:]]+/ /g' | # Replace first space per tab sed 's/ /'$'\t''/' | # Replace first space per tab (that was the second) -sed 's/ /'$'\t''/' > "${v_output}" +sed 's/ /'$'\t''/' > "${v_out_file_param}" exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh b/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh index de28be9..2c5fd74 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh +++ b/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh @@ -15,34 +15,34 @@ exitError () exit 1 } -v_output="$1" +v_out_file_param="$1" -[ -z "${v_output}" ] && exitError "First parameter is the target file and cannot be null." -[ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." +[ -z "${v_out_file_param}" ] && exitError "First parameter is the target file and cannot be null." +[ -f "${v_out_file_param}" ] && exitError "File \"${v_out_file_param}\" already exists. Remove it before rerunning." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." -v_output_fdr="$(cd "$(dirname "${v_output}")"; pwd)" -v_output_file="$(basename "${v_output}")" -v_output_file_noext="${v_output_file%.*}" +v_out_file_fdr="$(cd "$(dirname "${v_out_file_param}")"; pwd)" +v_out_file_name="$(basename "${v_out_file_param}")" +v_out_file_name_noext="${v_out_file_name%.*}" -v_output_full="${v_output_fdr}/${v_output_file}" -v_output_error="${v_output_fdr}/${v_output_file_noext}.err" +v_out_file_full="${v_out_file_fdr}/${v_out_file_name}" +v_err_file_full="${v_out_file_fdr}/${v_out_file_name_noext}.err" -[ -f "${v_output_error}" ] && rm -f "${v_output_error}" +[ -f "${v_err_file_full}" ] && rm -f "${v_err_file_full}" echo "Generating sha256sum for \$ORACLE_HOME files. Please wait.." cd "$ORACLE_HOME" set +e -find -type f -exec sha256sum "{}" + > "${v_output_full}" 2>> "${v_output_error}" +find -type f -exec sha256sum "{}" + > "${v_out_file_full}" 2>> "${v_err_file_full}" set -eo pipefail cd - > /dev/null -sed -i 's/$/ F/' "${v_output_full}" +sed -i 's/$/ F/' "${v_out_file_full}" set +e -v_libs=$(find "$ORACLE_HOME" -type f -name "*.a" 2>> "${v_output_error}") +v_libs=$(find "$ORACLE_HOME" -type f -name "*.a" 2>> "${v_err_file_full}") set -eo pipefail v_ext_fold=`mktemp -d` @@ -57,16 +57,16 @@ do mkdir "${v_ext_fold}" cd "${v_ext_fold}" set +e - ar x "${v_lib}" 2>> "${v_output_error}" + ar x "${v_lib}" 2>> "${v_err_file_full}" set -eo pipefail find -type f -exec sha256sum "{}" + > "${v_out_file}" cd - > /dev/null sed -i "s| \.| ${v_lib}|" "${v_out_file}" sed -i 's/$/ L/' "${v_out_file}" - cat "${v_out_file}" >> "${v_output}" + cat "${v_out_file}" >> "${v_out_file_param}" rm -rf "${v_ext_fold}" "${v_out_file}" done -[ -f "${v_output_error}" ] && echo "Total errors detected: $(wc -l < "${v_output_error}")" +[ -f "${v_err_file_full}" ] && echo "Total errors detected: $(wc -l < "${v_err_file_full}")" exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh b/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh index 9bd4edf..a9b1db5 100644 --- a/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh +++ b/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh @@ -18,33 +18,33 @@ exitError () exit 1 } -v_output="$1" +v_out_file_param="$1" -[ -z "${v_output}" ] && exitError "First parameter is the target file and cannot be null." -[ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." +[ -z "${v_out_file_param}" ] && exitError "First parameter is the target file and cannot be null." +[ -f "${v_out_file_param}" ] && exitError "File \"${v_out_file_param}\" already exists. Remove it before rerunning." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." -echo > "${v_output}" +echo > "${v_out_file_param}" echo "Generating symbols list. Please wait.." # Extract Symbols from Oracle archives (.a) for ARCHIVE in $(ls $ORACLE_HOME/lib/*.a $ORACLE_HOME/rdbms/lib/*.a) do - nm -A $ARCHIVE | grep ' [Tt] ' | tr ':' ' ' | cut -d" " -f1,2,4,5 | sort -u | awk '{ if ( $4 != "" ) { file=$1; sub(".*/","", file); printf "%s/%s|%s|%s\n", file, $2, $3, $4 } }' >> "${v_output}" + nm -A $ARCHIVE | grep ' [Tt] ' | tr ':' ' ' | cut -d" " -f1,2,4,5 | sort -u | awk '{ if ( $4 != "" ) { file=$1; sub(".*/","", file); printf "%s/%s|%s|%s\n", file, $2, $3, $4 } }' >> "${v_out_file_param}" done # Extract Symbols from Oracle objects (.o) for OBJECT in $(ls $ORACLE_HOME/lib/*.o $ORACLE_HOME/rdbms/lib/*.o) do - nm -A $OBJECT | grep ' [Tt] ' | tr ':' ' ' | cut -d" " -f1,3,4 | sort -u | awk '{ if ( $3 != "" ) { file=$1; sub(".*/","", file); printf "%s|%s|%s\n", file, $2, $3 } }' >> "${v_output}" + nm -A $OBJECT | grep ' [Tt] ' | tr ':' ' ' | cut -d" " -f1,3,4 | sort -u | awk '{ if ( $3 != "" ) { file=$1; sub(".*/","", file); printf "%s|%s|%s\n", file, $2, $3 } }' >> "${v_out_file_param}" done # Extract Symbols from Oracle executable -nm -A -C $ORACLE_HOME/bin/oracle | grep ' [TtDdRrVv] ' | tr ':' ' ' | cut -d" " -f1,3,4 | sort -u | awk '{ if ( $3 != "" ) { file=$1; sub(".*/","", file); printf "%s|%s|%s\n", file, $2, $3 } }' >> "${v_output}" +nm -A -C $ORACLE_HOME/bin/oracle | grep ' [TtDdRrVv] ' | tr ':' ' ' | cut -d" " -f1,3,4 | sort -u | awk '{ if ( $3 != "" ) { file=$1; sub(".*/","", file); printf "%s|%s|%s\n", file, $2, $3 } }' >> "${v_out_file_param}" # Remove empty lines or sqlldr will fail due to constant. -sed -i '/^$/d' "${v_output}" +sed -i '/^$/d' "${v_out_file_param}" exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh index 16eb712..82d1442 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh @@ -18,29 +18,29 @@ exitError () exit 1 } -v_output="$1" +v_out_file_param="$1" -[ -z "${v_output}" ] && exitError "First parameter is the target file and cannot be null." -[ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." +[ -z "${v_out_file_param}" ] && exitError "First parameter is the target file and cannot be null." +[ -f "${v_out_file_param}" ] && exitError "File \"${v_out_file_param}\" already exists. Remove it before rerunning." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." -v_output_fdr="$(cd "$(dirname "${v_output}")"; pwd)" -v_output_file="$(basename "${v_output}")" -v_output_file_noext="${v_output_file%.*}" +v_out_file_fdr="$(cd "$(dirname "${v_out_file_param}")"; pwd)" +v_out_file_name="$(basename "${v_out_file_param}")" +v_out_file_name_noext="${v_out_file_name%.*}" -v_output_full="${v_output_fdr}/${v_output_file}" -v_output_error="${v_output_fdr}/${v_output_file_noext}.err" +v_out_file_full="${v_out_file_fdr}/${v_out_file_name}" +v_err_file_full="${v_out_file_fdr}/${v_out_file_name_noext}.err" -[ -f "${v_output_error}" ] && rm -f "${v_output_error}" +[ -f "${v_err_file_full}" ] && rm -f "${v_err_file_full}" echo "Generating ORACLE_HOME non-binary files list. Please wait.." cd "$ORACLE_HOME" set +e # grep may return "Permission denied" -find -type f -not -path "./.patch_storage/*" -not -name "tfa_setup" -print0 2>> "${v_output_error}" | xargs -0 grep -Il '.' 2>> "${v_output_error}" | tar -czf "${v_output_full}" -T - +find -type f -not -path "./.patch_storage/*" -not -name "tfa_setup" -print0 2>> "${v_err_file_full}" | xargs -0 grep -Il '.' 2>> "${v_err_file_full}" | tar -czf "${v_out_file_full}" -T - -[ -f "${v_output_error}" ] && echo "Total errors detected: $(wc -l < "${v_output_error}")" +[ -f "${v_err_file_full}" ] && echo "Total errors detected: $(wc -l < "${v_err_file_full}")" exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh index 793379a..54a6fe9 100644 --- a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh @@ -16,20 +16,20 @@ exitError () } v_dump_user_name="$1" -v_output="$2" +v_out_file_param="$2" -[ -z "${v_output}" ] && exitError "First parameter is the target file and cannot be null." -[ -f "${v_output}" ] && exitError "File \"${v_output}\" already exists. Remove it before rerunning." +[ -z "${v_out_file_param}" ] && exitError "First parameter is the target file and cannot be null." +[ -f "${v_out_file_param}" ] && exitError "File \"${v_out_file_param}\" already exists. Remove it before rerunning." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." -v_output_fdr="$(cd "$(dirname "${v_output}")"; pwd)" -v_output_file="$(basename "${v_output}")" -v_output_file_noext="${v_output_file%.*}" +v_out_file_fdr="$(cd "$(dirname "${v_out_file_param}")"; pwd)" +v_out_file_name="$(basename "${v_out_file_param}")" +v_out_file_name_noext="${v_out_file_name%.*}" -v_output_full="${v_output_fdr}/${v_output_file}" -v_output_error="${v_output_fdr}/${v_output_file_noext}.err" +v_out_file_full="${v_out_file_fdr}/${v_out_file_name}" +v_err_file_full="${v_out_file_fdr}/${v_out_file_name_noext}.err" # If DB_EXP_USER_PASS is exported, use it as the password. [ -n "$DB_EXP_USER_PASS" ] && v_dump_user_pass="$DB_EXP_USER_PASS" || v_dump_user_pass='HhAaSsHh..135' @@ -39,8 +39,8 @@ v_dump_dir_name='expdir_hash' v_thisdir="$(cd "$(dirname "$0")"; pwd)" cd "${v_thisdir}" -v_output_file_cnt=`awk -F" " '{print NF-1}' <<< "${v_output_file_noext}"` -[ ${v_output_file_cnt} -ne 0 ] && exitError "File \"${v_output}\" must not have any spaces." +v_output_file_cnt=`awk -F" " '{print NF-1}' <<< "${v_out_file_name_noext}"` +[ ${v_output_file_cnt} -ne 0 ] && exitError "File \"${v_out_file_param}\" must not have any spaces." [ -z "${v_sysdba_connect}" ] && v_sysdba_connect='/ as sysdba' @@ -48,7 +48,7 @@ echo "Generating table export. Please wait.." cd "${v_thisdir}"/../../ # REMOVE_IF_ZIP $ORACLE_HOME/bin/sqlplus -L -S "${v_sysdba_connect}" <&1 >&3 | tee "${v_output_error}" +schemas="${v_dump_user_name}" 2>&1 >&3 | tee "${v_err_file_full}" v_ret=$? set -eo pipefail if [ ${v_ret} -ne 0 ] then - if grep -q 'ORA-39070: Unable to open the log file' "${v_output_error}" + if grep -q 'ORA-39070: Unable to open the log file' "${v_err_file_full}" then v_ora_user=$(stat -c '%U' $ORACLE_HOME/bin/expdp) - exitError "Error, check if the Oracle Database ('${v_ora_user}' user) has access to this directory: ${v_output_fdr}" + exitError "Error, check if the Oracle Database ('${v_ora_user}' user) has access to this directory: ${v_out_file_fdr}" else exitError 'Error when generating dump file.' fi From f02b8d402b6849e722cf73825685e7520c3769ba Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 21 Mar 2024 10:54:38 -0300 Subject: [PATCH 167/229] Term before kill --- tasks/lvm_reload.yml | 3 +++ tasks/lvm_savestate.yml | 3 +++ tasks/tar_restore.yml | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/tasks/lvm_reload.yml b/tasks/lvm_reload.yml index 1548c3d..56d1c01 100644 --- a/tasks/lvm_reload.yml +++ b/tasks/lvm_reload.yml @@ -4,6 +4,9 @@ export PATH=$PATH:/sbin:/usr/sbin v_snapshot="{{ vm_snapshot }}" v_disk="/dev/mapper/vg_u01-lv_u01" + # Term all oracle sessions + pkill -U oracle || true + sleep 5 # Kill all oracle sessions pkill -9 -U oracle || true sleep 5 diff --git a/tasks/lvm_savestate.yml b/tasks/lvm_savestate.yml index 0b05bf0..d92c27a 100644 --- a/tasks/lvm_savestate.yml +++ b/tasks/lvm_savestate.yml @@ -26,6 +26,9 @@ v_size=$(lvs --noheadings -o seg_size ${v_disk}) if grep -q 'release 5.' /etc/oracle-release then + # Term all oracle sessions + pkill -U oracle || true + sleep 5 # Kill all oracle sessions pkill -9 -U oracle || true sleep 5 diff --git a/tasks/tar_restore.yml b/tasks/tar_restore.yml index 49a6d4a..9aaaa4a 100644 --- a/tasks/tar_restore.yml +++ b/tasks/tar_restore.yml @@ -8,6 +8,10 @@ - name: "Kill all Oracle processes" shell: | set -e -x + # Term all oracle sessions + pkill -U oracle || true + # Kill all oracle sessions + sleep 5 pkill -9 -U oracle || true become: true become_user: root From 52e7741c8cf84fef53b2d9bc1d8262ed36513ff4 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 21 Mar 2024 10:54:54 -0300 Subject: [PATCH 168/229] Fix 10.2.0.1 CPU dependency --- list_patches.yml | 115 ++++++++++++++++++++++++----------------------- 1 file changed, 58 insertions(+), 57 deletions(-) diff --git a/list_patches.yml b/list_patches.yml index fe1847a..7531d5a 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -8,32 +8,33 @@ list_1020X: # 10.2.0.1 - { version : "10.2.0.1" , type : "BASE" , id : 0 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.10.2.0.1.tar.gz" } - - { version : "10.2.0.1" , type : "CPU" , id : 200601 , patch_number : 4751931 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUJan2006/catcpu.sql" } - - { version : "10.2.0.1" , type : "CPU" , id : 200604 , patch_number : 5049080 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUApr2006/catcpu.sql" } - - { version : "10.2.0.1" , type : "CPU" , id : 200607 , patch_number : 5225798 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUJul2006/catcpu.sql" } - - { version : "10.2.0.1" , type : "CPU" , id : 200610 , patch_number : 5490846 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUOct2006/catcpu.sql" } - - { version : "10.2.0.1" , type : "CPU" , id : 200701 , patch_number : 5689937 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUJan2007/catcpu.sql" } -# - { version : "10.2.0.1" , type : "CPU" , id : 200704 , patch_number : 5901880 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX + - { version : "10.2.0.1" , type : "DEP" , id : 0 , patch_number : 5240469 , dep_type : 'BASE' , dep_id : 0 } # Due to a bug, patches can only be applied after 5240469 fix + - { version : "10.2.0.1" , type : "CPU" , id : 200601 , patch_number : 4751931 , dep_type : 'DEP' , dep_id : 0 , cat_script : "cpu/CPUJan2006/catcpu.sql" } + - { version : "10.2.0.1" , type : "CPU" , id : 200604 , patch_number : 5049080 , dep_type : 'DEP' , dep_id : 0 , cat_script : "cpu/CPUApr2006/catcpu.sql" } + - { version : "10.2.0.1" , type : "CPU" , id : 200607 , patch_number : 5225798 , dep_type : 'DEP' , dep_id : 0 , cat_script : "cpu/CPUJul2006/catcpu.sql" } + - { version : "10.2.0.1" , type : "CPU" , id : 200610 , patch_number : 5490846 , dep_type : 'DEP' , dep_id : 0 , cat_script : "cpu/CPUOct2006/catcpu.sql" } + - { version : "10.2.0.1" , type : "CPU" , id : 200701 , patch_number : 5689937 , dep_type : 'DEP' , dep_id : 0 , cat_script : "cpu/CPUJan2007/catcpu.sql" } +# - { version : "10.2.0.1" , type : "CPU" , id : 200704 , patch_number : 5901880 , dep_type : 'DEP' , dep_id : 0 } # NO PATCH FOR LINUX # 10.2.0.2 - { version : "10.2.0.2" , type : "BASE" , id : 0 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.10.2.0.2.tar.gz" } - - { version : "10.2.0.2" , type : "DEP" , id : 0 , patch_number : 5240469 , dep_type : 'BASE', dep_id : 0 } # Due to a bug, patches can only be applied after 5240469 fix - - { version : "10.2.0.2" , type : "CPU" , id : 200604 , patch_number : 5079037 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUApr2006/catcpu.sql" } - - { version : "10.2.0.2" , type : "CPU" , id : 200607 , patch_number : 5225799 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUJul2006/catcpu.sql" } - - { version : "10.2.0.2" , type : "CPU" , id : 200610 , patch_number : 5490848 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUOct2006/catcpu.sql" } - - { version : "10.2.0.2" , type : "CPU" , id : 200701 , patch_number : 5689957 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUJan2007/catcpu.sql" } - - { version : "10.2.0.2" , type : "CPU" , id : 200704 , patch_number : 5901881 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUApr2007/catcpu.sql" } - - { version : "10.2.0.2" , type : "CPU" , id : 200707 , patch_number : 6079588 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUJul2007/catcpu.sql" } - - { version : "10.2.0.2" , type : "CPU" , id : 200710 , patch_number : 6394997 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUOct2007/catcpu.sql" } - - { version : "10.2.0.2" , type : "CPU" , id : 200801 , patch_number : 6646850 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUJan2008/catcpu.sql" } -# - { version : "10.2.0.2" , type : "CPU" , id : 200804 , patch_number : 6864071 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX -# - { version : "10.2.0.2" , type : "CPU" , id : 200807 , patch_number : 7154083 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX -# - { version : "10.2.0.2" , type : "CPU" , id : 200810 , patch_number : 7375660 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX -# - { version : "10.2.0.2" , type : "CPU" , id : 200901 , patch_number : 7592355 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX + - { version : "10.2.0.2" , type : "DEP" , id : 0 , patch_number : 5240469 , dep_type : 'BASE' , dep_id : 0 } # Due to a bug, patches can only be applied after 5240469 fix + - { version : "10.2.0.2" , type : "CPU" , id : 200604 , patch_number : 5079037 , dep_type : 'DEP' , dep_id : 0 , cat_script : "cpu/CPUApr2006/catcpu.sql" } + - { version : "10.2.0.2" , type : "CPU" , id : 200607 , patch_number : 5225799 , dep_type : 'DEP' , dep_id : 0 , cat_script : "cpu/CPUJul2006/catcpu.sql" } + - { version : "10.2.0.2" , type : "CPU" , id : 200610 , patch_number : 5490848 , dep_type : 'DEP' , dep_id : 0 , cat_script : "cpu/CPUOct2006/catcpu.sql" } + - { version : "10.2.0.2" , type : "CPU" , id : 200701 , patch_number : 5689957 , dep_type : 'DEP' , dep_id : 0 , cat_script : "cpu/CPUJan2007/catcpu.sql" } + - { version : "10.2.0.2" , type : "CPU" , id : 200704 , patch_number : 5901881 , dep_type : 'DEP' , dep_id : 0 , cat_script : "cpu/CPUApr2007/catcpu.sql" } + - { version : "10.2.0.2" , type : "CPU" , id : 200707 , patch_number : 6079588 , dep_type : 'DEP' , dep_id : 0 , cat_script : "cpu/CPUJul2007/catcpu.sql" } + - { version : "10.2.0.2" , type : "CPU" , id : 200710 , patch_number : 6394997 , dep_type : 'DEP' , dep_id : 0 , cat_script : "cpu/CPUOct2007/catcpu.sql" } + - { version : "10.2.0.2" , type : "CPU" , id : 200801 , patch_number : 6646850 , dep_type : 'DEP' , dep_id : 0 , cat_script : "cpu/CPUJan2008/catcpu.sql" } +# - { version : "10.2.0.2" , type : "CPU" , id : 200804 , patch_number : 6864071 , dep_type : 'DEP' , dep_id : 0 } # NO PATCH FOR LINUX +# - { version : "10.2.0.2" , type : "CPU" , id : 200807 , patch_number : 7154083 , dep_type : 'DEP' , dep_id : 0 } # NO PATCH FOR LINUX +# - { version : "10.2.0.2" , type : "CPU" , id : 200810 , patch_number : 7375660 , dep_type : 'DEP' , dep_id : 0 } # NO PATCH FOR LINUX +# - { version : "10.2.0.2" , type : "CPU" , id : 200901 , patch_number : 7592355 , dep_type : 'DEP' , dep_id : 0 } # NO PATCH FOR LINUX # 10.2.0.3 - { version : "10.2.0.3" , type : "BASE" , id : 0 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.10.2.0.3.tar.gz" } - { version : "10.2.0.3" , type : "DEP" , id : 0 , patch_number : 5240469 , dep_type : 'BASE', dep_id : 0 } # Due to a bug, patches can only be applied after 5240469 fix - - { version : "10.2.0.3" , type : "CPU" , id : 200701 , patch_number : 5881721 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUJan2007/catcpu.sql" } - - { version : "10.2.0.3" , type : "CPU" , id : 200704 , patch_number : 5901891 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUApr2007/catcpu.sql" } + - { version : "10.2.0.3" , type : "CPU" , id : 200701 , patch_number : 5881721 , dep_type : 'DEP' , dep_id : 0 , cat_script : "cpu/CPUJan2007/catcpu.sql" } + - { version : "10.2.0.3" , type : "CPU" , id : 200704 , patch_number : 5901891 , dep_type : 'DEP' , dep_id : 0 , cat_script : "cpu/CPUApr2007/catcpu.sql" } - { version : "10.2.0.3" , type : "CPU" , id : 200707 , patch_number : 6079591 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUJul2007/catcpu.sql" } - { version : "10.2.0.3" , type : "CPU" , id : 200710 , patch_number : 6394981 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUOct2007/catcpu.sql" } - { version : "10.2.0.3" , type : "CPU" , id : 200801 , patch_number : 6646853 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUJan2008/catcpu.sql" } @@ -43,23 +44,23 @@ list_1020X: - { version : "10.2.0.3" , type : "CPU" , id : 200901 , patch_number : 7592354 , dep_type : 'DEP' , dep_id : 0 , apply_method : "napply" , cat_script : "cpu/CPUJan2009/catcpu.sql" } # 10.2.0.4 - { version : "10.2.0.4" , type : "BASE" , id : 0 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.10.2.0.4.tar.gz" } - - { version : "10.2.0.4" , type : "PSU" , id : 1 , patch_number : 8576156 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.4" , type : "PSU" , id : 2 , patch_number : 8833280 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.4" , type : "PSU" , id : 3 , patch_number : 9119284 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.4" , type : "PSU" , id : 4 , patch_number : 9352164 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.4" , type : "PSU" , id : 5 , patch_number : 9654991 , dep_type : 'PSU' , dep_id : 4 , apply_method : "napply" } - - { version : "10.2.0.4" , type : "PSU" , id : 6 , patch_number : 9952234 , dep_type : 'PSU' , dep_id : 4 , apply_method : "napply" } - - { version : "10.2.0.4" , type : "PSU" , id : 7 , patch_number : 10248636 , dep_type : 'PSU' , dep_id : 4 , apply_method : "napply" } - - { version : "10.2.0.4" , type : "PSU" , id : 8 , patch_number : 11724977 , dep_type : 'PSU' , dep_id : 4 , apply_method : "napply" } - - { version : "10.2.0.4" , type : "PSU" , id : 9 , patch_number : 12419397 , dep_type : 'PSU' , dep_id : 4 , apply_method : "napply" } - - { version : "10.2.0.4" , type : "PSU" , id : 10 , patch_number : 12827778 , dep_type : 'PSU' , dep_id : 4 , apply_method : "napply" } - - { version : "10.2.0.4" , type : "PSU" , id : 11 , patch_number : 12879929 , dep_type : 'PSU' , dep_id : 4 , apply_method : "napply" } - - { version : "10.2.0.4" , type : "PSU" , id : 12 , patch_number : 12879933 , dep_type : 'PSU' , dep_id : 4 , apply_method : "napply" } -# - { version : "10.2.0.4" , type : "PSU" , id : 13 , patch_number : 13923851 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX -# - { version : "10.2.0.4" , type : "PSU" , id : 14 , patch_number : 14275630 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX -# - { version : "10.2.0.4" , type : "PSU" , id : 15 , patch_number : 14736542 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX -# - { version : "10.2.0.4" , type : "PSU" , id : 16 , patch_number : 16056269 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX -# - { version : "10.2.0.4" , type : "PSU" , id : 17 , patch_number : 16619897 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # NO PATCH FOR LINUX + - { version : "10.2.0.4" , type : "PSU" , id : 1 , patch_number : 8576156 , dep_type : 'BASE' , dep_id : 0 } + - { version : "10.2.0.4" , type : "PSU" , id : 2 , patch_number : 8833280 , dep_type : 'BASE' , dep_id : 0 } + - { version : "10.2.0.4" , type : "PSU" , id : 3 , patch_number : 9119284 , dep_type : 'BASE' , dep_id : 0 } + - { version : "10.2.0.4" , type : "PSU" , id : 4 , patch_number : 9352164 , dep_type : 'BASE' , dep_id : 0 } + - { version : "10.2.0.4" , type : "PSU" , id : 5 , patch_number : 9654991 , dep_type : 'PSU' , dep_id : 4 } + - { version : "10.2.0.4" , type : "PSU" , id : 6 , patch_number : 9952234 , dep_type : 'PSU' , dep_id : 4 } + - { version : "10.2.0.4" , type : "PSU" , id : 7 , patch_number : 10248636 , dep_type : 'PSU' , dep_id : 4 } + - { version : "10.2.0.4" , type : "PSU" , id : 8 , patch_number : 11724977 , dep_type : 'PSU' , dep_id : 4 } + - { version : "10.2.0.4" , type : "PSU" , id : 9 , patch_number : 12419397 , dep_type : 'PSU' , dep_id : 4 } + - { version : "10.2.0.4" , type : "PSU" , id : 10 , patch_number : 12827778 , dep_type : 'PSU' , dep_id : 4 } + - { version : "10.2.0.4" , type : "PSU" , id : 11 , patch_number : 12879929 , dep_type : 'PSU' , dep_id : 4 } + - { version : "10.2.0.4" , type : "PSU" , id : 12 , patch_number : 12879933 , dep_type : 'PSU' , dep_id : 4 } +# - { version : "10.2.0.4" , type : "PSU" , id : 13 , patch_number : 13923851 , dep_type : 'BASE' , dep_id : 0 } # NO PATCH FOR LINUX +# - { version : "10.2.0.4" , type : "PSU" , id : 14 , patch_number : 14275630 , dep_type : 'BASE' , dep_id : 0 } # NO PATCH FOR LINUX +# - { version : "10.2.0.4" , type : "PSU" , id : 15 , patch_number : 14736542 , dep_type : 'BASE' , dep_id : 0 } # NO PATCH FOR LINUX +# - { version : "10.2.0.4" , type : "PSU" , id : 16 , patch_number : 16056269 , dep_type : 'BASE' , dep_id : 0 } # NO PATCH FOR LINUX +# - { version : "10.2.0.4" , type : "PSU" , id : 17 , patch_number : 16619897 , dep_type : 'BASE' , dep_id : 0 } # NO PATCH FOR LINUX - { version : "10.2.0.4" , type : "CPU" , id : 200807 , patch_number : 7150470 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - { version : "10.2.0.4" , type : "CPU" , id : 200810 , patch_number : 7375644 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - { version : "10.2.0.4" , type : "CPU" , id : 200901 , patch_number : 7592346 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } @@ -88,25 +89,25 @@ list_1020X: - { version : "10.2.0.4" , type : "CPU" , id : 201307 , patch_number : 14038845 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } # EXCEPTION - PASSWORD PROTECTED # 10.2.0.5 - { version : "10.2.0.5" , type : "BASE" , id : 0 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.10.2.0.5.tar.gz" } - - { version : "10.2.0.5" , type : "PSU" , id : 1 , patch_number : 9952230 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.5" , type : "PSU" , id : 2 , patch_number : 10248542 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.5" , type : "PSU" , id : 3 , patch_number : 11724962 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.5" , type : "PSU" , id : 4 , patch_number : 12419392 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.5" , type : "PSU" , id : 5 , patch_number : 12827745 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.5" , type : "PSU" , id : 6 , patch_number : 13343471 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.5" , type : "PSU" , id : 7 , patch_number : 13632743 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.5" , type : "PSU" , id : 8 , patch_number : 13923855 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.5" , type : "PSU" , id : 9 , patch_number : 14275629 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.5" , type : "PSU" , id : 10 , patch_number : 14727319 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.5" , type : "PSU" , id : 11 , patch_number : 16056270 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.5" , type : "PSU" , id : 12 , patch_number : 16619894 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.5" , type : "PSU" , id : 13 , patch_number : 17082365 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.5" , type : "PSU" , id : 14 , patch_number : 17465584 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.5" , type : "PSU" , id : 15 , patch_number : 18031728 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.5" , type : "PSU" , id : 16 , patch_number : 18522511 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.5" , type : "PSU" , id : 17 , patch_number : 19274523 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.5" , type : "PSU" , id : 18 , patch_number : 19769505 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - - { version : "10.2.0.5" , type : "PSU" , id : 19 , patch_number : 20299014 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } + - { version : "10.2.0.5" , type : "PSU" , id : 1 , patch_number : 9952230 , dep_type : 'BASE' , dep_id : 0 } + - { version : "10.2.0.5" , type : "PSU" , id : 2 , patch_number : 10248542 , dep_type : 'BASE' , dep_id : 0 } + - { version : "10.2.0.5" , type : "PSU" , id : 3 , patch_number : 11724962 , dep_type : 'BASE' , dep_id : 0 } + - { version : "10.2.0.5" , type : "PSU" , id : 4 , patch_number : 12419392 , dep_type : 'BASE' , dep_id : 0 } + - { version : "10.2.0.5" , type : "PSU" , id : 5 , patch_number : 12827745 , dep_type : 'BASE' , dep_id : 0 } + - { version : "10.2.0.5" , type : "PSU" , id : 6 , patch_number : 13343471 , dep_type : 'BASE' , dep_id : 0 } + - { version : "10.2.0.5" , type : "PSU" , id : 7 , patch_number : 13632743 , dep_type : 'BASE' , dep_id : 0 } + - { version : "10.2.0.5" , type : "PSU" , id : 8 , patch_number : 13923855 , dep_type : 'BASE' , dep_id : 0 } + - { version : "10.2.0.5" , type : "PSU" , id : 9 , patch_number : 14275629 , dep_type : 'BASE' , dep_id : 0 } + - { version : "10.2.0.5" , type : "PSU" , id : 10 , patch_number : 14727319 , dep_type : 'BASE' , dep_id : 0 } + - { version : "10.2.0.5" , type : "PSU" , id : 11 , patch_number : 16056270 , dep_type : 'BASE' , dep_id : 0 } + - { version : "10.2.0.5" , type : "PSU" , id : 12 , patch_number : 16619894 , dep_type : 'BASE' , dep_id : 0 } + - { version : "10.2.0.5" , type : "PSU" , id : 13 , patch_number : 17082365 , dep_type : 'BASE' , dep_id : 0 } + - { version : "10.2.0.5" , type : "PSU" , id : 14 , patch_number : 17465584 , dep_type : 'BASE' , dep_id : 0 } + - { version : "10.2.0.5" , type : "PSU" , id : 15 , patch_number : 18031728 , dep_type : 'BASE' , dep_id : 0 } + - { version : "10.2.0.5" , type : "PSU" , id : 16 , patch_number : 18522511 , dep_type : 'BASE' , dep_id : 0 } + - { version : "10.2.0.5" , type : "PSU" , id : 17 , patch_number : 19274523 , dep_type : 'BASE' , dep_id : 0 } + - { version : "10.2.0.5" , type : "PSU" , id : 18 , patch_number : 19769505 , dep_type : 'BASE' , dep_id : 0 } + - { version : "10.2.0.5" , type : "PSU" , id : 19 , patch_number : 20299014 , dep_type : 'BASE' , dep_id : 0 } - { version : "10.2.0.5" , type : "CPU" , id : 201010 , patch_number : 9952270 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - { version : "10.2.0.5" , type : "CPU" , id : 201101 , patch_number : 10249537 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } - { version : "10.2.0.5" , type : "CPU" , id : 201104 , patch_number : 11725006 , dep_type : 'BASE' , dep_id : 0 , apply_method : "napply" } From f54f8bed329fd4dfb736056333cc0b6f50f4bcb0 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 25 Apr 2024 11:51:58 -0300 Subject: [PATCH 169/229] New 2024APR patches and minor perf improvement --- list_patches.yml | 24 +++++++++++++++++++++++- tasks/patch_tasks_pre.yml | 14 ++++++++++++-- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/list_patches.yml b/list_patches.yml index 7531d5a..4848440 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -335,6 +335,7 @@ list_11204: - { type : "PSU" , id : 230418 , patch_number : 34998337 } - { type : "PSU" , id : 230718 , patch_number : 35269283 } - { type : "PSU" , id : 231017 , patch_number : 35574075 } + - { type : "PSU" , id : 240416 , patch_number : 36222299 } # 11.2.0.4 OJVM - { type : "OJVM" , id : 1 , patch_number : 19282021 } - { type : "OJVM" , id : 2 , patch_number : 19877440 } @@ -374,6 +375,7 @@ list_11204: - { type : "OJVM" , id : 230718 , patch_number : 35349843 } - { type : "OJVM" , id : 231017 , patch_number : 35685663 } - { type : "OJVM" , id : 240116 , patch_number : 35926733 } + - { type : "OJVM" , id : 240416 , patch_number : 36222352 } # 11.2.0.4 BP - { type : "BP" , id : 1 , patch_number : 17628025 , patch_folder : 17628006 } - { type : "BP" , id : 2 , patch_number : 17838803 , patch_folder : 17741631 } @@ -428,6 +430,7 @@ list_11204: - { type : "BP" , id : 230418 , patch_number : 35058326 , patch_folder : 34998345 } - { type : "BP" , id : 230718 , patch_number : 35369924 , patch_folder : 35269278 } - { type : "BP" , id : 231017 , patch_number : 35685705 , patch_folder : 35574089 } + - { type : "BP" , id : 240416 , patch_number : 36234434 , patch_folder : 36222308 } #################### ##### 12.1.0.1 ##### @@ -507,6 +510,7 @@ list_12102: - { type : "PSU" , id : 230418 , patch_number : 34998358 } - { type : "PSU" , id : 230718 , patch_number : 35269262 } - { type : "PSU" , id : 231017 , patch_number : 35564645 } + - { type : "PSU" , id : 240416 , patch_number : 36222283 } # 12.1.0.2 OJVM - { type : "OJVM" , id : 1 , patch_number : 19282028 } - { type : "OJVM" , id : 2 , patch_number : 19877336 } @@ -546,6 +550,7 @@ list_12102: - { type : "OJVM" , id : 230718 , patch_number : 35354391 } - { type : "OJVM" , id : 231017 , patch_number : 35685666 } - { type : "OJVM" , id : 240116 , patch_number : 35926723 } + - { type : "OJVM" , id : 240416 , patch_number : 36222331 } # 12.1.0.2 BP - { type : "BP" , id : 1 , patch_number : 19404326 , patch_folder : 19189240 } - { type : "BP" , id : 2 , patch_number : 19774304 , patch_folder : 19649591 } @@ -593,6 +598,7 @@ list_12102: - { type : "BP" , id : 230418 , patch_number : 35058289 , patch_folder : 34998350 } - { type : "BP" , id : 230718 , patch_number : 35369903 , patch_folder : 35269270 } - { type : "BP" , id : 231017 , patch_number : 35685744 , patch_folder : 35564676 } + - { type : "BP" , id : 240416 , patch_number : 36360782 , patch_folder : 36222291 } #################### ##### 12.2.0.1 ##### @@ -630,6 +636,7 @@ list_12201: - { type : "RU" , id : 230718 , patch_number : 35407080 } # PASSWORD PROTECTED - { type : "RU" , id : 231017 , patch_number : 35746058 } # PASSWORD PROTECTED - { type : "RU" , id : 240116 , patch_number : 35966787 } # PASSWORD PROTECTED + - { type : "RU" , id : 240416 , patch_number : 36325581 } # PASSWORD PROTECTED # 12.2.0.1 RUR - { type : "RUR" , id : 171017 , patch_number : 26518812 , base_ru : JUL2017 } - { type : "RUR" , id : 180116 , patch_number : 27013506 , base_ru : JUL2017 } @@ -684,6 +691,7 @@ list_12201: - { type : "OJVM" , id : 230718 , patch_number : 35348984 } # PASSWORD PROTECTED - { type : "OJVM" , id : 231017 , patch_number : 35685669 } # PASSWORD PROTECTED - { type : "OJVM" , id : 240116 , patch_number : 35926712 } # PASSWORD PROTECTED + - { type : "OJVM" , id : 240416 , patch_number : 36222324 } # PASSWORD PROTECTED #################### ##### 18.0.0.0 ##### @@ -719,6 +727,7 @@ list_18000: - { type : "RU" , id : 23 , patch_number : 35411347 } # NOT AVAILABLE TO DOWNLOAD - { type : "RU" , id : 24 , patch_number : 35744266 } # NOT AVAILABLE TO DOWNLOAD - { type : "RU" , id : 25 , patch_number : 35962880 } # NOT AVAILABLE TO DOWNLOAD + - { type : "RU" , id : 26 , patch_number : 36339040 } # NOT AVAILABLE TO DOWNLOAD # 18c RUR # - { type : "RUR" , id : 1 , patch_number : 28346593 , base_ru : '18.2' } # - { type : "RUR" , id : 2 , patch_number : 28601267 , base_ru : '18.2' } @@ -767,7 +776,9 @@ list_18000: - { type : "OJVM" , id : 230418 , patch_number : 35058238 } # NOT AVAILABLE TO DOWNLOAD # 18.22 - { type : "OJVM" , id : 230718 , patch_number : 35354394 } # NOT AVAILABLE TO DOWNLOAD # 18.23 - { type : "OJVM" , id : 231017 , patch_number : 35685672 } # NOT AVAILABLE TO DOWNLOAD # 18.24 - - { type : "OJVM" , id : 240116 , patch_number : 35926632 } # NOT AVAILABLE TO DOWNLOAD # 18.24 + - { type : "OJVM" , id : 240116 , patch_number : 35926632 } # NOT AVAILABLE TO DOWNLOAD # 18.25 + - { type : "OJVM" , id : 240416 , patch_number : 36222358 } # NOT AVAILABLE TO DOWNLOAD # 18.26 + # No more updates on this one. @@ -800,6 +811,7 @@ list_19000: - { type : "RU" , id : 20 , patch_number : 35320081 } - { type : "RU" , id : 21 , patch_number : 35643107 } - { type : "RU" , id : 22 , patch_number : 35943157 } + - { type : "RU" , id : 23 , patch_number : 36233263 } # 19c RUR - { type : "RUR" , id : 1 , patch_number : 29799057 , base_ru : '19.3' } - { type : "RUR" , id : 2 , patch_number : 30087906 , base_ru : '19.3' } @@ -858,6 +870,12 @@ list_19000: - { type : "MRP" , id : 231121 , patch_number : 35972882 , base_ru : '19.21' , dep_type : 'RU' , dep_id : 21 , apply_method : "napply" } - { type : "MRP" , id : 231219 , patch_number : 36062320 , base_ru : '19.21' , dep_type : 'RU' , dep_id : 21 , apply_method : "napply" } - { type : "MRP" , id : 240116 , patch_number : 36155925 , base_ru : '19.21' , dep_type : 'RU' , dep_id : 21 , apply_method : "napply" } + - { type : "MRP" , id : 240220 , patch_number : 36235312 , base_ru : '19.21' , dep_type : 'RU' , dep_id : 21 , apply_method : "napply" } + - { type : "MRP" , id : 240319 , patch_number : 36356936 , base_ru : '19.21' , dep_type : 'RU' , dep_id : 21 , apply_method : "napply" } + - { type : "MRP" , id : 240416 , patch_number : 36484230 , base_ru : '19.21' , dep_type : 'RU' , dep_id : 21 , apply_method : "napply" } + - { type : "MRP" , id : 240220 , patch_number : 36235402 , base_ru : '19.22' , dep_type : 'RU' , dep_id : 22 , apply_method : "napply" } + - { type : "MRP" , id : 240319 , patch_number : 36356978 , base_ru : '19.22' , dep_type : 'RU' , dep_id : 22 , apply_method : "napply" } + - { type : "MRP" , id : 240416 , patch_number : 36484234 , base_ru : '19.22' , dep_type : 'RU' , dep_id : 22 , apply_method : "napply" } # 19c OJVM - { type : "OJVM" , id : 190416 , patch_number : 29548437 } - { type : "OJVM" , id : 190716 , patch_number : 29774421 } @@ -879,6 +897,7 @@ list_19000: - { type : "OJVM" , id : 230718 , patch_number : 35354406 } - { type : "OJVM" , id : 231017 , patch_number : 35648110 } - { type : "OJVM" , id : 240116 , patch_number : 35926646 } + - { type : "OJVM" , id : 240416 , patch_number : 36199232 } # 19c DPBP - { type : "DPBP" , id : 10 , patch_number : 32583144 , dep_type : 'RU' , dep_id : 10 } - { type : "DPBP" , id : 11 , patch_number : 32958059 , dep_type : 'RU' , dep_id : 11 } @@ -893,6 +912,7 @@ list_19000: - { type : "DPBP" , id : 20 , patch_number : 35512813 , dep_type : 'RU' , dep_id : 20 } - { type : "DPBP" , id : 21 , patch_number : 35787077 , dep_type : 'RU' , dep_id : 21 } - { type : "DPBP" , id : 22 , patch_number : 36092868 , dep_type : 'RU' , dep_id : 22 } + - { type : "DPBP" , id : 23 , patch_number : 36420641 , dep_type : 'RU' , dep_id : 23 } #################### ##### 21.0.0.0 ##### @@ -910,6 +930,7 @@ list_21000: - { type : "RU" , id : 11 , patch_number : 35428978 } - { type : "RU" , id : 12 , patch_number : 35740258 } - { type : "RU" , id : 13 , patch_number : 36041222 } + - { type : "RU" , id : 14 , patch_number : 36352352 } #################### ##### 23.0.0.0 ##### @@ -919,6 +940,7 @@ list_23000: - { type : "BETA" , id : 1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta1.tar.gz" } - { type : "BETA" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta2.tar.gz" } - { type : "BETA" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta3.tar.gz" } + - { type : "BETA" , id : 4 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta4.tar.gz" } - { type : "FREE" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel1_Beta2.tar.gz" , oracle_sid : "FREE" , expdp_comp : false } - { type : "FREE" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel2_Beta3.tar.gz" , oracle_sid : "FREE" , expdp_comp : false } # - { type : "RU" , id : 3 , patch_number : 00000000 , base_snap : "23.2.0" } \ No newline at end of file diff --git a/tasks/patch_tasks_pre.yml b/tasks/patch_tasks_pre.yml index db379e3..ae75545 100644 --- a/tasks/patch_tasks_pre.yml +++ b/tasks/patch_tasks_pre.yml @@ -57,7 +57,7 @@ - err_list.type == patch.type - err_list.id == patch.id - # When processing processing something, or perform_patch_actions = true + # When processing something, or perform_patch_actions = true - block: # Place patch file on the shared folder @@ -181,10 +181,14 @@ unarchive: src: "{{ db_patch }}" dest: "{{ shared_folder }}" + when: patch.patch_folder is undefined # When patch_folder variable is defined (mostly for BPs), extract that folder from unziped patch to apply - block: + - name : Unzip Patch to VM shared folder + shell: "unzip {{ db_patch }} '{{ unzip_patch_folder }}/{{ patch.patch_folder }}/*' -d {{ shared_folder }}" + - name: Process only patch subfolder command: "mv {{ unzip_patch_folder }}/{{ patch.patch_folder }} {{ shared_folder }}" @@ -198,6 +202,12 @@ when: patch.patch_folder is defined + - name: Remove file downloaded from OCI Bucket + file: + state: absent + path: "{{ db_patch }}" + when: patch_location_type == "bucket" + when: perform_patch_actions # Trigger database refresh command. @@ -206,7 +216,7 @@ - include: vbox_reload.yml when: not oci_mode - # We will run the lvm reload if we found the LVM entry to restore or if we are not running + # We will run the lvm reload if we found the LVM entry to restore or if we are not running - include: lvm_reload.yml when: > oci_mode and From b5e7d0b1b2b5d09d58f7496f5f61e7e168207285 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 25 Apr 2024 16:44:13 -0300 Subject: [PATCH 170/229] Update find_patch.yml --- tasks/find_patch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/find_patch.yml b/tasks/find_patch.yml index 001ea29..0a7099b 100644 --- a/tasks/find_patch.yml +++ b/tasks/find_patch.yml @@ -36,7 +36,7 @@ oci_download_file: "{{ oci_action.objects | map(attribute='name') | select('search',(patch.file_suf | default('')) ~ '.zip') | select('search', my_query) | list | first }}" when: - oci_action.objects | map(attribute='name') | select('search', my_query) | list | length > 0 - - patch.type == "MRP" and patch.type == "DPBP" + - patch.type == "MRP" or patch.type == "DPBP" when: patch_location_type == "bucket" From 9977c98b9ed14c2e869a59ff8c68028be234de7b Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 26 Apr 2024 10:14:29 -0300 Subject: [PATCH 171/229] Minor fixes --- list_exceptions.yml | 2 ++ tasks/patch_tasks_pre.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/list_exceptions.yml b/list_exceptions.yml index b0b1b38..73a8874 100644 --- a/list_exceptions.yml +++ b/list_exceptions.yml @@ -26,6 +26,7 @@ list_retry_datapatch: - { version: "12.1.0.2" , type : "BP" , id : 230418 , retries : 3 } - { version: "12.1.0.2" , type : "BP" , id : 230718 , retries : 3 } - { version: "12.1.0.2" , type : "BP" , id : 231017 , retries : 3 } + - { version: "12.1.0.2" , type : "BP" , id : 240416 , retries : 3 } ###### - { version: "12.1.0.2" , type : "PSU" , id : 200714 , retries : 2 } - { version: "12.1.0.2" , type : "PSU" , id : 201020 , retries : 2 } @@ -41,6 +42,7 @@ list_retry_datapatch: - { version: "12.1.0.2" , type : "PSU" , id : 230418 , retries : 2 } - { version: "12.1.0.2" , type : "PSU" , id : 230718 , retries : 2 } - { version: "12.1.0.2" , type : "PSU" , id : 231017 , retries : 2 } + - { version: "12.1.0.2" , type : "PSU" , id : 240416 , retries : 2 } ###### - { version: "12.2.0.1" , type : "RU" , id : 190716 , retries : 1 } - { version: "12.2.0.1" , type : "RU" , id : 191015 , retries : 1 } diff --git a/tasks/patch_tasks_pre.yml b/tasks/patch_tasks_pre.yml index ae75545..4ec73d2 100644 --- a/tasks/patch_tasks_pre.yml +++ b/tasks/patch_tasks_pre.yml @@ -187,7 +187,7 @@ - block: - name : Unzip Patch to VM shared folder - shell: "unzip {{ db_patch }} '{{ unzip_patch_folder }}/{{ patch.patch_folder }}/*' -d {{ shared_folder }}" + shell: "unzip {{ db_patch }} '{{ patch.patch_number }}/{{ patch.patch_folder }}/*' -d {{ shared_folder }}" - name: Process only patch subfolder command: "mv {{ unzip_patch_folder }}/{{ patch.patch_folder }} {{ shared_folder }}" From 742dde1fd86d6c211269fcdc7ce6852e044a9e0c Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 6 May 2024 11:00:34 -0300 Subject: [PATCH 172/229] Update setup_database.yml --- tasks/setup_database.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tasks/setup_database.yml b/tasks/setup_database.yml index d72f927..0b5db1d 100644 --- a/tasks/setup_database.yml +++ b/tasks/setup_database.yml @@ -7,6 +7,11 @@ set_fact: dbhome_locl: "{{ dbhomeoutput.stdout }}" +- name : Override DB Home + set_fact: + dbhome_locl: "{{ dbhomeoutput.stdout }}" + when: patch.oracle_home is defined + - name : Print DB Home debug: var=dbhome_locl @@ -100,7 +105,7 @@ db_start_retried: false # when: db_version != "11.2.0.2" and db_version != "11.2.0.3" and db_version != "11.2.0.4" - when: ( db_version | regex_replace('^([^\.]+).*','\\1') | int ) > 11 + when: ( db_version | regex_replace('^([^\.]+).*','\\1') | int ) > 11 and ( db_version | regex_replace('^([^\.]+).*','\\1') | int ) < 23 - name : Define CDB variable @@ -109,6 +114,12 @@ # when: db_version == "11.2.0.2" or db_version == "11.2.0.3" or db_version == "11.2.0.4" when: ( db_version | regex_replace('^([^\.]+).*','\\1') | int ) <= 11 +- name : Define CDB variable + set_fact: + db_iscdb: true +# when: db_version == "11.2.0.2" or db_version == "11.2.0.3" or db_version == "11.2.0.4" + when: ( db_version | regex_replace('^([^\.]+).*','\\1') | int ) >= 23 + ### Adjust dump_user_int based on database type and provided value. - name : Fail when dump_user is invalid From 7f96ebf9d2ea7fd81832ecd652bec7bfed10e99f Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 6 May 2024 11:02:13 -0300 Subject: [PATCH 173/229] Small fixes --- list_patches.yml | 11 ++++++----- tasks/datapatch.yml | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/list_patches.yml b/list_patches.yml index 4848440..c26953a 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -937,10 +937,11 @@ list_21000: #################### list_23000: - - { type : "BETA" , id : 1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta1.tar.gz" } - - { type : "BETA" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta2.tar.gz" } - - { type : "BETA" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta3.tar.gz" } +# - { type : "BETA" , id : 1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta1.tar.gz" } +# - { type : "BETA" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta2.tar.gz" } +# - { type : "BETA" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta3.tar.gz" } - { type : "BETA" , id : 4 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta4.tar.gz" } - - { type : "FREE" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel1_Beta2.tar.gz" , oracle_sid : "FREE" , expdp_comp : false } - - { type : "FREE" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel2_Beta3.tar.gz" , oracle_sid : "FREE" , expdp_comp : false } + - { type : "FREE" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel2.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel3.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 4 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel4.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } # - { type : "RU" , id : 3 , patch_number : 00000000 , base_snap : "23.2.0" } \ No newline at end of file diff --git a/tasks/datapatch.yml b/tasks/datapatch.yml index b725159..d2aa434 100644 --- a/tasks/datapatch.yml +++ b/tasks/datapatch.yml @@ -1,7 +1,8 @@ - name: Run Datapatch shell: | export ORACLE_HOME ORACLE_SID - ./datapatch -verbose >> /tmp/datapatch.{{ file_suffix }}_{{ datapatch_try }}.log 2>&1 + [ ! -d ~/datapatch_logs ] && mkdir ~/datapatch_logs + ./datapatch -verbose 2>&1 | tee ~/datapatch_logs/datapatch.{{ file_suffix }}_{{ datapatch_try }}.log environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" From b264803ce9085b11346436007ea0c00103dea143 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 16 Jul 2024 16:38:28 -0300 Subject: [PATCH 174/229] New July-2024 patches and minor improvements --- list_patches.yml | 31 +- user_scripts/odbfcl/createUser.sql | 4 +- .../diff_calculate/diff_calculate_all.sql | 337 ++++++++++++++++++ .../odbfcl/diff_calculate/diff_main_all.sql | 39 ++ user_scripts/odbfcl/extract/load_code.sql | 12 +- 5 files changed, 411 insertions(+), 12 deletions(-) create mode 100644 user_scripts/odbfcl/diff_calculate/diff_calculate_all.sql create mode 100644 user_scripts/odbfcl/diff_calculate/diff_main_all.sql diff --git a/list_patches.yml b/list_patches.yml index c26953a..83dfa02 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -336,6 +336,7 @@ list_11204: - { type : "PSU" , id : 230718 , patch_number : 35269283 } - { type : "PSU" , id : 231017 , patch_number : 35574075 } - { type : "PSU" , id : 240416 , patch_number : 36222299 } + - { type : "PSU" , id : 240716 , patch_number : 36575425 } # 11.2.0.4 OJVM - { type : "OJVM" , id : 1 , patch_number : 19282021 } - { type : "OJVM" , id : 2 , patch_number : 19877440 } @@ -376,6 +377,7 @@ list_11204: - { type : "OJVM" , id : 231017 , patch_number : 35685663 } - { type : "OJVM" , id : 240116 , patch_number : 35926733 } - { type : "OJVM" , id : 240416 , patch_number : 36222352 } + - { type : "OJVM" , id : 240716 , patch_number : 36533106 } # 11.2.0.4 BP - { type : "BP" , id : 1 , patch_number : 17628025 , patch_folder : 17628006 } - { type : "BP" , id : 2 , patch_number : 17838803 , patch_folder : 17741631 } @@ -431,6 +433,7 @@ list_11204: - { type : "BP" , id : 230718 , patch_number : 35369924 , patch_folder : 35269278 } - { type : "BP" , id : 231017 , patch_number : 35685705 , patch_folder : 35574089 } - { type : "BP" , id : 240416 , patch_number : 36234434 , patch_folder : 36222308 } + - { type : "BP" , id : 240716 , patch_number : 36663546 , patch_folder : 36521957 } #################### ##### 12.1.0.1 ##### @@ -511,6 +514,7 @@ list_12102: - { type : "PSU" , id : 230718 , patch_number : 35269262 } - { type : "PSU" , id : 231017 , patch_number : 35564645 } - { type : "PSU" , id : 240416 , patch_number : 36222283 } + - { type : "PSU" , id : 240716 , patch_number : 36519012 } # 12.1.0.2 OJVM - { type : "OJVM" , id : 1 , patch_number : 19282028 } - { type : "OJVM" , id : 2 , patch_number : 19877336 } @@ -551,6 +555,7 @@ list_12102: - { type : "OJVM" , id : 231017 , patch_number : 35685666 } - { type : "OJVM" , id : 240116 , patch_number : 35926723 } - { type : "OJVM" , id : 240416 , patch_number : 36222331 } + - { type : "OJVM" , id : 240716 , patch_number : 36533098 } # 12.1.0.2 BP - { type : "BP" , id : 1 , patch_number : 19404326 , patch_folder : 19189240 } - { type : "BP" , id : 2 , patch_number : 19774304 , patch_folder : 19649591 } @@ -599,6 +604,7 @@ list_12102: - { type : "BP" , id : 230718 , patch_number : 35369903 , patch_folder : 35269270 } - { type : "BP" , id : 231017 , patch_number : 35685744 , patch_folder : 35564676 } - { type : "BP" , id : 240416 , patch_number : 36360782 , patch_folder : 36222291 } + - { type : "BP" , id : 240716 , patch_number : 36663406 , patch_folder : 36519004 } #################### ##### 12.2.0.1 ##### @@ -637,6 +643,7 @@ list_12201: - { type : "RU" , id : 231017 , patch_number : 35746058 } # PASSWORD PROTECTED - { type : "RU" , id : 240116 , patch_number : 35966787 } # PASSWORD PROTECTED - { type : "RU" , id : 240416 , patch_number : 36325581 } # PASSWORD PROTECTED + - { type : "RU" , id : 240716 , patch_number : 36650048 } # PASSWORD PROTECTED # 12.2.0.1 RUR - { type : "RUR" , id : 171017 , patch_number : 26518812 , base_ru : JUL2017 } - { type : "RUR" , id : 180116 , patch_number : 27013506 , base_ru : JUL2017 } @@ -692,6 +699,7 @@ list_12201: - { type : "OJVM" , id : 231017 , patch_number : 35685669 } # PASSWORD PROTECTED - { type : "OJVM" , id : 240116 , patch_number : 35926712 } # PASSWORD PROTECTED - { type : "OJVM" , id : 240416 , patch_number : 36222324 } # PASSWORD PROTECTED + - { type : "OJVM" , id : 240716 , patch_number : 36533083 } # PASSWORD PROTECTED #################### ##### 18.0.0.0 ##### @@ -728,6 +736,7 @@ list_18000: - { type : "RU" , id : 24 , patch_number : 35744266 } # NOT AVAILABLE TO DOWNLOAD - { type : "RU" , id : 25 , patch_number : 35962880 } # NOT AVAILABLE TO DOWNLOAD - { type : "RU" , id : 26 , patch_number : 36339040 } # NOT AVAILABLE TO DOWNLOAD + - { type : "RU" , id : 27 , patch_number : 36682577 } # NOT AVAILABLE TO DOWNLOAD # 18c RUR # - { type : "RUR" , id : 1 , patch_number : 28346593 , base_ru : '18.2' } # - { type : "RUR" , id : 2 , patch_number : 28601267 , base_ru : '18.2' } @@ -778,6 +787,7 @@ list_18000: - { type : "OJVM" , id : 231017 , patch_number : 35685672 } # NOT AVAILABLE TO DOWNLOAD # 18.24 - { type : "OJVM" , id : 240116 , patch_number : 35926632 } # NOT AVAILABLE TO DOWNLOAD # 18.25 - { type : "OJVM" , id : 240416 , patch_number : 36222358 } # NOT AVAILABLE TO DOWNLOAD # 18.26 + - { type : "OJVM" , id : 240716 , patch_number : 36533062 } # NOT AVAILABLE TO DOWNLOAD # 18.27 # No more updates on this one. @@ -812,6 +822,7 @@ list_19000: - { type : "RU" , id : 21 , patch_number : 35643107 } - { type : "RU" , id : 22 , patch_number : 35943157 } - { type : "RU" , id : 23 , patch_number : 36233263 } + - { type : "RU" , id : 24 , patch_number : 36582781 } # 19c RUR - { type : "RUR" , id : 1 , patch_number : 29799057 , base_ru : '19.3' } - { type : "RUR" , id : 2 , patch_number : 30087906 , base_ru : '19.3' } @@ -876,6 +887,12 @@ list_19000: - { type : "MRP" , id : 240220 , patch_number : 36235402 , base_ru : '19.22' , dep_type : 'RU' , dep_id : 22 , apply_method : "napply" } - { type : "MRP" , id : 240319 , patch_number : 36356978 , base_ru : '19.22' , dep_type : 'RU' , dep_id : 22 , apply_method : "napply" } - { type : "MRP" , id : 240416 , patch_number : 36484234 , base_ru : '19.22' , dep_type : 'RU' , dep_id : 22 , apply_method : "napply" } + - { type : "MRP" , id : 240521 , patch_number : 36576193 , base_ru : '19.22' , dep_type : 'RU' , dep_id : 22 , apply_method : "napply" } + - { type : "MRP" , id : 240618 , patch_number : 36701122 , base_ru : '19.22' , dep_type : 'RU' , dep_id : 22 , apply_method : "napply" } + - { type : "MRP" , id : 240716 , patch_number : 36778719 , base_ru : '19.22' , dep_type : 'RU' , dep_id : 22 , apply_method : "napply" } + - { type : "MRP" , id : 240521 , patch_number : 36576266 , base_ru : '19.23' , dep_type : 'RU' , dep_id : 23 , apply_method : "napply" } + - { type : "MRP" , id : 240618 , patch_number : 36701173 , base_ru : '19.23' , dep_type : 'RU' , dep_id : 23 , apply_method : "napply" } + - { type : "MRP" , id : 240716 , patch_number : 36779399 , base_ru : '19.23' , dep_type : 'RU' , dep_id : 23 , apply_method : "napply" } # 19c OJVM - { type : "OJVM" , id : 190416 , patch_number : 29548437 } - { type : "OJVM" , id : 190716 , patch_number : 29774421 } @@ -898,6 +915,7 @@ list_19000: - { type : "OJVM" , id : 231017 , patch_number : 35648110 } - { type : "OJVM" , id : 240116 , patch_number : 35926646 } - { type : "OJVM" , id : 240416 , patch_number : 36199232 } + - { type : "OJVM" , id : 240716 , patch_number : 36414915 } # 19c DPBP - { type : "DPBP" , id : 10 , patch_number : 32583144 , dep_type : 'RU' , dep_id : 10 } - { type : "DPBP" , id : 11 , patch_number : 32958059 , dep_type : 'RU' , dep_id : 11 } @@ -913,6 +931,7 @@ list_19000: - { type : "DPBP" , id : 21 , patch_number : 35787077 , dep_type : 'RU' , dep_id : 21 } - { type : "DPBP" , id : 22 , patch_number : 36092868 , dep_type : 'RU' , dep_id : 22 } - { type : "DPBP" , id : 23 , patch_number : 36420641 , dep_type : 'RU' , dep_id : 23 } + - { type : "DPBP" , id : 24 , patch_number : 36682332 , dep_type : 'RU' , dep_id : 24 } #################### ##### 21.0.0.0 ##### @@ -931,6 +950,7 @@ list_21000: - { type : "RU" , id : 12 , patch_number : 35740258 } - { type : "RU" , id : 13 , patch_number : 36041222 } - { type : "RU" , id : 14 , patch_number : 36352352 } + - { type : "RU" , id : 15 , patch_number : 36696242 } #################### ##### 23.0.0.0 ##### @@ -940,8 +960,9 @@ list_23000: # - { type : "BETA" , id : 1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta1.tar.gz" } # - { type : "BETA" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta2.tar.gz" } # - { type : "BETA" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta3.tar.gz" } - - { type : "BETA" , id : 4 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta4.tar.gz" } - - { type : "FREE" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel2.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } - - { type : "FREE" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel3.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } - - { type : "FREE" , id : 4 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel4.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } -# - { type : "RU" , id : 3 , patch_number : 00000000 , base_snap : "23.2.0" } \ No newline at end of file +# - { type : "BETA" , id : 4 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta4.tar.gz" } + - { type : "RU" , id : 4.1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.RU_4_1.tar.gz" } +# - { type : "RU" , id : 5 , patch_number : 36741532 } + - { type : "FREE" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel2.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel3.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 4 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel4.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } \ No newline at end of file diff --git a/user_scripts/odbfcl/createUser.sql b/user_scripts/odbfcl/createUser.sql index 84109bd..d3e31ed 100644 --- a/user_scripts/odbfcl/createUser.sql +++ b/user_scripts/odbfcl/createUser.sql @@ -21,5 +21,7 @@ GRANT CREATE TABLE TO &v_username.; -- REMOVE_IF_ZIP_AFTER +-- This is no longer enabled after wrapper moved to PL/SQL + -- For unwrapper: -GRANT CREATE PROCEDURE TO &v_username.; \ No newline at end of file +-- GRANT CREATE PROCEDURE TO &v_username.; \ No newline at end of file diff --git a/user_scripts/odbfcl/diff_calculate/diff_calculate_all.sql b/user_scripts/odbfcl/diff_calculate/diff_calculate_all.sql new file mode 100644 index 0000000..82a52ac --- /dev/null +++ b/user_scripts/odbfcl/diff_calculate/diff_calculate_all.sql @@ -0,0 +1,337 @@ +-- Run diff generation process for ALL every database. +WHENEVER SQLERROR EXIT SQL.SQLCODE + +DEF V_CONN = '&1' +DEF V_BRELEASE = '&2' + +DEF V_TABLE_NAME_CODES = 'DIFF_CODES_LOAD_&&V_BRELEASE.' +DEF V_TABLE_NAME_CONTENTS = 'DIFF_CONTENTS_LOAD_&&V_BRELEASE.' + +SET TERMOUT OFF ECHO OFF + +set define '^' +SPO get_code.sql +PRO set pages 0 +PRO set long 1000000 +PRO set lines 10000 +PRO set trims on +PRO set feed off +PRO set echo off +PRO set verify off +PRO set define '&' +PRO col code for a10000 +PRO set termout off +PRO spool &1..sql +PRO select code from dm_codes where md5_hash='&1';; +PRO spool off +SPO OFF +set define '&' + +set define '^' +SPO get_contents.sql +PRO set pages 0 +PRO set long 1000000 +PRO set lines 10000 +PRO set trims on +PRO set feed off +PRO set echo off +PRO set verify off +PRO set define '&' +PRO col code for a10000 +PRO set termout off +PRO spool &1..sql +PRO select contents from dm_contents where md5_hash='&1';; +PRO spool off +SPO OFF +set define '&' + +SPO gen_diff.sh +PRO set -eo pipefail +PRO v_type="$1" +PRO v_file_1="$2" +PRO v_file_2="$3" +PRO +PRO v_size=$(diff -t -bB "${v_file_1}.sql" "${v_file_2}.sql" | awk '{ print length }' | sort -n | tail -1) +PRO +PRO # -2 to remove '> ' or '< ' +PRO # +3 to include ' | ' +PRO if [ -z ${v_size} ] +PRO then +PRO touch "${v_file_1}_${v_file_2}.txt" +PRO exit 0 +PRO fi +PRO v_size=$(((v_size-2)*2+3)) +PRO +PRO sdiff -w ${v_size} -bB -t -l "${v_file_1}.sql" "${v_file_2}.sql" | cat -n | grep -v -e '($' > "${v_file_1}_${v_file_2}.${v_type}.txt" +SPO OFF + +SPO load_codes.sh +PRO set -eo pipefail +PRO +PRO v_outpref="./list" +PRO v_file="${v_outpref}.csv" +PRO +PRO if ! ls *_*.codes.txt >/dev/null 2>/dev/null +PRO then +PRO echo "Codes: no file to process." +PRO exit 0 +PRO fi +PRO +PRO ls -1 *_*.codes.txt > "${v_file}" +PRO +PRO cat << EOF > "${v_outpref}_load.ctl" +PRO LOAD +PRO INTO TABLE &&V_TABLE_NAME_CODES. +PRO APPEND +PRO FIELDS TERMINATED BY ',' +PRO (file_name, +PRO contents lobfile(file_name) terminated by eof) +PRO EOF +PRO +PRO sqlldr &V_CONN \ +PRO control="${v_outpref}_load.ctl" \ +PRO errors=0 \ +PRO discardmax=0 \ +PRO direct=Y \ +PRO data="${v_file}" \ +PRO log="${v_outpref}_load.log" +PRO +PRO rm -f "${v_outpref}_load.log" "${v_outpref}_load.ctl" "${v_file}" +SPO OFF + +SPO load_contents.sh +PRO set -eo pipefail +PRO +PRO v_outpref="./list" +PRO v_file="${v_outpref}.csv" +PRO +PRO if ! ls *_*.contents.txt >/dev/null 2>/dev/null +PRO then +PRO echo "Contents: no file to process." +PRO exit 0 +PRO fi +PRO +PRO ls -1 *_*.contents.txt > "${v_file}" +PRO +PRO cat << EOF > "${v_outpref}_load.ctl" +PRO LOAD +PRO INTO TABLE &&V_TABLE_NAME_CONTENTS. +PRO APPEND +PRO FIELDS TERMINATED BY ',' +PRO (file_name, +PRO contents lobfile(file_name) terminated by eof) +PRO EOF +PRO +PRO sqlldr &V_CONN \ +PRO control="${v_outpref}_load.ctl" \ +PRO errors=0 \ +PRO discardmax=0 \ +PRO direct=Y \ +PRO data="${v_file}" \ +PRO log="${v_outpref}_load.log" +PRO +PRO rm -f "${v_outpref}_load.log" "${v_outpref}_load.ctl" "${v_file}" +SPO OFF + +-------------------------- +-------- PREPARE --------- +-------------------------- + +! rm -f *_*.txt + +------------------------------------- +------- LOAD CODES & CONTENTS ------- +------------------------------------- + +set serverout on lines 10000 trims on verify off feed off +SPOOL aaa.sql + +DECLARE + CURSOR V_VERS IS + with versions as (select /*+ materialize */ * from mv_versions) + select d.oraversion ORAVERSION_D, + d.oraseries ORASERIES_D, + d.orapatch ORAPATCH_D, + d.loaded_on loaded_on, + v2.oraversion ORAVERSION_FROM, + v2.oraseries ORASERIES_FROM, + v2.orapatch ORAPATCH_FROM, + v1.oraversion ORAVERSION_TO, + v1.oraseries ORASERIES_TO, + v1.orapatch ORAPATCH_TO + from versions v1, versions v2, d_patch_ready d -- driver table + where v1.display_name_prev=v2.display_name + and d.diff_generated is null + and ((v1.oraversion=d.oraversion and v1.oraseries=d.oraseries and v1.orapatch=d.orapatch) + or (v2.oraversion=d.oraversion and v2.oraseries=d.oraseries and v2.orapatch=d.orapatch)); + CURSOR V_DIFF_CODES (P_ORAVERSION_TO IN varchar2, P_ORASERIES_TO IN varchar2, P_ORAPATCH_TO IN NUMBER) IS + SELECT NVL(D1.MD5_HASH_UNWRAPPED,D1.MD5_HASH) OLD_VALUE, + NVL(D2.MD5_HASH_UNWRAPPED,D2.MD5_HASH) NEW_VALUE + FROM R_HASH.F(P_ORAVERSION_TO,P_ORASERIES_TO,P_ORAPATCH_TO) D0, DM_CODES D1, DM_CODES D2 + WHERE D0.COMPARE_COLUMN_NAME='MD5_HASH' + AND D1.MD5_HASH = D0.OLD_VALUE + AND D2.MD5_HASH = D0.NEW_VALUE + MINUS + SELECT MD5_HASH_FROM, MD5_HASH_TO + FROM DIFF_CODES; + CURSOR V_DIFF_CONTENTS (P_ORAVERSION_TO IN varchar2, P_ORASERIES_TO IN varchar2, P_ORAPATCH_TO IN NUMBER) IS + SELECT HEXTORAW(D0.OLD_VALUE) OLD_VALUE, + HEXTORAW(D0.NEW_VALUE) NEW_VALUE + FROM R_TXTCOLLECTION.F(P_ORAVERSION_TO, P_ORASERIES_TO, P_ORAPATCH_TO) D0 + WHERE D0.COMPARE_COLUMN_NAME='MD5_HASH' + MINUS + SELECT MD5_HASH_FROM, MD5_HASH_TO + FROM DIFF_CONTENTS; + V_FOUND BOOLEAN; +BEGIN + FOR V IN V_VERS + LOOP + V_FOUND := FALSE; + -- CODES + ROLLBACK; + R_HASH.L(V.ORAVERSION_FROM, V.ORASERIES_FROM, V.ORAPATCH_FROM, V.ORAVERSION_TO, V.ORASERIES_TO, V.ORAPATCH_TO); + FOR I IN V_DIFF_CODES (V.ORAVERSION_TO, V.ORASERIES_TO, V.ORAPATCH_TO) + LOOP + DBMS_OUTPUT.PUT_LINE('! echo Processing ' || I.OLD_VALUE || '_' || I.NEW_VALUE); + DBMS_OUTPUT.PUT_LINE('@get_code.sql ' || I.OLD_VALUE); + DBMS_OUTPUT.PUT_LINE('@get_code.sql ' || I.NEW_VALUE); + DBMS_OUTPUT.PUT_LINE('! sh gen_diff.sh codes ' || I.OLD_VALUE || ' ' || I.NEW_VALUE); + DBMS_OUTPUT.PUT_LINE('! rm -f ' || I.OLD_VALUE || '.sql ' || I.NEW_VALUE || '.sql'); + V_FOUND := TRUE; + END LOOP; + -- CONTENTS + ROLLBACK; + R_TXTCOLLECTION.L(V.ORAVERSION_FROM, V.ORASERIES_FROM, V.ORAPATCH_FROM, V.ORAVERSION_TO, V.ORASERIES_TO, V.ORAPATCH_TO); + FOR I IN V_DIFF_CONTENTS (V.ORAVERSION_TO, V.ORASERIES_TO, V.ORAPATCH_TO) + LOOP + DBMS_OUTPUT.PUT_LINE('! echo Processing ' || I.OLD_VALUE || '_' || I.NEW_VALUE); + DBMS_OUTPUT.PUT_LINE('@get_contents.sql ' || I.OLD_VALUE); + DBMS_OUTPUT.PUT_LINE('@get_contents.sql ' || I.NEW_VALUE); + DBMS_OUTPUT.PUT_LINE('! sh gen_diff.sh contents ' || I.OLD_VALUE || ' ' || I.NEW_VALUE); + DBMS_OUTPUT.PUT_LINE('! rm -f ' || I.OLD_VALUE || '.sql ' || I.NEW_VALUE || '.sql'); + V_FOUND := TRUE; + END LOOP; + ROLLBACK; + -- When there is nothing to generate, update the DIFF_GENERATED column so next execution will not query it again. + IF NOT V_FOUND + THEN + UPDATE D_PATCH_READY + SET DIFF_GENERATED=SYSTIMESTAMP + WHERE DIFF_GENERATED IS NULL + AND ORAVERSION=V.ORAVERSION_D + AND ORASERIES=V.ORASERIES_D + AND ORAPATCH=V.ORAPATCH_D + AND LOADED_ON=V.LOADED_ON; + COMMIT; + END IF; + END LOOP; +END; +/ +SPOOL OFF + +@aaa.sql + +-------------------------- +------- LOAD CODES ------- +-------------------------- + +BEGIN + EXECUTE IMMEDIATE 'DROP TABLE &&V_TABLE_NAME_CODES. PURGE'; +EXCEPTION + WHEN OTHERS THEN + IF SQLCODE != -942 THEN + RAISE; + END IF; +END; +/ + +CREATE TABLE &&V_TABLE_NAME_CODES. +( + FILE_NAME VARCHAR2(100) NOT NULL, + CONTENTS CLOB NOT NULL +) +COMPRESS NOLOGGING; + +! sh load_codes.sh + +SET TERMOUT ON ECHO ON + +INSERT /*+ APPEND */ + INTO DIFF_CODES (MD5_HASH_FROM, MD5_HASH_TO, DIFF_CODE) +SELECT T1.HASH_FROM, + T1.HASH_TO, + T1.CONTENTS +FROM ( SELECT SUBSTR(FILE_NAME,1,INSTR(FILE_NAME,'_',1,1)-1) HASH_FROM, + SUBSTR(FILE_NAME,INSTR(FILE_NAME,'_',1,1)+1,INSTR(FILE_NAME,'.',1,1)-INSTR(FILE_NAME,'_',1,1)-1) HASH_TO, + CONTENTS + FROM &&V_TABLE_NAME_CODES. ) T1 +-- We need this as some other sessions in parallel can end up inserting the same row. +WHERE NOT EXISTS (SELECT 1 + FROM DIFF_CODES D + WHERE D.MD5_HASH_FROM = T1.HASH_FROM AND D.MD5_HASH_TO = T1.HASH_TO); + +COMMIT; + +DROP TABLE &&V_TABLE_NAME_CODES. PURGE; + +SET TERMOUT OFF ECHO OFF + +! rm -f *_*.codes.txt +! rm -f load_codes.sh +! rm -f get_code.sql + +----------------------------- +------- LOAD CONTENTS ------- +----------------------------- + +BEGIN + EXECUTE IMMEDIATE 'DROP TABLE &&V_TABLE_NAME_CONTENTS. PURGE'; +EXCEPTION + WHEN OTHERS THEN + IF SQLCODE != -942 THEN + RAISE; + END IF; +END; +/ + +CREATE TABLE &&V_TABLE_NAME_CONTENTS. +( + FILE_NAME VARCHAR2(100) NOT NULL, + CONTENTS CLOB NOT NULL +) +COMPRESS NOLOGGING; + +! sh load_contents.sh + +SET TERMOUT ON ECHO ON + +INSERT /*+ APPEND */ + INTO DIFF_CONTENTS (MD5_HASH_FROM, MD5_HASH_TO, DIFF_CODE) +SELECT T1.HASH_FROM, + T1.HASH_TO, + T1.CONTENTS +FROM ( SELECT SUBSTR(FILE_NAME,1,INSTR(FILE_NAME,'_',1,1)-1) HASH_FROM, + SUBSTR(FILE_NAME,INSTR(FILE_NAME,'_',1,1)+1,INSTR(FILE_NAME,'.',1,1)-INSTR(FILE_NAME,'_',1,1)-1) HASH_TO, + CONTENTS + FROM &&V_TABLE_NAME_CONTENTS. ) T1 +-- We need this as some other sessions in parallel can end up inserting the same row. +WHERE NOT EXISTS (SELECT 1 + FROM DIFF_CONTENTS D + WHERE D.MD5_HASH_FROM = T1.HASH_FROM AND D.MD5_HASH_TO = T1.HASH_TO); + +COMMIT; + +DROP TABLE &&V_TABLE_NAME_CONTENTS. PURGE; + +SET TERMOUT OFF ECHO OFF + +! rm -f *_*.contents.txt +! rm -f load_contents.sh +! rm -f get_contents.sql + +---------------------- +------- FINISH ------- +---------------------- + +! rm -f gen_diff.sh +! rm -f aaa.sql \ No newline at end of file diff --git a/user_scripts/odbfcl/diff_calculate/diff_main_all.sql b/user_scripts/odbfcl/diff_calculate/diff_main_all.sql new file mode 100644 index 0000000..6a5bcfb --- /dev/null +++ b/user_scripts/odbfcl/diff_calculate/diff_main_all.sql @@ -0,0 +1,39 @@ +-- Run diff generation process for ALL every database. +WHENEVER SQLERROR CONTINUE + +CREATE TABLE "DIFF_CODES" +( + "MD5_HASH_FROM" RAW(16) NOT NULL, + "MD5_HASH_TO" RAW(16) NOT NULL, + "DIFF_CODE" CLOB NOT NULL, + CONSTRAINT DIFF_CODES_PK PRIMARY KEY ("MD5_HASH_FROM", "MD5_HASH_TO"), + CONSTRAINT DIFF_CODES_F1 FOREIGN KEY ("MD5_HASH_FROM") REFERENCES DM_CODES ("MD5_HASH") ON DELETE CASCADE, + CONSTRAINT DIFF_CODES_F2 FOREIGN KEY ("MD5_HASH_TO") REFERENCES DM_CODES ("MD5_HASH") ON DELETE CASCADE +) +COMPRESS NOLOGGING; + +CREATE INDEX "DIFF_CODES_F1" ON "DIFF_CODES" ("MD5_HASH_FROM"); +CREATE INDEX "DIFF_CODES_F2" ON "DIFF_CODES" ("MD5_HASH_TO"); + +CREATE TABLE "DIFF_CONTENTS" +( + "MD5_HASH_FROM" RAW(16) NOT NULL, + "MD5_HASH_TO" RAW(16) NOT NULL, + "DIFF_CODE" CLOB NOT NULL, + CONSTRAINT DIFF_CONTENTS_PK PRIMARY KEY ("MD5_HASH_FROM", "MD5_HASH_TO"), + CONSTRAINT DIFF_CONTENTS_F1 FOREIGN KEY ("MD5_HASH_FROM") REFERENCES DM_CONTENTS ("MD5_HASH") ON DELETE CASCADE, + CONSTRAINT DIFF_CONTENTS_F2 FOREIGN KEY ("MD5_HASH_TO") REFERENCES DM_CONTENTS ("MD5_HASH") ON DELETE CASCADE +) +COMPRESS NOLOGGING; + +CREATE INDEX "DIFF_CONTENTS_F1" ON "DIFF_CONTENTS" ("MD5_HASH_FROM"); +CREATE INDEX "DIFF_CONTENTS_F2" ON "DIFF_CONTENTS" ("MD5_HASH_TO"); + +WHENEVER SQLERROR EXIT SQL.SQLCODE + +DEF P_CRED = '&1' +DEF P_FOLDER = '&2' + +@&P_FOLDER./diff_calculate_all.sql '&P_CRED.' 'all' + +exit \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/load_code.sql b/user_scripts/odbfcl/extract/load_code.sql index 3c457bc..fcb1a0e 100644 --- a/user_scripts/odbfcl/extract/load_code.sql +++ b/user_scripts/odbfcl/extract/load_code.sql @@ -37,10 +37,10 @@ drop table &v_username..T_HASH_LOAD purge; -- REMOVE_IF_ZIP_AFTER --- BEGIN - Added to avoid "Java not installed" errors. -WHENEVER SQLERROR CONTINUE - -@@unwrap_code.sql +-- This is no longer enabled after wrapper moved to PL/SQL --- END - Added to avoid "Java not installed" errors. -WHENEVER SQLERROR EXIT SQL.SQLCODE \ No newline at end of file +-- BEGIN - Added to avoid "Java not installed" errors. +-- WHENEVER SQLERROR CONTINUE +-- @@unwrap_code.sql +-- WHENEVER SQLERROR EXIT SQL.SQLCODE +-- END - Added to avoid "Java not installed" errors. \ No newline at end of file From 7f03c9dcbd25fd8efba4ed2e5f06067d0f2b331b Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 16 Jul 2024 18:26:42 -0300 Subject: [PATCH 175/229] Update list_exceptions.yml --- list_exceptions.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/list_exceptions.yml b/list_exceptions.yml index 73a8874..a9d5a85 100644 --- a/list_exceptions.yml +++ b/list_exceptions.yml @@ -27,6 +27,7 @@ list_retry_datapatch: - { version: "12.1.0.2" , type : "BP" , id : 230718 , retries : 3 } - { version: "12.1.0.2" , type : "BP" , id : 231017 , retries : 3 } - { version: "12.1.0.2" , type : "BP" , id : 240416 , retries : 3 } + - { version: "12.1.0.2" , type : "BP" , id : 240716 , retries : 3 } ###### - { version: "12.1.0.2" , type : "PSU" , id : 200714 , retries : 2 } - { version: "12.1.0.2" , type : "PSU" , id : 201020 , retries : 2 } @@ -43,6 +44,7 @@ list_retry_datapatch: - { version: "12.1.0.2" , type : "PSU" , id : 230718 , retries : 2 } - { version: "12.1.0.2" , type : "PSU" , id : 231017 , retries : 2 } - { version: "12.1.0.2" , type : "PSU" , id : 240416 , retries : 2 } + - { version: "12.1.0.2" , type : "PSU" , id : 240716 , retries : 2 } ###### - { version: "12.2.0.1" , type : "RU" , id : 190716 , retries : 1 } - { version: "12.2.0.1" , type : "RU" , id : 191015 , retries : 1 } From 60ccfee5b8ccd5d766f50608311ade92dc42581a Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 18 Jul 2024 20:03:33 -0300 Subject: [PATCH 176/229] Minor fixes --- list_patches.yml | 15 ++++++++------- list_versions.yml | 2 +- .../odbfcl/diff_calculate/diff_calculate_all.sql | 15 +++++++++------ 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/list_patches.yml b/list_patches.yml index 83dfa02..334acbd 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -892,7 +892,7 @@ list_19000: - { type : "MRP" , id : 240716 , patch_number : 36778719 , base_ru : '19.22' , dep_type : 'RU' , dep_id : 22 , apply_method : "napply" } - { type : "MRP" , id : 240521 , patch_number : 36576266 , base_ru : '19.23' , dep_type : 'RU' , dep_id : 23 , apply_method : "napply" } - { type : "MRP" , id : 240618 , patch_number : 36701173 , base_ru : '19.23' , dep_type : 'RU' , dep_id : 23 , apply_method : "napply" } - - { type : "MRP" , id : 240716 , patch_number : 36779399 , base_ru : '19.23' , dep_type : 'RU' , dep_id : 23 , apply_method : "napply" } + - { type : "MRP" , id : 240716 , patch_number : 36779386 , base_ru : '19.23' , dep_type : 'RU' , dep_id : 23 , apply_method : "napply" } # 19c OJVM - { type : "OJVM" , id : 190416 , patch_number : 29548437 } - { type : "OJVM" , id : 190716 , patch_number : 29774421 } @@ -957,12 +957,13 @@ list_21000: #################### list_23000: -# - { type : "BETA" , id : 1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta1.tar.gz" } -# - { type : "BETA" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta2.tar.gz" } -# - { type : "BETA" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta3.tar.gz" } -# - { type : "BETA" , id : 4 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta4.tar.gz" } +# - { type : "BETA" , id : 1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta1.tar.gz" } +# - { type : "BETA" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta2.tar.gz" } +# - { type : "BETA" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta3.tar.gz" } +# - { type : "BETA" , id : 4 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta4.tar.gz" } - { type : "RU" , id : 4.1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.RU_4_1.tar.gz" } + - { type : "RU" , id : 5 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.RUGI_5_0.tar.gz" } # - { type : "RU" , id : 5 , patch_number : 36741532 } - - { type : "FREE" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel2.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } - - { type : "FREE" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel3.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel2.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel3.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } - { type : "FREE" , id : 4 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel4.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } \ No newline at end of file diff --git a/list_versions.yml b/list_versions.yml index c4f17e2..194e475 100644 --- a/list_versions.yml +++ b/list_versions.yml @@ -25,7 +25,7 @@ list_versions: - { id : "18.0.0.0" , patch_list : "list_18000" , main_file : "patch_main.yml" , opatch_file : "p6880880_210000_Linux-x86-64.zip" } - { id : "19.0.0.0" , patch_list : "list_19000" , main_file : "patch_main.yml" , opatch_file : "p6880880_210000_Linux-x86-64.zip" } - { id : "21.0.0.0" , patch_list : "list_21000" , main_file : "patch_main.yml" , opatch_file : "p6880880_210000_Linux-x86-64.zip" } - - { id : "23.0.0.0" , patch_list : "list_23000" , main_file : "patch_main.yml" , opatch_file : "p6880880_210000_Linux-x86-64.zip" } + - { id : "23.0.0.0" , patch_list : "list_23000" , main_file : "patch_main.yml" , opatch_file : "p6880880_230000_Linux-x86-64.zip" } list_info_vbox: - { id : "11.2.0.4" , vmachine : "Oracle Linux 6.8" , base_snap : "11.2.0.4 Ready" , ip : "xxx" } diff --git a/user_scripts/odbfcl/diff_calculate/diff_calculate_all.sql b/user_scripts/odbfcl/diff_calculate/diff_calculate_all.sql index 82a52ac..059772b 100644 --- a/user_scripts/odbfcl/diff_calculate/diff_calculate_all.sql +++ b/user_scripts/odbfcl/diff_calculate/diff_calculate_all.sql @@ -46,7 +46,7 @@ SPO OFF set define '&' SPO gen_diff.sh -PRO set -eo pipefail +PRO set -e PRO v_type="$1" PRO v_file_1="$2" PRO v_file_2="$3" @@ -57,7 +57,7 @@ PRO # -2 to remove '> ' or '< ' PRO # +3 to include ' | ' PRO if [ -z ${v_size} ] PRO then -PRO touch "${v_file_1}_${v_file_2}.txt" +PRO touch "${v_file_1}_${v_file_2}.${v_type}.txt" PRO exit 0 PRO fi PRO v_size=$(((v_size-2)*2+3)) @@ -66,7 +66,7 @@ PRO sdiff -w ${v_size} -bB -t -l "${v_file_1}.sql" "${v_file_2}.sql" | cat -n | SPO OFF SPO load_codes.sh -PRO set -eo pipefail +PRO set -e PRO PRO v_outpref="./list" PRO v_file="${v_outpref}.csv" @@ -100,7 +100,7 @@ PRO rm -f "${v_outpref}_load.log" "${v_outpref}_load.ctl" "${v_file}" SPO OFF SPO load_contents.sh -PRO set -eo pipefail +PRO set -e PRO PRO v_outpref="./list" PRO v_file="${v_outpref}.csv" @@ -183,6 +183,7 @@ DECLARE SELECT MD5_HASH_FROM, MD5_HASH_TO FROM DIFF_CONTENTS; V_FOUND BOOLEAN; + V_COUNT NUMBER := 0; BEGIN FOR V IN V_VERS LOOP @@ -192,7 +193,8 @@ BEGIN R_HASH.L(V.ORAVERSION_FROM, V.ORASERIES_FROM, V.ORAPATCH_FROM, V.ORAVERSION_TO, V.ORASERIES_TO, V.ORAPATCH_TO); FOR I IN V_DIFF_CODES (V.ORAVERSION_TO, V.ORASERIES_TO, V.ORAPATCH_TO) LOOP - DBMS_OUTPUT.PUT_LINE('! echo Processing ' || I.OLD_VALUE || '_' || I.NEW_VALUE); + V_COUNT := V_COUNT + 1; + DBMS_OUTPUT.PUT_LINE('! echo Processing ' || V_COUNT || ': ' || I.OLD_VALUE || '_' || I.NEW_VALUE); DBMS_OUTPUT.PUT_LINE('@get_code.sql ' || I.OLD_VALUE); DBMS_OUTPUT.PUT_LINE('@get_code.sql ' || I.NEW_VALUE); DBMS_OUTPUT.PUT_LINE('! sh gen_diff.sh codes ' || I.OLD_VALUE || ' ' || I.NEW_VALUE); @@ -204,7 +206,8 @@ BEGIN R_TXTCOLLECTION.L(V.ORAVERSION_FROM, V.ORASERIES_FROM, V.ORAPATCH_FROM, V.ORAVERSION_TO, V.ORASERIES_TO, V.ORAPATCH_TO); FOR I IN V_DIFF_CONTENTS (V.ORAVERSION_TO, V.ORASERIES_TO, V.ORAPATCH_TO) LOOP - DBMS_OUTPUT.PUT_LINE('! echo Processing ' || I.OLD_VALUE || '_' || I.NEW_VALUE); + V_COUNT := V_COUNT + 1; + DBMS_OUTPUT.PUT_LINE('! echo Processing ' || V_COUNT || ': ' || I.OLD_VALUE || '_' || I.NEW_VALUE); DBMS_OUTPUT.PUT_LINE('@get_contents.sql ' || I.OLD_VALUE); DBMS_OUTPUT.PUT_LINE('@get_contents.sql ' || I.NEW_VALUE); DBMS_OUTPUT.PUT_LINE('! sh gen_diff.sh contents ' || I.OLD_VALUE || ' ' || I.NEW_VALUE); From 21a7651ad6bbd4eb4deca54ef2e2176d7a6b27ed Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 19 Jul 2024 08:12:27 -0300 Subject: [PATCH 177/229] Update diff_calculate_all.sql --- .../diff_calculate/diff_calculate_all.sql | 63 ++++++++++++++----- 1 file changed, 47 insertions(+), 16 deletions(-) diff --git a/user_scripts/odbfcl/diff_calculate/diff_calculate_all.sql b/user_scripts/odbfcl/diff_calculate/diff_calculate_all.sql index 059772b..55958f8 100644 --- a/user_scripts/odbfcl/diff_calculate/diff_calculate_all.sql +++ b/user_scripts/odbfcl/diff_calculate/diff_calculate_all.sql @@ -65,6 +65,44 @@ PRO PRO sdiff -w ${v_size} -bB -t -l "${v_file_1}.sql" "${v_file_2}.sql" | cat -n | grep -v -e '($' > "${v_file_1}_${v_file_2}.${v_type}.txt" SPO OFF +SPO gen_sql.sh +PRO set -e +PRO v_file="$1" +PRO v_output="$2" +PRO +PRO cat "${v_file}" | sort -u > "${v_file}.new" +PRO mv "${v_file}.new" "${v_file}" +PRO +PRO rm -f "${v_output}" +PRO touch "${v_output}" +PRO +PRO v_counter=1 +PRO v_total=$(cat "${v_file}" | wc -l) +PRO v_entries=$(cat "${v_file}") +PRO +PRO OIFS="$IFS"; IFS=$'\n' +PRO for v_line in $v_entries +PRO do +PRO IFS="$OIFS" +PRO v_hash_1=$(cut -d: -f 1 <<< "${v_line}") +PRO v_hash_2=$(cut -d: -f 2 <<< "${v_line}") +PRO v_type=$(cut -d: -f 3 <<< "${v_line}") +PRO echo "! echo Processing ${v_counter}/${v_total}: ${v_hash_1}_${v_hash_2}" >> "${v_output}" +PRO if [ "${v_type}" = "codes" ] +PRO then +PRO echo "@get_code.sql ${v_hash_1}" >> "${v_output}" +PRO echo "@get_code.sql ${v_hash_2}" >> "${v_output}" +PRO elif [ "${v_type}" = "contents" ] +PRO then +PRO echo "@get_contents.sql ${v_hash_1}" >> "${v_output}" +PRO echo "@get_contents.sql ${v_hash_2}" >> "${v_output}" +PRO fi +PRO echo "! sh gen_diff.sh ${v_type} ${v_hash_1} ${v_hash_2}" >> "${v_output}" +PRO echo "! rm -f ${v_hash_1}.sql ${v_hash_2}.sql" >> "${v_output}" +PRO ((v_counter++)) +PRO done +SPO OFF + SPO load_codes.sh PRO set -e PRO @@ -144,7 +182,7 @@ SPO OFF ------------------------------------- set serverout on lines 10000 trims on verify off feed off -SPOOL aaa.sql +SPOOL hash.txt DECLARE CURSOR V_VERS IS @@ -183,7 +221,6 @@ DECLARE SELECT MD5_HASH_FROM, MD5_HASH_TO FROM DIFF_CONTENTS; V_FOUND BOOLEAN; - V_COUNT NUMBER := 0; BEGIN FOR V IN V_VERS LOOP @@ -193,12 +230,7 @@ BEGIN R_HASH.L(V.ORAVERSION_FROM, V.ORASERIES_FROM, V.ORAPATCH_FROM, V.ORAVERSION_TO, V.ORASERIES_TO, V.ORAPATCH_TO); FOR I IN V_DIFF_CODES (V.ORAVERSION_TO, V.ORASERIES_TO, V.ORAPATCH_TO) LOOP - V_COUNT := V_COUNT + 1; - DBMS_OUTPUT.PUT_LINE('! echo Processing ' || V_COUNT || ': ' || I.OLD_VALUE || '_' || I.NEW_VALUE); - DBMS_OUTPUT.PUT_LINE('@get_code.sql ' || I.OLD_VALUE); - DBMS_OUTPUT.PUT_LINE('@get_code.sql ' || I.NEW_VALUE); - DBMS_OUTPUT.PUT_LINE('! sh gen_diff.sh codes ' || I.OLD_VALUE || ' ' || I.NEW_VALUE); - DBMS_OUTPUT.PUT_LINE('! rm -f ' || I.OLD_VALUE || '.sql ' || I.NEW_VALUE || '.sql'); + DBMS_OUTPUT.PUT_LINE(I.OLD_VALUE || ':' || I.NEW_VALUE || ':codes'); V_FOUND := TRUE; END LOOP; -- CONTENTS @@ -206,12 +238,7 @@ BEGIN R_TXTCOLLECTION.L(V.ORAVERSION_FROM, V.ORASERIES_FROM, V.ORAPATCH_FROM, V.ORAVERSION_TO, V.ORASERIES_TO, V.ORAPATCH_TO); FOR I IN V_DIFF_CONTENTS (V.ORAVERSION_TO, V.ORASERIES_TO, V.ORAPATCH_TO) LOOP - V_COUNT := V_COUNT + 1; - DBMS_OUTPUT.PUT_LINE('! echo Processing ' || V_COUNT || ': ' || I.OLD_VALUE || '_' || I.NEW_VALUE); - DBMS_OUTPUT.PUT_LINE('@get_contents.sql ' || I.OLD_VALUE); - DBMS_OUTPUT.PUT_LINE('@get_contents.sql ' || I.NEW_VALUE); - DBMS_OUTPUT.PUT_LINE('! sh gen_diff.sh contents ' || I.OLD_VALUE || ' ' || I.NEW_VALUE); - DBMS_OUTPUT.PUT_LINE('! rm -f ' || I.OLD_VALUE || '.sql ' || I.NEW_VALUE || '.sql'); + DBMS_OUTPUT.PUT_LINE(I.OLD_VALUE || ':' || I.NEW_VALUE || ':contents'); V_FOUND := TRUE; END LOOP; ROLLBACK; @@ -232,7 +259,9 @@ END; / SPOOL OFF -@aaa.sql +! sh gen_sql.sh hash.txt run.sql + +@run.sql -------------------------- ------- LOAD CODES ------- @@ -337,4 +366,6 @@ SET TERMOUT OFF ECHO OFF ---------------------- ! rm -f gen_diff.sh -! rm -f aaa.sql \ No newline at end of file +! rm -f gen_sql.sh +! rm -f run.sql +! rm -f hash.txt \ No newline at end of file From 0733bddc74e07e4d23cfdba10483979a5b151987 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 23 Jul 2024 12:10:34 -0300 Subject: [PATCH 178/229] Update list_patches.yml --- list_patches.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/list_patches.yml b/list_patches.yml index 334acbd..aa10602 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -961,9 +961,11 @@ list_23000: # - { type : "BETA" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta2.tar.gz" } # - { type : "BETA" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta3.tar.gz" } # - { type : "BETA" , id : 4 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta4.tar.gz" } + - { type : "RU" , id : 4 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.RU_4_0.tar.gz" } - { type : "RU" , id : 4.1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.RU_4_1.tar.gz" } - { type : "RU" , id : 5 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.RUGI_5_0.tar.gz" } -# - { type : "RU" , id : 5 , patch_number : 36741532 } +# - { type : "RU" , id : 5 , patch_number : 36741532 , dep_type : 'RU' , dep_id : 4 } + - { type : "BASE" , id : 5 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.BASE_5_0.tar.gz" } - { type : "FREE" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel2.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } - { type : "FREE" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel3.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } - { type : "FREE" , id : 4 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel4.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } \ No newline at end of file From 7378d738c9f623634b43180bb062d6ffb7fc4211 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 5 Aug 2024 15:43:39 -0300 Subject: [PATCH 179/229] Implement download_tar option --- list_patches.yml | 7 ++++--- tasks/patch_tasks_pre.yml | 10 ++++++--- tasks/tar_download.yml | 43 +++++++++++++++++++++++++++++++++++++++ tasks/tar_restore.yml | 2 +- 4 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 tasks/tar_download.yml diff --git a/list_patches.yml b/list_patches.yml index aa10602..5a199e9 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -966,6 +966,7 @@ list_23000: - { type : "RU" , id : 5 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.RUGI_5_0.tar.gz" } # - { type : "RU" , id : 5 , patch_number : 36741532 , dep_type : 'RU' , dep_id : 4 } - { type : "BASE" , id : 5 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.BASE_5_0.tar.gz" } - - { type : "FREE" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel2.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } - - { type : "FREE" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel3.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } - - { type : "FREE" , id : 4 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.FreeRel4.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } \ No newline at end of file + - { type : "FREE" , id : 2 , patch_number : 00000000 , apply_method : "download_tar" , apply_file : "u01.FreeRel2.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 3 , patch_number : 00000000 , apply_method : "download_tar" , apply_file : "u01.FreeRel3.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 4 , patch_number : 00000000 , apply_method : "download_tar" , apply_file : "u01.FreeRel4.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 5 , patch_number : 00000000 , apply_method : "download_tar" , apply_file : "u01.FreeRel5.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } \ No newline at end of file diff --git a/tasks/patch_tasks_pre.yml b/tasks/patch_tasks_pre.yml index 4ec73d2..12d4958 100644 --- a/tasks/patch_tasks_pre.yml +++ b/tasks/patch_tasks_pre.yml @@ -166,7 +166,7 @@ set_fact: perform_patch_actions: false restore_from_tar: true - when: patch.apply_method is defined and patch.apply_method == "tar" and not restore_from_lvm + when: patch.apply_method is defined and ( patch.apply_method == "tar" or patch.apply_method == "download_tar" ) and not restore_from_lvm # This part was together with the block before the lvm_check. # It was put here together as we don't need to unzip the patch if using the VM. @@ -231,8 +231,12 @@ when: oci_mode and found_lvm_entry # It is not possible to have both restore_from_lvm and restore_from_tar as true - - include: tar_restore.yml - when: restore_from_tar + - include: tar_download.yml + when: restore_from_tar and patch.apply_method == "download_tar" + + # It is not possible to have both restore_from_lvm and restore_from_tar as true + - include: tar_restore.yml tar_file="{{ patch.apply_file }}" + when: restore_from_tar and patch.apply_method == "tar" # When patch has a pre-req, call the prepare_dependency script to setup. - include: prepare_dependency.yml diff --git a/tasks/tar_download.yml b/tasks/tar_download.yml new file mode 100644 index 0000000..dd39352 --- /dev/null +++ b/tasks/tar_download.yml @@ -0,0 +1,43 @@ +# If bucket +- block: + + - name: List files in OCI Bucket + include_role: + name: oci_object_storage_object_facts + vars: + object_action: "list" + oci_list_bucket: "{{ patch_location_bucket }}" + + - name: Download TAR file from OCI Bucket + shell: | + export LC_ALL=C.UTF-8 + export LANG=C.UTF-8 + oci os object get --bucket-name {{ patch_location_bucket }} --name {{ oci_download_file }} --file {{ shared_folder }}/{{ oci_download_file | basename }} + vars: + my_query: "{{ patch.apply_file }}" + oci_download_file: "{{ oci_action.objects | map(attribute='name') | select('search', my_query) | list | first }}" + when: oci_action.objects | map(attribute='name') | select('search', my_query) | list | length > 0 + + when: patch_location_type == "bucket" + +- name: Finding TAR File + find: + paths: "{{ shared_folder }}" + patterns: "{{ patch.apply_file }}" + recurse: "no" + file_type: "file" + register: find_result + +# If TAR was not found +- name: Could not find TAR file + fail: + msg: "Could not find TAR file." + when: find_result.files[0] is undefined + +# Restore tar file +- include: tar_restore.yml tar_file="{{ find_result.files[0].path }}" + +- name : "Remove TAR {{ find_result.files[0].path }} from shared folder" + file: + state: absent + path: "{{ find_result.files[0].path }}" \ No newline at end of file diff --git a/tasks/tar_restore.yml b/tasks/tar_restore.yml index 9aaaa4a..8857158 100644 --- a/tasks/tar_restore.yml +++ b/tasks/tar_restore.yml @@ -40,7 +40,7 @@ - name: UNTAR full Oracle shell: | rm -rf /u01/* - tar -xzf {{ patch.apply_file }} + tar -xzf {{ tar_file }} args: chdir: "/" register: tmp_shell_output From 92393278dd0ce9e3c2e08731774ed736994932d6 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 5 Aug 2024 17:56:56 -0300 Subject: [PATCH 180/229] Update list_patches.yml --- list_patches.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/list_patches.yml b/list_patches.yml index 5a199e9..d224f33 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -957,10 +957,10 @@ list_21000: #################### list_23000: -# - { type : "BETA" , id : 1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta1.tar.gz" } -# - { type : "BETA" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta2.tar.gz" } -# - { type : "BETA" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta3.tar.gz" } -# - { type : "BETA" , id : 4 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta4.tar.gz" } +# - { type : "BETA" , id : 1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta1.tar.gz" } +# - { type : "BETA" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta2.tar.gz" } +# - { type : "BETA" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta3.tar.gz" } +# - { type : "BETA" , id : 4 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta4.tar.gz" } - { type : "RU" , id : 4 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.RU_4_0.tar.gz" } - { type : "RU" , id : 4.1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.RU_4_1.tar.gz" } - { type : "RU" , id : 5 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.RUGI_5_0.tar.gz" } From 1f63fa896f434a97464b766b852445407ac396ec Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 18 Sep 2024 17:52:04 -0300 Subject: [PATCH 181/229] Minor changes --- tasks/setup_database.yml | 2 +- tasks/tar_restore.yml | 1 + user_scripts/odbfcl/extract/load_dba_cdb.sql | 2 ++ user_scripts/odbfcl/tables_create.sql | 29 +++++++++++++++++++- 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/tasks/setup_database.yml b/tasks/setup_database.yml index 0b5db1d..e9b62f3 100644 --- a/tasks/setup_database.yml +++ b/tasks/setup_database.yml @@ -9,7 +9,7 @@ - name : Override DB Home set_fact: - dbhome_locl: "{{ dbhomeoutput.stdout }}" + dbhome_locl: "{{ patch.oracle_home }}" when: patch.oracle_home is defined - name : Print DB Home diff --git a/tasks/tar_restore.yml b/tasks/tar_restore.yml index 8857158..2398180 100644 --- a/tasks/tar_restore.yml +++ b/tasks/tar_restore.yml @@ -2,6 +2,7 @@ - include: run_sql.yml vars: sql_param : { file : "shutdown.sql" , folder : "patch_sql" , task_action : "Stop Database for UNTAR" } + ignore_errors: yes # added as the previous database may be running with a diff home setting (example, it was /opt/oracle/product/23c/dbhomeFree and now is /opt/oracle/product/23ai/dbhomeFree) and may fail. # when: not oci_mode or patch.dep_type is defined # When patch has a dependency, if the dependency is loaded running the full patch process instead of loading from lvm, the DB will be left online. diff --git a/user_scripts/odbfcl/extract/load_dba_cdb.sql b/user_scripts/odbfcl/extract/load_dba_cdb.sql index 2cdfc2b..3389bd4 100644 --- a/user_scripts/odbfcl/extract/load_dba_cdb.sql +++ b/user_scripts/odbfcl/extract/load_dba_cdb.sql @@ -145,6 +145,8 @@ BEGIN RUN_INSERT ('ROLES'); + RUN_INSERT ('PROFILES'); + RUN_INSERT ('OBJECTS', q'[OWNER != '&&V_USERNAME.' AND NOT (OWNER='SYS' AND OBJECT_NAME='&&V_DIRECTORY.' AND OBJECT_TYPE='DIRECTORY')]', q'[OWNER != '&&V_USERNAME.' AND NOT (OWNER='SYS' AND OBJECT_NAME='&&V_DIRECTORY.' AND OBJECT_TYPE='DIRECTORY')]' diff --git a/user_scripts/odbfcl/tables_create.sql b/user_scripts/odbfcl/tables_create.sql index b894c15..7fde621 100644 --- a/user_scripts/odbfcl/tables_create.sql +++ b/user_scripts/odbfcl/tables_create.sql @@ -160,10 +160,13 @@ CREATE TABLE "T_TAB_COLUMNS" "DATA_SCALE" NUMBER, "NULLABLE" VARCHAR2(1 CHAR), "COLUMN_ID" NUMBER, +"DATA_DEFAULT_VC" VARCHAR2(4000 CHAR), "DEFAULT_LENGTH" NUMBER, "CHARACTER_SET_NAME" VARCHAR2(44 CHAR), "CHAR_COL_DECL_LENGTH" NUMBER, "DEFAULT_ON_NULL" VARCHAR2(3 CHAR), +"DEFAULT_ON_NULL_UPD" VARCHAR2(3 CHAR), +"RESERVABLE_COLUMN" VARCHAR2(3 CHAR), "IDENTITY_COLUMN" VARCHAR2(3 CHAR), "SENSITIVE_COLUMN" VARCHAR2(3 CHAR), "COLLATION" VARCHAR2(100 CHAR), @@ -209,6 +212,11 @@ CREATE TABLE "T_USERS" "DEFAULT_COLLATION" VARCHAR2(100 CHAR), "IMPLICIT" VARCHAR2(3 CHAR), "ALL_SHARD" VARCHAR2(3 CHAR), +"EXTERNAL_SHARD" VARCHAR2(3 CHAR), +"MANDATORY_PROFILE_VIOLATION" VARCHAR2(3 CHAR), +"PROTECTED" VARCHAR2(3 CHAR), +"READ_ONLY" VARCHAR2(3 CHAR), +"DICTIONARY_PROTECTED" VARCHAR2(3 CHAR), "CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -302,6 +310,10 @@ CREATE TABLE "T_AUDIT_UNIFIED_POLICIES" "OBJECT_TYPE" VARCHAR2(23 CHAR) NOT NULL, "COMMON" VARCHAR2(3 CHAR), "INHERITED" VARCHAR2(3 CHAR), +"AUDIT_ONLY_TOPLEVEL" VARCHAR2(3 CHAR), +"ORACLE_SUPPLIED" VARCHAR2(3 CHAR), +"PROTECTED" VARCHAR2(3 CHAR), +"COLUMN_NAME" VARCHAR2(128 CHAR), "CON_ID" NUMBER ) COMPRESS NOLOGGING; @@ -443,7 +455,7 @@ CREATE TABLE "T_OBJ_AUDIT_OPTS" "REN" VARCHAR2(3 CHAR), "SEL" VARCHAR2(3 CHAR), "UPD" VARCHAR2(3 CHAR), -"REF" CHAR(3 CHAR), +"REF" CHAR(3 CHAR), -- This column was removed starting on 19c "EXE" VARCHAR2(3 CHAR), "CRE" VARCHAR2(3 CHAR), "REA" VARCHAR2(3 CHAR), @@ -769,6 +781,21 @@ CREATE TABLE "T_SQL_HINT" ) COMPRESS NOLOGGING; +CREATE TABLE "T_PROFILES" +( +"PROFILE" VARCHAR2(128) NOT NULL, +"RESOURCE_NAME" VARCHAR2(32) NOT NULL, +"RESOURCE_TYPE" VARCHAR2(8), +"LIMIT" VARCHAR2(257), +"COMMON" VARCHAR2(3), +"INHERITED" VARCHAR2(3), +"IMPLICIT" VARCHAR2(3), +"ORACLE_MAINTAINED" VARCHAR2(3), +"MANDATORY" VARCHAR2(3), +"CON_ID" NUMBER +) +COMPRESS NOLOGGING; + ----------------------------------------------------- ----------------------------------------------------- ----------------------------------------------------- From 2532c31cf785c6cfa7b4f591c9bb36180d5a2bf4 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 19 Sep 2024 12:34:45 -0300 Subject: [PATCH 182/229] Update fileGet.sh --- user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh index 82d1442..dfb6b52 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh @@ -39,7 +39,8 @@ echo "Generating ORACLE_HOME non-binary files list. Please wait.." cd "$ORACLE_HOME" set +e # grep may return "Permission denied" -find -type f -not -path "./.patch_storage/*" -not -name "tfa_setup" -print0 2>> "${v_err_file_full}" | xargs -0 grep -Il '.' 2>> "${v_err_file_full}" | tar -czf "${v_out_file_full}" -T - +find -type f -not -path "./.patch_storage/*" -not -name "tfa_setup" -print0 2>> "${v_err_file_full}" | xargs -0 -n 100 grep -Il '.' 2>> "${v_err_file_full}" | tar -czf "${v_out_file_full}" -T - +# "-n 100" added to xargs due to bug in grep where it is skipping files when the input list is huge. Tested with DB 18.12. [ -f "${v_err_file_full}" ] && echo "Total errors detected: $(wc -l < "${v_err_file_full}")" From 18346891b7cb713e093ee83d5a6bcf6b8366c4b0 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 17 Oct 2024 14:57:46 -0300 Subject: [PATCH 183/229] Oct 2024 patches and fixes --- list_patches.yml | 36 +++++++++++-- tasks/patch_main.yml | 51 +++++++++++++++++++ tasks/patch_tasks_post.yml | 6 +++ tasks/patch_tasks_pre.yml | 10 +++- .../adb_load_txtcollection_files/fileGet.sh | 2 +- 5 files changed, 97 insertions(+), 8 deletions(-) diff --git a/list_patches.yml b/list_patches.yml index d224f33..d980e57 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -307,6 +307,7 @@ list_11204: - { type : "PSU" , id : 160419 , patch_number : 22502456 } - { type : "PSU" , id : 160719 , patch_number : 23054359 } - { type : "PSU" , id : 161018 , patch_number : 24006111 } +# - { type : "PSU" , id : 170117 , patch_number : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED - { type : "PSU" , id : 170418 , patch_number : 24732075 } - { type : "PSU" , id : 170718 , patch_number : 25869727 } - { type : "PSU" , id : 170814 , patch_number : 26609445 } @@ -335,8 +336,10 @@ list_11204: - { type : "PSU" , id : 230418 , patch_number : 34998337 } - { type : "PSU" , id : 230718 , patch_number : 35269283 } - { type : "PSU" , id : 231017 , patch_number : 35574075 } +# - { type : "PSU" , id : 240116 , patch_number : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED - { type : "PSU" , id : 240416 , patch_number : 36222299 } - { type : "PSU" , id : 240716 , patch_number : 36575425 } +# - { type : "PSU" , id : 241015 , patch_number : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED # 11.2.0.4 OJVM - { type : "OJVM" , id : 1 , patch_number : 19282021 } - { type : "OJVM" , id : 2 , patch_number : 19877440 } @@ -378,6 +381,7 @@ list_11204: - { type : "OJVM" , id : 240116 , patch_number : 35926733 } - { type : "OJVM" , id : 240416 , patch_number : 36222352 } - { type : "OJVM" , id : 240716 , patch_number : 36533106 } + - { type : "OJVM" , id : 241015 , patch_number : 36878781 } # 11.2.0.4 BP - { type : "BP" , id : 1 , patch_number : 17628025 , patch_folder : 17628006 } - { type : "BP" , id : 2 , patch_number : 17838803 , patch_folder : 17741631 } @@ -404,6 +408,7 @@ list_11204: - { type : "BP" , id : 160419 , patch_number : 22899777 , patch_folder : 22738760 } - { type : "BP" , id : 160719 , patch_number : 23274515 , patch_folder : 23061511 } - { type : "BP" , id : 161018 , patch_number : 24479801 , patch_folder : 24340671 } +# - { type : "BP" , id : 170117 , patch_number : xxxxxxxx , patch_folder : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED - { type : "BP" , id : 170418 , patch_number : 25440411 , patch_folder : 24828123 } - { type : "BP" , id : 170718 , patch_number : 26031163 , patch_folder : 25869844 } - { type : "BP" , id : 170814 , patch_number : 26610265 , patch_folder : 26609769 } @@ -432,8 +437,11 @@ list_11204: - { type : "BP" , id : 230418 , patch_number : 35058326 , patch_folder : 34998345 } - { type : "BP" , id : 230718 , patch_number : 35369924 , patch_folder : 35269278 } - { type : "BP" , id : 231017 , patch_number : 35685705 , patch_folder : 35574089 } +# - { type : "BP" , id : 240116 , patch_number : xxxxxxxx , patch_folder : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED - { type : "BP" , id : 240416 , patch_number : 36234434 , patch_folder : 36222308 } - { type : "BP" , id : 240716 , patch_number : 36663546 , patch_folder : 36521957 } +# - { type : "BP" , id : 241015 , patch_number : xxxxxxxx , patch_folder : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED + #################### ##### 12.1.0.1 ##### @@ -515,6 +523,7 @@ list_12102: - { type : "PSU" , id : 231017 , patch_number : 35564645 } - { type : "PSU" , id : 240416 , patch_number : 36222283 } - { type : "PSU" , id : 240716 , patch_number : 36519012 } + - { type : "PSU" , id : 241015 , patch_number : 36834621 } # 12.1.0.2 OJVM - { type : "OJVM" , id : 1 , patch_number : 19282028 } - { type : "OJVM" , id : 2 , patch_number : 19877336 } @@ -556,6 +565,7 @@ list_12102: - { type : "OJVM" , id : 240116 , patch_number : 35926723 } - { type : "OJVM" , id : 240416 , patch_number : 36222331 } - { type : "OJVM" , id : 240716 , patch_number : 36533098 } + - { type : "OJVM" , id : 241015 , patch_number : 36878764 } # 12.1.0.2 BP - { type : "BP" , id : 1 , patch_number : 19404326 , patch_folder : 19189240 } - { type : "BP" , id : 2 , patch_number : 19774304 , patch_folder : 19649591 } @@ -605,6 +615,7 @@ list_12102: - { type : "BP" , id : 231017 , patch_number : 35685744 , patch_folder : 35564676 } - { type : "BP" , id : 240416 , patch_number : 36360782 , patch_folder : 36222291 } - { type : "BP" , id : 240716 , patch_number : 36663406 , patch_folder : 36519004 } + - { type : "BP" , id : 241015 , patch_number : 36961411 , patch_folder : 36834630 } #################### ##### 12.2.0.1 ##### @@ -644,6 +655,7 @@ list_12201: - { type : "RU" , id : 240116 , patch_number : 35966787 } # PASSWORD PROTECTED - { type : "RU" , id : 240416 , patch_number : 36325581 } # PASSWORD PROTECTED - { type : "RU" , id : 240716 , patch_number : 36650048 } # PASSWORD PROTECTED + - { type : "RU" , id : 241015 , patch_number : 36941400 } # TIER 1 # 12.2.0.1 RUR - { type : "RUR" , id : 171017 , patch_number : 26518812 , base_ru : JUL2017 } - { type : "RUR" , id : 180116 , patch_number : 27013506 , base_ru : JUL2017 } @@ -696,10 +708,11 @@ list_12201: - { type : "OJVM" , id : 230117 , patch_number : 34763276 } # PASSWORD PROTECTED - { type : "OJVM" , id : 230418 , patch_number : 35058256 } # PASSWORD PROTECTED - { type : "OJVM" , id : 230718 , patch_number : 35348984 } # PASSWORD PROTECTED - - { type : "OJVM" , id : 231017 , patch_number : 35685669 } # PASSWORD PROTECTED - - { type : "OJVM" , id : 240116 , patch_number : 35926712 } # PASSWORD PROTECTED - - { type : "OJVM" , id : 240416 , patch_number : 36222324 } # PASSWORD PROTECTED - - { type : "OJVM" , id : 240716 , patch_number : 36533083 } # PASSWORD PROTECTED + - { type : "OJVM" , id : 231017 , patch_number : 35685669 } + - { type : "OJVM" , id : 240116 , patch_number : 35926712 } + - { type : "OJVM" , id : 240416 , patch_number : 36222324 } # START TIER 1 + - { type : "OJVM" , id : 240716 , patch_number : 36533083 } + - { type : "OJVM" , id : 241015 , patch_number : 36878737 } #################### ##### 18.0.0.0 ##### @@ -737,6 +750,7 @@ list_18000: - { type : "RU" , id : 25 , patch_number : 35962880 } # NOT AVAILABLE TO DOWNLOAD - { type : "RU" , id : 26 , patch_number : 36339040 } # NOT AVAILABLE TO DOWNLOAD - { type : "RU" , id : 27 , patch_number : 36682577 } # NOT AVAILABLE TO DOWNLOAD + - { type : "RU" , id : 28 , patch_number : 36941408 } # NOT AVAILABLE TO DOWNLOAD # 18c RUR # - { type : "RUR" , id : 1 , patch_number : 28346593 , base_ru : '18.2' } # - { type : "RUR" , id : 2 , patch_number : 28601267 , base_ru : '18.2' } @@ -788,7 +802,7 @@ list_18000: - { type : "OJVM" , id : 240116 , patch_number : 35926632 } # NOT AVAILABLE TO DOWNLOAD # 18.25 - { type : "OJVM" , id : 240416 , patch_number : 36222358 } # NOT AVAILABLE TO DOWNLOAD # 18.26 - { type : "OJVM" , id : 240716 , patch_number : 36533062 } # NOT AVAILABLE TO DOWNLOAD # 18.27 - + - { type : "OJVM" , id : 241015 , patch_number : 36878718 } # NOT AVAILABLE TO DOWNLOAD # 18.28 # No more updates on this one. @@ -823,6 +837,7 @@ list_19000: - { type : "RU" , id : 22 , patch_number : 35943157 } - { type : "RU" , id : 23 , patch_number : 36233263 } - { type : "RU" , id : 24 , patch_number : 36582781 } + - { type : "RU" , id : 25 , patch_number : 36912597 } # 19c RUR - { type : "RUR" , id : 1 , patch_number : 29799057 , base_ru : '19.3' } - { type : "RUR" , id : 2 , patch_number : 30087906 , base_ru : '19.3' } @@ -893,6 +908,12 @@ list_19000: - { type : "MRP" , id : 240521 , patch_number : 36576266 , base_ru : '19.23' , dep_type : 'RU' , dep_id : 23 , apply_method : "napply" } - { type : "MRP" , id : 240618 , patch_number : 36701173 , base_ru : '19.23' , dep_type : 'RU' , dep_id : 23 , apply_method : "napply" } - { type : "MRP" , id : 240716 , patch_number : 36779386 , base_ru : '19.23' , dep_type : 'RU' , dep_id : 23 , apply_method : "napply" } + - { type : "MRP" , id : 240820 , patch_number : 36907797 , base_ru : '19.23' , dep_type : 'RU' , dep_id : 23 , apply_method : "napply" } + - { type : "MRP" , id : 240917 , patch_number : 37000127 , base_ru : '19.23' , dep_type : 'RU' , dep_id : 23 , apply_method : "napply" } + - { type : "MRP" , id : 241015 , patch_number : 37106548 , base_ru : '19.23' , dep_type : 'RU' , dep_id : 23 , apply_method : "napply" } + - { type : "MRP" , id : 240820 , patch_number : 36907847 , base_ru : '19.24' , dep_type : 'RU' , dep_id : 24 , apply_method : "napply" } + - { type : "MRP" , id : 240917 , patch_number : 37000101 , base_ru : '19.24' , dep_type : 'RU' , dep_id : 24 , apply_method : "napply" } + - { type : "MRP" , id : 241015 , patch_number : 37106585 , base_ru : '19.24' , dep_type : 'RU' , dep_id : 24 , apply_method : "napply" } # 19c OJVM - { type : "OJVM" , id : 190416 , patch_number : 29548437 } - { type : "OJVM" , id : 190716 , patch_number : 29774421 } @@ -916,6 +937,7 @@ list_19000: - { type : "OJVM" , id : 240116 , patch_number : 35926646 } - { type : "OJVM" , id : 240416 , patch_number : 36199232 } - { type : "OJVM" , id : 240716 , patch_number : 36414915 } + - { type : "OJVM" , id : 241015 , patch_number : 36878697 } # 19c DPBP - { type : "DPBP" , id : 10 , patch_number : 32583144 , dep_type : 'RU' , dep_id : 10 } - { type : "DPBP" , id : 11 , patch_number : 32958059 , dep_type : 'RU' , dep_id : 11 } @@ -932,6 +954,7 @@ list_19000: - { type : "DPBP" , id : 22 , patch_number : 36092868 , dep_type : 'RU' , dep_id : 22 } - { type : "DPBP" , id : 23 , patch_number : 36420641 , dep_type : 'RU' , dep_id : 23 } - { type : "DPBP" , id : 24 , patch_number : 36682332 , dep_type : 'RU' , dep_id : 24 } + - { type : "DPBP" , id : 25 , patch_number : 37056207 , dep_type : 'RU' , dep_id : 25 } #################### ##### 21.0.0.0 ##### @@ -951,6 +974,7 @@ list_21000: - { type : "RU" , id : 13 , patch_number : 36041222 } - { type : "RU" , id : 14 , patch_number : 36352352 } - { type : "RU" , id : 15 , patch_number : 36696242 } + - { type : "RU" , id : 16 , patch_number : 36991631 } #################### ##### 23.0.0.0 ##### @@ -964,6 +988,8 @@ list_23000: - { type : "RU" , id : 4 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.RU_4_0.tar.gz" } - { type : "RU" , id : 4.1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.RU_4_1.tar.gz" } - { type : "RU" , id : 5 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.RUGI_5_0.tar.gz" } +# - { type : "RU" , id : 6 , patch_number : 37037086 } + - { type : "RU" , id : 6 , patch_number : 37037908 , apply_method : "gold_image" } # - { type : "RU" , id : 5 , patch_number : 36741532 , dep_type : 'RU' , dep_id : 4 } - { type : "BASE" , id : 5 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.BASE_5_0.tar.gz" } - { type : "FREE" , id : 2 , patch_number : 00000000 , apply_method : "download_tar" , apply_file : "u01.FreeRel2.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } diff --git a/tasks/patch_main.yml b/tasks/patch_main.yml index 9f07594..011edf8 100644 --- a/tasks/patch_main.yml +++ b/tasks/patch_main.yml @@ -81,6 +81,57 @@ - set_fact: shell_output="{{tmp_shell_output}}" when: tmp_shell_output is not skipped + ## RUGI ## + + - name: Deploy new ORACLE_HOME + shell: | + set -eo pipefail + # Save database files + rm -f /tmp/${ORACLE_SID}.tar.gz + cd $ORACLE_HOME/dbs + tar -cvzf /tmp/${ORACLE_SID}.tar.gz {hc_${ORACLE_SID}.dat,spfile${ORACLE_SID}.ora,orapw${ORACLE_SID}} + # Remove old home + rm -rf $ORACLE_HOME + # Create new home + mkdir $ORACLE_HOME + cd /u01/install + unzip -q -d $ORACLE_HOME {{ shared_folder }}/{{ db_patch | basename }} + # Recover saved files + cd $ORACLE_HOME/dbs + tar -xvf /tmp/${ORACLE_SID}.tar.gz + rm -f /tmp/${ORACLE_SID}.tar.gz + # Remove old home from inventory + sed -i '/dbhome_1/d' /u01/app/oraInstall/ContentsXML/inventory.xml + # Install new home + set +e + $ORACLE_HOME/runInstaller -silent -responseFile /u01/install/db_install.rsp + v_ret=$? + # ret = 6 is "Successfully Setup Software with warning(s)." + [ ${v_ret} -ne 0 -a ${v_ret} -ne 6 ] && exit 1 + environment: + ORACLE_HOME: "{{ dbhome_locl }}" + ORACLE_SID: "{{ mysid }}" + register: tmp_shell_output + become: true + become_user: oracle + when: patch.apply_method is defined and patch.apply_method == "gold_image" + delegate_to: "{{ vm_ip_address }}" + + - name: Call root.sh + shell: | + set -eo pipefail + $ORACLE_HOME/root.sh + environment: + ORACLE_HOME: "{{ dbhome_locl }}" + become: true + become_user: root + when: patch.apply_method is defined and patch.apply_method == "gold_image" + delegate_to: "{{ vm_ip_address }}" + + # Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" + - set_fact: shell_output="{{tmp_shell_output}}" + when: tmp_shell_output is not skipped + - name: Opatch Output debug: msg="{{ shell_output.stdout_lines }}" when: shell_output.stdout_lines is defined diff --git a/tasks/patch_tasks_post.yml b/tasks/patch_tasks_post.yml index 3413ca9..59d0f2a 100644 --- a/tasks/patch_tasks_post.yml +++ b/tasks/patch_tasks_post.yml @@ -34,6 +34,12 @@ path: "{{ unzip_patch_folder }}" when: perform_patch_actions +- name : Remove zipped patch + file: + state: absent + path: "{{ shared_folder }}/{{ db_patch | basename }}" + when: perform_patch_actions and patch.apply_method is defined and patch.apply_method == "gold_image" + # Here I don't check for perform_patch_actions as in some cases (like for LVM image usage) the patch will still be downloaded. - name: Remove file downloaded from OCI Bucket file: diff --git a/tasks/patch_tasks_pre.yml b/tasks/patch_tasks_pre.yml index 12d4958..5b9e78d 100644 --- a/tasks/patch_tasks_pre.yml +++ b/tasks/patch_tasks_pre.yml @@ -181,7 +181,13 @@ unarchive: src: "{{ db_patch }}" dest: "{{ shared_folder }}" - when: patch.patch_folder is undefined + when: patch.patch_folder is undefined and (patch.apply_method is undefined or patch.apply_method != "gold_image") + + - name : Copy zip Patch to VM shared folder + copy: + src: "{{ db_patch }}" + dest: "{{ shared_folder }}" + when: patch.apply_method is defined and patch.apply_method == "gold_image" # When patch_folder variable is defined (mostly for BPs), extract that folder from unziped patch to apply - block: @@ -200,7 +206,7 @@ - name : Rename patch subfolder shell: "mv {{ shared_folder }}/{{ patch.patch_folder }} {{ unzip_patch_folder }}" - when: patch.patch_folder is defined + when: patch.patch_folder is defined and (patch.apply_method is undefined or patch.apply_method != "gold_image") - name: Remove file downloaded from OCI Bucket file: diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh index dfb6b52..d8abe18 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh @@ -40,7 +40,7 @@ cd "$ORACLE_HOME" set +e # grep may return "Permission denied" find -type f -not -path "./.patch_storage/*" -not -name "tfa_setup" -print0 2>> "${v_err_file_full}" | xargs -0 -n 100 grep -Il '.' 2>> "${v_err_file_full}" | tar -czf "${v_out_file_full}" -T - -# "-n 100" added to xargs due to bug in grep where it is skipping files when the input list is huge. Tested with DB 18.12. +# "-n 100" added to xargs due to bug in grep where it is skipping files when the input list is huge. Tested with DB 18.12. https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73360 [ -f "${v_err_file_full}" ] && echo "Total errors detected: $(wc -l < "${v_err_file_full}")" From 62951d1e2956ae8a7a88b98cdb5ba4b858aba7a7 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 17 Oct 2024 16:48:46 -0300 Subject: [PATCH 184/229] Update patch_main.yml --- tasks/patch_main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tasks/patch_main.yml b/tasks/patch_main.yml index 011edf8..7d21534 100644 --- a/tasks/patch_main.yml +++ b/tasks/patch_main.yml @@ -107,7 +107,10 @@ $ORACLE_HOME/runInstaller -silent -responseFile /u01/install/db_install.rsp v_ret=$? # ret = 6 is "Successfully Setup Software with warning(s)." - [ ${v_ret} -ne 0 -a ${v_ret} -ne 6 ] && exit 1 + if [ ${v_ret} -ne 0 -a ${v_ret} -ne 6 ] + then + exit 1 + fi environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" From 354067c95b0cb5c8a477fbf70b8fbc7c79b2d828 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 17 Oct 2024 17:37:18 -0300 Subject: [PATCH 185/229] Update list_patches.yml --- list_patches.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/list_patches.yml b/list_patches.yml index d980e57..1f7976c 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -651,11 +651,11 @@ list_12201: - { type : "RU" , id : 230117 , patch_number : 34850184 } # PASSWORD PROTECTED - { type : "RU" , id : 230418 , patch_number : 35115783 } # PASSWORD PROTECTED - { type : "RU" , id : 230718 , patch_number : 35407080 } # PASSWORD PROTECTED - - { type : "RU" , id : 231017 , patch_number : 35746058 } # PASSWORD PROTECTED - - { type : "RU" , id : 240116 , patch_number : 35966787 } # PASSWORD PROTECTED - - { type : "RU" , id : 240416 , patch_number : 36325581 } # PASSWORD PROTECTED - - { type : "RU" , id : 240716 , patch_number : 36650048 } # PASSWORD PROTECTED - - { type : "RU" , id : 241015 , patch_number : 36941400 } # TIER 1 + - { type : "RU" , id : 231017 , patch_number : 35746058 } + - { type : "RU" , id : 240116 , patch_number : 35966787 } # START TIER 1 + - { type : "RU" , id : 240416 , patch_number : 36325581 } + - { type : "RU" , id : 240716 , patch_number : 36650048 } + - { type : "RU" , id : 241015 , patch_number : 36941400 } # 12.2.0.1 RUR - { type : "RUR" , id : 171017 , patch_number : 26518812 , base_ru : JUL2017 } - { type : "RUR" , id : 180116 , patch_number : 27013506 , base_ru : JUL2017 } @@ -702,12 +702,12 @@ list_12201: - { type : "OJVM" , id : 210720 , patch_number : 32876409 } - { type : "OJVM" , id : 211019 , patch_number : 33192662 } - { type : "OJVM" , id : 220118 , patch_number : 33561275 } # LAST PATCH - - { type : "OJVM" , id : 220419 , patch_number : 33829783 } # PASSWORD PROTECTED - - { type : "OJVM" , id : 220719 , patch_number : 34086867 } # PASSWORD PROTECTED - - { type : "OJVM" , id : 221018 , patch_number : 34412174 } # PASSWORD PROTECTED + - { type : "OJVM" , id : 220419 , patch_number : 33829783 } + - { type : "OJVM" , id : 220719 , patch_number : 34086867 } + - { type : "OJVM" , id : 221018 , patch_number : 34412174 } - { type : "OJVM" , id : 230117 , patch_number : 34763276 } # PASSWORD PROTECTED - { type : "OJVM" , id : 230418 , patch_number : 35058256 } # PASSWORD PROTECTED - - { type : "OJVM" , id : 230718 , patch_number : 35348984 } # PASSWORD PROTECTED + - { type : "OJVM" , id : 230718 , patch_number : 35348984 } - { type : "OJVM" , id : 231017 , patch_number : 35685669 } - { type : "OJVM" , id : 240116 , patch_number : 35926712 } - { type : "OJVM" , id : 240416 , patch_number : 36222324 } # START TIER 1 @@ -988,10 +988,10 @@ list_23000: - { type : "RU" , id : 4 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.RU_4_0.tar.gz" } - { type : "RU" , id : 4.1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.RU_4_1.tar.gz" } - { type : "RU" , id : 5 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.RUGI_5_0.tar.gz" } -# - { type : "RU" , id : 6 , patch_number : 37037086 } - - { type : "RU" , id : 6 , patch_number : 37037908 , apply_method : "gold_image" } # - { type : "RU" , id : 5 , patch_number : 36741532 , dep_type : 'RU' , dep_id : 4 } - { type : "BASE" , id : 5 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.BASE_5_0.tar.gz" } +# - { type : "RU" , id : 6 , patch_number : 37037086 } + - { type : "RU" , id : 6 , patch_number : 37037908 , apply_method : "gold_image" } - { type : "FREE" , id : 2 , patch_number : 00000000 , apply_method : "download_tar" , apply_file : "u01.FreeRel2.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } - { type : "FREE" , id : 3 , patch_number : 00000000 , apply_method : "download_tar" , apply_file : "u01.FreeRel3.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } - { type : "FREE" , id : 4 , patch_number : 00000000 , apply_method : "download_tar" , apply_file : "u01.FreeRel4.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } From 3b0bb62f9d8c0ba0e2d1385aeb0b7b948121b0dc Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 18 Oct 2024 12:29:59 -0300 Subject: [PATCH 186/229] Update list_exceptions.yml --- list_exceptions.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/list_exceptions.yml b/list_exceptions.yml index a9d5a85..ae4786e 100644 --- a/list_exceptions.yml +++ b/list_exceptions.yml @@ -28,6 +28,7 @@ list_retry_datapatch: - { version: "12.1.0.2" , type : "BP" , id : 231017 , retries : 3 } - { version: "12.1.0.2" , type : "BP" , id : 240416 , retries : 3 } - { version: "12.1.0.2" , type : "BP" , id : 240716 , retries : 3 } + - { version: "12.1.0.2" , type : "BP" , id : 241015 , retries : 3 } ###### - { version: "12.1.0.2" , type : "PSU" , id : 200714 , retries : 2 } - { version: "12.1.0.2" , type : "PSU" , id : 201020 , retries : 2 } @@ -45,6 +46,7 @@ list_retry_datapatch: - { version: "12.1.0.2" , type : "PSU" , id : 231017 , retries : 2 } - { version: "12.1.0.2" , type : "PSU" , id : 240416 , retries : 2 } - { version: "12.1.0.2" , type : "PSU" , id : 240716 , retries : 2 } + - { version: "12.1.0.2" , type : "PSU" , id : 241015 , retries : 2 } ###### - { version: "12.2.0.1" , type : "RU" , id : 190716 , retries : 1 } - { version: "12.2.0.1" , type : "RU" , id : 191015 , retries : 1 } From a02f73d7c92325264066546663b3d35aa54fc4a3 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 21 Oct 2024 21:12:44 -0300 Subject: [PATCH 187/229] Fix out_of_box_id --- tasks/main_PSU_BP.yml | 16 +++++++++++----- tasks/main_RU_RUR.yml | 8 +++++++- tasks/main_loader_adb.yml | 8 +++++++- tasks/main_loader_manual.yml | 8 +++++++- 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/tasks/main_PSU_BP.yml b/tasks/main_PSU_BP.yml index 383d855..a7716e3 100644 --- a/tasks/main_PSU_BP.yml +++ b/tasks/main_PSU_BP.yml @@ -21,10 +21,16 @@ set_fact: oci_instance_id: "{{ item.oci_instance_id }}" patch_base: "{{ item.base_snap }}" - out_of_box_id: "{{ item.out_of_box_id | default(-1, true) }}" + out_of_box_id: "{{ item.out_of_box_id | default(-1) }}" with_items: "{{ list_info_oci }}" when: item.id == db_version and oci_mode +# Before, with default(-1,true) above, it was also changing when out_of_box_id was 0 +- name : Fix out_of_box_id + set_fact: + out_of_box_id: -1 + when: out_of_box_id == '' + # This parameter will control if database start command was ever called. - name : Define database_started variable to false. set_fact: @@ -66,12 +72,12 @@ # Execute for base release - include: "{{ patch_file }}" vars: - patch : { type : BASE , id : 0, patch_number : 0 } + patch : { type : BASE , id : "{{ out_of_box_id }}" , patch_number : 0 } when: - (out_of_box_id | float) != -1 - - 0 == (param_patch | float) or param_patch == -1 - - 0 >= (param_patch_from | float) or param_patch_from == -1 - - 0 <= (param_patch_to | float) or param_patch_to == -1 + - (out_of_box_id | float) == (param_patch | float) or param_patch == -1 + - (out_of_box_id | float) >= (param_patch_from | float) or param_patch_from == -1 + - (out_of_box_id | float) <= (param_patch_to | float) or param_patch_to == -1 # Execute for every PSU - include: "{{ patch_file }}" diff --git a/tasks/main_RU_RUR.yml b/tasks/main_RU_RUR.yml index eefb3d8..d6c6198 100644 --- a/tasks/main_RU_RUR.yml +++ b/tasks/main_RU_RUR.yml @@ -21,10 +21,16 @@ set_fact: oci_instance_id: "{{ item.oci_instance_id }}" patch_base: "{{ item.base_snap }}" - out_of_box_id: "{{ item.out_of_box_id | default(-1, true) }}" + out_of_box_id: "{{ item.out_of_box_id | default(-1) }}" with_items: "{{ list_info_oci }}" when: item.id == db_version and oci_mode +# Before, with default(-1,true) above, it was also changing when out_of_box_id was 0 +- name : Fix out_of_box_id + set_fact: + out_of_box_id: -1 + when: out_of_box_id == '' + # This parameter will control if database start command was ever called. - name : Define database_started variable to false. set_fact: diff --git a/tasks/main_loader_adb.yml b/tasks/main_loader_adb.yml index 1b0b815..8eeec19 100644 --- a/tasks/main_loader_adb.yml +++ b/tasks/main_loader_adb.yml @@ -9,10 +9,16 @@ - name : Define Cloud params set_fact: - out_of_box_id: "{{ item.out_of_box_id | default(-1, true) }}" + out_of_box_id: "{{ item.out_of_box_id | default(-1) }}" with_items: "{{ list_info_oci }}" when: item.id == db_version +# Before, with default(-1,true) above, it was also changing when out_of_box_id was 0 +- name : Fix out_of_box_id + set_fact: + out_of_box_id: -1 + when: out_of_box_id == '' + #- fail: # msg: "Stop here." diff --git a/tasks/main_loader_manual.yml b/tasks/main_loader_manual.yml index 4adad30..ab77c86 100644 --- a/tasks/main_loader_manual.yml +++ b/tasks/main_loader_manual.yml @@ -163,10 +163,16 @@ - name : Define Cloud params set_fact: - out_of_box_id: "{{ item.out_of_box_id | default(-1, true) }}" + out_of_box_id: "{{ item.out_of_box_id | default(-1) }}" with_items: "{{ list_info_oci }}" when: item.id == db_version +# Before, with default(-1,true) above, it was also changing when out_of_box_id was 0 +- name : Fix out_of_box_id + set_fact: + out_of_box_id: -1 + when: out_of_box_id == '' + - include: "impdp_file_adb.yml patch={{ item }}" with_items: - { type : "{{ input_series }}" , id : "{{ input_patch }}" } From e10884e81ee2e62199d108cd1d004e3da8fb9c0c Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 21 Oct 2024 21:14:23 -0300 Subject: [PATCH 188/229] Update list_versions.yml --- list_versions.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/list_versions.yml b/list_versions.yml index 194e475..3c5e609 100644 --- a/list_versions.yml +++ b/list_versions.yml @@ -47,11 +47,11 @@ list_info_oci: - { id : "11.2.0.1" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } - { id : "11.2.0.2" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } - { id : "11.2.0.3" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } - - { id : "11.2.0.4" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" } - - { id : "12.1.0.1" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" } - - { id : "12.1.0.2" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" } - - { id : "12.2.0.1" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" } + - { id : "11.2.0.4" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : 0 } + - { id : "12.1.0.1" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : 0 } + - { id : "12.1.0.2" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : 0 } + - { id : "12.2.0.1" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : 0 } - { id : "18.0.0.0" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : 3 } - { id : "19.0.0.0" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : 3 } - { id : "21.0.0.0" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : 3 } - - { id : "23.0.0.0" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : null } + - { id : "23.0.0.0" , oci_instance_id : "ocid1.instance.oc1.phx.xxx" , base_snap : "base" , out_of_box_id : 5 } From 345f73ed2962df2f5871ff7fbfe8da61bbc54dd6 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 21 Oct 2024 21:50:11 -0300 Subject: [PATCH 189/229] Update main_RU_RUR.yml --- tasks/main_RU_RUR.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main_RU_RUR.yml b/tasks/main_RU_RUR.yml index d6c6198..bb1dbf0 100644 --- a/tasks/main_RU_RUR.yml +++ b/tasks/main_RU_RUR.yml @@ -92,7 +92,7 @@ - patch.id <= (param_patch_to | float) or param_patch_to == -1 - patch.id > (out_of_box_id | float) - when: param_type is undefined or param_type == "RU" + when: param_type is undefined or param_type == "RU" or param_type == "BASE" ### OJVM - block: From 69545aafb74a736ad7c790fd0a7c5792011c412e Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 25 Oct 2024 19:46:54 -0300 Subject: [PATCH 190/229] Minor fixes --- tasks/main_RU_RUR.yml | 1 - tasks/main_loader_adb.yml | 20 +------------------ .../odbfcl/diff_calculate/diff_main_all.sql | 3 ++- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/tasks/main_RU_RUR.yml b/tasks/main_RU_RUR.yml index bb1dbf0..c538148 100644 --- a/tasks/main_RU_RUR.yml +++ b/tasks/main_RU_RUR.yml @@ -90,7 +90,6 @@ - patch.id == (param_patch | float) or param_patch == -1 - patch.id >= (param_patch_from | float) or param_patch_from == -1 - patch.id <= (param_patch_to | float) or param_patch_to == -1 - - patch.id > (out_of_box_id | float) when: param_type is undefined or param_type == "RU" or param_type == "BASE" diff --git a/tasks/main_loader_adb.yml b/tasks/main_loader_adb.yml index 8eeec19..c5c0dc2 100644 --- a/tasks/main_loader_adb.yml +++ b/tasks/main_loader_adb.yml @@ -22,25 +22,8 @@ #- fail: # msg: "Stop here." -- name : Check if there is any PSU - set_fact: - total_psus: "{{ lookup('vars', patch_list) | json_query(filter_qry) | count }}" - vars: - filter_qry: "[?type=='PSU'].id" - ############################### -# Execute for base release if there is at least 1 PSU for that version -- include: "impdp_file_adb.yml" - vars: - patch : { type : BASE , id : 0, patch_number : 0 } - when: - - total_psus != "0" - - 0 == (param_patch | float) or param_patch == -1 - - 0 >= (param_patch_from | float) or param_patch_from == -1 - - 0 <= (param_patch_to | float) or param_patch_to == -1 - - param_type is undefined or param_type == "PSU" - # Execute for base release if there is at least 1 RU for that version - include: "impdp_file_adb.yml" vars: @@ -50,7 +33,7 @@ - (out_of_box_id | float) == (param_patch | float) or param_patch == -1 - (out_of_box_id | float) >= (param_patch_from | float) or param_patch_from == -1 - (out_of_box_id | float) <= (param_patch_to | float) or param_patch_to == -1 - - param_type is undefined or param_type == "RU" + - param_type is undefined or param_type == "BASE" ############################### @@ -64,6 +47,5 @@ - patch.id == (param_patch | float) or param_patch == -1 - patch.id >= (param_patch_from | float) or param_patch_from == -1 - patch.id <= (param_patch_to | float) or param_patch_to == -1 - - patch.id > (out_of_box_id | float) or patch.type != "RU" # When RU, skip patch.id lower or equal to out_of_box_id - (patch.version | default(db_version)) == db_version - param_type is undefined or param_type == patch.type \ No newline at end of file diff --git a/user_scripts/odbfcl/diff_calculate/diff_main_all.sql b/user_scripts/odbfcl/diff_calculate/diff_main_all.sql index 6a5bcfb..7c15029 100644 --- a/user_scripts/odbfcl/diff_calculate/diff_main_all.sql +++ b/user_scripts/odbfcl/diff_calculate/diff_main_all.sql @@ -36,4 +36,5 @@ DEF P_FOLDER = '&2' @&P_FOLDER./diff_calculate_all.sql '&P_CRED.' 'all' -exit \ No newline at end of file +-- Do not exit or it will stop next execution code. +-- exit \ No newline at end of file From b5467116c42a37f71c620db79f4171738fd7090f Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 11 Nov 2024 16:23:38 -0300 Subject: [PATCH 191/229] Change scripts license --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ea42fed..68566fe 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ loader_uploads.yml main.retry tasks/main_loader_uploads.yml user_scripts/odbfcl/sh_extractor/*.zip -user_scripts/odbfcl/sh_extractor/build_zip.sh \ No newline at end of file +user_scripts/odbfcl/sh_extractor/build_zip.sh +user_scripts/odbfcl/sh_extractor/oradiff_exporter/* From 13e5d8a7df8944f95990237ab79bfde0075a1381 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 11 Nov 2024 16:50:14 -0300 Subject: [PATCH 192/229] Removed Created by Rodrigo Jorge --- user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh | 1 - user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh | 1 - user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh | 1 - user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh | 1 - user_scripts/odbfcl/adb_load_symbols/symbolGet.sh | 1 - user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh | 1 - user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh | 1 - user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh | 1 - user_scripts/odbfcl/sh_extractor/dictionaryGet.sh | 1 - user_scripts/odbfcl/sh_extractor/dumpCreate.sh | 1 - user_scripts/odbfcl/sh_extractor/exporter.sh | 1 - user_scripts/odbfcl/sh_extractor/schemaCreate.sh | 1 - 12 files changed, 12 deletions(-) diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh index 13cab5b..d1a9a68 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh @@ -1,6 +1,5 @@ #!/bin/bash # Script to get all bugs fixed on OPatch -# Created by Rodrigo Jorge set -eo pipefail diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh index 8ea4da5..f5cad8b 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh @@ -1,6 +1,5 @@ #!/bin/bash # Script to load all bugs on database -# Created by Rodrigo Jorge set -eo pipefail diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh b/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh index 2c5fd74..4e3ba5d 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh +++ b/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh @@ -1,6 +1,5 @@ #!/bin/bash # Script to get the sha256sum of all ORACLE_HOME files and libraries -# Created by Rodrigo Jorge set -eo pipefail diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh index 0d0a43f..4c5a054 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh +++ b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh @@ -1,6 +1,5 @@ #!/bin/bash # Script to load all sha256sum on database -# Created by Rodrigo Jorge set -eo pipefail diff --git a/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh b/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh index a9b1db5..69382b9 100644 --- a/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh +++ b/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh @@ -1,6 +1,5 @@ #!/bin/bash # Script to list all symbols in ORACLE_HOME -# Created by Rodrigo Jorge # Thanks Frits Hooglang diff --git a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh index 9407aec..c41c075 100644 --- a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh +++ b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh @@ -1,6 +1,5 @@ #!/bin/bash # Script to load all symbols on database -# Created by Rodrigo Jorge set -eo pipefail diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh index d8abe18..8e1a696 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh @@ -1,6 +1,5 @@ #!/bin/bash # Script to get all non-binary files in ORACLE_HOME -# Created by Rodrigo Jorge # TODO: Fix: tar: ./rdbms/log/stout_orcl_17338.txt: Cannot stat: No such file or directory # SOLUTION: Stop DB before collection, or add flag to make tar ignore missing files diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh index 6f7d7df..bf51a04 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh @@ -1,6 +1,5 @@ #!/bin/bash # Script to load all non-binary files on database -# Created by Rodrigo Jorge set -eo pipefail diff --git a/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh b/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh index 5a8e376..3eb0659 100644 --- a/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh +++ b/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh @@ -1,6 +1,5 @@ #!/bin/bash # Script to collect dictionary tables -# Created by Rodrigo Jorge set -eo pipefail diff --git a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh index 54a6fe9..e4b86fe 100644 --- a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh @@ -1,6 +1,5 @@ #!/bin/bash # Script to collect dictionary tables -# Created by Rodrigo Jorge set -eo pipefail diff --git a/user_scripts/odbfcl/sh_extractor/exporter.sh b/user_scripts/odbfcl/sh_extractor/exporter.sh index 35d72f3..e6d6077 100644 --- a/user_scripts/odbfcl/sh_extractor/exporter.sh +++ b/user_scripts/odbfcl/sh_extractor/exporter.sh @@ -1,6 +1,5 @@ #!/bin/bash # Script to collect all info needed from the DB -# Created by Rodrigo Jorge # v1.1.0.0 set -eo pipefail diff --git a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh index 15502a7..1a2c27f 100644 --- a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh @@ -1,6 +1,5 @@ #!/bin/bash # Script to collect dictionary tables -# Created by Rodrigo Jorge set -eo pipefail From 5b31cd9f99e416c1fcd7562274ed21cc392ea049 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 11 Nov 2024 17:02:40 -0300 Subject: [PATCH 193/229] Move version to outside --- user_scripts/odbfcl/sh_extractor/VERSION | 1 + user_scripts/odbfcl/sh_extractor/exporter.sh | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 user_scripts/odbfcl/sh_extractor/VERSION diff --git a/user_scripts/odbfcl/sh_extractor/VERSION b/user_scripts/odbfcl/sh_extractor/VERSION new file mode 100644 index 0000000..a03e161 --- /dev/null +++ b/user_scripts/odbfcl/sh_extractor/VERSION @@ -0,0 +1 @@ +24.10.0 \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/exporter.sh b/user_scripts/odbfcl/sh_extractor/exporter.sh index e6d6077..9ec177d 100644 --- a/user_scripts/odbfcl/sh_extractor/exporter.sh +++ b/user_scripts/odbfcl/sh_extractor/exporter.sh @@ -1,6 +1,5 @@ #!/bin/bash # Script to collect all info needed from the DB -# v1.1.0.0 set -eo pipefail From 788cc088e19d70964546a96815bfcc3bf00a89e4 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 11 Nov 2024 17:57:32 -0300 Subject: [PATCH 194/229] Do not drop non-default users --- user_scripts/odbfcl/createUser.sql | 11 +++++++-- user_scripts/odbfcl/sh_extractor/exporter.sh | 23 +++++++++++++++++-- .../odbfcl/sh_extractor/schemaCreate.sh | 3 ++- user_scripts/odbfcl/tables_recreate.sql | 3 ++- 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/user_scripts/odbfcl/createUser.sql b/user_scripts/odbfcl/createUser.sql index d3e31ed..9263650 100644 --- a/user_scripts/odbfcl/createUser.sql +++ b/user_scripts/odbfcl/createUser.sql @@ -5,8 +5,15 @@ def v_username='&1.' def v_password='&2.' def v_data_tbs='&3.' def v_temp_tbs='&4.' - -DROP USER &v_username. CASCADE; +def v_def_user='&5.' + +BEGIN + IF '&v_def_user.' = 'true' + THEN + EXECUTE IMMEDIATE 'DROP USER &v_username. CASCADE'; + END IF; +END; +/ WHENEVER SQLERROR EXIT SQL.SQLCODE diff --git a/user_scripts/odbfcl/sh_extractor/exporter.sh b/user_scripts/odbfcl/sh_extractor/exporter.sh index 9ec177d..048b79d 100644 --- a/user_scripts/odbfcl/sh_extractor/exporter.sh +++ b/user_scripts/odbfcl/sh_extractor/exporter.sh @@ -86,6 +86,26 @@ else echo "Note: DB_EXP_CRED (provided)." fi +# Check if DB_EXP_USER was exported. +# If DB_EXP_USER defines the user inside the database to export the oradiff data. +v_def_dump_user_name='hash' +if [ -z "$DB_EXP_USER" ] +then + v_dump_user_name=${v_def_dump_user_name} + echo "Note: Variable 'DB_EXP_USER' was not exported. Assigning DB_EXP_USER='${v_dump_user_name}' (default)." +else + v_dump_user_name=$(echo "${v_dump_user_name}" | tr '[:upper:]' '[:lower:]') + echo "Note: DB_EXP_USER (provided)." +fi + +# Check if v_dump_user_name is the default or not. +if [ "$v_def_dump_user_name" = "$v_dump_user_name" ] +then + v_is_def_dump_user=true +else + v_is_def_dump_user=false +fi + # v_sysdba_connect needs to be exported export v_sysdba_connect @@ -99,7 +119,6 @@ v_zip=${v_pattern}.zip ######################## # Define dump username # ######################## -v_dump_user_name='hash' [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." @@ -142,7 +161,7 @@ sh "${v_thisdir}/symbolGet.sh" ${v_file} ! ${v_load_file} && zip -m ${v_zip} ${v_file} v_thisdir="${v_thisdir_bkp}" # REMOVE_IF_ZIP -sh "${v_thisdir}/schemaCreate.sh" ${v_dump_user_name} +sh "${v_thisdir}/schemaCreate.sh" ${v_dump_user_name} ${v_is_def_dump_user} if ${v_load_file} then diff --git a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh index 1a2c27f..aef3835 100644 --- a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh @@ -15,6 +15,7 @@ exitError () } v_dump_user_name="$1" +v_def_dump_user_name="$2" [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." @@ -38,7 +39,7 @@ echo "Creating export user. Please wait.." cd "${v_thisdir}"/../ # REMOVE_IF_ZIP $ORACLE_HOME/bin/sqlplus "${v_sysdba_connect}" < Date: Tue, 12 Nov 2024 14:51:53 -0300 Subject: [PATCH 195/229] Accept DB_EXP_CRED --- user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh | 3 ++- user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh | 3 ++- user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh | 3 ++- .../odbfcl/adb_load_txtcollection_files/fileLoad.sh | 3 ++- user_scripts/odbfcl/sh_extractor/dictionaryGet.sh | 3 ++- user_scripts/odbfcl/sh_extractor/dumpCreate.sh | 3 ++- user_scripts/odbfcl/sh_extractor/exporter.sh | 6 +++--- user_scripts/odbfcl/sh_extractor/schemaCreate.sh | 3 ++- 8 files changed, 17 insertions(+), 10 deletions(-) diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh index f5cad8b..3403c96 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh @@ -24,7 +24,8 @@ v_outpref="${v_file}" [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." -[ -z "${v_sysdba_connect}" ] && v_sysdba_connect='/ as sysdba' +# If DB_EXP_CRED is exported, use it as the credentials. +[ -n "$DB_EXP_CRED" ] && v_sysdba_connect="$DB_EXP_CRED" || v_sysdba_connect='/ as sysdba' echo "Loading bugs list. Please wait.." diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh index 4c5a054..1aa3fa8 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh +++ b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh @@ -24,7 +24,8 @@ v_outpref="${v_file}" [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." -[ -z "${v_sysdba_connect}" ] && v_sysdba_connect='/ as sysdba' +# If DB_EXP_CRED is exported, use it as the credentials. +[ -n "$DB_EXP_CRED" ] && v_sysdba_connect="$DB_EXP_CRED" || v_sysdba_connect='/ as sysdba' echo "Loading sha256sum list. Please wait.." diff --git a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh index c41c075..c46dfa9 100644 --- a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh +++ b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh @@ -24,7 +24,8 @@ v_outpref="${v_file}" [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." -[ -z "${v_sysdba_connect}" ] && v_sysdba_connect='/ as sysdba' +# If DB_EXP_CRED is exported, use it as the credentials. +[ -n "$DB_EXP_CRED" ] && v_sysdba_connect="$DB_EXP_CRED" || v_sysdba_connect='/ as sysdba' echo "Loading symbols list. Please wait.." diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh index bf51a04..ce92259 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh @@ -24,7 +24,8 @@ v_outpref="${v_file}" [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." -[ -z "${v_sysdba_connect}" ] && v_sysdba_connect='/ as sysdba' +# If DB_EXP_CRED is exported, use it as the credentials. +[ -n "$DB_EXP_CRED" ] && v_sysdba_connect="$DB_EXP_CRED" || v_sysdba_connect='/ as sysdba' echo "Loading ORACLE_HOME non-binary files. Please wait.." diff --git a/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh b/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh index 3eb0659..c1f8540 100644 --- a/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh +++ b/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh @@ -24,7 +24,8 @@ v_dump_dir_name='expdir_hash' v_thisdir="$(cd "$(dirname "$0")"; pwd)" cd "${v_thisdir}" -[ -z "${v_sysdba_connect}" ] && v_sysdba_connect='/ as sysdba' +# If DB_EXP_CRED is exported, use it as the credentials. +[ -n "$DB_EXP_CRED" ] && v_sysdba_connect="$DB_EXP_CRED" || v_sysdba_connect='/ as sysdba' echo "Generating table export. Please wait.." diff --git a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh index e4b86fe..63a6a61 100644 --- a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh @@ -41,7 +41,8 @@ cd "${v_thisdir}" v_output_file_cnt=`awk -F" " '{print NF-1}' <<< "${v_out_file_name_noext}"` [ ${v_output_file_cnt} -ne 0 ] && exitError "File \"${v_out_file_param}\" must not have any spaces." -[ -z "${v_sysdba_connect}" ] && v_sysdba_connect='/ as sysdba' +# If DB_EXP_CRED is exported, use it as the credentials. +[ -n "$DB_EXP_CRED" ] && v_sysdba_connect="$DB_EXP_CRED" || v_sysdba_connect='/ as sysdba' echo "Generating table export. Please wait.." diff --git a/user_scripts/odbfcl/sh_extractor/exporter.sh b/user_scripts/odbfcl/sh_extractor/exporter.sh index 048b79d..415397b 100644 --- a/user_scripts/odbfcl/sh_extractor/exporter.sh +++ b/user_scripts/odbfcl/sh_extractor/exporter.sh @@ -82,7 +82,7 @@ then v_sysdba_connect='/ as sysdba' echo "Note: Variable 'DB_EXP_CRED' was not exported. Assigning DB_EXP_CRED='${v_sysdba_connect}' (default)." else - v_sysdba_connect=$(echo "${DB_EXP_CRED}" | tr '[:upper:]' '[:lower:]') + v_sysdba_connect="${DB_EXP_CRED}" echo "Note: DB_EXP_CRED (provided)." fi @@ -106,8 +106,8 @@ else v_is_def_dump_user=false fi -# v_sysdba_connect needs to be exported -export v_sysdba_connect +# DB_EXP_CRED needs to be exported +export DB_EXP_CRED v_pattern_cnt=`awk -F" " '{print NF-1}' <<< "${v_pattern}"` [ ${v_pattern_cnt} -ne 0 ] && exitError "Pattern \"${v_output}\" must not have any spaces. Eg: ${v_example}" diff --git a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh index aef3835..f90105c 100644 --- a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh @@ -32,7 +32,8 @@ v_def_dump_user_name="$2" v_thisdir="$(cd "$(dirname "$0")"; pwd)" cd "${v_thisdir}" -[ -z "${v_sysdba_connect}" ] && v_sysdba_connect='/ as sysdba' +# If DB_EXP_CRED is exported, use it as the credentials. +[ -n "$DB_EXP_CRED" ] && v_sysdba_connect="$DB_EXP_CRED" || v_sysdba_connect='/ as sysdba' echo "Creating export user. Please wait.." From 61fba5ed0bd6874c21df12d16fce3dd2cee04e3a Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 12 Nov 2024 15:18:09 -0300 Subject: [PATCH 196/229] Fix checks and texts --- user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh | 4 +++- user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh | 4 +++- user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh | 4 +++- user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh | 4 +++- user_scripts/odbfcl/sh_extractor/dictionaryGet.sh | 2 ++ user_scripts/odbfcl/sh_extractor/dumpCreate.sh | 4 +++- user_scripts/odbfcl/sh_extractor/schemaCreate.sh | 2 ++ 7 files changed, 19 insertions(+), 5 deletions(-) diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh index 3403c96..4a1586f 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh @@ -18,7 +18,9 @@ v_dump_user_name="$1" v_file="$2" v_outpref="${v_file}" -[ -z "${v_file}" ] && exitError "First parameter is the source file and cannot be null." +[ -z "${v_dump_user_name}" ] && exitError "First parameter is the DB Schema and cannot be null." +[ -z "${v_file}" ] && exitError "Second parameter is the source file and cannot be null." + [ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh index 1aa3fa8..201c7f2 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh +++ b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh @@ -18,7 +18,9 @@ v_dump_user_name="$1" v_file="$2" v_outpref="${v_file}" -[ -z "${v_file}" ] && exitError "First parameter is the source file and cannot be null." +[ -z "${v_dump_user_name}" ] && exitError "First parameter is the DB Schema and cannot be null." +[ -z "${v_file}" ] && exitError "Second parameter is the source file and cannot be null." + [ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." diff --git a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh index c46dfa9..421964f 100644 --- a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh +++ b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh @@ -18,7 +18,9 @@ v_dump_user_name="$1" v_file="$2" v_outpref="${v_file}" -[ -z "${v_file}" ] && exitError "First parameter is the source file and cannot be null." +[ -z "${v_dump_user_name}" ] && exitError "First parameter is the DB Schema and cannot be null." +[ -z "${v_file}" ] && exitError "Second parameter is the source file and cannot be null." + [ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh index ce92259..15e898a 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh @@ -18,7 +18,9 @@ v_dump_user_name="$1" v_file="$2" v_outpref="${v_file}" -[ -z "${v_file}" ] && exitError "First parameter is the source file and cannot be null." +[ -z "${v_dump_user_name}" ] && exitError "First parameter is the DB Schema and cannot be null." +[ -z "${v_file}" ] && exitError "Second parameter is the source file and cannot be null." + [ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." diff --git a/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh b/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh index c1f8540..7eac23a 100644 --- a/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh +++ b/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh @@ -16,6 +16,8 @@ exitError () v_dump_user_name="$1" +[ -z "${v_dump_user_name}" ] && exitError "First parameter is the DB Schema and cannot be null." + [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." diff --git a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh index 63a6a61..5ae7c88 100644 --- a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh @@ -17,7 +17,9 @@ exitError () v_dump_user_name="$1" v_out_file_param="$2" -[ -z "${v_out_file_param}" ] && exitError "First parameter is the target file and cannot be null." +[ -z "${v_dump_user_name}" ] && exitError "First parameter is the DB Schema and cannot be null." +[ -z "${v_out_file_param}" ] && exitError "Second parameter is the target file and cannot be null." + [ -f "${v_out_file_param}" ] && exitError "File \"${v_out_file_param}\" already exists. Remove it before rerunning." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." diff --git a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh index f90105c..6fc8131 100644 --- a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh @@ -20,6 +20,8 @@ v_def_dump_user_name="$2" [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." +[ -z "${v_dump_user_name}" ] && exitError "First parameter is the DB Schema and cannot be null." + # If DB_EXP_USER_PASS is exported, use it as the password. [ -n "$DB_EXP_USER_PASS" ] && v_dump_user_pass="$DB_EXP_USER_PASS" || v_dump_user_pass='HhAaSsHh..135' From 34de690ff396fc6dd00cd26761ca84e1ce100c3a Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 12 Nov 2024 15:41:47 -0300 Subject: [PATCH 197/229] Change v_outpref --- user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh | 2 +- user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh | 2 +- user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh index 4a1586f..73b68a0 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh @@ -16,7 +16,7 @@ exitError () v_dump_user_name="$1" v_file="$2" -v_outpref="${v_file}" +v_outpref="${v_file%.*}" [ -z "${v_dump_user_name}" ] && exitError "First parameter is the DB Schema and cannot be null." [ -z "${v_file}" ] && exitError "Second parameter is the source file and cannot be null." diff --git a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh index 421964f..48dc68a 100644 --- a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh +++ b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh @@ -16,7 +16,7 @@ exitError () v_dump_user_name="$1" v_file="$2" -v_outpref="${v_file}" +v_outpref="${v_file%.*}" [ -z "${v_dump_user_name}" ] && exitError "First parameter is the DB Schema and cannot be null." [ -z "${v_file}" ] && exitError "Second parameter is the source file and cannot be null." diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh index 15e898a..b2ccb5b 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh @@ -16,7 +16,7 @@ exitError () v_dump_user_name="$1" v_file="$2" -v_outpref="${v_file}" +v_outpref="${v_file%.*}" [ -z "${v_dump_user_name}" ] && exitError "First parameter is the DB Schema and cannot be null." [ -z "${v_file}" ] && exitError "Second parameter is the source file and cannot be null." From 2f6fc043787031ff01ef2d0b3bce431b1b003d59 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 12 Nov 2024 23:29:49 -0300 Subject: [PATCH 198/229] Rename drop user scripts --- user_scripts/odbfcl/createUser.sql | 4 ++-- .../odbfcl/sh_extractor/cleanUser.sql | 9 ++++++++- .../odbfcl/sh_extractor/dumpCreate.sh | 8 +++++--- user_scripts/odbfcl/sh_extractor/exporter.sh | 19 +++++++------------ .../odbfcl/sh_extractor/schemaCreate.sh | 7 ++++--- user_scripts/odbfcl/tables_recreate.sql | 4 ++-- 6 files changed, 28 insertions(+), 23 deletions(-) diff --git a/user_scripts/odbfcl/createUser.sql b/user_scripts/odbfcl/createUser.sql index 9263650..1ef369f 100644 --- a/user_scripts/odbfcl/createUser.sql +++ b/user_scripts/odbfcl/createUser.sql @@ -5,10 +5,10 @@ def v_username='&1.' def v_password='&2.' def v_data_tbs='&3.' def v_temp_tbs='&4.' -def v_def_user='&5.' +def v_drop_user='&5.' BEGIN - IF '&v_def_user.' = 'true' + IF '&v_drop_user.' = 'true' THEN EXECUTE IMMEDIATE 'DROP USER &v_username. CASCADE'; END IF; diff --git a/user_scripts/odbfcl/sh_extractor/cleanUser.sql b/user_scripts/odbfcl/sh_extractor/cleanUser.sql index b0aca93..7c301fd 100644 --- a/user_scripts/odbfcl/sh_extractor/cleanUser.sql +++ b/user_scripts/odbfcl/sh_extractor/cleanUser.sql @@ -3,9 +3,16 @@ WHENEVER SQLERROR EXIT FAILURE ROLLBACK def v_username='&1.' def v_directory='&2.' +def v_drop_user='&3.' DROP DIRECTORY &v_directory.; -DROP USER &v_username. CASCADE; +BEGIN + IF '&v_drop_user.' = 'true' + THEN + EXECUTE IMMEDIATE 'DROP USER &v_username. CASCADE'; + END IF; +END; +/ EXIT 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh index 5ae7c88..bbb3891 100644 --- a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh @@ -16,9 +16,11 @@ exitError () v_dump_user_name="$1" v_out_file_param="$2" +v_drop_dump_user="$3" -[ -z "${v_dump_user_name}" ] && exitError "First parameter is the DB Schema and cannot be null." -[ -z "${v_out_file_param}" ] && exitError "Second parameter is the target file and cannot be null." +[ -z "${v_dump_user_name}" ] && exitError "1st parameter is the DB Schema and cannot be null." +[ -z "${v_out_file_param}" ] && exitError "2nd parameter is the target file and cannot be null." +[ -z "${v_drop_dump_user}" ] && exitError "3rd parameter is if DB Schema can be dropped and cannot be null." [ -f "${v_out_file_param}" ] && exitError "File \"${v_out_file_param}\" already exists. Remove it before rerunning." @@ -107,7 +109,7 @@ fi cd odbfcl/sh_extractor/ # REMOVE_IF_ZIP $ORACLE_HOME/bin/sqlplus -L -S "${v_sysdba_connect}" < Date: Tue, 12 Nov 2024 23:32:07 -0300 Subject: [PATCH 199/229] Rename errors --- user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh | 2 +- user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh | 4 ++-- user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh | 2 +- user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh | 4 ++-- user_scripts/odbfcl/adb_load_symbols/symbolGet.sh | 2 +- user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh | 4 ++-- user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh | 2 +- user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh | 4 ++-- user_scripts/odbfcl/sh_extractor/dictionaryGet.sh | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh index d1a9a68..8fa4720 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh @@ -16,7 +16,7 @@ exitError () v_out_file_param="$1" -[ -z "${v_out_file_param}" ] && exitError "First parameter is the target file and cannot be null." +[ -z "${v_out_file_param}" ] && exitError "1st parameter is the target file and cannot be null." [ -f "${v_out_file_param}" ] && exitError "File \"${v_out_file_param}\" already exists. Remove it before rerunning." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh index 73b68a0..a8f7338 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh @@ -18,8 +18,8 @@ v_dump_user_name="$1" v_file="$2" v_outpref="${v_file%.*}" -[ -z "${v_dump_user_name}" ] && exitError "First parameter is the DB Schema and cannot be null." -[ -z "${v_file}" ] && exitError "Second parameter is the source file and cannot be null." +[ -z "${v_dump_user_name}" ] && exitError "1st parameter is the DB Schema and cannot be null." +[ -z "${v_file}" ] && exitError "2nd parameter is the source file and cannot be null." [ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh b/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh index 4e3ba5d..594518c 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh +++ b/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh @@ -16,7 +16,7 @@ exitError () v_out_file_param="$1" -[ -z "${v_out_file_param}" ] && exitError "First parameter is the target file and cannot be null." +[ -z "${v_out_file_param}" ] && exitError "1st parameter is the target file and cannot be null." [ -f "${v_out_file_param}" ] && exitError "File \"${v_out_file_param}\" already exists. Remove it before rerunning." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh index 201c7f2..379a2e4 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh +++ b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh @@ -18,8 +18,8 @@ v_dump_user_name="$1" v_file="$2" v_outpref="${v_file}" -[ -z "${v_dump_user_name}" ] && exitError "First parameter is the DB Schema and cannot be null." -[ -z "${v_file}" ] && exitError "Second parameter is the source file and cannot be null." +[ -z "${v_dump_user_name}" ] && exitError "1st parameter is the DB Schema and cannot be null." +[ -z "${v_file}" ] && exitError "2nd parameter is the source file and cannot be null." [ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." diff --git a/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh b/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh index 69382b9..dfb99a0 100644 --- a/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh +++ b/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh @@ -19,7 +19,7 @@ exitError () v_out_file_param="$1" -[ -z "${v_out_file_param}" ] && exitError "First parameter is the target file and cannot be null." +[ -z "${v_out_file_param}" ] && exitError "1st parameter is the target file and cannot be null." [ -f "${v_out_file_param}" ] && exitError "File \"${v_out_file_param}\" already exists. Remove it before rerunning." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." diff --git a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh index 48dc68a..db0107e 100644 --- a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh +++ b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh @@ -18,8 +18,8 @@ v_dump_user_name="$1" v_file="$2" v_outpref="${v_file%.*}" -[ -z "${v_dump_user_name}" ] && exitError "First parameter is the DB Schema and cannot be null." -[ -z "${v_file}" ] && exitError "Second parameter is the source file and cannot be null." +[ -z "${v_dump_user_name}" ] && exitError "1st parameter is the DB Schema and cannot be null." +[ -z "${v_file}" ] && exitError "2nd parameter is the source file and cannot be null." [ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh index 8e1a696..be48e06 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh @@ -19,7 +19,7 @@ exitError () v_out_file_param="$1" -[ -z "${v_out_file_param}" ] && exitError "First parameter is the target file and cannot be null." +[ -z "${v_out_file_param}" ] && exitError "1st parameter is the target file and cannot be null." [ -f "${v_out_file_param}" ] && exitError "File \"${v_out_file_param}\" already exists. Remove it before rerunning." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh index b2ccb5b..f5ece4c 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh @@ -18,8 +18,8 @@ v_dump_user_name="$1" v_file="$2" v_outpref="${v_file%.*}" -[ -z "${v_dump_user_name}" ] && exitError "First parameter is the DB Schema and cannot be null." -[ -z "${v_file}" ] && exitError "Second parameter is the source file and cannot be null." +[ -z "${v_dump_user_name}" ] && exitError "1st parameter is the DB Schema and cannot be null." +[ -z "${v_file}" ] && exitError "2nd parameter is the source file and cannot be null." [ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." diff --git a/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh b/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh index 7eac23a..774cd86 100644 --- a/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh +++ b/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh @@ -16,7 +16,7 @@ exitError () v_dump_user_name="$1" -[ -z "${v_dump_user_name}" ] && exitError "First parameter is the DB Schema and cannot be null." +[ -z "${v_dump_user_name}" ] && exitError "1st parameter is the DB Schema and cannot be null." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." From 7cbed50266f9c73994554a57fbc64df465038cad Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 13 Nov 2024 10:29:18 -0300 Subject: [PATCH 200/229] Better reading --- .../odbfcl/adb_load_bugs_fixed/bugsLoad.sh | 29 +++++++++++----- .../odbfcl/adb_load_filechksum/chksumLoad.sh | 29 +++++++++++----- .../odbfcl/adb_load_symbols/symbolLoad.sh | 23 +++++++------ .../adb_load_txtcollection_files/fileLoad.sh | 33 +++++++++++-------- 4 files changed, 72 insertions(+), 42 deletions(-) diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh index a8f7338..cc8c28b 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh @@ -15,13 +15,13 @@ exitError () } v_dump_user_name="$1" -v_file="$2" -v_outpref="${v_file%.*}" +v_data_file_param="$2" +v_out_prefix="${v_data_file_param%.*}" [ -z "${v_dump_user_name}" ] && exitError "1st parameter is the DB Schema and cannot be null." -[ -z "${v_file}" ] && exitError "2nd parameter is the source file and cannot be null." +[ -z "${v_data_file_param}" ] && exitError "2nd parameter is the source file and cannot be null." -[ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." +[ ! -f "${v_data_file_param}" -o ! -r "${v_data_file_param}" ] && exitError "File '${v_data_file_param}' does not exist." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." @@ -31,7 +31,10 @@ v_outpref="${v_file%.*}" echo "Loading bugs list. Please wait.." -cat << EOF > "${v_outpref}_load.ctl" +v_control_file="${v_out_prefix}_load.ctl" +v_log_file="${v_out_prefix}_load.log" + +cat << EOF > "${v_control_file}" LOAD INTO TABLE ${v_dump_user_name}.T_BUGSFIXED APPEND @@ -39,15 +42,23 @@ FIELDS TERMINATED BY x'09' (bug_id, patch_id, bug_desc) EOF +set +e $ORACLE_HOME/bin/sqlldr \ userid=\'"${v_sysdba_connect}"\' \ -control="${v_outpref}_load.ctl" \ +control="${v_control_file}" \ errors=0 \ discardmax=0 \ direct=Y \ -data="${v_file}" \ -log="${v_outpref}_load.log" +data="${v_data_file_param}" \ +log="${v_log_file}" +v_ret=$? +set -eo pipefail + +if [ $v_ret -ne 0 ] +then + exitError "sqlldr failed to load '${v_data_file_param}'. Check also the 'bad' file for more information." +fi -rm -f "${v_outpref}_load.log" "${v_outpref}_load.ctl" +rm -f "${v_log_file}" "${v_control_file}" exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh index 379a2e4..a88ea0c 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh +++ b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh @@ -15,13 +15,13 @@ exitError () } v_dump_user_name="$1" -v_file="$2" -v_outpref="${v_file}" +v_data_file_param="$2" +v_out_prefix="${v_data_file_param%.*}" [ -z "${v_dump_user_name}" ] && exitError "1st parameter is the DB Schema and cannot be null." -[ -z "${v_file}" ] && exitError "2nd parameter is the source file and cannot be null." +[ -z "${v_data_file_param}" ] && exitError "2nd parameter is the source file and cannot be null." -[ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." +[ ! -f "${v_data_file_param}" -o ! -r "${v_data_file_param}" ] && exitError "File '${v_data_file_param}' does not exist." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." @@ -31,7 +31,10 @@ v_outpref="${v_file}" echo "Loading sha256sum list. Please wait.." -cat << EOF > "${v_outpref}_load.ctl" +v_control_file="${v_out_prefix}_load.ctl" +v_log_file="${v_out_prefix}_load.log" + +cat << EOF > "${v_control_file}" LOAD INTO TABLE ${v_dump_user_name}.T_FILES APPEND @@ -39,15 +42,23 @@ FIELDS TERMINATED BY ' ' (sha256_hash, path char(4000), file_type) EOF +set +e $ORACLE_HOME/bin/sqlldr \ userid=\'"${v_sysdba_connect}"\' \ -control="${v_outpref}_load.ctl" \ +control="${v_control_file}" \ errors=0 \ discardmax=0 \ direct=Y \ -data="${v_file}" \ -log="${v_outpref}_load.log" +data="${v_data_file_param}" \ +log="${v_log_file}" +v_ret=$? +set -eo pipefail + +if [ $v_ret -ne 0 ] +then + exitError "sqlldr failed to load '${v_data_file_param}'. Check also the 'bad' file for more information." +fi -rm -f "${v_outpref}_load.log" "${v_outpref}_load.ctl" +rm -f "${v_log_file}" "${v_control_file}" exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh index db0107e..8dbe3c0 100644 --- a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh +++ b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh @@ -15,13 +15,13 @@ exitError () } v_dump_user_name="$1" -v_file="$2" -v_outpref="${v_file%.*}" +v_data_file_param="$2" +v_out_prefix="${v_data_file_param%.*}" [ -z "${v_dump_user_name}" ] && exitError "1st parameter is the DB Schema and cannot be null." -[ -z "${v_file}" ] && exitError "2nd parameter is the source file and cannot be null." +[ -z "${v_data_file_param}" ] && exitError "2nd parameter is the source file and cannot be null." -[ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." +[ ! -f "${v_data_file_param}" -o ! -r "${v_data_file_param}" ] && exitError "File '${v_data_file_param}' does not exist." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." @@ -31,7 +31,10 @@ v_outpref="${v_file%.*}" echo "Loading symbols list. Please wait.." -cat << EOF > "${v_outpref}_load.ctl" +v_control_file="${v_out_prefix}_load.ctl" +v_log_file="${v_out_prefix}_load.log" + +cat << EOF > "${v_control_file}" LOAD INTO TABLE ${v_dump_user_name}.T_SYMBOLS APPEND @@ -42,20 +45,20 @@ EOF set +e $ORACLE_HOME/bin/sqlldr \ userid=\'"${v_sysdba_connect}"\' \ -control="${v_outpref}_load.ctl" \ +control="${v_control_file}" \ errors=0 \ discardmax=0 \ direct=Y \ -data="${v_file}" \ -log="${v_outpref}_load.log" +data="${v_data_file_param}" \ +log="${v_log_file}" v_ret=$? set -eo pipefail if [ $v_ret -ne 0 ] then - exitError "sqlldr failed to load '${v_file}'. Check also the 'bad' file for more information." + exitError "sqlldr failed to load '${v_data_file_param}'. Check also the 'bad' file for more information." fi -rm -f "${v_outpref}_load.log" "${v_outpref}_load.ctl" +rm -f "${v_log_file}" "${v_control_file}" exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh index f5ece4c..cc765d6 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh @@ -15,13 +15,13 @@ exitError () } v_dump_user_name="$1" -v_file="$2" -v_outpref="${v_file%.*}" +v_data_file_param="$2" +v_out_prefix="${v_data_file_param%.*}" [ -z "${v_dump_user_name}" ] && exitError "1st parameter is the DB Schema and cannot be null." -[ -z "${v_file}" ] && exitError "2nd parameter is the source file and cannot be null." +[ -z "${v_data_file_param}" ] && exitError "2nd parameter is the source file and cannot be null." -[ ! -f "${v_file}" -o ! -r "${v_file}" ] && exitError "File '${v_file}' does not exist." +[ ! -f "${v_data_file_param}" -o ! -r "${v_data_file_param}" ] && exitError "File '${v_data_file_param}' does not exist." [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." @@ -31,12 +31,17 @@ v_outpref="${v_file%.*}" echo "Loading ORACLE_HOME non-binary files. Please wait.." -rm -rf "${v_outpref}_unzip" -mkdir "${v_outpref}_unzip" -tar -tvf "${v_file}" | grep -o '\./.*' > "${v_outpref}_unzip/${v_file}_files.txt" -tar -xf "${v_file}" -C "${v_outpref}_unzip" +v_control_file="${v_out_prefix}_load.ctl" +v_log_file="${v_out_prefix}_load.log" +v_unzip_folder="${v_out_prefix}_unzip" +v_list_file="unzip_files.txt" -cd "${v_outpref}_unzip" +rm -rf "${v_unzip_folder}" +mkdir "${v_unzip_folder}" +tar -tvf "${v_data_file_param}" | grep -o '\./.*' > "${v_unzip_folder}/${v_list_file}" +tar -xf "${v_data_file_param}" -C "${v_unzip_folder}" + +cd "${v_unzip_folder}" $ORACLE_HOME/bin/sqlplus -L -S "${v_sysdba_connect}" < "${v_outpref}_load.ctl" +cat << EOF > "${v_control_file}" LOAD INTO TABLE ${v_dump_user_name}.T_TXTCOLLECTION_LOAD APPEND @@ -55,15 +60,15 @@ EOF $ORACLE_HOME/bin/sqlldr \ userid=\'"${v_sysdba_connect}"\' \ -control="${v_outpref}_load.ctl" \ +control="${v_control_file}" \ errors=0 \ discardmax=0 \ direct=Y \ -data="${v_file}_files.txt" \ -log="${v_outpref}_load.log" +data="${v_list_file}" \ +log="${v_log_file}" cd .. -rm -rf "${v_outpref}_unzip" +rm -rf "${v_unzip_folder}" $ORACLE_HOME/bin/sqlplus -L -S "${v_sysdba_connect}" < Date: Wed, 13 Nov 2024 10:52:44 -0300 Subject: [PATCH 201/229] Update exporter.sh --- user_scripts/odbfcl/sh_extractor/exporter.sh | 68 +++++++++++++++++--- 1 file changed, 59 insertions(+), 9 deletions(-) diff --git a/user_scripts/odbfcl/sh_extractor/exporter.sh b/user_scripts/odbfcl/sh_extractor/exporter.sh index ae4ccee..3803e62 100644 --- a/user_scripts/odbfcl/sh_extractor/exporter.sh +++ b/user_scripts/odbfcl/sh_extractor/exporter.sh @@ -18,6 +18,13 @@ v_pattern="$1" v_example='19.0.0.0_RU14_20220101' +# Defaults +v_def_load_file='true' +v_def_gen_dump='true' +v_def_ignore_error='true' +v_def_sysdba_connect='/ as sysdba' +v_def_dump_user_name='hash' + [ -z "$v_pattern" -o "$#" -ne 1 ] && exitError "Usage: $0 First parameter is the output file name and cannot be null. @@ -25,6 +32,43 @@ First parameter is the output file name and cannot be null. Eg: $0 ${v_example} The output is a zip file. + +Environment Variables: + + DB_EXP_MERGE_DUMP + + The generated ORACLE_HOME related files (bugs, symbols, chksum, etc) + won't be loaded on DB tables, but added to zip as separate files. + + Accepted values: 'true' or 'false'. + Default value: '${v_def_load_file}' + + DB_EXP_GEN_DUMP + + If schema is exported after being populated. + + Accepted values: 'true' or 'false'. + Default value: '${v_def_gen_dump}' + + DB_EXP_IGNORE_ERROR + + Code will ignore critical errors. + + Accepted values: 'true' or 'false'. + Default value: '${v_def_ignore_error}' + + DB_EXP_CRED + + SQLPlus connect string. + + Default value: '${v_def_sysdba_connect}' + + DB_EXP_USER + + Schema inside the database that will temporarily hold the oradiff data. + + Default value: '${v_def_dump_user_name}' + " [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." @@ -33,7 +77,7 @@ The output is a zip file. # If DB_EXP_MERGE_DUMP=false, then the generated ORACLE_HOME related files (bugs, symbols, chksum, etc) won't be loaded on DB tables, but added to zip as separate files. if [ -z "$DB_EXP_MERGE_DUMP" ] then - v_load_file=true + v_load_file=${v_def_load_file} # echo "Note: Variable 'DB_EXP_MERGE_DUMP' was not exported. Assigning DB_EXP_MERGE_DUMP=${v_load_file} (default)." else v_load_file=$(echo "${DB_EXP_MERGE_DUMP}" | tr '[:upper:]' '[:lower:]') @@ -48,7 +92,7 @@ fi # If DB_EXP_GEN_DUMP=false, then nothing will be exported. Only the schema populated. if [ -z "$DB_EXP_GEN_DUMP" ] then - v_gen_dump=true + v_gen_dump=${v_def_gen_dump} # echo "Note: Variable 'DB_EXP_GEN_DUMP' was not exported. Assigning DB_EXP_GEN_DUMP=${v_gen_dump} (default)." else v_gen_dump=$(echo "${DB_EXP_GEN_DUMP}" | tr '[:upper:]' '[:lower:]') @@ -63,7 +107,7 @@ fi # If DB_EXP_IGNORE_ERROR=false, the code will stop on some critical errors. if [ -z "$DB_EXP_IGNORE_ERROR" ] then - v_ignore_error=true + v_ignore_error=${v_def_ignore_error} # echo "Note: Variable 'DB_EXP_IGNORE_ERROR' was not exported. Assigning DB_EXP_IGNORE_ERROR=${v_ignore_error} (default)." else v_ignore_error=$(echo "${DB_EXP_IGNORE_ERROR}" | tr '[:upper:]' '[:lower:]') @@ -78,19 +122,18 @@ fi # If DB_EXP_CRED is exported, then connect using this string instead of '/ as sysdba'. if [ -z "$DB_EXP_CRED" ] then - v_sysdba_connect='/ as sysdba' - echo "Note: Variable 'DB_EXP_CRED' was not exported. Assigning DB_EXP_CRED='${v_sysdba_connect}' (default)." + v_sysdba_connect=${v_def_sysdba_connect} + # echo "Note: Variable 'DB_EXP_CRED' was not exported. Assigning DB_EXP_CRED='${v_sysdba_connect}' (default)." else v_sysdba_connect="${DB_EXP_CRED}" echo "Note: DB_EXP_CRED (provided)." fi # If DB_EXP_USER defines the user inside the database to export the oradiff data. -v_def_dump_user_name='hash' if [ -z "$DB_EXP_USER" ] then v_dump_user_name=${v_def_dump_user_name} - echo "Note: Variable 'DB_EXP_USER' was not exported. Assigning DB_EXP_USER='${v_dump_user_name}' (default)." + # echo "Note: Variable 'DB_EXP_USER' was not exported. Assigning DB_EXP_USER='${v_dump_user_name}' (default)." else v_dump_user_name=$(echo "${v_dump_user_name}" | tr '[:upper:]' '[:lower:]') echo "Note: DB_EXP_USER (provided)." @@ -127,8 +170,15 @@ then exitError "${v_common_user}" fi -[ -n "${v_common_user}" ] && v_dump_user_name="${v_common_user}${v_dump_user_name}" -################## +if [ "$v_def_dump_user_name" = "$v_dump_user_name" ] +then + [ -n "${v_common_user}" ] && v_dump_user_name="${v_common_user}${v_dump_user_name}" +fi + +############## +# Start Code # +############## + v_thisdir_bkp="${v_thisdir}" # REMOVE_IF_ZIP v_thisdir="${v_thisdir_bkp}/../adb_load_bugs_fixed" # REMOVE_IF_ZIP From 44eb54383d1e1d1d013e8ffc45828469fbecf139 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 13 Nov 2024 11:03:29 -0300 Subject: [PATCH 202/229] Update exporter.sh --- user_scripts/odbfcl/sh_extractor/exporter.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_scripts/odbfcl/sh_extractor/exporter.sh b/user_scripts/odbfcl/sh_extractor/exporter.sh index 3803e62..c1a7127 100644 --- a/user_scripts/odbfcl/sh_extractor/exporter.sh +++ b/user_scripts/odbfcl/sh_extractor/exporter.sh @@ -38,7 +38,7 @@ Environment Variables: DB_EXP_MERGE_DUMP The generated ORACLE_HOME related files (bugs, symbols, chksum, etc) - won't be loaded on DB tables, but added to zip as separate files. + will be loaded on DB tables, not added to zip as separate files. Accepted values: 'true' or 'false'. Default value: '${v_def_load_file}' @@ -59,7 +59,7 @@ Environment Variables: DB_EXP_CRED - SQLPlus connect string. + SQL*Plus connect string. Default value: '${v_def_sysdba_connect}' From 2c5d1809d39d2b02fab330d3a8a035c748d8276d Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 13 Nov 2024 12:30:41 -0300 Subject: [PATCH 203/229] Improve scripts --- .../adb_load_txtcollection_files/fileLoad.sh | 8 ++ .../odbfcl/sh_extractor/dictionaryGet.sh | 9 +- .../odbfcl/sh_extractor/dumpCreate.sh | 19 ++-- user_scripts/odbfcl/sh_extractor/exporter.sh | 89 +++++++++++++++++-- 4 files changed, 107 insertions(+), 18 deletions(-) diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh index cc765d6..5779d6a 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh @@ -58,6 +58,7 @@ FIELDS TERMINATED BY ',' (path char(4000), contents lobfile(path) terminated by eof) EOF +set +e $ORACLE_HOME/bin/sqlldr \ userid=\'"${v_sysdba_connect}"\' \ control="${v_control_file}" \ @@ -66,6 +67,13 @@ discardmax=0 \ direct=Y \ data="${v_list_file}" \ log="${v_log_file}" +v_ret=$? +set -eo pipefail + +if [ $v_ret -ne 0 ] +then + exitError "sqlldr failed to load '${v_data_file_param}'. Check also the 'bad' file for more information." +fi cd .. rm -rf "${v_unzip_folder}" diff --git a/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh b/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh index 774cd86..d5133b3 100644 --- a/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh +++ b/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh @@ -21,14 +21,15 @@ v_dump_user_name="$1" [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." -v_dump_dir_name='expdir_hash' +# If DB_EXP_CRED is exported, use it. +[ -n "$DB_EXP_CRED" ] && v_sysdba_connect="$DB_EXP_CRED" || v_sysdba_connect='/ as sysdba' + +# If DB_EXP_DIRECTORY is exported, use it. +[ -n "$DB_EXP_DIRECTORY" ] && v_dump_dir_name=$DB_EXP_DIRECTORY || v_dump_dir_name='expdir_hash' v_thisdir="$(cd "$(dirname "$0")"; pwd)" cd "${v_thisdir}" -# If DB_EXP_CRED is exported, use it as the credentials. -[ -n "$DB_EXP_CRED" ] && v_sysdba_connect="$DB_EXP_CRED" || v_sysdba_connect='/ as sysdba' - echo "Generating table export. Please wait.." cd "${v_thisdir}"/../extract # REMOVE_IF_ZIP diff --git a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh index bbb3891..4fd6edf 100644 --- a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/dumpCreate.sh @@ -34,10 +34,17 @@ v_out_file_name_noext="${v_out_file_name%.*}" v_out_file_full="${v_out_file_fdr}/${v_out_file_name}" v_err_file_full="${v_out_file_fdr}/${v_out_file_name_noext}.err" -# If DB_EXP_USER_PASS is exported, use it as the password. +# If DB_EXP_USER_PASS is exported, use it. [ -n "$DB_EXP_USER_PASS" ] && v_dump_user_pass="$DB_EXP_USER_PASS" || v_dump_user_pass='HhAaSsHh..135' -v_dump_dir_name='expdir_hash' +# If DB_EXP_CRED is exported, use it. +[ -n "$DB_EXP_CRED" ] && v_sysdba_connect="$DB_EXP_CRED" || v_sysdba_connect='/ as sysdba' + +# If DB_EXP_DIRECTORY is exported, use it. +[ -n "$DB_EXP_DIRECTORY" ] && v_dump_dir_name=$DB_EXP_DIRECTORY || v_dump_dir_name='expdir_hash' + +# If DB_EXP_COMPRESS is exported, use it. +[ -n "$DB_EXP_COMPRESS" ] && v_enable_compress=$DB_EXP_COMPRESS || v_enable_compress='false' v_thisdir="$(cd "$(dirname "$0")"; pwd)" cd "${v_thisdir}" @@ -45,9 +52,6 @@ cd "${v_thisdir}" v_output_file_cnt=`awk -F" " '{print NF-1}' <<< "${v_out_file_name_noext}"` [ ${v_output_file_cnt} -ne 0 ] && exitError "File \"${v_out_file_param}\" must not have any spaces." -# If DB_EXP_CRED is exported, use it as the credentials. -[ -n "$DB_EXP_CRED" ] && v_sysdba_connect="$DB_EXP_CRED" || v_sysdba_connect='/ as sysdba' - echo "Generating table export. Please wait.." cd "${v_thisdir}"/../../ # REMOVE_IF_ZIP @@ -69,6 +73,11 @@ else v_compress_alg='compression=all compression_algorithm=high' fi +if [ "$v_enable_compress" != "true" ] +then + v_compress_alg='' +fi + if [ $v_version -gt 19 ] then v_version_param="version=19" diff --git a/user_scripts/odbfcl/sh_extractor/exporter.sh b/user_scripts/odbfcl/sh_extractor/exporter.sh index c1a7127..62842a2 100644 --- a/user_scripts/odbfcl/sh_extractor/exporter.sh +++ b/user_scripts/odbfcl/sh_extractor/exporter.sh @@ -14,6 +14,14 @@ exitError () exit 1 } +echoDebug () +{ + if [ $DEBUG -eq 1 ] + then + echo "$1" + fi +} + v_pattern="$1" v_example='19.0.0.0_RU14_20220101' @@ -24,6 +32,9 @@ v_def_gen_dump='true' v_def_ignore_error='true' v_def_sysdba_connect='/ as sysdba' v_def_dump_user_name='hash' +v_def_dump_user_pass='HhAaSsHh..135' +v_def_dump_exp_dir='expdir_hash' +v_def_dump_exp_comp='false' [ -z "$v_pattern" -o "$#" -ne 1 ] && exitError "Usage: $0 @@ -69,6 +80,28 @@ Environment Variables: Default value: '${v_def_dump_user_name}' + DB_EXP_USER_PASS + + Password for the temporary schema that will temporarily hold the oradiff data. + + Default value: '${v_def_dump_user_pass}' + + DB_EXP_DIRECTORY + + Temporary directory that will be created to export the genetared data. + Only valid when DB_EXP_GEN_DUMP=true. + + Default value: '${v_def_dump_exp_dir}' + + DB_EXP_COMPRESS + + Enable data pump compression. + (Requires licensing of the Oracle Advanced Compression option). + Only valid when DB_EXP_GEN_DUMP=true. + + Accepted values: 'true' or 'false'. + Default value: '${v_def_dump_exp_comp}' + " [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." @@ -78,7 +111,7 @@ Environment Variables: if [ -z "$DB_EXP_MERGE_DUMP" ] then v_load_file=${v_def_load_file} - # echo "Note: Variable 'DB_EXP_MERGE_DUMP' was not exported. Assigning DB_EXP_MERGE_DUMP=${v_load_file} (default)." + echoDebug "Note: Variable 'DB_EXP_MERGE_DUMP' was not exported. Assigning DB_EXP_MERGE_DUMP=${v_load_file} (default)." else v_load_file=$(echo "${DB_EXP_MERGE_DUMP}" | tr '[:upper:]' '[:lower:]') echo "Note: DB_EXP_MERGE_DUMP=${v_load_file} (provided)." @@ -93,7 +126,7 @@ fi if [ -z "$DB_EXP_GEN_DUMP" ] then v_gen_dump=${v_def_gen_dump} - # echo "Note: Variable 'DB_EXP_GEN_DUMP' was not exported. Assigning DB_EXP_GEN_DUMP=${v_gen_dump} (default)." + echoDebug "Note: Variable 'DB_EXP_GEN_DUMP' was not exported. Assigning DB_EXP_GEN_DUMP=${v_gen_dump} (default)." else v_gen_dump=$(echo "${DB_EXP_GEN_DUMP}" | tr '[:upper:]' '[:lower:]') echo "Note: DB_EXP_GEN_DUMP=${v_gen_dump} (provided)." @@ -108,7 +141,7 @@ fi if [ -z "$DB_EXP_IGNORE_ERROR" ] then v_ignore_error=${v_def_ignore_error} - # echo "Note: Variable 'DB_EXP_IGNORE_ERROR' was not exported. Assigning DB_EXP_IGNORE_ERROR=${v_ignore_error} (default)." + echoDebug "Note: Variable 'DB_EXP_IGNORE_ERROR' was not exported. Assigning DB_EXP_IGNORE_ERROR=${v_ignore_error} (default)." else v_ignore_error=$(echo "${DB_EXP_IGNORE_ERROR}" | tr '[:upper:]' '[:lower:]') echo "Note: DB_EXP_IGNORE_ERROR=${v_ignore_error} (provided)." @@ -123,7 +156,10 @@ fi if [ -z "$DB_EXP_CRED" ] then v_sysdba_connect=${v_def_sysdba_connect} - # echo "Note: Variable 'DB_EXP_CRED' was not exported. Assigning DB_EXP_CRED='${v_sysdba_connect}' (default)." + # To be used by child shells. + DB_EXP_CRED=${v_sysdba_connect} + export DB_EXP_CRED + echoDebug "Note: Variable 'DB_EXP_CRED' was not exported. Assigning DB_EXP_CRED='${v_sysdba_connect}' (default)." else v_sysdba_connect="${DB_EXP_CRED}" echo "Note: DB_EXP_CRED (provided)." @@ -133,13 +169,51 @@ fi if [ -z "$DB_EXP_USER" ] then v_dump_user_name=${v_def_dump_user_name} - # echo "Note: Variable 'DB_EXP_USER' was not exported. Assigning DB_EXP_USER='${v_dump_user_name}' (default)." + echoDebug "Note: Variable 'DB_EXP_USER' was not exported. Assigning DB_EXP_USER='${v_dump_user_name}' (default)." else v_dump_user_name=$(echo "${v_dump_user_name}" | tr '[:upper:]' '[:lower:]') echo "Note: DB_EXP_USER (provided)." fi -# Check if v_dump_user_name is the default or not. +# If DB_EXP_USER_PASS defines the user inside the database to export the oradiff data. +if [ -z "$DB_EXP_USER_PASS" ] +then + # To be used by child shells. + DB_EXP_USER_PASS=${v_def_dump_user_pass} + export DB_EXP_USER_PASS + echoDebug "Note: Variable 'DB_EXP_USER_PASS' was not exported. Assigning DB_EXP_USER_PASS='${v_def_dump_user_pass}' (default)." +else + echo "Note: DB_EXP_USER_PASS (provided)." +fi + +# If DB_EXP_DIRECTORY defines the user inside the database to export the oradiff data. +if [ -z "$DB_EXP_DIRECTORY" ] +then + # To be used by child shells. + DB_EXP_DIRECTORY=${v_def_dump_exp_dir} + export DB_EXP_DIRECTORY + echoDebug "Note: Variable 'DB_EXP_DIRECTORY' was not exported. Assigning DB_EXP_DIRECTORY='${v_def_dump_exp_dir}' (default)." +else + echo "Note: DB_EXP_DIRECTORY (provided)." +fi + +# If DB_EXP_COMPRESS defines the user inside the database to export the oradiff data. +if [ -z "$DB_EXP_COMPRESS" ] +then + # To be used by child shells. + DB_EXP_COMPRESS=${v_def_dump_exp_comp} + export DB_EXP_COMPRESS + echoDebug "Note: Variable 'DB_EXP_COMPRESS' was not exported. Assigning DB_EXP_COMPRESS='${v_def_dump_exp_comp}' (default)." +else + echo "Note: DB_EXP_COMPRESS (provided)." +fi + +if [ "${v_def_dump_exp_comp}" != "false" -a "${v_def_dump_exp_comp}" != "true" ] +then + exitError "DB_EXP_COMPRESS must be 'true' or 'false'." +fi + +# Check if v_dump_user_name is the default. If it is, we drop it before and after. if [ "$v_def_dump_user_name" = "$v_dump_user_name" ] then v_drop_dump_user=true @@ -147,9 +221,6 @@ else v_drop_dump_user=false fi -# DB_EXP_CRED needs to be exported -export DB_EXP_CRED - v_pattern_cnt=`awk -F" " '{print NF-1}' <<< "${v_pattern}"` [ ${v_pattern_cnt} -ne 0 ] && exitError "Pattern \"${v_output}\" must not have any spaces. Eg: ${v_example}" From b976327d92c041f63fc2862c8fd9c6515552999b Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 13 Nov 2024 16:47:01 -0300 Subject: [PATCH 204/229] Change code --- .../odbfcl/adb_load_filechksum/chksumGet.sh | 2 + .../adb_load_txtcollection_files/fileGet.sh | 2 + .../adb_load_txtcollection_files/fileLoad.sh | 17 ++-- .../odbfcl/sh_extractor/dumpCreate.sh | 2 + user_scripts/odbfcl/sh_extractor/exporter.sh | 80 +++++++++++++++++-- .../odbfcl/sh_extractor/schemaCreate.sh | 12 +-- 6 files changed, 94 insertions(+), 21 deletions(-) diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh b/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh index 594518c..4887590 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh +++ b/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh @@ -68,4 +68,6 @@ done [ -f "${v_err_file_full}" ] && echo "Total errors detected: $(wc -l < "${v_err_file_full}")" +[ -f "${v_err_file_full}" -a ! -s "${v_err_file_full}" ] && rm -f "${v_err_file_full}" + exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh index be48e06..f80f386 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh @@ -43,4 +43,6 @@ find -type f -not -path "./.patch_storage/*" -not -name "tfa_setup" -print0 2>> [ -f "${v_err_file_full}" ] && echo "Total errors detected: $(wc -l < "${v_err_file_full}")" +[ -f "${v_err_file_full}" -a ! -s "${v_err_file_full}" ] && rm -f "${v_err_file_full}" + exit 0 \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh index 5779d6a..d6c038d 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh @@ -17,6 +17,7 @@ exitError () v_dump_user_name="$1" v_data_file_param="$2" v_out_prefix="${v_data_file_param%.*}" +v_out_prefix="${v_out_prefix%.*}" # Remove second extension [ -z "${v_dump_user_name}" ] && exitError "1st parameter is the DB Schema and cannot be null." [ -z "${v_data_file_param}" ] && exitError "2nd parameter is the source file and cannot be null." @@ -33,15 +34,15 @@ echo "Loading ORACLE_HOME non-binary files. Please wait.." v_control_file="${v_out_prefix}_load.ctl" v_log_file="${v_out_prefix}_load.log" -v_unzip_folder="${v_out_prefix}_unzip" -v_list_file="unzip_files.txt" +v_untar_folder="${v_out_prefix}_untar" +v_list_file="tar_list_files.txt" -rm -rf "${v_unzip_folder}" -mkdir "${v_unzip_folder}" -tar -tvf "${v_data_file_param}" | grep -o '\./.*' > "${v_unzip_folder}/${v_list_file}" -tar -xf "${v_data_file_param}" -C "${v_unzip_folder}" +rm -rf "${v_untar_folder}" +mkdir "${v_untar_folder}" +tar -tvf "${v_data_file_param}" | grep -o '\./.*' > "${v_untar_folder}/${v_list_file}" +tar -xf "${v_data_file_param}" -C "${v_untar_folder}" -cd "${v_unzip_folder}" +cd "${v_untar_folder}" $ORACLE_HOME/bin/sqlplus -L -S "${v_sysdba_connect}" < @@ -86,6 +89,18 @@ Environment Variables: Default value: '${v_def_dump_user_pass}' + DB_EXP_USER_TBS + + Default permanent tablespace for the temporary schema. + + Default value: '${v_def_dump_user_tbs}' + + DB_EXP_USER_TEMP + + Default temp tablespace for the temporary schema. + + Default value: '${v_def_dump_user_temp}' + DB_EXP_DIRECTORY Temporary directory that will be created to export the genetared data. @@ -102,8 +117,21 @@ Environment Variables: Accepted values: 'true' or 'false'. Default value: '${v_def_dump_exp_comp}' + DB_EXP_INTERNAL_ONLY + + If we want to retrieve dictionary info of full database or just internal + oracle maintained schemas. + + Accepted values: 'true' or 'false'. + Default value: '${v_def_dump_int_only}' + + " +################### +# Check variables # +################### + [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." @@ -175,7 +203,7 @@ else echo "Note: DB_EXP_USER (provided)." fi -# If DB_EXP_USER_PASS defines the user inside the database to export the oradiff data. +# If DB_EXP_USER_PASS defines the user password inside the database to export the oradiff data. if [ -z "$DB_EXP_USER_PASS" ] then # To be used by child shells. @@ -186,33 +214,71 @@ else echo "Note: DB_EXP_USER_PASS (provided)." fi -# If DB_EXP_DIRECTORY defines the user inside the database to export the oradiff data. +# If DB_EXP_USER_TBS defines the user tablespace inside the database to export the oradiff data. +if [ -z "$DB_EXP_USER_TBS" ] +then + # To be used by child shells. + DB_EXP_USER_TBS=${v_def_dump_user_tbs} + export DB_EXP_USER_TBS + echoDebug "Note: Variable 'DB_EXP_USER_TBS' was not exported. Assigning DB_EXP_USER_TBS='${DB_EXP_USER_TBS}' (default)." +else + echo "Note: DB_EXP_USER_TBS (provided)." +fi + +# If DB_EXP_USER_TEMP defines the user temp tablespace inside the database to export the oradiff data. +if [ -z "$DB_EXP_USER_TEMP" ] +then + # To be used by child shells. + DB_EXP_USER_TEMP=${v_def_dump_user_temp} + export DB_EXP_USER_TEMP + echoDebug "Note: Variable 'DB_EXP_USER_TEMP' was not exported. Assigning DB_EXP_USER_TEMP='${DB_EXP_USER_TEMP}' (default)." +else + echo "Note: DB_EXP_USER_TEMP (provided)." +fi + +# If DB_EXP_DIRECTORY defines the directory name inside the database to export the oradiff data. if [ -z "$DB_EXP_DIRECTORY" ] then # To be used by child shells. DB_EXP_DIRECTORY=${v_def_dump_exp_dir} export DB_EXP_DIRECTORY - echoDebug "Note: Variable 'DB_EXP_DIRECTORY' was not exported. Assigning DB_EXP_DIRECTORY='${v_def_dump_exp_dir}' (default)." + echoDebug "Note: Variable 'DB_EXP_DIRECTORY' was not exported. Assigning DB_EXP_DIRECTORY='${DB_EXP_DIRECTORY}' (default)." else echo "Note: DB_EXP_DIRECTORY (provided)." fi -# If DB_EXP_COMPRESS defines the user inside the database to export the oradiff data. +# If DB_EXP_COMPRESS defines if compression can be used to export the oradiff data. if [ -z "$DB_EXP_COMPRESS" ] then # To be used by child shells. DB_EXP_COMPRESS=${v_def_dump_exp_comp} export DB_EXP_COMPRESS - echoDebug "Note: Variable 'DB_EXP_COMPRESS' was not exported. Assigning DB_EXP_COMPRESS='${v_def_dump_exp_comp}' (default)." + echoDebug "Note: Variable 'DB_EXP_COMPRESS' was not exported. Assigning DB_EXP_COMPRESS='${DB_EXP_COMPRESS}' (default)." else echo "Note: DB_EXP_COMPRESS (provided)." fi -if [ "${v_def_dump_exp_comp}" != "false" -a "${v_def_dump_exp_comp}" != "true" ] +if [ "${DB_EXP_COMPRESS}" != "false" -a "${DB_EXP_COMPRESS}" != "true" ] then exitError "DB_EXP_COMPRESS must be 'true' or 'false'." fi +# If DB_EXP_INTERNAL_ONLY defines if we filter for internal schemas during export of oradiff data. +if [ -z "$DB_EXP_INTERNAL_ONLY" ] +then + # To be used by child shells. + DB_EXP_INTERNAL_ONLY=${v_def_dump_int_only} + export DB_EXP_INTERNAL_ONLY + echoDebug "Note: Variable 'DB_EXP_INTERNAL_ONLY' was not exported. Assigning DB_EXP_INTERNAL_ONLY='${DB_EXP_INTERNAL_ONLY}' (default)." +else + echo "Note: DB_EXP_INTERNAL_ONLY (provided)." +fi + +if [ "${DB_EXP_INTERNAL_ONLY}" != "false" -a "${DB_EXP_INTERNAL_ONLY}" != "true" ] +then + exitError "DB_EXP_INTERNAL_ONLY must be 'true' or 'false'." +fi + # Check if v_dump_user_name is the default. If it is, we drop it before and after. if [ "$v_def_dump_user_name" = "$v_dump_user_name" ] then diff --git a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh index cf1124c..83327c9 100644 --- a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh @@ -23,21 +23,21 @@ v_drop_dump_user="$2" [ -z "${v_dump_user_name}" ] && exitError "1st parameter is the DB Schema and cannot be null." [ -z "${v_drop_dump_user}" ] && exitError "2nd parameter is if DB Schema can be dropped and cannot be null." -# If DB_EXP_USER_PASS is exported, use it as the password. +# If DB_EXP_USER_PASS is exported, use it. [ -n "$DB_EXP_USER_PASS" ] && v_dump_user_pass="$DB_EXP_USER_PASS" || v_dump_user_pass='HhAaSsHh..135' -# If DB_EXP_USER_PASS is exported, use it as the password. +# If DB_EXP_USER_TBS is exported, use it. [ -n "$DB_EXP_USER_TBS" ] && v_dump_user_tbs="$DB_EXP_USER_TBS" || v_dump_user_tbs='USERS' -# If DB_EXP_USER_PASS is exported, use it as the password. +# If DB_EXP_USER_TEMP is exported, use it. [ -n "$DB_EXP_USER_TEMP" ] && v_dump_user_temp="$DB_EXP_USER_TEMP" || v_dump_user_temp='TEMP' -v_thisdir="$(cd "$(dirname "$0")"; pwd)" -cd "${v_thisdir}" - # If DB_EXP_CRED is exported, use it as the credentials. [ -n "$DB_EXP_CRED" ] && v_sysdba_connect="$DB_EXP_CRED" || v_sysdba_connect='/ as sysdba' +v_thisdir="$(cd "$(dirname "$0")"; pwd)" +cd "${v_thisdir}" + echo "Creating export user. Please wait.." cd "${v_thisdir}"/../ # REMOVE_IF_ZIP From 594242b62658ab1c281617b9f3a85841b90a6cf9 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 18 Nov 2024 13:55:33 -0300 Subject: [PATCH 205/229] New extractor version --- user_scripts/cleanUser.sql | 2 +- user_scripts/gen/create_hash_custom.sql | 2 +- user_scripts/gen/create_hash_dba_cdb.sql | 2 +- user_scripts/gen/create_hash_dv.sql | 2 +- .../odbfcl/adb_load_bugs_fixed/bugsLoad.sh | 6 +- .../odbfcl/adb_load_filechksum/chksumLoad.sh | 6 +- .../odbfcl/adb_load_symbols/symbolLoad.sh | 6 +- .../adb_load_txtcollection_files/fileLoad.sh | 10 +- user_scripts/odbfcl/createUser.sql | 6 + .../odbfcl/extract/create_hash_load_table.sql | 4 +- user_scripts/odbfcl/extract/hashGet.sql | 17 +- .../int_resources_10.2.0.1.sql | 61 +++++ .../int_resources_10.2.0.2.sql | 6 + .../int_resources_10.2.0.3.sql | 8 + .../int_resources_10.2.0.4.sql | 9 + .../int_resources_10.2.0.5.sql | 6 + .../int_resources_11.1.0.6.sql | 90 +++++++ .../int_resources_11.1.0.7.sql | 6 + .../int_resources_11.2.0.1.sql | 8 + .../int_resources_11.2.0.2.sql | 91 +++++++ .../int_resources_11.2.0.3.sql | 6 + .../int_resources_11.2.0.4.sql | 8 + .../int_resources_12.1.0.1.sql | 5 + .../int_resources_12.1.0.2.sql | 6 + .../int_resources_12.2.0.1.sql | 6 + .../int_resources_18.0.0.0.sql | 6 + .../int_resources_19.0.0.0.sql | 6 + .../internal_schemas/int_resources_create.sql | 28 +++ .../internal_schemas/int_resources_drop.sql | 1 + .../int_resources_nothing.sql | 5 + .../int_resources_prof_om.sql | 8 + .../int_resources_user_role_om.sql | 15 ++ user_scripts/odbfcl/extract/load_code.sql | 24 +- user_scripts/odbfcl/extract/load_custom.sql | 86 +++++-- .../odbfcl/extract/load_database_vault.sql | 2 +- user_scripts/odbfcl/extract/load_dba_cdb.sql | 195 +++++++++++---- user_scripts/odbfcl/extract/load_source.sql | 9 +- user_scripts/odbfcl/extract/load_v_dollar.sql | 37 +-- user_scripts/odbfcl/extract/load_view.sql | 61 +++-- user_scripts/odbfcl/extract/tables_drop.sql | 21 ++ .../odbfcl/extract/version_filter.sql | 31 +++ user_scripts/odbfcl/runExtractor.yml | 1 + .../odbfcl/sh_extractor/dictionaryGet.sh | 13 +- .../odbfcl/sh_extractor/dumpCreate.sh | 26 +- user_scripts/odbfcl/sh_extractor/exporter.sh | 233 ++++++++++-------- .../odbfcl/sh_extractor/schemaCreate.sh | 14 +- user_scripts/odbfcl/tables_create.sql | 16 +- user_scripts/odbfcl/tables_recreate.sql | 4 + user_scripts/tables_recreate.sql | 2 +- 49 files changed, 941 insertions(+), 282 deletions(-) create mode 100644 user_scripts/odbfcl/extract/internal_schemas/int_resources_10.2.0.1.sql create mode 100644 user_scripts/odbfcl/extract/internal_schemas/int_resources_10.2.0.2.sql create mode 100644 user_scripts/odbfcl/extract/internal_schemas/int_resources_10.2.0.3.sql create mode 100644 user_scripts/odbfcl/extract/internal_schemas/int_resources_10.2.0.4.sql create mode 100644 user_scripts/odbfcl/extract/internal_schemas/int_resources_10.2.0.5.sql create mode 100644 user_scripts/odbfcl/extract/internal_schemas/int_resources_11.1.0.6.sql create mode 100644 user_scripts/odbfcl/extract/internal_schemas/int_resources_11.1.0.7.sql create mode 100644 user_scripts/odbfcl/extract/internal_schemas/int_resources_11.2.0.1.sql create mode 100644 user_scripts/odbfcl/extract/internal_schemas/int_resources_11.2.0.2.sql create mode 100644 user_scripts/odbfcl/extract/internal_schemas/int_resources_11.2.0.3.sql create mode 100644 user_scripts/odbfcl/extract/internal_schemas/int_resources_11.2.0.4.sql create mode 100644 user_scripts/odbfcl/extract/internal_schemas/int_resources_12.1.0.1.sql create mode 100644 user_scripts/odbfcl/extract/internal_schemas/int_resources_12.1.0.2.sql create mode 100644 user_scripts/odbfcl/extract/internal_schemas/int_resources_12.2.0.1.sql create mode 100644 user_scripts/odbfcl/extract/internal_schemas/int_resources_18.0.0.0.sql create mode 100644 user_scripts/odbfcl/extract/internal_schemas/int_resources_19.0.0.0.sql create mode 100644 user_scripts/odbfcl/extract/internal_schemas/int_resources_create.sql create mode 100644 user_scripts/odbfcl/extract/internal_schemas/int_resources_drop.sql create mode 100644 user_scripts/odbfcl/extract/internal_schemas/int_resources_nothing.sql create mode 100644 user_scripts/odbfcl/extract/internal_schemas/int_resources_prof_om.sql create mode 100644 user_scripts/odbfcl/extract/internal_schemas/int_resources_user_role_om.sql create mode 100644 user_scripts/odbfcl/extract/tables_drop.sql create mode 100644 user_scripts/odbfcl/extract/version_filter.sql diff --git a/user_scripts/cleanUser.sql b/user_scripts/cleanUser.sql index d7e67f7..96b7016 100644 --- a/user_scripts/cleanUser.sql +++ b/user_scripts/cleanUser.sql @@ -18,7 +18,7 @@ BEGIN FOR I IN (select owner,table_name from sys.all_tables where owner=SYS_CONTEXT('USERENV','CURRENT_SCHEMA')) LOOP VCODE := 'TRUNCATE TABLE ' || DBMS_ASSERT.SCHEMA_NAME(I.OWNER) || '.' || DBMS_ASSERT.SQL_OBJECT_NAME(I.TABLE_NAME); - DBMS_OUTPUT.PUT_LINE(VCODE); + DBMS_OUTPUT.PUT_LINE(VCODE || ';'); EXECUTE IMMEDIATE VCODE; END LOOP; END; diff --git a/user_scripts/gen/create_hash_custom.sql b/user_scripts/gen/create_hash_custom.sql index 8fe07b3..38e7878 100644 --- a/user_scripts/gen/create_hash_custom.sql +++ b/user_scripts/gen/create_hash_custom.sql @@ -53,7 +53,7 @@ DECLARE V_SQL := V_SQL || ' WHERE ' || IN_WHERE_CLAUSE_12; END IF; END IF; - DBMS_OUTPUT.PUT_LINE(V_SQL); + DBMS_OUTPUT.PUT_LINE(V_SQL || ';'); EXECUTE IMMEDIATE 'alter session set current_schema=SYS'; EXECUTE IMMEDIATE V_SQL; diff --git a/user_scripts/gen/create_hash_dba_cdb.sql b/user_scripts/gen/create_hash_dba_cdb.sql index 7127da1..f8521b7 100644 --- a/user_scripts/gen/create_hash_dba_cdb.sql +++ b/user_scripts/gen/create_hash_dba_cdb.sql @@ -63,7 +63,7 @@ DECLARE V_SQL := V_SQL || ' WHERE ' || IN_WHERE_CLAUSE_12; END IF; END IF; - DBMS_OUTPUT.PUT_LINE(V_SQL); + DBMS_OUTPUT.PUT_LINE(V_SQL || ';'); EXECUTE IMMEDIATE V_SQL; END; diff --git a/user_scripts/gen/create_hash_dv.sql b/user_scripts/gen/create_hash_dv.sql index 56aefe2..4f4d538 100644 --- a/user_scripts/gen/create_hash_dv.sql +++ b/user_scripts/gen/create_hash_dv.sql @@ -51,7 +51,7 @@ DECLARE V_SQL := V_SQL || ' WHERE ' || IN_WHERE_CLAUSE_12; END IF; END IF; - DBMS_OUTPUT.PUT_LINE(V_SQL); + DBMS_OUTPUT.PUT_LINE(V_SQL || ';'); EXECUTE IMMEDIATE 'alter session set current_schema=SYS'; EXECUTE IMMEDIATE V_SQL; diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh index cc8c28b..99b920e 100644 --- a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh +++ b/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh @@ -26,8 +26,8 @@ v_out_prefix="${v_data_file_param%.*}" [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." -# If DB_EXP_CRED is exported, use it as the credentials. -[ -n "$DB_EXP_CRED" ] && v_sysdba_connect="$DB_EXP_CRED" || v_sysdba_connect='/ as sysdba' +# If DB_EXP_CONN is exported, use it as the credentials. +[ -z "$DB_EXP_CONN" ] && DB_EXP_CONN='/ as sysdba' echo "Loading bugs list. Please wait.." @@ -44,7 +44,7 @@ EOF set +e $ORACLE_HOME/bin/sqlldr \ -userid=\'"${v_sysdba_connect}"\' \ +userid=\'"${DB_EXP_CONN}"\' \ control="${v_control_file}" \ errors=0 \ discardmax=0 \ diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh index a88ea0c..de72a9c 100644 --- a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh +++ b/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh @@ -26,8 +26,8 @@ v_out_prefix="${v_data_file_param%.*}" [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." -# If DB_EXP_CRED is exported, use it as the credentials. -[ -n "$DB_EXP_CRED" ] && v_sysdba_connect="$DB_EXP_CRED" || v_sysdba_connect='/ as sysdba' +# If DB_EXP_CONN is exported, use it as the credentials. +[ -z "$DB_EXP_CONN" ] && DB_EXP_CONN='/ as sysdba' echo "Loading sha256sum list. Please wait.." @@ -44,7 +44,7 @@ EOF set +e $ORACLE_HOME/bin/sqlldr \ -userid=\'"${v_sysdba_connect}"\' \ +userid=\'"${DB_EXP_CONN}"\' \ control="${v_control_file}" \ errors=0 \ discardmax=0 \ diff --git a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh index 8dbe3c0..e8e6843 100644 --- a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh +++ b/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh @@ -26,8 +26,8 @@ v_out_prefix="${v_data_file_param%.*}" [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." -# If DB_EXP_CRED is exported, use it as the credentials. -[ -n "$DB_EXP_CRED" ] && v_sysdba_connect="$DB_EXP_CRED" || v_sysdba_connect='/ as sysdba' +# If DB_EXP_CONN is exported, use it as the credentials. +[ -z "$DB_EXP_CONN" ] && DB_EXP_CONN='/ as sysdba' echo "Loading symbols list. Please wait.." @@ -44,7 +44,7 @@ EOF set +e $ORACLE_HOME/bin/sqlldr \ -userid=\'"${v_sysdba_connect}"\' \ +userid=\'"${DB_EXP_CONN}"\' \ control="${v_control_file}" \ errors=0 \ discardmax=0 \ diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh index d6c038d..036a474 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh @@ -27,8 +27,8 @@ v_out_prefix="${v_out_prefix%.*}" # Remove second extension [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." -# If DB_EXP_CRED is exported, use it as the credentials. -[ -n "$DB_EXP_CRED" ] && v_sysdba_connect="$DB_EXP_CRED" || v_sysdba_connect='/ as sysdba' +# If DB_EXP_CONN is exported, use it as the credentials. +[ -z "$DB_EXP_CONN" ] && DB_EXP_CONN='/ as sysdba' echo "Loading ORACLE_HOME non-binary files. Please wait.." @@ -44,7 +44,7 @@ tar -xf "${v_data_file_param}" -C "${v_untar_folder}" cd "${v_untar_folder}" -$ORACLE_HOME/bin/sqlplus -L -S "${v_sysdba_connect}" <= 12 then 'user_role_om' else '&P_VERS_4D.' end v_suffix from dual; +select decode('&v_internal','true','&v_suffix.','nothing') v_suffix from dual; +@@int_resources_&v_suffix..sql + +-- Load (profiles for >= 12) +select case when &P_VERS_1D >= 21 then 'prof_om' when &P_VERS_1D < 12 then 'nothing' else '&P_VERS_4D.' end v_suffix from dual; +select decode('&v_internal','true','&v_suffix.','nothing') v_suffix from dual; +@@int_resources_&v_suffix..sql + +col v_suffix clear +undef v_suffix + +commit; + +set termout on \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_drop.sql b/user_scripts/odbfcl/extract/internal_schemas/int_resources_drop.sql new file mode 100644 index 0000000..d639d99 --- /dev/null +++ b/user_scripts/odbfcl/extract/internal_schemas/int_resources_drop.sql @@ -0,0 +1 @@ +drop table &v_int_schema_tab. purge; \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_nothing.sql b/user_scripts/odbfcl/extract/internal_schemas/int_resources_nothing.sql new file mode 100644 index 0000000..fa8182f --- /dev/null +++ b/user_scripts/odbfcl/extract/internal_schemas/int_resources_nothing.sql @@ -0,0 +1,5 @@ +-------------------------------------- +-- Nothing +-------------------------------------- + +-- Do not do anything. \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_prof_om.sql b/user_scripts/odbfcl/extract/internal_schemas/int_resources_prof_om.sql new file mode 100644 index 0000000..a06cb62 --- /dev/null +++ b/user_scripts/odbfcl/extract/internal_schemas/int_resources_prof_om.sql @@ -0,0 +1,8 @@ +-------------------------------------- +-- >= 21 +-------------------------------------- + +INSERT INTO &v_int_schema_tab. (TYPE,NAME) +SELECT DISTINCT 'P',PROFILE +FROM CDB_PROFILES +WHERE ORACLE_MAINTAINED = 'YES'; \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_user_role_om.sql b/user_scripts/odbfcl/extract/internal_schemas/int_resources_user_role_om.sql new file mode 100644 index 0000000..561bcf9 --- /dev/null +++ b/user_scripts/odbfcl/extract/internal_schemas/int_resources_user_role_om.sql @@ -0,0 +1,15 @@ +-------------------------------------- +-- >= 12 +-------------------------------------- + +INSERT INTO &v_int_schema_tab. (TYPE,NAME) +SELECT DISTINCT 'U',USERNAME +FROM CDB_USERS +WHERE ORACLE_MAINTAINED = 'Y' +UNION ALL +SELECT DISTINCT 'R',ROLE +FROM CDB_ROLES +WHERE ORACLE_MAINTAINED = 'Y' +UNION ALL +SELECT 'X','PUBLIC' +FROM DUAL; \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/load_code.sql b/user_scripts/odbfcl/extract/load_code.sql index fcb1a0e..2e1eecf 100644 --- a/user_scripts/odbfcl/extract/load_code.sql +++ b/user_scripts/odbfcl/extract/load_code.sql @@ -3,22 +3,28 @@ WHENEVER SQLERROR EXIT SQL.SQLCODE -- TODO: CHANGE 2 QUERIES FOR 1 USING "INSERT ALL" insert /*+ append */ - into &v_username..DM_CODES (MD5_HASH, CODE, WRAPPED) + into &v_username..DM_CODES (MD5_HASH, CODE) select MD5_HASH, - CODE, - CASE - WHEN REGEXP_INSTR(CODE, 'wrapped', 1, 1, 0, 'i') > 0 - AND REGEXP_INSTR(CODE, 'abcd', 1, 1, 0, 'i') > 0 - THEN 'Y' - ELSE 'N' - END WRAPPED + CODE from ( select MD5_HASH, CODE, RANK() over (partition by MD5_HASH order by rowid asc) col_ind from &v_username..T_HASH_LOAD ) -where col_ind=1; +where col_ind=1 and '&v_internal' = 'false'; + +DECLARE + V_SQL VARCHAR2(32767); -- 10.2 does not support CLOB for EXECUTE IMMEDIATE +BEGIN + IF '&v_internal' = 'true' + THEN + V_SQL := 'DROP TABLE &v_username.."DM_CODES" PURGE'; + DBMS_OUTPUT.PUT_LINE(V_SQL || ';'); + EXECUTE IMMEDIATE V_SQL; + END IF; +END; +/ insert /*+ append */ into &v_username..T_HASH (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_HASH, SHA1_HASH) diff --git a/user_scripts/odbfcl/extract/load_custom.sql b/user_scripts/odbfcl/extract/load_custom.sql index 45dca76..71ee862 100644 --- a/user_scripts/odbfcl/extract/load_custom.sql +++ b/user_scripts/odbfcl/extract/load_custom.sql @@ -1,13 +1,32 @@ DECLARE V_VERS_1D NUMBER := '&P_VERS_1D.'; V_VERS_4D VARCHAR2(20) := '&P_VERS_4D.'; + V_USER VARCHAR2(30) := '&&V_USERNAME.'; - PROCEDURE RUN_INSERT (IN_TAB_NAME VARCHAR2, OUT_TAB_NAME VARCHAR2, IN_WHERE_CLAUSE_12 VARCHAR2 DEFAULT NULL, IN_WHERE_CLAUSE_11 VARCHAR2 DEFAULT NULL) + PROCEDURE RUN_INSERT (P_TGT_TABLE VARCHAR2, + P_SRC_TABLE VARCHAR2, + P_WHERE_CLAUSE_12 VARCHAR2 DEFAULT NULL, + P_WHERE_CLAUSE_11 VARCHAR2 DEFAULT NULL, + P_WHERE_INT_FILTER VARCHAR2 DEFAULT NULL) AS V_TAB_COLS VARCHAR2(32767); V_INS_COLS VARCHAR2(32767); V_SQL VARCHAR2(32767); -- 10.2 does not support CLOB for EXECUTE IMMEDIATE + V_OBJ_EXISTS NUMBER; V_CDB_CLAUSE VARCHAR2(30); + V_WHERE_ADDED BOOLEAN := FALSE; + + PROCEDURE ADD_WHERE IS + BEGIN + IF NOT V_WHERE_ADDED + THEN + V_SQL := V_SQL || ' WHERE '; + V_WHERE_ADDED := TRUE; + ELSE + V_SQL := V_SQL || ' AND '; + END IF; + END ADD_WHERE; + BEGIN IF V_VERS_1D <= 11 THEN @@ -36,51 +55,76 @@ DECLARE nvl(c2.column_name,'NULL') c2_column_name, c1.column_id from dba_tab_columns c1, dba_tab_columns c2 - where c1.table_name = OUT_TAB_NAME - and c2.table_name (+) = IN_TAB_NAME - and c1.owner = '&v_username.' + where c1.table_name = P_TGT_TABLE + and c2.table_name (+) = P_SRC_TABLE + and c1.owner = V_USER and c2.owner(+) = 'SYS' and c1.column_name = c2.column_name (+) and c1.column_name not in ('CON_ID') order by c1.column_id ); - V_SQL := 'INSERT /*+ APPEND */ INTO &v_username..' || OUT_TAB_NAME || '(' || V_TAB_COLS || V_CDB_CLAUSE || ') SELECT '; + V_SQL := 'INSERT /*+ APPEND */ INTO ' || V_USER || '.' || P_TGT_TABLE || '(' || V_TAB_COLS || V_CDB_CLAUSE || ') SELECT '; V_SQL := V_SQL || V_INS_COLS || V_CDB_CLAUSE; IF V_VERS_1D <= 11 THEN - V_SQL := V_SQL || ' FROM ' || IN_TAB_NAME; + V_SQL := V_SQL || ' FROM ' || P_SRC_TABLE; ELSIF V_VERS_4D = '12.1.0.1' THEN - V_SQL := V_SQL || ' FROM CDB$VIEW("' || IN_TAB_NAME || '")'; + V_SQL := V_SQL || ' FROM CDB$VIEW("' || P_SRC_TABLE || '")'; ELSE - V_SQL := V_SQL || ' FROM CONTAINERS(' || IN_TAB_NAME || ')'; + V_SQL := V_SQL || ' FROM CONTAINERS(' || P_SRC_TABLE || ')'; END IF; IF V_VERS_1D <= 11 THEN - IF IN_WHERE_CLAUSE_11 IS NOT NULL THEN - V_SQL := V_SQL || ' WHERE ' || IN_WHERE_CLAUSE_11; + IF P_WHERE_CLAUSE_11 IS NOT NULL THEN + ADD_WHERE; + V_SQL := V_SQL || '( ' || P_WHERE_CLAUSE_11 || ' )'; END IF; ELSE - IF IN_WHERE_CLAUSE_12 IS NOT NULL THEN - V_SQL := V_SQL || ' WHERE ' || IN_WHERE_CLAUSE_12; + IF P_WHERE_CLAUSE_12 IS NOT NULL THEN + ADD_WHERE; + V_SQL := V_SQL || '( ' || P_WHERE_CLAUSE_12 || ' )'; END IF; END IF; - DBMS_OUTPUT.PUT_LINE(V_SQL); - EXECUTE IMMEDIATE V_SQL; + IF '&v_internal' = 'true' AND P_WHERE_INT_FILTER IS NOT NULL THEN + ADD_WHERE; + V_SQL := V_SQL || '( ' || P_WHERE_INT_FILTER || ' )'; + END IF; + + SELECT COUNT(1) + INTO V_OBJ_EXISTS + FROM DBA_OBJECTS V1 + WHERE V1.OWNER = 'SYS' + AND V1.OBJECT_NAME = P_SRC_TABLE + AND OBJECT_TYPE IN ('TABLE','VIEW'); + + DBMS_OUTPUT.PUT_LINE('----------'); + IF V_OBJ_EXISTS = 1 + THEN + DBMS_OUTPUT.PUT_LINE(V_SQL || ';'); + EXECUTE IMMEDIATE V_SQL; + ELSE + DBMS_OUTPUT.PUT_LINE(P_SRC_TABLE || ' does not exist.'); + V_SQL := 'DROP TABLE ' || V_USER || '.' || P_TGT_TABLE || ' PURGE'; + DBMS_OUTPUT.PUT_LINE(V_SQL || ';'); + EXECUTE IMMEDIATE V_SQL; + END IF; END; BEGIN DBMS_OUTPUT.ENABLE(NULL); - IF V_VERS_1D > 11 THEN - RUN_INSERT ('AUDIT_UNIFIED_POLICIES','T_AUDIT_UNIFIED_POLICIES'); - RUN_INSERT ('AUDIT_UNIFIED_ENABLED_POLICIES','T_AUD_UNIFIED_ENABLED_POLICIES'); - RUN_INSERT ('AUDIT_UNIFIED_POLICY_COMMENTS','T_AUD_UNIFIED_POLICY_COMMENTS'); - END IF; - - RUN_INSERT ('OPTSTAT_HIST_CONTROL$','T_OPTSTAT_HIST_CONTROL'); + RUN_INSERT ('T_AUDIT_UNIFIED_POLICIES', + 'AUDIT_UNIFIED_POLICIES', + NULL, + NULL, + q'[OBJECT_SCHEMA = 'NONE' OR OBJECT_SCHEMA IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U')]' + ); + RUN_INSERT ('T_AUD_UNIFIED_ENABLED_POLICIES','AUDIT_UNIFIED_ENABLED_POLICIES'); + RUN_INSERT ('T_AUD_UNIFIED_POLICY_COMMENTS','AUDIT_UNIFIED_POLICY_COMMENTS'); + RUN_INSERT ('T_OPTSTAT_HIST_CONTROL','OPTSTAT_HIST_CONTROL$'); END; / \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/load_database_vault.sql b/user_scripts/odbfcl/extract/load_database_vault.sql index c848684..ee8eead 100644 --- a/user_scripts/odbfcl/extract/load_database_vault.sql +++ b/user_scripts/odbfcl/extract/load_database_vault.sql @@ -57,7 +57,7 @@ DECLARE V_SQL := V_SQL || ' FROM CONTAINERS(DVSYS.' || IN_TAB_NAME || ')'; END IF; - DBMS_OUTPUT.PUT_LINE(V_SQL); + DBMS_OUTPUT.PUT_LINE(V_SQL || ';'); EXECUTE IMMEDIATE V_SQL; END; diff --git a/user_scripts/odbfcl/extract/load_dba_cdb.sql b/user_scripts/odbfcl/extract/load_dba_cdb.sql index 3389bd4..d980aa9 100644 --- a/user_scripts/odbfcl/extract/load_dba_cdb.sql +++ b/user_scripts/odbfcl/extract/load_dba_cdb.sql @@ -2,27 +2,42 @@ DECLARE V_VERS_1D NUMBER := '&&P_VERS_1D.'; V_USER VARCHAR2(30) := '&&V_USERNAME.'; - PROCEDURE RUN_INSERT (IN_TAB_NAME VARCHAR2, - IN_WHERE_CLAUSE_12 VARCHAR2 DEFAULT NULL, - IN_WHERE_CLAUSE_11 VARCHAR2 DEFAULT NULL) + PROCEDURE RUN_INSERT (P_OBJ_SUFFIX VARCHAR2, + P_WHERE_CLAUSE_12 VARCHAR2 DEFAULT NULL, + P_WHERE_CLAUSE_11 VARCHAR2 DEFAULT NULL, + P_WHERE_INT_FILTER VARCHAR2 DEFAULT NULL) AS V_TAB_COLS VARCHAR2(32767); V_INS_COLS VARCHAR2(32767); - V_PREFIX VARCHAR2(4); V_SQL VARCHAR2(32767); -- 10.2 does not support CLOB for EXECUTE IMMEDIATE V_OBJ_EXISTS NUMBER; + V_WHERE_ADDED BOOLEAN := FALSE; + V_SRC_OBJECT VARCHAR2(100); + V_TGT_TABLE VARCHAR2(100) := 'T_' || P_OBJ_SUFFIX; + + PROCEDURE ADD_WHERE IS + BEGIN + IF NOT V_WHERE_ADDED + THEN + V_SQL := V_SQL || ' WHERE '; + V_WHERE_ADDED := TRUE; + ELSE + V_SQL := V_SQL || ' AND '; + END IF; + END ADD_WHERE; + BEGIN IF V_VERS_1D <= 11 THEN - V_PREFIX := 'DBA_'; + V_SRC_OBJECT := 'DBA_' || P_OBJ_SUFFIX; else - V_PREFIX := 'CDB_'; + V_SRC_OBJECT := 'CDB_' || P_OBJ_SUFFIX; END IF; SELECT COUNT(1) INTO V_OBJ_EXISTS FROM DBA_VIEWS V1 WHERE V1.OWNER = 'SYS' - AND V1.VIEW_NAME = V_PREFIX || IN_TAB_NAME; + AND V1.VIEW_NAME = V_SRC_OBJECT; -- ORA-12805: parallel query server died unexpectedly -- ORA-00600: internal error code, arguments: [kkdlGetBaseUser2:authIdType], [0], [104], [_NEXT_USER], [], [], [], [], [], [], [], [] @@ -46,36 +61,47 @@ DECLARE nvl(c2.column_name,'NULL') c2_column_name, c1.column_id from dba_tab_columns c1, dba_tab_columns c2 - where c1.table_name = 'T_' || in_tab_name - and c2.table_name (+) = v_prefix || in_tab_name - and c1.owner = v_user + where c1.owner = v_user + and c1.table_name = V_TGT_TABLE and c2.owner(+) = 'SYS' + and c2.table_name (+) = V_SRC_OBJECT and c1.column_name = c2.column_name (+) order by c1.column_id ); - V_SQL := 'INSERT /*+ APPEND */ INTO ' || V_USER || '.T_' || IN_TAB_NAME || '(' || V_TAB_COLS || ') SELECT '; + V_SQL := 'INSERT /*+ APPEND */ INTO ' || V_USER || '.' || V_TGT_TABLE || '(' || V_TAB_COLS || ') SELECT '; V_SQL := V_SQL || V_INS_COLS; - V_SQL := V_SQL || ' FROM ' || V_PREFIX || IN_TAB_NAME; + V_SQL := V_SQL || ' FROM ' || V_SRC_OBJECT; IF V_VERS_1D <= 11 THEN - IF IN_WHERE_CLAUSE_11 IS NOT NULL THEN - V_SQL := V_SQL || ' WHERE ' || IN_WHERE_CLAUSE_11; + IF P_WHERE_CLAUSE_11 IS NOT NULL THEN + ADD_WHERE; + V_SQL := V_SQL || '( ' || P_WHERE_CLAUSE_11 || ' )'; END IF; else - IF IN_WHERE_CLAUSE_12 IS NOT NULL THEN - V_SQL := V_SQL || ' WHERE ' || IN_WHERE_CLAUSE_12; + IF P_WHERE_CLAUSE_12 IS NOT NULL THEN + ADD_WHERE; + V_SQL := V_SQL || '( ' || P_WHERE_CLAUSE_12 || ' )'; END IF; END IF; + IF '&v_internal' = 'true' AND P_WHERE_INT_FILTER IS NOT NULL THEN + ADD_WHERE; + V_SQL := V_SQL || '( ' || P_WHERE_INT_FILTER || ' )'; + END IF; + + DBMS_OUTPUT.PUT_LINE('----------'); IF V_OBJ_EXISTS = 1 THEN - DBMS_OUTPUT.PUT_LINE(V_SQL); + DBMS_OUTPUT.PUT_LINE(V_SQL || ';'); EXECUTE IMMEDIATE V_SQL; ELSE - DBMS_OUTPUT.PUT_LINE(V_PREFIX || IN_TAB_NAME || ' does not exist.'); + DBMS_OUTPUT.PUT_LINE(V_SRC_OBJECT || ' does not exist.'); + V_SQL := 'DROP TABLE ' || V_USER || '.' || V_TGT_TABLE || ' PURGE'; + DBMS_OUTPUT.PUT_LINE(V_SQL || ';'); + EXECUTE IMMEDIATE V_SQL; END IF; END; @@ -83,78 +109,161 @@ BEGIN DBMS_OUTPUT.ENABLE(NULL); RUN_INSERT ('TAB_PRIVS', - q'[GRANTEE != '&&V_USERNAME.' AND NOT(TABLE_NAME LIKE '&&V_USERNAME.' AND PRIVILEGE='INHERIT PRIVILEGES')]', - q'[GRANTEE != '&&V_USERNAME.']' + q'[GRANTEE != '&&V_USERNAME.' + AND NOT(TABLE_NAME LIKE '&&V_USERNAME.' AND PRIVILEGE='INHERIT PRIVILEGES')]', + q'[GRANTEE != '&&V_USERNAME.']', + q'[GRANTEE IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE IN ('U','R','X')) + AND OWNER IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U') + AND NOT (PRIVILEGE = 'INHERIT PRIVILEGES' AND TABLE_NAME NOT IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE IN ('U','X')))]' ); + RUN_INSERT ('COL_PRIVS', q'[GRANTEE != '&&V_USERNAME.']', - q'[GRANTEE != '&&V_USERNAME.']' + q'[GRANTEE != '&&V_USERNAME.']', + q'[GRANTEE IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE IN ('U','R','X')) + AND OWNER IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U')]' ); + RUN_INSERT ('SYS_PRIVS', q'[GRANTEE != '&&V_USERNAME.']', - q'[GRANTEE != '&&V_USERNAME.']' + q'[GRANTEE != '&&V_USERNAME.']', + q'[GRANTEE IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE IN ('U','R','X'))]' ); + RUN_INSERT ('ROLE_PRIVS', q'[GRANTEE != '&&V_USERNAME.']', - q'[GRANTEE != '&&V_USERNAME.']' + q'[GRANTEE != '&&V_USERNAME.']', + q'[GRANTEE IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE IN ('U','R','X')) + AND GRANTED_ROLE IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE IN ('R','X'))]' ); - RUN_INSERT ('JAVA_POLICY'); + RUN_INSERT ('JAVA_POLICY', + NULL, + NULL, + q'[GRANTEE IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE IN ('U','R','X')) + AND TYPE_SCHEMA IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U')]' + ); - RUN_INSERT ('JOBS'); + RUN_INSERT ('JOBS', + NULL, + NULL, + q'[SCHEMA_USER IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U')]' + ); RUN_INSERT ('TS_QUOTAS', q'[USERNAME != '&&V_USERNAME.']', - q'[USERNAME != '&&V_USERNAME.']' + q'[USERNAME != '&&V_USERNAME.']', + q'[USERNAME IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U')]' ); - RUN_INSERT ('POLICIES'); + RUN_INSERT ('POLICIES', + NULL, + NULL, + q'[OBJECT_OWNER IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U')]' + ); - RUN_INSERT ('TRIGGERS'); + RUN_INSERT ('TRIGGERS', + NULL, + NULL, + q'[OWNER IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U')]' + ); - RUN_INSERT ('SCHEDULER_JOBS'); + RUN_INSERT ('SCHEDULER_JOBS', + NULL, + NULL, + q'[OWNER IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U')]' + ); - RUN_INSERT ('SCHEDULER_PROGRAMS'); + RUN_INSERT ('SCHEDULER_PROGRAMS', + NULL, + NULL, + q'[OWNER IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U')]' + ); - RUN_INSERT ('OBJ_AUDIT_OPTS'); + RUN_INSERT ('OBJ_AUDIT_OPTS', + NULL, + NULL, + q'[OWNER IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U')]' + ); - RUN_INSERT ('STMT_AUDIT_OPTS'); + RUN_INSERT ('STMT_AUDIT_OPTS', + NULL, + NULL, + q'[USER_NAME IS NULL OR USER_NAME IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U')]' + ); - RUN_INSERT ('PRIV_AUDIT_OPTS'); + RUN_INSERT ('PRIV_AUDIT_OPTS', + NULL, + NULL, + q'[USER_NAME IS NULL OR USER_NAME IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U')]' + ); - RUN_INSERT ('AUDIT_POLICIES'); + RUN_INSERT ('AUDIT_POLICIES', + NULL, + NULL, + q'[OBJECT_SCHEMA IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U') + &skip_ver_le_10_s. + AND POLICY_OWNER IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U') + &skip_ver_le_10_e.]' + ); - RUN_INSERT ('AUDIT_POLICY_COLUMNS'); + RUN_INSERT ('AUDIT_POLICY_COLUMNS', + NULL, + NULL, + q'[OBJECT_SCHEMA IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U')]' + ); RUN_INSERT ('DIRECTORIES', q'[DIRECTORY_NAME != '&&V_DIRECTORY.']', - q'[DIRECTORY_NAME != '&&V_DIRECTORY.']' + q'[DIRECTORY_NAME != '&&V_DIRECTORY.']', + q'[OWNER IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U')]' ); - RUN_INSERT ('PROCEDURES'); + RUN_INSERT ('PROCEDURES', + NULL, + NULL, + q'[OWNER IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U')]' + ); RUN_INSERT ('SYNONYMS', q'[ORIGIN_CON_ID=CON_ID]', - NULL + NULL, + q'[OWNER IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE IN ('U','X')) + AND ( + TABLE_OWNER IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U') OR + (TABLE_OWNER = 'DVSYS' AND '&&P_VERS_4D.' = '11.2.0.4') OR + (TABLE_OWNER = 'DBMS_PRIVILEGE_CAPTURE' AND '&&P_VERS_4D.' IN ('12.1.0.1','12.1.0.2')) + )]' ); RUN_INSERT ('USERS', q'[USERNAME != '&&V_USERNAME.']', - q'[USERNAME != '&&V_USERNAME.']' + q'[USERNAME != '&&V_USERNAME.']', + q'[USERNAME IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U')]' ); - RUN_INSERT ('ROLES'); + RUN_INSERT ('ROLES', + NULL, + NULL, + q'[ROLE IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'R')]' + ); - RUN_INSERT ('PROFILES'); + RUN_INSERT ('PROFILES', + NULL, + NULL, + q'[PROFILE IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'P')]' + ); RUN_INSERT ('OBJECTS', q'[OWNER != '&&V_USERNAME.' AND NOT (OWNER='SYS' AND OBJECT_NAME='&&V_DIRECTORY.' AND OBJECT_TYPE='DIRECTORY')]', - q'[OWNER != '&&V_USERNAME.' AND NOT (OWNER='SYS' AND OBJECT_NAME='&&V_DIRECTORY.' AND OBJECT_TYPE='DIRECTORY')]' + q'[OWNER != '&&V_USERNAME.' AND NOT (OWNER='SYS' AND OBJECT_NAME='&&V_DIRECTORY.' AND OBJECT_TYPE='DIRECTORY')]', + q'[OWNER IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE IN ('U','X'))]' ); RUN_INSERT ('TAB_COLUMNS', q'[OWNER != '&&V_USERNAME.']', - q'[OWNER != '&&V_USERNAME.']' + q'[OWNER != '&&V_USERNAME.']', + q'[OWNER IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U')]' ); RUN_INSERT ('REGISTRY'); diff --git a/user_scripts/odbfcl/extract/load_source.sql b/user_scripts/odbfcl/extract/load_source.sql index 7e164ac..a407b6a 100644 --- a/user_scripts/odbfcl/extract/load_source.sql +++ b/user_scripts/odbfcl/extract/load_source.sql @@ -13,6 +13,7 @@ DECLARE MAX(LINE) OVER (PARTITION BY OWNER, NAME, TYPE) LAST_LINE, TEXT FROM DBA_SOURCE + WHERE (OWNER IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U') or '&v_internal' = 'false') ORDER BY OWNER, NAME, TYPE, LINE ASC; $ELSE CURSOR OBJS IS @@ -24,11 +25,13 @@ DECLARE LINE, MAX(LINE) OVER (PARTITION BY OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID) LAST_LINE, TEXT - FROM CDB_SOURCE WHERE ORIGIN_CON_ID=CON_ID -- AND CON_ID IN (1,2) + FROM CDB_SOURCE + WHERE ORIGIN_CON_ID=CON_ID -- AND CON_ID IN (1,2) + AND (OWNER IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U') or '&v_internal' = 'false') ORDER BY OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, LINE ASC; $END BEGIN - VCODE := ''; -- Zera a variável + VCODE := ''; -- Reset var FOR I IN OBJS LOOP VCODE := VCODE || I.TEXT; @@ -36,7 +39,7 @@ BEGIN INSERT INTO &v_username..T_HASH_LOAD (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_HASH, SHA1_HASH, CODE) VALUES (I.OWNER, I.NAME, I.TYPE, I.ORIGIN_CON_ID, I.CON_ID, SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_MD5), SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_SH1), VCODE); - VCODE := ''; -- Zera a variável + VCODE := ''; -- Reset var END IF; END LOOP; END; diff --git a/user_scripts/odbfcl/extract/load_v_dollar.sql b/user_scripts/odbfcl/extract/load_v_dollar.sql index ef0f835..2318da0 100644 --- a/user_scripts/odbfcl/extract/load_v_dollar.sql +++ b/user_scripts/odbfcl/extract/load_v_dollar.sql @@ -1,10 +1,11 @@ DECLARE V_VERS_1D NUMBER := '&P_VERS_1D.'; + V_USER VARCHAR2(30) := '&&V_USERNAME.'; - PROCEDURE RUN_INSERT (OUT_TAB_NAME VARCHAR2, - IN_TAB_NAME VARCHAR2, - IN_WHERE_CLAUSE_12 VARCHAR2 DEFAULT NULL, - IN_WHERE_CLAUSE_11 VARCHAR2 DEFAULT NULL) + PROCEDURE RUN_INSERT (P_TGT_TABLE VARCHAR2, + P_SRC_TABLE VARCHAR2, + P_WHERE_CLAUSE_12 VARCHAR2 DEFAULT NULL, + P_WHERE_CLAUSE_11 VARCHAR2 DEFAULT NULL) AS V_TAB_COLS VARCHAR2(32767); V_INS_COLS VARCHAR2(32767); @@ -16,7 +17,7 @@ DECLARE INTO V_OBJ_EXISTS FROM DBA_OBJECTS V1 WHERE V1.OWNER = 'SYS' - AND V1.OBJECT_NAME = IN_TAB_NAME; + AND V1.OBJECT_NAME = P_SRC_TABLE; $IF DBMS_DB_VERSION.VER_LE_10_2 $THEN @@ -36,36 +37,40 @@ DECLARE nvl(c2.column_name,'NULL') c2_column_name, c1.column_id from dba_tab_columns c1, dba_tab_columns c2 - where c1.table_name = OUT_TAB_NAME - and c2.table_name (+) = IN_TAB_NAME - and c1.owner = '&v_username.' + where c1.owner = V_USER + and c1.table_name = P_TGT_TABLE and c2.owner(+) = 'SYS' + and c2.table_name (+) = P_SRC_TABLE and c1.column_name = c2.column_name (+) order by c1.column_id ); - V_SQL := 'INSERT /*+ APPEND */ INTO &v_username..' || OUT_TAB_NAME || '(' || V_TAB_COLS || ') SELECT '; + V_SQL := 'INSERT /*+ APPEND */ INTO ' || V_USER || '.' || P_TGT_TABLE || '(' || V_TAB_COLS || ') SELECT '; V_SQL := V_SQL || V_INS_COLS; - V_SQL := V_SQL || ' FROM ' || IN_TAB_NAME; + V_SQL := V_SQL || ' FROM ' || P_SRC_TABLE; IF V_VERS_1D <= 11 THEN - IF IN_WHERE_CLAUSE_11 IS NOT NULL THEN - V_SQL := V_SQL || ' WHERE ' || IN_WHERE_CLAUSE_11; + IF P_WHERE_CLAUSE_11 IS NOT NULL THEN + V_SQL := V_SQL || ' WHERE ' || P_WHERE_CLAUSE_11; END IF; else - IF IN_WHERE_CLAUSE_12 IS NOT NULL THEN - V_SQL := V_SQL || ' WHERE ' || IN_WHERE_CLAUSE_12; + IF P_WHERE_CLAUSE_12 IS NOT NULL THEN + V_SQL := V_SQL || ' WHERE ' || P_WHERE_CLAUSE_12; END IF; END IF; + DBMS_OUTPUT.PUT_LINE('----------'); IF V_OBJ_EXISTS = 1 THEN - DBMS_OUTPUT.PUT_LINE(V_SQL); + DBMS_OUTPUT.PUT_LINE(V_SQL || ';'); EXECUTE IMMEDIATE V_SQL; ELSE - DBMS_OUTPUT.PUT_LINE(IN_TAB_NAME || ' does not exist.'); + DBMS_OUTPUT.PUT_LINE(P_SRC_TABLE || ' does not exist.'); + V_SQL := 'DROP TABLE ' || V_USER || '.' || P_TGT_TABLE || ' PURGE'; + DBMS_OUTPUT.PUT_LINE(V_SQL || ';'); + EXECUTE IMMEDIATE V_SQL; END IF; END; diff --git a/user_scripts/odbfcl/extract/load_view.sql b/user_scripts/odbfcl/extract/load_view.sql index c11ca30..7b8ad94 100644 --- a/user_scripts/odbfcl/extract/load_view.sql +++ b/user_scripts/odbfcl/extract/load_view.sql @@ -1,17 +1,10 @@ DECLARE VCODE CLOB; - VSID VARCHAR2(30) := 'VIEW_TESTE'; CURSOR OBJS IS - SELECT OBJECT_OWNER OWNER, - OBJECT_NAME NAME, - OBJECT_TYPE TYPE, - ID CON_ID, - PARENT_ID ORIGIN_CON_ID, - OTHER_XML TEXT - FROM PLAN_TABLE - WHERE STATEMENT_ID = VSID-- and rownum < 1000; - ORDER BY 1,2; + SELECT OWNER, ROWID, CODE + FROM &v_username..T_HASH_LOAD + WHERE TYPE = 'VIEW'; FUNCTION replaceClob ( srcClob IN CLOB, @@ -46,51 +39,57 @@ BEGIN $IF DBMS_DB_VERSION.VERSION <= 11 $THEN - INSERT INTO PLAN_TABLE (STATEMENT_ID, OBJECT_OWNER, OBJECT_NAME, OBJECT_TYPE, ID, PARENT_ID, OTHER_XML) - SELECT VSID, - OWNER, + INSERT INTO &v_username..T_HASH_LOAD (OWNER, NAME, TYPE, CON_ID, ORIGIN_CON_ID, CODE, MD5_HASH, SHA1_HASH) + SELECT OWNER, VIEW_NAME, 'VIEW', NULL CON_ID, NULL ORIGIN_CON_ID, - TO_LOB(TEXT) - FROM DBA_VIEWS; + TO_LOB(TEXT), + '0', + '0' + FROM DBA_VIEWS + WHERE (OWNER IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U') or '&v_internal' = 'false'); $ELSE - INSERT INTO PLAN_TABLE (STATEMENT_ID, OBJECT_OWNER, OBJECT_NAME, OBJECT_TYPE, ID, PARENT_ID, OTHER_XML) - SELECT VSID, - OWNER, + INSERT INTO &v_username..T_HASH_LOAD (OWNER, NAME, TYPE, CON_ID, ORIGIN_CON_ID, CODE, MD5_HASH, SHA1_HASH) + SELECT OWNER, VIEW_NAME, 'VIEW', SYS_CONTEXT('USERENV','CON_ID') CON_ID, ORIGIN_CON_ID, - TO_LOB(TEXT) - FROM DBA_VIEWS; + TO_LOB(TEXT), + '0', + '0' + FROM DBA_VIEWS + WHERE (OWNER IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U') or '&v_internal' = 'false'); - INSERT INTO PLAN_TABLE (STATEMENT_ID, OBJECT_OWNER, OBJECT_NAME, OBJECT_TYPE, ID, PARENT_ID, OTHER_XML) - SELECT VSID, - OWNER, + INSERT INTO &v_username..T_HASH_LOAD (OWNER, NAME, TYPE, CON_ID, ORIGIN_CON_ID, CODE, MD5_HASH, SHA1_HASH) + SELECT OWNER, VIEW_NAME, 'VIEW', CON_ID, ORIGIN_CON_ID, - TEXT_VC + TEXT_VC, + '0', + '0' FROM CDB_VIEWS WHERE CON_ID <> SYS_CONTEXT('USERENV','CON_ID') -- AND CON_ID IN (1,2) - AND ORIGIN_CON_ID = CON_ID; + AND ORIGIN_CON_ID = CON_ID + AND (OWNER IN (SELECT NAME FROM &v_int_schema_tab. WHERE TYPE = 'U') or '&v_internal' = 'false'); $END FOR I IN OBJS LOOP - VCODE := UPPER(I.TEXT); + VCODE := UPPER(I.CODE); VCODE := replaceClob(VCODE,'[[:space:]]*',''); -- Remove all space characters VCODE := replaceClob(VCODE,'"',''); -- Remove all quotes - INSERT INTO &v_username..T_HASH_LOAD - (OWNER, NAME, TYPE, ORIGIN_CON_ID, CON_ID, MD5_HASH, SHA1_HASH, CODE) - VALUES - (I.OWNER, I.NAME, I.TYPE, I.ORIGIN_CON_ID, I.CON_ID, SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_MD5), SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_SH1), I.TEXT); + UPDATE &v_username..T_HASH_LOAD + SET MD5_HASH = SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_MD5), + SHA1_HASH = SYS.DBMS_CRYPTO.HASH(VCODE, SYS.DBMS_CRYPTO.HASH_SH1) + WHERE ROWID = I.ROWID; END LOOP; - DELETE FROM PLAN_TABLE WHERE STATEMENT_ID = VSID; + END; / \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/tables_drop.sql b/user_scripts/odbfcl/extract/tables_drop.sql new file mode 100644 index 0000000..5d53be9 --- /dev/null +++ b/user_scripts/odbfcl/extract/tables_drop.sql @@ -0,0 +1,21 @@ +-- drop table for internal objects +@@internal_schemas/int_resources_drop.sql + +-- drop non-loaded tables when internal mode is used +DECLARE + TYPE V_STR_LIST IS TABLE OF VARCHAR2(30); + V_LIST V_STR_LIST; + V_SQL VARCHAR2(32767); -- 10.2 does not support CLOB for EXECUTE IMMEDIATE +BEGIN + V_LIST := V_STR_LIST('DM_CONTENTS', 'T_TXTCOLLECTION', 'T_SYMBOLS'); + IF '&v_internal' = 'true' + THEN + FOR I IN V_LIST.FIRST .. V_LIST.LAST + LOOP + V_SQL := 'DROP TABLE &v_username..' || V_LIST(I) || ' PURGE'; + DBMS_OUTPUT.PUT_LINE(V_SQL || ';'); + EXECUTE IMMEDIATE V_SQL; + END LOOP; + END IF; +END; +/ \ No newline at end of file diff --git a/user_scripts/odbfcl/extract/version_filter.sql b/user_scripts/odbfcl/extract/version_filter.sql new file mode 100644 index 0000000..a2bf646 --- /dev/null +++ b/user_scripts/odbfcl/extract/version_filter.sql @@ -0,0 +1,31 @@ +------------------------------- + +set termout off + +-- Set version variables. Value will be 'Y' or 'N' +COL is_ver_le_10 new_v is_ver_le_10 nopri + +select -- Lower or Equal + case when version <= 10 then 'Y' else 'N' end is_ver_le_10 +from (select to_number(substr(version,1,instr(version,'.')-1)) version + , to_number(substr(version,instr(version,'.')+1, instr(version,'.',1,2)-instr(version,'.')-1)) release + , to_number(substr(version,instr(version,'.',1,2)+1, instr(version,'.',1,3)-instr(version,'.',1,2)-1)) server + , to_number(substr(version,instr(version,'.',1,3)+1, instr(version,'.',1,4)-instr(version,'.',1,3)-1)) component + from v$instance); + +COL is_ver_le_10 clear + +COL skip_ver_le_10_s new_v skip_ver_le_10_s nopri +COL skip_ver_le_10_e new_v skip_ver_le_10_e nopri + +select -- Lower or Equal + decode('&&is_ver_le_10.','Y','/*','N','') skip_ver_le_10_s, + decode('&&is_ver_le_10.','Y','*/','N','') skip_ver_le_10_e +from dual; + +COL skip_ver_le_10_s clear +COL skip_ver_le_10_e clear + +set termout on + +------------------------------- diff --git a/user_scripts/odbfcl/runExtractor.yml b/user_scripts/odbfcl/runExtractor.yml index 7b8f2fe..965e503 100644 --- a/user_scripts/odbfcl/runExtractor.yml +++ b/user_scripts/odbfcl/runExtractor.yml @@ -7,6 +7,7 @@ export ORACLE_SID export DB_EXP_GEN_DUMP=false export DB_EXP_IGNORE_ERROR=false + export DB_EXP_INTERNAL_ONLY=false export DB_EXP_USER_PASS="{{ dump_pass }}" [ ! -d ~/exporter_logs ] && mkdir ~/exporter_logs sh "{{ VM_folder }}/user_scripts/odbfcl/sh_extractor/exporter.sh" db 2>&1 | tee ~/exporter_logs/{{ file_suffix }}.log diff --git a/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh b/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh index d5133b3..0960a3a 100644 --- a/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh +++ b/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh @@ -21,11 +21,14 @@ v_dump_user_name="$1" [ -z "$ORACLE_HOME" ] && exitError "\$ORACLE_HOME is unset." [ -z "$ORACLE_SID" ] && exitError "\$ORACLE_SID is unset." -# If DB_EXP_CRED is exported, use it. -[ -n "$DB_EXP_CRED" ] && v_sysdba_connect="$DB_EXP_CRED" || v_sysdba_connect='/ as sysdba' +# If DB_EXP_CONN is exported, use it. +[ -z "$DB_EXP_CONN" ] && DB_EXP_CONN='/ as sysdba' # If DB_EXP_DIRECTORY is exported, use it. -[ -n "$DB_EXP_DIRECTORY" ] && v_dump_dir_name=$DB_EXP_DIRECTORY || v_dump_dir_name='expdir_hash' +[ -z "$DB_EXP_DIRECTORY" ] && DB_EXP_DIRECTORY='expdir_oradiff' + +# If DB_EXP_INTERNAL_ONLY is exported, use it. +[ -z "$DB_EXP_INTERNAL_ONLY" ] && DB_EXP_INTERNAL_ONLY='true' v_thisdir="$(cd "$(dirname "$0")"; pwd)" cd "${v_thisdir}" @@ -33,8 +36,8 @@ cd "${v_thisdir}" echo "Generating table export. Please wait.." cd "${v_thisdir}"/../extract # REMOVE_IF_ZIP -$ORACLE_HOME/bin/sqlplus -L -S "${v_sysdba_connect}" <&1 set +e $ORACLE_HOME/bin/expdp \ -userid="${v_dump_user_name}/${v_dump_user_pass}" \ -directory=${v_dump_dir_name} \ +userid="${v_dump_user_name}/${DB_EXP_USER_PASS}" \ +directory=${DB_EXP_DIRECTORY} \ "${v_compress_alg}" \ dumpfile="${v_out_file_name}" \ logfile="${v_out_file_name_noext}.log" \ @@ -118,9 +118,9 @@ fi [ -f "${v_err_file_full}" ] && rm -f "${v_err_file_full}" cd odbfcl/sh_extractor/ # REMOVE_IF_ZIP -$ORACLE_HOME/bin/sqlplus -L -S "${v_sysdba_connect}" < +[ -z "$v_pattern" -o "$#" -ne 1 -o "$v_pattern" = "-help" ] && echoError "Usage: $0 | -help -First parameter is the output file name and cannot be null. +Example: + + \$ $0 ${v_example} -Eg: $0 ${v_example} + The output will be a zip file named '${v_example}.zip'. -The output is a zip file. +ORAdiff exporter will collect all metadata information from the database, +to be loaded in the ORAdiff utility for comparison with another patch set, +including another custom patch set you already loaded. -Environment Variables: +First parameter is the output file name and cannot be null. +" - DB_EXP_MERGE_DUMP +[ -z "$v_pattern" ] && echoError "The behaviour of the ORAdiff exporter can be changed by exporting +some environment variables. (Use -help for more details)" - The generated ORACLE_HOME related files (bugs, symbols, chksum, etc) - will be loaded on DB tables, not added to zip as separate files. +[ "$v_pattern" = "-help" ] && echoError "The behaviour of the ORAdiff exporter can be changed by exporting +some environment variables described below. - Accepted values: 'true' or 'false'. - Default value: '${v_def_load_file}' +Environment Variables: DB_EXP_GEN_DUMP - If schema is exported after being populated. + If ORAdiff schema is exported after being populated. If set to false, + the code will only populate the DB schema and stop. Accepted values: 'true' or 'false'. Default value: '${v_def_gen_dump}' DB_EXP_IGNORE_ERROR - Code will ignore critical errors. + Code will ignore critical errors and move forward. Accepted values: 'true' or 'false'. Default value: '${v_def_ignore_error}' - DB_EXP_CRED + DB_EXP_CONN SQL*Plus connect string. @@ -79,32 +86,33 @@ Environment Variables: DB_EXP_USER - Schema inside the database that will temporarily hold the oradiff data. + Schema inside the database that will temporarily hold the ORAdiff data + before it is exported. Default value: '${v_def_dump_user_name}' DB_EXP_USER_PASS - Password for the temporary schema that will temporarily hold the oradiff data. + Password for the temporary ORAdiff schema. Default value: '${v_def_dump_user_pass}' DB_EXP_USER_TBS - Default permanent tablespace for the temporary schema. + Default permanent tablespace for the temporary ORAdiff schema. Default value: '${v_def_dump_user_tbs}' DB_EXP_USER_TEMP - Default temp tablespace for the temporary schema. + Default temp tablespace for the temporary ORAdiff schema. Default value: '${v_def_dump_user_temp}' DB_EXP_DIRECTORY Temporary directory that will be created to export the genetared data. - Only valid when DB_EXP_GEN_DUMP=true. + Only applicable when DB_EXP_GEN_DUMP=true. Default value: '${v_def_dump_exp_dir}' @@ -119,15 +127,25 @@ Environment Variables: DB_EXP_INTERNAL_ONLY - If we want to retrieve dictionary info of full database or just internal - oracle maintained schemas. + Retrieve dictionary info of all DB schemas or just internal + oracle maintained schemas. If 'true', will also skip collecting + ORACLE_HOME files and symbols. Accepted values: 'true' or 'false'. Default value: '${v_def_dump_int_only}' + DB_EXP_MERGE_DUMP + + The generated ORACLE_HOME related files (bugs, symbols, chksum, etc) + will be loaded on DB tables, not added to zip as separate files. + + Accepted values: 'true' or 'false'. + Default value: '${v_def_load_file}' " +[ -z "$v_pattern" -o "$#" -ne 1 -o "$v_pattern" = "-help" ] && exit 1 + ################### # Check variables # ################### @@ -138,14 +156,14 @@ Environment Variables: # If DB_EXP_MERGE_DUMP=false, then the generated ORACLE_HOME related files (bugs, symbols, chksum, etc) won't be loaded on DB tables, but added to zip as separate files. if [ -z "$DB_EXP_MERGE_DUMP" ] then - v_load_file=${v_def_load_file} - echoDebug "Note: Variable 'DB_EXP_MERGE_DUMP' was not exported. Assigning DB_EXP_MERGE_DUMP=${v_load_file} (default)." + DB_EXP_MERGE_DUMP=${v_def_load_file} + echoDebug "Note: Variable 'DB_EXP_MERGE_DUMP' was not exported. Assigning DB_EXP_MERGE_DUMP=${DB_EXP_MERGE_DUMP} (default)." else - v_load_file=$(echo "${DB_EXP_MERGE_DUMP}" | tr '[:upper:]' '[:lower:]') - echo "Note: DB_EXP_MERGE_DUMP=${v_load_file} (provided)." + DB_EXP_MERGE_DUMP=$(echo "${DB_EXP_MERGE_DUMP}" | tr '[:upper:]' '[:lower:]') + echo "Note: DB_EXP_MERGE_DUMP=${DB_EXP_MERGE_DUMP} (provided)." fi -if [ "${v_load_file}" != "false" -a "${v_load_file}" != "true" ] +if [ "${DB_EXP_MERGE_DUMP}" != "false" -a "${DB_EXP_MERGE_DUMP}" != "true" ] then exitError "DB_EXP_MERGE_DUMP must be 'true' or 'false'." fi @@ -153,14 +171,14 @@ fi # If DB_EXP_GEN_DUMP=false, then nothing will be exported. Only the schema populated. if [ -z "$DB_EXP_GEN_DUMP" ] then - v_gen_dump=${v_def_gen_dump} - echoDebug "Note: Variable 'DB_EXP_GEN_DUMP' was not exported. Assigning DB_EXP_GEN_DUMP=${v_gen_dump} (default)." + DB_EXP_GEN_DUMP=${v_def_gen_dump} + echoDebug "Note: Variable 'DB_EXP_GEN_DUMP' was not exported. Assigning DB_EXP_GEN_DUMP=${DB_EXP_GEN_DUMP} (default)." else - v_gen_dump=$(echo "${DB_EXP_GEN_DUMP}" | tr '[:upper:]' '[:lower:]') - echo "Note: DB_EXP_GEN_DUMP=${v_gen_dump} (provided)." + DB_EXP_GEN_DUMP=$(echo "${DB_EXP_GEN_DUMP}" | tr '[:upper:]' '[:lower:]') + echo "Note: DB_EXP_GEN_DUMP=${DB_EXP_GEN_DUMP} (provided)." fi -if [ "${v_gen_dump}" != "false" -a "${v_gen_dump}" != "true" ] +if [ "${DB_EXP_GEN_DUMP}" != "false" -a "${DB_EXP_GEN_DUMP}" != "true" ] then exitError "DB_EXP_GEN_DUMP must be 'true' or 'false'." fi @@ -168,42 +186,57 @@ fi # If DB_EXP_IGNORE_ERROR=false, the code will stop on some critical errors. if [ -z "$DB_EXP_IGNORE_ERROR" ] then - v_ignore_error=${v_def_ignore_error} - echoDebug "Note: Variable 'DB_EXP_IGNORE_ERROR' was not exported. Assigning DB_EXP_IGNORE_ERROR=${v_ignore_error} (default)." + DB_EXP_IGNORE_ERROR=${v_def_ignore_error} + echoDebug "Note: Variable 'DB_EXP_IGNORE_ERROR' was not exported. Assigning DB_EXP_IGNORE_ERROR=${DB_EXP_IGNORE_ERROR} (default)." else - v_ignore_error=$(echo "${DB_EXP_IGNORE_ERROR}" | tr '[:upper:]' '[:lower:]') - echo "Note: DB_EXP_IGNORE_ERROR=${v_ignore_error} (provided)." + DB_EXP_IGNORE_ERROR=$(echo "${DB_EXP_IGNORE_ERROR}" | tr '[:upper:]' '[:lower:]') + echo "Note: DB_EXP_IGNORE_ERROR=${DB_EXP_IGNORE_ERROR} (provided)." fi -if [ "${v_ignore_error}" != "false" -a "${v_ignore_error}" != "true" ] +if [ "${DB_EXP_IGNORE_ERROR}" != "false" -a "${DB_EXP_IGNORE_ERROR}" != "true" ] then exitError "DB_EXP_IGNORE_ERROR must be 'true' or 'false'." fi -# If DB_EXP_CRED is exported, then connect using this string instead of '/ as sysdba'. -if [ -z "$DB_EXP_CRED" ] +# If DB_EXP_VERBOSE=true, the code will print detailed steps. +if [ -z "$DB_EXP_VERBOSE" ] +then + DB_EXP_VERBOSE=${v_def_ignore_error} + echoDebug "Note: Variable 'DB_EXP_VERBOSE' was not exported. Assigning DB_EXP_VERBOSE=${DB_EXP_VERBOSE} (default)." +else + DB_EXP_VERBOSE=$(echo "${DB_EXP_VERBOSE}" | tr '[:upper:]' '[:lower:]') + echo "Note: DB_EXP_VERBOSE=${DB_EXP_VERBOSE} (provided)." +fi + +if [ "${DB_EXP_VERBOSE}" != "false" -a "${DB_EXP_VERBOSE}" != "true" ] +then + exitError "DB_EXP_VERBOSE must be 'true' or 'false'." +fi + +# If DB_EXP_CONN is exported, then connect using this string instead of '/ as sysdba'. +if [ -z "$DB_EXP_CONN" ] then - v_sysdba_connect=${v_def_sysdba_connect} # To be used by child shells. - DB_EXP_CRED=${v_sysdba_connect} - export DB_EXP_CRED - echoDebug "Note: Variable 'DB_EXP_CRED' was not exported. Assigning DB_EXP_CRED='${v_sysdba_connect}' (default)." + DB_EXP_CONN=${v_def_sysdba_connect} + export DB_EXP_CONN + echoDebug "Note: Variable 'DB_EXP_CONN' was not exported. Assigning DB_EXP_CONN='${DB_EXP_CONN}' (default)." else - v_sysdba_connect="${DB_EXP_CRED}" - echo "Note: DB_EXP_CRED (provided)." + DB_EXP_CONN="${DB_EXP_CONN}" + echo "Note: DB_EXP_CONN (provided)." fi -# If DB_EXP_USER defines the user inside the database to export the oradiff data. +# If DB_EXP_USER defines the user inside the database to export the ORAdiff data. if [ -z "$DB_EXP_USER" ] then - v_dump_user_name=${v_def_dump_user_name} - echoDebug "Note: Variable 'DB_EXP_USER' was not exported. Assigning DB_EXP_USER='${v_dump_user_name}' (default)." + DB_EXP_USER=${v_def_dump_user_name} + export DB_EXP_USER + echoDebug "Note: Variable 'DB_EXP_USER' was not exported. Assigning DB_EXP_USER='${DB_EXP_USER}' (default)." else - v_dump_user_name=$(echo "${v_dump_user_name}" | tr '[:upper:]' '[:lower:]') + DB_EXP_USER=$(echo "${DB_EXP_USER}" | tr '[:upper:]' '[:lower:]') echo "Note: DB_EXP_USER (provided)." fi -# If DB_EXP_USER_PASS defines the user password inside the database to export the oradiff data. +# If DB_EXP_USER_PASS defines the user password inside the database to export the ORAdiff data. if [ -z "$DB_EXP_USER_PASS" ] then # To be used by child shells. @@ -214,7 +247,7 @@ else echo "Note: DB_EXP_USER_PASS (provided)." fi -# If DB_EXP_USER_TBS defines the user tablespace inside the database to export the oradiff data. +# If DB_EXP_USER_TBS defines the user tablespace inside the database to export the ORAdiff data. if [ -z "$DB_EXP_USER_TBS" ] then # To be used by child shells. @@ -225,7 +258,7 @@ else echo "Note: DB_EXP_USER_TBS (provided)." fi -# If DB_EXP_USER_TEMP defines the user temp tablespace inside the database to export the oradiff data. +# If DB_EXP_USER_TEMP defines the user temp tablespace inside the database to export the ORAdiff data. if [ -z "$DB_EXP_USER_TEMP" ] then # To be used by child shells. @@ -236,7 +269,7 @@ else echo "Note: DB_EXP_USER_TEMP (provided)." fi -# If DB_EXP_DIRECTORY defines the directory name inside the database to export the oradiff data. +# If DB_EXP_DIRECTORY defines the directory name inside the database to export the ORAdiff data. if [ -z "$DB_EXP_DIRECTORY" ] then # To be used by child shells. @@ -247,7 +280,7 @@ else echo "Note: DB_EXP_DIRECTORY (provided)." fi -# If DB_EXP_COMPRESS defines if compression can be used to export the oradiff data. +# If DB_EXP_COMPRESS defines if compression can be used to export the ORAdiff data. if [ -z "$DB_EXP_COMPRESS" ] then # To be used by child shells. @@ -255,6 +288,7 @@ then export DB_EXP_COMPRESS echoDebug "Note: Variable 'DB_EXP_COMPRESS' was not exported. Assigning DB_EXP_COMPRESS='${DB_EXP_COMPRESS}' (default)." else + DB_EXP_COMPRESS=$(echo "${DB_EXP_COMPRESS}" | tr '[:upper:]' '[:lower:]') echo "Note: DB_EXP_COMPRESS (provided)." fi @@ -263,7 +297,7 @@ then exitError "DB_EXP_COMPRESS must be 'true' or 'false'." fi -# If DB_EXP_INTERNAL_ONLY defines if we filter for internal schemas during export of oradiff data. +# If DB_EXP_INTERNAL_ONLY defines if we filter for internal schemas during export of ORAdiff data. if [ -z "$DB_EXP_INTERNAL_ONLY" ] then # To be used by child shells. @@ -271,6 +305,7 @@ then export DB_EXP_INTERNAL_ONLY echoDebug "Note: Variable 'DB_EXP_INTERNAL_ONLY' was not exported. Assigning DB_EXP_INTERNAL_ONLY='${DB_EXP_INTERNAL_ONLY}' (default)." else + DB_EXP_INTERNAL_ONLY=$(echo "${DB_EXP_INTERNAL_ONLY}" | tr '[:upper:]' '[:lower:]') echo "Note: DB_EXP_INTERNAL_ONLY (provided)." fi @@ -279,8 +314,8 @@ then exitError "DB_EXP_INTERNAL_ONLY must be 'true' or 'false'." fi -# Check if v_dump_user_name is the default. If it is, we drop it before and after. -if [ "$v_def_dump_user_name" = "$v_dump_user_name" ] +# Check if DB_EXP_USER is the default. If it is, we drop it before and after. +if [ "$v_def_dump_user_name" = "$DB_EXP_USER" ] then v_drop_dump_user=true else @@ -292,14 +327,14 @@ v_pattern_cnt=`awk -F" " '{print NF-1}' <<< "${v_pattern}"` v_thisdir="$(cd "$(dirname "$0")"; pwd)" -v_zip=${v_pattern}.zip +v_zip="${v_pattern}.zip" ######################## # Define dump username # ######################## echo "Checking if common user. Please wait.." -v_common_user=$($ORACLE_HOME/bin/sqlplus -L -S "${v_sysdba_connect}" @${v_thisdir}/get_user_prefix.sql) && v_ret=$? || v_ret=$? +v_common_user=$($ORACLE_HOME/bin/sqlplus -L -S "${DB_EXP_CONN}" @${v_thisdir}/get_user_prefix.sql) && v_ret=$? || v_ret=$? if [ $v_ret -ne 0 ] then @@ -307,9 +342,9 @@ then exitError "${v_common_user}" fi -if [ "$v_def_dump_user_name" = "$v_dump_user_name" ] +if [ "$v_def_dump_user_name" = "$DB_EXP_USER" ] then - [ -n "${v_common_user}" ] && v_dump_user_name="${v_common_user}${v_dump_user_name}" + [ -n "${v_common_user}" ] && DB_EXP_USER="${v_common_user}${DB_EXP_USER}" fi ############## @@ -320,74 +355,80 @@ v_thisdir_bkp="${v_thisdir}" # REMOVE_IF_ZIP v_thisdir="${v_thisdir_bkp}/../adb_load_bugs_fixed" # REMOVE_IF_ZIP v_file=bugs_${v_pattern}.txt -sh "${v_thisdir}/bugsGet.sh" ${v_file} && v_bugs_ret=$? || v_bugs_ret=$? -if ! ${v_ignore_error} && [ ${v_bugs_ret} -ne 0 ] +sh "${v_thisdir}/bugsGet.sh" "${v_file}" && v_bugs_ret=$? || v_bugs_ret=$? +if ! ${DB_EXP_IGNORE_ERROR} && [ ${v_bugs_ret} -ne 0 ] then exitError "OPatch returned ${v_bugs_ret}." fi -! ${v_load_file} && zip -m ${v_zip} ${v_file} +! ${DB_EXP_MERGE_DUMP} && zip -m "${v_zip}" "${v_file}" v_thisdir="${v_thisdir_bkp}/../adb_load_filechksum" # REMOVE_IF_ZIP v_file=sha256sum_${v_pattern}.chk -sh "${v_thisdir}/chksumGet.sh" ${v_file} -! ${v_load_file} && zip -m ${v_zip} ${v_file} +sh "${v_thisdir}/chksumGet.sh" "${v_file}" +! ${DB_EXP_MERGE_DUMP} && zip -m "${v_zip}" "${v_file}" -v_thisdir="${v_thisdir_bkp}/../adb_load_txtcollection_files" # REMOVE_IF_ZIP -v_file=txtcol_${v_pattern}.tar.gz -sh "${v_thisdir}/fileGet.sh" ${v_file} -! ${v_load_file} && zip -m ${v_zip} ${v_file} +if ! ${DB_EXP_INTERNAL_ONLY} +then + v_thisdir="${v_thisdir_bkp}/../adb_load_txtcollection_files" # REMOVE_IF_ZIP + v_file=txtcol_${v_pattern}.tar.gz + sh "${v_thisdir}/fileGet.sh" "${v_file}" + ! ${DB_EXP_MERGE_DUMP} && zip -m "${v_zip}" "${v_file}" -v_thisdir="${v_thisdir_bkp}/../adb_load_symbols" # REMOVE_IF_ZIP -v_file=symbols_${v_pattern}.csv -sh "${v_thisdir}/symbolGet.sh" ${v_file} -! ${v_load_file} && zip -m ${v_zip} ${v_file} + v_thisdir="${v_thisdir_bkp}/../adb_load_symbols" # REMOVE_IF_ZIP + v_file=symbols_${v_pattern}.csv + sh "${v_thisdir}/symbolGet.sh" "${v_file}" + ! ${DB_EXP_MERGE_DUMP} && zip -m "${v_zip}" "${v_file}" +fi v_thisdir="${v_thisdir_bkp}" # REMOVE_IF_ZIP -sh "${v_thisdir}/schemaCreate.sh" ${v_dump_user_name} ${v_drop_dump_user} +sh "${v_thisdir}/schemaCreate.sh" "${DB_EXP_USER}" "${v_drop_dump_user}" -if ${v_load_file} +if ${DB_EXP_MERGE_DUMP} then if [ ${v_bugs_ret} -eq 0 ] then v_thisdir="${v_thisdir_bkp}/../adb_load_bugs_fixed" # REMOVE_IF_ZIP - v_file=bugs_${v_pattern}.txt - sh "${v_thisdir}/bugsLoad.sh" ${v_dump_user_name} ${v_file} - rm -f ${v_file} + v_file="bugs_${v_pattern}.txt" + sh "${v_thisdir}/bugsLoad.sh" "${DB_EXP_USER}" "${v_file}" + rm -f "${v_file}" fi v_thisdir="${v_thisdir_bkp}/../adb_load_filechksum" # REMOVE_IF_ZIP - v_file=sha256sum_${v_pattern}.chk - sh "${v_thisdir}/chksumLoad.sh" ${v_dump_user_name} ${v_file} - rm -f ${v_file} - - v_thisdir="${v_thisdir_bkp}/../adb_load_txtcollection_files" # REMOVE_IF_ZIP - v_file=txtcol_${v_pattern}.tar.gz - sh "${v_thisdir}/fileLoad.sh" ${v_dump_user_name} ${v_file} - rm -f ${v_file} + v_file="sha256sum_${v_pattern}.chk" + sh "${v_thisdir}/chksumLoad.sh" "${DB_EXP_USER}" "${v_file}" + rm -f "${v_file}" - v_thisdir="${v_thisdir_bkp}/../adb_load_symbols" # REMOVE_IF_ZIP - v_file=symbols_${v_pattern}.csv - sh "${v_thisdir}/symbolLoad.sh" ${v_dump_user_name} ${v_file} - rm -f ${v_file} + if ! ${DB_EXP_INTERNAL_ONLY} + then + v_thisdir="${v_thisdir_bkp}/../adb_load_txtcollection_files" # REMOVE_IF_ZIP + v_file="txtcol_${v_pattern}.tar.gz" + sh "${v_thisdir}/fileLoad.sh" "${DB_EXP_USER}" "${v_file}" + rm -f "${v_file}" + + v_thisdir="${v_thisdir_bkp}/../adb_load_symbols" # REMOVE_IF_ZIP + v_file="symbols_${v_pattern}.csv" + sh "${v_thisdir}/symbolLoad.sh" "${DB_EXP_USER}" "${v_file}" + rm -f "${v_file}" + fi fi v_thisdir="${v_thisdir_bkp}" # REMOVE_IF_ZIP -sh "${v_thisdir}/dictionaryGet.sh" ${v_dump_user_name} +sh "${v_thisdir}/dictionaryGet.sh" "${DB_EXP_USER}" -if ${v_gen_dump} +if ${DB_EXP_GEN_DUMP} then - sh "${v_thisdir}/dumpCreate.sh" ${v_dump_user_name} tables_${v_pattern}.dmp ${v_drop_dump_user} + sh "${v_thisdir}/dumpCreate.sh" "${DB_EXP_USER}" "tables_${v_pattern}.dmp" "${v_drop_dump_user}" set +e - zip -m ${v_pattern}.zip tables_${v_pattern}.dmp tables_${v_pattern}.log + zip -m "${v_zip}" "tables_${v_pattern}.dmp" "tables_${v_pattern}.log" v_ret=$? set -eo pipefail if [ $v_ret -ne 0 ] then - echoError "Script failed to zip tables_${v_pattern}.dmp in ${v_pattern}.zip". + echoError "Script failed to zip tables_${v_pattern}.dmp in ${v_zip}". v_file_user=$(stat -c '%U' tables_${v_pattern}.dmp) echoError "1 - Try to rerun as '${v_file_user}' user." echoError "2 - Check file 'tables_${v_pattern}.dmp' permissions, make it readeable and run:". - echoError "$ zip ${v_pattern}.zip tables_${v_pattern}.dmp" + echoError "$ zip ${v_zip} tables_${v_pattern}.dmp" exit $v_ret fi fi diff --git a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh index 83327c9..8ed9fa5 100644 --- a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh +++ b/user_scripts/odbfcl/sh_extractor/schemaCreate.sh @@ -24,16 +24,16 @@ v_drop_dump_user="$2" [ -z "${v_drop_dump_user}" ] && exitError "2nd parameter is if DB Schema can be dropped and cannot be null." # If DB_EXP_USER_PASS is exported, use it. -[ -n "$DB_EXP_USER_PASS" ] && v_dump_user_pass="$DB_EXP_USER_PASS" || v_dump_user_pass='HhAaSsHh..135' +[ -z "$DB_EXP_USER_PASS" ] && DB_EXP_USER_PASS='HhAaSsHh..135' # If DB_EXP_USER_TBS is exported, use it. -[ -n "$DB_EXP_USER_TBS" ] && v_dump_user_tbs="$DB_EXP_USER_TBS" || v_dump_user_tbs='USERS' +[ -z "$DB_EXP_USER_TBS" ] && DB_EXP_USER_TBS='USERS' # If DB_EXP_USER_TEMP is exported, use it. -[ -n "$DB_EXP_USER_TEMP" ] && v_dump_user_temp="$DB_EXP_USER_TEMP" || v_dump_user_temp='TEMP' +[ -z "$DB_EXP_USER_TEMP" ] && DB_EXP_USER_TEMP='TEMP' -# If DB_EXP_CRED is exported, use it as the credentials. -[ -n "$DB_EXP_CRED" ] && v_sysdba_connect="$DB_EXP_CRED" || v_sysdba_connect='/ as sysdba' +# If DB_EXP_CONN is exported, use it as the credentials. +[ -z "$DB_EXP_CONN" ] && DB_EXP_CONN='/ as sysdba' v_thisdir="$(cd "$(dirname "$0")"; pwd)" cd "${v_thisdir}" @@ -41,9 +41,9 @@ cd "${v_thisdir}" echo "Creating export user. Please wait.." cd "${v_thisdir}"/../ # REMOVE_IF_ZIP -$ORACLE_HOME/bin/sqlplus "${v_sysdba_connect}" < Date: Thu, 12 Dec 2024 11:51:06 -0300 Subject: [PATCH 206/229] Renaming old files --- .../bugsGet.sh | 0 .../bugsLoad.sh | 0 .../chksumGet.sh | 0 .../chksumLoad.sh | 0 .../symbolGet.sh | 0 .../symbolLoad.sh | 0 .../fileGet.sh | 0 .../fileLoad.sh | 7 +++++-- 8 files changed, 5 insertions(+), 2 deletions(-) rename user_scripts/odbfcl/{adb_load_bugs_fixed => adb_load_bugs_fixed.old}/bugsGet.sh (100%) rename user_scripts/odbfcl/{adb_load_bugs_fixed => adb_load_bugs_fixed.old}/bugsLoad.sh (100%) rename user_scripts/odbfcl/{adb_load_filechksum => adb_load_filechksum.old}/chksumGet.sh (100%) rename user_scripts/odbfcl/{adb_load_filechksum => adb_load_filechksum.old}/chksumLoad.sh (100%) rename user_scripts/odbfcl/{adb_load_symbols => adb_load_symbols.old}/symbolGet.sh (100%) rename user_scripts/odbfcl/{adb_load_symbols => adb_load_symbols.old}/symbolLoad.sh (100%) rename user_scripts/odbfcl/{adb_load_txtcollection_files => adb_load_txtcollection_files.old}/fileGet.sh (100%) rename user_scripts/odbfcl/{adb_load_txtcollection_files => adb_load_txtcollection_files.old}/fileLoad.sh (94%) diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh b/user_scripts/odbfcl/adb_load_bugs_fixed.old/bugsGet.sh similarity index 100% rename from user_scripts/odbfcl/adb_load_bugs_fixed/bugsGet.sh rename to user_scripts/odbfcl/adb_load_bugs_fixed.old/bugsGet.sh diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh b/user_scripts/odbfcl/adb_load_bugs_fixed.old/bugsLoad.sh similarity index 100% rename from user_scripts/odbfcl/adb_load_bugs_fixed/bugsLoad.sh rename to user_scripts/odbfcl/adb_load_bugs_fixed.old/bugsLoad.sh diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh b/user_scripts/odbfcl/adb_load_filechksum.old/chksumGet.sh similarity index 100% rename from user_scripts/odbfcl/adb_load_filechksum/chksumGet.sh rename to user_scripts/odbfcl/adb_load_filechksum.old/chksumGet.sh diff --git a/user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh b/user_scripts/odbfcl/adb_load_filechksum.old/chksumLoad.sh similarity index 100% rename from user_scripts/odbfcl/adb_load_filechksum/chksumLoad.sh rename to user_scripts/odbfcl/adb_load_filechksum.old/chksumLoad.sh diff --git a/user_scripts/odbfcl/adb_load_symbols/symbolGet.sh b/user_scripts/odbfcl/adb_load_symbols.old/symbolGet.sh similarity index 100% rename from user_scripts/odbfcl/adb_load_symbols/symbolGet.sh rename to user_scripts/odbfcl/adb_load_symbols.old/symbolGet.sh diff --git a/user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh b/user_scripts/odbfcl/adb_load_symbols.old/symbolLoad.sh similarity index 100% rename from user_scripts/odbfcl/adb_load_symbols/symbolLoad.sh rename to user_scripts/odbfcl/adb_load_symbols.old/symbolLoad.sh diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh b/user_scripts/odbfcl/adb_load_txtcollection_files.old/fileGet.sh similarity index 100% rename from user_scripts/odbfcl/adb_load_txtcollection_files/fileGet.sh rename to user_scripts/odbfcl/adb_load_txtcollection_files.old/fileGet.sh diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh b/user_scripts/odbfcl/adb_load_txtcollection_files.old/fileLoad.sh similarity index 94% rename from user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh rename to user_scripts/odbfcl/adb_load_txtcollection_files.old/fileLoad.sh index 036a474..ae91768 100644 --- a/user_scripts/odbfcl/adb_load_txtcollection_files/fileLoad.sh +++ b/user_scripts/odbfcl/adb_load_txtcollection_files.old/fileLoad.sh @@ -85,9 +85,12 @@ update ${v_dump_user_name}.t_txtcollection_load set md5_hash=sys.dbms_crypto.hash(contents,2); insert /*+ append */ into ${v_dump_user_name}.dm_contents (md5_hash, contents) -select md5_hash, contents +select md5_hash, + contents from ( - select md5_hash, contents, rank() over (partition by md5_hash order by rowid asc) col_ind + select md5_hash, + contents, + rank() over (partition by md5_hash order by rowid asc) col_ind from ${v_dump_user_name}.t_txtcollection_load ) where col_ind=1; From 20b8d25e4e6987aac70ccdaf4acff84d3e1e352f Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 12 Dec 2024 11:51:58 -0300 Subject: [PATCH 207/229] Version changes --- user_scripts/odbfcl/sh_extractor/VERSION | 2 +- user_scripts/odbfcl/sh_extractor/exporter.sh | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/user_scripts/odbfcl/sh_extractor/VERSION b/user_scripts/odbfcl/sh_extractor/VERSION index a03e161..40115e9 100644 --- a/user_scripts/odbfcl/sh_extractor/VERSION +++ b/user_scripts/odbfcl/sh_extractor/VERSION @@ -1 +1 @@ -24.10.0 \ No newline at end of file +24.11.0 \ No newline at end of file diff --git a/user_scripts/odbfcl/sh_extractor/exporter.sh b/user_scripts/odbfcl/sh_extractor/exporter.sh index 9237f6e..75427e8 100644 --- a/user_scripts/odbfcl/sh_extractor/exporter.sh +++ b/user_scripts/odbfcl/sh_extractor/exporter.sh @@ -42,20 +42,20 @@ v_def_dump_int_only='true' [ -z "$v_pattern" -o "$#" -ne 1 -o "$v_pattern" = "-help" ] && echoError "Usage: $0 | -help -Example: - - \$ $0 ${v_example} - - The output will be a zip file named '${v_example}.zip'. +First parameter is the output file name and cannot be null. ORAdiff exporter will collect all metadata information from the database, to be loaded in the ORAdiff utility for comparison with another patch set, including another custom patch set you already loaded. -First parameter is the output file name and cannot be null. +Example: + + \$ $0 ${v_example} + + The output will be a zip file named '${v_example}.zip'. " -[ -z "$v_pattern" ] && echoError "The behaviour of the ORAdiff exporter can be changed by exporting +[ -z "$v_pattern" -o "$#" -ne 1 ] && echoError "The behaviour of the ORAdiff exporter can be changed by exporting some environment variables. (Use -help for more details)" [ "$v_pattern" = "-help" ] && echoError "The behaviour of the ORAdiff exporter can be changed by exporting From 4a0b9785a6d1d76f6e16161153298abffe65a174 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 12 Dec 2024 11:57:38 -0300 Subject: [PATCH 208/229] Rename files to old --- .gitignore | 6 +++--- .../odbfcl/adb_load_bugs_fixed.2024Dez}/bugsGet.sh | 0 .../odbfcl/adb_load_bugs_fixed.2024Dez}/bugsLoad.sh | 0 .../odbfcl/adb_load_filechksum.2024Dez}/chksumGet.sh | 0 .../odbfcl/adb_load_filechksum.2024Dez}/chksumLoad.sh | 0 .../odbfcl/adb_load_symbols.2024Dez}/symbolGet.sh | 0 .../odbfcl/adb_load_symbols.2024Dez}/symbolLoad.sh | 0 .../odbfcl/adb_load_txtcollection_files.2024Dez}/fileGet.sh | 0 .../adb_load_txtcollection_files.2024Dez}/fileLoad.sh | 0 .../odbfcl/extract.2024Dez}/create_hash_load_table.sql | 0 .../odbfcl/extract.2024Dez}/hashGet.sql | 0 .../internal_schemas/int_resources_10.2.0.1.sql | 0 .../internal_schemas/int_resources_10.2.0.2.sql | 0 .../internal_schemas/int_resources_10.2.0.3.sql | 0 .../internal_schemas/int_resources_10.2.0.4.sql | 0 .../internal_schemas/int_resources_10.2.0.5.sql | 0 .../internal_schemas/int_resources_11.1.0.6.sql | 0 .../internal_schemas/int_resources_11.1.0.7.sql | 0 .../internal_schemas/int_resources_11.2.0.1.sql | 0 .../internal_schemas/int_resources_11.2.0.2.sql | 0 .../internal_schemas/int_resources_11.2.0.3.sql | 0 .../internal_schemas/int_resources_11.2.0.4.sql | 0 .../internal_schemas/int_resources_12.1.0.1.sql | 0 .../internal_schemas/int_resources_12.1.0.2.sql | 0 .../internal_schemas/int_resources_12.2.0.1.sql | 0 .../internal_schemas/int_resources_18.0.0.0.sql | 0 .../internal_schemas/int_resources_19.0.0.0.sql | 0 .../internal_schemas/int_resources_create.sql | 0 .../internal_schemas/int_resources_drop.sql | 0 .../internal_schemas/int_resources_nothing.sql | 0 .../internal_schemas/int_resources_prof_om.sql | 0 .../internal_schemas/int_resources_user_role_om.sql | 0 .../odbfcl/extract.2024Dez}/load_code.sql | 0 .../odbfcl/extract.2024Dez}/load_custom.sql | 0 .../odbfcl/extract.2024Dez}/load_database_vault.sql | 0 .../odbfcl/extract.2024Dez}/load_dba_cdb.sql | 0 .../odbfcl/extract.2024Dez}/load_source.sql | 0 .../odbfcl/extract.2024Dez}/load_v_dollar.sql | 0 .../odbfcl/extract.2024Dez}/load_view.sql | 0 .../odbfcl/extract.2024Dez}/load_x_dollar.sql | 0 .../odbfcl/extract.2024Dez}/tables_drop.sql | 0 .../underscore_parameters/load_underscore_10.2.0.1.sql | 0 .../underscore_parameters/load_underscore_10.2.0.2.sql | 0 .../underscore_parameters/load_underscore_10.2.0.3.sql | 0 .../underscore_parameters/load_underscore_10.2.0.4.sql | 0 .../underscore_parameters/load_underscore_10.2.0.5.sql | 0 .../underscore_parameters/load_underscore_11.1.0.6.sql | 0 .../underscore_parameters/load_underscore_11.1.0.7.sql | 0 .../underscore_parameters/load_underscore_11.2.0.1.sql | 0 .../underscore_parameters/load_underscore_11.2.0.2.sql | 0 .../underscore_parameters/load_underscore_11.2.0.3.sql | 0 .../underscore_parameters/load_underscore_11.2.0.4.sql | 0 .../underscore_parameters/load_underscore_12.1.0.1.sql | 0 .../underscore_parameters/load_underscore_12.1.0.2.sql | 0 .../underscore_parameters/load_underscore_12.2.0.1.sql | 0 .../underscore_parameters/load_underscore_18.0.0.0.sql | 0 .../underscore_parameters/load_underscore_19.0.0.0.sql | 0 .../underscore_parameters/load_underscore_21.0.0.0.sql | 0 .../underscore_parameters/load_underscore_23.0.0.0.sql | 0 .../underscore_valid_values/load_underscore_vv_10.2.0.1.sql | 0 .../underscore_valid_values/load_underscore_vv_10.2.0.2.sql | 0 .../underscore_valid_values/load_underscore_vv_10.2.0.3.sql | 0 .../underscore_valid_values/load_underscore_vv_10.2.0.4.sql | 0 .../underscore_valid_values/load_underscore_vv_10.2.0.5.sql | 0 .../underscore_valid_values/load_underscore_vv_11.1.0.6.sql | 0 .../underscore_valid_values/load_underscore_vv_11.1.0.7.sql | 0 .../underscore_valid_values/load_underscore_vv_11.2.0.1.sql | 0 .../underscore_valid_values/load_underscore_vv_11.2.0.2.sql | 0 .../underscore_valid_values/load_underscore_vv_11.2.0.3.sql | 0 .../underscore_valid_values/load_underscore_vv_11.2.0.4.sql | 0 .../underscore_valid_values/load_underscore_vv_12.1.0.1.sql | 0 .../underscore_valid_values/load_underscore_vv_12.1.0.2.sql | 0 .../underscore_valid_values/load_underscore_vv_12.2.0.1.sql | 0 .../underscore_valid_values/load_underscore_vv_18.0.0.0.sql | 0 .../underscore_valid_values/load_underscore_vv_19.0.0.0.sql | 0 .../underscore_valid_values/load_underscore_vv_21.0.0.0.sql | 0 .../underscore_valid_values/load_underscore_vv_23.0.0.0.sql | 0 .../odbfcl/extract.2024Dez}/unwrap_code.sql | 0 .../odbfcl/extract.2024Dez}/version_filter.sql | 0 .../odbfcl/sh_extractor.2024Dez}/VERSION | 0 .../odbfcl/sh_extractor.2024Dez}/cleanUser.sql | 0 .../odbfcl/sh_extractor.2024Dez}/dictionaryGet.sh | 0 .../odbfcl/sh_extractor.2024Dez}/dumpCreate.sh | 0 .../odbfcl/sh_extractor.2024Dez}/exporter.sh | 0 .../odbfcl/sh_extractor.2024Dez}/get_db_version.sql | 0 .../odbfcl/sh_extractor.2024Dez}/get_user_prefix.sql | 0 .../odbfcl/sh_extractor.2024Dez}/schemaCreate.sh | 0 87 files changed, 3 insertions(+), 3 deletions(-) rename {user_scripts/odbfcl/adb_load_bugs_fixed.old => user_scripts_old/odbfcl/adb_load_bugs_fixed.2024Dez}/bugsGet.sh (100%) rename {user_scripts/odbfcl/adb_load_bugs_fixed.old => user_scripts_old/odbfcl/adb_load_bugs_fixed.2024Dez}/bugsLoad.sh (100%) rename {user_scripts/odbfcl/adb_load_filechksum.old => user_scripts_old/odbfcl/adb_load_filechksum.2024Dez}/chksumGet.sh (100%) rename {user_scripts/odbfcl/adb_load_filechksum.old => user_scripts_old/odbfcl/adb_load_filechksum.2024Dez}/chksumLoad.sh (100%) rename {user_scripts/odbfcl/adb_load_symbols.old => user_scripts_old/odbfcl/adb_load_symbols.2024Dez}/symbolGet.sh (100%) rename {user_scripts/odbfcl/adb_load_symbols.old => user_scripts_old/odbfcl/adb_load_symbols.2024Dez}/symbolLoad.sh (100%) rename {user_scripts/odbfcl/adb_load_txtcollection_files.old => user_scripts_old/odbfcl/adb_load_txtcollection_files.2024Dez}/fileGet.sh (100%) rename {user_scripts/odbfcl/adb_load_txtcollection_files.old => user_scripts_old/odbfcl/adb_load_txtcollection_files.2024Dez}/fileLoad.sh (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/create_hash_load_table.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/hashGet.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/internal_schemas/int_resources_10.2.0.1.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/internal_schemas/int_resources_10.2.0.2.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/internal_schemas/int_resources_10.2.0.3.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/internal_schemas/int_resources_10.2.0.4.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/internal_schemas/int_resources_10.2.0.5.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/internal_schemas/int_resources_11.1.0.6.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/internal_schemas/int_resources_11.1.0.7.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/internal_schemas/int_resources_11.2.0.1.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/internal_schemas/int_resources_11.2.0.2.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/internal_schemas/int_resources_11.2.0.3.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/internal_schemas/int_resources_11.2.0.4.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/internal_schemas/int_resources_12.1.0.1.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/internal_schemas/int_resources_12.1.0.2.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/internal_schemas/int_resources_12.2.0.1.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/internal_schemas/int_resources_18.0.0.0.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/internal_schemas/int_resources_19.0.0.0.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/internal_schemas/int_resources_create.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/internal_schemas/int_resources_drop.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/internal_schemas/int_resources_nothing.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/internal_schemas/int_resources_prof_om.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/internal_schemas/int_resources_user_role_om.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/load_code.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/load_custom.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/load_database_vault.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/load_dba_cdb.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/load_source.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/load_v_dollar.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/load_view.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/load_x_dollar.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/tables_drop.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_parameters/load_underscore_10.2.0.1.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_parameters/load_underscore_10.2.0.2.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_parameters/load_underscore_10.2.0.3.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_parameters/load_underscore_10.2.0.4.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_parameters/load_underscore_10.2.0.5.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_parameters/load_underscore_11.1.0.6.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_parameters/load_underscore_11.1.0.7.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_parameters/load_underscore_11.2.0.1.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_parameters/load_underscore_11.2.0.2.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_parameters/load_underscore_11.2.0.3.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_parameters/load_underscore_11.2.0.4.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_parameters/load_underscore_12.1.0.1.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_parameters/load_underscore_12.1.0.2.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_parameters/load_underscore_12.2.0.1.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_parameters/load_underscore_18.0.0.0.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_parameters/load_underscore_19.0.0.0.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_parameters/load_underscore_21.0.0.0.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_parameters/load_underscore_23.0.0.0.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_valid_values/load_underscore_vv_10.2.0.1.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_valid_values/load_underscore_vv_10.2.0.2.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_valid_values/load_underscore_vv_10.2.0.3.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_valid_values/load_underscore_vv_10.2.0.4.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_valid_values/load_underscore_vv_10.2.0.5.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_valid_values/load_underscore_vv_11.1.0.6.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_valid_values/load_underscore_vv_11.1.0.7.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_valid_values/load_underscore_vv_11.2.0.1.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_valid_values/load_underscore_vv_11.2.0.2.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_valid_values/load_underscore_vv_11.2.0.3.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_valid_values/load_underscore_vv_11.2.0.4.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_valid_values/load_underscore_vv_12.1.0.1.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_valid_values/load_underscore_vv_12.1.0.2.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_valid_values/load_underscore_vv_12.2.0.1.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_valid_values/load_underscore_vv_18.0.0.0.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_valid_values/load_underscore_vv_19.0.0.0.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_valid_values/load_underscore_vv_21.0.0.0.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/underscore_valid_values/load_underscore_vv_23.0.0.0.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/unwrap_code.sql (100%) rename {user_scripts/odbfcl/extract => user_scripts_old/odbfcl/extract.2024Dez}/version_filter.sql (100%) rename {user_scripts/odbfcl/sh_extractor => user_scripts_old/odbfcl/sh_extractor.2024Dez}/VERSION (100%) rename {user_scripts/odbfcl/sh_extractor => user_scripts_old/odbfcl/sh_extractor.2024Dez}/cleanUser.sql (100%) rename {user_scripts/odbfcl/sh_extractor => user_scripts_old/odbfcl/sh_extractor.2024Dez}/dictionaryGet.sh (100%) rename {user_scripts/odbfcl/sh_extractor => user_scripts_old/odbfcl/sh_extractor.2024Dez}/dumpCreate.sh (100%) rename {user_scripts/odbfcl/sh_extractor => user_scripts_old/odbfcl/sh_extractor.2024Dez}/exporter.sh (100%) rename {user_scripts/odbfcl/sh_extractor => user_scripts_old/odbfcl/sh_extractor.2024Dez}/get_db_version.sql (100%) rename {user_scripts/odbfcl/sh_extractor => user_scripts_old/odbfcl/sh_extractor.2024Dez}/get_user_prefix.sql (100%) rename {user_scripts/odbfcl/sh_extractor => user_scripts_old/odbfcl/sh_extractor.2024Dez}/schemaCreate.sh (100%) diff --git a/.gitignore b/.gitignore index 68566fe..1b21fcc 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,6 @@ config_oci.yml loader_uploads.yml main.retry tasks/main_loader_uploads.yml -user_scripts/odbfcl/sh_extractor/*.zip -user_scripts/odbfcl/sh_extractor/build_zip.sh -user_scripts/odbfcl/sh_extractor/oradiff_exporter/* +user_scripts_old/odbfcl/sh_extractor.*/*.zip +user_scripts_old/odbfcl/sh_extractor.*/build_zip.sh +user_scripts_old/odbfcl/sh_extractor.*/oradiff_exporter/* diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed.old/bugsGet.sh b/user_scripts_old/odbfcl/adb_load_bugs_fixed.2024Dez/bugsGet.sh similarity index 100% rename from user_scripts/odbfcl/adb_load_bugs_fixed.old/bugsGet.sh rename to user_scripts_old/odbfcl/adb_load_bugs_fixed.2024Dez/bugsGet.sh diff --git a/user_scripts/odbfcl/adb_load_bugs_fixed.old/bugsLoad.sh b/user_scripts_old/odbfcl/adb_load_bugs_fixed.2024Dez/bugsLoad.sh similarity index 100% rename from user_scripts/odbfcl/adb_load_bugs_fixed.old/bugsLoad.sh rename to user_scripts_old/odbfcl/adb_load_bugs_fixed.2024Dez/bugsLoad.sh diff --git a/user_scripts/odbfcl/adb_load_filechksum.old/chksumGet.sh b/user_scripts_old/odbfcl/adb_load_filechksum.2024Dez/chksumGet.sh similarity index 100% rename from user_scripts/odbfcl/adb_load_filechksum.old/chksumGet.sh rename to user_scripts_old/odbfcl/adb_load_filechksum.2024Dez/chksumGet.sh diff --git a/user_scripts/odbfcl/adb_load_filechksum.old/chksumLoad.sh b/user_scripts_old/odbfcl/adb_load_filechksum.2024Dez/chksumLoad.sh similarity index 100% rename from user_scripts/odbfcl/adb_load_filechksum.old/chksumLoad.sh rename to user_scripts_old/odbfcl/adb_load_filechksum.2024Dez/chksumLoad.sh diff --git a/user_scripts/odbfcl/adb_load_symbols.old/symbolGet.sh b/user_scripts_old/odbfcl/adb_load_symbols.2024Dez/symbolGet.sh similarity index 100% rename from user_scripts/odbfcl/adb_load_symbols.old/symbolGet.sh rename to user_scripts_old/odbfcl/adb_load_symbols.2024Dez/symbolGet.sh diff --git a/user_scripts/odbfcl/adb_load_symbols.old/symbolLoad.sh b/user_scripts_old/odbfcl/adb_load_symbols.2024Dez/symbolLoad.sh similarity index 100% rename from user_scripts/odbfcl/adb_load_symbols.old/symbolLoad.sh rename to user_scripts_old/odbfcl/adb_load_symbols.2024Dez/symbolLoad.sh diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files.old/fileGet.sh b/user_scripts_old/odbfcl/adb_load_txtcollection_files.2024Dez/fileGet.sh similarity index 100% rename from user_scripts/odbfcl/adb_load_txtcollection_files.old/fileGet.sh rename to user_scripts_old/odbfcl/adb_load_txtcollection_files.2024Dez/fileGet.sh diff --git a/user_scripts/odbfcl/adb_load_txtcollection_files.old/fileLoad.sh b/user_scripts_old/odbfcl/adb_load_txtcollection_files.2024Dez/fileLoad.sh similarity index 100% rename from user_scripts/odbfcl/adb_load_txtcollection_files.old/fileLoad.sh rename to user_scripts_old/odbfcl/adb_load_txtcollection_files.2024Dez/fileLoad.sh diff --git a/user_scripts/odbfcl/extract/create_hash_load_table.sql b/user_scripts_old/odbfcl/extract.2024Dez/create_hash_load_table.sql similarity index 100% rename from user_scripts/odbfcl/extract/create_hash_load_table.sql rename to user_scripts_old/odbfcl/extract.2024Dez/create_hash_load_table.sql diff --git a/user_scripts/odbfcl/extract/hashGet.sql b/user_scripts_old/odbfcl/extract.2024Dez/hashGet.sql similarity index 100% rename from user_scripts/odbfcl/extract/hashGet.sql rename to user_scripts_old/odbfcl/extract.2024Dez/hashGet.sql diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_10.2.0.1.sql b/user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_10.2.0.1.sql similarity index 100% rename from user_scripts/odbfcl/extract/internal_schemas/int_resources_10.2.0.1.sql rename to user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_10.2.0.1.sql diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_10.2.0.2.sql b/user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_10.2.0.2.sql similarity index 100% rename from user_scripts/odbfcl/extract/internal_schemas/int_resources_10.2.0.2.sql rename to user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_10.2.0.2.sql diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_10.2.0.3.sql b/user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_10.2.0.3.sql similarity index 100% rename from user_scripts/odbfcl/extract/internal_schemas/int_resources_10.2.0.3.sql rename to user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_10.2.0.3.sql diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_10.2.0.4.sql b/user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_10.2.0.4.sql similarity index 100% rename from user_scripts/odbfcl/extract/internal_schemas/int_resources_10.2.0.4.sql rename to user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_10.2.0.4.sql diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_10.2.0.5.sql b/user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_10.2.0.5.sql similarity index 100% rename from user_scripts/odbfcl/extract/internal_schemas/int_resources_10.2.0.5.sql rename to user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_10.2.0.5.sql diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_11.1.0.6.sql b/user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_11.1.0.6.sql similarity index 100% rename from user_scripts/odbfcl/extract/internal_schemas/int_resources_11.1.0.6.sql rename to user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_11.1.0.6.sql diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_11.1.0.7.sql b/user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_11.1.0.7.sql similarity index 100% rename from user_scripts/odbfcl/extract/internal_schemas/int_resources_11.1.0.7.sql rename to user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_11.1.0.7.sql diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_11.2.0.1.sql b/user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_11.2.0.1.sql similarity index 100% rename from user_scripts/odbfcl/extract/internal_schemas/int_resources_11.2.0.1.sql rename to user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_11.2.0.1.sql diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_11.2.0.2.sql b/user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_11.2.0.2.sql similarity index 100% rename from user_scripts/odbfcl/extract/internal_schemas/int_resources_11.2.0.2.sql rename to user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_11.2.0.2.sql diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_11.2.0.3.sql b/user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_11.2.0.3.sql similarity index 100% rename from user_scripts/odbfcl/extract/internal_schemas/int_resources_11.2.0.3.sql rename to user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_11.2.0.3.sql diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_11.2.0.4.sql b/user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_11.2.0.4.sql similarity index 100% rename from user_scripts/odbfcl/extract/internal_schemas/int_resources_11.2.0.4.sql rename to user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_11.2.0.4.sql diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_12.1.0.1.sql b/user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_12.1.0.1.sql similarity index 100% rename from user_scripts/odbfcl/extract/internal_schemas/int_resources_12.1.0.1.sql rename to user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_12.1.0.1.sql diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_12.1.0.2.sql b/user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_12.1.0.2.sql similarity index 100% rename from user_scripts/odbfcl/extract/internal_schemas/int_resources_12.1.0.2.sql rename to user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_12.1.0.2.sql diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_12.2.0.1.sql b/user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_12.2.0.1.sql similarity index 100% rename from user_scripts/odbfcl/extract/internal_schemas/int_resources_12.2.0.1.sql rename to user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_12.2.0.1.sql diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_18.0.0.0.sql b/user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_18.0.0.0.sql similarity index 100% rename from user_scripts/odbfcl/extract/internal_schemas/int_resources_18.0.0.0.sql rename to user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_18.0.0.0.sql diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_19.0.0.0.sql b/user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_19.0.0.0.sql similarity index 100% rename from user_scripts/odbfcl/extract/internal_schemas/int_resources_19.0.0.0.sql rename to user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_19.0.0.0.sql diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_create.sql b/user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_create.sql similarity index 100% rename from user_scripts/odbfcl/extract/internal_schemas/int_resources_create.sql rename to user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_create.sql diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_drop.sql b/user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_drop.sql similarity index 100% rename from user_scripts/odbfcl/extract/internal_schemas/int_resources_drop.sql rename to user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_drop.sql diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_nothing.sql b/user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_nothing.sql similarity index 100% rename from user_scripts/odbfcl/extract/internal_schemas/int_resources_nothing.sql rename to user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_nothing.sql diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_prof_om.sql b/user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_prof_om.sql similarity index 100% rename from user_scripts/odbfcl/extract/internal_schemas/int_resources_prof_om.sql rename to user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_prof_om.sql diff --git a/user_scripts/odbfcl/extract/internal_schemas/int_resources_user_role_om.sql b/user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_user_role_om.sql similarity index 100% rename from user_scripts/odbfcl/extract/internal_schemas/int_resources_user_role_om.sql rename to user_scripts_old/odbfcl/extract.2024Dez/internal_schemas/int_resources_user_role_om.sql diff --git a/user_scripts/odbfcl/extract/load_code.sql b/user_scripts_old/odbfcl/extract.2024Dez/load_code.sql similarity index 100% rename from user_scripts/odbfcl/extract/load_code.sql rename to user_scripts_old/odbfcl/extract.2024Dez/load_code.sql diff --git a/user_scripts/odbfcl/extract/load_custom.sql b/user_scripts_old/odbfcl/extract.2024Dez/load_custom.sql similarity index 100% rename from user_scripts/odbfcl/extract/load_custom.sql rename to user_scripts_old/odbfcl/extract.2024Dez/load_custom.sql diff --git a/user_scripts/odbfcl/extract/load_database_vault.sql b/user_scripts_old/odbfcl/extract.2024Dez/load_database_vault.sql similarity index 100% rename from user_scripts/odbfcl/extract/load_database_vault.sql rename to user_scripts_old/odbfcl/extract.2024Dez/load_database_vault.sql diff --git a/user_scripts/odbfcl/extract/load_dba_cdb.sql b/user_scripts_old/odbfcl/extract.2024Dez/load_dba_cdb.sql similarity index 100% rename from user_scripts/odbfcl/extract/load_dba_cdb.sql rename to user_scripts_old/odbfcl/extract.2024Dez/load_dba_cdb.sql diff --git a/user_scripts/odbfcl/extract/load_source.sql b/user_scripts_old/odbfcl/extract.2024Dez/load_source.sql similarity index 100% rename from user_scripts/odbfcl/extract/load_source.sql rename to user_scripts_old/odbfcl/extract.2024Dez/load_source.sql diff --git a/user_scripts/odbfcl/extract/load_v_dollar.sql b/user_scripts_old/odbfcl/extract.2024Dez/load_v_dollar.sql similarity index 100% rename from user_scripts/odbfcl/extract/load_v_dollar.sql rename to user_scripts_old/odbfcl/extract.2024Dez/load_v_dollar.sql diff --git a/user_scripts/odbfcl/extract/load_view.sql b/user_scripts_old/odbfcl/extract.2024Dez/load_view.sql similarity index 100% rename from user_scripts/odbfcl/extract/load_view.sql rename to user_scripts_old/odbfcl/extract.2024Dez/load_view.sql diff --git a/user_scripts/odbfcl/extract/load_x_dollar.sql b/user_scripts_old/odbfcl/extract.2024Dez/load_x_dollar.sql similarity index 100% rename from user_scripts/odbfcl/extract/load_x_dollar.sql rename to user_scripts_old/odbfcl/extract.2024Dez/load_x_dollar.sql diff --git a/user_scripts/odbfcl/extract/tables_drop.sql b/user_scripts_old/odbfcl/extract.2024Dez/tables_drop.sql similarity index 100% rename from user_scripts/odbfcl/extract/tables_drop.sql rename to user_scripts_old/odbfcl/extract.2024Dez/tables_drop.sql diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.1.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_10.2.0.1.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.1.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_10.2.0.1.sql diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.2.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_10.2.0.2.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.2.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_10.2.0.2.sql diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.3.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_10.2.0.3.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.3.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_10.2.0.3.sql diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.4.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_10.2.0.4.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.4.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_10.2.0.4.sql diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.5.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_10.2.0.5.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_parameters/load_underscore_10.2.0.5.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_10.2.0.5.sql diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.1.0.6.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_11.1.0.6.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.1.0.6.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_11.1.0.6.sql diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.1.0.7.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_11.1.0.7.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.1.0.7.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_11.1.0.7.sql diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.1.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_11.2.0.1.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.1.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_11.2.0.1.sql diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.2.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_11.2.0.2.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.2.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_11.2.0.2.sql diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.3.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_11.2.0.3.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.3.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_11.2.0.3.sql diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.4.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_11.2.0.4.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_parameters/load_underscore_11.2.0.4.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_11.2.0.4.sql diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.1.0.1.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_12.1.0.1.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.1.0.1.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_12.1.0.1.sql diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.1.0.2.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_12.1.0.2.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.1.0.2.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_12.1.0.2.sql diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.2.0.1.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_12.2.0.1.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_parameters/load_underscore_12.2.0.1.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_12.2.0.1.sql diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_18.0.0.0.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_18.0.0.0.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_parameters/load_underscore_18.0.0.0.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_18.0.0.0.sql diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_19.0.0.0.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_19.0.0.0.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_parameters/load_underscore_19.0.0.0.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_19.0.0.0.sql diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_21.0.0.0.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_21.0.0.0.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_parameters/load_underscore_21.0.0.0.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_21.0.0.0.sql diff --git a/user_scripts/odbfcl/extract/underscore_parameters/load_underscore_23.0.0.0.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_23.0.0.0.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_parameters/load_underscore_23.0.0.0.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_parameters/load_underscore_23.0.0.0.sql diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.1.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_10.2.0.1.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.1.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_10.2.0.1.sql diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.2.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_10.2.0.2.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.2.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_10.2.0.2.sql diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.3.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_10.2.0.3.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.3.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_10.2.0.3.sql diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.4.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_10.2.0.4.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.4.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_10.2.0.4.sql diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.5.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_10.2.0.5.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_10.2.0.5.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_10.2.0.5.sql diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.1.0.6.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_11.1.0.6.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.1.0.6.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_11.1.0.6.sql diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.1.0.7.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_11.1.0.7.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.1.0.7.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_11.1.0.7.sql diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.1.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_11.2.0.1.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.1.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_11.2.0.1.sql diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.2.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_11.2.0.2.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.2.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_11.2.0.2.sql diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.3.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_11.2.0.3.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.3.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_11.2.0.3.sql diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.4.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_11.2.0.4.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_11.2.0.4.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_11.2.0.4.sql diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.1.0.1.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_12.1.0.1.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.1.0.1.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_12.1.0.1.sql diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.1.0.2.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_12.1.0.2.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.1.0.2.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_12.1.0.2.sql diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.2.0.1.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_12.2.0.1.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_12.2.0.1.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_12.2.0.1.sql diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_18.0.0.0.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_18.0.0.0.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_18.0.0.0.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_18.0.0.0.sql diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_19.0.0.0.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_19.0.0.0.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_19.0.0.0.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_19.0.0.0.sql diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_21.0.0.0.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_21.0.0.0.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_21.0.0.0.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_21.0.0.0.sql diff --git a/user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_23.0.0.0.sql b/user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_23.0.0.0.sql similarity index 100% rename from user_scripts/odbfcl/extract/underscore_valid_values/load_underscore_vv_23.0.0.0.sql rename to user_scripts_old/odbfcl/extract.2024Dez/underscore_valid_values/load_underscore_vv_23.0.0.0.sql diff --git a/user_scripts/odbfcl/extract/unwrap_code.sql b/user_scripts_old/odbfcl/extract.2024Dez/unwrap_code.sql similarity index 100% rename from user_scripts/odbfcl/extract/unwrap_code.sql rename to user_scripts_old/odbfcl/extract.2024Dez/unwrap_code.sql diff --git a/user_scripts/odbfcl/extract/version_filter.sql b/user_scripts_old/odbfcl/extract.2024Dez/version_filter.sql similarity index 100% rename from user_scripts/odbfcl/extract/version_filter.sql rename to user_scripts_old/odbfcl/extract.2024Dez/version_filter.sql diff --git a/user_scripts/odbfcl/sh_extractor/VERSION b/user_scripts_old/odbfcl/sh_extractor.2024Dez/VERSION similarity index 100% rename from user_scripts/odbfcl/sh_extractor/VERSION rename to user_scripts_old/odbfcl/sh_extractor.2024Dez/VERSION diff --git a/user_scripts/odbfcl/sh_extractor/cleanUser.sql b/user_scripts_old/odbfcl/sh_extractor.2024Dez/cleanUser.sql similarity index 100% rename from user_scripts/odbfcl/sh_extractor/cleanUser.sql rename to user_scripts_old/odbfcl/sh_extractor.2024Dez/cleanUser.sql diff --git a/user_scripts/odbfcl/sh_extractor/dictionaryGet.sh b/user_scripts_old/odbfcl/sh_extractor.2024Dez/dictionaryGet.sh similarity index 100% rename from user_scripts/odbfcl/sh_extractor/dictionaryGet.sh rename to user_scripts_old/odbfcl/sh_extractor.2024Dez/dictionaryGet.sh diff --git a/user_scripts/odbfcl/sh_extractor/dumpCreate.sh b/user_scripts_old/odbfcl/sh_extractor.2024Dez/dumpCreate.sh similarity index 100% rename from user_scripts/odbfcl/sh_extractor/dumpCreate.sh rename to user_scripts_old/odbfcl/sh_extractor.2024Dez/dumpCreate.sh diff --git a/user_scripts/odbfcl/sh_extractor/exporter.sh b/user_scripts_old/odbfcl/sh_extractor.2024Dez/exporter.sh similarity index 100% rename from user_scripts/odbfcl/sh_extractor/exporter.sh rename to user_scripts_old/odbfcl/sh_extractor.2024Dez/exporter.sh diff --git a/user_scripts/odbfcl/sh_extractor/get_db_version.sql b/user_scripts_old/odbfcl/sh_extractor.2024Dez/get_db_version.sql similarity index 100% rename from user_scripts/odbfcl/sh_extractor/get_db_version.sql rename to user_scripts_old/odbfcl/sh_extractor.2024Dez/get_db_version.sql diff --git a/user_scripts/odbfcl/sh_extractor/get_user_prefix.sql b/user_scripts_old/odbfcl/sh_extractor.2024Dez/get_user_prefix.sql similarity index 100% rename from user_scripts/odbfcl/sh_extractor/get_user_prefix.sql rename to user_scripts_old/odbfcl/sh_extractor.2024Dez/get_user_prefix.sql diff --git a/user_scripts/odbfcl/sh_extractor/schemaCreate.sh b/user_scripts_old/odbfcl/sh_extractor.2024Dez/schemaCreate.sh similarity index 100% rename from user_scripts/odbfcl/sh_extractor/schemaCreate.sh rename to user_scripts_old/odbfcl/sh_extractor.2024Dez/schemaCreate.sh From 1b791fd8a8b42a079f664378115a5239758fb506 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 12 Dec 2024 12:00:54 -0300 Subject: [PATCH 209/229] Rename files --- .../odbfcl/createUser.sql.2024Dez | 0 .../odbfcl/tables_create.sql.2024Dez | 0 .../odbfcl/tables_recreate.sql.2024Dez | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename user_scripts/odbfcl/createUser.sql => user_scripts_old/odbfcl/createUser.sql.2024Dez (100%) rename user_scripts/odbfcl/tables_create.sql => user_scripts_old/odbfcl/tables_create.sql.2024Dez (100%) rename user_scripts/odbfcl/tables_recreate.sql => user_scripts_old/odbfcl/tables_recreate.sql.2024Dez (100%) diff --git a/user_scripts/odbfcl/createUser.sql b/user_scripts_old/odbfcl/createUser.sql.2024Dez similarity index 100% rename from user_scripts/odbfcl/createUser.sql rename to user_scripts_old/odbfcl/createUser.sql.2024Dez diff --git a/user_scripts/odbfcl/tables_create.sql b/user_scripts_old/odbfcl/tables_create.sql.2024Dez similarity index 100% rename from user_scripts/odbfcl/tables_create.sql rename to user_scripts_old/odbfcl/tables_create.sql.2024Dez diff --git a/user_scripts/odbfcl/tables_recreate.sql b/user_scripts_old/odbfcl/tables_recreate.sql.2024Dez similarity index 100% rename from user_scripts/odbfcl/tables_recreate.sql rename to user_scripts_old/odbfcl/tables_recreate.sql.2024Dez From b3486bcf2037f8ce56dae69390a3ab8111b78013 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 12 Dec 2024 12:25:28 -0300 Subject: [PATCH 210/229] Update runExtractor.yml --- user_scripts/odbfcl/runExtractor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/user_scripts/odbfcl/runExtractor.yml b/user_scripts/odbfcl/runExtractor.yml index 965e503..a9863b0 100644 --- a/user_scripts/odbfcl/runExtractor.yml +++ b/user_scripts/odbfcl/runExtractor.yml @@ -5,6 +5,8 @@ set -eo pipefail export ORACLE_HOME export ORACLE_SID + export DB_EXP_USER="{{ dump_user_int }}" + export DB_EXP_DIRECTORY="{{ dump_dir_name }}" export DB_EXP_GEN_DUMP=false export DB_EXP_IGNORE_ERROR=false export DB_EXP_INTERNAL_ONLY=false From 1bf34a92b072593498c717ad84087d16df250553 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 12 Dec 2024 12:38:48 -0300 Subject: [PATCH 211/229] Update scripts --- .gitignore | 2 +- user_scripts/odbfcl/runExtractor.yml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 1b21fcc..5bc5760 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,6 @@ config_oci.yml loader_uploads.yml main.retry tasks/main_loader_uploads.yml -user_scripts_old/odbfcl/sh_extractor.*/*.zip user_scripts_old/odbfcl/sh_extractor.*/build_zip.sh user_scripts_old/odbfcl/sh_extractor.*/oradiff_exporter/* +user_scripts/odbfcl/oradiff_exporter.zip diff --git a/user_scripts/odbfcl/runExtractor.yml b/user_scripts/odbfcl/runExtractor.yml index a9863b0..cb678bf 100644 --- a/user_scripts/odbfcl/runExtractor.yml +++ b/user_scripts/odbfcl/runExtractor.yml @@ -12,7 +12,9 @@ export DB_EXP_INTERNAL_ONLY=false export DB_EXP_USER_PASS="{{ dump_pass }}" [ ! -d ~/exporter_logs ] && mkdir ~/exporter_logs - sh "{{ VM_folder }}/user_scripts/odbfcl/sh_extractor/exporter.sh" db 2>&1 | tee ~/exporter_logs/{{ file_suffix }}.log + [ -d ~/oradiff_export ] && rm -rf ~/oradiff_export && mkdir ~/oradiff_export + unzip -q "{{ VM_folder }}/user_scripts/odbfcl/oradiff_export.zip" -d ~/ + sh "~/oradiff_export/exporter.sh" db 2>&1 | tee ~/exporter_logs/{{ file_suffix }}.log environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" From 719d731193c558340072747c451a6b9a344a39bb Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 12 Dec 2024 17:26:17 -0300 Subject: [PATCH 212/229] Update runExtractor.yml --- user_scripts/odbfcl/runExtractor.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/user_scripts/odbfcl/runExtractor.yml b/user_scripts/odbfcl/runExtractor.yml index cb678bf..bae9ae8 100644 --- a/user_scripts/odbfcl/runExtractor.yml +++ b/user_scripts/odbfcl/runExtractor.yml @@ -12,9 +12,9 @@ export DB_EXP_INTERNAL_ONLY=false export DB_EXP_USER_PASS="{{ dump_pass }}" [ ! -d ~/exporter_logs ] && mkdir ~/exporter_logs - [ -d ~/oradiff_export ] && rm -rf ~/oradiff_export && mkdir ~/oradiff_export - unzip -q "{{ VM_folder }}/user_scripts/odbfcl/oradiff_export.zip" -d ~/ - sh "~/oradiff_export/exporter.sh" db 2>&1 | tee ~/exporter_logs/{{ file_suffix }}.log + [ -d ~/oradiff_exporter ] && rm -rf ~/oradiff_exporter && mkdir ~/oradiff_exporter + unzip -q "{{ VM_folder }}/user_scripts/odbfcl/oradiff_exporter.zip" -d ~/ + sh "~/oradiff_exporter/exporter.sh" db 2>&1 | tee ~/exporter_logs/{{ file_suffix }}.log environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" From 3282ab241eca1cbb14c6361094836ef6b6292a9d Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 12 Dec 2024 17:43:00 -0300 Subject: [PATCH 213/229] Update runExtractor.yml --- user_scripts/odbfcl/runExtractor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_scripts/odbfcl/runExtractor.yml b/user_scripts/odbfcl/runExtractor.yml index bae9ae8..30db49f 100644 --- a/user_scripts/odbfcl/runExtractor.yml +++ b/user_scripts/odbfcl/runExtractor.yml @@ -14,7 +14,7 @@ [ ! -d ~/exporter_logs ] && mkdir ~/exporter_logs [ -d ~/oradiff_exporter ] && rm -rf ~/oradiff_exporter && mkdir ~/oradiff_exporter unzip -q "{{ VM_folder }}/user_scripts/odbfcl/oradiff_exporter.zip" -d ~/ - sh "~/oradiff_exporter/exporter.sh" db 2>&1 | tee ~/exporter_logs/{{ file_suffix }}.log + sh ~/oradiff_exporter/exporter.sh db 2>&1 | tee ~/exporter_logs/{{ file_suffix }}.log environment: ORACLE_HOME: "{{ dbhome_locl }}" ORACLE_SID: "{{ mysid }}" From 9ddc579b9742d0d1188a9316de161695dd8ebde5 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 12 Dec 2024 20:35:55 -0300 Subject: [PATCH 214/229] Update runExtractor.yml --- user_scripts/odbfcl/runExtractor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/user_scripts/odbfcl/runExtractor.yml b/user_scripts/odbfcl/runExtractor.yml index 30db49f..215c766 100644 --- a/user_scripts/odbfcl/runExtractor.yml +++ b/user_scripts/odbfcl/runExtractor.yml @@ -11,6 +11,7 @@ export DB_EXP_IGNORE_ERROR=false export DB_EXP_INTERNAL_ONLY=false export DB_EXP_USER_PASS="{{ dump_pass }}" + export DB_EXP_CLEAN_USER=true [ ! -d ~/exporter_logs ] && mkdir ~/exporter_logs [ -d ~/oradiff_exporter ] && rm -rf ~/oradiff_exporter && mkdir ~/oradiff_exporter unzip -q "{{ VM_folder }}/user_scripts/odbfcl/oradiff_exporter.zip" -d ~/ From 40a0df2b4caf7ff9000f9ef3654653b5ce7ac9cb Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 22 Jan 2025 11:40:04 -0300 Subject: [PATCH 215/229] Update list_patches.yml --- list_patches.yml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/list_patches.yml b/list_patches.yml index 1f7976c..7ab65e4 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -340,6 +340,7 @@ list_11204: - { type : "PSU" , id : 240416 , patch_number : 36222299 } - { type : "PSU" , id : 240716 , patch_number : 36575425 } # - { type : "PSU" , id : 241015 , patch_number : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED +# - { type : "PSU" , id : 250121 , patch_number : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED # 11.2.0.4 OJVM - { type : "OJVM" , id : 1 , patch_number : 19282021 } - { type : "OJVM" , id : 2 , patch_number : 19877440 } @@ -382,6 +383,7 @@ list_11204: - { type : "OJVM" , id : 240416 , patch_number : 36222352 } - { type : "OJVM" , id : 240716 , patch_number : 36533106 } - { type : "OJVM" , id : 241015 , patch_number : 36878781 } + - { type : "OJVM" , id : 250121 , patch_number : 37226818 } # 11.2.0.4 BP - { type : "BP" , id : 1 , patch_number : 17628025 , patch_folder : 17628006 } - { type : "BP" , id : 2 , patch_number : 17838803 , patch_folder : 17741631 } @@ -441,7 +443,7 @@ list_11204: - { type : "BP" , id : 240416 , patch_number : 36234434 , patch_folder : 36222308 } - { type : "BP" , id : 240716 , patch_number : 36663546 , patch_folder : 36521957 } # - { type : "BP" , id : 241015 , patch_number : xxxxxxxx , patch_folder : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED - +# - { type : "BP" , id : 250121 , patch_number : xxxxxxxx , patch_folder : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED #################### ##### 12.1.0.1 ##### @@ -524,6 +526,7 @@ list_12102: - { type : "PSU" , id : 240416 , patch_number : 36222283 } - { type : "PSU" , id : 240716 , patch_number : 36519012 } - { type : "PSU" , id : 241015 , patch_number : 36834621 } +# - { type : "PSU" , id : 250121 , patch_number : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED # 12.1.0.2 OJVM - { type : "OJVM" , id : 1 , patch_number : 19282028 } - { type : "OJVM" , id : 2 , patch_number : 19877336 } @@ -566,6 +569,7 @@ list_12102: - { type : "OJVM" , id : 240416 , patch_number : 36222331 } - { type : "OJVM" , id : 240716 , patch_number : 36533098 } - { type : "OJVM" , id : 241015 , patch_number : 36878764 } + - { type : "OJVM" , id : 250121 , patch_number : 37226811 } # 12.1.0.2 BP - { type : "BP" , id : 1 , patch_number : 19404326 , patch_folder : 19189240 } - { type : "BP" , id : 2 , patch_number : 19774304 , patch_folder : 19649591 } @@ -616,6 +620,7 @@ list_12102: - { type : "BP" , id : 240416 , patch_number : 36360782 , patch_folder : 36222291 } - { type : "BP" , id : 240716 , patch_number : 36663406 , patch_folder : 36519004 } - { type : "BP" , id : 241015 , patch_number : 36961411 , patch_folder : 36834630 } + - { type : "BP" , id : 250121 , patch_number : 37372537 , patch_folder : 37226852 } #################### ##### 12.2.0.1 ##### @@ -656,6 +661,7 @@ list_12201: - { type : "RU" , id : 240416 , patch_number : 36325581 } - { type : "RU" , id : 240716 , patch_number : 36650048 } - { type : "RU" , id : 241015 , patch_number : 36941400 } + - { type : "RU" , id : 250121 , patch_number : 37317999 } # 12.2.0.1 RUR - { type : "RUR" , id : 171017 , patch_number : 26518812 , base_ru : JUL2017 } - { type : "RUR" , id : 180116 , patch_number : 27013506 , base_ru : JUL2017 } @@ -713,6 +719,7 @@ list_12201: - { type : "OJVM" , id : 240416 , patch_number : 36222324 } # START TIER 1 - { type : "OJVM" , id : 240716 , patch_number : 36533083 } - { type : "OJVM" , id : 241015 , patch_number : 36878737 } + - { type : "OJVM" , id : 250121 , patch_number : 37226803 } #################### ##### 18.0.0.0 ##### @@ -751,6 +758,7 @@ list_18000: - { type : "RU" , id : 26 , patch_number : 36339040 } # NOT AVAILABLE TO DOWNLOAD - { type : "RU" , id : 27 , patch_number : 36682577 } # NOT AVAILABLE TO DOWNLOAD - { type : "RU" , id : 28 , patch_number : 36941408 } # NOT AVAILABLE TO DOWNLOAD + - { type : "RU" , id : 28 , patch_number : 37318028 } # NOT AVAILABLE TO DOWNLOAD # 18c RUR # - { type : "RUR" , id : 1 , patch_number : 28346593 , base_ru : '18.2' } # - { type : "RUR" , id : 2 , patch_number : 28601267 , base_ru : '18.2' } @@ -803,6 +811,7 @@ list_18000: - { type : "OJVM" , id : 240416 , patch_number : 36222358 } # NOT AVAILABLE TO DOWNLOAD # 18.26 - { type : "OJVM" , id : 240716 , patch_number : 36533062 } # NOT AVAILABLE TO DOWNLOAD # 18.27 - { type : "OJVM" , id : 241015 , patch_number : 36878718 } # NOT AVAILABLE TO DOWNLOAD # 18.28 + - { type : "OJVM" , id : 250121 , patch_number : 37226745 } # NOT AVAILABLE TO DOWNLOAD # 18.28 # No more updates on this one. @@ -838,6 +847,7 @@ list_19000: - { type : "RU" , id : 23 , patch_number : 36233263 } - { type : "RU" , id : 24 , patch_number : 36582781 } - { type : "RU" , id : 25 , patch_number : 36912597 } + - { type : "RU" , id : 26 , patch_number : 37260974 } # 19c RUR - { type : "RUR" , id : 1 , patch_number : 29799057 , base_ru : '19.3' } - { type : "RUR" , id : 2 , patch_number : 30087906 , base_ru : '19.3' } @@ -914,6 +924,12 @@ list_19000: - { type : "MRP" , id : 240820 , patch_number : 36907847 , base_ru : '19.24' , dep_type : 'RU' , dep_id : 24 , apply_method : "napply" } - { type : "MRP" , id : 240917 , patch_number : 37000101 , base_ru : '19.24' , dep_type : 'RU' , dep_id : 24 , apply_method : "napply" } - { type : "MRP" , id : 241015 , patch_number : 37106585 , base_ru : '19.24' , dep_type : 'RU' , dep_id : 24 , apply_method : "napply" } + - { type : "MRP" , id : 241119 , patch_number : 37243934 , base_ru : '19.24' , dep_type : 'RU' , dep_id : 24 , apply_method : "napply" } + - { type : "MRP" , id : 241217 , patch_number : 37331707 , base_ru : '19.24' , dep_type : 'RU' , dep_id : 24 , apply_method : "napply" } + - { type : "MRP" , id : 250121 , patch_number : 37446443 , base_ru : '19.24' , dep_type : 'RU' , dep_id : 24 , apply_method : "napply" } + - { type : "MRP" , id : 241119 , patch_number : 37244031 , base_ru : '19.25' , dep_type : 'RU' , dep_id : 25 , apply_method : "napply" } + - { type : "MRP" , id : 241217 , patch_number : 37331661 , base_ru : '19.25' , dep_type : 'RU' , dep_id : 25 , apply_method : "napply" } + - { type : "MRP" , id : 250121 , patch_number : 37446465 , base_ru : '19.25' , dep_type : 'RU' , dep_id : 25 , apply_method : "napply" } # 19c OJVM - { type : "OJVM" , id : 190416 , patch_number : 29548437 } - { type : "OJVM" , id : 190716 , patch_number : 29774421 } @@ -938,6 +954,7 @@ list_19000: - { type : "OJVM" , id : 240416 , patch_number : 36199232 } - { type : "OJVM" , id : 240716 , patch_number : 36414915 } - { type : "OJVM" , id : 241015 , patch_number : 36878697 } + - { type : "OJVM" , id : 250121 , patch_number : 37102264 } # 19c DPBP - { type : "DPBP" , id : 10 , patch_number : 32583144 , dep_type : 'RU' , dep_id : 10 } - { type : "DPBP" , id : 11 , patch_number : 32958059 , dep_type : 'RU' , dep_id : 11 } @@ -955,6 +972,7 @@ list_19000: - { type : "DPBP" , id : 23 , patch_number : 36420641 , dep_type : 'RU' , dep_id : 23 } - { type : "DPBP" , id : 24 , patch_number : 36682332 , dep_type : 'RU' , dep_id : 24 } - { type : "DPBP" , id : 25 , patch_number : 37056207 , dep_type : 'RU' , dep_id : 25 } + - { type : "DPBP" , id : 26 , patch_number : 37470729 , dep_type : 'RU' , dep_id : 26 } #################### ##### 21.0.0.0 ##### @@ -975,6 +993,7 @@ list_21000: - { type : "RU" , id : 14 , patch_number : 36352352 } - { type : "RU" , id : 15 , patch_number : 36696242 } - { type : "RU" , id : 16 , patch_number : 36991631 } + - { type : "RU" , id : 17 , patch_number : 37350281 } #################### ##### 23.0.0.0 ##### @@ -991,8 +1010,14 @@ list_23000: # - { type : "RU" , id : 5 , patch_number : 36741532 , dep_type : 'RU' , dep_id : 4 } - { type : "BASE" , id : 5 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.BASE_5_0.tar.gz" } # - { type : "RU" , id : 6 , patch_number : 37037086 } +# - { type : "RU" , id : 7 , patch_number : 37366180 } - { type : "RU" , id : 6 , patch_number : 37037908 , apply_method : "gold_image" } + - { type : "RU" , id : 7 , patch_number : 37370465 , apply_method : "gold_image" } - { type : "FREE" , id : 2 , patch_number : 00000000 , apply_method : "download_tar" , apply_file : "u01.FreeRel2.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } - { type : "FREE" , id : 3 , patch_number : 00000000 , apply_method : "download_tar" , apply_file : "u01.FreeRel3.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } - { type : "FREE" , id : 4 , patch_number : 00000000 , apply_method : "download_tar" , apply_file : "u01.FreeRel4.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } - - { type : "FREE" , id : 5 , patch_number : 00000000 , apply_method : "download_tar" , apply_file : "u01.FreeRel5.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } \ No newline at end of file + - { type : "FREE" , id : 5 , patch_number : 00000000 , apply_method : "download_tar" , apply_file : "u01.FreeRel5.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 6 , patch_number : 00000000 , apply_method : "download_tar" , apply_file : "u01.FreeRel6.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } +# 23ai DPBP + - { type : "DPBP" , id : 6 , patch_number : 37169536 , dep_type : 'RU' , dep_id : 6 } + - { type : "DPBP" , id : 7 , patch_number : 37491421 , dep_type : 'RU' , dep_id : 7 } \ No newline at end of file From a8174e0ac0a17b551e887acafaa03737b9d89ee5 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 23 Jan 2025 10:25:32 -0300 Subject: [PATCH 216/229] Fix Jan issues --- list_exceptions.yml | 1 + list_patches.yml | 2 +- tasks/lvm_reload.yml | 5 +++++ tasks/lvm_savestate.yml | 5 +++-- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/list_exceptions.yml b/list_exceptions.yml index ae4786e..ba61d28 100644 --- a/list_exceptions.yml +++ b/list_exceptions.yml @@ -29,6 +29,7 @@ list_retry_datapatch: - { version: "12.1.0.2" , type : "BP" , id : 240416 , retries : 3 } - { version: "12.1.0.2" , type : "BP" , id : 240716 , retries : 3 } - { version: "12.1.0.2" , type : "BP" , id : 241015 , retries : 3 } + - { version: "12.1.0.2" , type : "BP" , id : 250121 , retries : 3 } ###### - { version: "12.1.0.2" , type : "PSU" , id : 200714 , retries : 2 } - { version: "12.1.0.2" , type : "PSU" , id : 201020 , retries : 2 } diff --git a/list_patches.yml b/list_patches.yml index 7ab65e4..3f39695 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -758,7 +758,7 @@ list_18000: - { type : "RU" , id : 26 , patch_number : 36339040 } # NOT AVAILABLE TO DOWNLOAD - { type : "RU" , id : 27 , patch_number : 36682577 } # NOT AVAILABLE TO DOWNLOAD - { type : "RU" , id : 28 , patch_number : 36941408 } # NOT AVAILABLE TO DOWNLOAD - - { type : "RU" , id : 28 , patch_number : 37318028 } # NOT AVAILABLE TO DOWNLOAD + - { type : "RU" , id : 29 , patch_number : 37318028 } # NOT AVAILABLE TO DOWNLOAD # 18c RUR # - { type : "RUR" , id : 1 , patch_number : 28346593 , base_ru : '18.2' } # - { type : "RUR" , id : 2 , patch_number : 28601267 , base_ru : '18.2' } diff --git a/tasks/lvm_reload.yml b/tasks/lvm_reload.yml index 56d1c01..39cc6a5 100644 --- a/tasks/lvm_reload.yml +++ b/tasks/lvm_reload.yml @@ -4,6 +4,11 @@ export PATH=$PATH:/sbin:/usr/sbin v_snapshot="{{ vm_snapshot }}" v_disk="/dev/mapper/vg_u01-lv_u01" + if ! $(lvs -a | grep -q "lv_u01_${v_snapshot}") + then + echo "LV lv_u01_${v_snapshot} not found." + exit 1 + fi # Term all oracle sessions pkill -U oracle || true sleep 5 diff --git a/tasks/lvm_savestate.yml b/tasks/lvm_savestate.yml index d92c27a..1a70280 100644 --- a/tasks/lvm_savestate.yml +++ b/tasks/lvm_savestate.yml @@ -6,7 +6,8 @@ export PATH=$PATH:/sbin:/usr/sbin v_snapshot="{{ save_snapshot }}" v_disk_vg='/dev/mapper/vg_u01' - for lv_name in `lvs --noheadings -o lv_name | grep -E 'PSU|RU' | grep '{{ db_version_short }}' | grep -v ${v_snapshot}` + v_db_version_short="{{ db_version_short }}" + for lv_name in `lvs --noheadings -o lv_name | grep -E 'PSU|RU' | grep "${v_db_version_short}" | grep -v ${v_snapshot}` do lvremove -f ${v_disk_vg}-${lv_name} done @@ -21,7 +22,7 @@ export PATH=$PATH:/sbin:/usr/sbin v_snapshot="{{ save_snapshot }}" v_disk='/dev/mapper/vg_u01-lv_u01' - if ! $(lvs -a | grep -q "${v_snapshot}") + if ! $(lvs -a | grep -q "lv_u01_${v_snapshot}") then v_size=$(lvs --noheadings -o seg_size ${v_disk}) if grep -q 'release 5.' /etc/oracle-release From f3fc0e012e09cae076bce1d2c9bc9850daace68b Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 14 Feb 2025 10:43:28 -0300 Subject: [PATCH 217/229] Add free RPM download process --- list_patches.yml | 11 +-- tasks/free_rpm_download.yml | 136 ++++++++++++++++++++++++++++++++++++ tasks/patch_main.yml | 10 +-- tasks/patch_tasks_pre.yml | 10 +++ tasks/setup_database.yml | 2 +- 5 files changed, 158 insertions(+), 11 deletions(-) create mode 100644 tasks/free_rpm_download.yml diff --git a/list_patches.yml b/list_patches.yml index 3f39695..7509bb8 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -1013,11 +1013,12 @@ list_23000: # - { type : "RU" , id : 7 , patch_number : 37366180 } - { type : "RU" , id : 6 , patch_number : 37037908 , apply_method : "gold_image" } - { type : "RU" , id : 7 , patch_number : 37370465 , apply_method : "gold_image" } - - { type : "FREE" , id : 2 , patch_number : 00000000 , apply_method : "download_tar" , apply_file : "u01.FreeRel2.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } - - { type : "FREE" , id : 3 , patch_number : 00000000 , apply_method : "download_tar" , apply_file : "u01.FreeRel3.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } - - { type : "FREE" , id : 4 , patch_number : 00000000 , apply_method : "download_tar" , apply_file : "u01.FreeRel4.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } - - { type : "FREE" , id : 5 , patch_number : 00000000 , apply_method : "download_tar" , apply_file : "u01.FreeRel5.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } - - { type : "FREE" , id : 6 , patch_number : 00000000 , apply_method : "download_tar" , apply_file : "u01.FreeRel6.tar.gz" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 2 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23c-2.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 3 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23c-3.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 4 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-4.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 5 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-5.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 6 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-6.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 7 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-7.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } # 23ai DPBP - { type : "DPBP" , id : 6 , patch_number : 37169536 , dep_type : 'RU' , dep_id : 6 } - { type : "DPBP" , id : 7 , patch_number : 37491421 , dep_type : 'RU' , dep_id : 7 } \ No newline at end of file diff --git a/tasks/free_rpm_download.yml b/tasks/free_rpm_download.yml new file mode 100644 index 0000000..1305818 --- /dev/null +++ b/tasks/free_rpm_download.yml @@ -0,0 +1,136 @@ +# If bucket +- block: + + - name: List files in OCI Bucket + include_role: + name: oci_object_storage_object_facts + vars: + object_action: "list" + oci_list_bucket: "{{ patch_location_bucket }}" + + - name: Download RPM file from OCI Bucket + shell: | + export LC_ALL=C.UTF-8 + export LANG=C.UTF-8 + oci os object get --bucket-name {{ patch_location_bucket }} --name {{ oci_download_file }} --file {{ shared_folder }}/{{ oci_download_file | basename }} + vars: + my_query: "{{ patch.apply_file }}" + oci_download_file: "{{ oci_action.objects | map(attribute='name') | select('search', my_query) | list | first }}" + when: oci_action.objects | map(attribute='name') | select('search', my_query) | list | length > 0 + + when: patch_location_type == "bucket" + +- name: Finding RPM File + find: + paths: "{{ shared_folder }}" + patterns: "{{ patch.apply_file }}" + recurse: "no" + file_type: "file" + register: find_result + +# If RPM was not found +- name: Could not find RPM file + fail: + msg: "Could not find RPM file." + when: find_result.files[0] is undefined + +## FREE RPM ## + +- name: Deploy new ORACLE_HOME + shell: | + set -eo pipefail + # Recreate oracle home + rm -rf /u01/app/oracle/product/database/dbhome_1 + mkdir /u01/app/oracle/product/database/dbhome_1 + # Unzip RPM + cd /u01/install + (rm -rf tmp; mkdir tmp; cd tmp; rpm2cpio {{ shared_folder }}/{{ patch.apply_file }} | cpio -i -d) + # Move RPM contents + mv ./tmp/opt/oracle/product/*/*/* $ORACLE_HOME + rmdir -p ./tmp/opt/oracle/product/*/*/ || true + # Clean leftover files + [ -d ./tmp/opt/ ] && exit 1 + rm -rf tmp + # Recreate oradata/fra + rm -rf /u01/app/{oradata,fra}; mkdir /u01/app/{oradata,fra} + # Remove old entries from inventory + sed -i '/^ /tmp/oratab.new; cat /tmp/oratab.new > /etc/oratab; rm -f /tmp/oratab.new + # Attach new home + $ORACLE_HOME/oui/bin/attachHome.sh -silent -ignoreSysPrereqs -force INVENTORY_LOCATION=/u01/app/oraInstall + environment: + ORACLE_HOME: "{{ dbhome_locl }}" + ORACLE_SID: "{{ mysid }}" + register: shell_output + become: true + become_user: oracle + delegate_to: "{{ vm_ip_address }}" + +- name: Call root.sh + shell: | + set -eo pipefail + $ORACLE_HOME/root.sh + environment: + ORACLE_HOME: "{{ dbhome_locl }}" + become: true + become_user: root + delegate_to: "{{ vm_ip_address }}" + +- name: Create new database + shell: | + set -eo pipefail + set +e + # Create database + $ORACLE_HOME/bin/dbca -silent -createDatabase \ + -gdbName orcl \ + -templateName FREE_Database.dbc \ + -characterSet AL32UTF8 \ + -createAsContainerDatabase true \ + -numberOfPDBs 1 \ + -pdbAdminPassword "Rodrigo.123" \ + -pdbName PDB01 \ + -useLocalUndoForPDBs true \ + -databaseConfigType SINGLE \ + -databaseType MULTIPURPOSE \ + -datafileDestination /u01/app/oradata \ + -dvConfiguration false \ + -emConfiguration NONE \ + -enableArchive false \ + -memoryMgmtType AUTO_SGA \ + -totalMemory 4000 \ + -nationalCharacterSet AL16UTF16 \ + -olsConfiguration false \ + -recoveryAreaDestination /u01/app/fra \ + -sampleSchema false \ + -sid FREE \ + -storageType FS \ + -useOMF false \ + -sysPassword "Rodrigo.123" \ + -systemPassword "Rodrigo.123" + v_ret=$? + # ret = 6 is "Successfully Setup Software with warning(s)." + if [ ${v_ret} -ne 0 -a ${v_ret} -ne 6 ] + then + exit 1 + fi + environment: + ORACLE_HOME: "{{ dbhome_locl }}" + ORACLE_SID: "{{ mysid }}" + register: shell_output + become: true + become_user: oracle + delegate_to: "{{ vm_ip_address }}" + +- name: DBCA Output + debug: msg="{{ shell_output.stdout_lines }}" + when: shell_output.stdout_lines is defined + +- name : "Remove RPM {{ find_result.files[0].path }} from shared folder" + file: + state: absent + path: "{{ find_result.files[0].path }}" + +# Stop the database +- include: run_sql.yml + vars: + sql_param : { file : "shutdown.sql" , folder : "patch_sql" , task_action : "Stop Database" } \ No newline at end of file diff --git a/tasks/patch_main.yml b/tasks/patch_main.yml index 7d21534..7ccc224 100644 --- a/tasks/patch_main.yml +++ b/tasks/patch_main.yml @@ -120,6 +120,10 @@ when: patch.apply_method is defined and patch.apply_method == "gold_image" delegate_to: "{{ vm_ip_address }}" + # Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" + - set_fact: shell_output="{{tmp_shell_output}}" + when: tmp_shell_output is not skipped + - name: Call root.sh shell: | set -eo pipefail @@ -131,11 +135,7 @@ when: patch.apply_method is defined and patch.apply_method == "gold_image" delegate_to: "{{ vm_ip_address }}" - # Put the value inside another variable to avoid it from getting replaced with "skip_reason": "Conditional result was False" - - set_fact: shell_output="{{tmp_shell_output}}" - when: tmp_shell_output is not skipped - - - name: Opatch Output + - name: Patch Output debug: msg="{{ shell_output.stdout_lines }}" when: shell_output.stdout_lines is defined diff --git a/tasks/patch_tasks_pre.yml b/tasks/patch_tasks_pre.yml index 5b9e78d..0da8ef5 100644 --- a/tasks/patch_tasks_pre.yml +++ b/tasks/patch_tasks_pre.yml @@ -121,6 +121,12 @@ when: not database_started + # This is needed when database is started already and there are multiple home PATHs (23ai) + - name : Override DB Home + set_fact: + dbhome_locl: "{{ patch.oracle_home }}" + when: database_started and patch.oracle_home is defined + # Check if there is an image of the requested patch. # If this is the case, we can skip the patch operations (set perform_patch_actions to false). - block: @@ -244,6 +250,10 @@ - include: tar_restore.yml tar_file="{{ patch.apply_file }}" when: restore_from_tar and patch.apply_method == "tar" + # When download_rpm is true + - include: free_rpm_download.yml + when: patch.apply_method == "download_rpm" + # When patch has a pre-req, call the prepare_dependency script to setup. - include: prepare_dependency.yml when: patch.dep_type is defined and not restore_from_tar and not restore_from_lvm diff --git a/tasks/setup_database.yml b/tasks/setup_database.yml index e9b62f3..920a947 100644 --- a/tasks/setup_database.yml +++ b/tasks/setup_database.yml @@ -18,7 +18,7 @@ - name : Fail when ORACLE_HOME is null fail: msg: "Could not find ORACLE_HOME. Check if database {{ mysid }} is registered in /etc/oratab." - when: dbhomeoutput.stdout == '' + when: dbhome_locl == '' - block: From f2031f47fb806f9f67107c1a70f4c37f850c60d3 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 15 Apr 2025 19:30:03 -0300 Subject: [PATCH 218/229] Update list_patches.yml --- list_patches.yml | 205 +++++++++++++++++++++++++++++++---------------- 1 file changed, 138 insertions(+), 67 deletions(-) diff --git a/list_patches.yml b/list_patches.yml index 7509bb8..852c5ef 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -759,6 +759,35 @@ list_18000: - { type : "RU" , id : 27 , patch_number : 36682577 } # NOT AVAILABLE TO DOWNLOAD - { type : "RU" , id : 28 , patch_number : 36941408 } # NOT AVAILABLE TO DOWNLOAD - { type : "RU" , id : 29 , patch_number : 37318028 } # NOT AVAILABLE TO DOWNLOAD +# 18c GI + - { type : "GI" , id : 2 , patch_number : 27681568 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 3 , patch_number : 28096386 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 4 , patch_number : 28659165 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 5 , patch_number : 28828717 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 6 , patch_number : 29301682 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 7 , patch_number : 29708703 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 8 , patch_number : 30116795 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 9 , patch_number : 30480702 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 10 , patch_number : 30899645 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 11 , patch_number : 31305362 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 12 , patch_number : 31748523 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 13 , patch_number : 32226219 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 14 , patch_number : 32524152 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 15 , patch_number : 32905273 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } # NOT AVAILABLE TO DOWNLOAD + - { type : "GI" , id : 16 , patch_number : 33334777 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } # NOT AVAILABLE TO DOWNLOAD + - { type : "GI" , id : 17 , patch_number : 33582710 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 18 , patch_number : 33878362 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } # NOT AVAILABLE TO DOWNLOAD + - { type : "GI" , id : 19 , patch_number : 34219576 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } # NOT AVAILABLE TO DOWNLOAD + - { type : "GI" , id : 20 , patch_number : 34517244 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } # NOT AVAILABLE TO DOWNLOAD + - { type : "GI" , id : 21 , patch_number : 34853460 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } # NOT AVAILABLE TO DOWNLOAD + - { type : "GI" , id : 22 , patch_number : 35114007 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } # NOT AVAILABLE TO DOWNLOAD + - { type : "GI" , id : 23 , patch_number : 35405749 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } # NOT AVAILABLE TO DOWNLOAD + - { type : "GI" , id : 24 , patch_number : 35743376 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } # NOT AVAILABLE TO DOWNLOAD + - { type : "GI" , id : 25 , patch_number : 35962393 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } # NOT AVAILABLE TO DOWNLOAD + - { type : "GI" , id : 26 , patch_number : 36338157 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } # NOT AVAILABLE TO DOWNLOAD + - { type : "GI" , id : 27 , patch_number : 36681295 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } # NOT AVAILABLE TO DOWNLOAD + - { type : "GI" , id : 28 , patch_number : 36940355 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } # NOT AVAILABLE TO DOWNLOAD + - { type : "GI" , id : 29 , patch_number : 37313863 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } # NOT AVAILABLE TO DOWNLOAD # 18c RUR # - { type : "RUR" , id : 1 , patch_number : 28346593 , base_ru : '18.2' } # - { type : "RUR" , id : 2 , patch_number : 28601267 , base_ru : '18.2' } @@ -848,21 +877,46 @@ list_19000: - { type : "RU" , id : 24 , patch_number : 36582781 } - { type : "RU" , id : 25 , patch_number : 36912597 } - { type : "RU" , id : 26 , patch_number : 37260974 } +# 19c GI + - { type : "GI" , id : 3 , patch_number : 29517302 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 4 , patch_number : 29708769 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 5 , patch_number : 30116789 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 6 , patch_number : 30501910 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 7 , patch_number : 30899722 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 8 , patch_number : 31305339 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 9 , patch_number : 31750108 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 10 , patch_number : 32226239 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 11 , patch_number : 32545008 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 12 , patch_number : 32895426 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 13 , patch_number : 33182768 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 14 , patch_number : 33509923 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 15 , patch_number : 33803476 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 16 , patch_number : 34130714 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 17 , patch_number : 34416665 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 18 , patch_number : 34762026 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 19 , patch_number : 35037840 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 20 , patch_number : 35319490 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 21 , patch_number : 35642822 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 22 , patch_number : 35940989 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 23 , patch_number : 36233126 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 24 , patch_number : 36582629 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 25 , patch_number : 36916690 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 26 , patch_number : 37257886 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } # 19c RUR - - { type : "RUR" , id : 1 , patch_number : 29799057 , base_ru : '19.3' } - - { type : "RUR" , id : 2 , patch_number : 30087906 , base_ru : '19.3' } - - { type : "RUR" , id : 1 , patch_number : 30080447 , base_ru : '19.4' } - - { type : "RUR" , id : 2 , patch_number : 30446228 , base_ru : '19.4' } - - { type : "RUR" , id : 1 , patch_number : 30446054 , base_ru : '19.5' } - - { type : "RUR" , id : 2 , patch_number : 30830913 , base_ru : '19.5' } - - { type : "RUR" , id : 1 , patch_number : 30797938 , base_ru : '19.6' } - - { type : "RUR" , id : 2 , patch_number : 31212138 , base_ru : '19.6' } - - { type : "RUR" , id : 1 , patch_number : 31204483 , base_ru : '19.7' } - - { type : "RUR" , id : 2 , patch_number : 31667176 , base_ru : '19.7' } - - { type : "RUR" , id : 1 , patch_number : 31666885 , base_ru : '19.8' } - - { type : "RUR" , id : 2 , patch_number : 32066676 , base_ru : '19.8' } - - { type : "RUR" , id : 1 , patch_number : 32072711 , base_ru : '19.9' } - - { type : "RUR" , id : 2 , patch_number : 32421507 , base_ru : '19.9' } + - { type : "RUR" , id : 1 , patch_number : 29799057 , base_ru : '19.3' } + - { type : "RUR" , id : 2 , patch_number : 30087906 , base_ru : '19.3' } + - { type : "RUR" , id : 1 , patch_number : 30080447 , base_ru : '19.4' } + - { type : "RUR" , id : 2 , patch_number : 30446228 , base_ru : '19.4' } + - { type : "RUR" , id : 1 , patch_number : 30446054 , base_ru : '19.5' } + - { type : "RUR" , id : 2 , patch_number : 30830913 , base_ru : '19.5' } + - { type : "RUR" , id : 1 , patch_number : 30797938 , base_ru : '19.6' } + - { type : "RUR" , id : 2 , patch_number : 31212138 , base_ru : '19.6' } + - { type : "RUR" , id : 1 , patch_number : 31204483 , base_ru : '19.7' } + - { type : "RUR" , id : 2 , patch_number : 31667176 , base_ru : '19.7' } + - { type : "RUR" , id : 1 , patch_number : 31666885 , base_ru : '19.8' } + - { type : "RUR" , id : 2 , patch_number : 32066676 , base_ru : '19.8' } + - { type : "RUR" , id : 1 , patch_number : 32072711 , base_ru : '19.9' } + - { type : "RUR" , id : 2 , patch_number : 32421507 , base_ru : '19.9' } - { type : "RUR" , id : 1 , patch_number : 32441092 , base_ru : '19.10' } - { type : "RUR" , id : 2 , patch_number : 32819074 , base_ru : '19.10' } - { type : "RUR" , id : 3 , patch_number : 32923627 , base_ru : '19.10' } @@ -956,69 +1010,86 @@ list_19000: - { type : "OJVM" , id : 241015 , patch_number : 36878697 } - { type : "OJVM" , id : 250121 , patch_number : 37102264 } # 19c DPBP - - { type : "DPBP" , id : 10 , patch_number : 32583144 , dep_type : 'RU' , dep_id : 10 } - - { type : "DPBP" , id : 11 , patch_number : 32958059 , dep_type : 'RU' , dep_id : 11 } - - { type : "DPBP" , id : 12 , patch_number : 33590062 , dep_type : 'RU' , dep_id : 12 } - - { type : "DPBP" , id : 13 , patch_number : 33952087 , dep_type : 'RU' , dep_id : 13 } - - { type : "DPBP" , id : 14 , patch_number : 34423086 , dep_type : 'RU' , dep_id : 14 } - - { type : "DPBP" , id : 15 , patch_number : 34547013 , dep_type : 'RU' , dep_id : 15 } - - { type : "DPBP" , id : 16 , patch_number : 34620690 , dep_type : 'RU' , dep_id : 16 } - - { type : "DPBP" , id : 17 , patch_number : 34734035 , dep_type : 'RU' , dep_id : 17 } - - { type : "DPBP" , id : 18 , patch_number : 34972375 , dep_type : 'RU' , dep_id : 18 } - - { type : "DPBP" , id : 19 , patch_number : 35261302 , dep_type : 'RU' , dep_id : 19 } - - { type : "DPBP" , id : 20 , patch_number : 35512813 , dep_type : 'RU' , dep_id : 20 } - - { type : "DPBP" , id : 21 , patch_number : 35787077 , dep_type : 'RU' , dep_id : 21 } - - { type : "DPBP" , id : 22 , patch_number : 36092868 , dep_type : 'RU' , dep_id : 22 } - - { type : "DPBP" , id : 23 , patch_number : 36420641 , dep_type : 'RU' , dep_id : 23 } - - { type : "DPBP" , id : 24 , patch_number : 36682332 , dep_type : 'RU' , dep_id : 24 } - - { type : "DPBP" , id : 25 , patch_number : 37056207 , dep_type : 'RU' , dep_id : 25 } - - { type : "DPBP" , id : 26 , patch_number : 37470729 , dep_type : 'RU' , dep_id : 26 } + - { type : "DPBP" , id : 10 , patch_number : 32583144 , dep_type : 'RU' , dep_id : 10 } + - { type : "DPBP" , id : 11 , patch_number : 32958059 , dep_type : 'RU' , dep_id : 11 } + - { type : "DPBP" , id : 12 , patch_number : 33590062 , dep_type : 'RU' , dep_id : 12 } + - { type : "DPBP" , id : 13 , patch_number : 33952087 , dep_type : 'RU' , dep_id : 13 } + - { type : "DPBP" , id : 14 , patch_number : 34423086 , dep_type : 'RU' , dep_id : 14 } + - { type : "DPBP" , id : 15 , patch_number : 34547013 , dep_type : 'RU' , dep_id : 15 } + - { type : "DPBP" , id : 16 , patch_number : 34620690 , dep_type : 'RU' , dep_id : 16 } + - { type : "DPBP" , id : 17 , patch_number : 34734035 , dep_type : 'RU' , dep_id : 17 } + - { type : "DPBP" , id : 18 , patch_number : 34972375 , dep_type : 'RU' , dep_id : 18 } + - { type : "DPBP" , id : 19 , patch_number : 35261302 , dep_type : 'RU' , dep_id : 19 } + - { type : "DPBP" , id : 20 , patch_number : 35512813 , dep_type : 'RU' , dep_id : 20 } + - { type : "DPBP" , id : 21 , patch_number : 35787077 , dep_type : 'RU' , dep_id : 21 } + - { type : "DPBP" , id : 22 , patch_number : 36092868 , dep_type : 'RU' , dep_id : 22 } + - { type : "DPBP" , id : 23 , patch_number : 36420641 , dep_type : 'RU' , dep_id : 23 } + - { type : "DPBP" , id : 24 , patch_number : 36682332 , dep_type : 'RU' , dep_id : 24 } + - { type : "DPBP" , id : 25 , patch_number : 37056207 , dep_type : 'RU' , dep_id : 25 } + - { type : "DPBP" , id : 26 , patch_number : 37470729 , dep_type : 'RU' , dep_id : 26 } #################### ##### 21.0.0.0 ##### #################### list_21000: -# - { type : "RU" , id : 3 , patch_number : 00000000 , base_snap : "21.2.0" } - - { type : "RU" , id : 4 , patch_number : 33239276 } - - { type : "RU" , id : 5 , patch_number : 33516412 } - - { type : "RU" , id : 6 , patch_number : 33843745 } - - { type : "RU" , id : 7 , patch_number : 34160444 } - - { type : "RU" , id : 8 , patch_number : 34527084 } - - { type : "RU" , id : 9 , patch_number : 34839741 } - - { type : "RU" , id : 10 , patch_number : 35134934 } - - { type : "RU" , id : 11 , patch_number : 35428978 } - - { type : "RU" , id : 12 , patch_number : 35740258 } - - { type : "RU" , id : 13 , patch_number : 36041222 } - - { type : "RU" , id : 14 , patch_number : 36352352 } - - { type : "RU" , id : 15 , patch_number : 36696242 } - - { type : "RU" , id : 16 , patch_number : 36991631 } - - { type : "RU" , id : 17 , patch_number : 37350281 } +# - { type : "RU" , id : 3 , patch_number : 00000000 , base_snap : "21.2.0" } + - { type : "RU" , id : 4 , patch_number : 33239276 } + - { type : "RU" , id : 5 , patch_number : 33516412 } + - { type : "RU" , id : 6 , patch_number : 33843745 } + - { type : "RU" , id : 7 , patch_number : 34160444 } + - { type : "RU" , id : 8 , patch_number : 34527084 } + - { type : "RU" , id : 9 , patch_number : 34839741 } + - { type : "RU" , id : 10 , patch_number : 35134934 } + - { type : "RU" , id : 11 , patch_number : 35428978 } + - { type : "RU" , id : 12 , patch_number : 35740258 } + - { type : "RU" , id : 13 , patch_number : 36041222 } + - { type : "RU" , id : 14 , patch_number : 36352352 } + - { type : "RU" , id : 15 , patch_number : 36696242 } + - { type : "RU" , id : 16 , patch_number : 36991631 } + - { type : "RU" , id : 17 , patch_number : 37350281 } + - { type : "GI" , id : 4 , patch_number : 33250101 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 5 , patch_number : 33531909 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 6 , patch_number : 33859395 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 7 , patch_number : 34155589 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 8 , patch_number : 34526142 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 9 , patch_number : 34838415 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 10 , patch_number : 35132566 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 11 , patch_number : 35427907 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 12 , patch_number : 35738010 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 13 , patch_number : 36031790 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 14 , patch_number : 36352207 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 15 , patch_number : 36696109 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 16 , patch_number : 36990664 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 17 , patch_number : 37349593 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } #################### ##### 23.0.0.0 ##### #################### list_23000: -# - { type : "BETA" , id : 1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta1.tar.gz" } -# - { type : "BETA" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta2.tar.gz" } -# - { type : "BETA" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta3.tar.gz" } -# - { type : "BETA" , id : 4 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta4.tar.gz" } - - { type : "RU" , id : 4 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.RU_4_0.tar.gz" } - - { type : "RU" , id : 4.1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.RU_4_1.tar.gz" } - - { type : "RU" , id : 5 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.RUGI_5_0.tar.gz" } -# - { type : "RU" , id : 5 , patch_number : 36741532 , dep_type : 'RU' , dep_id : 4 } - - { type : "BASE" , id : 5 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.BASE_5_0.tar.gz" } -# - { type : "RU" , id : 6 , patch_number : 37037086 } -# - { type : "RU" , id : 7 , patch_number : 37366180 } - - { type : "RU" , id : 6 , patch_number : 37037908 , apply_method : "gold_image" } - - { type : "RU" , id : 7 , patch_number : 37370465 , apply_method : "gold_image" } - - { type : "FREE" , id : 2 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23c-2.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } - - { type : "FREE" , id : 3 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23c-3.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } - - { type : "FREE" , id : 4 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-4.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } - - { type : "FREE" , id : 5 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-5.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } - - { type : "FREE" , id : 6 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-6.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } - - { type : "FREE" , id : 7 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-7.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } +# - { type : "BETA" , id : 1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta1.tar.gz" } +# - { type : "BETA" , id : 2 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta2.tar.gz" } +# - { type : "BETA" , id : 3 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta3.tar.gz" } +# - { type : "BETA" , id : 4 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.Beta4.tar.gz" } + - { type : "RU" , id : 4 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.RU_4_0.tar.gz" } + - { type : "RU" , id : 4.1 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.RU_4_1.tar.gz" } + - { type : "RU" , id : 5 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.RUGI_5_0.tar.gz" } +# - { type : "RU" , id : 5 , patch_number : 36741532 , dep_type : 'RU' , dep_id : 4 } + - { type : "BASE" , id : 5 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.BASE_5_0.tar.gz" } +# - { type : "RU" , id : 6 , patch_number : 37037086 } +# - { type : "RU" , id : 7 , patch_number : 37366180 } + - { type : "RU" , id : 6 , patch_number : 37037908 , apply_method : "gold_image" } + - { type : "RU" , id : 7 , patch_number : 37370465 , apply_method : "gold_image" } +# - { type : "GI" , id : 5 , patch_number : 36739878 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 6 , patch_number : 37031054 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 7 , patch_number : 37353687 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "FREE" , id : 2 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23c-2.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 3 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23c-3.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 4 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-4.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 5 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-5.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 6 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-6.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 7 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-7.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } # 23ai DPBP - - { type : "DPBP" , id : 6 , patch_number : 37169536 , dep_type : 'RU' , dep_id : 6 } - - { type : "DPBP" , id : 7 , patch_number : 37491421 , dep_type : 'RU' , dep_id : 7 } \ No newline at end of file + - { type : "DPBP" , id : 6 , patch_number : 37169536 , dep_type : 'RU' , dep_id : 6 } + - { type : "DPBP" , id : 7 , patch_number : 37491421 , dep_type : 'RU' , dep_id : 7 } \ No newline at end of file From 1585af539d757a67972a821ac1d8266a1b9ea40e Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 15 Apr 2025 19:30:50 -0300 Subject: [PATCH 219/229] Add upload_only capability for xml of GI patches --- tasks/patch_main.yml | 34 +++++++++++++++++-- tasks/patch_main_11g.yml | 4 +++ tasks/patch_tasks_pre.yml | 4 +-- .../odbfcl/adb_load_expdp/adb_load_expdp.yml | 14 ++++---- 4 files changed, 45 insertions(+), 11 deletions(-) diff --git a/tasks/patch_main.yml b/tasks/patch_main.yml index 7ccc224..0e992b6 100644 --- a/tasks/patch_main.yml +++ b/tasks/patch_main.yml @@ -173,7 +173,7 @@ when: patch.type == "OJVM" - when: perform_patch_actions + when: perform_patch_actions and patch.upload_only is not defined # Start the database - include: run_sql.yml @@ -219,13 +219,43 @@ become_user: oracle delegate_to: "{{ vm_ip_address }}" + - name: Set load file name + set_fact: + load_file_name: "{{ dump_file_prefix }}.dmp" + + # User custom post-scripts + - include: run_script.yml + loop: "{{ user_expdp_post | flatten(levels=1) }}" + loop_control: + loop_var: script_param + + when: not only_deploy_patch and patch.upload_only is not defined + + # When patch.upload_only is defined and true + - block: + + # User custom pre-scripts + - name: Save patch file + shell: | + cp -av {{ db_patch }} {{ shared_folder }}/{{ dump_file_prefix }}.zip + touch {{ shared_folder }}/{{ dump_file_prefix }}.dmp + touch {{ shared_folder }}/{{ dump_file_prefix }}.log + + - name: Set load file name + set_fact: + load_file_name: "{{ dump_file_prefix }}.zip" + # User custom post-scripts - include: run_script.yml loop: "{{ user_expdp_post | flatten(levels=1) }}" loop_control: loop_var: script_param - when: not only_deploy_patch + - name: Remove patch file + shell: | + rm -f {{ shared_folder }}/{{ dump_file_prefix }}.zip + + when: not only_deploy_patch and patch.upload_only is defined and patch.upload_only # Post Actions - include: patch_tasks_post.yml diff --git a/tasks/patch_main_11g.yml b/tasks/patch_main_11g.yml index d4d3b5f..995b50f 100644 --- a/tasks/patch_main_11g.yml +++ b/tasks/patch_main_11g.yml @@ -186,6 +186,10 @@ become_user: oracle delegate_to: "{{ vm_ip_address }}" + - name: Set load file name + set_fact: + load_file_name: "{{ dump_file_prefix }}.dmp" + # User custom post-scripts - name: Run user custom post-scripts include: run_script.yml diff --git a/tasks/patch_tasks_pre.yml b/tasks/patch_tasks_pre.yml index 0da8ef5..5faadcd 100644 --- a/tasks/patch_tasks_pre.yml +++ b/tasks/patch_tasks_pre.yml @@ -218,7 +218,7 @@ file: state: absent path: "{{ db_patch }}" - when: patch_location_type == "bucket" + when: patch_location_type == "bucket" and (patch.upload_only is undefined or only_deploy_patch) when: perform_patch_actions @@ -252,7 +252,7 @@ # When download_rpm is true - include: free_rpm_download.yml - when: patch.apply_method == "download_rpm" + when: patch.apply_method is defined and patch.apply_method == "download_rpm" # When patch has a pre-req, call the prepare_dependency script to setup. - include: prepare_dependency.yml diff --git a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml index c90b9b0..68dd072 100644 --- a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml +++ b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml @@ -1,8 +1,8 @@ # For main.yml, the pre_prepare_dump_file.yml won't be called. # So dump_stat_result may be false if the dump was created on this execution. -- name: "Check if {{ shared_folder }}/{{ dump_file_prefix }}.dmp exists" +- name: "Check if {{ shared_folder }}/{{ load_file_name }} exists" stat: - path: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" + path: "{{ shared_folder }}/{{ load_file_name }}" register: dump_stat_result # This dump_stat_result.stat.exists block is required only because this code is used @@ -17,7 +17,7 @@ vars: oci_upload_bucket: "{{ oci_adb_bucket }}" oci_object_name: "{{ oci_upload_file | basename }}" - oci_upload_file: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" + oci_upload_file: "{{ shared_folder }}/{{ load_file_name }}" object_action: "create" # This is done because expdp/impdp still can't handle Credential using oracle native authentication (instance principal, tenancy id, etc), only swift. @@ -27,7 +27,7 @@ cred : "{{ oci_adb_main_tns }}" , file : "adb_oradir_copy_file.sql" , folder : "user_scripts/odbfcl/adb_load_expdp" , - params : "'{{ oci_adb_credential }}' '{{ oci_adb_os_url_prefix }}/{{ dump_file_prefix }}.dmp'" + params : "'{{ oci_adb_credential }}' '{{ oci_adb_os_url_prefix }}/{{ load_file_name }}'" } - name: Remove expdp from OCI Bucket @@ -35,7 +35,7 @@ name: oci_object_storage_object vars: oci_upload_bucket: "{{ oci_adb_bucket }}" - oci_object_name: "{{ dump_file_prefix }}.dmp" + oci_object_name: "{{ load_file_name }}" object_action: "remove" - include: tasks/local_sqlplus.yml @@ -44,7 +44,7 @@ cred : "{{ oci_adb_main_tns }}" , file : "adb_process_dp_dump.sql" , folder : "user_scripts/odbfcl/adb_load_expdp" , - params : "'{{ db_version }}' '{{ patch.base_ru | default('') }}{{ patch.type }}' '{{ patch.id }}' '{{ dump_file_prefix }}.dmp'" + params : "'{{ db_version }}' '{{ patch.base_ru | default('') }}{{ patch.type }}' '{{ patch.id }}' '{{ load_file_name }}'" } - include: tasks/local_sqlplus.yml @@ -53,7 +53,7 @@ cred : "{{ oci_adb_main_tns }}" , file : "adb_oradir_remove_file.sql" , folder : "user_scripts/odbfcl/adb_load_expdp" , - params : "'{{ dump_file_prefix }}.dmp'" + params : "'{{ load_file_name }}'" } - include: tasks/local_sqlplus.yml From 868187062c0b8330d5e5bf85b498a95764f922df Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Tue, 15 Jul 2025 16:20:49 -0300 Subject: [PATCH 220/229] New patches 2025-Apr --- list_exceptions.yml | 2 ++ list_patches.yml | 39 ++++++++++++++++++++++++++++++++------- tasks/impdp_file_adb.yml | 4 ++++ 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/list_exceptions.yml b/list_exceptions.yml index ba61d28..108985c 100644 --- a/list_exceptions.yml +++ b/list_exceptions.yml @@ -30,6 +30,7 @@ list_retry_datapatch: - { version: "12.1.0.2" , type : "BP" , id : 240716 , retries : 3 } - { version: "12.1.0.2" , type : "BP" , id : 241015 , retries : 3 } - { version: "12.1.0.2" , type : "BP" , id : 250121 , retries : 3 } + - { version: "12.1.0.2" , type : "BP" , id : 250415 , retries : 3 } ###### - { version: "12.1.0.2" , type : "PSU" , id : 200714 , retries : 2 } - { version: "12.1.0.2" , type : "PSU" , id : 201020 , retries : 2 } @@ -48,6 +49,7 @@ list_retry_datapatch: - { version: "12.1.0.2" , type : "PSU" , id : 240416 , retries : 2 } - { version: "12.1.0.2" , type : "PSU" , id : 240716 , retries : 2 } - { version: "12.1.0.2" , type : "PSU" , id : 241015 , retries : 2 } + - { version: "12.1.0.2" , type : "PSU" , id : 250415 , retries : 2 } ###### - { version: "12.2.0.1" , type : "RU" , id : 190716 , retries : 1 } - { version: "12.2.0.1" , type : "RU" , id : 191015 , retries : 1 } diff --git a/list_patches.yml b/list_patches.yml index 852c5ef..b8c82dd 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -341,6 +341,7 @@ list_11204: - { type : "PSU" , id : 240716 , patch_number : 36575425 } # - { type : "PSU" , id : 241015 , patch_number : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED # - { type : "PSU" , id : 250121 , patch_number : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED + - { type : "PSU" , id : 250415 , patch_number : 37608089 } # 11.2.0.4 OJVM - { type : "OJVM" , id : 1 , patch_number : 19282021 } - { type : "OJVM" , id : 2 , patch_number : 19877440 } @@ -384,6 +385,7 @@ list_11204: - { type : "OJVM" , id : 240716 , patch_number : 36533106 } - { type : "OJVM" , id : 241015 , patch_number : 36878781 } - { type : "OJVM" , id : 250121 , patch_number : 37226818 } + - { type : "OJVM" , id : 250415 , patch_number : 37547668 } # 11.2.0.4 BP - { type : "BP" , id : 1 , patch_number : 17628025 , patch_folder : 17628006 } - { type : "BP" , id : 2 , patch_number : 17838803 , patch_folder : 17741631 } @@ -444,6 +446,7 @@ list_11204: - { type : "BP" , id : 240716 , patch_number : 36663546 , patch_folder : 36521957 } # - { type : "BP" , id : 241015 , patch_number : xxxxxxxx , patch_folder : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED # - { type : "BP" , id : 250121 , patch_number : xxxxxxxx , patch_folder : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED + - { type : "BP" , id : 250415 , patch_number : 37712353 , patch_folder : 37608128 } #################### ##### 12.1.0.1 ##### @@ -527,6 +530,7 @@ list_12102: - { type : "PSU" , id : 240716 , patch_number : 36519012 } - { type : "PSU" , id : 241015 , patch_number : 36834621 } # - { type : "PSU" , id : 250121 , patch_number : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED + - { type : "PSU" , id : 250415 , patch_number : 37608146 } # 12.1.0.2 OJVM - { type : "OJVM" , id : 1 , patch_number : 19282028 } - { type : "OJVM" , id : 2 , patch_number : 19877336 } @@ -570,6 +574,7 @@ list_12102: - { type : "OJVM" , id : 240716 , patch_number : 36533098 } - { type : "OJVM" , id : 241015 , patch_number : 36878764 } - { type : "OJVM" , id : 250121 , patch_number : 37226811 } + - { type : "OJVM" , id : 250415 , patch_number : 37547662 } # 12.1.0.2 BP - { type : "BP" , id : 1 , patch_number : 19404326 , patch_folder : 19189240 } - { type : "BP" , id : 2 , patch_number : 19774304 , patch_folder : 19649591 } @@ -621,6 +626,7 @@ list_12102: - { type : "BP" , id : 240716 , patch_number : 36663406 , patch_folder : 36519004 } - { type : "BP" , id : 241015 , patch_number : 36961411 , patch_folder : 36834630 } - { type : "BP" , id : 250121 , patch_number : 37372537 , patch_folder : 37226852 } + - { type : "BP" , id : 250415 , patch_number : 37712366 , patch_folder : 37608165 } #################### ##### 12.2.0.1 ##### @@ -662,6 +668,7 @@ list_12201: - { type : "RU" , id : 240716 , patch_number : 36650048 } - { type : "RU" , id : 241015 , patch_number : 36941400 } - { type : "RU" , id : 250121 , patch_number : 37317999 } + - { type : "RU" , id : 250415 , patch_number : 37742706 } # 12.2.0.1 RUR - { type : "RUR" , id : 171017 , patch_number : 26518812 , base_ru : JUL2017 } - { type : "RUR" , id : 180116 , patch_number : 27013506 , base_ru : JUL2017 } @@ -720,6 +727,7 @@ list_12201: - { type : "OJVM" , id : 240716 , patch_number : 36533083 } - { type : "OJVM" , id : 241015 , patch_number : 36878737 } - { type : "OJVM" , id : 250121 , patch_number : 37226803 } + - { type : "OJVM" , id : 250415 , patch_number : 37547642 } #################### ##### 18.0.0.0 ##### @@ -877,6 +885,7 @@ list_19000: - { type : "RU" , id : 24 , patch_number : 36582781 } - { type : "RU" , id : 25 , patch_number : 36912597 } - { type : "RU" , id : 26 , patch_number : 37260974 } + - { type : "RU" , id : 27 , patch_number : 37642901 } # 19c GI - { type : "GI" , id : 3 , patch_number : 29517302 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 4 , patch_number : 29708769 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } @@ -902,6 +911,7 @@ list_19000: - { type : "GI" , id : 24 , patch_number : 36582629 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 25 , patch_number : 36916690 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 26 , patch_number : 37257886 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 27 , patch_number : 37641958 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } # 19c RUR - { type : "RUR" , id : 1 , patch_number : 29799057 , base_ru : '19.3' } - { type : "RUR" , id : 2 , patch_number : 30087906 , base_ru : '19.3' } @@ -984,6 +994,12 @@ list_19000: - { type : "MRP" , id : 241119 , patch_number : 37244031 , base_ru : '19.25' , dep_type : 'RU' , dep_id : 25 , apply_method : "napply" } - { type : "MRP" , id : 241217 , patch_number : 37331661 , base_ru : '19.25' , dep_type : 'RU' , dep_id : 25 , apply_method : "napply" } - { type : "MRP" , id : 250121 , patch_number : 37446465 , base_ru : '19.25' , dep_type : 'RU' , dep_id : 25 , apply_method : "napply" } + - { type : "MRP" , id : 250218 , patch_number : 37546427 , base_ru : '19.25' , dep_type : 'RU' , dep_id : 25 , apply_method : "napply" } + - { type : "MRP" , id : 250318 , patch_number : 37663443 , base_ru : '19.25' , dep_type : 'RU' , dep_id : 25 , apply_method : "napply" } + - { type : "MRP" , id : 250415 , patch_number : 37769916 , base_ru : '19.25' , dep_type : 'RU' , dep_id : 25 , apply_method : "napply" } + - { type : "MRP" , id : 250218 , patch_number : 37546431 , base_ru : '19.26' , dep_type : 'RU' , dep_id : 26 , apply_method : "napply" } + - { type : "MRP" , id : 250318 , patch_number : 37663483 , base_ru : '19.26' , dep_type : 'RU' , dep_id : 26 , apply_method : "napply" } + - { type : "MRP" , id : 250415 , patch_number : 37769923 , base_ru : '19.26' , dep_type : 'RU' , dep_id : 26 , apply_method : "napply" } # 19c OJVM - { type : "OJVM" , id : 190416 , patch_number : 29548437 } - { type : "OJVM" , id : 190716 , patch_number : 29774421 } @@ -1009,6 +1025,7 @@ list_19000: - { type : "OJVM" , id : 240716 , patch_number : 36414915 } - { type : "OJVM" , id : 241015 , patch_number : 36878697 } - { type : "OJVM" , id : 250121 , patch_number : 37102264 } + - { type : "OJVM" , id : 250415 , patch_number : 37499406 } # 19c DPBP - { type : "DPBP" , id : 10 , patch_number : 32583144 , dep_type : 'RU' , dep_id : 10 } - { type : "DPBP" , id : 11 , patch_number : 32958059 , dep_type : 'RU' , dep_id : 11 } @@ -1027,6 +1044,7 @@ list_19000: - { type : "DPBP" , id : 24 , patch_number : 36682332 , dep_type : 'RU' , dep_id : 24 } - { type : "DPBP" , id : 25 , patch_number : 37056207 , dep_type : 'RU' , dep_id : 25 } - { type : "DPBP" , id : 26 , patch_number : 37470729 , dep_type : 'RU' , dep_id : 26 } + - { type : "DPBP" , id : 27 , patch_number : 37777295 , dep_type : 'RU' , dep_id : 27 } #################### ##### 21.0.0.0 ##### @@ -1048,6 +1066,7 @@ list_21000: - { type : "RU" , id : 15 , patch_number : 36696242 } - { type : "RU" , id : 16 , patch_number : 36991631 } - { type : "RU" , id : 17 , patch_number : 37350281 } + - { type : "RU" , id : 18 , patch_number : 37655430 } - { type : "GI" , id : 4 , patch_number : 33250101 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 5 , patch_number : 33531909 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 6 , patch_number : 33859395 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } @@ -1062,6 +1081,7 @@ list_21000: - { type : "GI" , id : 15 , patch_number : 36696109 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 16 , patch_number : 36990664 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 17 , patch_number : 37349593 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 18 , patch_number : 37642955 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } #################### ##### 23.0.0.0 ##### @@ -1079,17 +1099,22 @@ list_23000: - { type : "BASE" , id : 5 , patch_number : 00000000 , apply_method : "tar" , apply_file : "/u01.BASE_5_0.tar.gz" } # - { type : "RU" , id : 6 , patch_number : 37037086 } # - { type : "RU" , id : 7 , patch_number : 37366180 } +# - { type : "RU" , id : 8 , patch_number : 37701421 } - { type : "RU" , id : 6 , patch_number : 37037908 , apply_method : "gold_image" } - { type : "RU" , id : 7 , patch_number : 37370465 , apply_method : "gold_image" } + - { type : "RU" , id : 8 , patch_number : 37703495 , apply_method : "gold_image" } # - { type : "GI" , id : 5 , patch_number : 36739878 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 6 , patch_number : 37031054 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 7 , patch_number : 37353687 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - - { type : "FREE" , id : 2 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23c-2.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } - - { type : "FREE" , id : 3 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23c-3.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } - - { type : "FREE" , id : 4 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-4.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } - - { type : "FREE" , id : 5 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-5.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } - - { type : "FREE" , id : 6 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-6.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } - - { type : "FREE" , id : 7 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-7.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } + - { type : "GI" , id : 8 , patch_number : 37689703 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "FREE" , id : 2 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23c-23.2-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 3 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23c-23.3-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 4 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-23.4-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 5 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-23.5-2.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 6 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-23.6-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 7 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-23.7-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 8 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-23.8-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } # 23ai DPBP - { type : "DPBP" , id : 6 , patch_number : 37169536 , dep_type : 'RU' , dep_id : 6 } - - { type : "DPBP" , id : 7 , patch_number : 37491421 , dep_type : 'RU' , dep_id : 7 } \ No newline at end of file + - { type : "DPBP" , id : 7 , patch_number : 37491421 , dep_type : 'RU' , dep_id : 7 } + - { type : "DPBP" , id : 8 , patch_number : 37805452 , dep_type : 'RU' , dep_id : 8 } \ No newline at end of file diff --git a/tasks/impdp_file_adb.yml b/tasks/impdp_file_adb.yml index c95a767..1446029 100644 --- a/tasks/impdp_file_adb.yml +++ b/tasks/impdp_file_adb.yml @@ -15,6 +15,10 @@ loop_var: script_param when: user_impdp_pre is defined + - name: Set load file name + set_fact: + load_file_name: "{{ dump_file_prefix }}.dmp" + # The impdp loader are the same steps executed after the expdp - include: run_script.yml loop: "{{ user_expdp_post | flatten(levels=1) }}" From 4c4776414739ef05869c4e7ca243bf3fd6ebed85 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Wed, 16 Jul 2025 10:43:41 -0300 Subject: [PATCH 221/229] Update list_patches.yml --- list_patches.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/list_patches.yml b/list_patches.yml index b8c82dd..9443fab 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -386,6 +386,7 @@ list_11204: - { type : "OJVM" , id : 241015 , patch_number : 36878781 } - { type : "OJVM" , id : 250121 , patch_number : 37226818 } - { type : "OJVM" , id : 250415 , patch_number : 37547668 } + - { type : "OJVM" , id : 250715 , patch_number : 37954278 } # 11.2.0.4 BP - { type : "BP" , id : 1 , patch_number : 17628025 , patch_folder : 17628006 } - { type : "BP" , id : 2 , patch_number : 17838803 , patch_folder : 17741631 } @@ -531,6 +532,7 @@ list_12102: - { type : "PSU" , id : 241015 , patch_number : 36834621 } # - { type : "PSU" , id : 250121 , patch_number : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED - { type : "PSU" , id : 250415 , patch_number : 37608146 } + - { type : "PSU" , id : 250715 , patch_number : 37929489 } # 12.1.0.2 OJVM - { type : "OJVM" , id : 1 , patch_number : 19282028 } - { type : "OJVM" , id : 2 , patch_number : 19877336 } @@ -575,6 +577,7 @@ list_12102: - { type : "OJVM" , id : 241015 , patch_number : 36878764 } - { type : "OJVM" , id : 250121 , patch_number : 37226811 } - { type : "OJVM" , id : 250415 , patch_number : 37547662 } + - { type : "OJVM" , id : 250715 , patch_number : 37954906 } # 12.1.0.2 BP - { type : "BP" , id : 1 , patch_number : 19404326 , patch_folder : 19189240 } - { type : "BP" , id : 2 , patch_number : 19774304 , patch_folder : 19649591 } @@ -627,6 +630,7 @@ list_12102: - { type : "BP" , id : 241015 , patch_number : 36961411 , patch_folder : 36834630 } - { type : "BP" , id : 250121 , patch_number : 37372537 , patch_folder : 37226852 } - { type : "BP" , id : 250415 , patch_number : 37712366 , patch_folder : 37608165 } + - { type : "BP" , id : 250715 , patch_number : 38112664 , patch_folder : 37929446 } #################### ##### 12.2.0.1 ##### @@ -669,6 +673,7 @@ list_12201: - { type : "RU" , id : 241015 , patch_number : 36941400 } - { type : "RU" , id : 250121 , patch_number : 37317999 } - { type : "RU" , id : 250415 , patch_number : 37742706 } + - { type : "RU" , id : 250715 , patch_number : 38102087 } # 12.2.0.1 RUR - { type : "RUR" , id : 171017 , patch_number : 26518812 , base_ru : JUL2017 } - { type : "RUR" , id : 180116 , patch_number : 27013506 , base_ru : JUL2017 } @@ -728,6 +733,7 @@ list_12201: - { type : "OJVM" , id : 241015 , patch_number : 36878737 } - { type : "OJVM" , id : 250121 , patch_number : 37226803 } - { type : "OJVM" , id : 250415 , patch_number : 37547642 } + - { type : "OJVM" , id : 250715 , patch_number : 37954266 } #################### ##### 18.0.0.0 ##### @@ -886,6 +892,7 @@ list_19000: - { type : "RU" , id : 25 , patch_number : 36912597 } - { type : "RU" , id : 26 , patch_number : 37260974 } - { type : "RU" , id : 27 , patch_number : 37642901 } + - { type : "RU" , id : 28 , patch_number : 37960098 } # 19c GI - { type : "GI" , id : 3 , patch_number : 29517302 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 4 , patch_number : 29708769 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } @@ -912,6 +919,7 @@ list_19000: - { type : "GI" , id : 25 , patch_number : 36916690 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 26 , patch_number : 37257886 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 27 , patch_number : 37641958 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 28 , patch_number : 37957391 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } # 19c RUR - { type : "RUR" , id : 1 , patch_number : 29799057 , base_ru : '19.3' } - { type : "RUR" , id : 2 , patch_number : 30087906 , base_ru : '19.3' } @@ -1000,6 +1008,12 @@ list_19000: - { type : "MRP" , id : 250218 , patch_number : 37546431 , base_ru : '19.26' , dep_type : 'RU' , dep_id : 26 , apply_method : "napply" } - { type : "MRP" , id : 250318 , patch_number : 37663483 , base_ru : '19.26' , dep_type : 'RU' , dep_id : 26 , apply_method : "napply" } - { type : "MRP" , id : 250415 , patch_number : 37769923 , base_ru : '19.26' , dep_type : 'RU' , dep_id : 26 , apply_method : "napply" } + - { type : "MRP" , id : 250520 , patch_number : 37921349 , base_ru : '19.26' , dep_type : 'RU' , dep_id : 26 , apply_method : "napply" } + - { type : "MRP" , id : 250617 , patch_number : 38018831 , base_ru : '19.26' , dep_type : 'RU' , dep_id : 26 , apply_method : "napply" } + - { type : "MRP" , id : 250715 , patch_number : 38122842 , base_ru : '19.26' , dep_type : 'RU' , dep_id : 26 , apply_method : "napply" } + - { type : "MRP" , id : 250520 , patch_number : 37921396 , base_ru : '19.27' , dep_type : 'RU' , dep_id : 27 , apply_method : "napply" } + - { type : "MRP" , id : 250617 , patch_number : 38018833 , base_ru : '19.27' , dep_type : 'RU' , dep_id : 27 , apply_method : "napply" } + - { type : "MRP" , id : 250715 , patch_number : 38122859 , base_ru : '19.27' , dep_type : 'RU' , dep_id : 27 , apply_method : "napply" } # 19c OJVM - { type : "OJVM" , id : 190416 , patch_number : 29548437 } - { type : "OJVM" , id : 190716 , patch_number : 29774421 } @@ -1026,6 +1040,7 @@ list_19000: - { type : "OJVM" , id : 241015 , patch_number : 36878697 } - { type : "OJVM" , id : 250121 , patch_number : 37102264 } - { type : "OJVM" , id : 250415 , patch_number : 37499406 } + - { type : "OJVM" , id : 250715 , patch_number : 37847857 } # 19c DPBP - { type : "DPBP" , id : 10 , patch_number : 32583144 , dep_type : 'RU' , dep_id : 10 } - { type : "DPBP" , id : 11 , patch_number : 32958059 , dep_type : 'RU' , dep_id : 11 } @@ -1067,6 +1082,7 @@ list_21000: - { type : "RU" , id : 16 , patch_number : 36991631 } - { type : "RU" , id : 17 , patch_number : 37350281 } - { type : "RU" , id : 18 , patch_number : 37655430 } + - { type : "RU" , id : 19 , patch_number : 38068980 } - { type : "GI" , id : 4 , patch_number : 33250101 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 5 , patch_number : 33531909 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 6 , patch_number : 33859395 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } @@ -1082,6 +1098,7 @@ list_21000: - { type : "GI" , id : 16 , patch_number : 36990664 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 17 , patch_number : 37349593 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 18 , patch_number : 37642955 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 19 , patch_number : 38068887 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } #################### ##### 23.0.0.0 ##### @@ -1100,13 +1117,16 @@ list_23000: # - { type : "RU" , id : 6 , patch_number : 37037086 } # - { type : "RU" , id : 7 , patch_number : 37366180 } # - { type : "RU" , id : 8 , patch_number : 37701421 } +# - { type : "RU" , id : 9 , patch_number : 38048302 } - { type : "RU" , id : 6 , patch_number : 37037908 , apply_method : "gold_image" } - { type : "RU" , id : 7 , patch_number : 37370465 , apply_method : "gold_image" } - { type : "RU" , id : 8 , patch_number : 37703495 , apply_method : "gold_image" } + - { type : "RU" , id : 9 , patch_number : 38053646 , apply_method : "gold_image" } # - { type : "GI" , id : 5 , patch_number : 36739878 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 6 , patch_number : 37031054 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 7 , patch_number : 37353687 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 8 , patch_number : 37689703 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 9 , patch_number : 38041895 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "FREE" , id : 2 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23c-23.2-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } - { type : "FREE" , id : 3 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23c-23.3-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } - { type : "FREE" , id : 4 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-23.4-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } @@ -1117,4 +1137,4 @@ list_23000: # 23ai DPBP - { type : "DPBP" , id : 6 , patch_number : 37169536 , dep_type : 'RU' , dep_id : 6 } - { type : "DPBP" , id : 7 , patch_number : 37491421 , dep_type : 'RU' , dep_id : 7 } - - { type : "DPBP" , id : 8 , patch_number : 37805452 , dep_type : 'RU' , dep_id : 8 } \ No newline at end of file + - { type : "DPBP" , id : 8 , patch_number : 37805452 , dep_type : 'RU' , dep_id : 8 } From 8b126d15143d3ab4b619007f0fefc27465666326 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 17 Jul 2025 17:42:09 -0300 Subject: [PATCH 222/229] Fix load issues on GI --- list_exceptions.yml | 2 ++ list_patches.yml | 2 ++ tasks/impdp_file_adb.yml | 8 +++++++- tasks/patch_main.yml | 4 ---- tasks/patch_tasks_post.yml | 10 ++++++++++ 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/list_exceptions.yml b/list_exceptions.yml index 108985c..4666d2f 100644 --- a/list_exceptions.yml +++ b/list_exceptions.yml @@ -31,6 +31,7 @@ list_retry_datapatch: - { version: "12.1.0.2" , type : "BP" , id : 241015 , retries : 3 } - { version: "12.1.0.2" , type : "BP" , id : 250121 , retries : 3 } - { version: "12.1.0.2" , type : "BP" , id : 250415 , retries : 3 } + - { version: "12.1.0.2" , type : "BP" , id : 250715 , retries : 3 } ###### - { version: "12.1.0.2" , type : "PSU" , id : 200714 , retries : 2 } - { version: "12.1.0.2" , type : "PSU" , id : 201020 , retries : 2 } @@ -50,6 +51,7 @@ list_retry_datapatch: - { version: "12.1.0.2" , type : "PSU" , id : 240716 , retries : 2 } - { version: "12.1.0.2" , type : "PSU" , id : 241015 , retries : 2 } - { version: "12.1.0.2" , type : "PSU" , id : 250415 , retries : 2 } + - { version: "12.1.0.2" , type : "PSU" , id : 250715 , retries : 2 } ###### - { version: "12.2.0.1" , type : "RU" , id : 190716 , retries : 1 } - { version: "12.2.0.1" , type : "RU" , id : 191015 , retries : 1 } diff --git a/list_patches.yml b/list_patches.yml index 9443fab..563b4fb 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -342,6 +342,7 @@ list_11204: # - { type : "PSU" , id : 241015 , patch_number : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED # - { type : "PSU" , id : 250121 , patch_number : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED - { type : "PSU" , id : 250415 , patch_number : 37608089 } +# - { type : "PSU" , id : 250715 , patch_number : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED # 11.2.0.4 OJVM - { type : "OJVM" , id : 1 , patch_number : 19282021 } - { type : "OJVM" , id : 2 , patch_number : 19877440 } @@ -448,6 +449,7 @@ list_11204: # - { type : "BP" , id : 241015 , patch_number : xxxxxxxx , patch_folder : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED # - { type : "BP" , id : 250121 , patch_number : xxxxxxxx , patch_folder : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED - { type : "BP" , id : 250415 , patch_number : 37712353 , patch_folder : 37608128 } +# - { type : "BP" , id : 250715 , patch_number : xxxxxxxx , patch_folder : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED #################### ##### 12.1.0.1 ##### diff --git a/tasks/impdp_file_adb.yml b/tasks/impdp_file_adb.yml index 1446029..3b48cfa 100644 --- a/tasks/impdp_file_adb.yml +++ b/tasks/impdp_file_adb.yml @@ -15,9 +15,15 @@ loop_var: script_param when: user_impdp_pre is defined - - name: Set load file name + - name: Set DMP load file name set_fact: load_file_name: "{{ dump_file_prefix }}.dmp" + when: not (patch.upload_only | default(false)) + + - name: Set ZIP load file name + set_fact: + load_file_name: "{{ dump_file_prefix }}.zip" + when: patch.upload_only | default(false) # The impdp loader are the same steps executed after the expdp - include: run_script.yml diff --git a/tasks/patch_main.yml b/tasks/patch_main.yml index 0e992b6..4fb4b42 100644 --- a/tasks/patch_main.yml +++ b/tasks/patch_main.yml @@ -251,10 +251,6 @@ loop_control: loop_var: script_param - - name: Remove patch file - shell: | - rm -f {{ shared_folder }}/{{ dump_file_prefix }}.zip - when: not only_deploy_patch and patch.upload_only is defined and patch.upload_only # Post Actions diff --git a/tasks/patch_tasks_post.yml b/tasks/patch_tasks_post.yml index 59d0f2a..95ed5c6 100644 --- a/tasks/patch_tasks_post.yml +++ b/tasks/patch_tasks_post.yml @@ -11,6 +11,11 @@ src: "{{ shared_folder }}/{{ dump_file_prefix }}.log" dest: "{{ output_folder }}/expdp" + - name: "Copy {{ dump_file_prefix }}.zip to repository" + copy: + src: "{{ shared_folder }}/{{ dump_file_prefix }}.zip" + dest: "{{ output_folder }}/expdp" + - name : "Remove file {{ dump_file_prefix }}.dmp" file: state: absent @@ -21,6 +26,11 @@ state: absent path: "{{ shared_folder }}/{{ dump_file_prefix }}.log" + - name : "Remove file {{ dump_file_prefix }}.zip" + file: + state: absent + path: "{{ shared_folder }}/{{ dump_file_prefix }}.zip" + # This task will mark file as loaded - include: run_script.yml vars: From 82747ad337c96478a5f1a6d1ea826c6f99aca951 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 18 Jul 2025 10:20:40 -0300 Subject: [PATCH 223/229] Use load_file_name instead of dump or zip --- tasks/impdp_file.yml | 4 ++-- tasks/impdp_file_adb.yml | 12 +--------- tasks/patch_main.yml | 19 +++++----------- tasks/patch_main_11g.yml | 6 +---- tasks/patch_tasks_post.yml | 18 ++++----------- tasks/patch_tasks_pre.yml | 22 ++++++++++++++----- .../odbfcl/adb_load_expdp/adb_load_expdp.yml | 8 +++---- .../adb_load_expdp/post_remove_dump_file.yml | 6 ++--- .../adb_load_expdp/pre_prepare_dump_file.yml | 22 ++++++++++++++----- 9 files changed, 52 insertions(+), 65 deletions(-) diff --git a/tasks/impdp_file.yml b/tasks/impdp_file.yml index fade863..bb0fd85 100644 --- a/tasks/impdp_file.yml +++ b/tasks/impdp_file.yml @@ -9,11 +9,11 @@ - name: "Check if {{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp exists" stat: path: "{{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp" - register: dump_stat_result + register: load_file_stat_result - fail: msg: "Could not find dump file." - when: dump_stat_result.stat.exists == false + when: load_file_stat_result.stat.exists == false - name: "Copy {{ dump_file_prefix }}.dmp to shared_folder" copy: diff --git a/tasks/impdp_file_adb.yml b/tasks/impdp_file_adb.yml index 3b48cfa..b2bf63d 100644 --- a/tasks/impdp_file_adb.yml +++ b/tasks/impdp_file_adb.yml @@ -15,16 +15,6 @@ loop_var: script_param when: user_impdp_pre is defined - - name: Set DMP load file name - set_fact: - load_file_name: "{{ dump_file_prefix }}.dmp" - when: not (patch.upload_only | default(false)) - - - name: Set ZIP load file name - set_fact: - load_file_name: "{{ dump_file_prefix }}.zip" - when: patch.upload_only | default(false) - # The impdp loader are the same steps executed after the expdp - include: run_script.yml loop: "{{ user_expdp_post | flatten(levels=1) }}" @@ -37,7 +27,7 @@ loop: "{{ user_impdp_post | flatten(levels=1) }}" loop_control: loop_var: script_param - when: user_impdp_post is defined and dump_stat_result.stat.exists + when: user_impdp_post is defined and load_file_stat_result.stat.exists # Won't execute user_impdp_post when no dumpfile to avoid marking file as processed. when: not loaded_stat_result.stat.exists diff --git a/tasks/patch_main.yml b/tasks/patch_main.yml index 4fb4b42..18bb1bf 100644 --- a/tasks/patch_main.yml +++ b/tasks/patch_main.yml @@ -173,7 +173,7 @@ when: patch.type == "OJVM" - when: perform_patch_actions and patch.upload_only is not defined + when: perform_patch_actions and not (patch.upload_only | default(false)) # Start the database - include: run_sql.yml @@ -207,7 +207,7 @@ directory={{ dump_dir_name }} \ {{ expdp_compression | default('') }} \ metrics=yes \ - dumpfile={{ dump_file_prefix }}.dmp \ + dumpfile={{ load_file_name }} \ logfile={{ dump_file_prefix }}.log \ content=data_only \ schemas={{ dump_user_int }} \ @@ -219,17 +219,13 @@ become_user: oracle delegate_to: "{{ vm_ip_address }}" - - name: Set load file name - set_fact: - load_file_name: "{{ dump_file_prefix }}.dmp" - # User custom post-scripts - include: run_script.yml loop: "{{ user_expdp_post | flatten(levels=1) }}" loop_control: loop_var: script_param - when: not only_deploy_patch and patch.upload_only is not defined + when: not only_deploy_patch and not (patch.upload_only | default(false)) # When patch.upload_only is defined and true - block: @@ -237,21 +233,16 @@ # User custom pre-scripts - name: Save patch file shell: | - cp -av {{ db_patch }} {{ shared_folder }}/{{ dump_file_prefix }}.zip - touch {{ shared_folder }}/{{ dump_file_prefix }}.dmp + cp -av {{ db_patch }} {{ shared_folder }}/{{ load_file_name }} touch {{ shared_folder }}/{{ dump_file_prefix }}.log - - name: Set load file name - set_fact: - load_file_name: "{{ dump_file_prefix }}.zip" - # User custom post-scripts - include: run_script.yml loop: "{{ user_expdp_post | flatten(levels=1) }}" loop_control: loop_var: script_param - when: not only_deploy_patch and patch.upload_only is defined and patch.upload_only + when: not only_deploy_patch and (patch.upload_only | default(false)) # Post Actions - include: patch_tasks_post.yml diff --git a/tasks/patch_main_11g.yml b/tasks/patch_main_11g.yml index 995b50f..5b45304 100644 --- a/tasks/patch_main_11g.yml +++ b/tasks/patch_main_11g.yml @@ -175,7 +175,7 @@ userid={{ dump_user_int }}/{{ dump_pass }} \ directory={{ dump_dir_name }} \ {{ expdp_compression | default('') }} \ - dumpfile={{ dump_file_prefix }}.dmp \ + dumpfile={{ load_file_name }} \ logfile={{ dump_file_prefix }}.log \ content=data_only \ schemas={{ dump_user_int }} @@ -186,10 +186,6 @@ become_user: oracle delegate_to: "{{ vm_ip_address }}" - - name: Set load file name - set_fact: - load_file_name: "{{ dump_file_prefix }}.dmp" - # User custom post-scripts - name: Run user custom post-scripts include: run_script.yml diff --git a/tasks/patch_tasks_post.yml b/tasks/patch_tasks_post.yml index 95ed5c6..ddccfb8 100644 --- a/tasks/patch_tasks_post.yml +++ b/tasks/patch_tasks_post.yml @@ -1,9 +1,9 @@ # Skip the dump part if no expdp was executed - block: - - name: "Copy {{ dump_file_prefix }}.dmp to repository" + - name: "Copy {{ load_file_name }} to repository" copy: - src: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" + src: "{{ shared_folder }}/{{ load_file_name }}" dest: "{{ output_folder }}/expdp" - name: "Copy {{ dump_file_prefix }}.log to repository" @@ -11,26 +11,16 @@ src: "{{ shared_folder }}/{{ dump_file_prefix }}.log" dest: "{{ output_folder }}/expdp" - - name: "Copy {{ dump_file_prefix }}.zip to repository" - copy: - src: "{{ shared_folder }}/{{ dump_file_prefix }}.zip" - dest: "{{ output_folder }}/expdp" - - - name : "Remove file {{ dump_file_prefix }}.dmp" + - name : "Remove file {{ load_file_name }}" file: state: absent - path: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" + path: "{{ shared_folder }}/{{ load_file_name }}" - name : "Remove file {{ dump_file_prefix }}.log" file: state: absent path: "{{ shared_folder }}/{{ dump_file_prefix }}.log" - - name : "Remove file {{ dump_file_prefix }}.zip" - file: - state: absent - path: "{{ shared_folder }}/{{ dump_file_prefix }}.zip" - # This task will mark file as loaded - include: run_script.yml vars: diff --git a/tasks/patch_tasks_pre.yml b/tasks/patch_tasks_pre.yml index 5faadcd..5179997 100644 --- a/tasks/patch_tasks_pre.yml +++ b/tasks/patch_tasks_pre.yml @@ -15,6 +15,16 @@ restore_from_lvm: false restore_from_tar: false +- name: Set DMP load file name + set_fact: + load_file_name: "{{ dump_file_prefix }}.dmp" + when: not (patch.upload_only | default(false)) + +- name: Set ZIP load file name + set_fact: + load_file_name: "{{ dump_file_prefix }}.zip" + when: (patch.upload_only | default(false)) + # Immediatly stop when skip_all becomes true - block: @@ -27,21 +37,21 @@ # Ignore dumpfile checks when only_deploy_patch is true - block: - - name: "Check if {{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp exists" + - name: "Check if {{ output_folder }}/expdp/{{ load_file_name }} exists" stat: - path: "{{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp" - register: dump_stat_result + path: "{{ output_folder }}/expdp/{{ load_file_name }}" + register: load_file_stat_result # Will skip all the rest if the dump file exists - name : Define skip_all set_fact: - skip_all: "{{ dump_stat_result.stat.exists }}" + skip_all: "{{ load_file_stat_result.stat.exists }}" when: skip_dump_exists - name : Remove dump file if exists file: state: absent - path: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" + path: "{{ shared_folder }}/{{ load_file_name }}" when: not only_deploy_patch @@ -218,7 +228,7 @@ file: state: absent path: "{{ db_patch }}" - when: patch_location_type == "bucket" and (patch.upload_only is undefined or only_deploy_patch) + when: patch_location_type == "bucket" and (not (patch.upload_only | default(false)) or only_deploy_patch) when: perform_patch_actions diff --git a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml index 68dd072..02d18bc 100644 --- a/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml +++ b/user_scripts/odbfcl/adb_load_expdp/adb_load_expdp.yml @@ -1,11 +1,11 @@ # For main.yml, the pre_prepare_dump_file.yml won't be called. -# So dump_stat_result may be false if the dump was created on this execution. +# So load_file_stat_result may be false if the dump was created on this execution. - name: "Check if {{ shared_folder }}/{{ load_file_name }} exists" stat: path: "{{ shared_folder }}/{{ load_file_name }}" - register: dump_stat_result + register: load_file_stat_result -# This dump_stat_result.stat.exists block is required only because this code is used +# This load_file_stat_result.stat.exists block is required only because this code is used # for both the extraction (main.yml), where the file obviusly exists, but also on the # loader_adb.yml. @@ -65,4 +65,4 @@ params : "'{{ dump_file_prefix }}.log'" } - when: dump_stat_result.stat.exists \ No newline at end of file + when: load_file_stat_result.stat.exists \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_expdp/post_remove_dump_file.yml b/user_scripts/odbfcl/adb_load_expdp/post_remove_dump_file.yml index ca54526..9a02cee 100644 --- a/user_scripts/odbfcl/adb_load_expdp/post_remove_dump_file.yml +++ b/user_scripts/odbfcl/adb_load_expdp/post_remove_dump_file.yml @@ -1,5 +1,5 @@ -- name : "Remove file {{ dump_file_prefix }}.dmp from shared folder" +- name : "Remove file {{ load_file_name }} from shared folder" file: state: absent - path: "{{ shared_folder }}/{{ dump_file_prefix }}.dmp" - when: dump_stat_result.stat.exists \ No newline at end of file + path: "{{ shared_folder }}/{{ load_file_name }}" + when: load_file_stat_result.stat.exists \ No newline at end of file diff --git a/user_scripts/odbfcl/adb_load_expdp/pre_prepare_dump_file.yml b/user_scripts/odbfcl/adb_load_expdp/pre_prepare_dump_file.yml index d8e659e..ea0b6c1 100644 --- a/user_scripts/odbfcl/adb_load_expdp/pre_prepare_dump_file.yml +++ b/user_scripts/odbfcl/adb_load_expdp/pre_prepare_dump_file.yml @@ -3,13 +3,23 @@ file_suffix: "{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}" dump_file_prefix: "tables_{{ db_version }}_{{ patch.base_ru | default('') }}{{ patch.type }}_{{ patch.id }}" -- name: "Check if {{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp exists" +- name: Set DMP load file name + set_fact: + load_file_name: "{{ dump_file_prefix }}.dmp" + when: not (patch.upload_only | default(false)) + +- name: Set ZIP load file name + set_fact: + load_file_name: "{{ dump_file_prefix }}.zip" + when: (patch.upload_only | default(false)) + +- name: "Check if {{ output_folder }}/expdp/{{ load_file_name }} exists" stat: - path: "{{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp" - register: dump_stat_result + path: "{{ output_folder }}/expdp/{{ load_file_name }}" + register: load_file_stat_result -- name: "Copy {{ dump_file_prefix }}.dmp to shared_folder" +- name: "Copy {{ load_file_name }} to shared_folder" copy: - src: "{{ output_folder }}/expdp/{{ dump_file_prefix }}.dmp" + src: "{{ output_folder }}/expdp/{{ load_file_name }}" dest: "{{ shared_folder }}" - when: dump_stat_result.stat.exists \ No newline at end of file + when: load_file_stat_result.stat.exists \ No newline at end of file From 79184943b8565a0bac388410309aae4149219939 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 18 Jul 2025 12:07:58 -0300 Subject: [PATCH 224/229] Fix issues --- tasks/main_PSU_BP.yml | 42 ++++++++++++++++++------------------ tasks/main_RU_RUR.yml | 42 ++++++++++++++++++------------------ tasks/prepare_dependency.yml | 4 ++++ 3 files changed, 46 insertions(+), 42 deletions(-) diff --git a/tasks/main_PSU_BP.yml b/tasks/main_PSU_BP.yml index a7716e3..3dac936 100644 --- a/tasks/main_PSU_BP.yml +++ b/tasks/main_PSU_BP.yml @@ -94,6 +94,27 @@ when: param_type is undefined or param_type == "PSU" or param_type == "CPU" or param_type == "BASE" +### BP +- block: + + - name : Define snapshot base version to rollback when reload is called. + set_fact: + vm_snapshot: "{{ patch_base }}" + + # Execute for every BP + - include: "{{ patch_file }}" + loop: "{{ lookup('vars', patch_list) | flatten(levels=1) }}" + loop_control: + loop_var: patch + label: "{{ patch.id }}" + when: + - patch.type == "BP" + - patch.id == (param_patch | float) or param_patch == -1 + - patch.id >= (param_patch_from | float) or param_patch_from == -1 + - patch.id <= (param_patch_to | float) or param_patch_to == -1 + + when: param_type is undefined or param_type == "BP" + ### OJVM - block: @@ -128,27 +149,6 @@ when: param_type is undefined or param_type == "OJVM" -### BP -- block: - - - name : Define snapshot base version to rollback when reload is called. - set_fact: - vm_snapshot: "{{ patch_base }}" - - # Execute for every BP - - include: "{{ patch_file }}" - loop: "{{ lookup('vars', patch_list) | flatten(levels=1) }}" - loop_control: - loop_var: patch - label: "{{ patch.id }}" - when: - - patch.type == "BP" - - patch.id == (param_patch | float) or param_patch == -1 - - patch.id >= (param_patch_from | float) or param_patch_from == -1 - - patch.id <= (param_patch_to | float) or param_patch_to == -1 - - when: param_type is undefined or param_type == "BP" - # Stop OCI VM - name: Call role to stop OCI VM include_role: diff --git a/tasks/main_RU_RUR.yml b/tasks/main_RU_RUR.yml index c538148..93022ed 100644 --- a/tasks/main_RU_RUR.yml +++ b/tasks/main_RU_RUR.yml @@ -93,6 +93,27 @@ when: param_type is undefined or param_type == "RU" or param_type == "BASE" +### RUR & MRP & DPBP & OTHERS +- block: + + - name : Define snapshot base version to rollback when reload is called. + set_fact: + vm_snapshot: "{{ patch_base }}" + + # Execute for every patch + - include: "{{ patch_file }}" + loop: "{{ lookup('vars', patch_list) | flatten(levels=1) }}" + loop_control: + loop_var: patch + label: "{{ patch.id }}" + when: + - (param_type is undefined and (patch.type != "RU" and patch.type != "OJVM")) or (param_type is defined and patch.type == param_type) + - patch.id == (param_patch | float) or param_patch == -1 + - patch.id >= (param_patch_from | float) or param_patch_from == -1 + - patch.id <= (param_patch_to | float) or param_patch_to == -1 + + when: param_type is undefined or (param_type != "RU" and param_type != "OJVM") + ### OJVM - block: @@ -126,27 +147,6 @@ when: param_type is undefined or param_type == "OJVM" -### RUR & MRP & DPBP & OTHERS -- block: - - - name : Define snapshot base version to rollback when reload is called. - set_fact: - vm_snapshot: "{{ patch_base }}" - - # Execute for every patch - - include: "{{ patch_file }}" - loop: "{{ lookup('vars', patch_list) | flatten(levels=1) }}" - loop_control: - loop_var: patch - label: "{{ patch.id }}" - when: - - (param_type is undefined and (patch.type != "RU" and patch.type != "OJVM")) or (param_type is defined and patch.type == param_type) - - patch.id == (param_patch | float) or param_patch == -1 - - patch.id >= (param_patch_from | float) or param_patch_from == -1 - - patch.id <= (param_patch_to | float) or param_patch_to == -1 - - when: param_type is undefined or (param_type != "RU" and param_type != "OJVM") - # Stop OCI VM - name: Call role to stop OCI VM include_role: diff --git a/tasks/prepare_dependency.yml b/tasks/prepare_dependency.yml index 6d596c6..4ad36ca 100644 --- a/tasks/prepare_dependency.yml +++ b/tasks/prepare_dependency.yml @@ -16,6 +16,7 @@ bkp2_db_patch: "{{ bkp1_db_patch }}" bkp2_unzip_patch_folder: "{{ bkp1_unzip_patch_folder }}" bkp2_perform_patch_actions: "{{ bkp1_perform_patch_actions }}" + bkp2_load_file_name: "{{ bkp1_load_file_name }}" when: bkp1_patch is defined and bkp1_patch != None - name : Backup1 Variables @@ -31,6 +32,7 @@ bkp1_db_patch: "{{ db_patch }}" bkp1_unzip_patch_folder: "{{ unzip_patch_folder }}" bkp1_perform_patch_actions: "{{ perform_patch_actions }}" + bkp1_load_file_name: "{{ load_file_name }}" - name : Replace settings set_fact: @@ -61,6 +63,7 @@ db_patch: "{{ bkp1_db_patch }}" unzip_patch_folder: "{{ bkp1_unzip_patch_folder }}" perform_patch_actions: "{{ bkp1_perform_patch_actions }}" + load_file_name: "{{ bkp1_load_file_name }}" - name : Clean Backup1 Variables set_fact: @@ -79,6 +82,7 @@ bkp1_db_patch: "{{ bkp2_db_patch }}" bkp1_unzip_patch_folder: "{{ bkp2_unzip_patch_folder }}" bkp1_perform_patch_actions: "{{ bkp2_perform_patch_actions }}" + bkp1_load_file_name: "{{ bkp2_load_file_name }}" when: bkp2_patch is defined and bkp2_patch != None - name : Clean Backup2 Variables From f7a11daace34f6e0d4554929c4a7eeadb395c9ee Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Sat, 19 Jul 2025 07:42:14 -0300 Subject: [PATCH 225/229] Reverse list --- tasks/main_PSU_BP.yml | 2 +- tasks/main_RU_RUR.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/main_PSU_BP.yml b/tasks/main_PSU_BP.yml index 3dac936..dd9cdc4 100644 --- a/tasks/main_PSU_BP.yml +++ b/tasks/main_PSU_BP.yml @@ -136,7 +136,7 @@ # Execute for every OJVM - include: "{{ patch_file }}" - loop: "{{ lookup('vars', patch_list) | flatten(levels=1) }}" + loop: "{{ lookup('vars', patch_list) | flatten(levels=1) | sort(attribute='id') | reverse | list }}" loop_control: loop_var: patch label: "{{ patch.id }}" diff --git a/tasks/main_RU_RUR.yml b/tasks/main_RU_RUR.yml index 93022ed..953ba34 100644 --- a/tasks/main_RU_RUR.yml +++ b/tasks/main_RU_RUR.yml @@ -135,7 +135,7 @@ # Execute for every OJVM - include: "{{ patch_file }}" - loop: "{{ lookup('vars', patch_list) | flatten(levels=1) }}" + loop: "{{ lookup('vars', patch_list) | flatten(levels=1) | sort(attribute='id') | reverse | list }}" loop_control: loop_var: patch label: "{{ patch.id }}" From baf403c2aaa6060df4bdf1b44e04ed2fc4a7b5fc Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 21 Jul 2025 14:27:23 -0300 Subject: [PATCH 226/229] Update list_patches.yml --- list_patches.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/list_patches.yml b/list_patches.yml index 563b4fb..3011f0d 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -1062,6 +1062,7 @@ list_19000: - { type : "DPBP" , id : 25 , patch_number : 37056207 , dep_type : 'RU' , dep_id : 25 } - { type : "DPBP" , id : 26 , patch_number : 37470729 , dep_type : 'RU' , dep_id : 26 } - { type : "DPBP" , id : 27 , patch_number : 37777295 , dep_type : 'RU' , dep_id : 27 } + - { type : "DPBP" , id : 28 , patch_number : 38170982 , dep_type : 'RU' , dep_id : 28 } #################### ##### 21.0.0.0 ##### @@ -1136,7 +1137,9 @@ list_23000: - { type : "FREE" , id : 6 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-23.6-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } - { type : "FREE" , id : 7 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-23.7-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } - { type : "FREE" , id : 8 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-23.8-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } +# - { type : "FREE" , id : 9 , patch_number : 11111111 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-23.8-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } # 23ai DPBP - { type : "DPBP" , id : 6 , patch_number : 37169536 , dep_type : 'RU' , dep_id : 6 } - { type : "DPBP" , id : 7 , patch_number : 37491421 , dep_type : 'RU' , dep_id : 7 } - { type : "DPBP" , id : 8 , patch_number : 37805452 , dep_type : 'RU' , dep_id : 8 } + - { type : "DPBP" , id : 9 , patch_number : 38171540 , dep_type : 'RU' , dep_id : 9 } \ No newline at end of file From ee18f97373d508ce91d8808b1cc091d63d44be86 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Fri, 1 Aug 2025 09:42:01 -0300 Subject: [PATCH 227/229] Update list_patches.yml --- list_patches.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/list_patches.yml b/list_patches.yml index 3011f0d..4da0044 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -1137,7 +1137,7 @@ list_23000: - { type : "FREE" , id : 6 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-23.6-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } - { type : "FREE" , id : 7 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-23.7-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } - { type : "FREE" , id : 8 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-23.8-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } -# - { type : "FREE" , id : 9 , patch_number : 11111111 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-23.8-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 9 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-23.9-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } # 23ai DPBP - { type : "DPBP" , id : 6 , patch_number : 37169536 , dep_type : 'RU' , dep_id : 6 } - { type : "DPBP" , id : 7 , patch_number : 37491421 , dep_type : 'RU' , dep_id : 7 } From 63efc293a67e1a33c0ce54c342c6b5aa14277592 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Thu, 11 Sep 2025 17:50:38 -0300 Subject: [PATCH 228/229] Update diff_calculate_all.sql --- user_scripts/odbfcl/diff_calculate/diff_calculate_all.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/user_scripts/odbfcl/diff_calculate/diff_calculate_all.sql b/user_scripts/odbfcl/diff_calculate/diff_calculate_all.sql index 55958f8..2d20044 100644 --- a/user_scripts/odbfcl/diff_calculate/diff_calculate_all.sql +++ b/user_scripts/odbfcl/diff_calculate/diff_calculate_all.sql @@ -204,11 +204,13 @@ DECLARE or (v2.oraversion=d.oraversion and v2.oraseries=d.oraseries and v2.orapatch=d.orapatch)); CURSOR V_DIFF_CODES (P_ORAVERSION_TO IN varchar2, P_ORASERIES_TO IN varchar2, P_ORAPATCH_TO IN NUMBER) IS SELECT NVL(D1.MD5_HASH_UNWRAPPED,D1.MD5_HASH) OLD_VALUE, - NVL(D2.MD5_HASH_UNWRAPPED,D2.MD5_HASH) NEW_VALUE + NVL(D2.MD5_HASH_UNWRAPPED,D2.MD5_HASH) NEW_VALUE FROM R_HASH.F(P_ORAVERSION_TO,P_ORASERIES_TO,P_ORAPATCH_TO) D0, DM_CODES D1, DM_CODES D2 WHERE D0.COMPARE_COLUMN_NAME='MD5_HASH' AND D1.MD5_HASH = D0.OLD_VALUE AND D2.MD5_HASH = D0.NEW_VALUE + AND NOT (D1.WRAPPED = 'Y' AND D1.MD5_HASH_UNWRAPPED IS NULL) + AND NOT (D2.WRAPPED = 'Y' AND D2.MD5_HASH_UNWRAPPED IS NULL) MINUS SELECT MD5_HASH_FROM, MD5_HASH_TO FROM DIFF_CODES; From 97c4adc9109c36a77c94adefbe72d098ec9ead87 Mon Sep 17 00:00:00 2001 From: Rodrigo Jorge Date: Mon, 10 Nov 2025 16:39:19 -0300 Subject: [PATCH 229/229] Update list_patches.yml --- list_patches.yml | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/list_patches.yml b/list_patches.yml index 4da0044..fd6feb8 100644 --- a/list_patches.yml +++ b/list_patches.yml @@ -343,6 +343,7 @@ list_11204: # - { type : "PSU" , id : 250121 , patch_number : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED - { type : "PSU" , id : 250415 , patch_number : 37608089 } # - { type : "PSU" , id : 250715 , patch_number : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED +# - { type : "PSU" , id : 251021 , patch_number : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED # 11.2.0.4 OJVM - { type : "OJVM" , id : 1 , patch_number : 19282021 } - { type : "OJVM" , id : 2 , patch_number : 19877440 } @@ -388,6 +389,7 @@ list_11204: - { type : "OJVM" , id : 250121 , patch_number : 37226818 } - { type : "OJVM" , id : 250415 , patch_number : 37547668 } - { type : "OJVM" , id : 250715 , patch_number : 37954278 } + - { type : "OJVM" , id : 251021 , patch_number : 38291847 } # 11.2.0.4 BP - { type : "BP" , id : 1 , patch_number : 17628025 , patch_folder : 17628006 } - { type : "BP" , id : 2 , patch_number : 17838803 , patch_folder : 17741631 } @@ -450,6 +452,7 @@ list_11204: # - { type : "BP" , id : 250121 , patch_number : xxxxxxxx , patch_folder : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED - { type : "BP" , id : 250415 , patch_number : 37712353 , patch_folder : 37608128 } # - { type : "BP" , id : 250715 , patch_number : xxxxxxxx , patch_folder : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED +# - { type : "BP" , id : 251021 , patch_number : xxxxxxxx , patch_folder : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED #################### ##### 12.1.0.1 ##### @@ -535,6 +538,8 @@ list_12102: # - { type : "PSU" , id : 250121 , patch_number : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED - { type : "PSU" , id : 250415 , patch_number : 37608146 } - { type : "PSU" , id : 250715 , patch_number : 37929489 } + - { type : "PSU" , id : 250715 , patch_number : 37929489 } +# - { type : "PSU" , id : 251021 , patch_number : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED # 12.1.0.2 OJVM - { type : "OJVM" , id : 1 , patch_number : 19282028 } - { type : "OJVM" , id : 2 , patch_number : 19877336 } @@ -580,6 +585,7 @@ list_12102: - { type : "OJVM" , id : 250121 , patch_number : 37226811 } - { type : "OJVM" , id : 250415 , patch_number : 37547662 } - { type : "OJVM" , id : 250715 , patch_number : 37954906 } + - { type : "OJVM" , id : 251021 , patch_number : 38265478 } # 12.1.0.2 BP - { type : "BP" , id : 1 , patch_number : 19404326 , patch_folder : 19189240 } - { type : "BP" , id : 2 , patch_number : 19774304 , patch_folder : 19649591 } @@ -633,6 +639,7 @@ list_12102: - { type : "BP" , id : 250121 , patch_number : 37372537 , patch_folder : 37226852 } - { type : "BP" , id : 250415 , patch_number : 37712366 , patch_folder : 37608165 } - { type : "BP" , id : 250715 , patch_number : 38112664 , patch_folder : 37929446 } +# - { type : "BP" , id : 251021 , patch_number : xxxxxxxx , patch_folder : xxxxxxxx } # NOTHING TO FIX - NO PATCH CREATED #################### ##### 12.2.0.1 ##### @@ -676,6 +683,7 @@ list_12201: - { type : "RU" , id : 250121 , patch_number : 37317999 } - { type : "RU" , id : 250415 , patch_number : 37742706 } - { type : "RU" , id : 250715 , patch_number : 38102087 } + - { type : "RU" , id : 251021 , patch_number : 38428389 } # 12.2.0.1 RUR - { type : "RUR" , id : 171017 , patch_number : 26518812 , base_ru : JUL2017 } - { type : "RUR" , id : 180116 , patch_number : 27013506 , base_ru : JUL2017 } @@ -736,6 +744,7 @@ list_12201: - { type : "OJVM" , id : 250121 , patch_number : 37226803 } - { type : "OJVM" , id : 250415 , patch_number : 37547642 } - { type : "OJVM" , id : 250715 , patch_number : 37954266 } + - { type : "OJVM" , id : 251021 , patch_number : 38265430 } #################### ##### 18.0.0.0 ##### @@ -856,7 +865,7 @@ list_18000: - { type : "OJVM" , id : 240416 , patch_number : 36222358 } # NOT AVAILABLE TO DOWNLOAD # 18.26 - { type : "OJVM" , id : 240716 , patch_number : 36533062 } # NOT AVAILABLE TO DOWNLOAD # 18.27 - { type : "OJVM" , id : 241015 , patch_number : 36878718 } # NOT AVAILABLE TO DOWNLOAD # 18.28 - - { type : "OJVM" , id : 250121 , patch_number : 37226745 } # NOT AVAILABLE TO DOWNLOAD # 18.28 + - { type : "OJVM" , id : 250121 , patch_number : 37226745 } # NOT AVAILABLE TO DOWNLOAD # 18.29 # No more updates on this one. @@ -895,6 +904,7 @@ list_19000: - { type : "RU" , id : 26 , patch_number : 37260974 } - { type : "RU" , id : 27 , patch_number : 37642901 } - { type : "RU" , id : 28 , patch_number : 37960098 } + - { type : "RU" , id : 29 , patch_number : 38291812 } # 19c GI - { type : "GI" , id : 3 , patch_number : 29517302 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 4 , patch_number : 29708769 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } @@ -922,6 +932,7 @@ list_19000: - { type : "GI" , id : 26 , patch_number : 37257886 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 27 , patch_number : 37641958 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 28 , patch_number : 37957391 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 29 , patch_number : 38298204 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } # 19c RUR - { type : "RUR" , id : 1 , patch_number : 29799057 , base_ru : '19.3' } - { type : "RUR" , id : 2 , patch_number : 30087906 , base_ru : '19.3' } @@ -1016,6 +1027,12 @@ list_19000: - { type : "MRP" , id : 250520 , patch_number : 37921396 , base_ru : '19.27' , dep_type : 'RU' , dep_id : 27 , apply_method : "napply" } - { type : "MRP" , id : 250617 , patch_number : 38018833 , base_ru : '19.27' , dep_type : 'RU' , dep_id : 27 , apply_method : "napply" } - { type : "MRP" , id : 250715 , patch_number : 38122859 , base_ru : '19.27' , dep_type : 'RU' , dep_id : 27 , apply_method : "napply" } + - { type : "MRP" , id : 250819 , patch_number : 38276684 , base_ru : '19.27' , dep_type : 'RU' , dep_id : 27 , apply_method : "napply" } + - { type : "MRP" , id : 250916 , patch_number : 38397020 , base_ru : '19.27' , dep_type : 'RU' , dep_id : 27 , apply_method : "napply" } + - { type : "MRP" , id : 251021 , patch_number : 38510189 , base_ru : '19.27' , dep_type : 'RU' , dep_id : 27 , apply_method : "napply" } + - { type : "MRP" , id : 250819 , patch_number : 38277071 , base_ru : '19.28' , dep_type : 'RU' , dep_id : 28 , apply_method : "napply" } + - { type : "MRP" , id : 250916 , patch_number : 38396041 , base_ru : '19.28' , dep_type : 'RU' , dep_id : 28 , apply_method : "napply" } + - { type : "MRP" , id : 251021 , patch_number : 38509376 , base_ru : '19.28' , dep_type : 'RU' , dep_id : 28 , apply_method : "napply" } # 19c OJVM - { type : "OJVM" , id : 190416 , patch_number : 29548437 } - { type : "OJVM" , id : 190716 , patch_number : 29774421 } @@ -1043,6 +1060,7 @@ list_19000: - { type : "OJVM" , id : 250121 , patch_number : 37102264 } - { type : "OJVM" , id : 250415 , patch_number : 37499406 } - { type : "OJVM" , id : 250715 , patch_number : 37847857 } + - { type : "OJVM" , id : 251021 , patch_number : 38194382 } # 19c DPBP - { type : "DPBP" , id : 10 , patch_number : 32583144 , dep_type : 'RU' , dep_id : 10 } - { type : "DPBP" , id : 11 , patch_number : 32958059 , dep_type : 'RU' , dep_id : 11 } @@ -1063,6 +1081,7 @@ list_19000: - { type : "DPBP" , id : 26 , patch_number : 37470729 , dep_type : 'RU' , dep_id : 26 } - { type : "DPBP" , id : 27 , patch_number : 37777295 , dep_type : 'RU' , dep_id : 27 } - { type : "DPBP" , id : 28 , patch_number : 38170982 , dep_type : 'RU' , dep_id : 28 } + - { type : "DPBP" , id : 29 , patch_number : 38535360 , dep_type : 'RU' , dep_id : 29 } #################### ##### 21.0.0.0 ##### @@ -1086,6 +1105,7 @@ list_21000: - { type : "RU" , id : 17 , patch_number : 37350281 } - { type : "RU" , id : 18 , patch_number : 37655430 } - { type : "RU" , id : 19 , patch_number : 38068980 } + - { type : "RU" , id : 20 , patch_number : 38371122 } - { type : "GI" , id : 4 , patch_number : 33250101 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 5 , patch_number : 33531909 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 6 , patch_number : 33859395 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } @@ -1102,6 +1122,7 @@ list_21000: - { type : "GI" , id : 17 , patch_number : 37349593 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 18 , patch_number : 37642955 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 19 , patch_number : 38068887 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 20 , patch_number : 38370812 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } #################### ##### 23.0.0.0 ##### @@ -1121,15 +1142,18 @@ list_23000: # - { type : "RU" , id : 7 , patch_number : 37366180 } # - { type : "RU" , id : 8 , patch_number : 37701421 } # - { type : "RU" , id : 9 , patch_number : 38048302 } +# - { type : "RU" , id : 26 , patch_number : 38404116 } - { type : "RU" , id : 6 , patch_number : 37037908 , apply_method : "gold_image" } - { type : "RU" , id : 7 , patch_number : 37370465 , apply_method : "gold_image" } - { type : "RU" , id : 8 , patch_number : 37703495 , apply_method : "gold_image" } - { type : "RU" , id : 9 , patch_number : 38053646 , apply_method : "gold_image" } + - { type : "RU" , id : 26 , patch_number : 38411960 , apply_method : "gold_image" } # - { type : "GI" , id : 5 , patch_number : 36739878 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 6 , patch_number : 37031054 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 7 , patch_number : 37353687 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 8 , patch_number : 37689703 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "GI" , id : 9 , patch_number : 38041895 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } + - { type : "GI" , id : 26 , patch_number : 38402446 , apply_method : 'skip' , file_suf : '_xmls' , upload_only : true } - { type : "FREE" , id : 2 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23c-23.2-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } - { type : "FREE" , id : 3 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23c-23.3-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23c/dbhomeFree" , expdp_comp : false } - { type : "FREE" , id : 4 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-23.4-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } @@ -1138,8 +1162,10 @@ list_23000: - { type : "FREE" , id : 7 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-23.7-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } - { type : "FREE" , id : 8 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-23.8-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } - { type : "FREE" , id : 9 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-database-free-23ai-23.9-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/23ai/dbhomeFree" , expdp_comp : false } + - { type : "FREE" , id : 26 , patch_number : 00000000 , apply_method : "download_rpm" , apply_file : "oracle-ai-database-free-26ai-23.26.0-1.el8.x86_64.rpm" , oracle_sid : "FREE" , oracle_home : "/opt/oracle/product/26ai/dbhomeFree" , expdp_comp : false } # 23ai DPBP - { type : "DPBP" , id : 6 , patch_number : 37169536 , dep_type : 'RU' , dep_id : 6 } - { type : "DPBP" , id : 7 , patch_number : 37491421 , dep_type : 'RU' , dep_id : 7 } - { type : "DPBP" , id : 8 , patch_number : 37805452 , dep_type : 'RU' , dep_id : 8 } - - { type : "DPBP" , id : 9 , patch_number : 38171540 , dep_type : 'RU' , dep_id : 9 } \ No newline at end of file + - { type : "DPBP" , id : 9 , patch_number : 38171540 , dep_type : 'RU' , dep_id : 9 } + - { type : "DPBP" , id : 26 , patch_number : 38504058 , dep_type : 'RU' , dep_id : 26 } \ No newline at end of file