Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Menyiapkan observer Data Guard di Google Cloud
Compute Engine
Bergantung pada persyaratan ketersediaan tinggi,
Anda dapat mengotomatiskan failover antar-database. Setelah
memvalidasi deployment Data Guard,
Anda memiliki opsi untuk menyiapkan observer Data Guard di Compute Engine untuk melakukannya.
Pengamat adalah proses yang memantau konfigurasi Data Guard untuk memulai
failover otomatis jika kondisi memungkinkan.
Panduan ini membahas penginstalan klien database Oracle 19c di virtual machine (VM) pengamat dan mengonfigurasi Failover Fast-Start.
Jaringan. Subnet dengan aturan firewall yang mengizinkan akses dari Virtual Private Cloud Anda ke host Solusi Bare Metal yang menjalankan database utama dan cadangan.
Penyimpanan. -- Minimal 20 GB dialokasikan ke disk booting.
Login ke VM dan pastikan nama host SCAN dari setiap cluster database
di-resolve di DNS:
Jika nama host tidak di-resolve, tambahkan alamat IP untuk setiap nama host SCAN
ke file /etc/hosts di VM. Ganti contoh alamat IP dengan alamat IP untuk setiap cluster:
Instal RPM Oracle Database.
Hanya instal software. Anda tidak perlu mengonfigurasi database di VM pengamat.
RPM Oracle Database menginstal software di direktori yang telah ditentukan. Tambahkan
entri berikut ke /home/oracle/.bash_profile untuk menambahkan direktori utama
software Oracle ke jalur:
Oracle Database versi 12.2 dan yang lebih tinggi menyertakan dukungan agar pengamat dapat
berjalan dalam mode latar belakang. Untuk melakukannya, dompet harus dibuat untuk melakukan autentikasi tanpa sandi ke database. Login sebagai pengguna oracle di VM pengamat dan lakukan tugas berikut untuk membuat dompet:
Tambahkan entri berikut ke $ORACLE_HOME/network/admin/sqlnet.ora:
Buat direktori dompet di VM yang menghosting observer:
mkdir/home/oracle/wallet
Lakukan inisialisasi dompet, lalu berikan sandi untuk dompet saat
diminta:
mkstore-wrl/home/oracle/wallet-create
Buat entri di dompet untuk setiap database dalam konfigurasi Data Guard. Perintah mkstore akan meminta sandi SYS untuk database, diikuti dengan sandi dompet yang diberikan di langkah sebelumnya:
Pastikan dompet berisi kredensial untuk setiap database dalam
konfigurasi Data Guard. Argumen -listCredential untuk mkstore
akan meminta sandi dompet:
mkstore-wrl/home/oracle/wallet-listCredential
Login ke VM observer sebagai Oracle, lalu uji konektivitas ke database utama dan standby. Hubungkan ke database utama dan sekunder
dengan SQL*Plus menggunakan kredensial dompet:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-04 UTC."],[[["\u003cp\u003eThis guide outlines the process of setting up a Data Guard observer on a Google Cloud Compute Engine VM to automate database failover.\u003c/p\u003e\n"],["\u003cp\u003eThe setup involves creating a VM with specific operating system, networking, and storage criteria, followed by installing the Oracle 19c database client software.\u003c/p\u003e\n"],["\u003cp\u003eDatabase connectivity is configured by updating \u003ccode\u003etnsnames.ora\u003c/code\u003e and \u003ccode\u003esqlnet.ora\u003c/code\u003e, and creating a wallet for passwordless authentication.\u003c/p\u003e\n"],["\u003cp\u003eFast-Start Failover (FSFO) is enabled and configured using the Data Guard broker, which can automate failover between primary and standby databases.\u003c/p\u003e\n"],["\u003cp\u003eThe final steps include starting the Data Guard observer and verifying the configuration status to ensure it is successful, with a target, and a defined observer.\u003c/p\u003e\n"]]],[],null,["# Set up a Data Guard observer on Google Cloud Compute Engine\n\nSet up a Data Guard observer on Google Cloud\nCompute Engine\n===========================================================\n\nDepending on your [high availability requirements](https://docs.oracle.com/en/database/oracle/oracle-database/19/haovw/ha-requirements-architecture.html).\nyou might want to automate failover between databases. After you've\n[validated your Data Guard deployment](/bare-metal/docs/solutions/oracle/data-guard-setup/validate),\nyou have the option to set up a Data Guard observer on Compute Engine to do this.\nAn observer is a process that monitors a Data Guard configuration to initiate\nan automated failover if conditions warrant it.\n\nThis guide covers installing the Oracle 19c database client on an observer\nvirtual machine (VM) and configuring Fast-Start Failover.\n\nThe following examples are used throughout this guide:\n\nInstall the Oracle Database client software\n-------------------------------------------\n\n1. [Create a virtual machine (VM) on Compute Engine](/compute/docs/instances/create-start-instance)\n that meets the following criteria:\n\n - **Operating system.** Red Hat Enterprise Linux 7.\n\n - **Networking.** A subnet with firewall rules that allow access from your\n Virtual Private Cloud to the Bare Metal Solution hosts running the primary and standby\n databases.\n\n - **Storage.** -- At least 20 GB allocated to the boot disk.\n\n2. Log in to the VM and verify that the SCAN hostname of each database cluster\n resolves in DNS:\n\n host \u003cvar translate=\"no\"\u003eDBDG_SITE1_SCAN_HOSTNAME\u003c/var\u003e\n host \u003cvar translate=\"no\"\u003eDBDG_SITE2_SCAN_HOSTNAME\u003c/var\u003e\n\n If the hostnames don't resolve, add the IP addresses for each SCAN hostname\n to the `/etc/hosts` file on the VM. Replace the example IP addresses with\n the IP addresses for each cluster: \n\n # Site 1 SCAN Hosts\n 192.0.2.10 \u003cvar translate=\"no\"\u003eDBDG_SITE1_SCAN_HOSTNAME\u003c/var\u003e\n 192.0.2.11 \u003cvar translate=\"no\"\u003eDBDG_SITE1_SCAN_HOSTNAME\u003c/var\u003e\n 192.0.2.12 \u003cvar translate=\"no\"\u003eDBDG_SITE1_SCAN_HOSTNAME\u003c/var\u003e\n\n # Site 2 SCAN Hosts\n 198.51.100.10 \u003cvar translate=\"no\"\u003eDBDG_SITE2_SCAN_HOSTNAME\u003c/var\u003e\n 198.51.100.11 \u003cvar translate=\"no\"\u003eDBDG_SITE2_SCAN_HOSTNAME\u003c/var\u003e\n 198.51.100.12 \u003cvar translate=\"no\"\u003eDBDG_SITE2_SCAN_HOSTNAME\u003c/var\u003e\n\n3. [Install the Oracle Database RPM](https://docs.oracle.com/en/database/oracle/oracle-database/19/ladbi/running-rpm-packages-to-install-oracle-database.html#GUID-BB7C11E3-D385-4A2F-9EAF-75F4F0AACF02).\n Install only the software. There's no need to configure a database on the\n observer VM.\n\n4. The Oracle Database RPM installs software in a predefined directory. Add the\n following entries to `/home/oracle/.bash_profile` to add the Oracle software\n home to the path:\n\n cat \u003e\u003e /home/oracle/.bash_profile \u003c\u003c EOL\n export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1\n export PATH=\\$PATH:\\$ORACLE_HOME/bin\n EOL\n\n5. Source the Oracle environment variables in your terminal session:\n\n source ~/.bash_profile\n\nConfigure the database connectivity\n-----------------------------------\n\n1. Configure the Oracle Net settings in the `$ORACLE_HOME/network/admin/tsnames.ora`\n file:\n\n \u003cvar translate=\"no\"\u003eDBDG_SITE1\u003c/var\u003e =\n (DESCRIPTION =\n (ADDRESS = (PROTOCOL = TCP)(HOST = \u003cvar translate=\"no\"\u003eDBDG_SITE1_SCAN_HOSTNAME\u003c/var\u003e)(PORT = 1521))\n (CONNECT_DATA =\n (SERVER = DEDICATED)\n (SERVICE_NAME = \u003cvar translate=\"no\"\u003eDBDG_SITE1\u003c/var\u003e) (UR=A)\n )\n )\n\n \u003cvar translate=\"no\"\u003eDBDG_SITE2\u003c/var\u003e =\n (DESCRIPTION =\n (ADDRESS = (PROTOCOL = TCP)(HOST = \u003cvar translate=\"no\"\u003eDBDG_SITE2_SCAN_HOSTNAME\u003c/var\u003e)(PORT = 1521))\n (CONNECT_DATA =\n (SERVER = DEDICATED)\n (SERVICE_NAME = \u003cvar translate=\"no\"\u003eDBDG_SITE2\u003c/var\u003e) (UR=A)\n )\n )\n\n2. Oracle Database version 12.2 and higher includes support for the observer to\n run in background mode. To do so, a wallet must be created to perform\n passwordless authentication to the database. Log in as the oracle user on\n the observer VM and perform the following tasks to create a wallet:\n\n 1. Add the following entries to `$ORACLE_HOME/network/admin/sqlnet.ora`:\n\n WALLET_LOCATION =\n (SOURCE =\n (METHOD = FILE)\n (METHOD_DATA = (DIRECTORY = /home/oracle/wallet))\n )\n SQLNET.WALLET_OVERRIDE = TRUE\n\n 2. Create the wallet directory on the VM hosting the observer:\n\n mkdir /home/oracle/wallet\n\n 3. Initialize the wallet, then supply a password for the wallet when\n prompted:\n\n mkstore -wrl /home/oracle/wallet -create\n\n 4. Create an entry in the wallet for each database in the Data Guard\n configuration. The `mkstore` command will request the SYS password for the\n database, followed by the wallet password provided in the previous step:\n\n mkstore -wrl /home/oracle/wallet -createCredential \u003cvar translate=\"no\"\u003eDBDG_SITE1\u003c/var\u003e sys\n mkstore -wrl /home/oracle/wallet -createCredential \u003cvar translate=\"no\"\u003eDBDG_SITE2\u003c/var\u003e sys\n\n 5. Confirm that the wallet contains credentials for each database in the\n Data Guard configuration. The `-listCredential` argument for `mkstore`\n will request the wallet password:\n\n mkstore -wrl /home/oracle/wallet -listCredential\n\n3. Log in to the observer VM as Oracle and then test connectivity to the\n primary and standby databases. Connect to the primary and secondary\n databases with SQL\\*Plus by using the wallet credentials:\n\n sqlplus /@\u003cvar translate=\"no\"\u003eDBDG_SITE1\u003c/var\u003e as sysdba\n sqlplus /@\u003cvar translate=\"no\"\u003eDBDG_SITE2\u003c/var\u003e as sysdba\n\n If the wallet configuration is successful, the `sqlplus` command directly\n logs in to the database without asking for a password.\n\nConfigure and enable Fast-Start Failover\n----------------------------------------\n\n1. Create a directory to store the observer configuration and log files:\n\n mkdir /home/oracle/fsfo\n\n2. Connect to the Data Guard broker on the primary database using the wallet:\n\n dgmgrl\n CONNECT /@\u003cvar translate=\"no\"\u003eDBDG_SITE1\u003c/var\u003e;\n\n3. View the Data Guard status to check that the configuration is marked as\n `SUCCESS`:\n\n SHOW CONFIGURATION;\n\n4. Enable Fast-Start Failover (FSFO):\n\n ENABLE FAST_START FAILOVER;\n\n Enabling FSFO does not make the configuration ready for automatic failover.\n Automatic failover requires an observer.\n5. Start Data Guard Observer:\n\n START OBSERVER observer1 IN BACKGROUND FILE IS '/home/oracle/fsfo/observer1_DBDG.dat' LOGFILE IS '/home/oracle/fsfo/observer1_DBDG.log';\n\n6. In a separate terminal session, verify the configuration:\n\n SHOW CONFIGURATION VERBOSE;\n\n The following example shows the verbose mode of the `show configuration`\n command. If the configuration status is `SUCCESS`, your setup is complete. \n\n Configuration - DBDG\n\n Protection Mode: MaxAvailability\n Members:\n \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nx\"\u003eDBDG_SITE1\u003c/span\u003e\u003c/var\u003e - Primary database\n \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nx\"\u003eDBDG_SITE2\u003c/span\u003e\u003c/var\u003e - Physical standby database\n\n (*) Fast-Start Failover target\n\n Properties:\n FastStartFailoverThreshold = '30'\n OperationTimeout = '30'\n TraceLevel = 'USER'\n FastStartFailoverLagLimit = '45'\n CommunicationTimeout = '180'\n ObserverReconnect = '0'\n FastStartFailoverAutoReinstate = 'TRUE'\n FastStartFailoverPmyShutdown = 'TRUE'\n BystandersFollowRoleChange = 'ALL'\n ObserverOverride = 'FALSE'\n ExternalDestination1 = ''\n ExternalDestination2 = ''\n PrimaryLostWriteAction = 'CONTINUE'\n ConfigurationWideServiceName = 'DBDG_CFG'\n\n Fast-Start Failover: Enabled in Potential Data Loss Mode\n Lag Limit: 45 seconds\n Threshold: 30 seconds\n Active Target: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nx\"\u003eDBDG_SITE2\u003c/span\u003e\u003c/var\u003e\n Potential Targets: \"\u003cvar translate=\"no\"\u003eDBDG_SITE2\u003c/var\u003e\"\n \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nx\"\u003eDBDG_SITE2\u003c/span\u003e\u003c/var\u003e valid\n Observer: observer1\n Shutdown Primary: TRUE\n Auto-reinstate: TRUE\n Observer Reconnect: (none)\n Observer Override: FALSE\n\n Configuration Status:\n SUCCESS"]]