Sunday 26 July 2015

patching and upgradation

Patch 13621679 - 11.1.0.7.11 Patch Set Update
Patchset/PSU    Patch Number    Description
11.1.0.7.11    13621679    DATABASE PATCH SET UPDATE 11.1.0.7.11 (INCLUDES CPU APR2012)

Patch 13621679 - 11.1.0.7.11 Patch Set Update


Patch InformationPatch Set Update (PSU) patches are cumulative. That is, the content of all previous PSUs is included in the latest PSU patch.

PSU 11.1.0.7.11 includes all fixes previously included in PSU 11.1.0.7.10 and those listed in .
To install the PSU 11.1.0.7.11 patch, the Oracle home must have the 11.1.0.7.0 Database installed. Subsequent PSU patches can be installed on Oracle Database 11.1.0.7.0 or any PSU with a lower 5th numeral version than the one being installed.

OPatch Utility
==============
You must use the OPatch utility version 11.1.0.8.2 or later to apply this patch. Oracle recommends that you use the latest released OPatch 11.1, which is available for download from My Oracle Support patch6880880 by selecting the 11.1.0.0.0 release.
For information about OPatch documentation, including any known issues, see My Oracle Support Note 293369.1 OPatch documentation list.

PSU Patching 11G Steps on PRIMARY database
==========================================

check DR sysnc status
=====================
http://select-star-from.blogspot.in/2013/09/data-guard-sync-status.html

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

Start OEM black out
===================

Confirmation
Blackout "Blackout-Apr 24 1998 9:33:42 PM" created successfully, Blackout status will be propagated to the target(s) shortly.

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

Node 1: (AS ORACLE)
===================

$ hostname
$ uname
$ bash
$ date
$ df -kg or df -h
$ cat /etc/oratab or cat/var/opt/oracle/oratab  ------> Note ASM and Database Home Paths
$ ps -ef| grep pmon
$ ps -ef| grep tns
$ ps -ef| grep emagent
$ ps -ef|grep oracle
$ ps -ef| grep d.bin
$ ps -ef|grep crs
 root  344170       1   0   Apr 24      -  0:00 /oradb/crs/product/11.1.0/crs_1/bin/oclskd.bin

$ cd /oradb/app/admin/orasw/patches/PSU_patches/Jan2012
$ opatch version
$ /oradb/crs/product/11.1.0/crs_1/OPatch/opatch version
$ /oradb/asm/product/11.1.0/asm_1/OPatch/opatch version
$ /oradb/app/oracle/product/11.1.0/db_1/OPatch/opatch version
$ which opatch
/oradb/app/oracle/product/11.1.0/db_1/OPatch/opatch
. oraenv  --- asm instance
$ opatch lsinventory
. oraenv  --- database 1 instance
$ opatch lsinventory
. oraenv  --- database 2 instance
$ opatch lsinventory

$ ps -ef| grep pmon
$ srvctl status database -d <database_1>                       or srvctl status instance -d <database_1> -i <database_1_instance>
$ srvctl status database -d <database_2>                       or srvctl status instance -d <database_2> -i <database_2_instance>

$ srvctl status asm -n <Node 1>
$ srvctl status asm -n <Node 2>

$ srvctl status listener -n <Node 1>
$ srvctl status listener -n <Node 2>

$ srvctl status nodeapps -n <Node 1>
$ srvctl status nodeapps -n <Node 2>

$ ps -ef|grep oracle or  ps -ef|grep emagent
./emctl status agent or  /oradb/app/oracle/product/agent1/agent11g/bin/emctl status agent

$ cd /oradb/crs/product/11.1.0/crs_1/bin
$ ./crsctl check cluster

$ cd /oradb/crs/product/11.1.0/crs_1/bin
$ ./crsctl check crs

$ cd /oradb/crs/product/11.1.0/crs_1/bin
$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------

$ srvctl stop database -d <database_1>              or srvctl stop insatnce -d <database_1> -i <database_1_instance>
$ srvctl stop database -d <database_2> -o immediate or srvctl stop insatnce -d <database_2> -i <database_2_instance>

$ srvctl stop asm -n <Node 1>
$ srvctl stop asm -n <Node 2>

$ srvctl stop listener -n <Node 1>
$ srvctl stop listener -n <Node 2>

$ srvctl stop nodeapps -n <Node 1>
$ srvctl stop nodeapps -n <Node 2>

$ ps -ef|grep oracle or  ps -ef|grep emagent
./emctl stop agent   or  /oradb/app/oracle/product/agent1/agent11g/bin/emctl stop agent

$ ps -ef| grep oracle
$ lsnrctl stop     -------------------------------to stop default listener
$ ps -ef| grep oracle

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

Node 2: (AS ORACLE)
===================

$ hostname
$ uname
$ bash
$ date
$ df -kg or df -h
$ cat /etc/oratab or cat/var/opt/oracle/oratab  ------> Note ASM and Database Home Paths
$ ps -ef| grep pmon
$ ps -ef| grep tns
$ ps -ef| grep emagent
$ ps -ef|grep oracle
$ ps -ef| grep d.bin
$ ps -ef|grep crs
 root  344170       1   0   Apr 24      -  0:00 /oradb/crs/product/11.1.0/crs_1/bin/oclskd.bin

$ cd /oradb/app/admin/orasw/patches/PSU_patches/Jan2012

$ opatch version

$ /oradb/crs/product/11.1.0/crs_1/OPatch/opatch version
$ /oradb/asm/product/11.1.0/asm_1/OPatch/opatch version
$ /oradb/app/oracle/product/11.1.0/db_1/OPatch/opatch version

$ which opatch
/oradb/app/oracle/product/11.1.0/db_1/OPatch/opatch

$ ps -ef| grep pmon

$ ps -ef|grep oracle or  ps -ef|grep emagent
./emctl status agent or  /oradb/app/oracle/product/agent1/agent11g/bin/emctl status agent

$ cd /oradb/crs/product/11.1.0/crs_1/bin
$ ./crsctl check cluster

$ cd /oradb/crs/product/11.1.0/crs_1/bin
$ ./crsctl check crs

$ cd /oradb/crs/product/11.1.0/crs_1/bin
$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------

$ ps -ef|grep oracle or  ps -ef|grep emagent
./emctl stop agent   or  /oradb/app/oracle/product/agent1/agent11g/bin/emctl stop agent

$ ps -ef| grep oracle
$ lsnrctl stop     -------------------------------to stop default listener
$ ps -ef| grep oracle

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

Pre-rootpatch
=============

Node 1: (AS ROOT)
=================

# cd /oradb/crs/product/11.1.0/crs_1/bin
# ./crsctl check cluster
# ./crsctl check crs
# ./crsctl stop crs

# ps -ef| grep oracle

# ssh <Node 2>

# cd /oradb/crs/product/11.1.0/crs_1/bin
# ./crsctl check cluster
# ./crsctl check crs
# ./crsctl stop crs

# ps -ef| grep oracle

# exit
# hostname
<Node 1>

# ps -ef| grep pmon   ---- (0 instances running)
# cd /oradb/app/admin/orasw/patches/PSU_patches/Jan2012/CRS/111077/11724953
# sh custom/scripts/prerootpatch.sh -crshome /oradb/crs/product/11.1.0/crs_1 -crsuser oracle

# ssh <Node 2>

# ps -ef| grep pmon   ---- (0 instances running)
# cd /oradb/app/admin/orasw/patches/PSU_patches/Jan2012/CRS/111077/11724953
# sh custom/scripts/prerootpatch.sh -crshome /oradb/crs/product/11.1.0/crs_1 -crsuser oracle

# exit
# hostname
<Node 1>

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

Pre-patch
=========

Node 1: (AS ORACLE)
===================

$ cd /oradb/app/admin/orasw/patches/PSU_patches/Jan2012/CRS/111077/11724953
$ custom/scripts/prepatch.sh -crshome /oradb/crs/product/11.1.0/crs_1

$ cd /oradb/app/admin/orasw/patches/PSU_patches/Jan2012/CRS/111077/11724953
$ custom/server/11724953/custom/scripts/prepatch.sh -dbhome /oradb/asm/product/11.1.0/asm_1

$ cd /oradb/app/admin/orasw/patches/PSU_patches/Jan2012/CRS/111077/11724953
$ custom/server/11724953/custom/scripts/prepatch.sh -dbhome /oradb/app/oracle/product/11.1.0/db_1

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

Opatch Apply
============

Node 1: (AS ORACLE)
===================

CRS
===
$ cd /oradb/app/admin/orasw/patches/PSU_patches/Jan2012/CRS/111077
$ opatch napply -oh /oradb/crs/product/11.1.0/crs_1 -id 11724953

ASM
===
$ cd /oradb/app/admin/orasw/patches/PSU_patches/Jan2012/CRS/111077/11724953/custom/server
$ opatch napply custom/server/ -oh /oradb/asm/product/11.1.0/asm_1 -id 11724953

RDBMS
=====
$ cd /oradb/app/admin/orasw/patches/PSU_patches/Jan2012/CRS/111077/11724953/custom/server
$ opatch napply custom/server/ -oh /oradb/app/oracle/product/11.1.0/db_1 -id 11724953

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

Do the post configure for CRS and RDBMS home
============================================

Node 1: (AS ORACLE)
===================

CRS
===
$ cd /oradb/app/admin/orasw/patches/PSU_patches/Jan2012/CRS/111077/11724953/custom/scripts
$ ./postpatch.sh -crshome /oradb/crs/product/11.1.0/crs_1

ASM
===
$ cd /oradb/app/admin/orasw/patches/PSU_patches/Jan2012/CRS/111077/11724953/custom/server/11724953
$ ./custom/scripts/postpatch.sh -dbhome /oradb/asm/product/11.1.0/asm_1

RDBMS
=====
$ cd /oradb/app/admin/orasw/patches/PSU_patches/Jan2012/CRS/111077/11724953/custom/server/11724953
$ ./custom/scripts/postpatch.sh -dbhome /oradb/app/oracle/product/11.1.0/db_1

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

11.1.0.7.11 PSU (13621679) and (9734685)
========================================

Node 1: (AS ORACLE)
===================

13621679
========

$ cd /oradb/app/admin/orasw/patches
$ chmod -R 777 PSU_patches
$ cd PSU_patches
$ pwd
/oradb/app/admin/orasw/patches/PSU_patches

$ ls -lrt p13621679_111070_AIX5L.zip
$ unzip p13621679_111070_AIX5L.zip
$ ls -lrt
$ cd 13621679
$ pwd

ASM
===
$ /oradb/app/admin/orasw/patches/PSU_patches/13621679
$ opatch apply -oh /oradb/asm/product/11.1.0/asm_1

RDBMS
=====
$ cd /oradb/app/admin/orasw/patches/PSU_patches/13621679
$ opatch apply -oh /oradb/app/oracle/product/11.1.0/db_1

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

9734685
=======

$ cd /oradb/app/admin/orasw/patches/PSU_patches/
$ ls -lrt p9734685_1110711_AIX64-5L.zip
$ unzip p9734685_1110711_AIX64-5L.zip

ASM
===
$ cd /oradb/app/admin/orasw/patches/PSU_patches/9734685
$ opatch apply -oh /oradb/asm/product/11.1.0/asm_1

RDBMS
=====
$ cd /oradb/app/admin/orasw/patches/PSU_patches/9734685
$ opatch apply -oh /oradb/app/oracle/product/11.1.0/db_1

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

After 9734685 Patch applied relink has to be done in both ASM and DB homes ------- Linking Oracle
==========================================================================

Node 1: (AS ORACLE)
===================

RDBMS
=====
$ cd /oradb/app/oracle/product/11.1.0/db_1/rdbms/lib
$ make -f ins_rdbms.mk ipc_g ioracle

ASM
===
$ cd /oradb/asm/product/11.1.0/asm_1/rdbms/lib
$ make -f ins_rdbms.mk ipc_g ioracle

Node 2: (AS ORACLE)
=======

RDBMS
=====
$ cd /oradb/app/oracle/product/11.1.0/db_1/rdbms/lib
$ make -f ins_rdbms.mk ipc_g ioracle

ASM
===
$ cd /oradb/asm/product/11.1.0/asm_1/rdbms/lib
$ make -f ins_rdbms.mk ipc_g ioracle

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

Post-rootpatch
==============

Node 1: (AS ROOT)
=================

# cd /oradb/app/admin/orasw/patches/PSU_patches/Jan2012/CRS/111077/11724953

# /oradb/app/admin/orasw/patches/PSU_patches/Jan2012/CRS/111077/11724953/custom/scripts/postrootpatch.sh -crshome /oradb/crs/product/11.1.0/crs_1

# ps -ef | grep pmon  --- Both the db and asm instances will be up and running

# ssh <Node 2>

# cd /oradb/app/admin/orasw/patches/PSU_patches/Jan2012/CRS/111077/11724953/custom/scripts/postrootpatch.sh -crshome /oradb/crs/product/11.1.0/crs_1

# ps -ef | grep pmon  --- Both the db and asm instances will be up and running

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

Start ASM

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

Run on each database, only in one node
======================================

NODE 1: (AS ORACLE)
===================

$ sqlplus /nolog
Enter user-name: / as sysdba
Connected to an idle instance.

SQL>startup;
SQL>@?/rdbms/admin/catbundle.sql psu apply
SQL>exit

$. oraenv ---- --- database 2 instance
$ sqlplus /nolog
Enter user-name: / as sysdba

SQL>startup;
SQL>@?/rdbms/admin/catbundle.sql psu apply
SQL>exit

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

Patch Validation:-
================

opatch lsinventory | grep 11724953
opatch lsinventory | grep 13621679
opatch lsinventory | grep 9734685

start local listeners, (if any)

$ cd /oradb/crs/product/11.1.0/crs_1/bin
$ ./crsctl check cluster

$ cd /oradb/crs/product/11.1.0/crs_1/bin
$ ./crsctl check crs

$ cd /oradb/crs/product/11.1.0/crs_1/bin
$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------

$ hostname
$ uname
$ bash
$ date
$ who -b
$ uptime
$ df -kg or df -h
$ cat /etc/oratab or cat/var/opt/oracle/oratab  ------> Note ASM and Database Home Paths
$ ps -ef| grep pmon
$ ps -ef| grep tns
$ ps -ef| grep emagent
$ ps -ef|grep oracle
$ ps -ef| grep d.bin
$ ps -ef|grep crs

$ ps -ef| grep pmon

$ srvctl status database -d <database_1>                      
$ srvctl status database -d <database_2>                      

$ srvctl status asm -n <Node 1>
$ srvctl status asm -n <Node 2>

$ srvctl status listener -n <Node 1>
$ srvctl status listener -n <Node 2>

$ srvctl status nodeapps -n <Node 1>
$ srvctl status nodeapps -n <Node 2>

$ ps -ef|grep oracle or  ps -ef|grep emagent
./emctl status agent or  /oradb/app/oracle/product/agent1/agent11g/bin/emctl status agent

Run on each database only in one node
=====================================

NODE 1: (AS ORACLE)
===================
SQL> select name db_name,DB_UNIQUE_NAME,instance_name,status,DATABASE_STATUS,open_mode, database_role, host_name,platform_id,version db_version,log_mode,flashback_on ,protection_mode,protection_level,LOGINS,to_char(STARTUP_TIME,'DD-MON-YYYY HH24:MI:SS') "UP TIME" from gv$instance,v$database;

SQL> select to_char(sysdate,'yyyy-mm-dd HH24:MI:SS') from dual
/

SQL>
col ACTION_TIME for a12
col NAMESPACE for a10
col VERSION for a10
col BUNDLE_SERIES for a15
col COMMENTS for a20
select action_time, action,namespace, version, id,bundle_series, comments from registry$history;

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

check DR sysnc status
=====================
http://select-star-from.blogspot.in/2013/09/data-guard-sync-status.html

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

Stop OEM black out
==================

Confirmation
Request to stop blackout "Blackout-Apr 24 1998 9:33:42 PM" was processed successfully, Blackout status will be propagated to the target(s) shortly.

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

July 28, 2013
Opatch rollback failed because files under patch_storage are missing
Issue : opatch rollback failed because files under patch_storage are missing
Error :
Archive Action: Source file "/u01/oracle/product/102/.patch_storage/4966417_Mar_12_2007_03_46_16/files/lib/libgeneric10.a/kgl.o" does not exist.

'oracle.rdbms, 10.2.0.3.0': Cannot update file '/u01/oracle/product/102/lib/libgeneric10.a' with '/kgl.o'

RollbackSession failed during prerequisite checks: Prerequisite check
"CheckRollbackable" failed.
System intact, OPatch will not attempt to restore the system

OPatch failed with error code 74

Fix:
Try roll backing the patch as below
opatch rollback -id <sub-set patch#> -no_sysmod

-no_sysmod options just removes the patch updating the inventory with out updating the files in the File System.

3
Oracle DBA Interview Questions and Answers - Patching,Cloning and Upgrade
Oracle Patching,Cloning and Upgrade Interview Questions and Answers

When you moved oracle binary files from one ORACLE_HOME server to another server then which oracle utility will be used to make this new ORACLE_HOME usable?
Relink all.

In which months oracle release CPU patches?
JAN, APR, JUL, OCT

When we applying single Patch, can you use opatch utility?
Yes, you can use Opatch incase of single patch. The only type of patch that cannot be used with OPatch is a patchset.

Is it possible to apply OPATCH without downtime?
As you know for apply patch your database and listener must be down. When you apply OPTACH it will update your current ORACLE_HOME. Thus coming to your question to the point in fact it is not possible without or zero downtime in case of single instance but in RAC you can Apply Opatch without downtime as there will be more separate ORACLE_HOME and more separate instances (running once instance on each ORACLE_HOME).

You have collection of patch (nearly 100 patches) or patchset. How can you apply only one patch from it?
With Napply itself (by providing patch location and specific patch id) you can apply only one patch from a collection of extracted patch. For more information check the opatch util NApply –help. It will give you clear picture.
For Example:
opatch util napply <patch_location> -id 9 -skip_subset -skip_duplicate
This will apply only the patch id 9 from the patch location and will skip duplicate and subset of patch installed in your ORACLE_HOME.

If both CPU and PSU are available for given version which one, you will prefer to apply?
From the above discussion it is clear once you apply the PSU then the recommended way is to apply the next PSU only. In fact, no need to apply CPU on the top of PSU as PSU contain CPU (If you apply CPU over PSU will considered you are trying to rollback the PSU and will require more effort in fact). So if you have not decided or applied any of the patches then, I will suggest you to go to use PSU patches. For more details refer: Oracle Products [ID 1430923.1], ID 1446582.1

PSU is superset of CPU then why someone choose to apply a CPU rather than a PSU?
CPUs are smaller and more focused than PSU and mostly deal with security issues. It seems to be theoretically more consecutive approach and can cause less trouble than PSU as it has less code changing in it. Thus any one who is concerned only with security fixes and not functionality fixes, CPU may be good approach.

How to Download Patches, Patchset or Opatch from metalink?

If you are using latest support.oracle.com then after login to metalink Dashboard
- Click on "Patches & Updates" tab
- On the left sidebar click on "Latest Patchsets" under "Oracle Server/Tools".
- A new window will appear.
- Just mouseover on your product in the "Latest Oracle Server/Tools Patchsets" page.
- Corresponding oracle platform version will appear. Then simply choose the patchset version and click on that.
- You will go the download page. From the download page you can also change your platform and patchset version.

REFERENCES:
http://docs.oracle.com/cd/E11857_01/em.111/e12255/e_oui_appendix.htm
Oracle® Universal Installer and OPatch User's Guide
11g Release 2 (11.2) for Windows and UNIX
Part Number E12255-11


What is the recent Patch applied?

What is OPatch?

How to Apply Opatch in Oracle?

1. You MUST read the Readme.txt file included in opatch file, look for any prereq. steps/ post installation steps or and DB related changes. Also, make sure that you have the correct opatch version required by this patch.
2.Make sure you have a good backup of database.
3. Make a note of all Invalid objects in the database prior to the patch.
4. Shutdown All the Oracle Processes running from that Oracle Home , including the Listener and Database instance, Management agent etc.
5. You MUST Backup your oracle Home and Inventory
tar -cvf $ORACLE_HOME $ORACLE_HOME/oraInventory | gzip > Backup_Software_Version.tar.gz
6. Unzip the patch in $ORACLE_HOME/patches
7. cd to the patch direcory and do opatch -apply to apply the patch.
8. Read the output/log file to make sure there were no errors.

Patching Oracle Software with OPatch ?

opatch napply <patch_location> -skip_subset -skip_duplicate
OPatch skips duplicate patches and subset patches (patches under <patch_location> that are subsets of patches installed in the Oracle home).

What is Opactch in Oracle?

OPATCH Utility (Oracle RDBMS Patching)

1. Download the required Patch from Metalink based on OS Bit Version and DB Version.
2. Need to down the database before applying patch.
3. Unzip and Apply the Patch using ”opatch apply” command.On successfully applied of patch you will see successful message “OPatch succeeded.“, Crosscheck your patch is applied by using “opatch lsinventory” command .
4. Each patch has a unique ID, the command to rollback a patch is “opatch rollback -id  <patch no.>” command.On successfully applied of patch you will see successful message “OPatch succeeded.“, Crosscheck your patch is applied by using “opatch lsinventory” command .
5. Patch file format will be like, “p<patch no.>_<db version>_<os>.zip”
6. We can check the opatch version using “opatch -version” command.
7. Generally, takes 2 minutes to apply a patch.
8. To get latest Opatch version download “patch 6880880 - latest opatch tool”, it contains OPatch directory.
9. Contents of downloaded patches will be like “etc,files directories and a README file”
10. Log file for Opatch utility can be found at $ORACLE_HOME/cfgtoollogs/opatch
11. OPatch also maintains an index of the commands executed with OPatch and the log files associated with it in the history.txt file located in the <ORACLE_HOME>/cfgtoollogs/opatch directory.
12. Starting with the 11.2.0.2 patch set, Oracle Database patch sets are full installations of the Oracle Database software. This means that you do not need to install Oracle Database 11g Release 2 (11.2.0.1) before installing Oracle Database 11g Release 2 (11.2.0.2).
13. Direct upgrade to Oracle 10g is only supported if your database is running one of the following releases: 8.0.6, 8.1.7, 9.0.1, or 9.2.0. If not, you will have to upgrade the database to one of these releases or use a different upgrade option (like export/ import).
14.Direct upgrades to 11g are possible from existing databases with versions 9.2.0.4+, 10.1.0.2+ or 10.2.0.1+. Upgrades from other versions are supported only via intermediate upgrades to a supported upgrade version.

http://avdeo.com/2008/08/19/opatch-utility-oracle-rdbms-patching/

Oracle version 10.2.0.4.0 what does each number refers to?
Oracle version number refers:
10 – Major database release number
 2 – Database Maintenance release number
 0 – Application server release number
 4 – Component Specific release number
 0 – Platform specific release number

Types of Patches?

How to rollback a patch?

What is PSU?

What is Rolling Patch?

How to check installed Patches?

How much time will it take for Patching?

Common issues faced in Patching?

REFERENCES:
OPATCH Utility (Oracle RDBMS Patching)
http://avdeo.com/2008/08/19/opatch-utility-oracle-rdbms-patching/

How to apply Database Patches
http://rafioracledba.blogspot.in/search/label/Database%20Patches

Critical Patch Updates, Security Alerts and Third Party Bulletin
http://www.oracle.com/technetwork/topics/security/alerts-086861.html

Oracle: Quick Guide to Opatch - (Oracle Database Patching utility)
http://www.dbalifeline.com/content/oracle-quick-guide-opatch-oracle-database-patching-utility

How to Design an Effective Patch Management Process
http://www.computing.net/howtos/show/how-to-design-an-effective-patch-management-process/744.html

Oracle Database 11.2.0.2 Patch Set (English)
http://www.dbacomp.com.br/blog/?p=69

Apply Oracle CPUApr2010 – 9352191 for Oracle10.2.0.4 in Aix5L
http://hendrydasan.com/2010/05/21/apply-oracle-cpuapr2010-9352191-for-oracle10-2-0-4-in-aix5l/

Cloning
=======
What is Cloning?

How to do take RMAN Cloning? Explain Steps?

Upgrade
=======

What is rolling upgrade?It is a new ASM feature from Database 11g.ASM instances in Oracle database 11g release(from 11.1) can be upgraded or patched using rolling upgrade feature. This enables us to patch or upgrade ASM nodes in a clustered environment without affecting database availability.During a rolling upgrade we can maintain a functional cluster while one or more of the nodes in the cluster are running in different software versions.Rolling upgrade can be used only for Oracle database 11g releases(from 11.1).

Steps to Upgrade in Oracle ?

Manual upgrade which involves the following steps:
1.Backup the database.
2.In UNIX/Linux environments, set the $ORACLE_HOME and $PATH variables to point to the new 11g Oracle home.
3.Analyze the existing instance using the "$ORACLE_HOME/rdbms/admin/utlu111i.sql" script.
4.Start the original database using the STARTUP UPGRADE command and proceed with the upgrade by running the "$ORACLE_HOME/rdbms/admin/catupgrd.sql" script.
5.Recompile invalid objects.
6.Restart the database.
7.Run the "$ORACLE_HOME/rdbms/admin/utlu111s.sql" script and check the result of the upgrade.
8.Troubleshoot any issues or abort the upgrade.

What happens when you give "STARTUP UPGRADE"?

$sqlplus "/as sysdba"
SQL> STARTUP UPGRADE

Note:
----
The UPGRADE keyword enables you to open a database based on an earlier Oracle Database release. It also restricts logons to AS SYSDBAsessions, disables system triggers, and performs additional operations that prepare the environment for the upgrade.

You might be required to use the PFILE option to specify the location of your initialization parameter file.
Once the database is started in upgrade mode, only queries on fixed views execute without errors until after the catupgrd.sql script is run. Before running catupgrd.sql, queries on any other view or the use of PL/SQL returns an error.

What is the difference between startup Upgrade and Migrate ?

startup migrate:
---------------
Used to upgrade a database till 9i.

Startup Upgrade
---------------
From 10G  we are using startup upgrade to upgrade database.

What happens internally when you use startup upgrade/migrate?

It will adjust few database (init) parameters (irrespective of what you have defined) automatically to certain values in order to run upgrade scripts smoothely.
in other way..it will issue few alter statements to set certain parameters which are required to complete the upgrade scripts without any issues.

REFERENCE:
---------
Oracle® Database Upgrade Guide 11g Release 2 (11.2)
http://docs.oracle.com/cd/E11882_01/server.112/e23633/upgrade.htm

Common issues faced in Upgrade?

Error is related to timezone file
Started database in upgrade mode and fired catupgrd.sql :

SQL> startup upgrade
ORACLE instance started.
Total System Global Area 6413680640 bytes
Fixed Size                  2160112 bytes
Variable Size            1946159632 bytes
Database Buffers         4429185024 bytes
Redo Buffers               36175872 bytes
Database mounted.
Database opened.
SQL> @catupgrd.sql
DOC>#######################################################################
DOC>#######################################################################
DOC>
DOC>   The first time this script is run, there should be no error messages
DOC>   generated; all normal upgrade error messages are suppressed.
DOC>
DOC>   If this script is being re-run after correcting some problem, then
DOC>   expect the following error which is not automatically suppressed:
DOC>
DOC>   ORA-00001: unique constraint () violated
DOC>#
   FROM registry$database
        *
ERROR at line 2:
ORA-00942: table or view does not exist
This  error is related to timezone file  which must be version 4 for Oracle version 11g.If timezone is not version 4 than patch needs to be applied.
Query to check timezone file  is:
SQL> select * from v$timezone_file;
FILENAME        VERSION
———— ———-
timezlrg.dat          4
SQL> select * from v$timezone_file;
FILENAME        VERSION
———— ———-
timezlrg.dat          4
So I had correct version.I remember applying patch before upgrade.I got lucky because patch existed for version 10.2.0.3.
If there is no patch for your Oracle versions than patch can be download for similar version and  applied manually.
Instructions are below:
1. Download the identified patch.
2. Unzip the patch, and locate the 2 files timezone.dat and timezlrg.dat in the “files/oracore/zoneinfo” directory of the uncompressed patch (or from the relevant .jar file of a   patchset). If there is also a readme.txt in this location then make a note of this as well.
3. Backup your existing files in $ORACLE_HOME/oracore/zoneinfo – THIS CAN BE VITAL, DO NOT SKIP.
Note:
Before going on with step 4, make sure the current files are not in use.
On Windows the files will simply refuse to be removed when the are in use.
On Unix replacing the files whilst they are in use can cause the files to become corrupt. Use the fuser command before replacing the files to make sure they are not in use.
4. Copy the 2 .dat files and possibly the readme.txt file that were found in step 2 into the $ORACLE_HOME/oracore/zoneinfo directory.
5. Restart the database (in case of installation on a database), or restart the client applications (in case of client install). Note that the database did not need to be down before the time zone files were applied, but it does need to be restarted afterwards.


s
BlogThis!
Share to Twitter
Share to Facebook
Share to Pinterest

Labels: Oracle DBA Interview Questions and Answers, PATCHING
March 02, 2013
ASM PATCHING

Install Instructions
====================
Download ASM Patch

Check DR sync status

shutdown all Applications related to databases

PROD
====
Blackout all the sevices on database server Node 1 and Node 2 (OEM)

Capture the pre-shutdown status at OS level.
Capture the pre-shutdown status at Database level.

shutdown all the instances on the database server (Node 1)
shutdown ASM instance on server (Node 1)

shutdown all the instances on the database server (Node 2)
shutdown ASM instance on server (Node 2)

Install Patch on Node 1
-----------------------
set environment variables to asm
export ORACLE_HOME=<>
cd <PATCH_NUMBER>
$ORACLE_HOME/Opatch/opatch apply -local

ps -ef|grep asm

. oraenv
+ASM

Install Patch on Node 2
-----------------------
set environment variables to asm
export ORACLE_HOME=<>
cd <PATCH_NUMBER>
$ORACLE_HOME/Opatch/opatch apply -local

ps -ef|grep asm

. oraenv
+ASM

Validate whether the Patches are applied or not
-----------------------------------------------
$ORACLE_HOME/Opatch/opatch lsinventory

start ASM instance on server (Node 1)
start all the instances on the database server (Node 1)

start ASM instance on server (Node 2)
start all the instances on the database server (Node 2)

start the listeners and validate the connections (Node 1)
start the listeners and validate the connections (Node 2)

Database Validation
-------------------
validate all the Database services for all databases (Node 1)
validate all the Database services for all databases (Node 2)

Application Validation
----------------------
Startup the applications and validate and inform Application team
Application team should validate.

DR
==
Same steps as in PROD

Check DR sync status

FALLBACK Plan
=============
set environment variables

Rollback Patches on both Node 1 and Node 2
$ORACLE_HOME/Opatch/opatch -id <PATCH_NO> rollback

Database Validation
-------------------
validate all the Database services for all databases (Node 1)
validate all the Database services for all databases (Node 2)

Application Validation
----------------------
Startup the applications and validate and inform Application team

No comments:

Post a Comment