--*********************************
--Oracle 10.2.0.1 upgrade to 10.2.0.4
--*********************************
This article is based on the Linux environment Oracle, but and win difference is not very big, commands and so on are the same. I also follow this document when I upgrade. So the enforceability is relatively strong.
Database upgrades are not difficult, as long as they follow their steps, the general problem is small. However, the failure of the upgrade is not uncommon, especially in the production database upgrades, and even to create an Sr.
The following steps to upgrade Oracle 10.2.0.1 to 10.2.0.4 under the Linux (Oracle Linux 5.4/2.6.18-164.EL5PAE) platform are described below.
For download of Oracle Upgrade package, please link to: Oracle Patch complete (Oracle 9i 10g 11g Path)
Note:
Before 9i, regardless of upgrade/downgrade, the database is startup migrate
10g after the addition of upgrade parameters, upgrade can be directly with startup upgrade, demotion is still startup migrate
First, single instance upgrade Prerequisites:
1. Table Space Requirements
To ensure that at least 10M space is available for the system tablespace, the following is a query statement
Col "Tablespace_name" for A20
Col "Usage_percent" for A10
Selectupper (f.tablespace_name) "Tablespace_name"
, D.TOT_GROOTTE_MB "Tablespace_size (M)"
, D.tot_grootte_mb-f.total_bytes "Used_size (M)"
, To_char (Round (d.tot_grootte_mb-f.total_bytes)/d.tot_grootte_mb * 100,
2),
' 990.99 ') "Usage_percent"
, F.total_bytes "Free_size (M)"
From (SELECT tablespace_name
, round (SUM (bytes)/1024/1024) total_bytes
, round (MAX (bytes)/(1024 * 1024), 2) max_bytes
From Sys.dba_free_space
GROUP by Tablespace_name) F
, (SELECT dd.tablespace_name
, round (SUM (bytes)/1024/1024) TOT_GROOTTE_MB
From Sys.dba_data_files DD
GROUP by Dd.tablespace_name) d
WHERE D.tablespace_name = F.tablespace_name
Order By2desc;
2. System Parameters:
Make sure that the parameters shared_pool_size and java_pool_size are greater than 150MB, in order to speed up the upgrade speed, in the case of system memory available, can temporarily increase these 2 parameters
Sql> Show PARAMETER Shared_pool_size
Sql> Show PARAMETER Java_pool_size
sql> altersystemset shared_pool_size= ' 200M ' scope=spfile;
sql> altersystemset java_pool_size= ' 200M ' scope=spfile;
II. implementation of the upgrade
1. Close the instance that needs to be upgraded
Stop instance
Sql> shutdownimmediate
To stop all background processes associated with this instance
Lsnrctl Emctl
2. Backup Oracle home directory and database
TAR-CVF $ORACLE _base/orabak/-Ensure that all ORACLE-related configurations are located in the $oracle_base directory, such as monitoring
CP *.dbf Con*.ora redo*.log/orabak/--cold standby for database implementation
3. Upgrade Software
./runistanller-->oracle Account
root.sh-->root Account
4. Updating the data dictionary
Sql> Startup upgrade
Sql> Spool Patch.log
Sql> @?/rdbms/admin/catupgrd.sql--note 9i Use Catpatch.sql Note: This place also needs to note the actual storage path of the file. )
Sql> Spool Off
5. Re-compile the failed object:
Sql>shutdownimmediate
Sql>startup
Sql>@?/rdbms/admin/utlrp.sql (Note: This local directory according to the actual situation, Rtlrp.sql first to find this file, in the installation of the home directory. )
6. After the upgrade of the detection
Sql>select comp_name,version,status from Sys.dba_registry;
Check the upgrade status of the component
Sql>select * from Utl_recomp_errors;
7. Modify Compatibility parameters
sql> altersystemset compatible= ' 10.2.0.4.0 ' scope=spfile;
8. Restart the database:
Sql> SHUTDOWN
Sql> STARTUP
9. If the recovery directory is used, execute the following command
$ Rman Catalog Username/password@alias
Rman> UPGRADE CATALOG;
10. Upgrade Fallback:
Sql> STARTUP downgrade
Sql> SPOOL Downgrade.log