# All commands run under the 10g environment.
# Create a staging directory for the upgrade (or, use the workbook lab
# directory if you prefer.)

mkdir ~/upgrade10gorcl11g
cd ~/upgrade10gorcl11g

# Copy the script 'rdbms/admin/utlu111i.sql' from the 11g software home:
cp /u01/app/oracle/product/11.1.0/db_1/rdbms/admin/utlu111i.sql .

# Run the Pre-Upgrade Information Tool script in the 10g instance, saving
# the output to a file.

sqlplus / as sysdba @utlu111i.sql > preupgrade.out

# Alternative, using sqlplus SPOOL command
# echo -e "SPOOL preupgrade.lst\n @utlu111i.sql\n exit" | sqlplus / as sysdba

# Review the results

more preupgrade.out

# For any Warnings, read the Oracle Database 11g Upgrade Guide and study
# how to resolve the issue so the database can be upgraded.

# Shut down your 10g instance.

echo "SHUTDOWN IMMEDIATE" | sqlplus / as sysdba
