Wednesday, 14 March 2012

Changing an IP address SCAN listener and VIP in Oracle 11G


This is a quick and dirty way to modify the SCAN listener, Public IP and Virtual IP for an Oracle 11G
database

This change was carried out on Linux OS but is applicable to most *nix
As Grid owner
 . oraenv
/oifcfg getif 
crsctl stat res -t
srvctl stop instance -d testdb -i testdb1
srvctl stop instance -d testdb -i testdb2

* If CRS is on ASM disks shutdown CRS first as root on both nodes -- crsctl stop crs

srvctl stop asm -n plrac2 -f
crsctl stat res -t
srvctl disable database -d testdb
srvctl disable nodeapps


Modify /etc/hosts
ifdown eth0
modify ip address: vi /etc/sysconfig/network-scripts/ifcfg-eth0
ifup eth0
confirm changes: ifconfig -a

========================================================================

SCAN Listener:

AS grid owner
$ ./srvctl stop scan_listener
$ ./srvctl stop scan
$ ./srvctl config scan

$ ./srvctl remove scan_listener -f

$ exit
exit
#./srvctl remove scan -f
#./srvctl add scan -n plrac_cluster
#./srvctl config scan

#su oracle
$ ./srvctl add scan_listener -p 1521
$ ./srvctl config scan

===============================================================================
As root
srvctl modify nodeapps -n plrac1 -A plrac1/255.255.255.0
srvctl modify nodeapps -n plrac2 -A plrac2/255.255.255.0
./srvctl config scan

verify the changes:
 srvctl config nodeapps -a
./srvctl config scan



as root:
srvctl enable nodeapps
srvctl enable database -d testdb



as grid owner:
srvctl start vip -n plrac1
srvctl start vip -n plrac2

srvctl start instance -d testdb -n plrac1
srvctl start instance -d testdb -n plrac2

Migrate Oracle 10.2.0.3 to Oracle 10.2.0.5


The following are the steps performed to migrate a database from 10.2.0.3 to 10.2.0.5
  

  •      Download oracle installables (Software, 10.2.0.5 Patchset)
  •      Install new oracle home. 
  •      Migrate ASM instance and database to new Oracle home.
  •      Upgrade database to 10.2.0.5

       *** Please note. ASM is started in a non-open state and consequently does not need to be upgraded after    moving the necessary files.

Download oracle installable files (Software, 10.2.0.5 Patchset)

Download the files to a location with enough space to contain the zipped files .
After the download the installables should be unzipped and renamed (It’s a personal thing, but I like to do this to know what the folders contain).

Install and upgrade new oracle home

The new oracle home can be installed following the usual steps using Oracle’s runInstaller utility after performing the pre-installation tasks.
Following the successful installation, the 10.2.0.5 patch was applied to the home using the runInstaller utility located in the patch folder and selecting the home to upgrade.

Migrate ASM and database to new Oracle home.

·         shutdown all database instances and afterwards ASM
·         stop listener(s)
·         change the entries in oratab
·         Since this is ASM the files(control and data) are located in a centralized location and do not need to be moved.
·         copy and modify init.ora for relevant databases and ASM
·         copy/move password files to new home
·         copy/move tnsnames and sqlnet.ora to new ORACLE_HOME location
·         startup ASM and migrated database to confirm that the change took effect.
·         Shutdown database




Upgrade Database to 10.2.0.5

Usually the Oracle Database Upgrade Assistant (DBUA) will be run from the new oracle home to upgrade the selected database. However sometimes  due to network issues, the upgrade can be run manually. See below:
  1. Start the database in the UPGRADE mode:
SQL> STARTUP UPGRADE
  1. Set the system to spool results to a log file for later analysis:
SQL> SPOOL upgrade_info.log
  1. Run the Pre-Upgrade Information Tool:
SQL> @/rdbms/admin/utlu102i.sql
  1. Turn off the spooling of script results to the log file:
SQL> SPOOL OFF

5.       Enter the following SQL*Plus commands:

SQL> SPOOL patch.log
SQL> @?/rdbms/admin/catupgrd.sql

This was run in nohup mode i.e.

SQL> nohup sqlplus "/ as sysdba" @?/rdbms/admin/catupgrd.sql &
SQL> SPOOL OFF

6.       Restart the database:

SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP

7.       Run the utlrp.sql script to recompile all invalid PL/SQL packages now instead of when the packages are accessed for the first time. This step is optional but recommended.
SQL> @?/rdbms/admin/utlrp.sql

8.       Run the following command to check the status of all the components after the upgrade:
SQL> SELECT COMP_NAME, VERSION, STATUS FROM SYS.DBA_REGISTRY;