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 correct approach is to prevent Terraform from destroying stateful resources. For Cloud SQL managed by Terraform, enable deletion protection/prevent destroy so database resources are not deleted during environment teardown. Rerunning apply does not preserve data, and read replicas or PITR are recovery mechanisms rather than preventing 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:
To verify that a cross-region read replica consistently meets an RPO of less than 5 minutes, you should monitor replication lag using Cloud Monitoring metrics exposed by Cloud SQL. Cloud Monitoring provides historical visibility and alerting, allowing you to validate and enforce the RPO threshold. Instance monitoring and logs are not the primary mechanism for RPO verification, and although Cloud SQL for SQL Server uses Always On technology internally, the managed service's supported monitoring approach is Cloud Monitoring.

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, allowing applications to authenticate using IAM identities and tokens instead of database passwords. PostgreSQL built-in authentication typically relies on usernames/passwords or other database-managed methods, Managed Active Directory is not the standard passwordless mechanism for Cloud SQL for PostgreSQL, and federated queries are unrelated to client authentication.

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:
For a regional disaster affecting the primary, the recommended disaster recovery approach with a cross-region read replica is to assess replication lag to estimate potential data loss, verify replication status, and then promote the cross-region read replica to become the new primary. Restoring from backups causes more downtime and potentially more data loss, and Cloud SQL does not automatically fail over to cross-region read replicas.

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 (regional) uses a primary instance and a standby in another zone with synchronous replication, providing automatic failover for zonal failures. This is the Google-recommended approach for mission-critical PostgreSQL workloads requiring minimal downtime and no transaction loss during a zonal failure. The other options either do not provide automatic failover, risk data loss, or are not the recommended HA architecture for Cloud SQL.

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:
For a 2 TB PostgreSQL migration to Compute Engine with minimal downtime, the appropriate approach is to take an online physical base backup, restore it on the target, configure recovery/streaming replication using WAL (via recovery configuration), then perform a short cutover after the target catches up. Logical exports/imports are much slower for large databases and require longer downtime because they do not support WAL-based catch-up. Option C describes the physical backup plus WAL replay approach.

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 replace an expiring Cloud SQL for MySQL server certificate without restarting the instance, create a new server certificate and download it for clients. Rotating server certificates does not require a manual instance restart, unlike some SSL configuration changes. The other options do not address server certificate renewal correctly.

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:
The Cloud Spanner IAM role roles/spanner.databaseReader grants read-only access to database contents. The roles/spanner.databaseUser role allows reading and writing data. The roles/spanner.viewer role is for viewing Spanner resources/metadata and does not grant database data read access. The roles/spanner.backupWriter is for managing backups, not 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 is designed to run Oracle databases with native Oracle capabilities, including Oracle RAC for high availability and Oracle Data Guard for disaster recovery, while minimizing application and database changes. It also provides low-latency connectivity to Google Cloud services for migrated applications.

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:
Cloud Spanner best matches the requirements: it is a fully managed, globally distributed relational database with automatic sharding, horizontal scalability, strong transactional consistency, and up to 99.999% availability. It also supports PostgreSQL-compatible interfaces, addressing the open source database compatibility requirement. Cloud SQL is not horizontally scalable in this way and does not offer 99.999% availability. Bigtable is not a relational database with global ACID transactions, and Bare Metal Solution for Oracle is neither fully managed nor based on an open source database.

$19

Get all 168 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.