Skip to content
This repository was archived by the owner on Apr 21, 2022. It is now read-only.

Commit 43f7be1

Browse files
Additional testing done for RAC
1 parent c0a6f77 commit 43f7be1

File tree

10 files changed

+94
-59
lines changed

10 files changed

+94
-59
lines changed

defaults/main.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
psu_name: July2015 # Should match psu dictionary variable defined in vars/main.yml
2+
psu_name: OCT2015 # Should match psu dictionary variable defined in vars/main.yml
33

44
shutdown_listener: true # set to false if patching an empty oracle home (ie new 12c install)
55
rollback_psu: false # set to true if rolling back current PSU.
@@ -8,8 +8,14 @@ oracle_home: "/app/oracle/{{ oracle_version }}/dbhome_1"
88
oracle_base: /app/oracle
99
tns_admin: "{{ oracle_home }}/network/admin"
1010

11+
oracle_stage_install: /u01/stage
12+
patch_directory: "{{ oracle_stage_install }}/{{ oracle_version }}/{{ psu_name }}"
13+
1114
env:
1215
ORACLE_HOME: "{{ oracle_home }}"
1316
ORACLE_BASE: "{{ oracle_base }}"
1417
TNS_ADMIN: "{{ tns_admin }}"
1518
PATH: "{{ oracle_home }}/bin:{{ oracle_home }}/OPatch:$PATH:/bin:/usr/bin::/usr/ccs/bin"
19+
20+
oracle_user: oracle # User that will own the Oracle Installations.
21+
oracle_group: oinstall # Primary group for oracle_user.

tasks/extract_files.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,26 @@
22

33
- name: Create Patch directory
44
file:
5-
path: "{{ oracle_stage_install }}/{{ oracle_version }}"
5+
path: "{{ patch_directory }}"
66
state: directory
7+
run_once: true
78

89
- name: Unzip PSU
910
unarchive:
1011
src: "{{ oracle_stage_install }}/{{ psu[oracle_version][psu_name][oracle_install_type].filename }}"
11-
dest: "{{ oracle_stage_install }}/{{ oracle_version }}/"
12+
dest: "{{ patch_directory}}/"
1213
copy: no
13-
creates: "{{ oracle_stage_install }}/{{ oracle_version }}/{{ psu[oracle_version][psu_name][oracle_install_type].patchid }}/README.txt"
14+
creates: "{{ patch_directory }}/{{ psu[oracle_version][psu_name][oracle_install_type].patchid }}/README.txt"
1415
owner: "{{ oracle_user }}"
1516
group: "{{ oracle_group }}"
1617
run_once: true
1718

1819
- name: Unzip oneoff patches
1920
unarchive:
2021
src: "{{ oracle_stage_install }}/{{ item.filename }}"
21-
dest: "{{ oracle_stage_install }}/{{ oracle_version }}/"
22+
dest: "{{ patch_directory }}/"
2223
copy: no
23-
creates: "{{ oracle_stage_install }}/{{ oracle_version }}/{{ item.patchid }}/README.txt"
24+
creates: "{{ patch_directory }}/{{ item.patchid }}/README.txt"
2425
owner: "{{ oracle_user }}"
2526
group: "{{ oracle_group }}"
2627
with_items: oneoff_patches[oracle_version]|default([])
@@ -30,9 +31,9 @@
3031
- name: Unzip oneoff patches (PSU version specific)
3132
unarchive:
3233
src: "{{ oracle_stage_install }}/{{ item.filename }}"
33-
dest: "{{ oracle_stage_install }}/{{ oracle_version }}/"
34+
dest: "{{ patch_directory }}/"
3435
copy: no
35-
creates: "{{ oracle_stage_install }}/{{ oracle_version }}/{{ item.patchid }}/README.txt"
36+
creates: "{{ patch_directory }}/{{ item.patchid }}/README.txt"
3637
owner: "{{ oracle_user }}"
3738
group: "{{ oracle_group }}"
3839
with_items: oneoff_patches[ psu[oracle_version][psu_name].patchversion ]|default([])

tasks/oneoff_apply.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# Apply one-off patches that are not PSU version specific
33
- name: Oneoff conflict check
4-
shell: "{{ oracle_home }}/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir {{ oracle_stage_install }}/{{ oracle_version }}/{{ item.patchid }}"
4+
shell: "{{ oracle_home }}/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir {{ patch_directory }}/{{ item.patchid }}"
55
sudo: yes
66
sudo_user: "{{ oracle_user }}"
77
with_items: oneoff_patches[oracle_version]|default([])
@@ -11,7 +11,7 @@
1111
- debug: var=oneoff_conflicts.results
1212

1313
- name: Apply one-off patches
14-
shell: "opatch apply -silent -local -ocmrf {{ oracle_stage_install }}/ocm.rsp {{ oracle_stage_install }}/{{ oracle_version }}/{{ item.patchid }}"
14+
shell: "opatch apply -silent -local -ocmrf {{ oracle_stage_install }}/ocm.rsp {{ patch_directory }}/{{ item.patchid }}"
1515
sudo: yes
1616
sudo_user: "{{ oracle_user }}"
1717
environment: env
@@ -22,8 +22,8 @@
2222
- debug: var=oneoff_apply.results
2323

2424
#Apply PSU version specific one-off patches
25-
- name: Oneoff conflict check
26-
shell: "{{ oracle_home }}/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir {{ oracle_stage_install }}/{{ oracle_version }}/{{ item.patchid }}"
25+
- name: PSU Version Specific Oneoff conflict check
26+
shell: "{{ oracle_home }}/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir {{ patch_directory }}/{{ item.patchid }}"
2727
sudo: yes
2828
sudo_user: "{{ oracle_user }}"
2929
with_items: oneoff_patches[ psu[oracle_version][psu_name].patchversion ]|default([])
@@ -32,8 +32,8 @@
3232

3333
- debug: var=oneoff_conflicts_psu.results
3434

35-
- name: Apply one-off patches
36-
shell: "opatch apply -silent -local -ocmrf {{ oracle_stage_install }}/ocm.rsp {{ oracle_stage_install }}/{{ oracle_version }}/{{ item.patchid }}"
35+
- name: Apply PSU Version Specific one-off patches
36+
shell: "opatch apply -silent -local -force -ocmrf {{ oracle_stage_install }}/ocm.rsp {{ patch_directory }}/{{ item.patchid }}"
3737
sudo: yes
3838
sudo_user: "{{ oracle_user }}"
3939
environment: env

tasks/oneoff_rollback.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,3 @@
1010
ignore_errors: true
1111

1212
- debug: var=oneoff_rollback.results
13-
14-
- name: SI | Rollback PSU
15-
shell: "{{ oracle_home }}/OPatch/opatch rollback -silent -local -id {{ psu[oracle_version][psu_name][oracle_install_type].patchid }}"
16-
sudo: yes
17-
sudo_user: "{{ oracle_user }}"
18-
register: opatch_rollback
19-
when: oracle_install_type == 'si'
20-
21-
- debug: var=opatch_rollback.stdout_lines
22-
23-
- name: RAC | Rollback PSU
24-
shell: "{{ grid_home }}/OPatch/opatch auto {{ oracle_stage_install }}/{{ oracle_version }}/{{ psu[oracle_version][psu_name][oracle_install_type].patchid }} -rollback -ocmrf {{ oracle_stage_install }}/ocm.rsp"
25-
sudo_user: root
26-
register: rac_psu_rollback
27-
when: oracle_install_type == 'rac'
28-
29-
- debug: var=rac_psu_rollback.stdout_lines

tasks/psu_rac.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,19 @@
77
sudo_user: "{{ oracle_user }}"
88
environment: env
99
register: dblist
10-
when: master_node
10+
11+
- debug: var=dblist.stdout_lines
12+
13+
- name: RAC | Generate srvctl state file
14+
template:
15+
src: srvctl_state.j2
16+
dest: "{{ oracle_home }}/srvm/admin/psu_state.txt"
17+
owner: "{{ oracle_user }}"
18+
group: "{{ oracle_group }}"
1119

1220
- name: RAC | delete srvctl state file if it exists
1321
file: path={{ oracle_home }}/srvm/admin/oneoffstop.txt state=absent
14-
22+
1523
- name: RAC | Update opatch
1624
unarchive:
1725
src: "{{ oracle_stage_install }}/{{ opatch[oracle_version].filename }}"
@@ -35,7 +43,7 @@
3543
- debug: var=lsinv_pre.results
3644

3745
- name: RAC | Check PSU for conflicts
38-
shell: "{{ item }}/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir {{ oracle_stage_install }}/{{ oracle_version }}/{{ psu[oracle_version][psu_name][oracle_install_type].patchid }}"
46+
shell: "{{ item }}/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir {{ patch_directory }}/{{ psu[oracle_version][psu_name][oracle_install_type].patchid }}"
3947
sudo: yes
4048
sudo_user: "{{ oracle_user }}"
4149
register: opatch_conflicts
@@ -44,7 +52,7 @@
4452
- "{{ grid_home|default(omit) }}"
4553

4654
- name: RAC | Apply patch to first node
47-
shell: "{{ grid_home }}/OPatch/opatch auto {{ oracle_stage_install }}/{{ oracle_version }}/{{ psu[oracle_version][psu_name][oracle_install_type].patchid }} -ocmrf {{ oracle_stage_install }}/ocm.rsp"
55+
shell: "{{ grid_home }}/OPatch/opatch auto {{ patch_directory }}/{{ psu[oracle_version][psu_name][oracle_install_type].patchid }} -ocmrf {{ oracle_stage_install }}/ocm.rsp"
4856
sudo: yes
4957
sudo_user: root
5058
when: master_node
@@ -61,7 +69,7 @@
6169
when: master_node
6270

6371
- name: RAC | Startup Oracle Home on first node
64-
shell: srvctl start home -o {{ oracle_home }} -s {{ oracle_home }}/srvm/admin/oneoffstop.txt -n {{ ansible_hostname }}
72+
shell: srvctl start home -o {{ oracle_home }} -s {{ oracle_home }}/srvm/admin/psu_state.txt -n {{ ansible_hostname }}
6573
sudo: yes
6674
sudo_user: "{{ oracle_user }}"
6775
environment: env
@@ -76,8 +84,11 @@
7684

7785
- debug: var=stat_res_t.stdout_lines
7886

87+
- name: RAC | Pause after first node
88+
pause: prompt="Verify everything's running on the first node."
89+
7990
- name: RAC | Apply patch to second node
80-
shell: "{{ grid_home }}/OPatch/opatch auto {{ oracle_stage_install }}/{{ oracle_version }}/{{ psu[oracle_version][psu_name][oracle_install_type].patchid }} -ocmrf {{ oracle_stage_install }}/ocm.rsp"
91+
shell: "{{ grid_home }}/OPatch/opatch auto {{ patch_directory }}/{{ psu[oracle_version][psu_name][oracle_install_type].patchid }} -ocmrf {{ oracle_stage_install }}/ocm.rsp"
8192
sudo_user: root
8293
when: not master_node
8394

@@ -93,7 +104,7 @@
93104
when: not master_node
94105

95106
- name: RAC | Startup Oracle Home on second node
96-
shell: srvctl start home -o {{ oracle_home }} -s {{ oracle_home }}/srvm/admin/oneoffstop.txt -n {{ ansible_hostname }}
107+
shell: srvctl start home -o {{ oracle_home }} -s {{ oracle_home }}/srvm/admin/psu_state.txt -n {{ ansible_hostname }}
97108
sudo: yes
98109
sudo_user: "{{ oracle_user }}"
99110
environment: env
@@ -111,3 +122,5 @@
111122
- "{{ oracle_home }}"
112123
- "{{ grid_home|default(omit) }}"
113124
register: lsinv_post
125+
126+
- debug: var=lsinv_post.results

tasks/psu_rollback_rac.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@
77
sudo_user: "{{ oracle_user }}"
88
environment: env
99
register: dblist
10-
when: master_node
10+
11+
- name: RAC | Generate srvctl state file
12+
template:
13+
src: srvctl_state.j2
14+
dest: "{{ oracle_home }}/srvm/admin/psu_state.txt"
15+
owner: "{{ oracle_user }}"
16+
group: "{{ oracle_group }}"
1117

1218
- name: RAC | delete srvctl state file if it exists
1319
file: path={{ oracle_home }}/srvm/admin/oneoffstop.txt state=absent
@@ -23,8 +29,16 @@
2329
include: oneoff_rollback.yml
2430
when: master_node
2531

32+
- name: RAC | Rollback PSU
33+
shell: "{{ grid_home }}/OPatch/opatch auto {{ patch_directory }}/{{ psu[oracle_version][psu_name][oracle_install_type].patchid }} -rollback -ocmrf {{ oracle_stage_install }}/ocm.rsp"
34+
sudo_user: root
35+
register: rac_psu_rollback
36+
when: master_node
37+
38+
- debug: var=rac_psu_rollback.stdout_lines
39+
2640
- name: RAC | Startup Oracle Home on first node
27-
shell: srvctl start home -o {{ oracle_home }} -s {{ oracle_home }}/srvm/admin/oneoffstop.txt -n {{ ansible_hostname }}
41+
shell: srvctl start home -o {{ oracle_home }} -s {{ oracle_home }}/srvm/admin/psu_state.txt -n {{ ansible_hostname }}
2842
sudo: yes
2943
sudo_user: "{{ oracle_user }}"
3044
environment: env
@@ -50,8 +64,14 @@
5064
include: oneoff_rollback.yml
5165
when: not master_node
5266

67+
- name: RAC | Rollback PSU on second node
68+
shell: "{{ grid_home }}/OPatch/opatch auto {{ patch_directory }}/{{ psu[oracle_version][psu_name][oracle_install_type].patchid }} -rollback -ocmrf {{ oracle_stage_install }}/ocm.rsp"
69+
sudo_user: root
70+
register: rac_psu_rollback
71+
when: not master_node
72+
5373
- name: RAC | Startup Oracle Home on first node
54-
shell: srvctl start home -o {{ oracle_home }} -s {{ oracle_home }}/srvm/admin/oneoffstop.txt -n {{ ansible_hostname }}
74+
shell: srvctl start home -o {{ oracle_home }} -s {{ oracle_home }}/srvm/admin/psu_state.txt -n {{ ansible_hostname }}
5575
sudo: yes
5676
sudo_user: "{{ oracle_user }}"
5777
environment: env

tasks/psu_si.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
group: "{{ oracle_group }}"
1111

1212
- name: SI | check for conflicts
13-
shell: "{{ oracle_home }}/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir {{ oracle_stage_install }}/{{ oracle_version }}/{{ psu[oracle_version][psu_name][oracle_install_type].patchid }}"
13+
shell: "{{ oracle_home }}/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir {{ patch_directory }}/{{ psu[oracle_version][psu_name][oracle_install_type].patchid }}"
1414
sudo: yes
1515
sudo_user: "{{ oracle_user }}"
1616
register: opatch_conflicts
@@ -38,7 +38,7 @@
3838
ignore_errors: true
3939

4040
- name: SI | opatch apply
41-
shell: "opatch apply -silent -ocmrf {{ oracle_stage_install }}/ocm.rsp {{ oracle_stage_install }}/{{ oracle_version }}/{{ psu[oracle_version][psu_name][oracle_install_type].patchid }}"
41+
shell: "opatch apply -silent -ocmrf {{ oracle_stage_install }}/ocm.rsp {{ patch_directory }}/{{ psu[oracle_version][psu_name][oracle_install_type].patchid }}"
4242
sudo: yes
4343
sudo_user: "{{ oracle_user }}"
4444
environment: env

tasks/run_catbundle.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
chdir: "{{ oracle_home }}/rdbms/admin"
1212
when: oracle_version == '11.2.0.4'
1313

14-
15-
# - debug: var=catbundle.results # too much output to be useful
16-
1714
- name: 12.1 - Load Modified SQL Files into the Database
1815
shell: "export ORACLE_SID={{ item }}; ./datapatch -verbose"
1916
sudo: yes
@@ -26,5 +23,3 @@
2623
failed_when: datapatch.rc == 1
2724
when: oracle_version == '12.1.0.2'
2825
ignore_errors: true
29-
30-
- debug: var=datapatch

templates/srvctl_state.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{% for item in dblist.stdout_lines %}
2+
db-{{ item }}
3+
{% endfor %}

vars/main.yml

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@
33
# PSU information for RAC and Single Instance (11.2 and 12.1)
44
psu:
55
12.1.0.2:
6-
July2015:
6+
OCT2015:
7+
patchversion: 12.1.0.2.5
8+
rac:
9+
filename: p21523234_121020_Linux-x86-64.zip
10+
patchid: 21523234
11+
si:
12+
filename: p21359755_121020_Linux-x86-64.zip
13+
patchid: 21359755
14+
JUL2015:
715
patchversion: 12.1.0.2.4
816
rac:
917
filename: p20996835_121020_Linux-x86-64.zip
@@ -13,7 +21,15 @@ psu:
1321
patchid: 20831110
1422

1523
11.2.0.4:
16-
July2015:
24+
OCT2015:
25+
patchversion: 11.2.0.4.8
26+
rac:
27+
filename: p21523375_112040_Linux-x86-64.zip
28+
patchid: 21523375
29+
si:
30+
filename: p21352635_112040_Linux-x86-64.zip
31+
patchid: 21352635
32+
JUL2015:
1733
patchversion: 11.2.0.4.7
1834
rac:
1935
filename: p20996923_112040_Linux-x86-64.zip
@@ -26,13 +42,13 @@ psu:
2642
# Files should exist in path defined by oracle_stage_install.
2743
opatch:
2844
12.1.0.2:
29-
version: 12.1.0.1.8
45+
version: 12.1.0.1.10
3046
filename: p6880880_121010_Linux-x86-64.zip
31-
3247
11.2.0.4:
33-
version: 11.2.0.3.11
48+
version: 11.2.0.3.12
3449
filename: p6880880_112000_Linux-x86-64.zip
3550

51+
3652
oneoff_patches:
3753
12.1.0.2:
3854
- patchid: 21091518
@@ -41,10 +57,6 @@ oneoff_patches:
4157
filename: p21800251_121020_Linux-x86-64.zip
4258
- patchid: 20879889
4359
filename: p20879889_121020_Linux-x86-64.zip
44-
# # 17890099: ORA-2072 AND ORA-2063 ON QUERY VIA DBLINK
45-
# - patchid: 17890099
46-
# filename: p17890099_121020_Linux-x86-64.zip
47-
# 21821738: Merge patch for bug 19509982, 'Select Statement Throws ORA-01792 Error (Doc ID 1951689.1)'
4860
- patchid: 21821738
4961
filename: p21821738_121020_Linux-x86-64.zip
5062

@@ -53,7 +65,9 @@ oneoff_patches:
5365
- patchid: 13542050
5466
filename: p13542050_121024_Linux-x86-64.zip
5567

68+
11.2.0.4.8:
69+
- patchid: 17890099 # ORA-2072 AND ORA-2063 ON QUERY VIA DBLINK
70+
filename: p17890099_112048_Linux-x86-64.zip
5671
11.2.0.4.7:
57-
# ORA-2072 AND ORA-2063 ON QUERY VIA DBLINK
58-
- patchid: 17890099
72+
- patchid: 17890099 # ORA-2072 AND ORA-2063 ON QUERY VIA DBLINK
5973
filename: p17890099_112047_Linux-x86-64.zip

0 commit comments

Comments
 (0)