oracle cloud デザイン・パターン -dbcs disaster recovery in cloud-

50
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Oracle Cloud デデデデ デデデデ -DBCS Disaster Recovery in Cloud- 2016 年 8 年 23 年 年年年年年年年年年年 年年年年 年年年年年年年年年年 年年年年年

Post on 16-Apr-2017

265 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

Oracle Cloud デザイン・パターン-DBCS Disaster Recovery in Cloud-

2016 年 8 月 23 日日本オラクル株式会社クラウド・テクノロジー事業統括 南野英梨子

Page 2: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 2

Safe Harbor StatementThe 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, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.

Page 3: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 3

Document Control

• 本資料は、 Oracle Database 12cR1 ならびに Database Cloud Service 16.3.3 を前提に説明します–製品・サービスのアップデートに伴い、内容が変更される可能性があります–最新情報は、各製品・サービスのマニュアルやドキュメントをご確認下さい

Page 4: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 4

Document Control

Date Version 変更箇所2016/08 1.0 DB 12.1 + DBCS 16.3.3 で資料作成2016/10 1.1 DR to Cloud と DR in Cloud で資料分割

Page 5: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Agenda

5

デザイン・パターンの位置づけ

DBCS Disaster Recovery Overview DBCS Disaster Recovery in Cloud

1

2

3

Page 6: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Agenda

6

デザイン・パターンの位置づけ

DBCS Disaster Recovery Overview DBCS Disaster Recovery in Cloud

1

2

3

Page 7: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 7

デザインパターンの位置づけ

設計ガイド 構築ガイド 運用 Tipsアーキテクチャー設計時に生じる典型的な課題

• サービス構成図• 解決したい課題• 解決方法• メリット• 補足事項• 関連パターン

• Step by Step の操作手順

• 留意点• ノウハウ• How To

解決策・設計方法 実装方法・操作手順 各種要件に応じた対応策

※ 記載粒度:お客様が「自力で行える手順書」として活用できるレベル

Page 8: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Agenda

8

デザイン・パターンの位置づけ

DBCS Disaster Recovery Overview DBCS Disaster Recovery in Cloud

1

2

3

Page 9: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 9

アーキテクチャー設計時に生じる典型的な課題

• Database Cloud Service のデータベースを、 DR 構成にするにはどうしたらいいの?

• メンテナンスの停止時間や障害時の RTO(Recovery time Objective)/RPO(Recovery Point Objective) を短くするには、どうしたらいいの?

• オンプレミスの Oracle Database の DR 構成を、 Database Cloud Service にとるにはどうしたらいいの?

• DR 環境を設けて高い ROI も得たいけれども、コストは抑えたい

• DR を設けるのは大事なのはわかっているけれども、普段使用しない ( スタンバイ ) 環境になかなかコストはさけない

Oracle Cloud を検討してくれているお客様の声

設計課題

Page 10: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

DBCS Disaster Recovery

10

設計ガイド

Oracle DatabaseCloud Service

Oracle DatabaseCloud Service

Oracle DatabaseCloud Service

Data Center

Data Center

Reporting

Backup

Sandbox

On-PremisesDatabase

On-PremisesDatabase on Exadata

Oracle Exadata Cloud Service

Oracle DatabaseCloud Service

Reporting

Backup

Oracle Cloud では、クラウド to クラウドとオンプレミス to クラウドの2種類の方式がとれます

Page 11: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

DBCS Disaster Recovery

11

設計ガイド

Oracle DatabaseCloud Service

Oracle DatabaseCloud Service

Oracle DatabaseCloud Service

Data Center

Data Center

Reporting

Backup

Sandbox

On-PremisesDatabase

On-PremisesDatabase on Exadata

Oracle Exadata Cloud Service

Oracle DatabaseCloud Service

Reporting

Backup

本資料では、 Disaster Recover(DR) in Cloud を説明します

Page 12: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Agenda

12

デザイン・パターンの位置づけ

DBCS Disaster Recovery Overview DBCS Disaster Recovery in Cloud

1

2

3

Page 13: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

• 解決したい課題– クラウド上のデータベースの運用として、

計画外停止や定期的な計画停止のために、「障害時の RTO/RPO を短くしたい」 「メンテナンス時の停止時間を短くしたい」といった要望があります

– また、 ROI を高めるために、 DR 環境も有効活用することも検討されます

– DR 環境を構築するのに、インスタンスを作成するように、 GUI ベースで簡単に構築できることが望ましいです

– クラウド上にあるデータベース内のデータ保護も考慮する必要があります

DBCS Disaster Recovery in Cloud

13

設計ガイド

Oracle DatabaseCloud Service

Oracle DatabaseCloud Service

Oracle DatabaseCloud Service

Data Center

Data Center

Reporting

Backup

Sandbox

Page 14: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 14

• Oracle Cloud での解決方法– Oracle Database Cloud Service 内で、

Data Guard を構築してデータベースのスタンバイを作成することで、災対環境を用意できます。それにより、障害時の RTO/RPO を短くすることが可能です

– 数クリックで Data Guard が自動的に作成されます

– 計画 / 計画外停止時に、切り替えて使用することが可能なため、停止時間を短くすることが可能です。また、切り替え作業も、 GUI ベースで数クリックでできます

– Database Cloud Service 上のデータベースはデフォルトで暗号化されています

• 補足事項– アイデンティティ・ドメインがマルチサイト

対応していることが必要です

• メリット:– 常に切り替え ( スイッチオーバー / フェイルオー

バー ) が可能なスタンバイ・データベースを保持します

– 数クリックで、構築や切り替えが可能です– Oracle Cloud のマイ・サービス (UI) から管理可

能です。また、デフォルトで Data Guard Broker が有効なので、コマンドラインでの管理も簡単にできます

– 障害時の RTO/RPO や、メンテナンス時の停止時間を短くすることが可能です

– スナップショット・スタンバイに切り替えることより、一時的に読み書き可能モードにできます

– (Active Data Guard) スタンバイも参照用として使用することで、処理のオフロード先として有効活用できます

– (Active Data Guard) 自動ブロック・メディアリカバリ機能により、データ破損を自動的に修復します

DBCS Disaster Recovery to Cloud設計ガイド

Page 15: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 15

DBCS Disaster Recovery to Cloud

• アイデンティティ・ドメインがマルチサイト対応している必要があります– マルチゾーン対応かどうかは、 Compute Cloud のサービスコンソールで確認可能です– 対応していれば「サイトセレクタ」へのリンクが表示されます– 基本的に新しいアイデンティティ・ドメインは全てマルチサイト対応、古いものも順次対応

される予定です

参考 ) 作成の条件

US002 – Chicago(IL)US006 – Ashburn(VA)EM001 – Amsterdam(NL)EM002 – Slough(UK)

設計ガイド

Page 16: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

スタンバイ・データベース作成手順

16

Step 1. Database Cloud Service インスタンス作成

エディションは下記のいずれかを選択します

Data Guard の場合• Enterprise Edition (EE)• EE - High Performance• EE - Extreme Performance

Active Data Guard の場合• EE - Extreme Performance

(Exadata Cloud Service)

構築ガイドDBCS Disaster Recovery to Cloud

Page 17: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

スタンバイ・データベース作成手順

17

Step 2. Database Cloud Service インスタンス作成での Data Guard 構成の選択

『 Data Guard を使用したスタンバイ・データベース』のチェックボックスにチェックを入れ、下記のいずれかを選択します

High Availability• 別ゾーン /同データセンター

Disaster Recovery• 別データセンター /同リージョン

構築ガイドDBCS Disaster Recovery in Cloud

Page 18: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 18

DBCS Disaster Recovery in Cloud

参考 ) 2 タイプのインスタンス配置High Availablity Disaster Recovery

ドメインゾーンゾーン

Chicago DC Ashburn DC

ゾーンゾーン

ゾーン

P

S

P

S

ドメインゾーンゾーン

Chicago DC Ashburn DC

ゾーンゾーン

ゾーン

P S

プライマリ・インスタンススタンバイ・インスタンス

同じデータセンターの別ゾーンに配置 別データセンターのゾーンに配置プライマリは必ず PaaS プライマリのゾーンに配置されますスタンバイの配置候補のゾーンが複数ある場合でもユーザーが選ぶことはできません

構築ガイド

Page 19: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 19

DBCS Disaster Recovery in Cloud

• アイデンティティ・ドメインにおいて、それぞれの配置タイプに必要なゾーンが存在しない場合は、作成時の検証に失敗して、 Data Guard を作成することができません– High Availability が作成できないケース• 同じデータセンターに別ゾーンがない場合

※現在のトライアル環境はこちらに該当するため High Availability は作成できません

– Disaster Recovery が作成できないケース• 同じリージョンの別データセンターにゾーンがない

場合※マルチゾーン未対応のアイデンティティドメイン

参考 ) 未対応のアイデンティティ・ドメインの場合

アイデンティティ・ドメインゾーンゾーン

Data Center Data Center

ゾーンゾーン

P

S

SHA

DR

作成不可

作成不可

構築ガイド

Page 20: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

スタンバイ・データベース作成手順

20

Step 3. Database Cloud Service インスタンス作成の構成情報の確認

構成情報を確認して、修正点がなければその内容でインスタンスを作成します

構築ガイドDBCS Disaster Recovery in Cloud

Page 21: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

スタンバイ・データベース作成手順

21

Step 4. 作成した Database Cloud Service インスタンスの内容確認

サービス一覧のサービス名をクリックし、サービス詳細を確認します

ノード一覧に2ノード ( プライマリとスタンバイ ) のエントリがあることを確認します

構築ガイドDBCS Disaster Recovery in Cloud

Page 22: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard 関連情報確認

22

確認方法

Database Cloud Service で作成した Data Guard 構成は、下記のいずれかの方法で監視・運用が可能です Database Cloud Service

マイ・サービス dbaascli ユーティリティ

Database Cloud Service インスタンスの操作のためのコマンドラインユーティリティ

DGMGRL ユーティリティ Data Guard Broker 構成用の

コマンドラインユーティリティ

SQL*Plus

運用 TipsDBCS Disaster Recovery in Cloud

ロール変換• スイッチ・オーバー• フェイル・オーバー• スナップショット・スタンバイへの変換

監視• 構成情報の確認• REDO 転送宛先の状態• REDO 転送・適用ラグ• REDO 適用関連プロセス• REDO 適用処理 etc…

Page 23: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard 関連情報確認

23

確認方法

運用 TipsDBCS Disaster Recovery in Cloud

カテゴリ 内容 Database

Cloud Service マイ・サービス

dbaascli DGMGRL SQL*Plus

UI Command Line

運用 スイッチオーバー / フェイルオーバー ○ ○ ○ ○

フェイルオーバー後の旧プライマリの復旧

○ ○ ○ ○

スナップショット・スタンバイへの変換 - - ○ ○

構成 / 設定変更 - - ○ ○

監視 構成情報の確認 ○ ○ ○ ○

設定値の確認 - ○ ○ ○

REDO 転送宛先の状態 - ○ ○

REDO 転送・適用ラグ ○ ○ ○ ○

REDO 適用プロセス状態・情報 - - ○ ○

REDO 適用性能の確認 - - ○ ○

Page 24: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard 関連情報確認

24

マイ・サービス からの確認

ノード一覧でデータベース・ロールを確認できます• プライマリ• スタンバイ• 回復 (旧プライマリデータ

ベースの回復 ) Data Guard メトリックが確認

できます• Apply Lag• Transport Lag• Active Session• Last Update Time

運用 TipsDBCS Disaster Recovery in Cloud

Page 25: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard 関連情報確認

25

dbaascli ユーティリティ

dbaascli ユーティリティの dataguard サブコマンドを使用して、 Data Guard の構成情報確認や操作が可能

構成情報確認$ dbaascli dataguard status [--details yes|no]\[--password password]

運用 TipsDBCS Disaster Recovery in Cloud

DBAAS>dataguard status --short yesExecuting command dataguard status --short yesSUCCESS: Dataguard is up and running{ "FSFO" : "Start Failover: DISABLED", "STANDBY" : “ORCL_02", "PRIMARY" : "ORCL_01", "CONFIGURATION" : "fsc"

構成情報短縮バージョン ( 実行例 )

DBAAS> dataguard statusDBAAS CLI version 1.0.0Executing command dataguard status

SUCCESS : Dataguard is up and running

DETAILS:Configuration - fsc

  Protection Mode: MaxPerformance  Members:  ORCL_01 - Primary database    ORCL_02 - Physical standby database

  Properties:    FastStartFailoverThreshold      = '30'    OperationTimeout                = '120'    TraceLevel                      = 'USER'    FastStartFailoverLagLimit       = '30'    CommunicationTimeout            = '180'    ObserverReconnect               = '0'    FastStartFailoverAutoReinstate  = 'TRUE'    FastStartFailoverPmyShutdown    = 'TRUE'    BystandersFollowRoleChange      = 'ALL'    ObserverOverride                = 'FALSE'    ExternalDestination1            = ''    ExternalDestination2            = ''    PrimaryLostWriteAction          = 'CONTINUE'

Fast-Start Failover: DISABLED

Configuration Status: SUCCESS

構成情報 ( 実行例 )

Page 26: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard 関連情報確認

26

dbaascli ユーティリティ

運用 TipsDBCS Disaster Recovery in Cloud

DBAAS> dataguard status --details yesExecuting command dataguard status --details yesSUCCESS: Dataguard is up and running{ "instances" : [ { "DATABASE_TYPE" : "PRIMARY", "PROTECTION_MODE" : "MAXIMUM PERFORMANCE", "PROTECTION_LEVEL" : "MAXIMUM PERFORMANCE", "ADDITIONAL_MESSAGES" : "", "DATABASE_NAME" : "ORCL_01", "PENDING_APPLY_LOG_CNT" : 0, "ACTIVE_SESSIONS" : "1", "HOST_NAME" : "JPDGHA-dg01", "OPEN_MODE" : "READ WRITE" }, { "PROTECTION_LEVEL" : "MAXIMUM PERFORMANCE", "ADDITIONAL_MESSAGES" : "", "APPLY_LAG" : "00 days 00 hrs 00 min 00 sec", "DATABASE_NAME" : "ORCL_02", "APPROXIMATE_ROLE_TRANSITION_TIME" : "00 days 00 hrs 00 min 00 sec + 30 sec", "ACTIVE_SESSIONS" : "2", "HOST_NAME" : "JPDGHA-dg02", "TRANSPORT_LAG" : "00 days 00 hrs 00 min 00 sec last computed 0 days 0 hrs 0 min 13 sec before", "PROTECTION_MODE" : "MAXIMUM PERFORMANCE", "DATABASE_TYPE" : "PHYSICAL STANDBY", "OPEN_MODE" : "READ ONLY WITH APPLY" } ]}

構成情報詳細  ( 実行例 )

Page 27: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard 関連情報確認

27

DGMGRL ユーティリティ

Database Cloud Service で作成された Data Guard は、デフォルトで Data Guard Broker が有効

DGMGRL ユーティリティを使用して、 Data Guard の構成情報確認や操作が可能

構成情報確認$ dgmgrl show configuration [VERBOSE|property-name];

運用 TipsDBCS Disaster Recovery in Cloud

DGMGRL> show configuration;

Configuration - fsc

Protection Mode: MaxPerformance Members: ORCL_01 - Primary database ORCL_02 - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:SUCCESS (status updated 47 seconds ago)

構成情報 ( 実行例 )

DGMGRL> SHOW CONFIGURATION VERBOSE;

Configuration - fsc

Protection Mode: MaxPerformance Members: ORCL_01 - Primary database ORCL_02 - Physical standby database

Properties: FastStartFailoverThreshold = '30' OperationTimeout = '120' TraceLevel = 'USER' FastStartFailoverLagLimit = '30' CommunicationTimeout = '180' ObserverReconnect = '0' FastStartFailoverAutoReinstate = 'TRUE' FastStartFailoverPmyShutdown = 'TRUE' BystandersFollowRoleChange = 'ALL' ObserverOverride = 'FALSE' ExternalDestination1 = '' ExternalDestination2 = '' PrimaryLostWriteAction = 'CONTINUE'

Fast-Start Failover: DISABLED

Configuration Status:SUCCESS

構成情報詳細 ( 実行例 )

Page 28: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard 関連情報確認

28

DGMGRL ユーティリティ

運用 TipsDBCS Disaster Recovery in Cloud

DGMGRL> show database 'ORCL_01'

Database - ORCL_01

Role: PRIMARY Intended State: TRANSPORT-ON Instance(s): ORCL

Database Status:SUCCESS

DGMGRL> show database 'ORCL_02'

Database - ORCL_02

Role: PHYSICAL STANDBY Intended State: APPLY-ON Transport Lag: 20 seconds (computed 7 seconds ago) Apply Lag: 21 seconds (computed 7 seconds ago) Average Apply Rate: 2.00 KByte/s Real Time Query: ON Instance(s): JPDG

Database Status:SUCCESS

DGMGRL> show database verbose 'ORCL_01'

Database - JPDG_01 Role: PRIMARY Intended State: TRANSPORT-ON Instance(s): JPDG

Properties: DGConnectIdentifier = 'ORCL_01' ObserverConnectIdentifier = '' LogXptMode = 'ASYNC' RedoRoutes = '' DelayMins = '0' Binding = 'optional' MaxFailure = '0' MaxConnections = '1' ReopenSecs = '300' NetTimeout = '30' RedoCompression = 'DISABLE' LogShipping = 'ON' PreferredApplyInstance = '' ApplyInstanceTimeout = '0' ApplyLagThreshold = '0' TransportLagThreshold = '0' TransportDisconnectedThreshold = '30' ApplyParallel = 'AUTO' StandbyFileManagement = 'AUTO' ArchiveLagTarget = '0' LogArchiveMaxProcesses = '4' LogArchiveMinSucceedDest = '1' DbFileNameConvert = '' LogFileNameConvert = 'dummy, dummy' FastStartFailoverTarget = 'ORCL_02'・・・・ ( 略 ) StaticConnectIdentifier = 'ORCL_01' StandbyArchiveLocation = 'USE_DB_RECOVERY_FILE_DEST' AlternateLocation = '' LogArchiveTrace = '0' LogArchiveFormat = '%t_%s_%r.dbf' TopWaitEvents = '(monitor)'

Database Status:SUCCESS

プライマリ・データベース情報  ( 実行例 )

スタンバイ・データベース情報  ( 実行例 )

プライマリ・データベース情報詳細  ( 実行例 )

Page 29: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard スイッチ・オーバー

29

マイ・サービスからの実行

運用 TipsDBCS Disaster Recovery in Cloud

1. サービスもしくはノードのをクリックし、一覧から『スイッチオーバー』をクリックします

Page 30: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard スイッチ・オーバー

30

マイ・サービスからの実行

運用 TipsDBCS Disaster Recovery in Cloud

2. 『 OK』をクリックして実行します

3. 進捗状況は、『アクティビティ』→『 Activity Summary』 から確認が可能です

4. 各ノードの『データベース・ロール』で、ロールが変換されていることを確認します

Page 31: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard スイッチ・オーバー

31

dbaascli からの実行

運用 TipsDBCS Disaster Recovery in Cloud

1. スイッチ・オーバー先のノードに opc ユーザーでログインします

2. rootユーザー (sudo)→oracle ユーザーの順に切り替えます

3. スイッチ・オーバーを実行します

4. oracle ユーザーからログアウトします

5. ORDS をリスタートします

## 1. opc ユーザーでログインlogin as: opc## 2. root -> oracle ユーザーの順に切り替え$ sudo -s# su - oracle$## 3. スイッチ・オーバーの実行$ dbaascli dataguard switchoverDBAAS CLI version 1.0.0Executing command dataguard switchoverPerforming switchover NOW, please wait...New primary database “ORCL_02” is opening...Operation requires start up of instance “ORCL” on database “ORCL_01”Starting instance “ORCL”...ORACLE instance started.Database mounted.Database opened.Switchover succeeded, new primary is “ORCL_02”SUCCESS : Switchover to Standby operation completed successfully## 4. oracle ユーザーからログアウト$ exit### 5.ORDS をリスタート# /etc/init.d/ords restartINFO: Stopping Oracle REST Data Services...INFO: Oracle REST Data Services stoppedINFO: Starting Oracle REST Data Services...INFO: Oracle REST Data Services started with PID 20400

実行例

Page 32: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard スイッチ・オーバー

32

dbaascli からの実行

運用 TipsDBCS Disaster Recovery in Cloud

6. Data Guard 構成情報から、各データーベースのロールが切り替わっているか確認します

## 6. Data Guard 構成の確認$ dbaascli dataguard statusDBAAS CLI version 1.0.0Executing command dataguard statusSUCCESS : Dataguard is up and running

DETAILS:

Configuration - fsc

Protection Mode: MaxPerformance Members: ORCL_02 - Primary database ORCL_01 - Physical standby database

Properties:   ...( 略 )Fast-Start Failover: DISABLED

Configuration Status:SUCCESS

実行例

Page 33: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard スイッチ・オーバー

33

DGMGRL からの実行

運用 TipsDBCS Disaster Recovery to Cloud

1. 現在の Data Guard 構成を確認します

2. スイッチ・オーバーが可能な状態か確認します

実行例## 1. 現在の Data Guard 構成を確認DGMGRL> show configuration;

Configuration - fsc

Protection Mode: MaxPerformance Members: ORCL_01- Primary database ORCL_02- Physical standby database

Fast-Start Failover: DISABLEDConfiguration Status:SUCCESS (status updated 34 seconds ago)

## 2. スイッチ・オーバーが可能か確認DGMGRL> validate database 'ORCL_02'; Database Role: Physical standby database Primary Database: ORCL_01

Ready for Switchover: Yes Ready for Failover: Yes (Primary Running)

Current Log File Groups Configuration: Thread # Online Redo Log Groups Standby Redo Log Groups Status (ORCL_01) (ORCL_02) 1 3 2 Insufficient SRLs Future Log File Groups Configuration: Thread # Online Redo Log Groups Standby Redo Log Groups Status (ORCL_02) (ORCL_01) 1 3 2 Insufficient SRLs

Page 34: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard スイッチ・オーバー

34

DGMGRL からの実行

運用 TipsDBCS Disaster Recovery to Cloud

3. スイッチ・オーバーを実行します

4. Data Guard 構成情報から、各データーベースのロールが切り替わっているか確認します

## 3. スイッチ・オーバーを実行DGMGRL> switchover to 'ORCL_02';Performing switchover NOW, please wait...Operation requires a connection to instance "ORCL" on database "ORCL_02"Connecting to instance "ORCL_02"...Connected as SYSDBA.New primary database "ORCL_02" is opening...Operation requires start up of instance "ORCL" on database "ORCL_01"Starting instance "ORCL_01"...ORACLE instance started.Database mounted.Switchover succeeded, new primary is "ORCL_02“

## 4. 現在の Data Guard 構成を確認DGMGRL> show configuration;

Configuration - fsc

Protection Mode: MaxPerformance Members: ORCL_02- Primary database ORCL_01- Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:SUCCESS (status updated 34 seconds ago)

実行例

Page 35: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard フェイル・オーバー

35

マイ・サービスからの実行

運用 TipsDBCS Disaster Recovery in Cloud

1. サービスもしくはノードのをクリックし、一覧から Failover をクリックします

Page 36: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard フェイル・オーバー

36

マイ・サービスからの実行

運用 TipsDBCS Disaster Recovery in Cloud

2. 『 OK』をクリックして実行します

3. 進捗状況は、『アクティビティ』→『 Activity Summary』 から確認が可能です

4. 各ノードの『データベース・ロール』で、ロールが変換されていることを確認します• 旧プライマリ・データベースは、『回復』が必要なデータベース状態となります

Page 37: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard フェイル・オーバー

37

dbaascli からの実行

運用 TipsDBCS Disaster Recovery in Cloud

1. スイッチ・オーバー先のノードに opc ユーザーでログインします

2. rootユーザー (sudo)→oracle ユーザーの順に切り替えます

3. フェイル・オーバーを実行します4. oracle ユーザーからログアウト

します5. ORDS をリスタートします

## 1. opc ユーザーでログインlogin as: opc

## 2. root -> oracle ユーザーの順に切り替え$ sudo -s# su - oracle$

## 3. スイッチ・オーバーの実行$ dbaascli dataguard failoverDBAAS CLI version 1.0.0Executing command dataguard failoverPerforming failover NOW, please wait...Failover succeeded, new primary is “ORCL_02"SUCCESS : Successfully failed over to Standby

## 4. oracle ユーザーからログアウト$ exit#

## 5.ORDS をリスタート# /etc/init.d/ords restartINFO: Stopping Oracle REST Data Services...INFO: Oracle REST Data Services stoppedINFO: Starting Oracle REST Data Services...INFO: Oracle REST Data Services started with PID 20400

実行例

Page 38: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard フェイル・オーバー

38

dbaascli からの実行

運用 TipsDBCS Disaster Recovery in Cloud

6. Data Guard 構成情報から、各データーベースのロールが切り替わっているか確認します• 旧プライマリ・データベース

は、回復が必要なデータベース状態 (reinstate) となります

## 6. Data Guard 構成の確認$ dbaascli dataguard statusDBAAS CLI version 1.0.0Executing command dataguard statusSUCCESS : Dataguard is up and running

DETAILS:

Configuration - fsc

Protection Mode: MaxPerformance Members: ORCL_02 - Primary database ORCL_01 - Physical standby database (disabled) ORA-16661: the standby database needs to be reinstated Properties:   ...( 略 )Fast-Start Failover: DISABLED

Configuration Status:SUCCESS

実行例

Page 39: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard フェイル・オーバー

39

DGMGRL からの実行

運用 TipsDBCS Disaster Recovery to Cloud

1. 現在の Data Guard 構成を確認します

2. フェイル・オーバーが可能な状態か確認します

実行例## 1. 現在の Data Guard 構成を確認DGMGRL> show configuration;

Configuration - fsc

Protection Mode: MaxPerformance Members: ORCL_01- Primary database ORCL_02- Physical standby database

Fast-Start Failover: DISABLEDConfiguration Status:SUCCESS (status updated 34 seconds ago)

## 2. スイッチ・オーバーが可能か確認DGMGRL> validate database 'ORCL_02'; Database Role: Physical standby database Primary Database: ORCL_01

Ready for Switchover: Yes Ready for Failover: Yes (Primary Running)

Current Log File Groups Configuration: Thread # Online Redo Log Groups Standby Redo Log Groups Status (ORCL_01) (ORCL_02) 1 3 2 Insufficient SRLs Future Log File Groups Configuration: Thread # Online Redo Log Groups Standby Redo Log Groups Status (ORCL_02) (ORCL_01) 1 3 2 Insufficient SRLs

Page 40: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard フェイル・オーバー

40

DGMGRL からの実行

運用 TipsDBCS Disaster Recovery to Cloud

3. フェイル・オーバーを実行します

4. Data Guard 構成情報から、各データーベースのロールが切り替わっているか確認します• 旧プライマリ・データベース

は、回復が必要なデータベース状態 (reinstate) となります

## 3. フェイル・オーバーを実行DGMGRL> failover to 'ORCL_02';Performing failover NOW, please wait...Failover succeeded, new primary is “ORCL_02"

## 4. 現在の Data Guard 構成を確認DGMGRL> show configuration;

Configuration - pri

Protection Mode: MaxPerformance Members: ORCL_02- Primary database ORCL_01- Physical standby database (disabled) ORA-16795: the standby database needs to be re-created

Fast-Start Failover: DISABLED

Configuration Status:SUCCESS (status updated 34 seconds ago)

実行例

Page 41: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard 旧プライマリ・データベースの回復

41

マイ・サービスからの実行

運用 TipsDBCS Disaster Recovery in Cloud

• フェイル・オーバー実行後、旧プライマリ・データベースは無効化され、再作成 /回復が必要な状態になります

• DBCS で作成された Data Guard のデータベースは、デフォルトでフラッシュバック・データベースが有効化されているので、 Broker の回復機能が使用可能です

1. サービスもしくはノードのをクリックし、一覧から 『回復』をクリックします

Page 42: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard 旧プライマリ・データベースの回復

42

マイ・サービスからの実行

運用 TipsDBCS Disaster Recovery in Cloud

2. 『 OK』をクリックして実行します

3. 進捗状況は、『アクティビティ』→『 Activity Summary』 から確認が可能です

4. 旧プライマリ・データベースのデータベース・ロールが、『スタンバイ』に変わっているか確認します

Page 43: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard フェイル・オーバー

43

dbaascli からの実行

運用 TipsDBCS Disaster Recovery in Cloud

1. 旧プライマリのノードに oracle ユーザーでログインします

2. 旧プライマリの回復 (reinstate)を実行します

3. 現在の Data Guard 構成を確認します

## 1. oracle ユーザーでログインlogin as: oracle

## 2. 旧プライマリの回復の実行$ dbaascli dataguard reinstateDBAAS CLI version 1.0.0Executing command dataguard reinstateSuccessfully reinstated dataguard instancesDetail : Successfully reinstated database : ORCL_01

## 3. 現在の Data Guard 構成を確認$ dbaascli dataguard statusDBAAS CLI version 1.0.0Executing command dataguard statusSUCCESS : Dataguard is up and running

DETAILS:Configuration - fsc

Protection Mode: MaxPerformance Members: ORCL_02 - Primary database ORCL_01 - Physical standby databaseProperties:   ...( 略 )Fast-Start Failover: DISABLED

Configuration Status:SUCCESS

実行例

Page 44: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard 旧プライマリ・データベースの回復

44

DGMGRL からの実行

運用 TipsDBCS Disaster Recovery to Cloud

1. 現在の Data Guard 構成を確認します

2. データベースの回復を実行します3. Data Guard 構成情報から、旧

プライマリがスタンバイ・ロールに変わっているかを確認します

## 1. 現在の Data Guard 構成を確認DGMGRL> show configuration;Configuration - pri

Protection Mode: MaxPerformance Members: ORCL_02- Primary database ORCL_01- Physical standby database (disabled) ORA-16795: the standby database needs to be re-created

Fast-Start Failover: DISABLEDConfiguration Status:SUCCESS (status updated 34 seconds ago)

## 2. データベースの回復を実行DGMGRL> reinstate database 'ORCL_01';Reinstating database “ORCL_01", please wait...

## 3. 現在の Data Guard 構成を確認DGMGRL> show configurationConfiguration - pri

Protection Mode: MaxPerformance Members: ORCL_02- Primary database ORCL_01- Physical standby database

Fast-Start Failover: DISABLEDConfiguration Status:SUCCESS (status updated 34 seconds ago)

実行例

Page 45: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard スナップショット・スタンバイへの変換

45

DGMGRL からの実行

運用 TipsDBCS Disaster Recovery to Cloud

スナップショットへの変換は、DGMGRL もしくは SQL*Plus での操作になります

1. 現在の Data Guard 構成を確認します

2. スナップショット・スタンバイへの変換を実行します

3. Data Guard 構成情報から、スタンバイ・データベースのロールがスナップショット・スタンバイに切り替わっているか確認します

## 1. 現在の Data Guard 構成を確認DGMGRL> show configuration;Configuration - fsc

Protection Mode: MaxPerformance Members: ORCL_01- Primary database ORCL_02- Physical standby database

Fast-Start Failover: DISABLEDConfiguration Status:SUCCESS (status updated 34 seconds ago)

## 2. スナップショット・スタンバイへの変換を実行DGMGRL> convert database 'ORCL_02' to snapshot standby;Converting database “ORCL_02" to a Snapshot Standby database, please wait...Database “ORCL_02" converted successfully

## 3. 現在の Data Guard 構成を確認DGMGRL> show configuration;Configuration - fsc

Protection Mode: MaxPerformance Members: ORCL_01- Primary database ORCL_02- Snapshot standby database

Fast-Start Failover: DISABLEDConfiguration Status:SUCCESS (status updated 34 seconds ago)

実行例

Page 46: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Data Guard スナップショット・スタンバイへの変換

46

DGMGRL からの実行

運用 TipsDBCS Disaster Recovery to Cloud

3. R/W モードでの処理完了後、再度スタンバイ・データベースに戻します

4. Data Guard 構成情報から、スタンバイ・データベースのロールが、フィジカル・スタンバイに切り替わっているか確認します

## 3. フィジカル・スタンバイデータベースへの変換を実行DGMGRL> CONVERT DATABASE 'ORCL_02' to physical standby;Converting database “ORCL_02" to a Physical Standby database, please wait...

Operation requires shut down of instance “ORCL" on database “ORCL_02"Shutting down instance “ORCL"...Database closed.Database dismounted.ORACLE instance shut down.Operation requires start up of instance “ORCL" on database “ORCL_02"Starting instance “ORCL"...ORACLE instance started.Database mounted.Continuing to convert database “ORCL_02" ...Database “ORCL_02" converted successfully

## 4. 現在の Data Guard 構成を確認DGMGRL> show configuration;Configuration - fsc

Protection Mode: MaxPerformance Members: ORCL_01- Primary database ORCL_02- Physical standby database

Fast-Start Failover: DISABLEDConfiguration Status:SUCCESS (status updated 34 seconds ago)

実行例

Page 47: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 47

参考資料リンク

• White Paper: Disaster Recovery in the Oracle Cloud http://www.oracle.com/technetwork/database/availability/cloud-to-cloud-dr-3046095.pdf

• Oracle Database Cloud Data Guard 機能にいついてhttp://www.slideshare.net/oracle4engineer/oracle-database-cloud-data-guard

• Oracle Maximum Availability Architecture http://www.oracle.com/technetwork/jp/content/maa-094615-ja.html

Page 48: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Oracle Cloud Service 30日間無料トライアル 

48

トライアルのお申し込みサイト 

トライアルのお申し込みサイトはコチラ - 上記サイトより、ご利用したいクラウドサービスを選択し、お申し込み頂けます。- Oracle PaaS の各サービスは「プラットフォームとインフラ」項目をご参照ください。

https://cloud.oracle.com/ja_JP/tryit

Database Cloud トライアル申し込みご案内

お申し込みは数ステップでカンタン! 30日間お試し放題!!

- Database Cloud Service のトライアルを申し込むと、 Database Backup Service や Java Cloud Service などもトライアル可能です!- 上記 FAQ サイトにてチュートリアルも提供しております:

- Oracle Database Cloud Serviceを使ってみよう- Oracle Database Cloud Service 体験チュートリアル - トライアル環境を使用したAPEXアプリケーション作成

DBCS の詳細なお申込み方法は FAQ にてご案内しております。

https://faq.oracle.co.jp/app/answers/detail/a_id/2809 へアクセス

Page 49: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 49

Page 50: Oracle Cloud デザイン・パターン -DBCS Disaster Recovery in Cloud-