Difference between revisions of "Patching Oracle Database Appliance (ODA)"

From dbawiki
Jump to: navigation, search
Line 15: Line 15:
 
* [https://support.oracle.com/epmos/faces/DocumentDisplay?id=1417713.2 Master ODA document]
 
* [https://support.oracle.com/epmos/faces/DocumentDisplay?id=1417713.2 Master ODA document]
 
* [https://support.oracle.com/epmos/faces/DocumentDisplay?id=888888.1 Oracle Database Appliance - 12.1.2 and 2.X Supported ODA Versions & Known Issues (Doc ID 888888.1)]
 
* [https://support.oracle.com/epmos/faces/DocumentDisplay?id=888888.1 Oracle Database Appliance - 12.1.2 and 2.X Supported ODA Versions & Known Issues (Doc ID 888888.1)]
 +
<br />
 +
 +
===Useful queries===
 +
As seen on [https://www.pythian.com/blog/oracle-database-12c-patching-dbms_qopatch-opatch_xml_inv-and-datapatch/ Pythian]
 +
 +
<pre>
 +
 +
prompt ------------------------------------------
 +
prompt Patches applied to both the $OH and the DB
 +
prompt ------------------------------------------
 +
with a as (select dbms_qopatch.get_opatch_lsinventory patch_output from dual)
 +
select x.patch_id
 +
,      x.patch_uid
 +
,      x.rollbackable
 +
,      s.status
 +
,      x.description
 +
from  a
 +
,      xmltable('InventoryInstance/patches/*'
 +
          passing a.patch_output
 +
          columns
 +
            patch_id number path 'patchID',
 +
            patch_uid number path 'uniquePatchID',
 +
            description varchar2(80) path 'patchDescription',
 +
            rollbackable varchar2(8) path 'rollbackable'
 +
      ) x
 +
,      dba_registry_sqlpatch s
 +
where  x.patch_id = s.patch_id
 +
and    x.patch_uid = s.patch_uid
 +
--      and s.bundle_series = 'PSU'
 +
/
 +
 +
 +
</pre>
 +
<pre>
 +
 +
prompt --------------------------------------------------------
 +
prompt Patches installed into the $OH but not applied to the DB
 +
prompt --------------------------------------------------------
 +
with a as (select dbms_qopatch.get_opatch_lsinventory patch_output from dual)
 +
select x.patch_id
 +
,      x.patch_uid
 +
,      x.description
 +
from  a
 +
,      xmltable('InventoryInstance/patches/*'
 +
        passing a.patch_output
 +
        columns
 +
          patch_id number path 'patchID',
 +
          patch_uid number path 'uniquePatchID',
 +
          description varchar2(80) path 'patchDescription'
 +
      ) x
 +
minus
 +
select s.patch_id
 +
,      s.patch_uid
 +
,      s.description
 +
from  dba_registry_sqlpatch s
 +
/
 +
 +
 +
 +
</pre>
 +
<pre>
 +
 +
prompt --------------------------------------------------------
 +
prompt Patches applied to the DB but not installed into the $OH
 +
prompt --------------------------------------------------------
 +
with a as (select dbms_qopatch.get_opatch_lsinventory patch_output from dual)
 +
select s.patch_id
 +
,      s.patch_uid
 +
,      s.description
 +
from  dba_registry_sqlpatch s
 +
minus
 +
select x.patch_id
 +
,      x.patch_uid
 +
,      x.description
 +
from  a
 +
,      xmltable('InventoryInstance/patches/*'
 +
          passing a.patch_output
 +
          columns
 +
            patch_id number path 'patchID',
 +
            patch_uid number path 'uniquePatchID',
 +
            description varchar2(80) path 'patchDescription'
 +
      ) x
 +
/
 +
 +
 +
</pre>

Revision as of 14:56, 13 December 2016

Oracle Database Appliance (ODA) is a rack mounted "all-in-one" box supplied by Oracle. It contains 2 nodes, 2 networks, 2 power supplies and a bunch of storage accessible to both nodes.
It can be virtualised or bare-metal. You can setup single instance databases, RAC-One (active-passive) or RAC databases (active-active).
A whole new set of commands is used to interact with ODA - oakcli.
For example to create a database on ODA, it's no longer

dbca

it's

oakcli create database -d <database name>

Patching ODA means patching the O/S, the Grid Infrastructure (GI) and the RDBMS.
Useful ODA documents:


Useful queries

As seen on Pythian


prompt ------------------------------------------
prompt Patches applied to both the $OH and the DB
prompt ------------------------------------------
with a as (select dbms_qopatch.get_opatch_lsinventory patch_output from dual)
select x.patch_id
,      x.patch_uid
,      x.rollbackable
,      s.status
,      x.description
from   a
,      xmltable('InventoryInstance/patches/*'
          passing a.patch_output
          columns
             patch_id number path 'patchID',
             patch_uid number path 'uniquePatchID',
             description varchar2(80) path 'patchDescription',
             rollbackable varchar2(8) path 'rollbackable'
       ) x
,      dba_registry_sqlpatch s
where  x.patch_id = s.patch_id
and    x.patch_uid = s.patch_uid
--       and s.bundle_series = 'PSU'
/



prompt --------------------------------------------------------
prompt Patches installed into the $OH but not applied to the DB
prompt --------------------------------------------------------
with a as (select dbms_qopatch.get_opatch_lsinventory patch_output from dual)
select x.patch_id
,      x.patch_uid
,      x.description
from   a
,      xmltable('InventoryInstance/patches/*'
         passing a.patch_output
         columns
           patch_id number path 'patchID',
           patch_uid number path 'uniquePatchID',
           description varchar2(80) path 'patchDescription'
       ) x
minus
select s.patch_id
,      s.patch_uid
,      s.description
from   dba_registry_sqlpatch s
/




prompt --------------------------------------------------------
prompt Patches applied to the DB but not installed into the $OH
prompt --------------------------------------------------------
with a as (select dbms_qopatch.get_opatch_lsinventory patch_output from dual)
select s.patch_id
,      s.patch_uid
,      s.description
from   dba_registry_sqlpatch s
minus
select x.patch_id
,      x.patch_uid
,      x.description
from   a
,      xmltable('InventoryInstance/patches/*'
          passing a.patch_output
          columns
             patch_id number path 'patchID',
             patch_uid number path 'uniquePatchID',
             description varchar2(80) path 'patchDescription'
       ) x
/