Wednesday, December 4, 2013

Database 12c: Initialization parameter THREADED_EXECUTION

THREADED_EXECUTION

Property Description
Parameter type Boolean
Default value false
Modifiable No
Range of values true | false
Basic No
Oracle RAC If specified, all instances must use the same value

THREADED_EXECUTION specifies whether to enable the multithreaded Oracle model. Starting in Oracle Database 12c, the multithreaded Oracle model enables Oracle processes on UNIX and Linux to run as operating system threads in separate address spaces.

By default, some background processes on UNIX and Linux always use threaded execution; the remaining Oracle processes run as operating system processes. Thus, an "Oracle process" is not always equivalent to an "operating system process."

Note:

When this initialization parameter is set to TRUE, which enables the multithreaded Oracle model, operating system authentication is not supported. Attempts to connect to the database using operating system authentication (for example,CONNECT / AS SYSDBA or CONNECT / ) when this initialization parameter is set to TRUE receive an ORA-01031 "insufficient privileges" error.

The solution to this error is to always use the password when connecting to the database.

Also, when this initialization parameter is set to TRUE, the DEDICATED_THROUGH_BROKER_listener-name=ON parameter should be added to the listener.ora file, where listener-name is the name of the database listener. This enables the server to spawn threads when connections to the database are requested through the listener.

 

Scenario1: Threaded_execution=false

[oracle@gc12c ~]$ ps -T -fu oracle

UID        PID  SPID  PPID  C STIME TTY          TIME CMD
oracle    2303  2303     1  0 19:16 ?        00:00:00 ora_pmon_cdborcl
oracle    2305  2305     1  0 19:16 ?        00:00:00 ora_psp0_cdborcl
oracle    2307  2307     1  1 19:16 ?        00:00:03 ora_vktm_cdborcl
oracle    2311  2311     1  0 19:16 ?        00:00:00 ora_gen0_cdborcl
oracle    2313  2313     1  0 19:16 ?        00:00:00 ora_mman_cdborcl
oracle    2317  2317     1  0 19:16 ?        00:00:00 ora_diag_cdborcl
oracle    2319  2319     1  0 19:16 ?        00:00:00 ora_dbrm_cdborcl
oracle    2321  2321     1  0 19:16 ?        00:00:00 ora_dia0_cdborcl
oracle    2323  2323     1  0 19:16 ?        00:00:00 ora_dbw0_cdborcl
oracle    2325  2325     1  0 19:16 ?        00:00:00 ora_lgwr_cdborcl
oracle    2327  2327     1  0 19:16 ?        00:00:00 ora_ckpt_cdborcl
oracle    2329  2329     1  0 19:16 ?        00:00:00 ora_smon_cdborcl
oracle    2331  2331     1  0 19:16 ?        00:00:00 ora_reco_cdborcl
oracle    2333  2333     1  0 19:16 ?        00:00:00 ora_lreg_cdborcl
oracle    2335  2335     1  0 19:16 ?        00:00:00 ora_mmon_cdborcl
oracle    2337  2337     1  0 19:16 ?        00:00:00 ora_mmnl_cdborcl
oracle    2339  2339     1  0 19:16 ?        00:00:00 ora_d000_cdborcl
oracle    2341  2341     1  0 19:16 ?        00:00:00 ora_s000_cdborcl
oracle    2343  2343     1  0 19:16 ?        00:00:00 ora_s001_cdborcl
oracle    2355  2355     1  0 19:16 ?        00:00:00 ora_tmon_cdborcl
oracle    2357  2357     1  0 19:16 ?        00:00:00 ora_arc0_cdborcl
oracle    2359  2359     1  0 19:16 ?        00:00:00 ora_arc1_cdborcl
oracle    2361  2361     1  0 19:16 ?        00:00:00 ora_arc2_cdborcl
oracle    2363  2363     1  0 19:16 ?        00:00:00 ora_arc3_cdborcl
oracle    2365  2365     1  0 19:16 ?        00:00:00 ora_tt00_cdborcl
oracle    2367  2367     1  0 19:16 ?        00:00:00 ora_smco_cdborcl
oracle    2369  2369     1  0 19:16 ?        00:00:00 ora_aqpc_cdborcl
oracle    2371  2371     1  0 19:16 ?        00:00:00 ora_w000_cdborcl
oracle    2375  2375     1  0 19:16 ?        00:00:02 ora_p000_cdborcl
oracle    2377  2377     1  1 19:16 ?        00:00:02 ora_p001_cdborcl
oracle    2379  2379     1  0 19:16 ?        00:00:00 ora_p002_cdborcl
oracle    2381  2381     1  0 19:16 ?        00:00:00 ora_p003_cdborcl
oracle    2409  2409     1  0 19:16 ?        00:00:00 ora_qm02_cdborcl
oracle    2413  2413     1  0 19:16 ?        00:00:00 ora_q002_cdborcl
oracle    2415  2415     1  0 19:16 ?        00:00:00 ora_q003_cdborcl
oracle    2419  2419     1  0 19:16 ?        00:00:00 ora_cjq0_cdborcl
oracle    2425  2425     1  0 19:16 ?        00:00:00 ora_p004_cdborcl
oracle    2427  2427     1  0 19:16 ?        00:00:00 ora_p005_cdborcl
oracle    2433  2433     1  0 19:16 ?        00:00:00 ora_p006_cdborcl
oracle    2437  2437     1  0 19:16 ?        00:00:00 ora_p007_cdborcl
oracle    2441  2441     1  0 19:16 ?        00:00:00 ora_p008_cdborcl
oracle    2445  2445     1  0 19:16 ?        00:00:00 ora_p009_cdborcl
oracle    2503  2503     1  0 19:20 ?        00:00:00 ora_j000_cdborcl
oracle    2505  2505     1  0 19:20 ?        00:00:00 ora_j001_cdborcl
-- Total 44 processes

Scenario2: Threaded_execution=true

SQL> alter system set threaded_execution=true scope=spfile;

System altered.

SQL> shutdown abort
ORACLE instance shut down.
SQL> conn sys/password as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.

[oracle@gc12c ~]$ ps -fu oracle
UID        PID  PPID  C STIME TTY          TIME CMD
oracle    2797     1  0 19:59 ?        00:00:00 ora_pmon_cdborcl
oracle    2799     1  0 19:59 ?        00:00:00 ora_psp0_cdborcl
oracle    2801     1  1 19:59 ?        00:00:01 ora_vktm_cdborcl
oracle    2805     1  0 19:59 ?        00:00:00 ora_u004_cdborcl
oracle    2811     1  5 19:59 ?        00:00:09 ora_u005_cdborcl
oracle    2817     1  0 19:59 ?        00:00:00 ora_dbw0_cdborcl

[oracle@gc12c ~]$ ps -T -fu oracle
UID        PID  SPID  PPID  C STIME TTY          TIME CMD
oracle    2797  2797     1  0 19:59 ?        00:00:00 ora_pmon_cdborcl
oracle    2799  2799     1  0 19:59 ?        00:00:00 ora_psp0_cdborcl
oracle    2801  2801     1  1 19:59 ?        00:00:00 ora_vktm_cdborcl
oracle    2805  2805     1  0 19:59 ?        00:00:00 ora_u004_cdborc
oracle    2805  2806     1  0 19:59 ?        00:00:00 ora_u004_cdborc
oracle    2805  2807     1  0 19:59 ?        00:00:00 ora_u004_cdborc
oracle    2805  2808     1  0 19:59 ?        00:00:00 ora_u004_cdborc
oracle    2805  2814     1  0 19:59 ?        00:00:00 ora_u004_cdborc
oracle    2805  2818     1  0 19:59 ?        00:00:00 ora_u004_cdborc
oracle    2805  2819     1  0 19:59 ?        00:00:00 ora_u004_cdborc
oracle    2805  2820     1  0 19:59 ?        00:00:00 ora_u004_cdborc
oracle    2805  2822     1  0 19:59 ?        00:00:00 ora_u004_cdborc
oracle    2811  2811     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2812     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2813     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2815     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2821     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2823     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2824     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2825     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2826     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2827     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2828     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2835     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2836     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2837     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2838     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2839     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2840     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2841     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2842     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2844     1  5 19:59 ?        00:00:01 ora_u005_cdborc
oracle    2811  2845     1  6 19:59 ?        00:00:02 ora_u005_cdborc
oracle    2811  2846     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2847     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2861     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2862     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2867     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2868     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2869     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2871     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2811  2872     1  0 19:59 ?        00:00:00 ora_u005_cdborc
oracle    2817  2817     1  0 19:59 ?        00:00:00 ora_dbw0_cdborc
oracle    2875  2875  2137  0 19:59 pts/0    00:00:00 ps -T -fu oracl

SQL> conn system/password@cdborcl
Connected.
SQL> select s.program,s.process,p.spid,p.stid,p.sosid from v$session s, v$process p where s.paddr=p.addr;

PROGRAM                                      PROCESS    SPID       STID       SOSID
-------------------------------------------- ---------- ---------- ---------- ----------
oracle@gc12c.dbaglobe.com (PMON)             2797       2797       2797       2797
oracle@gc12c.dbaglobe.com (PSP0)             2799       2799       2799       2799
oracle@gc12c.dbaglobe.com (VKTM)             2801       2801       2801       2801
oracle@gc12c.dbaglobe.com (GEN0)             2805_2807  2805       2807       2805_2807
oracle@gc12c.dbaglobe.com (SCMN)             2805_2805  2805       2805       2805_2805
oracle@gc12c.dbaglobe.com (MMAN)             2805_2808  2805       2808       2805_2808
oracle@gc12c.dbaglobe.com (TMON)             2811_2835  2811       2835       2811_2835
oracle@gc12c.dbaglobe.com (DIAG)             2811_2813  2811       2813       2811_2813
oracle@gc12c.dbaglobe.com (SCMN)             2811_2811  2811       2811       2811_2811
oracle@gc12c.dbaglobe.com (DBRM)             2805_2814  2805       2814       2805_2814
oracle@gc12c.dbaglobe.com (DIA0)             2811_2815  2811       2815       2811_2815
oracle@gc12c.dbaglobe.com (DBW0)             2817       2817       2817       2817
oracle@gc12c.dbaglobe.com (LGWR)             2805_2818  2805       2818       2805_2818
oracle@gc12c.dbaglobe.com (CKPT)             2805_2819  2805       2819       2805_2819
oracle@gc12c.dbaglobe.com (SMON)             2805_2820  2805       2820       2805_2820
oracle@gc12c.dbaglobe.com (RECO)             2811_2821  2811       2821       2811_2821
oracle@gc12c.dbaglobe.com (LREG)             2805_2822  2805       2822       2805_2822
oracle@gc12c.dbaglobe.com (MMON)             2811_2823  2811       2823       2811_2823
oracle@gc12c.dbaglobe.com (MMNL)             2811_2824  2811       2824       2811_2824
sqlplus@gc12c.dbaglobe.com (TNS V1-V3)       2911       2980       2980       2980
oracle@gc12c.dbaglobe.com (ARC0)             2811_2836  2811       2836       2811_2836
oracle@gc12c.dbaglobe.com (ARC1)             2811_2837  2811       2837       2811_2837
oracle@gc12c.dbaglobe.com (ARC2)             2811_2838  2811       2838       2811_2838
oracle@gc12c.dbaglobe.com (ARC3)             2811_2839  2811       2839       2811_2839
oracle@gc12c.dbaglobe.com (TT00)             2811_2840  2811       2840       2811_2840
oracle@gc12c.dbaglobe.com (SMCO)             2811_2841  2811       2841       2811_2841
oracle@gc12c.dbaglobe.com (AQPC)             2811_2842  2811       2842       2811_2842
oracle@gc12c.dbaglobe.com (CJQ0)             2811_2861  2811       2861       2811_2861
oracle@gc12c.dbaglobe.com (W000)             2811_2862  2811       2862       2811_2862
oracle@gc12c.dbaglobe.com (QM02)             2811_2869  2811       2869       2811_2869
oracle@gc12c.dbaglobe.com (W001)             2811_2939  2811       2939       2811_2939
oracle@gc12c.dbaglobe.com (Q002)             2811_2871  2811       2871       2811_2871
oracle@gc12c.dbaglobe.com (Q003)             2811_2872  2811       2872       2811_2872
oracle@gc12c.dbaglobe.com (W002)             2811_2970  2811       2970       2811_2970

34 rows selected.

Database Alert Log:
NOTE: remote asm mode is local (mode 0x1; from cluster type)
Starting background process PMON
Starting background process PSP0
PMON started with pid=2, OS id=2797
Starting background process VKTM
PSP0 started with pid=3, OS id=2799
2013-12-04 19:59:05.539000 +08:00
VKTM started with pid=4, OS id=2801 at elevated priority
VKTM running at (1)millisec precision with DBRM quantum (100)ms
Starting background process GEN0
Starting background process MMAN
GEN0 started with pid=5, OS id=2805_2807
MMAN started with pid=7, OS id=2805_2808
Starting background process DIAG
Starting background process DBRM
DIAG started with pid=9, OS id=2811_2813
Starting background process DIA0
DBRM started with pid=11, OS id=2805_2814
Starting background process DBW0
DIA0 started with pid=12, OS id=2811_2815
Starting background process LGWR
DBW0 started with pid=13, OS id=2817
Starting background process CKPT
LGWR started with pid=14, OS id=2805_2818
Starting background process SMON
CKPT started with pid=15, OS id=2805_2819
Starting background process RECO
SMON started with pid=16, OS id=2805_2820
Starting background process LREG
RECO started with pid=17, OS id=2811_2821
Starting background process MMON
LREG started with pid=18, OS id=2805_2822
Starting background process MMNL
MMON started with pid=19, OS id=2811_2823
starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
MMNL started with pid=20, OS id=2811_2824
starting up 2 shared server(s) ...
2013-12-04 19:59:06.774000 +08:00
ORACLE_BASE from environment = /u01/app/oracle
ALTER DATABASE   MOUNT
2013-12-04 19:59:08.715000 +08:00
Using default pga_aggregate_limit of 2048 MB
2013-12-04 19:59:10.837000 +08:00
Successful mount of redo thread 1, with mount id 2818372491
Database mounted in Exclusive Mode
Lost write protection disabled
Ping without log force is disabled.
Completed: ALTER DATABASE   MOUNT
2013-12-04 19:59:19.026000 +08:00
alter database open
Starting background process TMON
LGWR: STARTING ARCH PROCESSES
Starting background process ARC0
TMON started with pid=8, OS id=2811_2835
ARC0 started with pid=26, OS id=2811_2836
2013-12-04 19:59:20.045000 +08:00
ARC0: Archival started
LGWR: STARTING ARCH PROCESSES COMPLETE
ARC0: STARTING ARCH PROCESSES
Starting background process ARC1
Starting background process ARC2
ARC1 started with pid=27, OS id=2811_2837
Starting background process ARC3
ARC2 started with pid=28, OS id=2811_2838
ARC1: Archival started
ARC2: Archival started
ARC1: Becoming the 'no FAL' ARCH
ARC1: Becoming the 'no SRL' ARCH
ARC2: Becoming the heartbeat ARCH
ARC3 started with pid=29, OS id=2811_2839
Thread 1 opened at log sequence 13
  Current log# 1 seq# 13 mem# 0: /u01/app/oracle/oradata/cdborcl/redo01.log
Successful open of redo thread 1
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
SMON: enabling cache recovery
[2811_2834] Successfully onlined Undo Tablespace 2.
Undo initialization finished serial:0 start:1913054 end:1913114 diff:60 ms (0.1 seconds)
Verifying file header compatibility for 11g tablespace encryption..
Verifying 11g file header compatibility for tablespace encryption completed
SMON: enabling tx recovery
Starting background process SMCO
Database Characterset is WE8MSWIN1252
SMCO started with pid=31, OS id=2811_2841
No Resource Manager plan active
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process AQPC
AQPC started with pid=32, OS id=2811_2842
2013-12-04 19:59:21.245000 +08:00
ARC3: Archival started
ARC0: STARTING ARCH PROCESSES COMPLETE
Opening pdb PDB$SEED (2) with no Resource Manager plan active
db_recovery_file_dest_size of 4800 MB is 0.00% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
2013-12-04 19:59:22.251000 +08:00
Starting background process CJQ0
CJQ0 started with pid=33, OS id=2811_2861
Completed: alter database open

 

Known Errors:

SQL> conn / as sysdba
ERROR:
ORA-01017: invalid username/password; logon denied


Warning: You are no longer connected to ORACLE.

 

Monday, December 2, 2013

Free ebook: Securing Oracle Database 12c: A Technical Primer

“Are you an Oracle DBA who wants to protect your databases? The new ebook, Securing Oracle Database 12c: A Technical Primer, will be the book that database administrators will want to turn to for their database security questions.

For a limited time, Oracle Press will be offering this book free of charge, so pre-register for your copy now.”

 

http://books.mcgraw-hill.com/ebookdownloads/Oracle12cSecurity/

Oracle Database 12c: Fix the EM DB Express issue for Linux-64 Multitenant Setup

Symptom:

1. Resources and SQL Monitor can not load in Enterprise Manager

2. Following errors flooding the database alert log:

2013-12-02 11:27:11.511000 +08:00
found dead shared server 'S000', pid = (20, 6)
Exception [type: SIGSEGV, Address not mapped to object] [ADDR:0x5] [PC:0xB71F161, qervwRowProcedure()+113] [flags: 0x0, count: 1]
Errors in file /u01/app/oracle/diag/rdbms/cdborcl/cdborcl/trace/cdborcl_s000_3664.trc (incident=9765):
ORA-07445: exception encountered: core dump [qervwRowProcedure()+113] [SIGSEGV] [ADDR:0x5] [PC:0xB71F161] [Address not mapped to object] []
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.



 



Solution:



1. Apply patch PSU Oct2013 for 12.1.0.1 (17027522) Refer to: http://www.dbaglobe.com/2013/12/oracle-database-12cinstalling-psu-in.html



2. Apply bug fix 16527374. Refer to http://www.dbaglobe.com/2013/12/oracle-database-12capply-online-patch.html 



image

Oracle Database 12c–Apply online patch

1. Make sure the patch can be apply online from patch readme file

Oracle Database 12c Release 12.1.0.1.1

ORACLE DATABASE Patch for Bug# 16527374 for Linux-x86-64 Platforms

This patch is RAC Rolling Installable - Please read My Oracle Support Document 244241.1 https://support.us.oracle.com/oip/faces/secure/km/DocumentDisplay.jspx?id=244241.1
Rolling Patch - OPatch Support for RAC.

This patch is Online Patchable - Please read My Oracle Support note 761111.1 on how to use/deploy an online patch


2. Pre-checking



[oracle@gc12c 16527374]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.1.0.1.0
Copyright (c) 2012, Oracle Corporation. All rights reserved.

PREREQ session

Oracle Home : /u01/app/oracle/product/12.1.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0/dbhome_1/oraInst.loc
OPatch version : 12.1.0.1.0
OUI version : 12.1.0.1.0
Log file location : /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/opatch2013-12-02_21-24-29PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.




3. Apply the patch in online mode



[oracle@gc12c 16527374]$ $ORACLE_HOME/OPatch/opatch apply online -connectString cdborcl:sys:password
Oracle Interim Patch Installer version 12.1.0.1.0
Copyright (c) 2012, Oracle Corporation. All rights reserved.


Oracle Home : /u01/app/oracle/product/12.1.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0/dbhome_1/oraInst.loc
OPatch version : 12.1.0.1.0
OUI version : 12.1.0.1.0
Log file location : /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/16527374_Dec_02_2013_21_25_05/apply2013-12-02_21-25-04PM_1.log


The patch should be applied/rolled back in '-all_nodes' mode only.
Converting the RAC mode to '-all_nodes' mode.
Applying interim patch '16527374' to OH '/u01/app/oracle/product/12.1.0/dbhome_1'
Verifying environment and performing prerequisite checks...
All checks passed.
Backing up files...

Patching component oracle.rdbms, 12.1.0.1.0...
Installing and enabling the online patch 'bug16527374.pch', on database 'cdborcl'.


Verifying the update...
Patch 16527374 successfully applied
Log file location: /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/16527374_Dec_02_2013_21_25_05/apply2013-12-02_21-25-04PM_1.log

OPatch succeeded.


4. Check the database alert log



2013-12-02 21:25:08.921000 +08:00
Patch file bug16527374.pch is out of sync with oracle binary; performing fixup
Patch file bug16527374.pch has been synced with oracle binary
Patch bug16527374.pch Installed - Update #1
Patch bug16527374.pch Enabled - Update #2
Online patch bug16527374.pch has been installed
Online patch bug16527374.pch has been enabled



5. Things to take note



Extra memory required for online patches:



Ensure that you maintain adequate memory on your system to apply this online patch. To calculate the amount of memory required for this online patch, use the following formula:
Memory Consumed = (Number of Oracle Processes + 1) X (Size of Patched .pch File)



[oracle@gc12c 16527374]$ ls -l online/files/hpatch/bug16527374.pch
-rw-r--r--. 1 oracle oinstall 222801 Oct 14 17:28 online/files/hpatch/bug16527374.pch

Oracle Database 12c–Query opatch status from SQL interface

1. How to query

SQL> set pages 999
SQL> set long 8000
SQL> set longc 2000

SQL> select xmltransform(DBMS_QOPATCH.GET_OPATCH_LSINVENTORY, DBMS_QOPATCH.GET_OPATCH_XSLT) from dual;

XMLTRANSFORM(DBMS_QOPATCH.GET_OPATCH_LSINVENTORY,DBMS_QOPATCH.GET_OPATCH_XSLT)
--------------------------------------------------------------------------------

Oracle Querayable Patch Interface 1.0
--------------------------------------------------------------------------------

Oracle Home : /u01/app/oracle/product/12.1.0/dbhome_1
Inventory : /u01/app/oraInventory
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 12c 12.1.0.1.0
Installed Products ( 131)

Oracle Database 12c 12.1.0.1.0
Sun JDK 1.6.0.37.0
oracle.swd.oui.core.min 12.1.0.1.0
Installer SDK Component 12.1.0.1.0
Oracle One-Off Patch Installer 12.1.0.1.0
Oracle Universal Installer 12.1.0.1.0
Oracle USM Deconfiguration 12.1.0.1.0
Oracle Configuration Manager Deconfiguration 10.3.1.0.0
Oracle RAC Deconfiguration 12.1.0.1.0
Oracle DBCA Deconfiguration 12.1.0.1.0
Oracle Database Plugin for Oracle Virtual Assembly Builder 12.1.0.1.0
Oracle Configuration Manager Client 10.3.2.1.0
Oracle Configuration Manager 10.3.7.0.3
Oracle ODBC Driverfor Instant Client 12.1.0.1.0
LDAP Required Support Files 12.1.0.1.0
Expat libraries 2.0.1.0.2
Oracle Bali Share 11.1.1.6.0
SSL Required Support Files for InstantClient 12.1.0.1.0
Oracle Net Required Support Files 12.1.0.1.0
Oracle R Enterprise Server Files 12.1.0.1.0
Oracle Real Application Testing 12.1.0.1.0
Oracle Label Security 12.1.0.1.0
Oracle Data Mining RDBMS Files 12.1.0.1.0
Oracle OLAP RDBMS Files 12.1.0.1.0
Oracle OLAP API 12.1.0.1.0
SQL*Plus Required Support Files 12.1.0.1.0
Oracle Database Vault option 12.1.0.1.0
XDK Required Support Files 12.1.0.1.0
Oracle Notification Service for Instant Client 12.1.0.1.0
Platform Required Support Files 12.1.0.1.0
Oracle RAC Required Support Files-HAS 12.1.0.1.0
Oracle JDBC Server Support Package 12.1.0.1.0
Oracle SQL Developer 12.1.0.1.0
Oracle Application Express 12.1.0.1.0
RDBMS Required Support Files Runtime 12.1.0.1.0
RDBMS Required Support Files for Instant Client 12.1.0.1.0
SQLJ Runtime 12.1.0.1.0
Database Workspace Manager 12.1.0.1.0
Precompiler Common Files for Core 12.1.0.1.0
Parser Generator Required Support Files 12.1.0.1.0
Oracle Globalization Support 12.1.0.1.0
Oracle Notification Service (eONS) 12.1.0.1.0
Oracle Text ATG Language Support Files 12.1.0.1.0
Oracle Text for Core 12.1.0.1.0
Oracle Text Required Support Files 12.1.0.1.0
Precompiler Required Support Files 12.1.0.1.0
Oracle Database 12c Multimedia Files 12.1.0.1.0
Oracle Multimedia Java Advanced Imaging 12.1.0.1.0
Oracle JDBC/OCI Instant Client 12.1.0.1.0
Oracle Multimedia Locator Java Required Support Files 12.1.0.1.0
Oracle Multimedia Locator RDBMS Files 12.1.0.1.0
Oracle Core Required Support Files for Core DB 12.1.0.1.0
Oracle Core Required Support Files 12.1.0.1.0
Sample Schema Data 12.1.0.1.0
Oracle Starter Database 12.1.0.1.0
Oracle Message Gateway Common Files 12.1.0.1.0
Oracle XML Query 12.1.0.1.0
Oracle Core XML Development Kit 12.1.0.1.0
XML Parser for Oracle JVM 12.1.0.1.0
Oracle JFC Extended Windowing Toolkit 11.1.1.6.0
Oracle Globalization Support For Core 12.1.0.1.0
Oracle Database Deconfiguration 12.1.0.1.0
Oracle Quality of Service Management (Client) 12.1.0.1.0
Oracle Locale Builder 12.1.0.1.0
JAccelerator (COMPANION) 12.1.0.1.0
Oracle Containers for Java 12.1.0.1.0
Oracle JVM For Core 12.1.0.1.0
Perl Modules 5.14.1.0.0
RDBMS Required Support Files 12.1.0.1.0
Secure Socket Layer 12.1.0.1.0
Oracle Universal Connection Pool 12.1.0.1.0
Oracle JDBC/THIN Interfaces 12.1.0.1.0
Oracle Multimedia Client Option 12.1.0.1.0
Oracle Java Client 12.1.0.1.0
Database Migration Assistant for Unicode 12.1.0.1.0
Perl Interpreter 5.14.1.0.0
PL/SQL Embedded Gateway 12.1.0.1.0
OLAP SQL Scripts 12.1.0.1.0
Database SQL Scripts 12.1.0.1.0
Oracle Globalization Support 12.1.0.1.0
Oracle Extended Windowing Toolkit 11.1.1.6.0
SQL*Plus Files for Instant Client 12.1.0.1.0
Required Support Files 12.1.0.1.0
Oracle ODBC Driver 12.1.0.1.0
Precompilers 12.1.0.1.0
Precompiler Common Files 12.1.0.1.0
Deinstallation Tool 12.1.0.1.0
Oracle Recovery Manager 12.1.0.1.0
Oracle Net Java Required Support Files 12.1.0.1.0
XML Parser for Java 12.1.0.1.0
Oracle Security Developer Tools 12.1.0.1.0
Oracle Wallet Manager 12.1.0.1.0
Cluster Verification Utility Common Files 12.1.0.1.0
Oracle Clusterware RDBMS Files 12.1.0.1.0
Oracle Ice Browser 11.1.1.6.0
Installation Plugin Files 12.1.0.1.0
Installation Common Files 12.1.0.1.0
Oracle LDAP administration 12.1.0.1.0
Buildtools Common Files 12.1.0.1.0
Oracle Java Layout Engine 11.0.0.0.0
Oracle Database User Interface 11.0.0.0.0
Oracle Help Share Library 11.1.1.6.0
Oracle Help for Java 11.1.1.6.0
HAS Common Files 12.1.0.1.0
PL/SQL 12.1.0.1.0
Assistant Common Files 12.1.0.1.0
Oracle Notification Service

SQL> select xmltransform(DBMS_QOPATCH.GET_OPATCH_BUGS, DBMS_QOPATCH.GET_OPATCH_XSLT) from dual;

XMLTRANSFORM(DBMS_QOPATCH.GET_OPATCH_BUGS,DBMS_QOPATCH.GET_OPATCH_XSLT)
--------------------------------------------------------------------------------

Bugs fixed:
17034172 16694728 16448848 16863422 16634384 16465158 16320173 1
6313881 16910734 16816103 16911800 16715647 16825779 16707927 16392068 1
4197853 16712618 17273253 16902138 16524071 16856570 16465149 16705020 1
6689109 16372203 16864864 16849982 16946613 16837842 16964279 16459685 1
6978185 16845022 16195633 14536110 16964686 16787973 16850996 16674842 1
6838328 16178562 15996344 16503473 16842274 16935643 17000176 14355775 1
6362358 16994576 16485876 16919176 16928832 16864359 16617325 16921340 1
6679874 16788832 16483559 16733884 16784167 16286774 15986012 16660558 1
6674666 16191248 16697600 16993424 16946990 16589507 16173738 16784143 1
6772060 16991789 17346196 16495802 16859937 16590848 16910001 16603924 1
6427054 16730813 16227068 16663303 16784901 16836849 16186165 16457621 1
6007562 16170787 16663465 16524968 16543323 17027533 16675710 17005047 1
6795944 16668226 16070351 16212405 16523150 16698577 16621274 16930325 1
7330580 16443657

SQL> select xmltransform(DBMS_QOPATCH.GET_OPATCH_LIST, DBMS_QOPATCH.GET_OPATCH_XSLT) from dual;

XMLTRANSFORM(DBMS_QOPATCH.GET_OPATCH_LIST,DBMS_QOPATCH.GET_OPATCH_XSLT)
--------------------------------------------------------------------------------

Patch Details:

Patch(sqlpatch) 17027533: applied on 2013-12-02T18:28:17+08:00
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 1
6313881 16910734 16816103 16911800 16715647 16825779 16707927 16392068 1
4197853 16712618 17273253 16902138 16524071 16856570 16465149 16705020 1
6689109 16372203 16864864 16849982 16946613 16837842 16964279 16459685 1
6978185 16845022 16195633 14536110 16964686 16787973 16850996 16674842 1
6838328 16178562 15996344 16503473 16842274 16935643 17000176 14355775 1
6362358 16994576 16485876 16919176 16928832 16864359 16617325 16921340 1
6679874 16788832 16483559 16733884 16784167 16286774 15986012 16660558 1
6674666 16191248 16697600 16993424 16946990 16589507 16173738 16784143 1
6772060 16991789 17346196 16495802 16859937 16590848 16910001 16603924 1
6427054 16730813 16227068 16663303 16784901 16836849 16186165 16457621 1
6007562 16170787 16663465 16524968 16543323 17027533 16675710 17005047 1
6795944 16668226 16070351 16212405 16523150 16698577 16621274 16930325 1
7330580 16443657
Files Touched:

/kcb.o
/kcbo.o
/kcl.o
/kjzd.o
/kjzn.o
/kjb.o
/kjbl.o
/kjbm.o
/kjbr.o
/kjcts.o
... <omitted> ..
libzt12.a
libnnzst12.a
libnnz12.so

 

SQL> set lin 120
SQL> select xmltransform(dbms_qopatch.GET_OPATCH_LIST,
2 '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3 <xsl:template match="patch">
4 <xsl:text>Patch Id= </xsl:text><xsl:value-of select="patchID"/>
5 <xsl:text> Description: </xsl:text> <xsl:value-of select="patchDescription"/>
6 </xsl:template>
7 </xsl:stylesheet>'
)
8 from dual
9 /

XMLTRANSFORM(DBMS_QOPATCH.GET_OPATCH_LIST,'<XSL:STYLESHEETVERSION="1.0"XMLNS:XSL="HTTP://WWW.W3.ORG/1999/XSL/TRANSFORM"X
------------------------------------------------------------------------------------------------------------------------
Patch Id= 17027533 Description: Database Patch Set Update : 12.1.0.1.1 (17027533)



2. What is behind the sense



SQL> select dbms_metadata.get_ddl('TABLE','OPATCH_XML_INV','SYS') from dual;

DBMS_METADATA.GET_DDL('TABLE','OPATCH_XML_INV','SYS')
--------------------------------------------------------------------------------

CREATE TABLE "SYS"."OPATCH_XML_INV"
( "XML_INVENTORY" CLOB
)
ORGANIZATION EXTERNAL
( TYPE ORACLE_LOADER
DEFAULT DIRECTORY "OPATCH_SCRIPT_DIR"
ACCESS PARAMETERS
( RECORDS DELIMITED BY NEWLINE
READSIZE 67108864
preprocessor opatch_script_dir:'qopiprep.bat'
BADFILE opatch_script_dir:'qopatch_bad.bad'
LOGFILE opatch_log_dir:'qopatch_log.log'
FIELDS TERMINATED BY 'UIJSVTBOEIZBEFFQBL'
MISSING FIELD VALUES ARE NULL
REJECT ROWS WITH ALL NULL FIELDS
(
xml_inventory CHAR(100000000)
)
)
LOCATION
( "OPATCH_SCRIPT_DIR":'qopiprep.bat'
)
)
REJECT LIMIT UNLIMITED


SQL> select directory_path from dba_directories where directory_name='OPATCH_SCRIPT_DIR';

DIRECTORY_PATH
--------------------------------------------------------------------------------
/u01/app/oracle/product/12.1.0/dbhome_1/QOpatch

SQL> ! ls -l /u01/app/oracle/product/12.1.0/dbhome_1/QOpatch/qopiprep.bat
-r-xr-xr--. 1 oracle oinstall 1353 Jan 26 2013 /u01/app/oracle/product/12.1.0/dbhome_1/QOpatch/qopiprep.bat

SQL> ! file /u01/app/oracle/product/12.1.0/dbhome_1/QOpatch/qopiprep.bat
/u01/app/oracle/product/12.1.0/dbhome_1/QOpatch/qopiprep.bat: POSIX shell script text executable

SQL> ! tail -n 6 /u01/app/oracle/product/12.1.0/dbhome_1/QOpatch/qopiprep.bat

$ORACLE_HOME/OPatch/opatch lsinventory -xml $ORACLE_HOME/QOpatch/xml_file.xml -retry 0 -invPtrLoc $ORACLE_HOME/oraInst.loc >> $ORACLE_HOME/QOpatch/stout.txt
`echo "UIJSVTBOEIZBEFFQBL" >> $ORACLE_HOME/QOpatch/xml_file.xml`
echo `cat $ORACLE_HOME/QOpatch/xml_file.xml`
rm $ORACLE_HOME/QOpatch/xml_file.xml
rm $ORACLE_HOME/QOpatch/stout.txt


3. Possible error



SQL> select xmltransform(dbms_qopatch.GET_OPATCH_LIST,
2 '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3 <xsl:template match="patch">
4 <xsl:text>Patch Id= </xsl:text><xsl:value-of select="patchID"/>
5 <xsl:text> Description: </xsl:text> <xsl:value-of select="patchDescription"/>
6 </xsl:template>
7 </xsl:stylesheet>'
)
8 from dual
9 /
ERROR:
ORA-20001: Latest xml inventory is not loaded into table
ORA-06512: at "SYS.DBMS_QOPATCH", line 1448
ORA-06512: at "SYS.DBMS_QOPATCH", line 152



When this error happens, just retry the SQL statement, Oracle will delete these XML files inside “$ORACLE_HOME/QOpatch/” automatically.

Oracle database 12c–Installing PSU in multitenant envrionment

1. Preparation work

[oracle@gc12c db]$ unzip p17027533_121010_Linux-x86-64.zip
[oracle@gc12c db]$ cd 17027533
[oracle@gc12c 17027533]$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 12.1.0.1.0

OPatch succeeded.

[oracle@gc12c 17027533]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.1.0.1.0
Copyright (c) 2012, Oracle Corporation. All rights reserved.

PREREQ session

Oracle Home : /u01/app/oracle/product/12.1.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0/dbhome_1/oraInst.loc
OPatch version : 12.1.0.1.0
OUI version : 12.1.0.1.0
Log file location : /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/opatch2013-12-02_18-05-50PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.




2. Shutdown database listener



[oracle@gc12c 17027533]$ lsnrctl stop
[oracle@gc12c 17027533]$ sqlplus / as sysdba <<EOD
> shutdown immediate
> EOD


[oracle@gc12c 17027533]$ ps -fu oracle


3. Apply binary patch



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


Oracle Home : /u01/app/oracle/product/12.1.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0/dbhome_1/oraInst.loc
OPatch version : 12.1.0.1.0
OUI version : 12.1.0.1.0
Log file location : /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/17027533_Dec_02_2013_18_25_52/apply2013-12-02_18-25-52PM_1.log

Applying interim patch '17027533' to OH '/u01/app/oracle/product/12.1.0/dbhome_1'
Verifying environment and performing prerequisite checks...
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/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: /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/17027533_Dec_02_2013_18_25_52/apply2013-12-02_18-25-52PM_1.log

OPatch succeeded.
[oracle@gc12c 17027533]$


[oracle@gc12c 17027533]$ $ORACLE_HOME/OPatch/opatch lsinventory
Oracle Interim Patch Installer version 12.1.0.1.0
Copyright (c) 2012, Oracle Corporation. All rights reserved.


Oracle Home : /u01/app/oracle/product/12.1.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0/dbhome_1/oraInst.loc
OPatch version : 12.1.0.1.0
OUI version : 12.1.0.1.0
Log file location : /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/opatch2013-12-02_18-33-02PM_1.log

Lsinventory Output file location : /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2013-12-02_18-33-02PM.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 Mon Dec 02 18:28:17 SGT 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.



4. Startup database and listener



[oracle@gc12c 17027533]$ lsnrctl start

LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 02-DEC-2013 18:37:07

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

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

TNSLSNR for Linux: Version 12.1.0.1.0 - Production
System parameter file is /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/gc12c/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=gc12c)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=gc12c)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date 02-DEC-2013 18:37:07
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/gc12c/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=gc12c)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
[oracle@gc12c 17027533]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Mon Dec 2 18:37:17 2013

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 1636814848 bytes
Fixed Size 2288968 bytes
Variable Size 1056965304 bytes
Database Buffers 570425344 bytes
Redo Buffers 7135232 bytes
Database mounted.
Database opened.
SQL> alter pluggable database all open;

Pluggable database altered.

SQL> exit



5. Post-patch: loading modified SQL Files into the database



[oracle@gc12c 17027533]$ cd $ORACLE_HOME/OPatch
[oracle@gc12c OPatch]$ ./datapatch -verbose
SQL Patching tool version 12.1.0.1.0 on Mon Dec 2 19:59:16 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 DEMO:
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: DEMO
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: /u01/app/oracle/product/12.1.0/dbhome_1/sqlpatch/17027533/17027533_apply_CDBORCL_CDBROOT_2013Dec02_19_59_22.log (no errors)
catbundle generate logfile: /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/catbundle/catbundle_PSU_CDBORCL_DEMO_GENERATE_2013Dec02_19_59_50.log (no errors)
catbundle apply logfile: /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/catbundle/catbundle_PSU_CDBORCL_DEMO_APPLY_2013Dec02_19_59_52.log (no errors)
Patch 17027533 apply (pdb PDB$SEED): SUCCESS
logfile: /u01/app/oracle/product/12.1.0/dbhome_1/sqlpatch/17027533/17027533_apply_CDBORCL_PDBSEED_2013Dec02_19_59_35.log (no errors)
catbundle generate logfile: /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/catbundle/catbundle_PSU_CDBORCL_DEMO_GENERATE_2013Dec02_19_59_50.log (no errors)
catbundle apply logfile: /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/catbundle/catbundle_PSU_CDBORCL_DEMO_APPLY_2013Dec02_19_59_52.log (no errors)
Patch 17027533 apply (pdb DEMO): SUCCESS
logfile: /u01/app/oracle/product/12.1.0/dbhome_1/sqlpatch/17027533/17027533_apply_CDBORCL_DEMO_2013Dec02_19_59_45.log (no errors)
catbundle generate logfile: /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/catbundle/catbundle_PSU_CDBORCL_DEMO_GENERATE_2013Dec02_19_59_50.log (no errors)
catbundle apply logfile: /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/catbundle/catbundle_PSU_CDBORCL_DEMO_APPLY_2013Dec02_19_59_52.log (no errors)
SQL Patching tool complete on Mon Dec 2 20:00:02 2013

How to fix “OPatch failed with error code 41”

 

Symptom:


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


Oracle Home : /u01/app/oracle/product/12.1.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0/dbhome_1/oraInst.loc
OPatch version : 12.1.0.1.0
OUI version : 12.1.0.1.0
Log file location : /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/17027533_Dec_02_2013_18_09_09/apply2013-12-02_18-09-09PM_1.log

Applying interim patch '17027533' to OH '/u01/app/oracle/product/12.1.0/dbhome_1'
Verifying environment and performing prerequisite checks...
Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:


Following executables are active :
/u01/app/oracle/product/12.1.0/dbhome_1/lib/libclntsh.so.12.1
Log file location: /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/17027533_Dec_02_2013_18_09_09/apply2013-12-02_18-09-09PM_1.log


Recommended actions: OPatch needs to modify files which are being used by some processes.

OPatch failed with error code 41




Fix: find out which process is currently use it, and kill it



[oracle@gc12c 17027533]$ fuser /u01/app/oracle/product/12.1.0/dbhome_1/lib/libclntsh.so.12.1
/u01/app/oracle/product/12.1.0/dbhome_1/lib/libclntsh.so.12.1: 4063m
[oracle@gc12c 17027533]$ ps up 4063
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
oracle 4063 0.0 0.2 81256 11400 pts/2 S+ 11:41 0:02 adrci
[oracle@gc12c 17027533]$ kill 4063
[oracle@gc12c 17027533]$ ps up 4063
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
[oracle@gc12c 17027533]$ fuser /u01/app/oracle/product/12.1.0/dbhome_1/lib/libclntsh.so.12.1