Roberto Valsania asked this question once he read my blog post about whether you have to execute
datapatch
after creating a new 12c database: Do you have to execute catbundle.sql
when you create a new 11g database?
I’d bet you all are aware that Oracle Database 11.2.0.4 will go out of Waived Extended Support by end of 2018. But that doesn’t answer the question. So I did a quick experiment and created a fresh 11.2.0.4 database to answer the question.
Do you have to execute catbundle.sql when you create a new 11g database?
First of all, let me clarify what catbundle.sql
does – just in case you’ve never applied any bundle patches to your Oracle environment. catbundle.sql
is the script which adds the necessary SQL changes to a database after you applied a patch bundle. It has to be executed after you applied a patch bundle as there may be for instance changes to a PL/SQL package or function. And with catbundle.sql you make these necessary changes to your database(s).
Now with Oracle 12c we had to change the mechanism thanks to Oracle Multitenant. As the PDB$SEED is read-only and you may have many PDBs having a SQL script wasn’t the best option. Therefore datapatch.pl
came into play. Simple rule: Oracle 11g – use catbundle.sql
. Oracle 12c/18c/19c use datapatch
.
Quick Experiment
I create a CUSTOM database with my 11.2.0.4 environment. It has the most recent April 2018 PSU installed already.
Then I connect to my new database HANS
and check with check_patches.sql (one query will fail with 11g) if any patches are known to the database already:
export ORACLE_SID=HANS sqlplus / as sysdba SELECT TO_CHAR(action_time, 'DD-MON-YYYY HH24:MI:SS') AS action_time, action, namespace, version, id, comments, bundle_series FROM sys.registry$history ORDER by action_time; ACTION_TIME ACTION NAMESPACE VERSION ID COMMENTS BUNDLE_SER -------------------- ---------- -------------------- ---------- ---------- ------------------------------ ---------- 25-APR-2018 13:28:48 APPLY SERVER 11.2.0.4 180417 PSU 11.2.0.4.180417 PSU
Question answered:
As long as you create a CUSTOM database in Oracle 11g with DBCA, it will execute catbundle.sql
by itself.
You don’t have to run it. But you won’t harm the database if you run it again.
Are you looking for information on DBCA and Oracle 12c/18c/19c instead?
–Mike
On an 11g (11.1.0.7.24) patched ORACLE_HOME,when I create a new database by script (thus without DBCA) ,is it MANDATORY to apply the command “catbundle psu apply” or any commands from the PSU’s ‘post-install instructions’ for my database to be up-to-date?
(Thanks for this excellent blog.)
Hi Vincent,
yes, you’ll have to execute it. And even if it had been run somewhere already, it won’t harm.
DBCA executes it – but when you use your own scripts, you’ll have to take care.
Cheers,
Mike
The latest 11.2.0.4.200114 PSU is documented that it can be applied to the clusterware and database homes in a rolling fashion. The applications are therefore still connecting and processing on available instances as the patch is being rolled through all instances. Are there any potential issues executing catbundle.sql on the last patched instance while application users are still connected and processing transactions on the database?
Hi Carlos,
I don’t think that there is an issue. Otherwise it would be marked and required as STARTUP UPGRADE to prevent users from accessing the database.
Cheers,
Mike