Friday, May 11, 2012

Installing Oracle 10g Binaries on Redhat-5 (Issue with Redhat version)


Installing 10g Binaries on Redhat-5 (Issue with Redhat version)

Error during redhat installation
===================================
Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
                                      Failed <<<<

Exiting Oracle Universal Installer, log for this session can be found at /app/oraInventory/logs/installActions2012-04-27_03-12-11PM.log



------------------------------------------------------------------------------------------
Path of software:
SOFTWARE_PATH/oracle/linux/x86_64/base_10.2.0.1_64/database/install


cp -p oraparam.ini /tmp
vi /tmp/oraparam.ini

Linux=redhat-3,SuSE-9,redhat-4,UnitedLinux-1.0,asianux-1,asianux-2
to
Linux=redhat-3,SuSE-9,redhat-4,UnitedLinux-1.0,asianux-1,asianux-2,redhat-5

Run the runIntaller using the below command to use the new oraparam.ini files:

./runInstaller -paramFile /tmp/oraparam.ini


runInstaller logfile:
------------------------
===========================You can ignore this =================================
Checking operating system requirements ...
Expected result: One of redhat-3,redhat-4,SuSE-9
Actual Result: redhat-Red Hat Enterprise Linux Server release 5.5 (Tikanga)
Check complete. The overall result of this check is: Failed <<<<
Problem: Oracle Database 10g is not certified on the current operating system.
Recommendation: Make sure you are installing the software on the correct platform.
=======================================================================

Checking operating system package requirements ...
Check complete. The overall result of this check is: Not executed <<<<
OUI-18001: The operating system 'Linux Version redhat-Red Hat Enterprise Linux Server release 5.5 (Tikanga)' is not supported.
Recommendation: Install the required packages before continuing with the installation.
=======================================================================

Checking kernel parameters
Check complete. The overall result of this check is: Not executed <<<<
OUI-18001: The operating system 'Linux Version redhat-Red Hat Enterprise Linux Server release 5.5 (Tikanga)' is not supported.
Recommendation: Perform operating system specific instructions to update the kernel parameters.
=======================================================================

Checking Recommended glibc version
Check complete. The overall result of this check is: Not executed <<<<
OUI-18001: The operating system 'Linux Version redhat-Red Hat Enterprise Linux Server release 5.5 (Tikanga)' is not supported.
Recommendation: You may actually have installed packages which have obsoleted these, in which case you can successfully continue with the install. If you have not, it is recommended that you do not continue. Refer to the readme to find out how to get the missing packages.
=======================================================================

Checking physical memory requirements ...
Expected result: 922MB
Actual Result: 257456MB
Check complete. The overall result of this check is: Passed
=======================================================================

Checking available swap space requirements ...
Expected result: 193092MB
Actual Result: 301529MB
Check complete. The overall result of this check is: Passed
=======================================================================

Checking Network Configuration requirements ...
Check complete. The overall result of this check is: Passed
=======================================================================

Overall status is passed. Ignore the warning which you get after this and  proceed with the remaining installation.

Tuesday, May 8, 2012

ORA-00354: corrupt redo log block header/Issues with RMAN backup



I faced this issue where in a perticular block 146150  in one of the redo log file got corrupted in one of my database. Please note that below can be implemented for the corrupt redo log block. This involves data loss as we are clearing the redo log which is having issue.I performed this for a test database.

alert log error
====================
Mon May 07 10:54:12 2012
ARC3: Log corruption near block 146150 change 83907949 time ?
CORRUPTION DETECTED: thread 1 sequence 2670 log 3 at block 146150. Arch found corrupt blocks
Errors in file /app/oracle/admin/diag/rdbms/ORCL/ORCL/trace/ORCL_arc3_20151.trc:
ORA-00354: corrupt redo log block header
ORA-00353: log corruption near block 146150 change 83907949 time 04/20/2012 14:00:10
ORA-00312: online log 3 thread 1: '/ora04/oradata/ORCL/redo/g3m2.rdo'
ORA-00312: online log 3 thread 1: '/ora03/oradata/ORCL/redo/g3m1.rdo'
ARC3: All Archive destinations made inactive due to error 354
ARC3: Closing local archive destination LOG_ARCHIVE_DEST_1: '/oraarch/oradata/ORCL/ORCL_1_2670_756578622.arc' (error 354) (ORCL)



SQL> select  GROUP#,SEQUENCE#, MEMBERS, STATUS  from v$log;

    GROUP#  SEQUENCE#    MEMBERS STATUS
---------- ---------- ---------- ----------------
         1       2725          2 ACTIVE
         2       2726          2 CURRENT
         3       2670          2 INACTIVE

SQL> ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP 3;

Database altered.


SQL> alter system switch logfile;

System altered.


SQL>  select  GROUP#,SEQUENCE#, MEMBERS, STATUS  from v$log;

    GROUP#  SEQUENCE#    MEMBERS STATUS
---------- ---------- ---------- ----------------
         1       2728          2 CURRENT
         2       2726          2 ACTIVE
         3       2727          2 ACTIVE

SQL> select  GROUP#,SEQUENCE#, MEMBERS, STATUS  from v$log;

    GROUP#  SEQUENCE#    MEMBERS STATUS
---------- ---------- ---------- ----------------
         1       2728          2 ACTIVE
         2       2729          2 CURRENT
         3       2727          2 ACTIVE

alert log
===========

Tue May 08 13:19:45 2012
ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP 3
Tue May 08 13:19:45 2012
Beginning global checkpoint up to RBA [0xaa6.2d.10], SCN: 85719068
Completed checkpoint up to RBA [0xaa6.2d.10], SCN: 85719068
Completed checkpoint up to RBA [0xaa6.2.10], SCN: 85718985
WARNING! CLEARING REDO LOG WHICH HAS NOT BEEN ARCHIVED. BACKUPS TAKEN
    BEFORE 04/21/2012 06:00:18 (CHANGE 83917294) CANNOT BE USED FOR RECOVERY.
Clearing online log 3 of thread 1 sequence number 2670
Completed: ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP 3
Tue May 08 13:20:24 2012
Direct NFS: NFS3ERR 2 No such file or directory. path somnas301 mntport 4046 nfsport 2049
Archived Log entry 2702 added for thread 1 sequence 2725 ID 0x361bd8fe dest 1:
Archiver process freed from errors. No longer stopped


This is how issue was resolved.

Thursday, May 3, 2012

Upgrade database from 9.2.0.5 to 9.2.0.7

Steps followed to upgrade database from 9.2.0.5 to 9.2.0.7

This was just one of the specific requirement from the application team so i am posting it just in case it benefits anyone.

Steps:
Download software and extract the oracle installation software

Set the oracle environment

Shut down the database

Stop all processes

Take a backup of Oracle installation

Installation

Post Installation Task(Database Upgrade)

STEP 1: Download and extract the latest patch

You can use the oracle website to download the latest oracle patch set. Here we have installed p4163445_92070_SOLARIS64.zip

Here we have placed the patch set dump file p4163445_92070_SOLARIS64.zip at /var/opt/oracle/product

Once the patch set dump has been placed on the server extract the patch set p4163445_92070_SOLARIS64.zip

unzip p4163445_92070_SOLARIS64.zip


STEP2: Set up the oracle environments variables:
This is one of the very important step that need to be followed religiously because if this is not followed properly then this can ruin all the effort.

Set up mainly the correct ORACLE_HOME and ORACLE_SID
Export ORACLE_SID=blfxen1
Export ORACLE_HOME=/var/opt/oracle/product/9.2.0.5.0



STEP 3: SHUT DOWN DATABASE:

Ensure that before the installation begin shut down the databases which the using binaries for which you are doing the upgrading activity.

SQl>Shutdown immediate;


STEP 4: Stop all processes

Ensure that before you begin this upgradation activity all the oracle processes should be stopped.
The main oracle processes would be the database listeners as well as any agent(if running.

Lsnrctl stop
Or
lsnrop.sh stop

Ensure that you run the above command for all the listeners for the databases(if more than one) running on the same server.

STEP 5: BACKUP

This is recommended that before installation activity starts we should take a backup of the binaries on which the database is running. This is to ensure to roll back in case of any corruption after the installation activity completes.

STEP 6: INSTALLING BINARIES

a. First of all we need to direct the X applications to display on the local system. So for that export the DISPLAY parameter a:

DISPLAY=export DISPLAY=:0.0
For e.g.

DISPLAY=export DISPLAY=10.5.12.133:0.0

Where LOCAL_HOST is the address (ip or hostname) of the machine where you want to display runInstaller.

b. Check on your local machine where you are displaying the runInstaller for softwares like EXCEED/XSESSION (XSecurePro64) which supports display settings required for running the runInstaller.

c. Once the patch set dump is extracted

unzip p4163445_92070_SOLARIS64.zip


It will create a directory Disk1
Inside the directory below are the files that will be present.

(f7q21-08) [SID: blfxenv1]/var/opt/oracle/product>cd Disk1
(f7q21-08) [SID: blfxenv1]/var/opt/oracle/product/Disk1>ls -ltr
total 4280
-rwxr-xr-x 1 oracle dba 1477 Sep 1 2005 runInstaller
drwxr-xr-x 2 oracle dba 96 Sep 1 2005 response
drwxr-xr-x 4 oracle dba 1024 Sep 1 2005 install
-rwxr-xr-x 1 oracle dba 2087863 Sep 2 2005 9207_buglist.htm
-rwxr-xr-x 1 oracle dba 99327 Sep 2 2005 patch_note.htm
drwxr-xr-x 8 oracle dba 1024 Sep 2 2005 stage

d.Now,go to /var/opt/oracle/product/Disk1

Before running runInstaller ensure that file /var/opt/oracle/oraInst.loc contains the right oraInventory path

If any issue you face like the installer product are not being shown at the
GUI runInstaller window, you must give the correct path of the ORAINVENTORY in the orainst.loc file.

5.RUNINSTALLER

This will open a GUI window:

(f7q21-08) [SID: blfxdev2]/var/opt/oracle/product/Disk1>./runInstaller
Starting Oracle Universal Installer...

Checking installer requirements...

Checking operating system version: must be 5.6, 5.7, 5.8, 5.9 or 5.10. Actual 5.9
Passed

Checking Temp space: must be greater than 250 MB. Actual 27549 MB Passed
Checking swap space: must be greater than 500 MB. Actual 29116MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 256 Passed

All installer requirements met.

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2009-08-20_11-15-44AM. Please wait ...(f7q21-08) [SID: blfxdev2]/var/opt/oracle/product/Disk1>Oracle Universal Installer, Version 10.1.0.4.0 Production
Copyright (C) 1999, 2005, Oracle. All rights reserved.

Warning: Cannot convert string "-monotype-arial-regular-r-normal--*-140-*-*-p-*-iso8859-1" to type FontStruct



Just ensure that installed product show the binaries installed


Here ensure that when you click on the Installed product (as shown above in the screen shot ) you find the Oracle products installed. If no check path of inventory_loc your file’s /var/opt/oracle/oraInst.loc and ensure that it is not corrupted. Other wise change this to path of $ORACLE_HOME/oraInventory

f11u30-06:sdas> more oraInst.loc
#Oracle Installer Location File Location
#Mon Jun 08 23:20:57 GMT 2009
inst_group=dba
inventory_loc=/var/opt/oracle/oraInventory


Also ensure that the Destination PATH taken while installation is your ORACLE_HOME and source PATH is file patchset_directory/Disk1/stage/products.xml(here my pathset_directory is /var/opt/oracle/product).


Here as shown in the above diagram, path will be the path of the product that needs to be installed. Here in this case it is /d2100/var/opt/oracle/product/stage/product.xml

At the destination side path will be the path of your old binaries. Here in this case this is ORACLE_HOME.

$ORACLE_HOME=/var/opt/oracle/product/9.2.0.5

Here once you click NEXT installer check the components present at the ORACLE_HOME location.




As shown above, the installer checks for the oracle components that are installed in the database. If the upgraded version is already installed then, an error will be popped up telling that the patchset is already applied.
Otherwise the product component will start loading on the server. Once this completes to 100% then we will get an overall statistics.

Next we will start the upgradation.

d. At last when the upgradation of binaries completes before which, you will be asked to run root.sh by the root user.
Run this file by root user otherwise contact unix SA’s
/d2100/var/opt/oracle/product/9.2.0.5.0/root.sh

Output of the root.sh
----------------------------

Running Oracle9 root.sh script...

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /var/opt/oracle/product/9.2.0.5.0

Enter the full pathname of the local bin directory: [/usr/local/bin]:
bash-2.05# /d2100/var/opt/oracle/product/9.2.0.5.0/root.sh
Running Oracle9 root.sh script...

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /var/opt/oracle/product/9.2.0.5.0

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y
Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y
Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y
Copying coraenv to /usr/local/bin ...

Adding entry to /var/opt/oracle/oratab file...
Entries will be added to the /var/opt/oracle/oratab file as needed by
Database Configuration Assistant when a database is created
chmod: WARNING: can't access /var/opt/oracle/product/9.2.0.5.0/dbs/initbillprd1.ora
chmod: WARNING: can't access /var/opt/oracle/product/9.2.0.5.0/dbs/orapwbillprd1
chmod: WARNING: can't access /var/opt/oracle/product/9.2.0.5.0/rdbms/filemap
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.



STEP 7: DATABASE UPGRADE
a.Check SYSTEM Tablespace Size
Here as a pre-requisite we need to ensure that there is at least 10 MB of free space allocated to the SYSTEM tablespace. If not we need to add some space to system tablespace.
Next, check for SHARED_POOL_SIZE and JAVA_POOL_SIZE Initialization Parameters

b.Check java_pool_size:
show parameter java_pool_size

Here if required increase the size of java_pool_size:

alter system set java_pool_size=’150M’ scope=spfile;

c.check shared_pool_size
show parameter shared_pool_size

Here if required increase the size of shared_pool_size


alter system set shared_pool_size =’150M’ scope=spfile;

d.If the system uses an initialization parameter file then change the value of these parameters in the pfile (initsid.ora)

Shut down the database: shut down immediate
Startup pfile=
Create spfile form pfile;
Shut immediate
Startup

Now ensure that the changes done in the pfile are getting reflected in the spfile
show parameter java_pool_size
show parameter shared_pool_size



e. Now we are ready for the upgradation as the pre check has completed.

First startup the data



Startup the database in migrate mode:
Startup migrate;

Once the database is started in migrate mode, we need to run catpatch.sql script.

Before running take a spool file
SQL> SPOOL patch_blfxenv1.log
SQL> @?/rdbms/admin/catpatch.sql
SQL> SPOOL OFF


I am attaching below log file that comes up on running the catpatch.sql script.



Once the catpatch finishes the last few lines will show you as given below:


Output file will show as given below

COMP_NAME STATUS VERSION
----------------------------------- ----------- ------------------------------
Oracle9i Catalog Views VALID 9.2.0.7.0
Oracle9i Packages and Types VALID 9.2.0.7.0
JServer JAVA Virtual Machine VALID 9.2.0.7.0
Oracle XDK for Java VALID 9.2.0.9.0
Oracle9i Java Packages VALID 9.2.0.7.0


f.INVALID OBJECTS

Check all the invalid objects in the database. We should always run the utlrp utility once the upgrade completes.

To check the invalid objects in the database:
SQL>select * from dba_objects where status='INVALID'

Compile all the invalid objects in the database.
SQL>@?/rdbms/admin/utlrp


This completes the upgradation of the database from 9.2.0.5.0 to 9.2.0.7.0



g.CONFIRMATION

TO confirm the version of the several components installed in the database, query dba_registry

SQL> select COMP_NAME,VERSION from dba_registry;


COMP_NAME VERSION

Oracle9i Catalog Views 9.2.0.7.0
Oracle9i Packages and Types 9.2.0.7.0
JServer JAVA Virtual Machine 9.2.0.7.0
Oracle XDK for Java 9.2.0.9.0
Oracle9i Java Packages 9.2.0.7.0


ORA-16014: log n sequence# not archived, no available destinations


Recently i created a standby database but soon at the primary side started seeing the below error:


Thu May 3 15:09:42 2012
Errors in file /app/oracle/admin/orcl/trace/bdump/orcl_arc1_246675.trc:

ORA-16014: log 9 sequence# 269 not archived, no available destinations
ORA-00312: online log 9 thread 1: '/ora03/oradata/orcl/redo_stby/orcl_redo_g9m1.rdo'
ORA-00312: online log 9 thread 1: '/ora04/oradata/orcl/redo_stby/orcl_redo_g9m2.rdo'

Similarly

Thu May 3 15:19:52 2012

ORACLE Instance orcl - Archival Error
Thu May 3 15:19:52 2012
ORA-16014: log 10 sequence# 270 not archived, no available destinations
ORA-00312: online log 10 thread 1: '/ora01/oradata/orcl/redo_stby/orcl_redo_g10m1.rdo'
ORA-00312: online log 10 thread 1: '/ora02/oradata/orcl/redo_stby/orcl_redo_g10m2.rdo'

and


Thu May 3 15:22:29 2012
ORACLE Instance orcl - Archival Error
Thu May 3 15:22:29 2012
ORA-16014: log 6 sequence# 272 not archived, no available destinations
ORA-00312: online log 6 thread 1: '/ora01/oradata/orcl/redo_stby/orcl_redo_g6m1.rdo'
ORA-00312: online log 6 thread 1: '/ora02/oradata/orcl/redo_stby/orcl_redo_g6m2.rdo'

To resolve this i found that the redo log groups  6,9,10 were that of standby so only option i had to get rid of these errors was to clear these unarchived redo groups.

So i did the below:
alter database clear unarchived logfile group 6;
alter database clear unarchived logfile group 9;

alter database clear unarchived logfile group 10;
Once i cleared these unarchived standby redo logs , i did not see them again :)