Oracle Database: Select BLOB via DB Link


Today i’vh tried to select a simple blob over da database link. I know there are some restrictions using database links but in my business case i’vh to do this. So my goal is to transparenty select blobs over a database link from a remote database.

First I havn’t found any suiteable workaround. Here my references from support.oracle.com:

  • SELECT with a LOB and DBLink Returns an ORA-22992: Cannot Use LOB Locators Selected from Remote tables (Doc ID 1234893.1)
    • “The error is expected because the use of DBLinks and LOBs via the SELECT from PL/SQL is not supported.”
  • Ora-22992 workaround (Doc ID 436707.1)
    • Getting ORA-1406 with lobs greater than 32KB – 1
  • ORA-1406: Fetched Column Value was Truncated When Selecting Remote Column into Local BLOB Variable (Doc ID 459557.1)
    • “This means that we are not able to retrieve BLOBs columns greater than 32KB – 1 in size through a database link.”

Summarized we are not able to select a blob nativ over a database link if this blob is greater than 32KB-1.

The interesting thing is, that you are able to use DBMS_LOB operators on local and remote site. My favourite is the DBMS_LOB.SUBSTR function. The name is a little bit missleading because you can retrieve BLOB and CLOB. Here is my approach to select blob via a database link transparently to application:

VERSION 1 (chunk method):

create or replace function GETBLOBVIADBLINK
( dblnk in varchar2
  ,tbl  in varchar2
  ,col  in varchar2
  ,rwid in urowid)
return blob
is
  retval blob;
  tmpraw raw(2000);  
  tmplen number;
  tmpchk number;
  chksize number;
begin
  --preset vars
  chksize:=2000;
  dbms_lob.createtemporary (retval,true);
  execute immediate 'select dbms_lob.getlength@'||dblnk||' ('||col||') from '||tbl||'@'||dblnk||' where rowid=:rwid' into tmplen using rwid;
  
  -- precalc  
  tmpchk:=floor(tmplen/chksize);

  -- applicate frist chunks  
  for i in 0 .. tmpchk-1
  loop  
    execute immediate 'select dbms_lob.substr@'||dblnk||'('||col||','||chksize||','||((i*chksize)+1)||') from '||tbl||'@'||dblnk||' where rowid=:rwid' into tmpraw using rwid;
    dbms_lob.append(retval,tmpraw);
  end loop;
  
  -- applicate last entry
  if (tmplen-(tmpchk*chksize)) > 0 then
    execute immediate 'select dbms_lob.substr@'||dblnk||'('||col||','||(tmplen-(tmpchk*chksize))||','||((tmpchk*chksize)+1)||') from '||tbl||'@'||dblnk||' where rowid=:rwid' into tmpraw using rwid;
    dbms_lob.append(retval,tmpraw);
  end if;
  return retval;
end;
/

The explanation of the function is simple:

  1. Create a temp lob at local site
  2. The limitation of DBMS_LOB.SUBSTR is a RAW(2000) as maximum chunk size
  3. Copy chunk (2000 bytes max.) by chunk over the database link and append it to our local temporary blob. So we generate a local copy
  4. return local blob to upper caller

 

Now create a view with the new defintion:

CREATE OR REPLACE FORCE VIEW TESTVW1 (ID, MYLOB) AS 
SELECT id
       ,getblobviadblink('ARCHIV','MYLOBTABLE','MYLOB',rowid) MYLOB
FROM  MYLOB@archiv;

It’s done. I’m able to select a blob via dblink even it is greater than 32KB, now!

VERSION 2 (temporary table method):

create global temporary table tmplob (tmplob blob) ON COMMIT PRESERVE ROWS;
create or replace function getblobviadblink2
( dblnk in varchar2
  ,tbl  in varchar2
  ,col  in varchar2
  ,rwid in urowid)
return blob
is
  PRAGMA AUTONOMOUS_TRANSACTION;
  retval blob;
begin

  execute immediate 'insert /*+ NOLOGGING */ into tmplob select '||col||' from '||tbl||'@'||dblnk||' where rowid=:rwid' using rwid;
  select tmplob into retval from tmplob;
  delete /*+ NOLOGGING */ from tmplob;
  commit;
  return retval;
end;
/

Both methods are suitable for selecting on  it, but the VERSION2 Method is significant faster on network.

These are just two of many other ways. I would appreciate it if you share your implementation and experience with lob selection.

Oracle Enterprise Linux 6.5 is out!


There was two weeks since RedHat released it’s Enterprise Linux 6.4 (RHEL 6.5 Release Notes). Oracle have followed with Oracle Enterprise Linux 6.5 (Announcement). Some interessting new features comes with this release (OEL6.5/UEK3 Release Notes):

Linux Containers

This Features is fully supported by OEL now.

For the Oracle Database Users:

“Oracle Database is not yet supported for use with Linux Containers. The following information is intended for those who want to experiment with such a configuration.”

The following /proc parameter files may only be set on the host and not for individual containers

  • /proc/sys/fs/aio-max-nr
  • /proc/sys/net/core/rmem_default
  • /proc/sys/net/core/rmem_max
  • /proc/sys/net/core/wmem_default
  • /proc/sys/net/core/wmem_max
  • /proc/sys/net/ipv4/ip_local_port_range

Setting the parameters in the host to the Oracle recommended values sets them for all containers and allows the Oracle database to run in a container. For more information, see Configuring Kernel Parameters. (Bug ID 17217854)

Transparent Huge Pages

This release removes the Transparent Huge Pages (THP) feature. Following extensive benchmarking and testing, Oracle found that THP caused a performance degradation of between 5 and 10% for some workloads. This performance degradation was a result of a slower memory allocator code path being used even when the applications were not using THP. When the fact that huge pages are not swappable was taken into account, the positive effect that THP should provide was outweighed by its negative effects.

After installing this UEK release, you cannot enable THP (for example, by specifying kernel boot parameters). The THP settings under /sys/kernel/mm/transparent_hugepage have also been removed. A future update might contain an updated THP implementation which resolves the performance issue.

Note:This change does not affect support for applications that use explicit huge pages (for example, Oracle Database). (Bug ID 16823432)

One-gigabyte (1 GB) huge pages are not currently supported for the following configurations:

  • HVM guests
  • PV guests
  • Oracle Database

Two-megabyte (2 MB) huge pages have been tested and work with these configurations. (Bug ID 17299364, 17299871, 17271305)

Other features

There are some more interessting features. Please refer to UEK3 Overview

Oracle Database 12c: Apply 12.1.0.1.1 PSU (October 2013)


1. Preface

To apply PSU 12.1.0.1.1 oracle provides some new tools to reach this goal.

2. Apply PSU to single instance database

2.1 Set enviroment

[bash install]$ . oraenv
ORACLE_SID = [CDB1] ?
The Oracle base remains unchanged with value /opt/oracle/app
[bash install]$

2.2 Check OPatch version

[oracle install]$ $ORACLE_HOME/OPatch/opatch lsinventory | grep version
Oracle Interim Patch Installer version 12.1.0.1.0
OPatch version    : 12.1.0.1.0
OUI version       : 12.1.0.1.0

2.3 Upgrade OPatch

[oracle install]$ cp p6880880_121010_Linux-x86-64.zip $ORACLE_HOME
[oracle install]$ cd $ORACLE_HOME
[oracle dbhome_1]$ mv OPatch OPatch.old
[oracle dbhome_1]$ unzip p6880880_121010_Linux-x86-64.zip
Archive:  p6880880_121010_Linux-x86-64.zip
   creating: OPatch/
  inflating: OPatch/opatchauto
   creating: OPatch/jlib/
  inflating: OPatch/jlib/oracle.opatch.classpath.jar
  inflating: OPatch/jlib/oracle.opatch.classpath.windows.jar
  inflating: OPatch/jlib/opatch.jar
  inflating: OPatch/jlib/opatchsdk.jar
  inflating: OPatch/jlib/oracle.opatch.classpath.unix.jar
   creating: OPatch/oplan/
  inflating: OPatch/oplan/oplan.bat
   creating: OPatch/oplan/jlib/
  inflating: OPatch/oplan/jlib/oplan.jar
  inflating: OPatch/oplan/jlib/osysmodel-utils.jar
  inflating: OPatch/oplan/jlib/patchsdk.jar
  inflating: OPatch/oplan/jlib/JMXDrivers.jar
  inflating: OPatch/oplan/jlib/Validation.jar
  inflating: OPatch/oplan/jlib/bundle.jar
  inflating: OPatch/oplan/jlib/oracle.oplan.classpath.jar
  inflating: OPatch/oplan/jlib/OuiDriver.jar
  inflating: OPatch/oplan/jlib/automation.jar
   creating: OPatch/oplan/jlib/jaxb/
  inflating: OPatch/oplan/jlib/jaxb/jaxb-impl.jar
  inflating: OPatch/oplan/jlib/jaxb/activation.jar
  inflating: OPatch/oplan/jlib/jaxb/jaxb-api.jar
  inflating: OPatch/oplan/jlib/jaxb/jsr173_1.0_api.jar
  inflating: OPatch/oplan/jlib/EMrepoDrivers.jar
  inflating: OPatch/oplan/jlib/CRSProductDriver.jar
  inflating: OPatch/oplan/jlib/ValidationRules.jar
   creating: OPatch/oplan/jlib/apache-commons/
  inflating: OPatch/oplan/jlib/apache-commons/commons-cli-1.0.jar
  inflating: OPatch/oplan/jlib/OsysModel.jar
  inflating: OPatch/oplan/oplan
  inflating: OPatch/oplan/README.txt
  inflating: OPatch/oplan/README.html
   creating: OPatch/opatchprereqs/
  inflating: OPatch/opatchprereqs/prerequisite.properties
   creating: OPatch/opatchprereqs/opatch/
  inflating: OPatch/opatchprereqs/opatch/opatch_prereq.xml
  inflating: OPatch/opatchprereqs/opatch/runtime_prereq.xml
  inflating: OPatch/opatchprereqs/opatch/rulemap.xml
   creating: OPatch/opatchprereqs/oui/
  inflating: OPatch/opatchprereqs/oui/knowledgesrc.xml
  inflating: OPatch/emdpatch.pl
  inflating: OPatch/opatch.pl
  inflating: OPatch/opatch
  inflating: OPatch/opatch.bat
  inflating: OPatch/README.txt
  inflating: OPatch/datapatch.bat
   creating: OPatch/docs/
  inflating: OPatch/docs/Prereq_Users_Guide.txt
  inflating: OPatch/docs/Users_Guide.txt
  inflating: OPatch/docs/FAQ
   creating: OPatch/ocm/
  inflating: OPatch/ocm/ocm_platforms.txt
 extracting: OPatch/ocm/ocm.zip
   creating: OPatch/ocm/lib/
  inflating: OPatch/ocm/lib/emocmclnt.jar
  inflating: OPatch/ocm/lib/emocmclnt-14.jar
  inflating: OPatch/ocm/lib/http_client.jar
  inflating: OPatch/ocm/lib/osdt_jce.jar
  inflating: OPatch/ocm/lib/jnet.jar
  inflating: OPatch/ocm/lib/emocmcommon.jar
  inflating: OPatch/ocm/lib/xmlparserv2.jar
  inflating: OPatch/ocm/lib/log4j-core.jar
  inflating: OPatch/ocm/lib/jcert.jar
  inflating: OPatch/ocm/lib/jsse.jar
  inflating: OPatch/ocm/lib/osdt_core3.jar
  inflating: OPatch/ocm/lib/regexp.jar
   creating: OPatch/ocm/bin/
  inflating: OPatch/ocm/bin/emocmrsp
  inflating: OPatch/operr_readme.txt
 extracting: OPatch/version.txt
  inflating: OPatch/operr.bat
  inflating: OPatch/opatch.ini
  inflating: OPatch/datapatch
  inflating: OPatch/operr
  inflating: PatchSearch.xml
[oracle dbhome_1]$

2.4 Check OPatch pre apply requirements

[oracle dbhome_1]$ cd /opt/oracle/install
[oracle install]$ unzip p17027533_121010_Linux-x86-64.zip
Archive:  p17027533_121010_Linux-x86-64.zip
   creating: 17027533/
  inflating: 17027533/README.html
 extracting: 17027533/README.txt
   creating: 17027533/etc/
   creating: 17027533/etc/config/
  inflating: 17027533/etc/config/actions.xml
  inflating: 17027533/etc/config/inventory.xml
   creating: 17027533/files/
   creating: 17027533/files/lib/
  inflating: 17027533/files/lib/asmcmdexceptions.pm
  inflating: 17027533/files/lib/librs12.so
   creating: 17027533/files/lib/libgeneric12.a/
  inflating: 17027533/files/lib/libgeneric12.a/kgh.o
  inflating: 17027533/files/lib/libgeneric12.a/kgl4.o
  inflating: 17027533/files/lib/libgeneric12.a/kxdcap.o
  inflating: 17027533/files/lib/libgeneric12.a/kgl.o
  inflating: 17027533/files/lib/libgeneric12.a/kgl2.o
   creating: 17027533/files/lib/libserver12.a/
  inflating: 17027533/files/lib/libserver12.a/ksp.o
  inflating: 17027533/files/lib/libserver12.a/kpdbd.o
  inflating: 17027533/files/lib/libserver12.a/kmm.o
  inflating: 17027533/files/lib/libserver12.a/kjbm.o
  inflating: 17027533/files/lib/libserver12.a/ksb.o
  inflating: 17027533/files/lib/libserver12.a/kkm.o
  inflating: 17027533/files/lib/libserver12.a/kqr.o
  inflating: 17027533/files/lib/libserver12.a/kjcts.o
  inflating: 17027533/files/lib/libserver12.a/ktsj.o
  inflating: 17027533/files/lib/libserver12.a/opilof.o
  inflating: 17027533/files/lib/libserver12.a/kkzl.o
  inflating: 17027533/files/lib/libserver12.a/kcvfdb.o
  inflating: 17027533/files/lib/libserver12.a/kql.o
  inflating: 17027533/files/lib/libserver12.a/kjm.o
  inflating: 17027533/files/lib/libserver12.a/fbadrv.o
  inflating: 17027533/files/lib/libserver12.a/kpdba.o
  inflating: 17027533/files/lib/libserver12.a/ktm.o
  inflating: 17027533/files/lib/libserver12.a/ksl.o
  inflating: 17027533/files/lib/libserver12.a/kpolon.o
  inflating: 17027533/files/lib/libserver12.a/qesrc.o
  inflating: 17027533/files/lib/libserver12.a/kpdbe.o
  inflating: 17027533/files/lib/libserver12.a/kpdb.o
  inflating: 17027533/files/lib/libserver12.a/kzap.o
  inflating: 17027533/files/lib/libserver12.a/kzr.o
  inflating: 17027533/files/lib/libserver12.a/kjbl.o
  inflating: 17027533/files/lib/libserver12.a/qerfx.o
  inflating: 17027533/files/lib/libserver12.a/ksfd.o
  inflating: 17027533/files/lib/libserver12.a/ksfdaf.o
  inflating: 17027533/files/lib/libserver12.a/kdu.o
  inflating: 17027533/files/lib/libserver12.a/krvrd.o
  inflating: 17027533/files/lib/libserver12.a/kff.o
  inflating: 17027533/files/lib/libserver12.a/kpon.o
  inflating: 17027533/files/lib/libserver12.a/kpdbutl.o
  inflating: 17027533/files/lib/libserver12.a/knalf.o
  inflating: 17027533/files/lib/libserver12.a/jscr.o
  inflating: 17027533/files/lib/libserver12.a/kxdam.o
  inflating: 17027533/files/lib/libserver12.a/knas.o
  inflating: 17027533/files/lib/libserver12.a/kcfis.o
  inflating: 17027533/files/lib/libserver12.a/krt.o
  inflating: 17027533/files/lib/libserver12.a/ctc.o
  inflating: 17027533/files/lib/libserver12.a/ksws.o
  inflating: 17027533/files/lib/libserver12.a/aud.o
  inflating: 17027533/files/lib/libserver12.a/krvt.o
  inflating: 17027533/files/lib/libserver12.a/kwqr.o
  inflating: 17027533/files/lib/libserver12.a/kjb.o
  inflating: 17027533/files/lib/libserver12.a/kzvdve.o
  inflating: 17027533/files/lib/libserver12.a/kxes.o
  inflating: 17027533/files/lib/libserver12.a/cvw.o
  inflating: 17027533/files/lib/libserver12.a/kqlb.o
  inflating: 17027533/files/lib/libserver12.a/ktsi.o
  inflating: 17027533/files/lib/libserver12.a/kfi.o
  inflating: 17027533/files/lib/libserver12.a/knipg.o
  inflating: 17027533/files/lib/libserver12.a/jskq.o
  inflating: 17027533/files/lib/libserver12.a/kjzd.o
  inflating: 17027533/files/lib/libserver12.a/kdo.o
  inflating: 17027533/files/lib/libserver12.a/kjbr.o
  inflating: 17027533/files/lib/libserver12.a/kwqic.o
  inflating: 17027533/files/lib/libserver12.a/ksk.o
  inflating: 17027533/files/lib/libserver12.a/knl.o
  inflating: 17027533/files/lib/libserver12.a/ktfa.o
  inflating: 17027533/files/lib/libserver12.a/knahs.o
  inflating: 17027533/files/lib/libserver12.a/qol.o
  inflating: 17027533/files/lib/libserver12.a/ksu.o
  inflating: 17027533/files/lib/libserver12.a/kcl.o
  inflating: 17027533/files/lib/libserver12.a/knanr.o
  inflating: 17027533/files/lib/libserver12.a/kxdofl.o
  inflating: 17027533/files/lib/libserver12.a/k2v.o
  inflating: 17027533/files/lib/libserver12.a/kjfc.o
  inflating: 17027533/files/lib/libserver12.a/knalse.o
  inflating: 17027533/files/lib/libserver12.a/kkt.o
  inflating: 17027533/files/lib/libserver12.a/kzekm.o
  inflating: 17027533/files/lib/libserver12.a/kdn.o
  inflating: 17027533/files/lib/libserver12.a/kcf.o
  inflating: 17027533/files/lib/libserver12.a/kwqmn.o
  inflating: 17027533/files/lib/libserver12.a/ktt.o
  inflating: 17027533/files/lib/libserver12.a/kzp.o
  inflating: 17027533/files/lib/libserver12.a/kokl2.o
  inflating: 17027533/files/lib/libserver12.a/kzckmr.o
  inflating: 17027533/files/lib/libserver12.a/knasp.o
  inflating: 17027533/files/lib/libserver12.a/kokt.o
  inflating: 17027533/files/lib/libserver12.a/kfda.o
  inflating: 17027533/files/lib/libserver12.a/kfpkg.o
  inflating: 17027533/files/lib/libserver12.a/kpdbicd.o
  inflating: 17027533/files/lib/libserver12.a/opiprs.o
  inflating: 17027533/files/lib/libserver12.a/knahf.o
  inflating: 17027533/files/lib/libserver12.a/qksrc.o
  inflating: 17027533/files/lib/libserver12.a/dgls.o
  inflating: 17027533/files/lib/libserver12.a/kzmkr.o
  inflating: 17027533/files/lib/libserver12.a/kewf.o
  inflating: 17027533/files/lib/libserver12.a/kcc.o
  inflating: 17027533/files/lib/libserver12.a/qkagby.o
  inflating: 17027533/files/lib/libserver12.a/ksfq.o
  inflating: 17027533/files/lib/libserver12.a/kewm.o
  inflating: 17027533/files/lib/libserver12.a/kpdbcv.o
  inflating: 17027533/files/lib/libserver12.a/kfd.o
  inflating: 17027533/files/lib/libserver12.a/kcbo.o
  inflating: 17027533/files/lib/libserver12.a/knlogc.o
  inflating: 17027533/files/lib/libserver12.a/kpdbc.o
  inflating: 17027533/files/lib/libserver12.a/qmps.o
  inflating: 17027533/files/lib/libserver12.a/sol.o
  inflating: 17027533/files/lib/libserver12.a/dgl.o
  inflating: 17027533/files/lib/libserver12.a/krvxr.o
  inflating: 17027533/files/lib/libserver12.a/kwslb.o
  inflating: 17027533/files/lib/libserver12.a/jskm.o
  inflating: 17027533/files/lib/libserver12.a/krvxb.o
  inflating: 17027533/files/lib/libserver12.a/kcb.o
  inflating: 17027533/files/lib/libserver12.a/kfgb.o
  inflating: 17027533/files/lib/libserver12.a/knals.o
  inflating: 17027533/files/lib/libserver12.a/ktrv.o
  inflating: 17027533/files/lib/libserver12.a/kkp.o
  inflating: 17027533/files/lib/libserver12.a/knasx.o
  inflating: 17027533/files/lib/libserver12.a/knasda.o
  inflating: 17027533/files/lib/libserver12.a/kfvsu.o
  inflating: 17027533/files/lib/libserver12.a/knam.o
  inflating: 17027533/files/lib/libserver12.a/kkeaf.o
  inflating: 17027533/files/lib/libserver12.a/kwqv.o
  inflating: 17027533/files/lib/libserver12.a/kzckm.o
  inflating: 17027533/files/lib/libserver12.a/kjzn.o
  inflating: 17027533/files/lib/libserver12.a/knac.o
  inflating: 17027533/files/lib/libserver12.a/kffm.o
  inflating: 17027533/files/lib/libserver12.a/zllc.o
  inflating: 17027533/files/lib/libnnz12.so
  inflating: 17027533/files/lib/libnnzst12.a
  inflating: 17027533/files/lib/asmcmdshare.pm
  inflating: 17027533/files/lib/libzt12.a
  inflating: 17027533/files/lib/asmcmddisk.pm
  inflating: 17027533/files/lib/libosbws12.so
   creating: 17027533/files/sqlpatch/
  inflating: 17027533/files/sqlpatch/sqlpatch.pm
  inflating: 17027533/files/sqlpatch/sqlpatch.pl
   creating: 17027533/files/sqlpatch/17027533/
  inflating: 17027533/files/sqlpatch/17027533/17027533_apply.sql
  inflating: 17027533/files/sqlpatch/17027533/17027533_rollback.sql
   creating: 17027533/files/rdbms/
   creating: 17027533/files/rdbms/lib/
  inflating: 17027533/files/rdbms/lib/jox.o
   creating: 17027533/files/rdbms/lib/libknlopt.a/
  inflating: 17027533/files/rdbms/lib/libknlopt.a/jox.o
   creating: 17027533/files/rdbms/mesg/
  inflating: 17027533/files/rdbms/mesg/oraus.msg
  inflating: 17027533/files/rdbms/mesg/oraus.msb
   creating: 17027533/files/rdbms/admin/
  inflating: 17027533/files/rdbms/admin/prvtbstr.plb
  inflating: 17027533/files/rdbms/admin/prvtlmd.plb
  inflating: 17027533/files/rdbms/admin/bundledata_PSU.xml
  inflating: 17027533/files/rdbms/admin/catbundleapply.sql
  inflating: 17027533/files/rdbms/admin/prvtbxstr.plb
  inflating: 17027533/files/rdbms/admin/catuppst.sql
  inflating: 17027533/files/rdbms/admin/catbundle.sql
  inflating: 17027533/files/rdbms/admin/cdenv.sql
  inflating: 17027533/files/rdbms/admin/catbundlerollback.sql
   creating: 17027533/files/bin/
  inflating: 17027533/files/bin/asmcmdcore
   creating: 17027533/files/patch/
   creating: 17027533/files/patch/scripts/
  inflating: 17027533/files/patch/scripts/bug16825779.sql
  inflating: 17027533/files/patch/scripts/bug16286774.sql
[oracle install]$ cd 17027533
[oracle 17027533]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.1.0.1.2
Copyright (c) 2013, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /opt/oracle/app/product/12.1.0/dbhome_1
Central Inventory : /opt/oracle/oraInventory
   from           : /opt/oracle/app/product/12.1.0/dbhome_1/oraInst.loc
OPatch version    : 12.1.0.1.2
OUI version       : 12.1.0.1.0
Log file location : /opt/oracle/app/product/12.1.0/dbhome_1/cfgtoollogs/opatch/opatch2013-11-27_21-48-10PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
[oracle 17027533]$

2.5 Stopping all components

[oracle 17027533]$ lsnrctl stop

LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 27-NOV-2013 21:43:34

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
The command completed successfully
[oracle 17027533]$
[oracle 17027533]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Wed Nov 27 21:43:07 2013

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

2.6 Apply patch

[oracle 17027533]$ $ORACLE_HOME/OPatch/opatch apply
Oracle Interim Patch Installer version 12.1.0.1.2
Copyright (c) 2013, Oracle Corporation.  All rights reserved.

Oracle Home       : /opt/oracle/app/product/12.1.0/dbhome_1
Central Inventory : /opt/oracle/oraInventory
   from           : /opt/oracle/app/product/12.1.0/dbhome_1/oraInst.loc
OPatch version    : 12.1.0.1.2
OUI version       : 12.1.0.1.0
Log file location : /opt/oracle/app/product/12.1.0/dbhome_1/cfgtoollogs/opatch/17027533_Nov_27_2013_21_43_50/apply2013-11-27_21-43-50PM_1.log

Applying interim patch '17027533' to OH '/opt/oracle/app/product/12.1.0/dbhome_1'
Verifying environment and performing prerequisite checks...
All checks passed.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name:

You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  y

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/opt/oracle/app/product/12.1.0/dbhome_1')

Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...

Patching component oracle.rdbms, 12.1.0.1.0...

Patching component oracle.rdbms.dbscripts, 12.1.0.1.0...

Patching component oracle.rdbms.rsf, 12.1.0.1.0...

Patching component oracle.ldap.rsf, 12.1.0.1.0...

Patching component oracle.ldap.rsf.ic, 12.1.0.1.0...

Verifying the update...
Patch 17027533 successfully applied
Log file location: /opt/oracle/app/product/12.1.0/dbhome_1/cfgtoollogs/opatch/17027533_Nov_27_2013_21_43_50/apply2013-11-27_21-43-50PM_1.log

OPatch succeeded.
[oracle 17027533]$

2.7 Start components

[oracle 17027533]$ lsnrctl start

LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 27-NOV-2013 21:44:48

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Starting /opt/oracle/app/product/12.1.0/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Log messages written to /opt/oracle/app/diag/tnslsnr/oel12ctest/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel12ctest)(PORT=1521)))

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date                27-NOV-2013 21:44:48
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Log File         /opt/oracle/app/diag/tnslsnr/oel12ctest/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel12ctest)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle 17027533]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Wed Nov 27 21:44:50 2013

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 1269366784 bytes
Fixed Size                  2287912 bytes
Variable Size             855639768 bytes
Database Buffers          402653184 bytes
Redo Buffers                8785920 bytes
Database mounted.
Database opened.
SQL> alter pluggable database all open;

Pluggable database altered.

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

2.7 Check applied patches

cd $ORACLE_HOME/OPatch
[oracle OPatch]$ ./opatch lsinventory
Oracle Interim Patch Installer version 12.1.0.1.2
Copyright (c) 2013, Oracle Corporation.  All rights reserved.

Oracle Home       : /opt/oracle/app/product/12.1.0/dbhome_1
Central Inventory : /opt/oracle/oraInventory
   from           : /opt/oracle/app/product/12.1.0/dbhome_1/oraInst.loc
OPatch version    : 12.1.0.1.2
OUI version       : 12.1.0.1.0
Log file location : /opt/oracle/app/product/12.1.0/dbhome_1/cfgtoollogs/opatch/opatch2013-11-27_21-52-12PM_1.log

Lsinventory Output file location : /opt/oracle/app/product/12.1.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2013-11-27_21-52-12PM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1):

Oracle Database 12c                                                  12.1.0.1.0
There are 1 products installed in this Oracle Home.

Interim patches (1) :

Patch  17027533     : applied on Wed Nov 27 21:49:35 CET 2013
Unique Patch ID:  16677152
Patch description:  "Database Patch Set Update : 12.1.0.1.1 (17027533)"
   Created on 27 Sep 2013, 05:30:33 hrs PST8PDT
   Bugs fixed:
     17034172, 16694728, 16448848, 16863422, 16634384, 16465158, 16320173
     16313881, 16910734, 16816103, 16911800, 16715647, 16825779, 16707927
     16392068, 14197853, 16712618, 17273253, 16902138, 16524071, 16856570
     16465149, 16705020, 16689109, 16372203, 16864864, 16849982, 16946613
     16837842, 16964279, 16459685, 16978185, 16845022, 16195633, 14536110
     16964686, 16787973, 16850996, 16674842, 16838328, 16178562, 15996344
     16503473, 16842274, 16935643, 17000176, 14355775, 16362358, 16994576
     16485876, 16919176, 16928832, 16864359, 16617325, 16921340, 16679874
     16788832, 16483559, 16733884, 16784167, 16286774, 15986012, 16660558
     16674666, 16191248, 16697600, 16993424, 16946990, 16589507, 16173738
     16784143, 16772060, 16991789, 17346196, 16495802, 16859937, 16590848
     16910001, 16603924, 16427054, 16730813, 16227068, 16663303, 16784901
     16836849, 16186165, 16457621, 16007562, 16170787, 16663465, 16524968
     16543323, 17027533, 16675710, 17005047, 16795944, 16668226, 16070351
     16212405, 16523150, 16698577, 16621274, 16930325, 17330580, 16443657

--------------------------------------------------------------------------------

OPatch succeeded.

2.8 Postpatch work
Here comes the new section. On 11g and earlier you have to use @catbundle.sql psu apply. In 12g the new tool datapatch will do this work you you.

[oracle 17027533]$ cd $ORACLE_HOME/OPatch
[oracle OPatch]$ ./datapatch -verbose
SQL Patching tool version 12.1.0.1.0 on Wed Nov 27 21:46:28 2013
Copyright (c) 2013, Oracle.  All rights reserved.

Connecting to database...OK
Determining current state...
Currently installed SQL Patches:
  PDB CDB$ROOT:
  PDB PDB$SEED:
  PDB PDB1:
Currently installed C Patches: 17027533
For the following PDBs: CDB$ROOT
  Nothing to roll back
  The following patches will be applied: 17027533
For the following PDBs: PDB$SEED
  Nothing to roll back
  The following patches will be applied: 17027533
For the following PDBs: PDB1
  Nothing to roll back
  The following patches will be applied: 17027533
Adding patches to installation queue...
Installing patches...
Validating logfiles...
Patch 17027533 apply (pdb CDB$ROOT): SUCCESS
  logfile: /opt/oracle/app/product/12.1.0/dbhome_1/sqlpatch/17027533/17027533_apply_CDB1_CDBROOT_2013Nov27_21_46_32.log (no errors)
Patch 17027533 apply (pdb PDB$SEED): SUCCESS
  logfile: /opt/oracle/app/product/12.1.0/dbhome_1/sqlpatch/17027533/17027533_apply_CDB1_PDBSEED_2013Nov27_21_46_41.log (no errors)
Patch 17027533 apply (pdb PDB1): SUCCESS
  logfile: /opt/oracle/app/product/12.1.0/dbhome_1/sqlpatch/17027533/17027533_apply_CDB1_PDB1_2013Nov27_21_46_44.log (no errors)
SQL Patching tool complete on Wed Nov 27 21:46:53 2013

Problems while patching with datapatch

If you rollback an online patch before you apply the psu you may get an error during datapatch:

[oracle OPatch]$ export OPATCH_DEBUG=true
[oracle OPatch]$ ./datapatch -verbose -debug
SQL Patching tool version 12.1.0.1.0 on Tue Oct 29 13:25:17 2013
Copyright (c) 2013, Oracle. All rights reserved.

Command line arguments:
db:
apply_list:
rollback_list:
force: 0
prereq: 0
oh:
Connecting to database...OK
Determining current state...
CDB! pdbs: CDB$ROOT PDB$SEED PDB1
Currently installed SQL Patches:
PDB CDB$ROOT:
PDB PDB$SEED:
PDB PDB1:
DBD::Oracle::st execute failed: ORA-20001: Latest xml inventory is not loaded into table
ORA-06512: at "SYS.DBMS_QOPATCH", line 1011
ORA-06512: at line 4 (DBD ERROR: OCIStmtExecute) [for Statement "DECLARE
x XMLType;
BEGIN
x := dbms_qopatch.get_pending_activity;
? := x.getStringVal();
END;" with ParamValues: :p1=undef] at /opt/oracle/app/product/12.1.0/dbhome_1/sqlpatch/sqlpatch.pm line 824.
[oracle OPatch]$

This is a problem with directories created during patching …
To solve this issue you can workaround with the following

Check parameter:

SELECT a.ksppinm “Parameter”,
b.ksppstvl “Session Value”,
c.ksppstvl “Instance Value”
FROM x$ksppi a,
x$ksppcv b,
x$ksppsv c
WHERE a.indx = b.indx
AND a.indx = c.indx
AND a.ksppinm LIKE ‘/_disable_direc%’ escape ‘/’

if _disable_directory_link_check is set to FALSE I would suggest you set to TRUE and try to execute datapatch and update again. It should work now.

3. Apply PSU to Grid Infrastruce and RAC database

3.1 Check GI Patches

[oracle@node0 ~]$ opatch lsinventory
Oracle Interim Patch Installer version 12.1.0.1.2
Copyright (c) 2013, Oracle Corporation.  All rights reserved.

Oracle Home       : /opt/oracle/12.1.0.1/grid
Central Inventory : /opt/oracle/oraInventory
   from           : /opt/oracle/12.1.0.1/grid/oraInst.loc
OPatch version    : 12.1.0.1.2
OUI version       : 12.1.0.1.0
Log file location : /opt/oracle/12.1.0.1/grid/cfgtoollogs/opatch/opatch2013-11-24_22-37-14PM_1.log

Lsinventory Output file location : /opt/oracle/12.1.0.1/grid/cfgtoollogs/opatch/lsinv/lsinventory2013-11-24_22-37-14PM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1):

Oracle Grid Infrastructure 12c                                       12.1.0.1.0
There are 1 products installed in this Oracle Home.

There are no Interim patches installed in this Oracle Home.

Patch level status of Cluster nodes :

 Patching Level                  Nodes
 --------------                  -----
 0                               node1,node0,node2,node3

--------------------------------------------------------------------------------

3.2 Check Databases Patches

[oracle@node0 ~]$ opatch lsinventory
Oracle Interim Patch Installer version 12.1.0.1.2
Copyright (c) 2013, Oracle Corporation.  All rights reserved.

Oracle Home       : /opt/oracle/app/12.1.0.1/dbhome_1
Central Inventory : /opt/oracle/oraInventory
   from           : /opt/oracle/app/12.1.0.1/dbhome_1/oraInst.loc
OPatch version    : 12.1.0.1.2
OUI version       : 12.1.0.1.0
Log file location : /opt/oracle/app/12.1.0.1/dbhome_1/cfgtoollogs/opatch/opatch2013-11-24_22-39-13PM_1.log

Lsinventory Output file location : /opt/oracle/app/12.1.0.1/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2013-11-24_22-39-13PM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1):

Oracle Database 12c                                                  12.1.0.1.0
There are 1 products installed in this Oracle Home.

There are no Interim patches installed in this Oracle Home.

Rac system comprising of multiple nodes
  Local node = node0
  Remote node = node1
  Remote node = node2
  Remote node = node3

--------------------------------------------------------------------------------

3.3 Create response file

[oracle@node0 tmp]$ cd /opt/oracle/12.1.0.1/grid/OPatch/ocm/bin
[oracle@node0 bin]$ ls -l
total 12
-rwxr----- 1 oracle oinstall 9063 Nov 27  2009 emocmrsp
[oracle@node0 bin]$ ./emocmrsp
OCM Installation Response Generator 10.3.7.0.0 - Production
Copyright (c) 2005, 2012, Oracle and/or its affiliates.  All rights reserved.

Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name:

You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  y
The OCM configuration response file (ocm.rsp) was successfully created.
[oracle@node0 bin]$ ls -l
total 16
-rwxr----- 1 oracle oinstall 9063 Nov 27  2009 emocmrsp
-rw-r--r-- 1 oracle oinstall  623 Nov 24 22:42 ocm.rsp
[oracle@node0 bin]$ cp ocm.rsp /opt/oracle/install/

3.4 Patch GI and Databases with opatchauto
opatchauto is also a new tool to apply patches automated to gi and database at one step. You have to run this as ROOT user:

[root@node0 install]# opatchauto apply /opt/oracle/install/17272829 -ocmrf /opt/oracle/install/ocm.rsp
OPatch Automation Tool
Copyright (c) 2013, Oracle Corporation.  All rights reserved.

OPatchauto version : 12.1.0.1.2
OUI version        : 12.1.0.1.0
Running from       : /opt/oracle/12.1.0.1/grid

opatchauto log file: /opt/oracle/12.1.0.1/grid/cfgtoollogs/opatchauto/17272829/opatch_gi_2013-11-24_22-43-51_deploy.log

Parameter Validation: Successful

Grid Infrastructure home:
/opt/oracle/12.1.0.1/grid
RAC home(s):
/opt/oracle/app/12.1.0.1/dbhome_1

Configuration Validation: Successful

Patch Location: /opt/oracle/install/17272829
Grid Infrastructure Patch(es): 17027533 17077442 17303297
RAC Patch(es): 17027533 17077442

Patch Validation: Successful

Stopping RAC (/opt/oracle/app/12.1.0.1/dbhome_1) ... Successful
Following database(s) were stopped and will be restarted later during the session: cdb1

Applying patch(es) to "/opt/oracle/app/12.1.0.1/dbhome_1" ...
Patch "/opt/oracle/install/17272829/17027533" successfully applied to "/opt/oracle/app/12.1.0.1/dbhome_1".
Patch "/opt/oracle/install/17272829/17077442" successfully applied to "/opt/oracle/app/12.1.0.1/dbhome_1".

Stopping CRS ... Successful

Applying patch(es) to "/opt/oracle/12.1.0.1/grid" ...
Patch "/opt/oracle/install/17272829/17027533" successfully applied to "/opt/oracle/12.1.0.1/grid".
Patch "/opt/oracle/install/17272829/17077442" successfully applied to "/opt/oracle/12.1.0.1/grid".
Patch "/opt/oracle/install/17272829/17303297" successfully applied to "/opt/oracle/12.1.0.1/grid".

Starting CRS ... Successful

Starting RAC (/opt/oracle/app/12.1.0.1/dbhome_1) ... Successful

SQL changes, if any, are applied successfully on the following database(s): CDB1

Apply Summary:
Following patch(es) are successfully installed:
GI Home: /opt/oracle/12.1.0.1/grid: 17027533, 17077442, 17303297
RAC Home: /opt/oracle/app/12.1.0.1/dbhome_1: 17027533, 17077442

opatchauto succeeded.
[root@node0 install]#

3.5 Check patch on local node

[root@node0 install]# su - oracle
[oracle@node0 ~]$ opatch lsinventory
Oracle Interim Patch Installer version 12.1.0.1.2
Copyright (c) 2013, Oracle Corporation.  All rights reserved.

Oracle Home       : /opt/oracle/12.1.0.1/grid
Central Inventory : /opt/oracle/oraInventory
   from           : /opt/oracle/12.1.0.1/grid/oraInst.loc
OPatch version    : 12.1.0.1.2
OUI version       : 12.1.0.1.0
Log file location : /opt/oracle/12.1.0.1/grid/cfgtoollogs/opatch/opatch2013-11-24_22-57-20PM_1.log

Lsinventory Output file location : /opt/oracle/12.1.0.1/grid/cfgtoollogs/opatch/lsinv/lsinventory2013-11-24_22-57-20PM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1):

Oracle Grid Infrastructure 12c                                       12.1.0.1.0
There are 1 products installed in this Oracle Home.

Interim patches (3) :

Patch  17303297     : applied on Sun Nov 24 22:50:27 CET 2013
Unique Patch ID:  16881795
Patch description:  "ACFS Patch Set Update 12.1.0.1.1"
   Created on 14 Oct 2013, 07:25:50 hrs US/Central
   Bugs fixed:
     14487556, 16398970, 16552813, 16930184, 16420645, 16170117, 16436434
     16476044, 16458315, 16463033, 16095100, 16545876, 16429953, 14826673
     16001893, 16482869, 16371746, 16435343, 14476443, 16294308, 16671486
     16386110, 15978267, 16085530, 16347837, 16814544, 16022372, 16167084
     14510092, 16450287, 16399406

Patch  17077442     : applied on Sun Nov 24 22:49:35 CET 2013
Unique Patch ID:  16881794
Patch description:  "Oracle Clusterware Patch Set Update 12.1.0.1.1"
   Created on 12 Oct 2013, 06:33:53 hrs US/Central
   Bugs fixed:
     16505840, 16505255, 16390989, 16399322, 16505617, 16505717, 17486244
     16168869, 16444109, 16505361, 13866165, 16505763, 16208257, 16904822
     17299876, 16246222, 16505214, 16505540, 15936039, 16580269, 16838292
     16505449, 16801843, 16309853, 16505395, 17507349, 17475155, 16493242
     17039197, 16196609, 17463260, 16505667, 15970176, 16488665, 16670327

Patch  17027533     : applied on Sun Nov 24 22:49:04 CET 2013
Unique Patch ID:  16677152
Patch description:  "Database Patch Set Update : 12.1.0.1.1 (17027533)"
   Created on 27 Sep 2013, 05:30:33 hrs PST8PDT
   Bugs fixed:
     17034172, 16694728, 16448848, 16863422, 16634384, 16465158, 16320173
     16313881, 16910734, 16816103, 16911800, 16715647, 16825779, 16707927
     16392068, 14197853, 16712618, 17273253, 16902138, 16524071, 16856570
     16465149, 16705020, 16689109, 16372203, 16864864, 16849982, 16946613
     16837842, 16964279, 16459685, 16978185, 16845022, 16195633, 14536110
     16964686, 16787973, 16850996, 16674842, 16838328, 16178562, 15996344
     16503473, 16842274, 16935643, 17000176, 14355775, 16362358, 16994576
     16485876, 16919176, 16928832, 16864359, 16617325, 16921340, 16679874
     16788832, 16483559, 16733884, 16784167, 16286774, 15986012, 16660558
     16674666, 16191248, 16697600, 16993424, 16946990, 16589507, 16173738
     16784143, 16772060, 16991789, 17346196, 16495802, 16859937, 16590848
     16910001, 16603924, 16427054, 16730813, 16227068, 16663303, 16784901
     16836849, 16186165, 16457621, 16007562, 16170787, 16663465, 16524968
     16543323, 17027533, 16675710, 17005047, 16795944, 16668226, 16070351
     16212405, 16523150, 16698577, 16621274, 16930325, 17330580, 16443657

Patch level status of Cluster nodes :

 Patching Level                  Nodes
 --------------                  -----
 1650217826                      node0
 0                               node1,node2,node3

--------------------------------------------------------------------------------

OPatch succeeded.
[oracle@node0 ~]$

3.6 Repeat the opatchauto process on each node
3.7 Check opatch inventory again now

[root@node0 install]# su - oracle
[oracle@node0 ~]$ opatch lsinventory
Oracle Interim Patch Installer version 12.1.0.1.2
Copyright (c) 2013, Oracle Corporation.  All rights reserved.

Oracle Home       : /opt/oracle/12.1.0.1/grid
Central Inventory : /opt/oracle/oraInventory
   from           : /opt/oracle/12.1.0.1/grid/oraInst.loc
OPatch version    : 12.1.0.1.2
OUI version       : 12.1.0.1.0
Log file location : /opt/oracle/12.1.0.1/grid/cfgtoollogs/opatch/opatch2013-11-24_22-57-20PM_1.log

Lsinventory Output file location : /opt/oracle/12.1.0.1/grid/cfgtoollogs/opatch/lsinv/lsinventory2013-11-24_22-57-20PM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1):

Oracle Grid Infrastructure 12c                                       12.1.0.1.0
There are 1 products installed in this Oracle Home.

Interim patches (3) :

Patch  17303297     : applied on Sun Nov 24 22:50:27 CET 2013
Unique Patch ID:  16881795
Patch description:  "ACFS Patch Set Update 12.1.0.1.1"
   Created on 14 Oct 2013, 07:25:50 hrs US/Central
   Bugs fixed:
     14487556, 16398970, 16552813, 16930184, 16420645, 16170117, 16436434
     16476044, 16458315, 16463033, 16095100, 16545876, 16429953, 14826673
     16001893, 16482869, 16371746, 16435343, 14476443, 16294308, 16671486
     16386110, 15978267, 16085530, 16347837, 16814544, 16022372, 16167084
     14510092, 16450287, 16399406

Patch  17077442     : applied on Sun Nov 24 22:49:35 CET 2013
Unique Patch ID:  16881794
Patch description:  "Oracle Clusterware Patch Set Update 12.1.0.1.1"
   Created on 12 Oct 2013, 06:33:53 hrs US/Central
   Bugs fixed:
     16505840, 16505255, 16390989, 16399322, 16505617, 16505717, 17486244
     16168869, 16444109, 16505361, 13866165, 16505763, 16208257, 16904822
     17299876, 16246222, 16505214, 16505540, 15936039, 16580269, 16838292
     16505449, 16801843, 16309853, 16505395, 17507349, 17475155, 16493242
     17039197, 16196609, 17463260, 16505667, 15970176, 16488665, 16670327

Patch  17027533     : applied on Sun Nov 24 22:49:04 CET 2013
Unique Patch ID:  16677152
Patch description:  "Database Patch Set Update : 12.1.0.1.1 (17027533)"
   Created on 27 Sep 2013, 05:30:33 hrs PST8PDT
   Bugs fixed:
     17034172, 16694728, 16448848, 16863422, 16634384, 16465158, 16320173
     16313881, 16910734, 16816103, 16911800, 16715647, 16825779, 16707927
     16392068, 14197853, 16712618, 17273253, 16902138, 16524071, 16856570
     16465149, 16705020, 16689109, 16372203, 16864864, 16849982, 16946613
     16837842, 16964279, 16459685, 16978185, 16845022, 16195633, 14536110
     16964686, 16787973, 16850996, 16674842, 16838328, 16178562, 15996344
     16503473, 16842274, 16935643, 17000176, 14355775, 16362358, 16994576
     16485876, 16919176, 16928832, 16864359, 16617325, 16921340, 16679874
     16788832, 16483559, 16733884, 16784167, 16286774, 15986012, 16660558
     16674666, 16191248, 16697600, 16993424, 16946990, 16589507, 16173738
     16784143, 16772060, 16991789, 17346196, 16495802, 16859937, 16590848
     16910001, 16603924, 16427054, 16730813, 16227068, 16663303, 16784901
     16836849, 16186165, 16457621, 16007562, 16170787, 16663465, 16524968
     16543323, 17027533, 16675710, 17005047, 16795944, 16668226, 16070351
     16212405, 16523150, 16698577, 16621274, 16930325, 17330580, 16443657

Patch level status of Cluster nodes :

 Patching Level                  Nodes
 --------------                  -----
 1650217826                      node0,node1,node2,node3

--------------------------------------------------------------------------------

OPatch succeeded.

3.8 And on database home

[oracle@node0 ~]$ . oraenv
ORACLE_SID = [+ASM1] ? CDB1
The Oracle base has been set to /opt/oracle/app
[oracle@node0 ~]$ opatch lsinventory
Oracle Interim Patch Installer version 12.1.0.1.2
Copyright (c) 2013, Oracle Corporation.  All rights reserved.

Oracle Home       : /opt/oracle/app/12.1.0.1/dbhome_1
Central Inventory : /opt/oracle/oraInventory
   from           : /opt/oracle/app/12.1.0.1/dbhome_1/oraInst.loc
OPatch version    : 12.1.0.1.2
OUI version       : 12.1.0.1.0
Log file location : /opt/oracle/app/12.1.0.1/dbhome_1/cfgtoollogs/opatch/opatch2013-11-24_22-58-04PM_1.log

Lsinventory Output file location : /opt/oracle/app/12.1.0.1/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2013-11-24_22-58-04PM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1):

Oracle Database 12c                                                  12.1.0.1.0
There are 1 products installed in this Oracle Home.

Interim patches (2) :

Patch  17077442     : applied on Sun Nov 24 22:46:01 CET 2013
Unique Patch ID:  16881794
Patch description:  "Oracle Clusterware Patch Set Update 12.1.0.1.1"
   Created on 12 Oct 2013, 06:33:53 hrs US/Central
   Bugs fixed:
     16505840, 16505255, 16390989, 16399322, 16505617, 16505717, 17486244
     16168869, 16444109, 16505361, 13866165, 16505763, 16208257, 16904822
     17299876, 16246222, 16505214, 16505540, 15936039, 16580269, 16838292
     16505449, 16801843, 16309853, 16505395, 17507349, 17475155, 16493242
     17039197, 16196609, 17463260, 16505667, 15970176, 16488665, 16670327

Patch  17027533     : applied on Sun Nov 24 22:45:55 CET 2013
Unique Patch ID:  16677152
Patch description:  "Database Patch Set Update : 12.1.0.1.1 (17027533)"
   Created on 27 Sep 2013, 05:30:33 hrs PST8PDT
   Bugs fixed:
     17034172, 16694728, 16448848, 16863422, 16634384, 16465158, 16320173
     16313881, 16910734, 16816103, 16911800, 16715647, 16825779, 16707927
     16392068, 14197853, 16712618, 17273253, 16902138, 16524071, 16856570
     16465149, 16705020, 16689109, 16372203, 16864864, 16849982, 16946613
     16837842, 16964279, 16459685, 16978185, 16845022, 16195633, 14536110
     16964686, 16787973, 16850996, 16674842, 16838328, 16178562, 15996344
     16503473, 16842274, 16935643, 17000176, 14355775, 16362358, 16994576
     16485876, 16919176, 16928832, 16864359, 16617325, 16921340, 16679874
     16788832, 16483559, 16733884, 16784167, 16286774, 15986012, 16660558
     16674666, 16191248, 16697600, 16993424, 16946990, 16589507, 16173738
     16784143, 16772060, 16991789, 17346196, 16495802, 16859937, 16590848
     16910001, 16603924, 16427054, 16730813, 16227068, 16663303, 16784901
     16836849, 16186165, 16457621, 16007562, 16170787, 16663465, 16524968
     16543323, 17027533, 16675710, 17005047, 16795944, 16668226, 16070351
     16212405, 16523150, 16698577, 16621274, 16930325, 17330580, 16443657

Rac system comprising of multiple nodes
  Local node = node0
  Remote node = node1
  Remote node = node2
  Remote node = node3

--------------------------------------------------------------------------------

OPatch succeeded.
[oracle@node0 ~]$

All done

Oracle Security Patch October 2013 has been released


On 15. October 2013 Oracle released the quarterly Security Patch for October 2013.

How to patch, see here.

At same time the following PSUs for Database and Clusterware/Grid Infrastructure has been released:

Unix/Linux Systems:

  • 12.1.0.1.0 PSU 1 (12.1.0.1.1)  (DB: 17027533, GI: 17272829)
    actual available for:
    • Linux x86-64
    • Solaris x86-64
    • Solaris SPARC (64Bit)
  • 11.2.0.3.0 PSU 8 (11.2.0.3.8)  (DB:  16902043, GI: 17272731)
  • 11.2.0.2.0 PSU 12 (11.2.0.2.12)  (DB:  17082367, GI: 17272753)
  • 11.1.0.7.0 PSU 16 (11.1.0.7.16) (DB:  17082366, CRS: 11724953)

Windows Systems:

For 10g Customers:

The PSU July 2013 was the final PSU for Oracle 10gR2 Database (10.2.0.4.0 & 10.2.0.5.0). So the final version is:

Unix/Linux

  • 10.2.0.5.0 PSU 12
  • 10.2.0.4.0 PSU 17

Windows

  • 10.2.0.5 BP 23 (32 Bit)
  • 10.2.0.5 BP 22 (64 Bit) (Maybe there will be a BP 23, Documentation is inconsistent)
  • 10.2.0.4 BP 50 (32 Bit)
  • 10.2.0.4 BP 49 (64 Bit) (Maybe there will be a BP 50, Documentation is inconsistent)

Common Vulnerabilities and Exposures (CVE) fixed in these patches:

  • CVE-2011-3389
  • CVE-2013-0169
  • CVE-2013-3762
  • CVE-2013-5766
  • CVE-2013-5827
  • CVE-2013-5828

Limitations:

  • Patch Set Update (PSU) patches are cumulative.
  • This patch is Oracle RAC Rolling Installable.
  • This patch is Data Guard Standby-First Installable.

IMPORTANT:
This patch contains a security fix due to which a SELECT query’s plan MAY change under the following conditions:

  • The SELECT queries a table protected with a Fined Grained Auditing policy
  • And the policy condition is NULL

Refer to My Support notice for more information:

  • Bug 17027533 – 12.1.0.1.1 (Oct 2013) Database Patch Set Update (PSU) [ID 17027533.8]
  • Oracle Database Patch Set Update 12.1.0.1.1 Known Issues (Doc ID 1571651.1)
  • Bug 16902043 – 11.2.0.3.8 (Oct 2013) Database Patch Set Update (PSU) [ID 16902043.8]
  • Oracle Database Patch Set Update 11.2.0.3.8 Known Issues (Doc ID 1571650.1)
  • Patch Set Update and Critical Patch Update October 2013 Availability Document (Doc ID 1571391.1)

The new release, new Bugs here the list of the Multitenant Bugs, which has been fixed:

16427054 - SR12.1.0.2PX_HYBRID_LOAD - TRC - KPDBIDTONAME
16443657 - CDB: OCITRANSCOMMIT() IS ABLE TO COMMIT FROM WRONG CONTAINER
16457621 - W2K8_12.1_CDB: ORA-600 [KKAEGEN_GET_EDITION_NAME_3] TERMINATE INSTANCE
16459685 - CDB (NON RAC) : ORA-44310 AND ORA-07445:[KSPGIP()+106] [SIGSEGV]
16483559 - CDB:COMMON USER NOT SYNCED ON PDB OPEN WITH FORCE OPTION
16485876 - FIRE LOGON TRIGGER DOING DDL IN OTHER CONTAINER GIVES ORA-600 [KTSSCNI1],
16603924 - XSTRM CDB W/ UPG'D PDBS, CREATE_OUTBOUND => ORA-600 [KKAEGEN_GET_EDITION_NAME_1]
16660558 - CDB: ORA-7445 [KSFD_IO] & [KSLWS_DMP_SESS_WAITSTACK] IN CREATE PDB UNDO CALLBACK
16663303 - SR12.1UPD-PLUGIN:DBMS_EDITIONS_UTILITIES FAILS WITH ORA-38817: INSUFFICIENT PRIV
16663465 - SR12.1UPD-PLUGIN -TRC -ORA-600KKDLGETBASEUSER2:AUTHIDTYPE/ORA-04024 SELF-DEADLOC
16675710 - CDB: ORA-7445 [KSUSDIINPROGRESS()+47] [SIGSEGV] [ADDR:0X18] [PC:0XB35190F]
16689109 - INVALID OBJECTS OCCUR WHEN UPGRADING IN A CDB
16697600 - CDB: "ALTER PDB ALL OPEN INSTANCES = ALL" ERRORS IF ALL OPEN ALREADY
16698577 - FA + REDACT: ORA-10387 AND ORA-600 [KGLRELEASEHANDLEREFERENCE1]
16705020 - LNX64-12.1-CDB: HIT ORA-7445 [KSP_PDB_SPFILE_INSERT] WHEN CREATING PDB
16707927 - PKT : ORA-600 [2130] - TRC - KCCUGG
16712618 - CDB:ORPHANED USER CAN BE UNLOCKED
16715647 - CDB-ADG:RESTRICTED OPEN FORCE FOR MULTIPLE PDBS DOES NOT WORK
16730813 - CDB:ORA-65144 WHEN DISABLING RESTRICTED SESSION IN ROOT
16772060 - TT12.1SQLFUZZ2: DBMS_PDB.SYNC_PDB THROWS ORA-600 [KGHSTACK_UNDERFLOW_INTERNAL_1]
16784167 - CDB(NON-RAC):ORA-00600: INTERNAL ERROR CODE, ARGUMENTS: [2801], [], [], [], [],
16784901 - TT12.1SQLFUZZ2: DESC ON RECREATED SUPPLIED OBJ THROWS ORA-7445 [KQLPRFD()+121]
16795944 - TT12.1SQLFUZZ2: PDB OPEN CRASHES AFTER LICENSE_MAX_USERS SET TO LESS THAN CURREN
16825779 - COMMON PROFILE RESOURCE LIMIT FOR PASSWORD VERIFY FUNCTION DISPLAYS FROM ROOT
16836849 - PHSB: CDB ORA-00600:[KTCALLOCXCB] DURING DB OPEN
16859937 - CDB: LOCAL USER CONVERTED TO COMMON
16902138 - RAC: ORA-7445 [RPIDRV] AFTER DROPPING A PDB
16921340 - CDB EXIT: NON-CDB TO PDB PLUGIN HANGS
16935643 - GOT ORA-600 [KQLUDP2] , [0X16EB753A8], [4] WHILE UPGRADING A PDB
16946613 - TT12.1SQLFUZZ2: CMN USER WHICH WAS LOCAL PRIOR TO SYNC NOT SYNCED ON PDB OPEN
16946990 - UNABLE TO INSTALL APEX IN LOCAL PDB 12C DATABASE.RAISES ORA-65050
16993424 - CDB: ORA-600 [KKAEGEN_GET_EDITION_NAME_3], [3]
16994576 - CDB(NON-RAC): ORA-600 [KQLBBOTADD:3]
17000176 - HANG INSIDE CATCDB_INT.SQL CALLED USING CATCON.PL
16911800 - Fix for bug 16911800
16919176 - Fix for bug 16919176

Database 12c: Create Container Database


To create a CDB there are two methods to do so:

  1. Create CDB with DBCA
  2. Create CDB manually

1. Create CDB with DBCA

To create a CDB with DBCA , there is nothing special to do. If you install in Basic Mode, you are able to configure CDB on the start site:

createcdb1

If you are installing in Advanced Mode you are able on the second site:

createcdb2

2. Create CDB manually or with “CREATE DATABASE”

1. Setup init file with the according parameters. In my example I used the OFM creation method:

*.db_create_file_dest='/opt/oracle/app/oradata'
*.enable_pluggable_database=TRUE

2. Execute the “CREATE DATABASE” statement with the “ENABLE PLUGGABLE DATABASE”:

CREATE DATABASE db12ee2
USER SYS IDENTIFIED BY welcome1
USER SYSTEM IDENTIFIED BY welcome1
EXTENT MANAGEMENT LOCAL
DEFAULT TABLESPACE users
DEFAULT TEMPORARY TABLESPACE temp
UNDO TABLESPACE undotbs1
ENABLE PLUGGABLE DATABASE
   SEED
   SYSTEM DATAFILES SIZE 125M AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED
   SYSAUX DATAFILES SIZE 100M;

3. Execute catcdb.sql

@?/rdbms/admin/catcdb.sql

This step is a problem right now, because the required file catcdb.sql is not shipped with the installation. The problem is already in progress:
Bug 17033183 – $OH/rdbms/admin/catcdb.sql is missing from 12c release (Doc ID 17033183.8)