Monday, September 26, 2011

How to Upgrade Oracle Database Release 10.2.0.1 to 10.2.0.4

In the name of God, Most Gracious, Most Merciful.

In this article i will describe "How to upgrade Oracle Database Release 10.2.0.1 to 10.2.0.4" on Red Hat Linux 5.3 OS. For this you have to download patch number 6810189 from Oracle Metalink site.

Export ORACLE_HOME and ORACLE_SID environment variables

export ORACLE_HOME=/u01/oracle/product/10.2/db_1
export ORACLE_SID=db10g

Stop Oracle Instance

$ isqlplusctl stop
$ emctl stop agent
$ /u01/oracle/product/10.2/grid/oms10g/opmn/bin/opmnctl stopall
$ sqlplus / as sysdba
  shutdown immediate;
  exit;
$ lsnrctl stop

Backup the control files, data files, redolog files, undo files and spfile.

Run Installer as follows

$ /u01/p6810189/Disk1/runInstaller

Figure - 1

Click Next

Figure - 2

Select Oracle Home and Path to Upgrade and Click Next.

Figure - 3

Click Next.

Figure - 4

Click Next.

Figure - 5
Review the Summary Information and Click Install.

Figure - 6

View Progress.

Figure - 7

Open a new terminal, login with root user and run the script above. After that click Ok Button

Figure - 8

Click Exit to Finish Installation. On a terminal window login with oracle user and run dbua command

$ dbua

Figure - 9

Click Next.

Figure - 10

Select the database you want to upgrade and click Next.

Figure - 11

In this scenario although it is not required but select "Move Database Files during Upgrade" and click Next.

Figure - 12

Click Next.

Figure - 13

If you have multiprocessors that you can select a higher degree of Parallelism to speed up compilation process. Click Next.


Figure - 14

If you have already backed up that database then Click Next. Otherwise choose "I would like this tool to back up the database" option and Click Next.

Figure - 15

Select Flash Recovery Area and Size and Click Next.

Figure - 16

Review Summary and Click Finish.

Figure - 17

View Progress.

Figure - 18

View Progress.

Figure - 19

View Progress.

Figure - 20

Upgrade Results are displayed.

Insha-Allah this will help and serve the purpose. For any corrections and improvements please suggest.

Wednesday, September 21, 2011

Oracle Management Agent 10g Release 2 Installation on Red Hat Linux 5.3

In the name of God, Most Gracious, Most Merciful.

In this article i will describe the installation of Oracle Management Agent 10g Release 2 on Red Hat Linux 5.3 OS on a machine other then the Enterprise Manager Grid Control machine. The per-requisites of this installation is Oracle Enterprise Manager 10g Grid Control R2. You can find its installation here. Before any proceedings with installation make sure that C library RPMs are installed. 

Unzip the installer and run runInstaller script as shown in figure below.
Figure - 1

You will see following screen after the OS check is passed.

Figure - 2

Select "Additional Management Agent" option on the screen and press Next button.

Figure - 3

Provide parent directory path. Agent home directory will be created by installer i.e. agent10g. Press Next button.

Figure - 4

View progress.

Figure - 5

All checks should be passed if not then please check the log file and try to fix the issues. Press Next button.

Figure - 6

Provide the host name and port of the Management Service. If it is not already installed then you have to install it first. Please find the installation here. Press Next button.

Figure - 7

Provide the password of the Management Service and press Next button.

Figure - 8

Review the summary and press Install button.

Figure - 9

View progress.

Figure - 10

View progress.

Figure - 11

Make directory for agent files in /usr/local/bin directory and run the script with root user as shown in the figure below. Once script is executed press the OK button on above screen.

Figure - 12

Figure - 13

View agent Configuration.
Figure - 14
Click the exit button.

You can view the status of the agent by entering following commands.

$ $AGENT_HOME/bin/emctl status agent

You will find that "Agent is Running but not ready". Don't worry just wait some time and it will be ready. Get the "Agent URL" from the output of above command and run it in a browser. It will show that Agent is Running. Now get the "Repository URL" from the output of above command and run it in a browser. It will show that HTTP Receiver Servlet active. Now check "Last successful heartbeat to OMS" from the output of above command if it is valid time then configuration is successful. If your browser is unable to run "Repository URL" then make sure that /etc/hosts file contain the entry of "Repository URL" machine.

Now stop the agent and apply p4716787_10201_GENERIC.zip Patch as shown in figure below.

Figure - 15

Now start the agent again and your host will be visible on Enterprise Manager Grid Control.

Insha-Allah this will help and serve the purpose. For any corrections and improvements please suggest.

Friday, September 16, 2011

How to fix "MAX_TRANSFER_UNIT inet6 addr"

In the name of God, Most Gracious, Most Merciful.

In this article i will be listing steps to fix "MAX_TRANSFER_UNIT inet6 addr" issue. This issue arises after installation of Grid Control 10g Release 2 on Linux Red Hat 5.0/5.3. This is due to
change in the output of /sbin/ifconfig -a command. To fix this issue just use following steps.

Step 1. Stop Management Agent.


$/u01/oracle/prdocut/10.2.0/grid/agent10g/bin/emctl stop agent

Step 2. Download p4716787_10201_GENERIC.zip Patch and use following script to apply this patch.

$ export ORACLE_HOME=/u01/oracle/product/10.2.0/grid/agent10g
$ cd /tmp
$ unzip p4716787_10201_GENERIC.zip
$ cd /tmp/4716787
$ $ORACLE_HOME/OPatch/opatch apply



Figure - 1




Step 3. Start Management Agent.

$/u01/oracle/prdocut/10.2.0/grid/agent10g/bin/emctl start agent
Insha-Allah this will help and serve the purpose. For any corrections and improvements please suggest.
 

How to fix "FREQUENCY_IN_MHZ PERR is not numeric"

In the name of God, Most Gracious, Most Merciful.

In this article i will be listing steps to fix "FREQUENCY_IN_MHZ <PERR- is not numeric" issue. This issue arises after installation of Grid Control 10g Release 2 on Linux Red Hat 5.0/5.3. This is due to getting hardware detail with incorrect case of string i.e. searching "Mhz" instead of "MHz" in Ptdpm1.pm file. To fix this issue just use following steps.


Step 1. Stop Grid Control Services.



$/u01/oracle/prdocut/10.2.0/grid/agent10g/bin/emctl stop agent
$/u01/oracle/prdocut/10.2.0/grid/oms10g/opmn/bin/opmnctl stopall

Step 2. Take Backup of files which are searching for "Mhz" string.

$ mkdir -p /tmp/agent/backup


$ mkdir -p /tmp/oms/backup
$ cp /u01/oracle/product/10.2.0/grid/agent10g/sysman/admin/scripts/Ptdpm1.pm /tmp/agent/backup/Ptdpm1.pm 
$ cp /u01/oracle/product/10.2.0/grid/oms10g/sysman/admin/scripts/Ptdpm1.pm /tmp/oms/backup/Ptdpm1.pm


Step 3. Search for "Mhz" in following files and update with "MHz".
/u01/oracle/product/10.2.0/grid/agent10g/sysman/admin/scripts/Ptdpm1.pm
/u01/oracle/product/10.2.0/grid/om10g/sysman/admin/scripts/Ptdpm1.pm

Step 4. Start Grid Control Services.


$/u01/oracle/prdocut/10.2.0/grid/oms10g/opmn/bin/opmnctl startall
$/u01/oracle/prdocut/10.2.0/grid/agent10g/bin/emctl start agent


Insha-Allah this will help and serve the purpose. For any corrections and improvements please suggest.

How to fix "tail: cannot open `+2' for reading: No such file or directory"

In the name of God, Most Gracious, Most Merciful.

In this article i will be listing steps to fix "tail: cannot open `+2' for reading: No such file or directory" issue. This issue arises after installation of Grid Control 10g Release 2 on Linux Red Hat 5.0/5.3. This is due to old syntax of tail command used in script files trying to get Hardware details. To fix this issue just use following steps.


Step 1. Stop Grid Control Services.


$/u01/oracle/prdocut/10.2.0/grid/agent10g/bin/emctl stop agent
$/u01/oracle/prdocut/10.2.0/grid/oms10g/opmn/bin/opmnctl stopall

Step 2. Take Backup of files which are using old syntax of tail command.


$ mkdir -p /tmp/agent/backup
$ mkdir -p /tmp/oms/backup
$ cd /u01/oracle/product/10.2.0/grid/agent10g/sysman/admin/scripts
$ for file in *; do if grep -i -l "tail +" "$file"; then cp "$file" /tmp/agent/backup/ ;fi; done

$ cd /u01/oracle/product/10.2.0/grid/oms10g/sysman/admin/scripts
$for file in *; do if grep -i -l "tail +" "$file"; then cp "$file" /tmp/oms/backup/ ;fi; done

Step 3. Update files of agent and oms

$ cd /u01/oracle/product/10.2.0/grid/agent10g/sysman/admin/scripts
$ mkdir -p /tmp/agent/modified 
$ for file in *; do if grep -i -l "tail +" "$file"; then cp "$file" /tmp/agent/ && sed -e 's/tail +/tail -n +/g' /tmp/agent/$file > /tmp/agent/modified/$file; cp /tmp/agent/modified/* .;fi; done

$ for file in *; do if grep -i -l "tail +" "$file"; then cp "$file" /tmp/agent/ && sed -e 's/TAIL +/TAIL -n +/g' /tmp/agent/$file > /tmp/agent/modified/$file; cp /tmp/agent/modified/* .;fi; done

$ cd /u01/oracle/product/10.2.0/grid/oms10g/sysman/admin/scripts

$ mkdir -p /tmp/oms/modified 

$ for file in *; do if grep -i -l "tail +" "$file"; then cp "$file" /tmp/oms/ && sed -e 's/tail +/tail -n +/g' /tmp/oms/$file > /tmp/oms/modified/$file; cp /tmp/oms/modified/* .;fi; done



$ for file in *; do if grep -i -l "tail +" "$file"; then cp "$file" /tmp/oms/ && sed -e 's/TAIL +/TAIL -n +/g' /tmp/oms/$file > /tmp/oms/modified/$file; cp /tmp/oms/modified/* .;fi; done

Step 4. Start Grid Control Services.


$/u01/oracle/prdocut/10.2.0/grid/oms10g/opmn/bin/opmnctl startall
$/u01/oracle/prdocut/10.2.0/grid/agent10g/bin/emctl start agent





Insha-Allah this will help and serve the purpose. For any corrections and improvements please suggest.





Thursday, September 15, 2011

Oracle Enterprise Manager 10g Grid Control Release 2 10.2.0.1.1 Installation On Red Hat Enterprise Linux 5.3

In the name of God, Most Gracious, Most Merciful.

In this article I will describe the installation of Oracle Enterprise Manager 10g Grid Control Release 2 10.2.0.1.1 installation On Red Hat Enterprise Linux 5.3. Before any proceedings with installation make sure that C library RPMs are installed.
Oracle Enterprise Manager 10g Grid Control Release 2 10.2.0.1.1 has four main components
  1. Enterprise Manager
  2. Management Service
  3. Management Repository
  4. Management Agent
In this article i am using already installed Oracle Database 10g Release 2 10.2.0.1.0 as Management Repository and its guide is available here. You can first install Management Repository Database by using this guide or if you are planning to use already installed database on some other machine then you can make user accounts and kernel parameters from the mentioned guide if required.
Prerequisites

  1. Make Sure that database control is de-configured from Management Repository Database.
  2. Parameter session_cached_cursors must be greater then or equal to 200.
  3. Package DBMS_SHARED_POOL should be executed on Management Repository Database.
  4. Grant execute on UTL_FILE to public.

Make Sure that database control is de-configured from Management Repository Database.
execute following script by "oracle" user


cd $ORACLE_HOME/bin
emca -deconfig dbcontrol db -repos drop


Figure - 1



if you haven't de-configured database control then you will receive following error during installation.


Figure -2













Check/Change session_cached_cursors parameter by executing following script.



sqlplus / as sysdba
show parameter session_cached_cursors

if value < 200 then execute following script


create pfile from spfile;
alter system set session_cached_cursors=200 scope=spfile;
shutdown immediate;
startup;


These steps are shown in following figure.


Figure - 3


Package DBMS_SHARED_POOL should be executed. You can check it by executing following query.


select count(*) from dba_objects
where object_name = 'DBMS_SHARED_POOL'
and object_type in ('PACKAGE', 'PACKAGE BODY');


Verify that its result is 2 otherwise execute following script.

@<ORACLE_HOME>/rdbms/admin/dbmspool.sql


This steps are shown in following figure.


Figure - 4


Execute following script.


Grant execute on UTL_FILE to public;
 


Installation


Now make directories for Enterprise Manager Installation and change ownership of these directories to “oracle” user by running following script.


mkdir –p /u01/oracle/product/10.2.0/grid

chown –R oracle:oinstall /u01
Figure - 5

Add following oracle variables in /home/oracle/.bash_profile by switching to oracle user.

export ORACLE_BASE=/u01/oracle

export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/grid
Figure - 6
make these changes permanent by executing following script.
cd ~
. ./.bash_profile

Figure - 7

Copy setup files to /u01/gc_102011_linux

Start Oracle Database installation by running following command

/u01/gc_102011_linux/runInstaller


Select "Enterprise Manager 10g Grid Control Using an Existing Database" radio button and then click Next button on following screen.

Figure - 8
Provide parent directory patch for Oracle Management Server and Agent Homes as shown in screen below.
Figure - 9
Installation starts.
Figure - 10
Make sure that overall result is passed in following screen. If not then make sure that required packages, parameters and Prerequisites are executed correctly. Click Next On following screen.
Figure - 11
Provide Management Repository Database Information in following screen and click Next.

Figure - 12

When you click Next following Warning message will appear click Continue on it.
Figure - 13
Click Next on following screen.

Figure - 14

Enter password information on following screen and click Next.

Figure - 15

Review information on following screen and click Install.

Figure - 16

View progress.

Figure - 17

View progress.

Figure - 18

You will receive following warning message during installation.

Figure - 19

This warning is due to missing library libdb.so.2 which is required to start Oracle HTTP Server. You need to download patch p6078836_101330_Linuxx86.zip containing libdb.so.2 library. Copy this library to /usr/lib/ directory. After this execute following script with oracle user and then click "Continue" on the warning message.

cd $ORACLE_HOME/oms10g/opmn/bin
./opmnctl stopall
./opmnctl startall

View progress.

Figure - 20

View progress.
Figure - 21
Start a Terminal, change user to “root” by using “su – root” command and execute following script.
mkdir -p /usr/local/bin/grid
mkdir -p /usr/local/bin/agent

copy Script Location from following screen to Terminal. Press enter and provide directory location for grid and agent as above.
Figure - 22
View progress

Figure - 23

View progress.

Figure - 24

View progress.

Figure - 25

Open browser and paste the URL of “Enterprise Manager 10g Grid Control URL:” to browser. Provide “sysman” as username and its password and click login.

Figure - 26

Insha-Allah this will help and serve the purpose. For any corrections and improvements please suggest.