1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Oracle Data Guard per Pluggable Database (DGPDB)でReal Time Queryを試してみた

Posted at

はじめに

本記事は、「Oracle Database 23aiのData Guard per Pluggable Database (DGPDB)を構築してみた」の続編です。

上記記事で作成したDGPDBの環境でReal Time Queryを試していきます。
環境の情報は上記記事をご参考ください。

image.png

検証概要

以下、検証概要です。
image.png
TOKYO_SALES (ソースPDB)にInsert文を実行し、OSAKA_SALES (ターゲットPDB)をREAD ONLYで起動し、データが更新されていることを確認します。

検証内容

  • OSAKA_SALES (ターゲットPDB)をREAD ONLYで起動する
SQL> show pdbs

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
	 2 PDB$SEED			  READ ONLY  NO
	 3 OSAKA_PUB			  READ WRITE NO
	 4 OSAKA_SALES			  MOUNTED
SQL> alter pluggable database osaka_sales open;

Pluggable database altered.

SQL> show pdbs

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
	 2 PDB$SEED			  READ ONLY  NO
	 3 OSAKA_PUB			  READ WRITE NO
	 4 OSAKA_SALES			  READ ONLY  NO
  • Data Guard BrokerでOSAKA_SALESのステータスを確認し、Real Time Queryが"ON"になっていることを確認する
DGMGRL> show pluggable database osaka_sales at osaka_1

Pluggable database - OSAKA_SALES at osaka_1

  Data Guard Role:     Physical Standby
  Con_ID:              4
  Source:              con_id 3 at tokyo_1
  Transport Lag:       0 seconds (computed 2 seconds ago)
  Apply Lag:           0 seconds (computed 2 seconds ago)
  Intended State:      APPLY-ON
  Apply State:         Running
  Apply Instance:      osaka
  Average Apply Rate:  2 KByte/s
  Real Time Query:     ON

Pluggable Database Status:
SUCCESS
  • データをInsertする表を確認する

TOKYO_SALES:

SQL> alter session set container = tokyo_sales;

Session altered.

SQL> select * from testuser.employee;

ID  NAME
--- ----------
1   James

OSAKA_SALES:

SQL> alter session set container = osaka_sales;

Session altered.

SQL> select * from testuser.employee;

ID  NAME
--- ----------
1   James
  • TOKYO_SALES (ソースPDB)のテスト表 (employee表)にデータをInsertする
SQL> select * from testuser.employee;

ID  NAME
--- ----------
1   James

SQL> INSERT INTO testuser.employee (ID, Name) Values ('2', 'Mike');

1 row created.

SQL> commit;

Commit complete.

SQL> select * from testuser.employee;

ID  NAME
--- ----------
1   James
2   Mike
  • OSAKA_SALES (ターゲットPDB)で更新を確認する
SQL> alter session set container = osaka_sales;

Session altered.

SQL> select * from testuser.employee;

ID  NAME
--- ----------
1   James
2   Mike

今回の内容は以上です。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?