Oracle - AutoUpgrade

更新 發佈閱讀 12 分鐘

個人網站: https://kxodia.com

Oracle Database AutoUpgrade 可以讓 DBA 在沒有過多人工干預的情況下,升級一個或多個資料庫,只需一個命令和一個配置文件,Autoupgrade會產生preupgrade來執行以符合一些升級條件,也會產生post-upgrade的要執行的文件,要是升級失敗也能自動重新嘗試或執行rollback。

可以通MOS下載最新的AutoUpgrade工具AutoUpgrade Tool (Doc ID 2485457.1)

關於可支援的資料庫版本,可以參考 Database Server Upgrade/Downgrade Compatibility Matrix (Doc ID 551141.1)


  • 11g ORACLE_HOME=/u01/app/oracle/product/11g/dbhome_1
  • 19c ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1


【安裝目標資料庫軟體】

unzip LINUX.X64_193000_db_home.zip -d /u01/app/oracle/product/19c/dbhome_1
$ ./runInstaller

《Silent mode 安裝》

  1. 編輯response file
$cd /u01/app/oracle/product/19c/dbhome_1/install/response/
$ cp db_install.rsp db_install.bk
$ cat db_install.rsp|grep -v '#'|grep -v ^$|grep -v '=$'
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.0.0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=dba
oracle.install.db.OSBACKUPDBA_GROUP=dba
oracle.install.db.OSDGDBA_GROUP=dba
oracle.install.db.OSKMDBA_GROUP=dba
oracle.install.db.OSRACDBA_GROUP=dba
oracle.install.db.rootconfig.executeRootScript=true
oracle.install.db.rootconfig.configMethod=ROOT
oracle.install.db.CLUSTER_NODES=rac1,rac2

2. 執行precheck

$ ./runInstaller -executePrereqs -silent -responseFile /u01/app/oracle/product/19c/dbhome_1/install/response/db_install.rsp
Launching Oracle Database Setup Wizard...

Prerequisite checks executed successfully.

3. 若安裝時檢查有錯,可加入-ignorePrereqFailure 忽略

$ ./runInstaller -silent -responseFile /u01/app/oracle/product/19c/dbhome_1/install/response/db_install.rsp -ignorePrereqFailure

Enter password for 'root' user:


【Autoupgrade - create_sample_file】

$ java -jar autoupgrade.jar -create_sample_file config

編輯config file

[oracle@rac1 autoupgrade]$ cat sample_config.cfg  |grep -v ^$ |grep -v ^#
global.autoupg_log_dir=/u01/app/oracle/cfgtoollogs/autoupgrade
upg1.log_dir=/u01/app/oracle/cfgtoollogs/autoupgrade/orcl # Path of the log directory for the upgrade job
upg1.sid=orcl # ORACLE_SID of the source DB/CDB
upg1.source_home=/u01/app/oracle/product/11g/dbhome_1 # Path of the source ORACLE_HOME
upg1.target_home=/u01/app/oracle/product/19c/dbhome_1 # Path of the target ORACLE_HOME
upg1.start_time=NOW # Optional. [NOW | +XhYm (X hours, Y minutes after launch) | dd/mm/yyyy hh:mm:ss]
upg1.upgrade_node=rac1 # Optional. To find out the name of your node, run the hostname utility. Default is 'localhost'

【Autoupgrade - analyze】

raw-image

檢視status log內記錄著資訊,包含preupgrade log 路徑

raw-image

檢視preupgrade.log 內包含 “REQUIRED ACTIONS”

=======================================
Status of the database prior to upgrade
=======================================
Database Name: orcl1
Container Name: Not Applicable in Pre-12.1 database
Container ID: Not Applicable in Pre-12.1 database
Version: 11.2.0.4.0
DB Patch Level: UNKNOWN
Compatible: 11.2.0.4.0
Blocksize: 8192
Platform: Linux x86 64-bit
Timezone File: 14
Database log mode: ARCHIVELOG
Readonly: false
Edition: EE
......
...
.
==============
BEFORE UPGRADE
==============

REQUIRED ACTIONS
================
None

RECOMMENDED ACTIONS
===================
1.(AUTOFIXUP)...
2.(AUTOFIXUP)...
=============
AFTER UPGRADE
=============

REQUIRED ACTIONS
================
None

RECOMMENDED ACTIONS
===================
3.(AUTOFIXUP)
4.Gather statistics...
...

【Autoupgrade - deploy

執行deploy開始執行自動升級

$ java -jar autoupgrade.jar -config sample_config.cfg -mode deploy

lsj可以看到目前執行狀態與進度

raw-image
raw-image

status 可以看到詳細進度、花費時間、耗用資源

raw-image

檢視資料庫資源,自動更換oracle home到19c

raw-image

【刪除restore point】

預設自動建立restore point,記得將其刪除。

raw-image


【筆記】

upg> restore all_failed

upg> restore -job <id>

java -jar autoupgrade.jar -config config.cfg -restore -jobs <id>

想要還原時,不可以動config檔案

AutoUpgrade is not fully tested on OpenJDK 64-Bit Server VM, Oracle recommends to use Java HotSpot(TM)
Previous execution found loading latest data
Total jobs recovered: 1
The content of the user config file /home/oracle/scripts/UPGR.cfg was altered after a deploy which may lead to corruption or invalid settings,
the AutoUpgrade will stop for safety, make sure to restore the original content of the file prior running the tool again
or if you wish to start from the beginning then remove or change the autoupg_log_dir directory
留言
avatar-img
留言分享你的想法!
avatar-img
工程師Kxodia的技術報告的沙龍
4會員
13內容數
2022/04/08
今天新安裝一台11024的Oracle RAC DB 在AIX的環境 並要更新PSU到 root> /oracle/11.2.0/grid/OPatch/opatch auto /source/oracle/30501155 -ocmrf /tmp/ocm.f zizhoho@gmail.com
2022/04/08
今天新安裝一台11024的Oracle RAC DB 在AIX的環境 並要更新PSU到 root> /oracle/11.2.0/grid/OPatch/opatch auto /source/oracle/30501155 -ocmrf /tmp/ocm.f zizhoho@gmail.com
2022/03/31
今天在第一個節點發現有wait event read by other session 與DB file sequential read幾乎佔據了80% 的DB time。 研究一下這是兩個session引發的問題,以session執行的動作又有不同的現象 查一下buffer裝啥囉~ 持續調查!
2022/03/31
今天在第一個節點發現有wait event read by other session 與DB file sequential read幾乎佔據了80% 的DB time。 研究一下這是兩個session引發的問題,以session執行的動作又有不同的現象 查一下buffer裝啥囉~ 持續調查!
2022/03/14
今天要將oracle goldengate 的extract 從classic 轉成integrated mode. 真是簡單的任務阿~ 趕緊做完下班囉~ 結果! 裡面有如何轉換的步驟,排錯的方式就是將Extract 重新打開讓他跑一下,追上就好了,但! 如果這樣就好我還寫個屁? 下班!
Thumbnail
2022/03/14
今天要將oracle goldengate 的extract 從classic 轉成integrated mode. 真是簡單的任務阿~ 趕緊做完下班囉~ 結果! 裡面有如何轉換的步驟,排錯的方式就是將Extract 重新打開讓他跑一下,追上就好了,但! 如果這樣就好我還寫個屁? 下班!
Thumbnail
看更多
你可能也想看
Thumbnail
在supabase裡可以直接從客戶端讀取資料庫中的資料,在設定好RLS的前提之下,更可以對資料庫直接進行新增、修改、刪除等操作。 先進到後台選擇SQL Editor,可以來到SQL編輯器的頁面,如果是本身會寫資料庫相關的SQL內容可以直接點擊上方的New query按鈕,可以開啟一個空白頁面開始編輯
Thumbnail
在supabase裡可以直接從客戶端讀取資料庫中的資料,在設定好RLS的前提之下,更可以對資料庫直接進行新增、修改、刪除等操作。 先進到後台選擇SQL Editor,可以來到SQL編輯器的頁面,如果是本身會寫資料庫相關的SQL內容可以直接點擊上方的New query按鈕,可以開啟一個空白頁面開始編輯
Thumbnail
PostgreSQL 安裝與配置 前往 PostgreSQL 官方網站 https://www.postgresql.org ,點選 Download。 選擇自己的作業系統,筆者是使用 macbook,所以這邊我選擇 mac。 點選 download the installer,按下去之後會轉導到
Thumbnail
PostgreSQL 安裝與配置 前往 PostgreSQL 官方網站 https://www.postgresql.org ,點選 Download。 選擇自己的作業系統,筆者是使用 macbook,所以這邊我選擇 mac。 點選 download the installer,按下去之後會轉導到
Thumbnail
當我們抓取了相當多的網站資料,這些來自不同網站的資料總不可能全都匯集成一張Excel吧,因此通常在寫程式的使用者,都需要一個可以存放資料,並進行串聯的資料庫(SQL),因此我們今天就來教大家如何安裝使用免費的資料庫吧!!
Thumbnail
當我們抓取了相當多的網站資料,這些來自不同網站的資料總不可能全都匯集成一張Excel吧,因此通常在寫程式的使用者,都需要一個可以存放資料,並進行串聯的資料庫(SQL),因此我們今天就來教大家如何安裝使用免費的資料庫吧!!
Thumbnail
最近接獲一個任務,該任務的目標是替一個即將進入正式部署階段的系統,導入一個 database migration tool,以下是此任務整個思考決策的邏輯以及正式進行時技術上比較值得和大家分享的小細節。 系統背景 資料庫的設計方式,目前常見會有兩種方向,code first 以及 database
Thumbnail
最近接獲一個任務,該任務的目標是替一個即將進入正式部署階段的系統,導入一個 database migration tool,以下是此任務整個思考決策的邏輯以及正式進行時技術上比較值得和大家分享的小細節。 系統背景 資料庫的設計方式,目前常見會有兩種方向,code first 以及 database
Thumbnail
Laravel Migrate可以用來做資料庫版本控制,對開發團隊來說,可以快速修改Schema,了解每個工程師做了什麼change,比如新增、修改哪些欄位、表格等等,是非常實用的功能。 在開始之前,須先建立好DB,並設定好.env中的DB連線config。 建立migrate指令:
Thumbnail
Laravel Migrate可以用來做資料庫版本控制,對開發團隊來說,可以快速修改Schema,了解每個工程師做了什麼change,比如新增、修改哪些欄位、表格等等,是非常實用的功能。 在開始之前,須先建立好DB,並設定好.env中的DB連線config。 建立migrate指令:
Thumbnail
patchm此文章主要藉由一個exadata 季度補丁來介紹下載方式,解壓縮,與目錄架構。 QFSDP Quarterly Full Stack Download Patch for Exadata (QFSDP)是僅用於EXADATA MACHINE 每季度發行的補丁,內容包括有: Opatch
Thumbnail
patchm此文章主要藉由一個exadata 季度補丁來介紹下載方式,解壓縮,與目錄架構。 QFSDP Quarterly Full Stack Download Patch for Exadata (QFSDP)是僅用於EXADATA MACHINE 每季度發行的補丁,內容包括有: Opatch
Thumbnail
Oracle Database AutoUpgrade 可以讓 DBA 在沒有過多人工干預的情況下,升級一個或多個資料庫,只需一個命令和一個配置文件。
Thumbnail
Oracle Database AutoUpgrade 可以讓 DBA 在沒有過多人工干預的情況下,升級一個或多個資料庫,只需一個命令和一個配置文件。
Thumbnail
本文以12.1的oracle單機資料庫為例,更新每季出的PSU
Thumbnail
本文以12.1的oracle單機資料庫為例,更新每季出的PSU
追蹤感興趣的內容從 Google News 追蹤更多 vocus 的最新精選內容追蹤 Google News