Friday 28 February 2014

Upgrading 10.1.3.4 OH to 10.1.3.5 by Applying Patchset (10.1.3.5)

Upgrading 10.1.3.4  OH to 10.1.3.5 by Applying Patchset (10.1.3.5)


1)Pre-Installation Steps

àDownload  patches 8626084, 8920270 

àTake a Backup of the Oracle E-Business Suite Release 12 10.1.3 Oracle Home and Inventory

àUpgrade Oracle E-Business Suite Release 12 JDK to Java 6.0 latest update (Recommended)

 àApply OracleAS 10g Release 3 (10.1.3.0) Patch Set 5 (10.1.3.5.0)

Set Your Environment to 10.1.3 ORACLE_HOME

Export ORACLE_HOME=/u01/applmgr/apps/tech_st/10.1.3
Export ORACLE_CONFIG_HOME=/u01/applmgr/inst/apps/PROD_fed01/ora/10.1.3
Note:-If you didn’t export ORACLE_CONFIG_HOME env variable then  runInstaller will fail

Ensure that the location of the <1013_ORACLE_HOME>/ant/bin directory is included in                                  
the PATH Environment variable

                echo $PATH

àUnzip patch 8920270 into temporary directory and perform 1,2,3 steps mentioned in four steps.
                Unzip 8920270

àUnzip patch 8626084  into temporary directory
                Unzip 8626084

àMake sure that OPatch version 1.0.0.0.58 or higher before running this patch
                To check opatch version
                Opatch version


 2)Apply OracleAS 10g Release 3 (10.1.3.0) Patch Set 5 (10.1.3.5.0)
àChange directory to <patch-top>/Disk1
Execute runInstaller
./runInstaller

à If you have a Local Inventory, invoke the runInstaller program by running the command:

                ./runInstaller -invPtrLoc <1013_ORACLE_HOME>/oraInst.loc

àDuring the Installation, OUI may display the following warning messages.

 1)Ensure that all OC4J instances are up and running prior to applying this patch.

2)At this time, Oracle Application Tier will be shut down. There will be a brief pause in the installer when the application tier processes are stopped.

--Click the 'OK' button to proceed with the installation.
--When it asks Enter the <oc4jadmin> user password then enter password as “oafm”
--During 10.1.3.5 patchset installation, Oracle Universal Installer may have started some process from the OracleAS Oracle Home. Before proceeding further, shut down any processes started by the installer.
--Run AutoConfig

 Apply Any Additional OracleAS 10g Patches
                Patch 12965674(IF JDK version is higher than 1.6.0_29)
 Post-Installation Tasks

Regenerate appsborg.zip and appsborg2.zip files

Run adadmin, and choose Generate product JAR files (with the no force option) to generate the appsborg.zip and appsborg2.zip files.
 Verify the OracleAS 10g Release 3 (10.1.3) Patch Set 5 (10.1.3.5) Installation
Invoke runInstaller from <1013_ORACLE_HOME>/oui/bin (on UNIX and Linux) or setup.exe (on Windows).
Click on Installed Products.
Select the 10.1.3 Oracle Home and expand the tree. You should see Oracle Application Server Patchset 10.1.3.5 patch in the list.
And also
 'opatch lsinventory -detail'
2. Look for 'Oracle Application Server PatchSet' in the 'Product' column. 'Version' should show 10.1.3.5.0.

Restart application tier services

àApplying subsequent OracleAS 10g Patches
5587546
9010039
9099241

àRun adadmin, and choose Generate product JAR files (with the no force option) to generate the appsborg.zip and appsborg2.zip files.



For Step by step process to upgrade JDK 7 in oracle applications click on link below.

http://learnappsdbaskills.blogspot.in/2014/02/upgrading-to-jdk-70-in-oracle.html

Thursday 27 February 2014

Upgrading to JDK 7.0 in oracle applications R12

Upgrading JDK 7.0(1467892.1)

1)Upgrading to Latest JDK 7.0 on Application Tier Nodes

àUpgrading to JDK 7.0 requires Oracle Application Server 10.1.3.5 or higher for the web tier.

àNote:- By default when we install R12.1.1 we will get Web Tier with 10.1.3.4 so First we need to upgrade 10.1.3.4 to 10.1.3.5

àTo upgrade to 10.1.3.5 follow metalink noteid 454811.1. Upgrading to the Latest OracleAS 10g 10.1.3.x Patch Set in Oracle E-Business Suite Release 12.
                                                                                    (or)
                                                                           follow below link

http://learnappsdbaskills.blogspot.in/2014/02/upgrading-10134-oh-to-10135-by-applying.html

àOnce upgrading to 10.1.3.5 verify $OAS_ORACLE_HOME/config/ias.properties file to confirm WebTier version.

àBefore upgrading Application Tier Nodes to JDK 7.0 apply these prerequisite patches.
                                Patch 16545472 
                                Patch 17309237
                                Note:- Before Applying this patches make sure you have applied all prerequisite patches and performed post installation steps.
                               
àDownload Latest JDK 7.0 Update from below link  http://www.oracle.com/technetwork/java/javase/downloads/index.html
 Note:-You will find rpm file and tar file make sure you are downloading tar file.

àStop All Application Tier Services
                cd $ADMIN_SCRIPTS_HOME
                adstpall.sh apps/apps

àReplace JDK Home Used With Oracle E-Business Suite Release 12
Oracle E-Business Suite application tier uses the JDK from a fixed installation location, $IAS_ORACLE_HOME/
appsutil/jdk
To replace existing JDK to Newly installed version perform below steps.
                    cd $IAS_ORACLE_HOME/appsutil
                    mv jdk jdk_old
                    Extract Downloaded file(JDK 7.0) in this location
                    mv jdk1.7.0_5 jdk
Note:- The final line installs the latest update of JDK 7.0 into the $IAS_ORACLE_HOME/appsutil directory. In this example, the version is 7.0_5.
                Rename Existing JRE Directories
                    mv $IAS_ORACLE_HOME/jre/1.4.2 $IAS_ORACLE_HOME$/jre/1.4.2_old
àInstall Albany (Display) Font
Copy the below files from $FND_TOP/resource directory to $IAS_ORACLE_HOME/appsutil/jdk/jre/lib/fonts directory
         ALBANYWT.ttf,  ALBANWTJ.ttf,  ALBANWTK.ttf,    ALBANWTS.ttf, ALBANWTT.ttf
                                ex: cp $FND_TOP/resource/ALBANYWT.ttf $IAS_ORACLE_HOME/appsutil/jdk/jre/lib/fonts

2)Upgrading to Latest JDK 7.0 in OracleAS 10.1.2 Oracle_Home
àDownload and Apply the following Patches
                                Patch 12848228
                                Patch 5659594

àDownload Latest JDK 7.0 Update

àReplace JDK Home Used With Oracle E-Business Suite Release 12
     To replace existing JDK to Newly installed version perform below steps.
                                cd 10.1.2_ORACLE_HOME
                                mv jdk jdk_old
                                Extract Downloaded file(JRE 7.0) in this location
                                mv jdk1.7.0_2

àRename The Following Directories
                                mv $ORACLE_HOME/jdk64   $ORACLE_HOME/jdk64_old
                                mv $ORACLE_HOME/jre/1.4.2 $ORACLE_HOME/jre/1.4.2_old
                                mv $IAS_ORACLE_HOME/jre/1.4.2 $IAS_ORACLE_HOME/jre/1.4.2_old
   
àAfter JDK 7 UPGRADE REPORTS,FORMS CAUSES RELINKING ERROR so apply these patches on top of 10.1.2 ORACLE_HOME.
   Note:-Apply these patches in sequence using opatch utility and perform post patch steps.
               
                1)16271876
                2)14703419
                3)16207165
                4)16241466
   
  àRe-generate Oracle E-Business Suite Forms and Reports
    Under adadmin main menu select "Generate Applications Files Menu"
                Under submenu select "Generate Form Files” when adadmin completes Form Files Select "Generate Report Files".
   
 à Restart All Application Tier Services
                                cd $ADMIN_SCRIPTS_HOME
                                adstrtall.sh apps/apps

  à Perform Health Checks

3)Upgrading to Latest JRE 7.0 on Database Tier Node

 àDownload Latest JRE 7.0 Update(Note: Download the 32-bit JRE only, not the Java SE Development Kit (JDK))

 àReplacing JRE Home Used With Oracle E-Business Suite Release 12
                The Oracle E-Business Suite database tier uses the JRE 7.0 from a fixed installation location, $ORACLE_HOME/appsutil/jre.
                To replace existing JRE to Newly installed version perform below steps.
                cd $ORACLE_HOME/appsutil
                mv jre jre_old
                Extract Downloaded file(JRE 7.0) in this location
                mv jre1.7.0_5 jre
                Note:The final line installs the latest update of JRE 7.0 into the $ORACLE_HOME/appsutil directory. In this example, the version is 7.0_5.
               
4)Verify Application Tier Node Configurations
àVerify Installations On All Web Server Nodes
                Navigate to OA_HTML directory and Create JDKtest.jsp file
                Using a text editor, create a file called JDKtest.jspunder [OA_HTML] containing the following line:
                                The JDK version is: <%= System.getProperty("java.version") %>
                Compile JDKtest.jsp script using following command
                                 perl -x $FND_TOP/patch/115/bin/ojspCompile.pl --compile -s 'JDKtest.jsp'
                Run JDKtest.jsp script from browser  using the below URL
                                http://[web server]:[port]/OA_HTML/JDKtest.jsp

àVerify Configurations On All Application Tier Nodes
check the output of below commands.
                $ $ADJVAPRG -version
                $ echo $CLASSPATH
                $ $AFJVAPRG -version
                $ echo $AF_CLASSPATH
                Note:-The output of  CLASSPATH and AF_CLASSPATH should contain below executables
                                $IAS_ORACLE_HOME/appsutil/jdk/lib/dt.jar
                                $IAS_ORACLE_HOME/appsutil/jdk/lib/tools.jar
                                $IAS_ORACLE_HOME/appsutil/jdk/jre/lib/rt.jar
                Note:-The output of ADJVAPRG and AFJVAPRG should contain New JDK 7 executables
                                [applmgr@fed01 ~]$ $AFJVAPRG -version
                java version "1.7.0_51"
                Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
                Java HotSpot(TM) Server VM (build 24.51-b03, mixed mode)
                [applmgr@fed01 ~]$ $ADJVAPRG -version
                java version "1.7.0_51"
                Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
                Java HotSpot(TM) Server VM (build 24.51-b03, mixed mode)

àVerify Oracle E-Business Suite concurrent programs
                Log in to Oracle E-Business Suite and select the "System Administrator" responsibility.
                Check the Concurrent --> Manager --> Administer form and ensure that all managers have the appropriate numbers for their actual and target.

àVerify JRE Installation on Database Tier Node
                cd $ORACLE_HOME/appsutil/jre/bin {ORACLE_HOME here refers to RDBMS ORACLE_HOME}
                 java -version
                 Output of above command should refer to 1.7.0_x.
                

Monday 17 February 2014

Data Recovery Advisor in RMAN

Data Recovery Advisor in RMAN


Connect to sqlplus and create any table.

Sql> create table myobjects  tablespace users as select * from all_objects;

Using DBMS_ROWID, we determine the blocks which this table occupies (if you like, just restrict the query to the first 5 blocks in case the table contains many blocks)
SQL> select * from
2 (select distinct dbms_rowid.rowid_block_number(rowid)
3 from myobjects)
4 where rownum < 6;
DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID)
------------------------------------
12
13
14
15
16

We can then corrupt any one of these blocks (in our case block 13) to simulate a block corruption - don't do this in production!

dd of=/u01/app/oracle9/oradata/SATISH/datafile / o1_mf_users_9gdfxf2t_.dbf  bs=8192 seek=13 conv=notrunc count=1 if=/dev/zero

Now try to take backup of tablespace users. RMAN will validate corrupted blocks and it will not take backup.

[oracle9@fed01 datafile]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Tue Feb 18 12:09:23 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: SATISH (DBID=3984685639)

RMAN> backup tablespace users;

Starting backup at 18-FEB-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=190 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/u01/app/oracle9/oradata/SATISH/datafile/o1_mf_users_9gdfxf2t_.dbf
channel ORA_DISK_1: starting piece 1 at 18-FEB-14
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 02/18/2014 12:09:46
ORA-19566: exceeded limit of 0 corrupt blocks for file /u01/app/oracle9/oradata/SATISH/datafile/o1_mf_users_9gdfxf2t_.dbf


RMAN is unable to take backup of tablespace users as a block was corrupted .
Using Data Recovery Advisor we will recover corrupted block.

RMAN> list failure;

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
562        HIGH     OPEN      18-FEB-14     Datafile 4: '/u01/app/oracle9/oradata/SATISH/datafile/o1_mf_users_9gdfxf2t_.dbf' contains one or more corrupt blocks

RMAN> advise failure;

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
562        HIGH     OPEN      18-FEB-14     Datafile 4: '/u01/app/oracle9/oradata/SATISH/datafile/o1_mf_users_9gdfxf2t_.dbf' contains one or more corrupt blocks

analyzing automatic repair options; this may take some time
using channel ORA_DISK_1
analyzing automatic repair options complete

Mandatory Manual Actions
========================
no manual actions available

Optional Manual Actions
=======================
no manual actions available

Automated Repair Options
========================
Option Repair Description
------ ------------------
1      Perform block media recovery of block 221 in file 4
  Strategy: The repair includes complete media recovery with no data loss
  Repair script: /u01/app/oracle9/diag/rdbms/satish/SATISH/hm/reco_1937462406.hm

RMAN> repair failure;

Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle9/diag/rdbms/satish/SATISH/hm/reco_1937462406.hm

contents of repair script:
   # block media recovery
   recover datafile 4 block 221;

Do you really want to execute the above repair (enter YES or NO)? Yes
executing repair script

Starting recover at 18-FEB-14
using channel ORA_DISK_1

channel ORA_DISK_1: restoring block(s)
channel ORA_DISK_1: specifying block(s) to restore from backup set
restoring blocks of datafile 00004
channel ORA_DISK_1: reading from backup piece /u01/app/oracle9/product/11.2.0/dbhome_1/dbs/07ovuei2_1_1
channel ORA_DISK_1: piece handle=/u01/app/oracle9/product/11.2.0/dbhome_1/dbs/07ovuei2_1_1 tag=TAG20140206T104938
channel ORA_DISK_1: restored block(s) from backup piece 1
channel ORA_DISK_1: block restore complete, elapsed time: 00:00:01

starting media recovery
media recovery complete, elapsed time: 00:00:07

Finished recover at 18-FEB-14
repair failure complete

RMAN> backup tablespace users;

Starting backup at 18-FEB-14
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/u01/app/oracle9/oradata/SATISH/datafile/o1_mf_users_9gdfxf2t_.dbf
channel ORA_DISK_1: starting piece 1 at 18-FEB-14
channel ORA_DISK_1: finished piece 1 at 18-FEB-14
piece handle=/u01/app/oracle9/product/11.2.0/dbhome_1/dbs/0ep0u7sd_1_1 tag=TAG20140218T121157 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 18-FEB-14


Now RMAN successfully taken backup of tablespace users.

Thursday 13 February 2014

FLASHBACK CONCEPTS IN ORACLE

Flashback Concepts:

The flash recovery area serves as the default storage area for all files related to backup and restore operations.

The flash recovery area provides the following benefits:

Single storage location for all recovery-related files.
Automatic management of recovery-related disk space.
Faster backup and restore operations, since you don’t need to restore tape backups.
Increased reliability of backups, since disks are generally safer storage devices than tapes. 

The flash recovery area may contain the following files:

1) Datafile copies: The new RMAN command BACKUP AS COPY can be used to create image copies of all datafiles and automatically store in the flash recovery area.
 2)Control file autobackups: The database places any control file backups it generates in the flash recovery area.
 3)Archived redo log files: If you store Archived redo log files in the flash recovery area, Oracle will automatically delete the files. 
 4)Online redo log files: Oracle recommends that you save a multiplexed copy of your online redo log files in the flash recovery area. The following statements can create online redo logs in the flash recovery area: CREATE DATABASE, ALTER DATABASE ADD LOGFILE, ALTER DATABASE ADD STANDBY LOGFILE, and ALTER DATABASE OPEN RESETLOGS.
5)Current control files: Oracle also recommends that you store a multiplexed current control file in the flash recovery area.
 6)RMAN backup pieces : If configuration of RMAN parameters for storing backup pieces is not set, by default rman will write the backup pieces to FRA ( if enabled) while taking backup.
7)Flashback logs: If you enable the flashback database feature, Oracle copies images of each altered block in every datafile into flashback logs stored in the flash recovery area.

Note: Oracle calls the multiplexed redo log files and control files in the flash recovery area permanent files, since they should never be deleted and are part of the live database. Oracle terms all the other files in the flash recovery area (recovery related files) transient files, since Oracle will delete them eventually after they have become obsolete or have already been copied to tape.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u02/oradata/ritesh/arch

1)To enable flashback we need to set size and destination for flashback logs.

SQL> alter system set db_recovery_file_dest_size=500m;
SQL> alter system set db_recovery_file_dest='/u02/oradata/ritesh/flashback';

2)To check configured parameters.

SQL> show parameter recovery_file_dest;
NAME                                 TYPE              VALUE
db_recovery_file_dest                           string
db_recovery_file_dest_size               big integer 500M

3)To enable Flashback enter the following command

SQL> alter database flashback on;
SQL> alter database open;

Note: When we enable FRA then oracle will generate archive logs in DB_RECOVERY_FILE_DEST location. Hence the destination mount point will fill  very quickly due to flashback logs and archived logs.
Change the archiver log destination by using log_archive_dest_1
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST

4)To change archivelog file destination

SQL> alter system set log_archive_dest_1='LOCATION=/u02/oradata/ritesh/arch';

SQL> ARCHIVE LOG LIST;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u02/oradata/ritesh/arch

5)Check whether FRA is working or not

SQL> drop table vamshi.t1;
SQL> select * from vamshi.t1;
ORA-00942: table or view does not exist
SQL> flashback table vamshi.t1 to before drop;
Flashback complete.
SQL> select count(*) from vamshi.t1;
 COUNT(*)
         6

6) Flashback recover using SCN:

SQL> select current_scn from v$database;
CURRENT_SCN
     230178
SQL> drop table vamshi.t1 purge;
SQL> shut immediate;
SQL> startup mount;
SQL>  flashback database to scn 230178;
Flashback complete.

àCheck your table in database by opening database in Readonly mode before opening database in resetlogs

SQL> alter database open READ ONLY;
SQL> select count(*) from vamshi.t1;
 COUNT(*)
   6
SQL> alter database open resetlogs;
Note:-When we Perform recovery using Flashback database should  be opened with resetlogs.

7) Flashback recover until TIME

[oracle@oracledb1 ~]$ date
Fri Mar 22 18:10:24 IST 2013

SQL> drop table vamshi.t1 purge;
SQL> shut immediate;
SQL> startup mount;

SQL> flashback database to timestamp to_timestamp('18:10:24 2013/03/22','HH24:MI:SS YYYY/MM/DD');
Flashback complete.
SQL> alter database open READ ONLY;
Database altered.
SQL> select count(*) from vamshi.t1;
COUNT(*)
         6
SQL> SHUT IMMEDIATE;
SQL> startup mount;
SQL> alter database open resetlogs;

8) To Disable current  Flash Recovery Area

SQl>alter system set DB_RECOVERY_FILE_DEST=”  “;

9)To move  Flash Recovery Area to another destination

SQL>alter system set DB_RECOVERY_FILE_DEST=’<NEW LOCATION>’ scope=both;

Different views based on Flash Recovery Area

V$FLASH_RECOVERY_AREA_USAGE
V$RECOVERY_FILE_DEST


also see http://learnappsdbaskills.blogspot.com/2013/07/flashfast-recovery-area-fra-in-oracle.html