重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1202|回复: 1
打印 上一主题 下一主题

手工升级到 Oracle Database 12c r2的路径

[复制链接]
跳转到指定楼层
楼主
发表于 2018-10-24 15:04:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Complete Checklist for Manual Upgrades to Non-CDB Oracle Database 12c Release 2 (12.2) (文档 ID 2173141.1)


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

沙发
 楼主| 发表于 2018-10-24 15:05:30 | 只看该作者
In this Document

Purpose
Scope
Details
Step 1: Upgrade Path for 12.2 Oracle database
Minimum version of the database that can be directly upgraded to Oracle 12c Release 1 (12.2)
Intermediate upgrades needs to be carried for following releases
Step 2: Requirements and recommendations for source database
Step3: Requirements and recommendations for target ORACLE_HOME
Step 4: Check the health of the source database
Step 5: Pre-upgrade checks
Clean up database
Check materialized views
Performance
Checking Time zone settings
Back up the database
Ensure no files are in Back up mode before starting the upgrade
Purge Recycle bin
Save Oracle EM DB Control Configuration and Data
Steps to save data
Manually remove DB control with emremove.sql
Drop JSON-Enabled Context search Indexes
Check the accounts use Case-Insensitive password version
Remove Unified Auditing Schema and Roles
Put Schema based tablespaces offline during upgrade
Preserve Downgrade capability
Audit table preupgrade requirements
Cluster DB Requirements
Other Checks
Step 6: Preupgrade step
Dependencies on Network Utility Packages
Check Time zone version
Step7: Upgrade Database to 12.2
Step 8: Post-upgrade
Setting Environment variables on Linux and Unix
Update oratab entries
Post-upgrade fixup script
Upgrading Tables Dependent on Oracle-Maintained Types
Enabling the New Extended Data Type Capability
Recovery Catalog Upgrade
Upgrade the Time Zone File Version After Upgrading Oracle Database
Upgrading Statistics Tables
Upgrade Externally Authenticated SSL Users
Install Oracle Text Supplied Knowledge Bases After Upgrading Oracle Database
Update Oracle Application Express Configuration After Upgrading Oracle Database
Configure Access Control Lists (ACLs) to External Network Services
Enabling Oracle Database Vault After Upgrading Oracle Database
Check for the SQLNET.ALLOWED_LOGON_VERSION Parameter Behavior
Known issues
References


Applies to:  Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Cloud Exadata Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Information in this document applies to any platform.
Purpose This document is created for use as a guideline and checklist when manually upgrading from Oracle 10gR2 (10.2) , Oracle 11gR1 (11.1) or Oracle 11gR2 (11.2) or Oracle 12c Release 1 (12.1) to Oracle 12c Release 2 (12.2)
Scope Database Administrators, Support
DetailsStep 1: Upgrade Path for 12.2 Oracle databaseMinimum version of the database that can be directly upgraded to Oracle 12c Release 1 (12.2)
Source DatabaseTarget Database
11.2.0.3 / 11.2.0.412.2.x
12.1.0.1 / 12.1.0.212.2.x
Intermediate upgrades needs to be carried for following releases
Source Database Intermediate upgrade path Target database
11.2.0.1 / 11.2.0.2-->11.2.0.4-->12.2.x
11.1.0.6 / 11.1.0.7-->11.2.0.4-->12.2.x
10.2.0.2/10.2.0.3/10.2.0.4/10.2.0.5-->11.2.0.4 / 12.1.0.2-->12.2.x
10.1.0.5-->11.2.0.4 / 12.1.0.2-->12.2.x
9.2.0.8-->11.2.0.3 / 11.2.0.4-->12.2.x
For example
  • If you are upgrading from release 11.2.0.2 or 11.1.0.7, then you must first upgrade to Oracle Database 11g release 2 (11.2.0.4).
  • If you are upgrading from release 10.2.0.2, 10.2.0.3, 10.2.0.4,10.2.0.5 or 10.1.0.5, then you must first upgrade to release 11.2.0.4 or 12.1.0.2.
  • If you are upgrading from release 9.2.0.8, then you must first upgrade to a sequence of intermediate Oracle Database releases:
Upgrade from release 9.2.0.8 to release 11.2.0.3 or 11.2.0.4. Then upgrade from release 11.2.0.4 to 12.2
Step 2: Requirements and recommendations for source database
  • Take a cold or hot back up of the source database.
  • Disable any custom triggers that would get executed before / after DDL. You can enable it once upgrade is completed.
  • Data security roles defined in a release 11g Oracle Database instance are not automatically converted to ORAS. Before you upgrade an 11g database to Oracle Database 12c, you must delete any data security roles that are defined in the 11g database. After the upgrade, you may use Analytic Workspace Manager 12c to define the data security roles again.
  • If you upgrade an 11g database to Oracle Database 12c without deleting the 11g data security roles, then any data security policies that include a data security role are invalid in the Oracle Database 12c database.
  • Timezone should less than or equal to target database timezone version.
  • IF APEX is installed then it is recommended to upgrade APEX in the source DB first before upgrading DB

Step3: Requirements and recommendations for target ORACLE_HOME
  • Verify the whether your operating system is certified for 12.2.  Click here to launch certification portal
  • Install 12.2.0.1, verify there are no installation related issues.
  • Download and install latest PSU if any
  • Copy spfile or pfile from source ORACLE_HOME (under $ORACLE_HOME/dbs) to target home
  • Remove any _parameter, obsolete and deprecated parameters in pfile
  • Note min value of COMPATIBLE parameter to upgrade 12.2 is “11.2.0”, make sure you have COMPATIBLE parameter is set to 11.2.0 or greater
  • Review patch recommendations as given in the article "Patches to apply before upgrading Oracle GI and DB to 12.2.0.1 (Doc ID 2180188.1)"
Step 4: Check the health of the source database
  • Execute dbupgdiag.sql (refer note 556610.1 to download this script) and verify whether there are any INVALID components or objects owned by SYS/SYSTEM. If any, fix them before proceeding to upgrade the database. You can execute utlrp.sql multiple times to VALIDate them, if still objects are INVALID, create a service request with Oracle support.
  • Execute utlrp.sql multiple times and verify there are no INVALID objects.
Step 5: Pre-upgrade checksClean up database
Empty the recycle bin
Check for INVALID objects in SYS and SYSTEM
Check for duplicate objects in SYS and SYSTEM
Check for INVALID, mandatory, obsolete components
Check materialized views
Check the status of all materialized views (MV), and refresh any materialized views that are not fresh.
Check the size of your materialized view logs. If any materialized view logs have non-zero rows, then refresh the base table materialized views.
Check the size of direct loader logs and PMOP logs (partition maintenance operation logs). If any direct loader logs or PMOP logs have non-zero rows, then refresh the MVs indicated by the logs
Before upgrading Oracle Database, you must wait until all materialized views have completed refreshing.

1. Run the following SQL query:
SQL> SELECT o.name FROM sys.obj$ o, sys.user$ u, sys.sum$ s WHERE o.type# = 42 AND bitand(s.mflags, 8) =8;  

Performance
Preserve performance statistics
Check network performance
Gather Optimizer statistics
To decrease the amount of downtime, gather statistics. Oracle recommends that you use the DBMS_STATS.GATHER_DICTIONARY_STATS procedure to gather these statistics. For example, enter the following SQL statement:
SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;
Checking Time zone settingsDefault time zone for Oracle database 12.2 is V26
Time zone should less than or equal to target database time zone version. If source is having higher time zone, then apply time zone patch on target ORACLE_HOME to match the source.
Back up the database
Back up the database, create a guaranteed flashback restore point, or both.
Test your fallback strategies at least once before your upgrade window.
Ensure that you have fallback strategies for issues both during upgrade, and after upgrade.
Connect to RMAN
rman "target / nocatalog"

Execute RMAN command to backup

RUN
{
ALLOCATE CHANNEL chan_name TYPE DISK;
BACKUP DATABASE FORMAT 'some_backup_directory%U' TAG before_upgrade;
BACKUP CURRENT CONTROLFILE FORMAT 'controlfile location and name';
}

Ensure no files are in Back up mode before starting the upgrade
Run the following statement:
SQL> SELECT * FROM v$backup WHERE status != 'NOT ACTIVE';  

Purge Recycle bin
To empty the database recycle bin, run the following command:
SQL> PURGE DBA_RECYCLEBIN
Note: The database recycle bin must be empty during the upgrade process to avoid possible ORA-00600 errors, and to minimize the upgrade time.
Save Oracle EM DB Control Configuration and Data
If you plan to downgrade database after upgrading to 12.2, then before starting the upgrade save the DB Control configuration and data using emdwgrd utility, so that you can restore the files after downgrading.
Steps to save data
1. Install the software for the new Oracle Database 12c release.
2. Set ORACLE_HOME to your old Oracle home.
3. Set ORACLE_SID to the SID of the database being upgraded.
4. Set PATH, LD_LIBRARY_PATH, and SHLIB_PATH to point to the upgraded Oracle Database Oracle home.
5. Change directory to the new Oracle Database release Oracle home.
6. Run emdwgrd
Single-instance databases:
emdwgrd[sh|bat] -save -sid old_SID -path save_directory
Oracle Real Application Clusters (Oracle RAC) databases:
Remote copy must be enabled across all cluster member nodes. Use EM_REMCP environment variable, to indicate which remote copy is configured, for example: export EM_REMCP /usr/bin/scp
emdwgrd -save -cluster -sid old_SID -path save_directory
7. Enter the SYS password for the database that you want to upgrade.
Manually remove DB control with emremove.sql
Stop/shutdown DB control
emctl stop dbconsole
  
Login as sysdba
SQL>SET ECHO ON
SQL>SET SERVEROUTPUT ON
SQL>@emremove.sql >> Script located in new 12c ORACLE_HOME/rdbms/admin
Manually remove ORACLE_HOME/HOSTNAME_SID/ and ORACLE_HOME/oc4j/j2ee/OC4J_DBConsole_HOSTNAME_SID directory from the system
On windows delete DB Console service OracleDBConsoleSID
Drop JSON-Enabled Context search Indexes
If you created a JSON search index using Oracle Database 12c Release 1 (12.1.0.2) then Oracle recommends that you drop that index and create a new search index for use with later releases.
Check the accounts use Case-Insensitive password version
Log in to SQL*Plus as an administrative user, and enter the following SQL query
SELECT USERNAME,PASSWORD_VERSIONS FROM DBA_USERS;
If there are any 10g versions, suggest you to refer Oracle documentation to fix 10g versions, failing to do so, user accounts with LOCKED after upgrade is completed.
Remove Unified Auditing Schema and RolesNote: If you have created AUDIT_ADMIN and AUDIT_VIEWER users or roles with Oracle Database 12c release 1 (12.1) or if the database was created in 12.1, then you do not drop these roles and AUDSYS user.
Log into SQL*Plus as SYS with SYSDBA privilege.  Drop AUDSYS schema if exists. Start DB in migrate mode and drop AUDSYS user
SQL> startup migrate pfile=$T_WORK/t_init1.ora
ORACLE instance started.
SQL> drop user audsys cascade;

Drop AUDIT_ADMIN and AUDIT_VIEWER roles
DROP ROLE AUDIT_ADMIN;
DROP ROLE AUDIT_VIEWER;
Put Schema based tablespaces offline during upgradeNote down the table space names which needs to be offline during upgrade.  Use -T option followed by table space name
dbupgrade –T

Starting with Oracle Database 12c release 2, you can run the Parallel Upgrade Utility with the -T option to have schema-based tablespaces (user tablespaces) taken offline during the upgrade. Taking these tablespaces offline can reduce the necessity of backing up before upgrades. The Parallel Upgrade Utility (catctl.pl) analyzes tablespaces, and automatically selects the right set of tablespaces to set to read only.  The utility does not set to READ ONLY any tablespaces that contain Oracle-Maintained objects
Preserve Downgrade capability
If you have any plans to downgrade the database to its previous version, then you must have patch 20898997 installed in source ORACLE_HOME, else downgrade will not be possible.
On source ORACLE_HOME
$ORACLE_HOME/OPatch/opatch lsinventory -bugs_fixed |grep –i "20898997"
  
If patch is not installed, download patch 20898997 from MOS and install
Audit table preupgrade requirements

If upgrading from pre 12.1 release and using Oracle database Vault, Oracle Label Security, then you must first run olspreupgrade.sql.  Copy $ORACLE_HOME/rdbms/admin/olspreupgrade.sql from target home (12.2).  Connect as DVOWNER to the source db
SQL> GRANT DV_PATCH_ADMIN to SYS;
Grant DV_PATCH_ADMIN to SYS.  Connect SYS as SYSDBA
CONNECT SYS AS SYSDBA
Execute olspreupgrade.sql
SQL>ORACLE_HOME/rdbms/admin/olspreupgrade.sql
After completion, connect as DVOWNER and revoke DV_PATCH_ADMIN to SYS
SQL> REVOKE DV_PATCH_ADMIN from SYS;
Cluster DB RequirementsUpgrade GI first before upgrading the database.  If RAC, then database set CLUSTER_DATABASE to false in the init parameter file.
Note: After completing post upgrade steps set CLUSTER_DATABASE to true.
Other Checks1. Ensure you have enough space in ARCHIVE_LOG and FLASHBACK location.
2. Check whether there are tables with SDO_GEOMETRY by executing below query.
col owner format a15
col table_name format a30
col column_name format a30
SELECT owner,table_name,column_name FROM dba_tab_columns WHERE data_type = 'SDO_GEOMETRY' AND owner != 'MDSYS' ORDER BY 1,2,3;
If it returns a row(s), then apply patch 25293022 on the 12.2 Oracle home, before starting the upgrade.
Step 6: Preupgrade stepExecute Preupgrade script from source home
$Earlier_release_Oracle_home/jdk/bin/java -jar $New_release_Oracle_home/rdbms/admin/preupgrade.jar FILE TEXT DIR output_dir
FILE - Use this option to direct output to a file
TEXT - Use this option to specify log should be in Text format (other option is to have XML output)
DIR - Logs will be created under <output_dir>
It is recommended to execute pre-upgrade fixup script, if any, which are AUTO FIXABLE
Dependencies on Network Utility PackagesExecute the following query
SQL> SELECT * FROM DBA_DEPENDENCIES WHERE referenced_name IN ('UTL_TCP','UTL_SMTP','UTL_MAIL','UTL_HTTP','UTL_INADDR','DBMS_LDAP') AND owner NOT IN ('SYS','PUBLIC','ORDPLUGINS');
To ensure that the new access controls are part of your upgrade testing, prepare a post-upgrade script to make the scripts available in your database environment.  After the upgrade, grant specific required privileges. Access is based on the usage in the original database.
Check Time zone versionCheck if target database's time zone version is lower than the source database time zone version.  If yes, before starting upgrade time zone should be upgrade without fail.  RDBMS DST patches are available in Note 412160.1
Step7: Upgrade Database to 12.2Shut down the database.
SQL> SHUTDOWN IMMEDIATE
Steps specific to Windows :

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
If your operating system is Windows, then complete the following steps:
a. Stop the OracleServiceSID Oracle service of the database you are upgrading,where SID is the instance name. For example, if your SID is ORCL, then enter the following at a command prompt:

C:\> NET STOP OracleServiceORCL

b. Delete the Oracle service at a command prompt using ORADIM. Refer to your platform guide for a complete list of the ORADIM syntax and commands.
For example, if your SID is ORCL, then enter the following command.

C:\> ORADIM -DELETE -SID ORCL

c. Create the service for the new release Oracle Database at a command prompt using the ORADIM command of the new Oracle Database release.
For example:

C:\> ORADIM -NEW -SID SID -SYSPWD PASSWORD -MAXUSERS USERS  -STARTMODE AUTO -PFILE ORACLE_HOME\DATABASE\INITSID.ORA
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Set the environment variables to point to target ORACLE_HOME
export ORACLE_HOME=<path to Oracle 12.2>
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_BASE=<path to Oracle_Base set during installation>

Start DB in upgrade mode from target ORACLE_HOME
CONNECT / AS SYSDBA
SQL> startup upgrade;
SQL> exit
On Linux/Unix
cd $ORACLE_HOME/bin
./dbupgrade  


On Windows
cd %ORACLE_HOME%\bin
dbupgrade

Execute Post-Upgrade Status Tool, utlu122s.sql and review the upgrade spool log file.  You run the Post-Upgrade Status Tool in the environment of the new release.
$ sqlplus "/as sysdba"
SQL> STARTUP
SQL> @utlu122s.sql

Verify the upgrade log whether catuppst.sql has been executed or not.  If not, execute it manually from new ORACLE_HOME, located at $ORACLE_HOME/rdbms/admin directory

SQL> @catuppst.sql  
Run utlrp.sql to recompile any remaining stored PL/SQL and Java code in another session.
SQL> @utlrp.sql
Check the state of the Oracle Data Dictionary for diagnosing upgrades and migrations.  The dbupgdiag.sql script collects upgrade and migration diagnostic information about the current state of the data dictionary.  You can run the script in SQL*Plus on the upgraded database as the SYS user.  Refer Note 556610.1 Script to Collect DB Upgrade/Migrate Diagnostic Information (dbupgdiag.sql)
If the dbupgdiag.sql script reports any invalid objects, run $ORACLE_HOME/rdbms/admin/utlrp.sql (multiple times) to validate the invalid objects in the database, until there is no change in the number of invalid objects.  After validating the invalid objects, re-run dbupgdiag.sql in the upgraded database once again and make sure that everything is fine.
If you are using Oracle Clusterware, then you must upgrade the Oracle Clusterware keys for the database.  Run srvctl for Oracle Database 12c to upgrade the database. For example:
ORACLE_HOME/bin/srvctl upgrade database -db name -o ORACLE_HOME
Step 8: Post-upgrade
Setting Environment variables on Linux and UnixConfirm that the following environment variables point to the directories of the new Oracle home:
ORACLE_HOME
PATH
Update oratab entriesModify the corresponding entry in the /etc/oratab file to point to the new ORACLE_HOME location.
Post-upgrade fixup scriptExecute post-upgrade fixup scripts generated by the pre-upgrade script.
Upgrading Tables Dependent on Oracle-Maintained TypesStarting with Oracle Database 12c release 2 (12.2), you must manually upgrade user tables that depend on Oracle-Maintained types.
To identify tables that need to be upgraded after the database upgrade, connect AS SYSDBA and run the following query:
COLUMN owner FORMAT A30
COLUMN table_name FORMAT A30
SELECT DISTINCT owner, table_name
FROM dba_tab_cols
WHERE data_upgraded = 'NO'
ORDER BY 1,2;
Execute utluptabdata.sql script either with a user account with the privileges to ALTER all of the tables dependent on Oracle-Maintained types, or with a user granted the SYSDBA system privileges that is logged in AS SYSDBA.
SET SERVEROUTPUT ON
@utluptabdata.sql

Enabling the New Extended Data Type CapabilityEnabling a system to take advantage of the new extended data types requires specific upgrade actions.
Oracle Database 12c introduces MAX_STRING_SIZE to control the maximum size of VARCHAR2, NVARCHAR2, and RAW data types in SQL. Setting MAX_STRING_SIZE = EXTENDED enables the 32767 byte limit introduced in Oracle Database 12c.
You must set the COMPATIBLE initialization parameter to 12.0.0.0 or higher to be able to set MAX_STRING_SIZE = EXTENDED.  For more information on this refer to Note 1570297.1
Recovery Catalog UpgradeIf you use a version of the recovery catalog schema that is older than that required by the RMAN client, then you must upgrade it. You can upgrade the Recovery catalog by executing the UPGRADE CATALOG command
Please refer to Oracle documentation under "Upgrading the Recovery Catalog" for complete information and steps
Upgrade the Time Zone File Version After Upgrading Oracle DatabaseIf the Pre-Upgrade Information Tool instructed you to upgrade the time zone files after completing the database upgrade,
then use the DBMS_DST PL/SQL package to update the RDBMS DST (timezone) version.
Follow the procedure in Oracle documentation under "Steps to Upgrade Time Zone File and Timestamp with Time Zone Data" and Note 1509653.1 "Updating the RDBMS DST version in 12c Release 1 (12.1.0.1 and up) using DBMS_DST"
Upgrading Statistics TablesIf you created statistics tables using the DBMS_STATS.CREATE_STAT_TABLE procedure, then upgrade these tables by running DBMS_STATS.UPGRADE_STAT_TABLE.  In the following example, SYS is the owner of the statistics table and 'dictstattab' is the name of the statistics table.
EXECUTE DBMS_STATS.UPGRADE_STAT_TABLE('SYS', 'dictstattab');
Perform this procedure for each statistics table.
Upgrade Externally Authenticated SSL UsersIf you are upgrading from Oracle9i Release 2 (9.2) or Oracle Database 10g Release 1 (10.1), and you are using externally authenticated SSL users, then you must run the SSL external users conversion (extusrupgrade) script to upgrade those users.
ORACLE_HOME/rdbms/bin/extusrupgrade --dbconnectstring hostname:port_no:sid --dbuser db_admin --dbuserpassword password -a
Install Oracle Text Supplied Knowledge Bases After Upgrading Oracle DatabaseThe Oracle Text-supplied knowledge bases are part of the companion products for Oracle Database 12c and are not immediately available after an upgrade to Oracle Database 12c. Any Oracle Text features dependent on the supplied knowledge bases which were available before the upgrade do not function after the upgrade. To re-enable such features, you must install the Oracle Text supplied knowledge bases from the installation media.
Update Oracle Application Express Configuration After Upgrading Oracle DatabaseIf the Oracle Database release that you upgrade includes Oracle Application Express release 3.2 or later, then you do not need to carry out additional configuration after upgrading to Oracle Database 12c. However, if Oracle Application Express is in the registry, so that Oracle Application Express is included in the upgrade, then set the open_cursors parameter to a minimum of 200.
Configure Access Control Lists (ACLs) to External Network Servicesif you have applications that use UTL_TCP, UTL_SMTP, UTL_MAIL, UTL_HTTP, or UTL_INADDR packages, then after upgrading Oracle Database you must configure network access control lists (ACLs) in the database before these packages can work as they did in earlier releases. Without the ACLs, your applications may fail with the error "ORA-24247: network access denied by access control list (ACL)."
Enabling Oracle Database Vault After Upgrading Oracle DatabaseRefer to the following documents for enabling Oracle Database Vault:
Note 453903.1 - Enabling and Disabling Oracle Database Vault in UNIX
Note 453902.1 - Enabling and Disabling Oracle Database Vault in WINDOWS
Check for the SQLNET.ALLOWED_LOGON_VERSION Parameter BehaviorConnections to Oracle Database from clients earlier than release 10g fail with the error ORA-28040: No matching authentication protocol. Refer to Oracle documentation for fixing the ORA-28040: No matching authentication protocol.
Known issuesFor known issues refer to Oracle Database Upgrade Known issues - 12.2 (Doc ID 2243613.1)
utluiobj.sql is not available from 12.2.  Before the upgrade, the list of invalid SYS/SYSTEM objects is written to registry$sys_inv_objs and non-SYS/SYSTEM objects was written to registry$nonsys_inv_objs by the Pre-Upgrade Information Tool, we can use these tables to query the INVALID objects after upgrade and compare with the current status.

ReferencesNOTE:2243613.1 - Oracle Database Upgrade Known issues - 12.2


回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-11-28 17:48 , Processed in 0.128767 second(s), 19 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表