Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Oracle Database Technology Night #44 データベースの移行・アップグレードにおける最新ツールのご紹介 AutoUpgrade

Oracle Database Technology Night #44 データベースの移行・アップグレードにおける最新ツールのご紹介 AutoUpgrade

Oracle Databaseの移行・アップグレードには様々な機能やツールをご利用いただくことができます。
今回のTech Nightではアップグレード・プロセスの自動化を目指し設計された、AutoUpgradeについて紹介します。

oracle4engineer

May 28, 2021
Tweet

More Decks by oracle4engineer

Other Decks in Technology

Transcript

  1. Oracle Technology Night #44 データベースの移行・アップグレードにおける 最新ツールのご紹介 第一部 AutoUpgrade 2021/04/27 日本オラクル株式会社

    テクノロジー事業戦略統括 テクノロジー・クラウド・エンジニアリング本部 データベースソリューション部 山田恭平
  2. Safe harbor statement The following is intended to outline our

    general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, timing, and pricing of any features or functionality described for Oracle’s products may change and remains at the sole discretion of Oracle Corporation. Safe harbor statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, timing, and pricing of any features or functionality described for Oracle’s products may change and remains at the sole discretion of Oracle Corporation. Copyright © 2021, Oracle and/or its affiliates 2
  3. Program agenda Copyright © 2021, Oracle and/or its affiliates 3

    AutoUpgrade概要と実行手順 データベースアップグレードの流れ&事前作業について AutoUpgrade詳細 2 3 1 3 1
  4. データベースアップグレードの流れ 1. Oracle 19c ダウンロードと インストール 2. 最新のRU ダウンロードと インストール

    3. 最新の AutoUpgrade をダウンロード、実行 4. SPM, STA, RAT を 使って性能安定性を確認 eDelivery MOS: 2485457.1 MOS: 2521164.1 Copyright © 2021, Oracle and/or its affiliates 4
  5. 1. ORACLE_HOME ディレクトリの作成 2. イメージのダウンロード 3. ORACLE_HOME へ解凍 4. ./runInstaller

    5. root.sh Oracle 19c | インストール https://www.oracle.com/jp/database/technologies/oracl e-database-software-downloads.html#19c Copyright © 2021, Oracle and/or its affiliates 5
  6. Oracle Database をアップグレードする唯一の推奨方法 • 1つのコマンドで、単一のデータベース、或いは多くのデータベースをまとめて アップグレードすることが可能な自動アップグレードユーティリティ • コンフィグファイルを編集し、ツールを実行して自動アップグレード • 事前チェックのみ

    / 実行前後にユーザ定義のスクリプト処理、など柔軟に実行可能 • 既に世界で数千のお客様がご利用中 AutoUpgrade Copyright © 2021, Oracle and/or its affiliates 9 upg> Job Console 11.2.0.4 12.1.0.2 12.2.0.1 18.0 autoupgrade.jar MOS Note: 2485457.1 3MB config.cfg autoupgrade.jar 12.2.0.1 18.5.0 19.3
  7. • Java 8 以上 • 12.1.0.2 以上の $ORACLE_HOME にはデフォルトで存在 •

    確認 : $ORACLE_HOME/jdk/bin/java -version • Oracle Databaseが稼働するすべてのオペレーティング・システム • Standard Edition 2 および Enterprise Edition • Enterprise Editionであれば自動的に保証付きリストア・ポイントを作成 • RAC 構成 • Data Guard 構成 • Non-CDB および CDB のアップグレード • アップグレード 元 : • 11.2.0.4 以降 • アップグレード 先 : • 12.2.0.1 • 18.5.0 • 19.3.0 以降 AutoUpgrade | 要件 と サポート範囲 Copyright © 2021, Oracle and/or its affiliates 10
  8. AutoUpgrade | コンフィグファイルの編集 Download Configure Analyze Check Upgrade 実行に必要な情報をコンフィグファイルに記載 upg1.source_home=/u01/app/oracle/product/12.2.0.1

    upg1.target_home=/u01/app/oracle/product/19 upg1.sid=CDB1 サンプルコンフィグファイルを作成することが可能 $ java -jar autoupgrade.jar -create_sample_file config Created sample configuration file /home/oracle/sample_config.cfg Copyright © 2021, Oracle and/or its affiliates 12
  9. AutoUpgrade | 事前チェックの実行 Download Configure Analyze Check Upgrade 分析処理モードで実行しアップグレード前の事前チェックを行う $

    java -jar autoupgrade.jar -config CDB1.cfg -mode analyze ... upg> Job 100 completed Please check the summary report at: /u01/app/oracle/cfgtoollogs/autoupgrade/cfgtoollogs/upgrade/auto/status/status.html /u01/app/oracle/cfgtoollogs/autoupgrade/cfgtoollogs/upgrade/auto/status/status.log Copyright © 2021, Oracle and/or its affiliates 13
  10. AutoUpgrade | 事前チェックレポートの確認 Download Configure Analyze Check Upgrade ========================================== Autoupgrade

    Summary Report ========================================== [Date] Tue Jan 12 10:26:19 CET 2021 [Number of Jobs] 1 ========================================== [Job ID] 100 ========================================== [DB Name] CDB1 [Version Before Upgrade] 12.2.0.1.0 [Version After Upgrade] 19.9.0.0.0 ------------------------------------------ [Stage Name] PRECHECKS [Status] SUCCESS [Start Time] 2021-01-12 10:25:58 [Duration] 0:00:20 [Log Directory] /u01/app/oracle/upg/CDB1/100/prechecks [Detail] /u01/app/oracle/upg/CDB1/100/prechecks/cdb1_preupgrade.log Precheck passed and no manual intervention needed ------------------------------------------ 事前チェックレポートの確認 Copyright © 2021, Oracle and/or its affiliates 14
  11. AutoUpgrade | アップグレードの実行 Download Configure Analyze Check Upgrade 実行コマンド $

    java -jar autoupgrade.jar -config CDB1.cfg -mode deploy Copyright © 2021, Oracle and/or its affiliates 16
  12. AutoUpgrade | ジョブ一覧の確認 Download Configure Analyze Check Upgrade lsjコマンドにてジョブ一覧を確認 upg>

    lsj +----+-------+---------+---------+-------+--------------+--------+---------------+ |Job#|DB_NAME| STAGE|OPERATION| STATUS| START_TIME| UPDATED| MESSAGE| +----+-------+---------+---------+-------+--------------+--------+---------------+ | 101| CDB1|PREFIXUPS|EXECUTING|RUNNING|20/11/24 13:38|13:39:26|Remaining 12/13| +----+-------+---------+---------+-------+--------------+--------+---------------+ Copyright © 2021, Oracle and/or its affiliates 17
  13. AutoUpgrade | ジョブの詳細を確認 Download Configure Analyze Check Upgrade ジョブ一覧から取得したジョブナンバーを指定して詳細を確認 upg>

    status -job 101 Progress ----------------------------------- Start time: 20/11/24 13:38 Elapsed (min): 13 Last update: 2020-11-24T13:48:52.139 Stage: DBUPGRADE Operation: EXECUTING Status: RUNNING Stage summary: SETUP <1 min GRP <1 min PREUPGRADE <1 min PRECHECKS <1 min PREFIXUPS 8 min DRAIN <1 min DBUPGRADE 3 min (IN PROGRESS) Job Logs Locations ----------------------------------- Logs Base: /home/oracle/autoupg_default/CDB1/CDB1 Job logs: /home/oracle/autoupg_default/CDB1/CDB1/101 Stage logs: /home/oracle/autoupg_default/CDB1/CDB1/101/dbupgrade TimeZone: /home/oracle/autoupg_default/CDB1/CDB1/temp Copyright © 2021, Oracle and/or its affiliates 18
  14. AutoUpgrade | 実行結果の確認 Download Configure Analyze Check Upgrade Success upg>

    Job 101 completed ------------------- Final Summary -------------------- Number of databases [ 1 ] Jobs finished successfully [1] Jobs failed [0] Jobs pending [0] ------------- JOBS FINISHED SUCCESSFULLY ------------- Job 101 for CDB1 ---- Drop GRP at your convenience once you consider it is no longer needed ---- Drop GRP from CDB1: drop restore point AUTOUPGRADE_9212_CDB1122010 Copyright © 2021, Oracle and/or its affiliates 19
  15. AutoUpgrade | 実行デモ Download Configure Analyze Check Upgrade Watch on

    YouTube Copyright © 2021, Oracle and/or its affiliates 20
  16. AutoUpgrade | 4つのモード autoupgrade.jar -deploy -analyze -fixups -upgrade Copyright ©

    2021, Oracle and/or its affiliates 22 $ java -jar autoupgrade.jar -config config.cfg -mode analyze $ java -jar autoupgrade.jar -config config.cfg -mode deploy $ java -jar autoupgrade.jar -config config.cfg -mode fixups $ java -jar autoupgrade.jar -config config.cfg -mode upgrade
  17. 1. 分析処理モード –analyze データベースをチェックしてアップグレード可能かをチェック データの読み取りのみを実行し、更新は発生しない 2. 修正処理モード –fixups アップグレードを実行する前に修正する必要がある項目を修正する 修正処理モードを実行すると分析処理モード同様のチェックを実行し、

    チェック完了後に自動修正を実行する 3. アップグレードモード -upgrade データベースのアップグレードを実行する ※別サーバへのアップグレードが必要な際にのみ使用する 4. デプロイ処理モード –deploy 分析処理モード、修正処理モード、アップグレードのモードのすべてのモードを実行する デプロイ処理モードでのみリストア・ポイントの作成やデータベースの停止が行われる AutoUpgrade | 4つのモード Copyright © 2021, Oracle and/or its affiliates 23
  18. AutoUpgrade | ベストプラクティス $ java -jar autoupgrade.jar -config config.cfg -mode

    analyze autoupgrade.jar -deploy -analyze $ java -jar autoupgrade.jar -config config.cfg -mode deploy Copyright © 2021, Oracle and/or its affiliates 24
  19. デプロイ処理モード実行時に保証付きリストア・ポイント(GRP)を作成 • 保証付きリストア・ポイント(GRP)に関する仕様 • 以下の場合を除きデプロイ処理モードで自動的にGRPを作成 • Standard Edition 2をご利用の場合 •

    コンフィグファイルでrestoration=noを指定した場合 • GRPはアップグレード後にも保持される • アップグレード成功時にのみ自動削除する指定が可能 • コンフィグファイルでdrop_grp_after_upgrade=yesを指定 AutoUpgrade | 保証付きリストア・ポイントの作成 upg1.source_home=/u01/app/oracle/product/12.2.0.1 upg1.target_home=/u01/app/oracle/product/19 upg1.sid=CDB1 upg1.restoration=no upg2.source_home=/u01/app/oracle/product/12.2.0.1 upg2.target_home=/u01/app/oracle/product/19 upg2.sid=CDB2 upg2.drop_grp_after_upgrade=yes Copyright © 2021, Oracle and/or its affiliates 27
  20. • アップグレード処理自体に失敗した場合 • restoreコマンドを利用してGRPからの復旧が可能 • 処理中に接続が切れた場合 • 再度同様のコマンドを実行することで、再開可能 接続切れまでの作業は保持されているため、自動的に途中から実行します •

    アップグレード成功後に元のバージョンに戻したい場合 • 手動でダウングレードが必要 ※COMPATIBLEパラメータが変更前の場合にのみダウングレードが可能です マニュアルはこちら AutoUpgrade | AutoUpgradeの切り戻しについて java -jar autoupgrade.jar -restore –jobs n Copyright © 2021, Oracle and/or its affiliates 28
  21. ソースデータベースでの作業 1. -mode analyzeでAutoUpgradeを実行 2. -mode fixupsでAutoUpgradeを実行 3. RMANバックアップを実行 4.

    パスワードファイル、ウォレットファイル ネットワークファイルなどを 必要に応じてコピー ターゲットデータベースでの作業 1. RMANリストアを実行 2. STARTUP UPGRADEでデータベースを起動 3. -mode upgradeでAutoUpgradeを実行 AutoUpgrade | 新規サーバへのアップグレード autoupgrade.jar -analyze -fixups autoupgrade.jar -upgrade Copyright © 2021, Oracle and/or its affiliates 30
  22. ご参考 – AutoUpgrade 適用事例 “この場をお借りして、Oracle AutoUpgrade utilityに感謝いたします。 おかげで我々は、 500以上のOracleデータベースにおいて、完全自動化で Oracle

    12.2からOracle 19cへのアップグレードを完了しました。 四半期に一度の OSアップグレードの処理に本スクリプトを組み込むことで、追加の ダウンタイム無しでデータベースのアップグレードを実現できました。 これにより、一切の人手をかけずに、10日以内で全てのアップグレードを終えました。 ピーク時には、1時間で80個のデータベースを同時にアップグレードしました。” “I would like to take the opportunity to thank you for the Oracle AutoUpgrade utility. Thanks to it, we at <name removed> completed more than 500 Oracle database upgrade fully automated from Oracle 12.2 to Oracle 19c. We even did this without using additional downtime for the database upgrades as we scripted it into our process for the OS upgrade which happens once per quarter. This way, we completed the entire upgrade process within 10 days - without any manual intervention. At peak, we upgraded 80 databases in parallel within 1 hour.” Copyright © 2021, Oracle and/or its affiliates 31
  23. • Oracle Databaseアップグレードガイド 19c https://docs.oracle.com/en/database/oracle/oracle-database/19/upgrd/index.html • アップグレード関連情報ブログ Upgrade your Database

    - NOW! https://mikedietrichde.com/ • AutoUpgradeハンズオン https://mikedietrichde.com/autoupgrade-19c-hands-on-lab-japanese-version/ ご参考 各種資料 Copyright © 2021, Oracle and/or its affiliates 32
  24. セミナー中のQ&A Copyright © 2021, Oracle and/or its affiliates 33 質問

    回答 AutoUpgradeで12cSE2-RACから19c(19.7)SEHAに 構成変更できるのでしょうか? 構成変更はできません。 またSERACの既存のRACデータベースを19cSEにアップグレードするときは、 シングルデータベースに変更してからのアップグレードが必要です。 AutoUpgrade複数DB(複数インスタンス)構成にも対応している のでしょうか? はい、複数のDBを一度にUpgradeすることができます。 オンプレからクラウドへアップグレードするときもupgradeモードで実行す ればいいのでしょうか。 AutoUpgradeは、あくまでオンプレのデータベースをアップグレードする際にご利用頂 くツールになります。