Oracleフリート・パッチ適用およびプロビジョニングを使用した基本タスク


previous post about Oracle Fleet Patching and Provisioning で述べたように、この新しい (少なくとも私にとっては) Oracle 管理システムのテストとして BrokeDBA FPP Vagrant Fork をインストールする必要がありました.
Oracle FPP の利点について確認するには、まずこちらを参照してください: Oracle Fleet Patching and Provisioning - Introduction and Technical Overview

この投稿では、これまでに試したコマンドのいくつかについて言及したいと思います.空想的でも複雑でもありませんが、強制的に使用して新しい質問を見つける方法にすぎません:)

実行されることはすべて FPP サーバーから直接実行されます.この場合、クライアントを 1 つしか使用していませんが、同じことを足全体に複製できるはずです.

アクション一覧


  • Import Oracle DB Images
  • Deploy New DB Oracle Home to the Fleet
  • Create Database
  • Create PDB
  • Upgrade Database
  • Remove Database
  • Remove Oracle Home
  • Operations Auditing

  • -cdbname と -pdbname ではなく、-cdbName と -pdbName のように

    [grid@fpp-Server ~]$ rhpctl import image -image db_19300 -imagetype ORACLEDBSOFTWARE -zip /vagrant/ORCL_software/LINUX.X64_193000_db_home.zip
    fpp-Server.evilcorp.com: Audit ID: 3
    fpp-Server.evilcorp.com: Creating a new ACFS file system for image "db_19300" ...
    fpp-Server.evilcorp.com: Extracting files to directory /rhp_storage/images/idb_19300815168/swhome...
    fpp-Server.evilcorp.com: Files successfully extracted
    fpp-Server.evilcorp.com: Changing the home ownership to user grid...
    fpp-Server.evilcorp.com: Starting clone operation...
    ========================================
    fpp-Server.evilcorp.com:
    [INFO] [INS-32183] Use of clone.pl is deprecated in this release. Clone operation is equivalent to performing a Software Only installation from the image.
    [....]
    You can find the log of this install session at:
     /u01/app/oraInventory/logs/DetachHome2021-01-19_01-59-14PM.log
    'DetachHome' was successful.
    fpp-Server.evilcorp.com: Successfully executed detach home operation.
    [grid@fpp-Server ~]$
    
    [grid@fpp-Server ~]$ rhpctl import image -image db_12102 -imagetype ORACLEDBSOFTWARE -path /u01/app/oracle/product/12.1.0.2/dbhome_1 -targetnode fpp-Client -root
    Enter user "root" password:
    fpp-Server.evilcorp.com: Adding storage for image ...
    fpp-Server.evilcorp.com: Creating a new ACFS file system for image "db_12102" ...
    fpp-Server.evilcorp.com: Creating export file system ...
    fpp-Server.evilcorp.com: Starting export file system...
    fpp-Server.evilcorp.com: Mounting file system...
    fpp-Server.evilcorp.com: Copying files...
    fpp-Server.evilcorp.com: Removing export file system ...
    [grid@fpp-Server ~]$
    


    Oracle DB イメージのインポート

    Let's import the DB 19c image in the server so we can deploy it later to our clients (we only have one client so far)

    [grid@fpp-Server ~]$ rhpctl add workingcopy -workingcopy wc_db_19300 -image db_19300 -user oracle -groups OSBACKUP=dba,OSDG=dba,OSKM=dba,OSRAC=dba -oraclebase /u01/app/oracle -path /u01/app/oracle/product/19.0.0/dbhome_1 -targetnode fpp-Client -root
    Enter user "root" password:
    fpp-Server.evilcorp.com: Audit ID: 7
    fpp-Server.evilcorp.com: Option storagetype is set to the following default value: LOCAL.
    fpp-Server.evilcorp.com: Storing metadata in repository for working copy "wc_db_19300" ...
    fpp-Server.evilcorp.com: Connecting to node fpp-client ...
    fpp-Server.evilcorp.com: Starting transfer for remote copy ...
    [...]
    fpp-client: ..................................................   100% Done.
    fpp-Server.evilcorp.com: Successfully executed clone operation.
    fpp-Server.evilcorp.com: Executing root script on nodes fpp-client.
    fpp-client: Check /u01/app/oracle/product/19.0.0/dbhome_1/install/root_fpp-Client_2021-01-19_14-18-52-702784822.log for the output of root script
    fpp-Server.evilcorp.com: Successfully executed root script on nodes fpp-client.
    fpp-Server.evilcorp.com: Working copy creation completed.
    [grid@fpp-Server ~]$
    


    [grid@fpp-Server ~]$ rhpctl add workingcopy -workingcopy wc_db_12102 -image db_12102 -user oracle  -oraclebase /u01/app/oracle -path /u01/app/oracle/product/12.1.0.2/dbhome_1 -targetnode fpp-Client -root
    Enter user "root" password:
    fpp-Server.evilcorp.com: Audit ID: 21
    fpp-Server.evilcorp.com: Option storagetype is set to the following default value: LOCAL.
    fpp-Server.evilcorp.com: Storing metadata in repository for working copy "wc_db_12102" ...
    [....]
    fpp-Server.evilcorp.com: Executing root script on nodes fpp-client.
    fpp-client: Check /u01/app/oracle/product/12.1.0.2/dbhome_1/install/root_fpp-Client_2021-01-20_13-34-01.log for the output of root script
    fpp-Server.evilcorp.com: Successfully executed root script on nodes fpp-client.
    fpp-Server.evilcorp.com: Working copy creation completed.
    [grid@fpp-Server ~]$
    


    これで、新しい 19c Oracle ホームをクライアント VM に追加できます。 [grid@fpp-Server ~]$ rhpctl add database -workingcopy wc_db_19300 -dbname CDB19 -dbtype SINGLE -cdb -pdbName PDB -numberOfPDBs 1 -root ユーザーの「root」パスワードを入力してください: fpp-Server.evilcorp.com: 監査 ID: 8 fpp-Server.evilcorp.com: オプション datafileDestination は、次のデフォルト値に設定されています: /u01/app/oracle/oradata。 fpp-Server.evilcorp.com: ノード fpp-client でデータベースの作成を開始しています ... ^C^C PRCG-1104 : ユーザーがコマンドを終了しました。この中断によってコマンド操作がキャンセルされることはなく、サーバー上で処理が続行される場合があります。 [grid@fpp-Server ~]$ # クライアント VM [root@fpp-クライアント ログ]# ps -ef |grep pmon オラクル 1161 1 0 13:19 ? 00:00:00 ora_pmon_cdb1 オラクル 31149 1 0 14:34 ? 00:00:00 ora_pmon_CDB19 ルート 32083 24582 0 14:41 ポイント/0 00:00:00 grep --color=auto pmon [root@fpp-Client ログ]# FPPサーバーにある他のデータベースのOracleホームについても同じことができます [oracle@fpp-Client ~]$ . oraenv ORACLE_SID = [cdb1] ? CDB19 Oracle ベースは変更されず、値は /u01/app/oracle のままです [oracle@fpp-Client ~]$ sqlplus / as sysdba DB_NAME CDB HOST_NAME STARTUP DATABASE_ROLE ---------- --- ----------- -------------------- ------- ------ CDB19 はい fpp クライアント 2021 年 1 月 19 日 14:51:12 プライマリ INST_ID CON_ID 名前 OPEN_MODE OPEN_TIME ステータス ---------- ---------- -------------------- ---------- ---------------------------------------- ---------------------- 1 2 PDB$SEED 読み取り専用 19-JAN-21 02.51.22.283 PM +00:00 通常 1 3 PDB 読み取り 書き込み 19-JAN-21 02.51.38.524 PM +00:00 通常 SQL> フリートへの新しいDB Oracleホームのデプロイ

    What about creating a DB in our fpp-client? as simple as a remote command from our FPP Server
    By the way, is not a "good idea" to cancel a Sever operation using "Ctrl+c" since it will actually continue in the background:

    [grid@fpp-Server ~]$ rhpctl add database -workingcopy wc_db_12102 -dbname cdb12 -dbtype SINGLE -cdb -pdbName PDB12 -numberOfPDBs 1 -datafileDestination /u02/oradata -root
    Enter user "root" password:
    fpp-Server.evilcorp.com: Audit ID: 22
    fpp-Server.evilcorp.com: Starting database creation on node fpp-client ...
    fpp-client: SYS_PASSWORD_PROMPT
    SYSTEM_PASSWORD_PROMPT
    fpp-client:PDB_ADMIN_PASSWORD_PROMPT
    fpp-client:Copying database files
    fpp-client: 1% complete
    [....]
    fpp-client:   For the following PDBs: CDB$ROOT PDB$SEED PDB12
    fpp-client:     Nothing to roll back
    fpp-client:     Nothing to apply
    fpp-client:
    fpp-client: SQL Patching tool complete on Wed Jan 20 13:42:35 2021
    [grid@fpp-Server ~]$
    
    
    #DB alert confirming datfiles location
    alter database rename global_name to "cdb12"
    Completed: alter database rename global_name to "cdb12"
    ALTER TABLESPACE TEMP ADD TEMPFILE '/u02/oradata/cdb12/temp01.dbf' SIZE 61440K REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED
    Completed: ALTER TABLESPACE TEMP ADD TEMPFILE '/u02/oradata/cdb12/temp01.dbf' SIZE 61440K REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED
    
    

    Just to confirm, we can see our new 19c Database running in fpp-Client

    [grid@fpp-Server ~]$ rhpctl addpdb database -workingcopy wc_db_12102 -cdbname cdb12 -pdbname PDB122 -root
    Enter user "root" password:
    fpp-Server.evilcorp.com: Audit ID: 26
    fpp-Server.evilcorp.com: Option dbtype is set to the following default value: SINGLE.
    fpp-Server.evilcorp.com: Option datafileDestination is set to the following default value: /u01/app/oracle/oradata.
    fpp-Server.evilcorp.com: Starting pluggable database addition on node fpp-client ...
    fpp-client: Enter PDBADMIN User Password:
    Creating Pluggable Database
    fpp-client: 4% complete
    fpp-client: 12% complete
    fpp-client: 21% complete
    fpp-client: 38% complete
    fpp-client: 85% complete
    fpp-client: Completing Pluggable Database Creation
    fpp-client: 100% complete
    fpp-client: Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/cdb12/PDB122/cdb12.log" for further details.
    [grid@fpp-Server ~]$
    
    ## fpp-client
    
    CON_ID NAME     OPEN_MODE  OPEN_TIME                          STATUS
    ----------- -------- ---------- ---------------------------------- ---------
         2 PDB$SEED READ ONLY  20-JAN-21 01.42.01.262 PM +00:00   NORMAL
         3 PDB12    READ WRITE 20-JAN-21 01.42.20.847 PM +00:00   NORMAL
         4 PDB122   READ WRITE 20-JAN-21 02.19.24.252 PM +00:00   NORMAL
    

    You can also specify the datafile creation destination, like we are doing for this 12.1 Database

    [grid@fpp-Server ~]$ rhpctl upgrade database -dbname cdb12 -sourcehome /u01/app/oracle/product/12.1.0.2/dbhome_1  -destwc wc_db_19300 -root
    Enter user "root" password:
    fpp-Server.evilcorp.com: Audit ID: 28
    fpp-Server.evilcorp.com: verifying versions of Oracle homes ...
    fpp-Server.evilcorp.com: verifying owners of Oracle homes ...
    fpp-Server.evilcorp.com: verifying groups of Oracle homes ...
    fpp-Server.evilcorp.com: Processing arguments file /u01/app/grid/crsdata/fpp-server/rhp/conf/rhp.pref
    fpp-Server.evilcorp.com: Connecting to node fpp-client ...
    fpp-Server.evilcorp.com: Starting to upgrade database from path "/u01/app/oracle/product/12.1.0.2/dbhome_1" to path "/u01/app/oracle/product/19.0.0/dbhome_1" on node "fpp-client"
    fpp-client: Logs directory:  /u01/app/oracle/cfgtoollogs/dbua/upgrade2021-01-20_02-28-20PM
    fpp-client: Performing Pre-Upgrade Checks...
    fpp-client: ============================
    fpp-client: PRE- and POST- FIXUP ACTIONS
    fpp-client: =============================
    fpp-client: /u01/app/oracle/cfgtoollogs/dbua/upgrade2021-01-20_02-28-20PM/cdb12/upgrade.xml
    fpp-client: /u01/app/oracle/cfgtoollogs/dbua/upgrade2021-01-20_02-28-20PM/cdb12/preupgrade_fixups.sql
    fpp-client: /u01/app/oracle/cfgtoollogs/dbua/upgrade2021-01-20_02-28-20PM/cdb12/postupgrade_fixups.sql
    [....]
    69% complete
    70% complete
    80% complete
    90% complete
    Database upgrade has been completed successfully, and the database is ready to use.
    [grid@fpp-Server ~]$
    
    #fpp-client
    
    DB_NAME   CDB HOST_NAME       STARTUP               DATABASE_ROLE
    -------------- --- --------------- --------------------- -------------
    CDB12     YES fpp-Client      20-JAN-2021 15:41:56  PRIMARY      
    
    SQL> SQL> SQL>   2    3    4
     CON_ID NAME                 OPEN_MODE  OPEN_TIME                                STATUS
    ------------ -------------------- ---------- ---------------------------------------- ----------
          2 PDB$SEED             READ ONLY  20-JAN-21 05.47.39.793 PM +00:00         NORMAL
          3 PDB12                READ WRITE 20-JAN-21 06.11.24.190 PM +00:00         NORMAL
          4 PDB122               READ WRITE 20-JAN-21 06.11.24.376 PM +00:00         NORMAL
    
    SQL>  select banner from v$version;
    
    BANNER
    -------------------------------------------------------------------------------------
    Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
    
    Create Database

    PDBの作成 すでに実行中のCDBにPDBを作成することもできます (ちなみに、すぐに修正されると思いますが、

    documentation
    また、 でさらに多くの例を見つけることができます.

    Oracle FPP を使用するのはこれが初めてなので、学ぶべきことがたくさんあります.