# Log in as 'oracle', the owner of the 11g Database software.
su - oracle

# Set up your environment to reference the 11g installation.
     
export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1
# Put ORACLE_HOME/bin first, in case 10g bin is already in the path.
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_SID=orcl
     
# Copy the modified 10g PFILE to the 11g ORACLE_HOME dbs directory.
cp /u01/app/oracle/product/10.2.0/db_1/dbs/initorcl.ora /u01/app/oracle/product/11.1.0/db_1/dbs

# Start up in upgrade mode, using the modified PFILE.
echo "STARTUP UPGRADE PFILE='/u01/app/oracle/product/11.1.0/db_1/dbs/initorcl.ora'" | sqlplus / as sysdba

# Go to the 11g $ORACLE_HOME/rdbms/admin directory.
cd $ORACLE_HOME/rdbms/admin

# Log in to sqlplus.  SPOOL output to a log file (if you like, you can specify
# the path for a log file to be created in the upgrade staging
# directory you created (or the workbook lab directory, if you prefer))
# Begin the upgrade.

echo -e "SPOOL upgrade.out\n@catupgrd.sql" | sqlplus / as sysdba

# After the upgrade completes, the database will shut down.

# Carefully review the contents of your upgrade log.  If there were any
# errors, you can attempt to correct them and re-run the upgrade script.
