技術ブログ
目次
渡部です。これは、(全部俺) Oracle Cloud Infrastructure Advent Calendar 2018と Oracle Database or GoldenGate Advent Calendar 2018の17日目のエントリです。
Oracle Cloud Infrastructure Virtual Machine DBシステムは、OCI-ClassicのDatabase Cloud Serviceに比べると、作成時に指定する設定項目が減っています。バックアップ関係の設定項目が減っている点が特に気になったため、OCI Virtual Machine DBシステムのバックアップ構成について調べてみます。
まずは試しということで、OCI管理コンソールからバックアップを取得してみます。
バックアップ取得後、RMAN list backupでバックアップを確認してみると、以下の点が分かります。
.
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1 Full 17.95M DISK 00:00:01 24-NOV-18
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20181124T034522
Piece Name: +RECO/DB182_IAD1D2/AUTOBACKUP/2018_11_24/s_993008722.262.993008723
SPFILE Included: Modification time: 24-NOV-18
SPFILE db_unique_name: DB182_IAD1D2
Control File Included: Ckp SCN: 1354091 Ckp time: 24-NOV-18
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2 Full 512.00K SBT_TAPE 00:00:02 24-NOV-18
BP Key: 2 Status: AVAILABLE Compressed: YES Tag: TAG20181124T084937
Handle: DB182_285796062_02tj0ot1_1_1_20181124_993026977 Media: swiftobjectstorage.us-ashburn-1.oraclecloud.com/v1/dbbackupiad/b
Control File Included: Ckp SCN: 1455315 Ckp time: 24-NOV-18
:
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
19 Full 512.00K SBT_TAPE 00:00:01 24-NOV-18
BP Key: 19 Status: AVAILABLE Compressed: YES Tag: TAG20181124T085527
Handle: c-285796062-20181124-02 Media: swiftobjectstorage.us-ashburn-1.oraclecloud.com/v1/dbbackupiad/b
SPFILE Included: Modification time: 24-NOV-18
SPFILE db_unique_name: DB182_IAD1D2
Control File Included: Ckp SCN: 1455939 Ckp time: 24-NOV-18
RMAN>
どうやら、オブジェクトストレージにバックアップするようにSBT_TAPEデバイスが構成されているようなので、 DBシステム作成直後におけるRMANの設定を確認してみると、以下が分かります。
.
RMAN> show all;
RMAN configuration parameters for database with db_unique_name DB182_IAD1D2 are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 30 DAYS;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default←★
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE SBT_TAPE TO '%F'; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE 'SBT_TAPE' PARALLELISM 5 BACKUP TYPE TO COMPRESSED BACKUPSET;
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 2 G;
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' MAXPIECESIZE 2 G FORMAT '%d_%I_%U_%T_%t' PARMS 'SBT_LIBRARY=/opt/oracle/dcs/commonstore/pkgrepos/oss/odbcs/libopc.so ENV=(OPC_PFILE=/opt/oracle/dcs/commonstore/objectstore/opc_pfile/285796062/opc_db182_iad1d2.ora)';←★
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE ON;
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'MEDIUM' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;
CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO 'SBT_TAPE';
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '+RECO/DB182_IAD1D2/controlfile/snapcf_db182_iad1d2.f';
OCI Virtual Machine DBシステムでも、OCI-ClassicのDatabase Cloud Serviceと同様にデータベースの管理権限が解放されており、使い慣れた管理コマンドが使用可能です。当然ながらRMANのBACKUPコマンドも使えますので、バックアップ出力デバイスにSBT_TAPEを指定して、データファイルのバックアップを取得してみます。
RMAN> BACKUP DEVICE TYPE SBT_TAPE DATAFILE 11;
Starting backup at 24-NOV-18
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=54 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: Oracle Database Backup Service Library VER=12.2.0.1
allocated channel: ORA_SBT_TAPE_2
channel ORA_SBT_TAPE_2: SID=57 device type=SBT_TAPE
channel ORA_SBT_TAPE_2: Oracle Database Backup Service Library VER=12.2.0.1
allocated channel: ORA_SBT_TAPE_3
channel ORA_SBT_TAPE_3: SID=59 device type=SBT_TAPE
channel ORA_SBT_TAPE_3: Oracle Database Backup Service Library VER=12.2.0.1
allocated channel: ORA_SBT_TAPE_4
channel ORA_SBT_TAPE_4: SID=215 device type=SBT_TAPE
channel ORA_SBT_TAPE_4: Oracle Database Backup Service Library VER=12.2.0.1
allocated channel: ORA_SBT_TAPE_5
channel ORA_SBT_TAPE_5: SID=58 device type=SBT_TAPE
channel ORA_SBT_TAPE_5: Oracle Database Backup Service Library VER=12.2.0.1
channel ORA_SBT_TAPE_1: starting compressed full datafile backup set
channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
input datafile file number=00011 name=+DATA/DB182_IAD1D2/DATAFILE/users.274.993008153
channel ORA_SBT_TAPE_1: starting piece 1 at 24-NOV-18
channel ORA_SBT_TAPE_1: finished piece 1 at 24-NOV-18
piece handle=DB182_285796062_0ktj0pre_1_1_20181124_993027950 tag=TAG20181124T090549 comment=API Version 2.0,MMS Version 12.2.0.1
channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:03
Finished backup at 24-NOV-18
Starting Control File and SPFILE Autobackup at 24-NOV-18
piece handle=c-285796062-20181124-03 comment=API Version 2.0,MMS Version 12.2.0.1
Finished Control File and SPFILE Autobackup at 24-NOV-18
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1 Full 17.95M DISK 00:00:01 24-NOV-18
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20181124T034522
Piece Name: +RECO/DB182_IAD1D2/AUTOBACKUP/2018_11_24/s_993008722.262.993008723
SPFILE Included: Modification time: 24-NOV-18
SPFILE db_unique_name: DB182_IAD1D2
Control File Included: Ckp SCN: 1354091 Ckp time: 24-NOV-18
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2 Full 512.00K SBT_TAPE 00:00:02 24-NOV-18
BP Key: 2 Status: AVAILABLE Compressed: YES Tag: TAG20181124T084937
Handle: DB182_285796062_02tj0ot1_1_1_20181124_993026977 Media: swiftobjectstorage.us-ashburn-1.oraclecloud.com/v1/dbbackupiad/b
Control File Included: Ckp SCN: 1455315 Ckp time: 24-NOV-18
:
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
19 Full 512.00K SBT_TAPE 00:00:01 24-NOV-18
BP Key: 19 Status: AVAILABLE Compressed: YES Tag: TAG20181124T085527
Handle: c-285796062-20181124-02 Media: swiftobjectstorage.us-ashburn-1.oraclecloud.com/v1/dbbackupiad/b
SPFILE Included: Modification time: 24-NOV-18
SPFILE db_unique_name: DB182_IAD1D2
Control File Included: Ckp SCN: 1455939 Ckp time: 24-NOV-18
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
20 Full 512.00K SBT_TAPE 00:00:01 24-NOV-18
BP Key: 20 Status: AVAILABLE Compressed: YES Tag: TAG20181124T090549
Handle: DB182_285796062_0ktj0pre_1_1_20181124_993027950 Media: swiftobjectstorage.us-ashburn-1.oraclecloud.com/v1/dbbackupiad/b
List of Datafiles in backup set 20
File LV Type Ckp SCN Ckp Time Abs Fuz SCN Sparse Name
---- -- ---- ---------- --------- ----------- ------ ----
11 Full 1459839 24-NOV-18 NO +DATA/DB182_IAD1D2/DATAFILE/users.274.993008153←★
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
21 Full 512.00K SBT_TAPE 00:00:01 24-NOV-18
BP Key: 21 Status: AVAILABLE Compressed: YES Tag: TAG20181124T090553
Handle: c-285796062-20181124-03 Media: swiftobjectstorage.us-ashburn-1.oraclecloud.com/v1/dbbackupiad/b
SPFILE Included: Modification time: 24-NOV-18
SPFILE db_unique_name: DB182_IAD1D2
Control File Included: Ckp SCN: 1460679 Ckp time: 24-NOV-18
RMAN>
無事、オブジェクトストレージにバックアップを取得できました。オブジェクトストレージには、領域管理不要、耐久性というバックアップ向きの優れた特徴があります。 追加構成なしで安全なバックアップが取得でき、らくちんです。 🙂