Skip to content

Commit

Permalink
Merge pull request #403 from ministryofjustice/oasys/RCU_update
Browse files Browse the repository at this point in the history
updated RCU code to run from DB server
  • Loading branch information
Sandhya1874 authored Nov 20, 2023
2 parents 674f6a9 + 236b1e3 commit 985e68d
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 21 deletions.
21 changes: 20 additions & 1 deletion ansible/group_vars/environment_name_oasys_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,26 @@ db_configs:
- { name: db_files, value: 600, db_restart_required: 0, scope: both }
- {
name: log_archive_dest_1,
value: '"''location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name=emrep''"',
value: '"''location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name=T2BIPINF''"',
db_restart_required: 0,
scope: both,
}
service:
- { name: BIPINF_TAF, role: PRIMARY }

T1BIPINF:
parameters:
- { name: "_allow_insert_with_update_check", value: TRUE, db_restart_required: 0, scope: both }
- { name: session_cached_cursors, value: 300, db_restart_required: 0, scope: spfile }
- { name: processes, value: 500, db_restart_required: 1, scope: spfile }
- { name: pga_aggregate_target, value: 800M, db_restart_required: 0, scope: both }
- { name: db_recovery_file_dest_size, value: 40G, db_restart_required: 0, scope: both }
- { name: shared_pool_size, value: 300M, db_restart_required: 0, scope: both }
- { name: open_cursors, value: 800, db_restart_required: 0, scope: both }
- { name: db_files, value: 600, db_restart_required: 0, scope: both }
- {
name: log_archive_dest_1,
value: '"''location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name=T1BIPINF''"',
db_restart_required: 0,
scope: both,
}
Expand Down
7 changes: 4 additions & 3 deletions ansible/roles/oasys-bip/tasks/create_bip_database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@
mode: "0700"
loop:
- create_bip_db.sh
- add_hidden_parameter.sql
- bip_db_parameters.sql

- name: Create BIP database
become_user: oracle
ansible.builtin.shell: |
set -eo pipefail
main() {
echo "# create_recovery_catalog_db.sh "
export PATH=/usr/local/bin:$PATH
echo "# create_bip_db.sh "
{{ stage }}/create_bip_db.sh {{ bip_db_name }} {{ bipdb_sys_password }} {{ bipdb_system_password }}
. oraenv <<< {{ bip_db_name }}
sqlplus / as sysdba @add_hidden_parameter.sql
sqlplus / as sysdba @{{ stage }}/bip_db_parameters.sql
}
main 2>&1 | logger -p local3.info -t ansible-oracle-db
async: 86400
Expand Down
5 changes: 5 additions & 0 deletions ansible/roles/oasys-bip/tasks/get-db-facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
name: secretsmanager-passwords
vars:
secretsmanager_passwords: "{{ bip_db_secretsmanager_secrets }}"
bip_db_server: "{{ ansible_facts.hostname }}"

- name: Set secret facts
set_fact:
bipdb_sys_password: "{{ secretsmanager_passwords_dict['bipdbshared'].passwords['sys'] }}"
bipdb_system_password: "{{ secretsmanager_passwords_dict['bipdb'].passwords['system'] }}"
bipdb_biplatform_password: "{{ secretsmanager_passwords_dict['bipdbshared'].passwords['biplatform'] }}"
bipdb_mds_password: "{{ secretsmanager_passwords_dict['bipdbshared'].passwords['mds'] }}"

- name: Fail if missing parameters
fail:
Expand All @@ -21,6 +24,8 @@
when:
- bipdb_sys_password|length > 0
- bipdb_system_password| length > 0
- bipdb_biplatform_password|length> 0
- bipdb_mds_password|length> 0

- name: Fail if missing parameters
fail:
Expand Down
13 changes: 5 additions & 8 deletions ansible/roles/oasys-bip/tasks/rcu.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
- name: Create stage directory
ansible.builtin.file:
path: "{{ item }}"
path: "{{ stage }}/bi_rcu"
state: directory
owner: oracle
group: oinstall
mode: "0755"
loop:
- "{{ stage }}"
- "{{ wl_home }}/bi_rcu"

- name: Get RCU install software from S3 bucket
amazon.aws.aws_s3:
Expand All @@ -23,14 +20,14 @@
owner: oracle
group: oinstall
src: "{{stage }}/rcuHome.zip"
dest: "{{ wl_home }}/bi_rcu"
dest: "{{ stage }}/bi_rcu"
remote_src: true
keep_newer: true

- name: Copy weblogic install config
- name: Copy config password file
ansible.builtin.template:
src: "bip_password.tmp.j2"
dest: "{{stage }}/obiee_rcu_paramfile.txt"
dest: "{{ stage }}/obiee_rcu_paramfile.txt"
owner: oracle
group: oinstall

Expand All @@ -40,7 +37,7 @@
set -eo pipefail
main() {
. ~/.bash_profile
$WL_HOME//bi_rcu/bin/rcu -silent -createRepository \
{{ stage }}//bi_rcu/bin/rcu -silent -createRepository \
-connectString {{ bip_db_server }}:1521/{{ bip_db_name }} \
-dbUser SYS -dbRole SYSDBA -schemaPrefix OAS \
-component BIPLATFORM -component MDS -f < /u01/stage/obiee_rcu_paramfile.txt
Expand Down
9 changes: 0 additions & 9 deletions ansible/roles/oasys-bip/templates/add_hidden_parameter.sql.j2

This file was deleted.

15 changes: 15 additions & 0 deletions ansible/roles/oasys-bip/templates/bip_db_parameters.sql.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
set echo on
spool {{ stage }}/add_hidden_parameter.log

ALTER SYSTEM SET "_allow_insert_with_update_check"=TRUE scope=spfile;
ALTER SYSTEM SET shared_pool_size=150M SCOPE=SPFILE;
ALTER SYSTEM SET session_cached_cursors=100 SCOPE=SPFILE;
ALTER SYSTEM SET processes=500 SCOPE=SPFILE;
ALTER SYSTEM SET open_cursors=800 SCOPE=SPFILE;
ALTER SYSTEM SET db_files=600 SCOPE=SPFILE;
alter system set log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name={{ bip_db_name }}';
shutdown immediate
startup

spool off
exit

0 comments on commit 985e68d

Please sign in to comment.