Oracle DB 18c - 手動升級到 18c 的完整核對清單 (文件 ID 2469647.1)
Oracle DB 18c - 手動升級到 Non-CDB Oracle Database 18c 的完整核對清單 (文件 ID 2469647.1)
文件內容
用途 |
適用範圍 |
詳細資訊 |
步驟 1: 升級到資料庫 18.1 的升級路徑 |
能夠直接升級到 Oracle 18.1 的資料庫最小版本 |
以下的資料庫版本需要間接升級 |
步驟 2: 推薦/需要在源庫上完成的 |
步驟 3: 推薦/需要在目標庫上完成的 |
步驟 4: 升級前檢查 |
清理資料庫 |
檢查所有的物化檢視 |
複製 Transparent Encryption Oracle 錢包 |
理解密碼大小寫敏感 |
對只讀表空間升級 |
為升級新的Oracle Home做準備 |
在Windows平臺為升級新的Oracle Home做準備 |
使用了 Oracle Label Security 和 Oracle Database Vault 的資料庫 |
備份資料庫 |
使用 emremove.sql 手工刪除 DB control |
確保升級前所有的檔案都沒有處於備份模式 |
清空回收站 |
效能方面 |
檢查時區設定 |
關於升級 Oracle OLAP Data Security Policies |
步驟 5: Preupgrade 步驟 |
Preupgrade fixup 指令碼 |
Network Utility 包的依賴關係 |
檢查 Time zone 檔案版本 |
步驟 6: 升級資料庫到 18c |
步驟 7:
升級後步驟
|
在 Linux 和 Unix 上設定環境變數 |
更新 oratab 檔案 |
Post-upgrade fixup 指令碼 |
在升級資料庫後升級 Recovery Catalog |
在升級資料庫後升級 Time Zone檔案版本 |
升級那些使用 DBMS_STATS 建立的統計資訊表(Statistics Tables) |
參考 |
適用於:
Oracle Database Backup Service - 版本 N/A 和更高版本
Oracle Database Exadata Express Cloud Service - 版本 N/A 和更高版本
Oracle Database Cloud Service - 版本 N/A 和更高版本
Oracle Database - Standard Edition - 版本 11.2.0.3 到 18.1.0.0.0 [發行版 11.2 到 18]
Oracle Database Cloud Schema Service - 版本 N/A 和更高版本
本文件所含資訊適用於所有平臺
用途
本文件可用作手工將 Oracle 11gR2 (11.2) 或者 Oracle 12c Release 1 (12.1) 或者 Oracle 12c Release 2 (12.2) 版本資料庫升級至 Oracle 18c 版本資料庫的指南與核對表。
適用範圍
資料庫管理人員, 技術支援
詳細資訊
步驟 1: 升級到資料庫 18.1 的升級路徑
能夠直接升級到 Oracle 18.1 的資料庫最小版本
源資料庫 | 目標資料庫 |
11.2.0.3/11.2.0.4 | 18.1 |
12.1.0.1/12.1.0.2 | 18.1 |
12.2.0.1 | 18.1 |
以下的資料庫版本需要間接升級
源資料庫 | 升級路徑 | 目標資料庫 | ||
11.2.0.1/11.2.0.2 | --> | 11.2.0.3/11.2.0.4 | --> | 18.1 |
11.1.0.6/11.1.0.7 | --> | 11.2.0.3/11.2.0.4 | --> | 18.1 |
10.2.0.2, 10.2.0.3, 10.2.0.4, 10.2.0.5 | --> | 11.2.0.3/11.2.0.4/12.1.0.1/12.1.0.2 | --> | 18.1 |
10.1.0.5 | --> | 11.2.0.3/11.2.0.4/12.1.0.1/12.1.0.2 | --> | 18.1 |
9.2.0.8 或更低版本 | --> | 11.2.0.3/11.2.0.4 | --> | 18.1 |
對於任何多步驟的升級,因為必須要升級兩次,所以需要執行 preupgrade 指令碼兩次:首先,對於中間升級版本執行指令碼一次,之後,對於最終升級到的版本執行指令碼一次。比如,如果要升級的資料庫是Oracle Database 10g,那麼按照下面的步驟:
- 按照 Oracle Database Upgrade Guide 12c Release 1 (12.1) 的步驟升級 10.2.0.5 到 12.1.0.2,包括為 12.1.0.2 執行 pre-upgrade 指令碼。
- 直接升級 Oracle Database 12c release 1 (12.1.0.2) 到 Oracle Database 18c。按照Oracle Database Upgrade Guide的說明,包括為 18.1 執行 preupgrade 指令碼。
如果您打算使用Data Pump export/import來升級,那麼這個限制就不存在了。
比如:
- 如果您要升級的資料庫當前是 11.2.0.2 或者 11.1.0.7,那麼您必須先要升級到 Oracle Database 11g release 2 (11.2.0.3)。
- 如果您要升級的資料庫當前是 10.2.0.2, 10.2.0.3, 10.2.0.4,10.2.0.5 或者 10.1.0.5,那麼您先要升級到版本 11.2. 或者 12.1
- 如果您要升級的資料庫當前是 9.2.0.8, 那麼您必須先要升級到一箇中間版本:
- 從 9.2.0.8 升級到 11.2.0.3 或者 11.2.0.4,之後再從11.2升級到18c。
步驟 2: 推薦/需要在源庫上完成的
- 對源庫做備份,冷備份或熱備份都可以。
- 禁用所有自定義的 before/after DDL 型別的觸發器,完成升級後再啟用它們。
- 在 11g 資料庫上定義的 Data security roles 不能自動轉換成 ORAS。 所以在升級前,需要刪除所有在 11g 資料庫上定義的 data security roles。升級後可以使用 Analytic Workspace Manager 12c 重新定義 data security roles。
- 如果從 11g 升級到 12c 之前未刪除 data security roles,那麼所有的 data security policies 以及 data security role 都會在 12c 上失效。
- Timezone 版本應當小於等於目標資料庫的 Timezone 版本。
- 如果源庫上已經安裝了 APEX 元件,那麼 升級資料庫前需要先在源庫上升級 APEX 元件。
- 源庫中沒有失效的物件/元件
- 如果您當前的資料庫是32位的,那麼升級後資料庫會被自動轉換成64位的
- 升級前執行 Preupgrade 指令碼並檢查 preupgrade 日誌。
- 執行 dbupgdiag.sql(可以從 Note 556610.1 下載這個指令碼),並且 確認是否有 SYS/SYSTEM 使用者下的失效物件或者失效元件。 如果存在的話, 那麼需要在升級前解決這些問題。 你可以多次執行 utlrp.sql 來解決問題。如果在這樣做之後仍然存在失效物件,那麼開一個 SR 來解決這個問題。
- 多次執行指令碼 utlrp.sql 確認資料庫中沒有失效物件。
步驟 3: 推薦/需要在目標庫上完成的
- 需要先檢查您的硬體平臺/作業系統是否相容 18.1。 點選 來確定相容性。
- 安裝資料庫軟體 18.1.0.0,並確保沒有安裝方面的問題。
- 如果有的話,下載並應用最新的 RU / RUR
-
從源庫的 ORACLE_HOME/dbs 下複製 spfile 或者 pfile 到目標 ORACLE_HOME/dbs。
- 從引數檔案中刪除所有廢棄的引數。
- 注意升級到 18.1 需要的最低的引數 COMPATIBLE 值為“11.2.0”, 確保引數 COMPATIBLE 值設定為 11.2.0 或者更高。
- 檢視文件 "Patches to apply before upgrading Oracle GI and DB to 18c (Doc ID 2414935.1)" 給出的推薦補丁
步驟 4: 升級前檢查
清理資料庫
清空回收站
檢查 SYS 及 SYSTEM 使用者的失效物件
檢查 SYS 及 SYSTEM 使用者下的重複物件
檢查失效的、必需的、廢棄的元件
檢查所有的物化檢視
檢查所有的物化檢視的狀態,重新整理所有沒有重新整理的物化檢視。
檢查物化檢視日誌的大小,如果物化檢視日誌的行數非零,那麼重新整理物化檢視。
檢查 direct loader 日誌以及 PMOP 日誌(分割槽維護操作日誌),如果 direct loader log 或者 PMOP 日誌非空,那麼重新整理日誌顯示的物化檢視。
升級資料庫前,必須確保所有的物化檢視都已經重新整理完畢。
執行下面的 SQL 查詢:
複製 Transparent Encryption Oracle 錢包
如果使用了帶 Oracle 錢包的 Transparent Data Encryption (TDE),那麼複製 thesqlnet.ora 和 wallet 檔案到新的Oracle home。在升級前需要手工複製 sqlnet.ora 和 wallet 檔案。
- 以授權使用者身份登入。
- 手工複製 sqlnet.ora,wallet 檔案以及 ewallet.p12,到新的 Oracle home。
以 mount 模式開啟資料庫 wallet。
例如:
SQL> ALTER SYSTEM SET ENCRYPTION WALLET OPEN
理解密碼大小寫敏感
從 Oracle Database 12c release 2 (12.2) 開始,預設的基於密碼驗證的協議排除了大小寫不敏感的 10g 版本的密碼。預設的SQLNET.ORA檔案中引數SQLNET.ALLOWED_LOGON_VERSION_SERVER被設定成了 12 (排他模式)。
為了安全起見,Oracle建議使用大小寫敏感的密碼驗證。這是預設的設定。但是在升級資料庫的時候可以短暫的關閉大小寫敏感的密碼驗證。在升級後,可以再決定是否啟用大小寫敏感的密碼驗證。
在升級前,Oracle建議您檢查是否新的密碼驗證會影響您的應用。可以做下面的檢查:
- 檢查是否有使用者使用了 10g 大小寫不敏感的密碼驗證方式。
- 檢查是否使用了尚未安裝 CPUOct2012 補丁的11.2.0.3或者更早版本的客戶端,或者應用了這個補丁但尚未啟用大小寫敏感的密碼版本。
- 確認您並未設定SEC_CASE_SENSITIVE_LOGON成FALSE。設定SEC_CASE_SENSITIVE_LOGON為FALSE就無法啟用大小寫敏感的密碼版本了(11G和12C的密碼版本)
更多資訊請參考18.1 Oracle database documentation
對只讀表空間升級
以 -T 引數使用 Parallel Upgrade Utility 可以在升級時把使用者表空間置為只讀。 因為資料庫可以讀取之前版本建立的資料檔案 header, 所以在升級時我們不需要做額外的操作。當升級完成後,表空間被置為讀寫時,檔案 header 會自動被更新。如果升級失敗,無法把表空間重新 online,那麼檢查升級日誌。日誌中包含把表空間重新 online 的語句。可以在資料庫中或者每個pdb裡手工執行來 online 表空間。
在升級日誌檔案中找到表空間相關的命令
如果升級失敗可以檢查升級的日誌 (Oracle_base/cfgtoologs/dbua),並且手工執行日誌中的命令來 online 表空間。可以檢查如下日誌:
Non-CDB升級
: catupgrd0.log
PDB 資料庫
: catupgrdpdbname0.log, 這裡 pdbname 是要升級的pdb的名字。
在每個日誌檔案的開始部分,可以找到把表空間置為只讀的命令
Tablespace altered.
而在每個日誌檔案的結尾部分,可以找到把表空間置為讀寫的SQL命令:
Tablespace altered.
為升級新的Oracle Home做準備
- 從要升級的資料庫 Home 複製配置檔案到新的版本的Oracle Home中。
- 如果您有一個 password 檔案,那麼把它從舊的 Oracle home 複製到新的 Oracle home。
- 從引數檔案中刪除所有廢棄的引數。在新的版本的資料庫裡有一些引數已經被廢棄。從要啟動新版本的資料庫的引數檔案中刪除所有被廢棄的引數,否則會在啟動時產生錯誤。同時,修改那些在新版本里格式已經被改變的引數。
- 如果要升級的是叢集資料庫,那麼需要在升級前修改引數 CLUSTER_DATABASE 為 FALSE 。
在Windows平臺為升級新的Oracle Home做準備
在 Microsoft Windows 平臺升級資料庫前需要先確保系統已經滿足升級條件。
出於安全考慮,不同的 Windows 賬戶配置為 Oracle home 不允許共享同一個 Oracle Base。
- 當源庫和目標庫的 Oracle home 使用同一個 Windows 賬戶作為 oracle home 使用者,資料庫升級是支援的。
- 資料庫升級對於源資料庫使用 Windows 自帶賬戶是支援的。Oracle Database 12c 之前的版本 (release 11.2 或者之前的版本) 在 Windows 上只支援使用 Windows 自帶的使用者來作為 Oracle Home 使用者。
- Oracle home 使用者可能沒有許可權訪問自己的 Oracle Base 和 Oracle home 之外的檔案。因此,如果您的升級使用不同的 Oracle Base,Oracle 資料庫服務可能沒有許可權訪問舊的 Oracle Base 下的檔案。
- 在手工升級或者在需要訪問舊的Oracle Base之外的檔案(比如,wallets, 配置檔案及其它檔案)之前,需要確保 Oracle Home 使用者可以訪問這些檔案;或者複製這些檔案到新的 Oracle Base。
使用了 Oracle Label Security 和 Oracle Database Vault 的資料庫
Audit Table升級及歸檔的要求
如果要升級的源庫版本低於12.1並且安裝了 Oracle Label Security和Oracle Database Vault,那麼必須執行 OLS preprocess olspreupgrade.sql 指令碼。
如果要升級使用了 Oracle Label Security (OLS) 和 Oracle Database Vault 的低於 12.1 版本的資料庫,必須執行 OLS preprocess 指令碼, olspreupgrade.sql,來處理 aud$ 表的內容。它會把 AUD$ 從 SYSTEM 使用者遷移到 SYS 使用者下。
如果要升級的資料庫低於12.1,並且使用了 Oracle Label Security (OLS) 和 Oracle Database Vault,那麼在升級前執行 olspreupgrade.sql 是必須的。一旦資料庫升級到了12.1,那麼就不需要執行OLS preprocessing 步驟了。
升級前在 11.2 資料庫上執行 OLS preprocess 指令碼:
1. 從 18.1 的 Oracle Home 下複製 olspreupgrde.sql 指令碼到源庫的 Oracle Home 下。
ORACLE_HOME/rdbms/admin/emremove.sql
ORACLE_HOME/rdbms/admin/catnoamd.sql
2. 啟動 SQL*Plus 並以 DVOWNER 登入到要升級的資料庫。
3. 執行下面的SQL:
4. 使用 SYS as SYSDBA 登陸資料庫:
5. 執行 Data Vault preprocess 指令碼:
ORACLE_HOME/rdbms/admin/emremove.sql
ORACLE_HOME/rdbms/admin/catnoamd.sql
6. 執行完畢後,以 DVOWNER 登陸資料庫
7. 執行下面的SQL:
對於Database Vault,賦予SYS以DV_PATCH_ADMIN的角色
如果啟用了Database Vault,那麼也需要做對應的檢查,檢查步驟需要執行下面的SQL指令碼 - olspreupgrade.sql, emremove.sql, catnoamd.sql
以 DVOWNER 登陸要升級的資料庫
執行下面的SQL:
備份資料庫
建議在執行 Pre-Upgrade Information Tool 之後備份資料庫。建立 guaranteed flashback restore point。 測試備份,確保出現問題後有回退方案。
rman "target / nocatalog"
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';
}
使用 emremove.sql 手工刪除 DB control
關閉 DB control
使用 sysdba 登陸
SQL>SET SERVEROUTPUT ON
SQL>@emremove.sql >> Script located in new 12c ORACLE_HOME/rdbms/admin
從系統中手工刪除
ORACLE_HOME/HOSTNAME_SID/ and ORACLE_HOME/oc4j/j2ee/OC4J_DBConsole_HOSTNAME_SID
目錄。
如果是 windows 系統則刪除
OracleDBConsoleSID
確保升級前所有的檔案都沒有處於備份模式
執行下面的語句:
清空回收站
要清空回收站,執行下面的語句:
注意: 升級前務必清空回收站來避免 ORA-00600 錯誤並且減少升級時間。
效能方面
儲存效能相關指標
檢查網路效能
收集最佳化器統計資訊
收集統計資訊可以減少停機時間,Oracle建議使用 DBMS_STATS.GATHER_DICTIONARY_STATS 來收集這些統計資訊,比如:
檢查時區設定
源庫的 time zone 檔案版本應該小於或者等於目標庫的 time zone 檔案版本。如果源庫的 time zone 檔案版本更高,那麼需要升級目標庫的 time zone 檔案版本來對應源庫的 time zone 檔案。
關於升級 Oracle OLAP Data Security Policies
在 11g 資料庫上定義的 Data security roles 不能自動轉換成 ORAS。所以在升級前,需要刪除所有在 11g 資料庫上定義的 data security roles。升級後可以使用新版本的 Analytic Workspace Manager 重新定義 data security roles。
如果從 11g 升級到 12c 之前未刪除 data security roles,那麼所有的 data security policies 以及 data security role 都會在新版本上失效。
步驟 5: Preupgrade 步驟
在源庫執行 Preupgrade 指令碼
FILE - 使用這個引數把輸出寫入輸出檔案
TEXT - 使用這個引數指定日誌格式為 TEXT 模式(如果不指定的話則為 XML 格式)
DIR - 日誌會建立在<output_dir>指定的這個目錄中
建議執行 pre-upgrade 的 fixup 指令碼,如果發現的問題是可以使用這個指令碼修復的話。
Preupgrade fixup 指令碼
執行 Preupgrade fixup 指令碼 preupgrade_fixups.sql
Network Utility 包的依賴關係
執行下面的語句
在升級測試中,確保使用新的訪問控制。在升級後確保這些包是可用的,在升級後,根據源庫的使用情況賦予正確的許可權。
檢查 Time zone 檔案版本
檢查目標資料庫的 time zone 檔案版本是否低於源庫的 time zone 檔案版本,如果是的話,需要升級目標資料庫的 time zone 檔案版本。 資料庫 DST 補丁可以從 Note 412160.1 下載。
步驟 6: 升級資料庫到 18c
關閉資料庫
Windows平臺的步驟
:
如果作業系統是Windows,那麼完成下面的步驟:
a. 停掉要升級的資料庫 OracleServiceSID Oracle service,這裡的SID是例項名。比如,如果SID是ORCL,那麼執行下面的命令:
b. 使用ORADIM來刪除 Oracle service。請參考平臺相關的文件來獲取ORADIM命令的格式。
比如,如果您的SID是ORCL,那麼執行下面的命令
c. 使用新ORACLE軟體的ORADIM來建立 service。
比如:
對於 Unix/Linux
設定環境變數指向目標 ORACLE_HOME
export ORACLE_HOME=<path to Oracle 18c>
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_BASE=<path to Oracle_Base set during installation>
從舊的Oracle home下複製 SPFILE.ORA 或者 INIT.ORA到目標Oracle home
使用目標 ORACLE_HOME(設定 ORACLE_HOME 為目標 ORACLE_HOME)啟動資料庫到 upgrade 模式
SQL> startup upgrade;
SQL> exit
在 Linux/Unix 上
cd $ORACLE_HOME/bin
./dbupgrade
在 Windows 上
cd %ORACLE_HOME%\bin
dbupgrade
執行 Post-Upgrade Status 工具,utlu122s.sql 並且檢查升級的日誌。在新的版本下執行 Post-Upgrade Status 工具。
$ sqlplus "/as sysdba"
SQL> STARTUP
SQL> @utlu122s.sql
檢查升級日誌看是否指令碼 catuppst.sql 已被執行。如果尚未執行,那麼在新的 ORACLE_HOME 裡手工執行。這個指令碼被放置在 $ORACLE_HOME/rdbms/admin 目錄。
在另一個 session 裡執行 utlrp.sql 來編譯 stored PL/SQL 和 Java 程式碼。
檢查診斷升級/遷移相關的狀態的 Oracle 資料字典。dbupgdiag.sql 指令碼可以收集和升級遷移診斷資訊有關的資料字典的資訊,可以在升級的資料庫上以 SYS 使用者來執行它,關於更多資訊,請參考文件 Note 556610.1 Script to Collect DB Upgrade/Migrate Diagnostic Information (dbupgdiag.sql)
如果指令碼 dbupgdiag.sql 發現了失效物件,執行 $ORACLE_HOME/rdbms/admin/utlrp.sql (多次) 來使它們生效,直到失效物件的個數不再改變。之後重新執行 dbupgdiag.sql 並確保沒有任何問題。
如果使用了叢集,那麼必須升級這個資料庫的 Oracle Clusterware keys,執行 srvctl 來完成,比如:
步驟 7:
升級後步驟
在 Linux 和 Unix 上設定環境變數
確保下面的環境變數指向了新的 ORACLE_HOME 對應的目錄:
ORACLE_HOME
PATH
更新 oratab 檔案
修改 /etc/oratab 檔案對應的條目指向新的 ORACLE_HOME 目錄
Post-upgrade fixup 指令碼
執行 pre-upgrade 產生的 post-upgrade fixup 指令碼
在升級資料庫後升級 Recovery Catalog
如果使用的recovery catalog版本低於rman客戶端的版本,我們必須升級它。可以透過命令 UPGRADE CATALOG 來升級 Recovery catalog。
關於具體的步驟資訊,請參照 Upgrading the Recovery Catalog。
在升級資料庫後升級 Time Zone檔案版本
如果 Pre-Upgrade Information Tool 要求我們在升級資料庫後升級 time zone 檔案,那麼使用 DBMS_DST PL/SQL package 來升級 RDBMS DST(timezone)版本
按照 Note 1509653.1 "Updating the RDBMS DST version in 12c Release 1 (12.1.0.1 and up) using DBMS_DST" 的 "Steps to Upgrade Time Zone File and Timestamp with Time Zone Data" 部分來進行升級
升級那些使用 DBMS_STATS 建立的統計資訊表(Statistics Tables)
如果我們使用 DBMS_STATS.CREATE_STAT_TABLE 手工建立了一些統計資訊表(statistics tables),那麼執行下面的命令來升級這些表(如果沒有建立過統計資訊表,那這一步驟可以忽略)。例如:
對每個統計資訊表都要執行一遍上面的命令。
Oracle 18c - Complete Checklist for Manual Upgrades to Non-CDB Oracle Database 18c (文件 ID 2418045.1)
In this Document
Purpose |
Scope |
Details |
Step 1: Upgrade Path for 18.1 Oracle database |
Minimum version of the database that can be directly upgraded to Oracle 18.1 |
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: Pre-upgrade checks |
Clean up database |
Check materialized views |
Copying Transparent Encryption Oracle Wallets |
Understanding Password Case Sensitivity |
Running Upgrades with Read-Only Tablespaces |
Preparing the New Oracle Home for Upgrading |
Prerequisites for Preparing Oracle Home on Windows |
Databases That Use Oracle Label Security and Oracle Database Vault |
Backing Up Oracle Database for Upgrading |
Manually remove DB control with emremove.sql |
Ensure no files are in Back up mode before starting the upgrade |
Purge Recycle bin |
Performance |
Checking Time zone settings |
About Upgrading Oracle OLAP Data Security Policies |
Step 5: Preupgrade step |
Preupgrade fixup script |
Dependencies on Network Utility Packages |
Check Time zone version |
Step 6: Upgrade Database to 18c |
Step 7: Post-upgrade
|
Setting Environment variables on Linux and Unix |
Update oratab entries |
Post-upgrade fixup script |
Recovery Catalog Upgrade |
Upgrade the Time Zone File Version After Upgrading Oracle Database |
Upgrading Statistics Tables |
References |
APPLIES TO:
Oracle Database Cloud Service - Version N/A and later
Oracle Database - Standard Edition - Version 11.2.0.3 to 18.1.0.0.0 [Release 11.2 to 18]
Oracle Database - Enterprise Edition - Version 11.2.0.3 to 18.1.0.0.0 [Release 11.2 to 18]
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - 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 11gR2 (11.2) or Oracle 12c Release 1 (12.1) or Oracle 12c Release 2 (12.2) to Oracle 18c Release
SCOPE
Database Administrators, Support
DETAILS
Step 1: Upgrade Path for 18.1 Oracle database
Minimum version of the database that can be directly upgraded to Oracle 18.1
Source | Target |
11.2.0.3/11.2.0.4 | 18.1 |
12.1.0.1/12.1.0.2 | 18.1 |
12.2.0.1 | 18.1 |
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.3/11.2.0.4 | --> | 18.1 |
11.1.0.6/11.1.0.7 | --> | 11.2.0.3/11.2.0.4 | --> | 18.1 |
10.2.0.2, 10.2.0.3, 10.2.0.4, 10.2.0.5 | --> | 11.2.0.3/11.2.0.4/12.1.0.1/12.1.0.2 | --> | 18.1 |
10.1.0.5 | --> | 11.2.0.3/11.2.0.4/12.1.0.1/12.1.0.2 | --> | 18.1 |
9.2.0.8 or earlier | --> | 11.2.0.3/11.2.0.4 | --> | 18.1 |
For any multi-step upgrade, if you must carry out two upgrades to upgrade to the current release, then you must run the preupgrade script twice: First, for the intermediate upgrade release, and second, for the target upgrade target release. For example, if the database from which you are upgrading is running Oracle Database 10g, then follow these steps:
- Upgrade release 10.2.0.5 to release 12.1.0.2 using the instructions in Oracle Database Upgrade Guide 12c Release 1 (12.1), including running the pre-upgrade script for 12.1.0.2.
- Upgrade Oracle Database 12c release 1 (12.1.0.2) directly to Oracle Database 18c. Use the instructions in this book, Oracle Database Upgrade Guide, including running the preupgrade script for 18.1.
Upgrade to an intermediate Oracle Database release that can be directly upgraded to the current release. Upgrade Oracle Database releases that are not supported for direct upgrade in this release to an intermediate Oracle Database release that is supported for direct upgrade.
This restriction does not apply if you use Oracle Data Pump export/import to migrate data to the new release.
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.3).
- 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. or 12.1
- 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 to 18c
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
- No INVALID object / Components in Source
- If you are installing 64-bit Oracle Database software, and your existing Oracle Database is a 32-bit Oracle Database installation, then your existing Oracle Database is automatically converted to 64-bit during the upgrade to the new Oracle Database release.
- Execute Preupgrade scripts before upgrade and review the preupgrade log for any issues.
- 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.
Step3: Requirements and recommendations for target ORACLE_HOME
- Verify the whether your operating system is certified for 18.1. Click to launch certification portal
- Install 18.1.0.0, verify there are no installation related issues.
- Download and install latest RU / RUR if any
-
Copy spfile or pfile from source ORACLE_HOME (under $ORACLE_HOME/dbs) to target home
- Remove any _ (underscore) parameter, obsolete and deprecated parameters in pfile
- Note min value of COMPATIBLE parameter to upgrade 18.1 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 18c (Doc ID 2414935.1)"
- Apply patch 29213893 on target ORACLE_HOME to avoid ORA-01422 error - refer: Database Upgrade to 12.2, 18c, 19c fails with ORA-01422, ORA-06512 for SYS.DBMS_STATS (Doc ID 2525596.1)
Step 4: Pre-upgrade checks
Clean 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.
Run the following SQL query:
Copying Transparent Encryption Oracle Wallets
If Oracle wallet used with Transparent Data Encryption (TDE), then copy the sqlnet.ora and wallet file to the new Oracle home. You must copy the sqlnet.ora and the wallet file manually before starting the upgrade.
- Log in as an authorized user.
- Manually copy the sqlnet.ora file, and the wallet file, ewallet.p12, to the new release Oracle home.
Open the Oracle wallet in mount.
For example:
SQL> ALTER SYSTEM SET ENCRYPTION WALLET OPEN
Understanding Password Case Sensitivity
Starting with Oracle Database 12c release 2 (12.2), the default password-based authentication protocol configuration excludes the use of the case-insensitive 10G password version. By default, the SQLNET.ORA parameter SQLNET.ALLOWED_LOGON_VERSION_SERVER is set to 12, which is an Exclusive Mode.
For greater security, Oracle recommends that you leave case-sensitive password-based authentication enabled. This setting is the default. However, you can temporarily disable case-sensitive authentication during the upgrade to new Oracle Database releases. After the upgrade, you can then decide if you want to enable the case-sensitive password-based authentication feature as part of your implementation plan to manage your password versions.
Before upgrading, Oracle recommends that you determine if this change to the default password-based authentication protocol configuration affects you. Perform the following checks:
- Identify if you have accounts that use only 10G case-insensitive password authentication versions.
- Identify if you have Oracle Database 11g release 2 (11.2.0.3) database or earlier clients that have not applied critical patch update CPUOct2012, or a later patch update, and have any account that does not have the case-insensitive 10G password version.
- Ensure that you do not have the deprecated parameter SEC_CASE_SENSITIVE_LOGON set to FALSE. Setting this parameter to FALSE prevents the use of the case-sensitive password versions (the 11G and 12C password versions) for authentication.
For more information refer 18.1 Oracle database documentation
Running Upgrades with Read-Only Tablespaces
Use the Parallel Upgrade Utility with the -T option to take schema-based tablespaces offline during upgrade. Oracle Database can read file headers created in earlier releases, so you are not required to do anything to them during the upgrade. The file headers of READ ONLY tablespaces are updated when they are changed to READ WRITE. If the upgrade suffers a catastrophic error, so that the upgrade is unable to bring the tablespaces back online, then review the upgrade log files. The log files contain the actual SQL statements required to make the tablespaces available. To bring the tablespaces back online, you must run the SQL statements in the log files for the database, or run the log files for each PDB.
Viewing Tablespace Commands In Upgrade Log Files
If a catastrophic upgrade failure occurs, then you can navigate to the log directory (Oracle_base/cfgtoologs/dbua), and run commands in the log files manually to bring up tablespaces. You can view tablespace commands in the following log files:
Non-CDB Upgrades
: catupgrd0.log
PDB databases
: catupgrdpdbname0.log, where pdbname is the name of the PDB that you are upgrading.
At the beginning of each log file, you find SQL statements such as the following, which sets tables to READ ONLY:
Tablespace altered.
Near the end of each log file, you find SQL statements to reset tables to READ WRITE:
Tablespace altered.
Preparing the New Oracle Home for Upgrading
- Copy configuration files from the Oracle home of the database being upgraded to the new release Oracle Database Oracle home.
- If you have a password file that resides within the old environment Oracle home, then move or copy the password file to the new Oracle home.
- Remove desupported initialization parameters and adjust deprecated initialization parameters. In new releases, some parameters are desupported, and other parameters are deprecated. Remove all desupported parameters from any parameter file that starts the new Oracle Database instance. Desupported parameters can cause errors in new Oracle Database releases. Also, alter any parameter whose syntax has changed in the new release.
- If you are upgrading a cluster database, then you need to change CLUSTER_DATABASE=FALSE before starting upgrade
Prerequisites for Preparing Oracle Home on Windows
System must meet these requirements before starting Oracle Database upgrade on Microsoft Windows platforms.
For security reasons, different Microsoft Windows user accounts configured as Oracle home users for different Oracle homes are not allowed to share the same Oracle Base.
- Database upgrade is supported when the same Windows user account is used as the Oracle home user in both the source and destination Oracle homes.
- Database upgrade is supported when the Oracle home from which the database is being upgraded uses the Windows Built-in Account. Releases earlier than Oracle Database 12c (release 11.2 and earlier) only supported the built-in account option for the Oracle home user on Windows.
- The Oracle home user may not have access to files outside its own Oracle Base and Oracle home. If that is the case, then if you choose a different Oracle Base during upgrade, it is possible that Oracle Database services cannot access files in the older Oracle Base. Using DBUA for database upgrade ensures that the Oracle home user has access to files outside of its own Oracle Base and its own Oracle home.
- Before upgrading manually, or before using the custom files from the older Oracle Base (for example, wallets, configuration files and other custom files ), you must grant access to the Oracle home user for these outside files, or copy these files to the new Oracle Base.
Databases That Use Oracle Label Security and Oracle Database Vault
Audit Table Preupgrade and Archive Requirements
For Oracle Database releases earlier than 12.1 using Oracle Label Security and Oracle Database Vault, you must run the OLS preprocess script before you upgrade.
If you are upgrading from a database earlier than Oracle Database release 12.1 that uses Oracle Label Security (OLS) and Oracle Database Vault, then you must first run the OLS preprocess script, olspreupgrade.sql, to process the aud$ table contents. The OLS upgrade moves the aud$ table from the SYSTEM schema to the SYS schema. The olspreupgrade.sql script is a preprocessing script required for this move.
Running the olspreupgrade.sql script before upgrading is mandatory for upgrading databases earlier than Oracle Database release 12.1 that use Oracle Label Security and Oracle Database Vault. Once you have upgraded to Oracle Database release 12.1, you do not have to perform the OLS preprocessing procedure going forward to patch or upgrade the database.
Oracle Database Vault and Upgrades of Oracle Database Release 11.2
If Oracle Label Security is installed in the earlier release that you are upgrading, then grant the DV_PATCH_ADMIN role to SYS.
To run the OLS preprocess script on a release 11.2 database before upgrading:
1. Copy the following scripts script from the newly installed Oracle home (18.1) to the Oracle home of the database that needs to be upgraded (11.2):
ORACLE_HOME/rdbms/admin/emremove.sql
ORACLE_HOME/rdbms/admin/catnoamd.sql
2. Start SQL*Plus and connect as DVOWNER to the database that you want to upgrade.
3. Run the following statement:
4. At the system prompt, connect SYS as SYSDBA:
5. Run the preprocess scripts for Data Vault
ORACLE_HOME/rdbms/admin/emremove.sql
ORACLE_HOME/rdbms/admin/catnoamd.sql
You may continue to run your applications on the database while the preprocess scripts are running.
6. After the olspreupgrade.sql completes its run successfully, start SQL*Plus and connect to the database as DVOWNER.
7. Run the following SQL statement:
Granting the DV_PATCH_ADMIN Role to SYS for Oracle Database Vault
If Oracle Database Vault is enabled, then to perform checks for Oracle Data Vault, the upgrade process requires running three SQL scripts - olspreupgrade.sql, emremove.sql, catnoamd.sql
Start SQL*Plus and connect as DVOWNER to the database that you want to upgrade.
Run the following statement:
Backing Up Oracle Database for Upgrading
Suggested to backup Oracle database after you run the Pre-Upgrade Information Tool. Take backup or create a guaranteed restore point or both. Test your backup. Ensure there is a proper fallback plan in case of any issues.
rman "target / nocatalog"
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';
}
Manually remove DB control with emremove.sql
Stop/shutdown DB control
Login as sysdba
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
Ensure no files are in Back up mode before starting the upgrade
Run the following statement:
Purge Recycle bin
To empty the database recycle bin, run the following command:
Note: The database recycle bin must be empty during the upgrade process to avoid possible ORA-00600 errors, and to minimize the upgrade time.
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:
Checking Time zone settings
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.
About Upgrading Oracle OLAP Data Security Policies
Data security roles defined in a release 11g Oracle Database instance are not automatically converted to ORAS. Before upgrading Oracle Database Release 11g to a current Oracle Database release, delete any data security roles that are defined in the 11g database. After the upgrade, you can use the new release Oracle Database Analytic Workspace Manager to define the data security roles again.
If DB us upgraded from an 11g database without deleting the 11g data security roles, then any data security policies that include a data security role are invalid in the later Oracle Database releases.
Step 5: Preupgrade step
Execute Preupgrade script from source home
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
Preupgrade fixup script
Execute Preupgrade fixup scripts
preupgrade_fixups.sql
Dependencies on Network Utility Packages
Execute the following query
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 version
Check 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
Step 6: Upgrade Database to 18c
Shut down the database.
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:
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. 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:
For Unix/Linux
Set the environment variables to point to target ORACLE_HOME
export ORACLE_HOME=<path to Oracle 18c>
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_BASE=<path to Oracle_Base set during installation>
Copy the SPFILE.ORA or INIT.ORA file from the old Oracle home to the target Oracle home.
Start DB in upgrade mode from target ORACLE_HOME
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
Run utlrp.sql to recompile any remaining stored PL/SQL and Java code in another session.
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 18c to upgrade the database. For example:
Step 7: Post-upgrade
Setting Environment variables on Linux and Unix
Confirm that the following environment variables point to the directories of the new Oracle home:
ORACLE_HOME
PATH
Update oratab entries
Modify the corresponding entry in the /etc/oratab file to point to the new ORACLE_HOME location.
Post-upgrade fixup script
Execute post-upgrade fixup scripts generated by the pre-upgrade script.
Recovery Catalog Upgrade
If 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 Database
If 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 Tables
If 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.
Perform this procedure for each statistics table.
About Me
........................................................................................................................ ● 本文作者:小麥苗,部分內容整理自網路,若有侵權請聯絡小麥苗刪除 ● 本文在itpub( http://blog.itpub.net/26736162 )、部落格園( http://www.cnblogs.com/lhrbest )和個人weixin公眾號( xiaomaimiaolhr )上有同步更新 ● 本文itpub地址: http://blog.itpub.net/26736162 ● 本文部落格園地址: http://www.cnblogs.com/lhrbest ● 本文pdf版、個人簡介及小麥苗雲盤地址: http://blog.itpub.net/26736162/viewspace-1624453/ ● 資料庫筆試面試題庫及解答: http://blog.itpub.net/26736162/viewspace-2134706/ ● DBA寶典今日頭條號地址: ........................................................................................................................ ● QQ群號: 230161599 (滿) 、618766405 ● weixin群:可加我weixin,我拉大家進群,非誠勿擾 ● 聯絡我請加QQ好友 ( 646634621 ) ,註明新增緣由 ● 於 2019-04-01 06:00 ~ 2019-04-31 24:00 在魔都完成 ● 最新修改時間:2019-03-01 06:00 ~ 2019-03-31 24:00 ● 文章內容來源於小麥苗的學習筆記,部分整理自網路,若有侵權或不當之處還請諒解 ● 版權所有,歡迎分享本文,轉載請保留出處 ........................................................................................................................ ● 小麥苗的微店 : ● 小麥苗出版的資料庫類叢書 : http://blog.itpub.net/26736162/viewspace-2142121/ ● 小麥苗OCP、OCM、高可用網路班 : http://blog.itpub.net/26736162/viewspace-2148098/ ● 小麥苗騰訊課堂主頁 : https://lhr.ke.qq.com/ ........................................................................................................................ 使用 weixin客戶端 掃描下面的二維碼來關注小麥苗的weixin公眾號( xiaomaimiaolhr )及QQ群(DBA寶典)、新增小麥苗weixin, 學習最實用的資料庫技術。
........................................................................................................................ |
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26736162/viewspace-2640262/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 手動升級到 Oracle Database 11gR2 (11.2)的完整核對清單 (文件 ID 1674333.1)OracleDatabase
- Oracle 19c - 手動升級到 Non-CDB 19c 的完整核對清單 (Doc ID 2577572.1)Oracle
- 手動升級到資料庫 12c 版本1(12.1)的完整核對清單 (文件 ID 2047701.1)資料庫
- 【MOS】手動升級到資料庫 12c 版本1(12.1)的完整核對清單 (文件 ID 2047701.1)資料庫
- Oracle 18C升級到19COracle
- Oracle 12C升級到18COracle
- Oracle 19c - 手動升級 Oracle 12.x, 18c CDB 到 Oracle 19c (19.x)Oracle
- Oracle 18cOracle
- 【kingsql分享】Oracle 18c RAC補丁升級實戰【DBRU】SQLOracle
- Oracle 18c使用dbca建立級聯DGOracle
- Oracle 18c - 配置只讀 OracleHome / DBCA / Patching / Upgrade (文件 ID 2469646.1)Oracle
- 除錯核對清單除錯
- Oracle 18c安裝初體驗Oracle
- 【18c】Oracle 18.3 RPM安裝Oracle
- 軟體升級配置清單
- Oracle 12c和18c中的MGMTDB(下)Oracle
- Windows升級到oracle 11g的異機物理升級文件(冷備)WindowsOracle
- ORACLE 18C啟動資料庫報錯ORA-04031Oracle資料庫
- ABP Framework 手動升級指南:從6.0.1升級到7.0.0Framework
- 升級 upgrade ORACLE DBOracle
- 開發安全的 API 所需要核對的清單API
- Oracle Linux 7.1 靜默安裝Oracle 18c RACOracleLinux
- 做 Web 開發必備的安全核對清單Web
- Oracle RAC 手動升級 11.2.0.3.4Oracle
- 【恩墨學院】深入解讀Oracle 18c對於DBA的影響及應對措施Oracle
- ORACLE 18C 19C 20C新特性Oracle
- Oracle 18c新特性詳解:In-Memory 專題Oracle
- Oracle 18C新特性之PDB snapshot(快照) CarouselOracle
- 探索Oracle之資料庫升級二 11.2.0.3升級到11.2.0.4完整步驟Oracle資料庫
- Oracle 18c新特性:多租戶艦隊 CDB FleetOracle
- Oracle 18c新特性詳解-多租戶專題Oracle
- 技術分享 | tidb 2.1升級到4.0操作文件TiDB
- 關於Oracle 18c將採用新的命名版本號的方式Oracle
- ORACLE10201手動升級到10204Oracle
- Oracle 18c rpm 安裝及解析安裝過程Oracle
- 【靜默】在RHEL 6.5上靜默安裝Oracle 18cOracle
- 【MOS】從 11.2.0.N 版本非原地手動升級到最新的 11.2.0.N (文件 ID 1602485.1)
- mongodb單機從3.2升級到4.0.4升級MongoDB