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
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=
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
No comments:
Post a Comment