Instalando o Patch 13343438 – 11.2.0.3.1 Patch Set Update

Os Patches conhecidos como PSU (PatchSet Update) – são atualizações acumuladas de um PatchSet, e são altamenre recomendadas. Por exemplo, o que iremos aplicar irá atualizar nossa instalação de 11.2.0.3.0 para 11.2.0.3.1, e inclui o CPU (Ctrical Patch Update) de Janeiro/2012.

Descompacte o Patch. Ele é pequeno, apenas alguns MB.

[oracle@nerv06 ~]$ ls -lh
total 6.9M
-rw-r--r--. 1 oracle oinstall 6.9M Apr  1 14:05 p13343438_112030_Linux-x86-64.zip
[oracle@nerv06 ~]$ unzip -q p13343438_112030_Linux-x86-64.zip

Verifique os pré-requisitos, de acardo com o README. Neste Patch, é solicitada a verificação da versão o OPatch e se temos alguns utilitários do sistema operacional acessíveis.

[oracle@nerv06 ~]$ /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch lsinventory
Invoking OPatch 11.2.0.1.7

Oracle Interim Patch Installer version 11.2.0.1.7
Copyright (c) 2011, Oracle Corporation.  All rights reserved.

Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.2.0.1.7
OUI version       : 11.2.0.3.0
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2012-04-01_14-06-49PM.log

Lsinventory Output file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2012-04-01_14-06-49PM.txt

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

Oracle Database 11g                                                  11.2.0.3.0
There are 1 products installed in this Oracle Home.

There are no Interim patches installed in this Oracle Home.

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

OPatch succeeded.
[oracle@nerv06 ~]$ whereis make
make: /usr/bin/make /usr/share/man/man1/make.1.gz
[oracle@nerv06 ~]$ whereis ar
ar: /usr/bin/ar /usr/include/ar.h /usr/share/man/man1/ar.1.gz
[oracle@nerv06 ~]$ whereis ld
ld: /usr/bin/ld /usr/share/man/man1/ld.1.gz
[oracle@nerv06 ~]$ whereis nm
nm: /usr/bin/nm /usr/share/man/man1/nm.1.gz

Em seguida, deve-se parar tudo o que utilizar o ORACLE_HOME onde o Patch será aplicado: listener, instância, Enterprise Manager, e iSQLPlus, se houver.

[oracle@nerv06 ~]$ lsnrctl stop

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 01-APR-2012 14:07:37

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=nerv06.localdomain)(PORT=1521)))
The command completed successfully
[oracle@nerv06 ~]$ sqlplus / AS SYSDBA

SQL*Plus: Release 11.2.0.3.0 Production on Sun Apr 1 14:07:45 2012

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> SHUTDOWN IMMEDIATE;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> EXIT
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

E finalmente a aplicação do Patch, sempre de acordo com a instrução no README.

[oracle@nerv06 ~]$ cd 13343438/
[oracle@nerv06 13343438]$ ls -lh
total 60K
drwxr-xr-x. 4 oracle oinstall 4.0K Jan  3 08:50 etc
drwxr-xr-x. 6 oracle oinstall 4.0K Jan  3 08:50 files
-rwxr-xr-x. 1 oracle oinstall 2.9K Jan  3 08:50 patchmd.xml
-rw-rw-r--. 1 oracle oinstall  42K Jan 16 06:46 README.html
-rw-rw-r--. 1 oracle oinstall   21 Jan  3 08:50 README.txt
[oracle@nerv06 13343438]$ /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch apply
Invoking OPatch 11.2.0.1.7

Oracle Interim Patch Installer version 11.2.0.1.7
Copyright (c) 2011, Oracle Corporation.  All rights reserved.

Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.2.0.1.7
OUI version       : 11.2.0.3.0
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2012-04-01_14-09-14PM.log

Applying interim patch '13343438' to OH '/u01/app/oracle/product/11.2.0/db_1'
Verifying environment and performing prerequisite checks...

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/11.2.0/db_1')

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

Patching component oracle.rdbms.rsf, 11.2.0.3.0...

Patching component oracle.rdbms, 11.2.0.3.0...
Copying file to "/u01/app/oracle/product/11.2.0/db_1/psu/11.2.0.3.1/catpsu.sql"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/psu/11.2.0.3.1/catpsu_rollback.sql"

Patching component oracle.rdbms.dbscripts, 11.2.0.3.0...
Patch 13343438 successfully applied
Log file location: /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2012-04-01_14-09-14PM.log

OPatch succeeded.

Depois subimos a instância, para aplicar as alterações de banco de dados.

[oracle@nerv06 13343438]$ sqlplus / AS SYSDBA

SQL*Plus: Release 11.2.0.3.0 Production on Sun Apr 1 14:13:50 2012

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

Connected to an idle instance.

SQL> STARTUP
ORACLE instance started.

Total System Global Area 1068937216 bytes
Fixed Size                  2235208 bytes
Variable Size             616563896 bytes
Database Buffers          444596224 bytes
Redo Buffers                5541888 bytes
Database mounted.
Database opened.
SQL> @?/rdbms/admin/catbundle.sql psu apply

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

Generating apply and rollback scripts...
Check the following file for errors:
/u01/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_ORCL_GENERATE_2012Apr01_14_14_39.log
Apply script: /u01/app/oracle/product/11.2.0/db_1/rdbms/admin/catbundle_PSU_ORCL_APPLY.sql
Rollback script: /u01/app/oracle/product/11.2.0/db_1/rdbms/admin/catbundle_PSU_ORCL_ROLLBACK.sql

PL/SQL procedure successfully completed.

Executing script file...

SQL> COLUMN spool_file NEW_VALUE spool_file NOPRINT
SQL> SELECT '/u01/app/oracle/cfgtoollogs/catbundle/' || 'catbundle_PSU_' || name || '_APPLY_' || TO_CHAR(SYSDATE, 'YYYYMonDD_hh24_mi_ss', 'NLS_DATE_LANGUAGE=''AMERICAN''') || '.log' AS spool_file FROM v$database;

SQL> SPOOL &spool_file
SQL> exec dbms_registry.set_session_namespace('SERVER')

PL/SQL procedure successfully completed.

SQL> ALTER SESSION SET current_schema = SYS;

Session altered.

SQL> PROMPT Updating registry...
Updating registry...
SQL> INSERT INTO registry$history
  2    (action_time, action,
  3     namespace, version, id,
  4     bundle_series, comments)
  5  VALUES
  6    (SYSTIMESTAMP, 'APPLY',
  7     SYS_CONTEXT('REGISTRY$CTX','NAMESPACE'),
  8     '11.2.0.3',
  9     1,
 10     'PSU',
 11     'PSU 11.2.0.3.1');

1 row created.

SQL> COMMIT;

Commit complete.

SQL> SPOOL off
SQL> SET echo off
Check the following log file for errors:
/u01/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_ORCL_APPLY_2012Apr01_14_14_41.log
SQL>
SQL>

E depois é só conferir o resultado.

SQL> COL ACTION_TIME FORMAT A40
SQL> COL COMMENTS FORMAT A40
SQL> COL VERSION FORMAT A20
SQL> SELECT ACTION_TIME, VERSION, COMMENTS FROM DBA_REGISTRY_HISTORY;

ACTION_TIME                              VERSION              COMMENTS
---------------------------------------- -------------------- ----------------------------------------
01-APR-12 11.37.41.315015 AM             11.2.0.3             Patchset 11.2.0.2.0
01-APR-12 02.14.41.518371 PM             11.2.0.3             PSU 11.2.0.3.1
SQL>

Leave a Reply

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

Esse site utiliza o Akismet para reduzir spam. Aprenda como seus dados de comentários são processados.