Oracle Cross-Version upgrade

Source: Internet
Author: User
Tags sqlplus

Cross-Version upgrade (10.2.0.5 upgrade to 11.2.0.3)
10.2.0.5 version: Oracle_base:/oracle/u01/app/oracle
Oracle_home:/oracle/u01/app/oracle/product/10.2/db_1
11.2.0.3 version: Oracle_base:/oracle/u02/app/oracle
Oracle_home:/oracle/u02/app/oracle/product/10.2/db_1

Description: New 11g software to hang up the original 10g library.

Upgrade steps:
1, pre-upgrade to confirm that the database has been fully backed up, if not to do the backup, do not upgrade.
2, feasibility issues, can upgrade? What are the requirements for upgrading? Does the application support the new version? Pre-migration to see if your app meets your needs?
Look at the upgrade diagram first to see if you can upgrade, higher than 10.2.0.2 to upgrade directly to the 11GR2 version.
3, install the high version of the database to the new installation directory, in this case, the/oracle/u02/app/oracle directory.
4. Start the original database, create the Pfile file A.txt, and store the file in/tmp.
5, run pre-upgrade script (recommended script), 11g version run Oracle_home/rdbms/admin/utlu112i.sql script. Note: Oracle_home is the installation directory for ORACLE software.
6. Modify the/tmp/a.txt file according to the script suggestion, modify the table space size, empty the Recycle Bin, collect the statistic information.
7, close the original database related applications, close the database.
8, with orcle users copy the lower version of the installation directory Oracle_base/admin folder to 11g under the oracle_base.
9. Modify the Oracle user environment variables to modify oracle_base and Oracle_home to the high version installation directory.
10. Use the root user to modify the/etc/oratab file and the/etc/orainst.loc file to modify the associated path to the new version of the path.
11. Use the/tmp/a.txt parameter file to start the database to upgrade mode, rebuild the SPFile file, run the upgrade script to upgrade the database. The database shuts down automatically when the upgrade is complete.
12. Rebuild the Orainventory directory after the upgrade is complete.
13, delete the original software installation directory.

Specific implementation:
1. Check that the database is fully backed up, and do not upgrade if you do not have a backup.
2, study the feasibility of upgrading, confirm the following questions.
Can the database be upgraded?
What are the requirements for upgrading?
Does the application support a new version of the database?
Do a pre-migration to see if your app meets your needs.
Find information (official documentation) to see if it can be upgraded, and a version higher than 10.2.0.2 can be upgraded directly to the 11GR2 version.
The above questions can only be upgraded if they are confirmed to be feasible.
3, install the high version of the database to the new installation directory, in this case, the/oracle/u02/app/oracle directory.
Note: oracle11g upgrade to a new installation, upgrading from a low version (9i or 10g) to 11g or from a 11g to a low version to a 11g high version is a fresh installation.
4. Start the original database and create the Pfile file (/tmp/a.txt).
Note: The Pfile file is a database parameter file, which records the PGA, SGA, control file location and other information of the database. Used when starting the database.
The purpose of creating the Pfile file here is to start the original database with the new version of the database software.
Oracle User Login system, link database.
Sqlplus/as Sysdba; Note: The Oracle user executes this command to link to the database.
Sql> Startup Note: Start the database and will error if the database is already started.
sql> create pfile= '/tmp/a.txt ' from SPFile; Note: Create a new parameter file/tmp/a.txt
5, run the pre-upgrade script (recommended script), the role of the script is to check the database upgrade when the parameters need to be modified.
sql> spool/tmp/test.txt Note: Open spool to store the SQL statements and results executed after the command in the/tmp/test.txt file.
Sql> @/oracle/u02/app/oracle/product/10.2/db_1/rdbms/admin/utlu112i.sql
Sql> spool off;
6, view the/tmp/test.txt file, modify the/tmp/a.txt file according to the prompt, modify the tablespace size, empty the Recycle Bin, collect statistics.
To modify the/tmp/a.txt file:
Delete all rows beginning with the original instance name.
Deletelines starting with the. Background_dump_dest
Delete
Lines starting with the. User_dump_dest
Deletelines starting with the. Core_dump_dest
Add
. diagnostic_dest= '/oracle/u02/app/oracle '
Increase the Sga_target and Pga_aggregate_target parameter sizes as recommended in the/tmp/a.txt file.
Modifythe value of the. Compatible:. compatible= ' 11.2.0.0.0 '
Modifypath to the. Audit_file_dest:. audit_file_dest= '/oracle/u02/app/oracle/admin/fsdb/adump '
Modifies the size of the table space.
Sql> select file_name,tablespace_name,bytes/1024/1024 from Dba_data_files; View the size of each tablespace data file.
Sql> select file_name,tablespace_name,bytes/1024/1024 from Dba_temp_files; View the data file size for the temp table space.
sql> ALTER DATABASE datafile '/ORADATA/FSDB/SYSAUX01.DBF ' resize 500M; Modify the Sysaux tablespace data file size to 500M.
sql> ALTER DATABASE tempfile '/ORADATA/FSDB/TEMP01.DBF ' resize 400M; Modify the Temp table spatial data file size to 400M.
Empty the Recycle Bin:
Sql> purge Dba_recyclebin;
Sql> purge User_recyclebin;
Collect statistics:
Sql> Execute dbms_stats.gather_dictionary_stats;
Specifically modified to be much more than the recommended modifications in accordance with the/tmp/test.txt file.
7. Close the application and close the original database.
sql> shutdown immediate;
8, Oracle User copy oracle10g oracle_base directory under the Admin folder under the Oracle_base under 11g.
Cp-r/oracle/u01/app/oracle/admin/oracle/u02/app/oracle
9. Oracle user modifies the environment variables of Oracle user and modifies Oracle_home and oracle_base to the 11g installation directory.
Vi/home/oracle/.bash_profile Note: Edit environment variables for Oracle users
Export Oracle_base=/oracle/u02/app/oracle
Export Oracle_home=/oracle/u02/app/oracle/product/10.2/db_1 Note: The following two behavior modified content
10, using the root user to modify the/etc/oratab file and the/etc/orainst.loc file, the relevant path is modified to 11g path.
Vi/etc/oratab Note: Modify the/etc/oratab file, which is related to whether the Oracle database is booted.
Fsdb:/oracle/u02/app/oracle/product/10.2/db_1:n Note: Make a change to the line and change the path to 11g.
Vi/etc/orainst.loc Note: Modify the/etc/orainst.loc file, which controls the Orainventory storage path.
Inventory_loc=/oracle/u02/app/oracle/orainventory Note: Modify the Orainventory storage path to a path of 11g.
11, use the/tmp/a.txt parameter file to start the database to upgrade mode, create a new SPFile file, run the upgrade script. The database shuts down automatically when finished.
Oracle user logs on to an empty instance. Sqlplus/as SYSDBA
sql> startup upgrade pfile= '/tmp/a.txt '; Note: Use the/tmp/a.txt parameter file to start the database to upgrade mode.
Sql> create SPFile from pfile= '/tmp/a.txt '; Note: Create a new SPFile file to make it easier to start the database later.
Sql> @?/rdbms/admin/catupgrd.sql Note: Perform an upgrade script to complete the upgrade of the database.
12, rebuild the Orainventory directory.
ORACLE user to $oracle_home/oui/bin directory, execute the following command;
./runinstaller-slient-attachhome oracle_home= "/oracle/u02/app/oracle/product/10.2/db_1" ORACLE_HOME_NAME= " Oraclehome ";
Note: Oracle_home for 11g software can be arbitrarily specified oracle_home,oracle_home_name, no impact.
Restart the database after execution, view the database version, and see if the database is healthy.
13. Delete the installation directory of 10g database after confirming normal error.

Oracle Cross-Version upgrade

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.