Google

Professional Cloud Database Engineer Free Practice Questions — Page 5

Question 41

Your DevOps team is using Terraform to deploy applications and Cloud SQL databases. After every new application change is rolled out, the environment is torn down and recreated, and the persistent database layer is lost. You need to prevent the database from being dropped. What should you do?

A. Set Terraform deletion_protection to true.
B. Rerun terraform apply.
C. Create a read replica.
D. Use point-in-time-recovery (PITR) to recover the database.
Show Answer
Correct Answer: A
Explanation:
The problem is that Terraform destroys and recreates the environment, causing the Cloud SQL database to be dropped. The correct solution is to prevent destruction of the database resource. In Terraform this is done by enabling deletion protection (for Cloud SQL) or using the lifecycle block with prevent_destroy = true for stateful resources. This ensures the database is preserved even when the rest of the infrastructure is torn down and redeployed. The other options do not prevent database deletion.

Question 42

You have deployed a Cloud SQL for SQL Server instance. In addition, you created a cross-region read replica for disaster recovery (DR) purposes. Your company requires you to maintain and monitor a recovery point objective (RPO) of less than 5 minutes. You need to verify that your cross-region read replica meets the allowed RPO. What should you do?

A. Use Cloud SQL instance monitoring.
B. Use the Cloud Monitoring dashboard with available metrics from Cloud SQL.
C. Use Cloud SQL logs.
D. Use the SQL Server Always On Availability Group dashboard.
Show Answer
Correct Answer: B
Explanation:
RPO for a read replica is measured by replication lag. Cloud SQL exposes replica lag as Cloud Monitoring metrics (for example, cloudsql.googleapis.com/database/replication/replica_lag), which let you visualize historical lag and create alerts to ensure it stays under 5 minutes. This is the supported, cloud-native way to verify and continuously monitor RPO for Cloud SQL. The SQL Server Always On dashboard is not the appropriate or supported tool for monitoring RPO in a managed Cloud SQL service.

Question 43

You are a DBA of Cloud SQL for PostgreSQL. You want the applications to have password-less authentication for read and write access to the database. Which authentication mechanism should you use?

A. Use Identity and Access Management (IAM) authentication.
B. Use Managed Active Directory authentication.
C. Use Cloud SQL federated queries.
D. Use PostgreSQL database's built-in authentication.
Show Answer
Correct Answer: A
Explanation:
Cloud SQL for PostgreSQL supports IAM database authentication, which allows applications to authenticate using IAM identities and tokens instead of database passwords. This provides password-less read and write access. Managed AD is not used for Cloud SQL PostgreSQL, federated queries are unrelated, and PostgreSQL built-in authentication requires passwords.

Question 44

You are managing a Cloud SQL for PostgreSQL instance in Google Cloud. You have a primary instance in region 1 and a read replica in region 2. After a failure of region 1, you need to make the Cloud SQL instance available again. You want to minimize data loss and follow Google-recommended practices. What should you do?

A. Restore the Cloud SQL instance from the automatic backups in region 3.
B. Restore the Cloud SQL instance from the automatic backups in another zone in region 1.
C. Check "Lag Bytes" in the monitoring dashboard for the primary instance in the read replica instance. Check the replication status using pg_catalog.pg_last_wal_receive_lsn(). Then, fail over to region 2 by promoting the read replica instance.
D. Check your instance operational log for the automatic failover status. Look for time, type, and status of the operations. If the failover operation is successful, no action is necessary. Otherwise, manually perform gcloud sql instances failover .
Show Answer
Correct Answer: C
Explanation:
With a cross-region read replica already in place, Google-recommended disaster recovery is to promote the replica to become the new primary to minimize data loss. Checking replication lag/LSN helps assess potential data loss before promotion. Restoring from backups (A, B) would result in more data loss and longer recovery, and Cloud SQL does not automatically fail over to read replicas (so D is incorrect).

Question 45

You want to migrate an on-premises mission-critical PostgreSQL database to Cloud SQL. The database must be able to withstand a zonal failure with less than five minutes of downtime and still not lose any transactions. You want to follow Google-recommended practices for the migration. What should you do?

A. Take nightly snapshots of the primary database instance, and restore them in a secondary zone.
B. Build a change data capture (CDC) pipeline to read transactions from the primary instance, and replicate them to a secondary instance.
C. Create a read replica in another region, and promote the read replica if a failure occurs.
D. Enable high availability (HA) for the database to make it regional.
Show Answer
Correct Answer: D
Explanation:
Cloud SQL High Availability (HA) deploys a regional instance with synchronous replication to a standby in another zone. This is the Google‑recommended approach for mission‑critical databases and provides automatic failover with minimal downtime and no data loss during a zonal failure. The other options do not meet the <5‑minute downtime and zero data loss requirement.

Question 46

You are migrating your 2 TB on-premises PostgreSQL cluster to Compute Engine. You want to set up your new environment in an Ubuntu virtual machine instance in Google Cloud and seed the data to a new instance. You need to plan your database migration to ensure minimum downtime. What should you do?

A. 1. Take a full export while the database is offline. 2. Create a bucket in Cloud Storage. 3. Transfer the dump file to the bucket you just created. 4. Import the dump file into the Google Cloud primary server. B.1. Take a full export while the database is offline. 2. Create a bucket in Cloud Storage. 3. Transfer the dump file to the bucket you just created. 4. Restore the backup into the Google Cloud primary server.
C. 1. Take a full backup while the database is online. 2. Create a bucket in Cloud Storage. 3. Transfer the backup to the bucket you just created. 4. Restore the backup into the Google Cloud primary server. 5. Create a recovery.conf file in the $PG_DATA directory. 6. Stop the source database. 7. Transfer the write ahead logs to the bucket you created before. 8. Start the PostgreSQL service. 9. Wait until Google Cloud primary server syncs with the running primary server.
D. 1. Take a full export while the database is online. 2. Create a bucket in Cloud Storage. 3. Transfer the dump file and write-ahead logs to the bucket you just created. 4. Restore the dump file into the Google Cloud primary server. 5. Create a recovery.conf file in the $PG_DATA directory. 6. Stop the source database. 7. Transfer the write-ahead logs to the bucket you created before. 8. Start the PostgreSQL service. 9. Wait until the Google Cloud primary server syncs with the running primary server.
Show Answer
Correct Answer: C
Explanation:
To minimize downtime for a large (2 TB) PostgreSQL migration to Compute Engine, you should seed the target using an online physical backup (base backup) and then apply WALs for catch-up. Option C correctly uses an online full backup, restores it on the GCE instance, configures recovery to replay WALs, and synchronizes until cutover. Logical exports (A, B, D) are slower for large datasets and/or require extended downtime and cannot efficiently keep the target in sync, making them unsuitable for minimal downtime migrations.

Question 47

You need to issue a new server certificate because your old one is expiring. You need to avoid a restart of your Cloud SQL for MySQL instance. What should you do in your Cloud SQL instance?

A. Issue a rollback, and download your server certificate.
B. Create a new client certificate, and download it.
C. Create a new server certificate, and download it.
D. Reset your SSL configuration, and download your server certificate.
Show Answer
Correct Answer: C
Explanation:
To avoid restarting a Cloud SQL for MySQL instance while rotating an expiring server certificate, you should create a new server certificate and download it. Cloud SQL allows server certificate rotation without requiring an instance restart, whereas enforcing or resetting SSL settings could trigger a restart. Client certificates are not relevant when the server certificate is expiring.

Question 48

Your company's mission-critical, globally available application is supported by a Cloud Spanner database. Experienced users of the application have read and write access to the database, but new users are assigned read-only access to the database. You need to assign the appropriate Cloud Spanner Identity and Access Management (IAM) role to new users being onboarded soon. What roles should you set up?

A. roles/spanner.databaseReader
B. roles/spanner.databaseUser
C. roles/spanner.viewer
D. roles/spanner.backupWriter
Show Answer
Correct Answer: A
Explanation:
New users require read-only access to Cloud Spanner databases. roles/spanner.databaseReader grants permission to read data and schemas in a database without allowing writes. roles/spanner.databaseUser allows read/write, roles/spanner.viewer only allows viewing Spanner resources (not reading database data), and roles/spanner.backupWriter is unrelated to database access.

Question 49

Your company is migrating all legacy applications to Google Cloud. All on-premises applications are using legacy Oracle 12c databases with Oracle Real Application Cluster (RAC) for high availability (HA) and Oracle Data Guard for disaster recovery. You need a solution that requires minimal code changes, provides the same high availability you have today on-premises, and supports a low latency network for migrated legacy applications. What should you do?

A. Migrate the databases to Cloud Spanner.
B. Migrate the databases to Cloud SQL, and enable a standby database.
C. Migrate the databases to Compute Engine using regional persistent disks.
D. Migrate the databases to Bare Metal Solution for Oracle.
Show Answer
Correct Answer: D
Explanation:
Bare Metal Solution for Oracle allows you to run Oracle 12c with native features like RAC and Data Guard with minimal code changes. It provides the same HA and DR capabilities as on‑premises and offers low‑latency networking for migrated legacy applications, which the other managed database options do not support for Oracle RAC.

Question 50

Your company is evaluating Google Cloud database options for a mission-critical global payments gateway application. The application must be available 24/7 to users worldwide, horizontally scalable, and support open source databases. You need to select an automatically shardable, fully managed database with 99.999% availability and strong transactional consistency. What should you do?

A. Select Bare Metal Solution for Oracle.
B. Select Cloud SQL.
C. Select Bigtable.
D. Select Cloud Spanner.
Show Answer
Correct Answer: D
Explanation:
The requirements point directly to Cloud Spanner: it is a fully managed, automatically sharded, horizontally scalable global database with 99.999% availability and strong transactional (ACID) consistency across regions. Cloud SQL is not horizontally scalable and cannot meet five‑nines availability, Bigtable does not provide strong multi‑row transactional consistency, and Bare Metal Solution for Oracle is neither open source nor automatically managed at global scale. Cloud Spanner also supports open‑source compatibility via its PostgreSQL interface.

$19

Get all 167 questions with detailed answers and explanations

  • Instant download HTML + PDF delivered the moment payment clears.
  • Secure Stripe checkout we never see or store your card details.
  • 7-day refund if files are defective see our refund policy.