fc2ブログ

データベースコンサルタントのノウハウちょい見せ

各種インフラ技術(OS、ストレージ、ネットワーク)やオラクル製品といった話題を取り上げます。著者は小田圭二、「門外不出のOracle現場ワザ」、「絵で見てわかるOracleの仕組み」、「絵で見てわかるOS/ストレージ/ネットワーク」などの著作もあります

An experiment of AutoUpgrade to Oracle19c (English)

An experiment of AutoUpgrade to Oracle19c

This article is the 23rd of JPOUG Advent Calendar. I've heard Mike's instruction about AutoUpgrade at DB tech show case 2020, and I was encouraged to try AutoUpgrade by myself.

In my home, I introduced a tiny box and deploy VirtualBOX, Oracle12c, 19c. This time I executed AutoUpgrade along with Mike's article:
https://mikedietrichde.com/

First, I created multitenant DB of Oracle12c. There's no DB on Oracle19c.
Second, I downloaded AutoUpgrade from MOS(My Oracle Support):
MOS Note: 2485457.1 – AutoUpgrade Tool
AutoUpgrade itself is a tiny jar program.

Then, I created sample config file by running AutoUpgrade(see below).
create_config.png

That file was like this:
#
# Database number 1
#
upg1.dbname=employee
upg1.start_time=NOW
upg1.source_home=/u01/app/oracle/product/11.2.0/dbhome_1
upg1.target_home=/u01/app/oracle/product/19.1.0/dbhome_1
upg1.sid=emp
upg1.log_dir=/scratch/auto
upg1.upgrade_node=node1
upg1.target_version=19.1
#upg1.run_utlrp=yes
#upg1.timezone_upg=yes

I changed it according to the real environment.

In advance of the upgrade, I started up DB12c instance.
12.png

Usually, we execute AutoUpgrade with analyze mode. This tells you the result of precheck.

As for deploy mode, we can execute all the tasks (precheck and migration). If you got to fail, you adjust manually and retry again. AutoUpgrade allows us to resume from the point of failure.

Once upgrade begins, there is no response for a while. We may be anxious about the execution of AutoUpgrade, we can input "status" command on the console anytime and confirm the progress.
実行イメージ

status.png

Finally, It's Done! It took about 90min with my PC. I could shut down and startup 19c instance.
finish.png

19.png

Additionally, we can use AutoUpgrade in case of changing boxes(the old one to the new one) as well.

Tips:
Using the latest version. Oracle Development has been fixing it all the time.
You may be halted at precheck with error, then you can search in MOS and Mike's blog.
I recommend you unset LANG environment variable.

By the way, in Mike's blog, there is a usuful hands-on library kit and explanation in Japanese! How don't you try this?
https://mikedietrichde.com/autoupgrade-19c-hands-on-lab-japanese-version/
  1. 2020/12/24(木) 14:04:25|
  2. DBA
  3. | トラックバック:0
  4. | コメント:0

AutoUpgradeで19cにアップグレードしてみた

この記事は、JPOUG Advent Calendar 2020 23日目の記事です。
22日目はKazuhiro Takahashiさんの記事『ダイレクトパスリードとNSMTIOトレース』でした。
いい意味でマニアックでしたねー


DB tech showcaseでMikeさんのAutoUpgradeのプレゼンを聞いて、DatapumpやOracle GoldenGate以外のDB移行も大事だよなあと思い、自分でやってみることにしました。

自宅にちっちゃなサーバーを導入し、Virtual box上にOracle12cと19cを入れ、移行させてみることにしました。

今回はMikeさんの記事を読みつつ進めました。
https://mikedietrichde.com/

12cはマルチテナントでDBを作成しました。19cではDBは作成していません。

MOSからAutoUpgrade最新版をダウンロードします。
MOS Note: 2485457.1 – AutoUpgrade Tool
移行ツール自体はちっちゃなjarファイルです。

まず移行ツールの設定ファイルを作成します。
create_config.png

設定ファイルサンプルはこんな感じです。ここを書き換えます。
#
# Database number 1
#
upg1.dbname=employee
upg1.start_time=NOW
upg1.source_home=/u01/app/oracle/product/11.2.0/dbhome_1
upg1.target_home=/u01/app/oracle/product/19.1.0/dbhome_1
upg1.sid=emp
upg1.log_dir=/scratch/auto
upg1.upgrade_node=node1
upg1.target_version=19.1
#upg1.run_utlrp=yes
#upg1.timezone_upg=yes

移行前に移行元(12c)のDBを起動しておきます。
12.png

通常、まずanalyzeモードで実行します。これで事前チェックが行えます。

deployモードでは、事前チェックから移行まで含めた全タスクを実施します。ひっかかった場合、手作業での修正と再実行が必要です。再実行は止まったところからやり直しが可能です。
実行イメージ


upgradeが始まると、反応がなくなります。進んでいるか不安になりますが、statusというコマンドを使って、進捗を確認できます。
status.png

finish.png

移行が終わりました。私のマシンでupgradeは90分くらいかかりました。19cで起動停止も無事行えました!
19.png

なお、よく見る構成である、移行元マシンと移行先マシンが別々でも、このツールで移行が行えます。

■Tips

最新版を使いましょう。逐次修正されています。
事前チェックでひっかかることがあります。サポートサイトやMikeさんのブログなどを調べて、原因を調査しましょう。
環境変数LANGはunsetしましょう。

なお、Mikeさんのサイトにハンズオンライブラリと、日本語のハンズオンライブラリの説明があります。
https://mikedietrichde.com/autoupgrade-19c-hands-on-lab-japanese-version/
  1. 2020/12/23(水) 14:46:15|
  2. DBA
  3. | トラックバック:0
  4. | コメント:0