Wednesday, November 1, 2017

datapatch in Oracle 12c.



Post installation of PSU has been changed since oracle 12c . There is a new script ( datapatch) that takes care of all the details. 

Once the opatch has been done to apply the patch , we need to start the services / database in upgrade mode and run the datapatch. 

Here  is the example.


Post Installation using Datapatch
---------------------------------------


C:\26792364>cd %ORACLE_HOME%/OPatch

C:\app\Oracle\product\12.1.0\dbhome_2\OPatch>datapatch -verbose
SQL Patching tool version 12.1.0.2.0 Production on Wed Nov  1 14:42:31 2017
Copyright (c) 2012, 2017, Oracle.  All rights reserved.

Log file for this invocation: c:\app\oracle\cfgtoollogs\sqlpatch\sqlpatch_2256_2017_11_01_14_42_31\sqlpatch_invocation.log

Connecting to database...OK
Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of SQL patches:
Patch 26792364 (WINDOWS ORACLE JAVAVM COMPONENT BUNDLE PATCH 12.1.0.2.171017 (64bit): 26792364):
  Installed in the binary registry only
Bundle series PSU:
  ID 171017 in the binary registry and ID 171017 in the SQL registry

Adding patches to installation queue and performing prereq checks...
Installation queue:
  Nothing to roll back
  The following patches will be applied:
    26792364 (WINDOWS ORACLE JAVAVM COMPONENT BUNDLE PATCH 12.1.0.2.171017 (64bit): 26792364)

Installing patches...
Patch installation complete.  Total patches installed: 1

Validating logfiles...
Patch 26792364 apply: SUCCESS
  logfile: c:\app\oracle\cfgtoollogs\sqlpatch\26792364\21612362/26792364_apply_CSDBQA12_2017Nov01_14_43_23.log (no errors)
SQL Patching tool complete on Wed Nov  1 14:47:53 2017


Confirm by checking the metadata
--------------------------------.


SQL> set linesize 1000
SQL> select * from
  2  ( Select  patch_id , patch_uid , version , status , action_time , flags
  3  from
  4  dba_registry_sqlpatch
  5  order by action_time desc )
  6  Where rownum <= 2 ;

  PATCH_ID  PATCH_UID VERSION              STATUS          ACTION_TIME                                                         FLAGS
---------- ---------- -------------------- --------------- --------------------------------------------------------------------------- ----------
  26792364   21612362 12.1.0.2             SUCCESS         01-NOV-17 02.47.53.329000 PM                                        UJJ

  26720785   21612430 12.1.0.2             SUCCESS         01-NOV-17 02.05.48.787000 PM                                        NB



I understand , oracle is changing the way the releases by going to Release Update / Release Update Revision .  Not sure , if this is going to be changed with the RU / RUR. 

And , I guess , with the autonomous database ( Oracle 18c ) , we need not worry about these kind of tasks . :-) 

Update :

I have delete the references to the Oracle 18c as autonomous . Thanks to Tim Hall for correcting this ( https://oracle-base.com/blog/2018/01/03/oracle-database-18c-is-not-an-autonomous-database/). 


No comments:

Post a Comment