技術ブログ
bkup_api bkup_startを実行して、バックアップ処理を行うと、内部的にRMANが実行され、データベースがバックアップされます。
先のエントリでご説明したとおり、RMANはすでにディスクバックアップに加えて、Oracle Storage Cloudへのバックアップ設定が行われています。
[oracle@testbk01 ~]$ rman target /
Recovery Manager: Release 12.1.0.2.0 - Production on Sun Dec 6 07:50:11 2015
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1425502718)
RMAN>show all;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 30 DAYS;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK;←★
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 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 'SBT_TAPE' MAXPIECESIZE 2 G FORMAT 'cloudstorage_%d_%U' PARMS 'SBT_LIBRARY=libopc.so, ENV=(OPC_PFILE=/u01/app/oracle/product/12.1.0/dbhome_1/dbs/opcORCL.ora)';←★
CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 2 G;
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE ON;
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/12.1.0/dbhome_1/dbs/snapcf_ORCL.f'; # default
なお、RMANのデフォルトのバックアップ先デバイスはディスクに設定されていますが("CONFIGURE DEFAULT DEVICE TYPE TO DISK")、Oracle Database Cloud Serviceインスタンス作成時の「バックアップの保存先」に、「クラウド・ストレージおよびブロック・ストレージ」を指定した場合、bkup_api bkup_startでは、ディスクとOracle Storage Cloudの両方にバックアップが取得されるようです。
以下のステータス出力からも、primary backupにおいてディスク(local storage)に、secondary backupにおいてOracle Storage Cloud(cloud storage)にバックアップが取得されていることがわかります。
-bash-4.1# /var/opt/oracle/bkup_api/bkup_api bkup_status
########### DBAAS BACKUP API ######################
* Action: bkup_status
* log: /var/opt/oracle/bkup_api/bkup_api.log
* Current backup settings:
catalog: no
type: diskoss
* DBAAS utility logfile: /home/oracle/bkup/log/obkup.log
* Last registered Bkup: 12-07 09:31 API::1928:: Starting dbaas backup process
* Bkup state: finished
**************************************************
* API History: API steps
12-07 09:31 API:: NEW PROCESS 1928
12-07 09:31 API:: Starting dbaas backup process
12-07 09:31 API:: Requesting the number of backups in your system ....
12-07 09:31 API:: Your system has 1 backups
12-07 09:31 API:: Running the following command: /home/oracle/bkup/obkup
12-07 09:55 API:: The dbaas backup process is completed
12-07 09:55 API:: Searching for the new dbaas backup tag:
12-07 09:55 API:: Multiple new dbaas backups were created
12-07 09:55 API:: * TAG20151207T094129
12-07 09:55 API:: * TAG20151207T094906
12-07 09:55 API:: * TAG20151207T094924
12-07 09:55 API:: Your new dbaas backup tag is TAG20151207T095506
12-07 09:55 API:: BKUP COMPLETE YOUR BKUP TAG TAG20151207T095506
*************************************************
* Backup steps
API:: Oracle database state is up and running
API:: Performing backup to local storage (primary backup)←★★★
API:: Executing rman instructions
API:: ...... OK
API:: Backup to local storage is completed←★★★
API:: Clean MOTD.
API:: Performing backup to cloud storage (secondary backup)←★★★
API:: Executing rman instructions
API:: ......OK
API:: Backup to cloud storage is completed←★★★★
API:: Clean MOTD.
API:: Validating the backup repository:
API:: All backup pieces are ok
API:: Starting backup of config files
API:: at time: 2015-12-07:09:55:40
API:: Creating directories to store config files
API:: Determining the oracle database id
API:: DBID: 1425569508
API:: Compressing config files into tar files
API:: .... OK
API:: Uploading config files to cloud storage
API:: Completed at time: 2015-12-07:09:55:46
API:: Config files backup ended successfully
API:: All requested tasks are completed
*
* RETURN CODE:0
##################################################
-bash-4.1#