You can change the following database cluster attributes with the GDC console or the gdcloud CLI:
- Database password for the admin user
- External connections (enabled/disabled)
- Availability level (AlloyDB Omni and PostgreSQL only)
- Backup enabled and backup retention days
- Database flags
- CPU, memory, or storage allocated to the database cluster
For information on how to modify an attribute, see the workflow corresponding to the attribute type you want to update:
Console
High Availability
For AlloyDB Omni and PostgreSQL database clusters, enable or disable same zone high availability. See the Configure high availability section for more information.
Data Protection
For all database cluster types, you can enable or disable Data protection:
- Go to Data protection and click edit Edit to access the data protection settings form. If automated backups are enabled, you can also configure how long the backups are to be retained.
- After making changes, click Save to have the updates applied to your database cluster.
Connectivity
For all database cluster types, you can choose whether the database cluster can be accessed only from inside the GDC project, or if it is accessible from outside the project as well:
- Go to Connectivity and click edit Edit.
- Update your connectivity configurations.
Click Save to apply your changes.
Instances
For all database cluster types, you can edit the primary instance properties:
- Go to Primary Instance and click edit Edit.
Choose between High Performance, Standard, Minimum, or Custom configurations. The Custom option lets you choose the number of CPUs, memory, and storage for your primary instance.
Updating your primary instance's CPU, memory, or storage will require a restart. Select Save and Restart to apply your changes.
For all database cluster types, this form also lets you add, modify, or remove database flags. The set of flags available is predetermined by GDC. See the Configure database flags section for more information.
gdcloud CLI
Use the following command to update a database cluster:
sh
gdcloud database clusters update CLUSTER_NAME [options]
Replace the following:
- CLUSTER_NAME with the name of the database cluster to update.
For the full list of options, see the command reference or run
sh
gdcloud database clusters update --help
API
Data Protection
For all database cluster types, you can enable data protection feature by creating a BackupPlan resource for that database cluster.
apiVersion: DBENGINE_NAME.dbadmin.gdc.goog/v1
kind: BackupPlan
metadata:
name: DBCLUSTER_NAME-backupplan
namespace: USER_PROJECT
spec:
dbclusterRef: DBCLUSTER_NAME
backupRetainDays: RETENTION_DAYS
Replace the following variables:
DBENGINE_NAME
: the name of the database engine. This is one ofalloydbomni
,postgresql
ororacle
.DBCLUSTER_NAME
: the name of the database cluster to enable data protection for.USER_PROJECT
: the name of the user project where the database cluster will be created.RETENTION_DAYS
: the number of days for which the AlloyDB Omni Operator retains this backup. It must be an integer between 1 and 90.
You can also configure data protection settings like retention days by editing the corresponding BackupPlan resource.
To turn off data protection for a database cluster, delete the corresponding BackupPlan resource previously created.
Configure database flags
Database images that ship with GDC come with default settings. However, you can customize the default database engine to satisfy requirements for your applications. Database clusters provide predefined flags that you can set using the GDC console or gdcloud CLI:
Console
In the navigation menu, select Database Service.
From the database cluster list, click the database cluster you want to configure database flags for.
In the Instances in your database cluster section, click Edit Primary.
In the Flags section, click Add a Database Flag.
Choose your flag and enter the value. If the value you input is not valid, the GDC console gives you instructions on how to satisfy the required range or value type.
Click Done.
To set the configuration, click Save. For some flags to take effect, you must restart the database cluster. For this case, click Save and Restart.
To confirm your new flag is set, return to the Instances in your database cluster section of your database cluster and verify the new flag and value are visible.
To edit your database flags, return to the Flags section and modify the existing flags. Hover over a flag component and click the
Delete icon to remove a database flag.gdcloud
You can configure new database flags for your cluster or reset all existing flags back to their default values:
To configure a database flag for your database cluster, run:
gdcloud database clusters update CLUSTER_NAME \ --database-flags DB_FLAGS
Replace the following:
CLUSTER_NAME
: the name of the database cluster.DB_FLAGS
: the comma-separated list of database flags to set on the database running in the database cluster. Each database flag and value are set as a key-value pair. Flags without a value can be defined without a string following the=
character.
For example, the following command sets several database flags for the
test-db-cluster
:gdcloud database clusters update test-db-cluster \ --database-flags max_allowed_packet=55555,skip_grant_tables=,log_output=1
For a list of available database flags, see Available database flags.
To reset all your database flags to their default settings, run:
gdcloud database clusters update CLUSTER_NAME --clear-database-flags
Replace
CLUSTER_NAME
with the name of the database cluster.
API
To configure database flags for your database cluster, run:
kubectl patch dbcluster.DBENGINE_NAME.dbadmin.gdc.goog DBCLUSTER_NAME -p '{"spec":{"primarySpec": {"parameters": DB_FLAGS}}}' --type=merge -n USER_PROJECT
Replace the following variables:
DBENGINE_NAME
: the name of the database engine. This is one ofalloydbomni
,postgresql
, ororacle
.DBCLUSTER_NAME
: the name of the database cluster.USER_PROJECT
: the name of the user project where the database cluster was created.DB_FLAGS
: the database configuration parameters to be added or updated. This should be JSON-formatted object of key-value pairs, where keys are the database parameter names and values are their respective settings. For example, the following sets several database flags:
"autovacuum": "on", "autovacuum_analyze_threshold": "2147483647", "dbs.enable_anon": "on"
For a list of available database flags, see Available database flags.
To reset all your database flags to their default settings, run:
kubectl patch dbcluster.DBENGINE_NAME.dbadmin.gdc.goog DBCLUSTER_NAME --type=json -p='[{"op": "remove", "path": "/spec/primarySpec/parameters"}]' -n USER_PROJECT
Replace the following variables:
DBENGINE_NAME
: the name of the database engine. This is one ofalloydbomni
,postgresql
, ororacle
.DBCLUSTER_NAME
: the name of the database cluster.USER_PROJECT
: the name of the user project where the database cluster was created.
Available database flags
The available database flags to configure for your database cluster are provided next based on the database engine you configured.
PostgreSQL database flags
Flag | Range | Type | Need restart |
---|---|---|---|
max_connections | [1, 262143] | Integer | TRUE |
temp_file_limit | [1048576, 2147483647] | Integer | FALSE |
log_min_duration_statement | [-1, 2147483647] | Integer | FALSE |
log_connections | on, off | Boolean | FALSE |
log_lock_waits | on, off | Boolean | FALSE |
log_disconnections | on, off | Boolean | FALSE |
log_checkpoints | on, off | Boolean | FALSE |
log_temp_files | [-1, 2147483647] | Integer | FALSE |
log_statement | none, ddl, mod, all | Enum | FALSE |
pgaudit.log | read, write, function, role, ddl, misc, misc_set, all, none , -read, -write, -function, -role, -ddl, -misc, -misc_set, -all, -none |
Repeated string | FALSE |
work_mem | [64, 2147483647] | Integer | FALSE |
autovacuum | on, off | Boolean | FALSE |
maintenance_work_mem | [1024, 2147483647] | Integer | FALSE |
random_page_cost | [0, 2147483647] | Float | FALSE |
log_min_messages | debug5, debug4, debug3, debug2, debug1, info notice, warning, error, log, fatal, panic |
Enum | FALSE |
idle_in_transaction_session_timeout | [0, 2147483647] | Integer | FALSE |
max_wal_size | [2, 2147483647],. | Integer | FALSE |
autovacuum_vacuum_scale_factor | [0, 100] | Float | FALSE |
log_autovacuum_min_duration | [-1, 2147483647] | Integer | FALSE |
autovacuum_vacuum_cost_limit | [-1, 10000] | Integer | FALSE |
autovacuum_max_workers | [1, 262143] | Integer | TRUE |
autovacuum_analyze_scale_factor | [0, 100] | Float | FALSE |
track_activity_query_size | [100, 1048576] | Integer | TRUE |
log_duration | on, off | Boolean | FALSE |
autovacuum_vacuum_cost_delay | [-1, 100] | Integer | FALSE |
checkpoint_completion_target | [0, 1] | Float | FALSE |
log_statement_stats | on, off | Boolean | FALSE |
max_worker_processes | [8, 4096] | Integer | TRUE |
log_min_error_statement | debug5, debug4, debug3, debug2, debug1, info, notice, warning, error, log, fatal, panic |
Enum | FALSE |
default_statistics_target | [1, 10000] | Integer | FALSE |
checkpoint_timeout | [30, 86400] | Integer | FALSE |
wal_buffers | [-1, 262143 ] | Integer | TRUE |
effective_cache_size | [1, 2147483647] | Integer | FALSE |
autovacuum_work_mem | [1, 2147483647] | Integer | FALSE |
log_hostname | on, off | Boolean | FALSE |
autovacuum_vacuum_threshold | [0, 2147483647] | Integer | FALSE |
autovacuum_naptime | [1, 2147483] | Integer | FALSE |
autovacuum_analyze_threshold | [0, 2147483647] | Integer | FALSE |
pgaudit.log_client | on, off | Boolean | FALSE |
pgaudit.log_parameter | on, off | Boolean | FALSE |
pgaudit.log_level | debug5, debug4, debug3, debug2, debug1, info, notice, warning, error, log |
Enum | FALSE |
pgaudit.log_relation | on, off | Boolean | FALSE |
pgaudit.log_catalog | on, off | Boolean | FALSE |
pgaudit.role | String | FALSE | |
autovacuum_freeze_max_age | [100000, 2000000000] | Integer | TRUE |
autovacuum_multixact_freeze_max_age | [10000, 2000000000] | Integer | TRUE |
pgaudit.log_statement_once | on, off | Boolean | FALSE |
anon.algorithm | String | FALSE | |
anon.maskschema | String | FALSE | |
anon.restrict_to_trusted_schemas | on, off | Boolean | FALSE |
anon.salt | String | FALSE | |
anon.sourceschema | String | FALSE | |
dbs.enable_anon | on, off | Boolean | TRUE |
dbs.enable_pg_bigm | on, off | Boolean | TRUE |
dbs.enable_pg_cron | on, off | Boolean | TRUE |
dbs.enable_pg_hint_plan | on, off | Boolean | TRUE |
dbs.enable_pg_wait_sampling | on, off | Boolean | TRUE |
pg_bigm.enable_recheck | on, off | Boolean | FALSE |
pg_bigm.gin_key_limit | [0, 2147483647] | Integer | FALSE |
pg_bigm.similarity_limit | [0, 1] | Float | FALSE |
pg_hint_plan.debug_print | off, on, detailed, verbose, 0, 1, 2, 3, no, yes, false, true | Enum | TRUE |
pg_hint_plan.enable_hint | on, off | Boolean | FALSE |
pg_hint_plan.enable_hint_table | on, off | Boolean | FALSE |
pg_hint_plan.message_level | debug5, debug4, debug3, debug2, debug1, debug, info, notice, warning, error, log | Enum | FALSE |
pg_hint_plan.parse_messages | debug5, debug4, debug3, debug2, debug1, debug, info, notice, warning, error, log | Enum | FALSE |
pg_stat_statements.max | [100, 2147483647] | Integer | TRUE |
pg_stat_statements.save | on, off | Boolean | FALSE |
pg_stat_statements.track | none, top, all | Enum | FALSE |
pg_stat_statements.track_utility | on, off | Boolean | FALSE |
pg_wait_sampling.history_period | [1, 2147483647] | Integer | FALSE |
pg_wait_sampling.history_size | [1, 2147483647] | Integer | FALSE |
pg_wait_sampling.profile_period | [1, 2147483647] | Integer | FALSE |
pg_wait_sampling.profile_pid | on, off | Boolean | FALSE |
pg_wait_sampling.profile_queries | on, off | Boolean | FALSE |
pglogical.batch_inserts | on, off | Boolean | TRUE |
pglogical.conflict_log_level | debug5, debug4, debug3 , debug2, debug1 , info, notice , warning, error , log, fatal , panic | Enum | FALSE |
pglogical.conflict_resolution | error, apply_remote, keep_local, last_update_wins, first_update_wins | Enum | FALSE |
pglogical.extra_connection_options | String | FALSE | |
pglogical.synchronous_commit | on, off | Boolean | TRUE |
pglogical.use_spi | on, off | Boolean | TRUE |
pgtt.enabled | on, off | Boolean | FALSE |
plv8.execution_timeout | [1, 65536] | Integer | FALSE |
plv8.memory_limit | [256, 3096] | Integer | FALSE |
plv8.start_proc | String | FALSE | |
rdkit.agent_FP_bit_ratio | [0, 3] | Float | FALSE |
rdkit.avalon_fp_size | [64, 9192] | Integer | FALSE |
rdkit.dice_threshold | [0, 1] | Float | FALSE |
rdkit.difference_FP_weight_agents | [-10, 10] | Integer | FALSE |
rdkit.difference_FP_weight_nonagents | [1, 20] | Integer | FALSE |
rdkit.do_chiral_sss | on, off | Boolean | FALSE |
rdkit.do_enhanced_stereo_sss | on, off | Boolean | FALSE |
rdkit.featmorgan_fp_size | [64, 9192] | Integer | FALSE |
rdkit.hashed_atompair_fp_size | [64, 9192] | Integer | FALSE |
rdkit.hashed_torsion_fp_size | [64, 9192] | Integer | FALSE |
rdkit.ignore_reaction_agents | on, off | Boolean | FALSE |
rdkit.init_reaction | on, off | Boolean | FALSE |
rdkit.layered_fp_size | [64, 9192] | Integer | FALSE |
rdkit.morgan_fp_size | [64, 9192] | Integer | FALSE |
rdkit.move_unmmapped_reactants_to_agents | on, off | Boolean | FALSE |
rdkit.rdkit_fp_size | [64, 9192] | Integer | FALSE |
rdkit.reaction_difference_fp_size | [64, 9192] | Integer | FALSE |
rdkit.reaction_difference_fp_type | [1, 3] | Integer | FALSE |
rdkit.reaction_sss_fp_size | [64, 9192] | Integer | FALSE |
rdkit.reaction_sss_fp_type | [1, 5] | Integer | FALSE |
rdkit.sss_fp_size | [64, 4096] | Integer | FALSE |
rdkit.tanimoto_threshold | [0, 1] | Float | FALSE |
rdkit.threshold_unmapped_reactant_atoms | [0, 1] | Float | FALSE |
The following table specifies default values for flags different from the vendor default:
Flag | Value/Formula | |
---|---|---|
shared_buffers | 1/3 * totalMemory(MiB) | |
max_wal_size | 1504MB | |
max_connections | Total memory >= ? | Value |
120GB | 1000 | |
60GB | 800 | |
15GB | 500 | |
7.5GB | 400 | |
6GB | 200 | |
3.75GB | 100 | |
1.7GB | 50 | |
0 | 25 | |
effective_cache_size | 2/5 * totalMemory | |
temp_file_limit | 1/10 * storageSize | |
log_connections | on | |
log_disconnections | on | |
pgaudit.log | all, -misc | |
log_hostname | on | |
pgaudit.log_parameter | on |
Oracle database flags
Flag | Range | Type | Need restart |
---|---|---|---|
aq_tm_processes | [0, 40] | Integer | FALSE |
background_core_dump | FULL, PARTIAL | Enum | FALSE |
bitmap_merge_area_size | [0, 2147483647] | Integer | TRUE |
control_management_pack_access | NONE, DIAGNOSTIC, DIAGNOSTIC+TUNING | Enum | FALSE |
cursor_sharing | FORCE, EXACT, SIMILAR | Enum | FALSE |
db_cache_size | [0, 10995116277760] | Integer | FALSE |
db_files | [200, 20000] | Integer | TRUE |
db_flashback_retention_target | [30, 2147483647] | Integer | FALSE |
db_keep_cache_size | [0, 10995116277760] | Integer | FALSE |
db_recovery_file_dest_size | [0, 10995116277760] | Integer | FALSE |
event | String | TRUE | |
large_pool_size | [0, 10995116277760] | Integer | FALSE |
log_buffer | [2097152, 10995116277760] | Integer | TRUE |
open_cursors | [5, 65535] | Integer | FALSE |
pga_aggregate_limit | [0, 10995116277760] | Integer | FALSE |
pga_aggregate_target | [10485760, 10995116277760] | Integer | FALSE |
processes | [100, 20000] | Integer | TRUE |
recyclebin | ON, OFF | Enum | TRUE |
resource_limit | TRUE, FALSE | Boolean | FALSE |
sec_max_failed_login_attempts | [1, 2147483647] | Integer | TRUE |
sga_max_size | [377487360, 10995116277760] | Integer | TRUE |
sga_target | [377487360, 10995116277760] | Integer | FALSE |
shared_pool_size | [0, 10995116277760] | Integer | FALSE |
undo_retention | [0, 2147483647] | Integer | FALSE |
global_names | TRUE, FALSE | Boolean | FALSE |
DBFIPS_140 | TRUE, FALSE | Boolean | TRUE |
parallel_max_servers | [0, 32767] | Integer | FALSE |
_fix_control | String | FALSE | |
_sql_plan_directive_mgmt_control | [0, 65535] | Integer | FALSE |
_optimizer_dsdir_usage_control | [0, 126] | Integer | FALSE |
skip_unusable_indexes | TRUE, FALSE | Boolean | FALSE |
The following table specifies default values for flags different from the vendor default:
Flag | Value/Formula |
---|---|
sga_target | 4/5* (totalMemory-1GiB) |
pga_aggregate_target | 1/5* (totalMemory-1GiB) |
open_cursors | 300 |
processes | 300 |
DBFIPS_140 | TRUE |
global_names | TRUE |
AlloyDB Omni database flags
Flag | Range | Type | Need restart |
---|---|---|---|
google_columnar_engine.enabled | on, off | Boolean | TRUE |
google_columnar_engine.memory_size_in_mb | [128, 2147483647] | Integer | TRUE |
anon.algorithm | String | FALSE | |
anon.maskschema | String | FALSE | |
anon.restrict_to_trusted_schemas | on, off | Boolean | FALSE |
anon.salt | String | FALSE | |
anon.sourceschema | String | FALSE | |
dbs.enable_anon | on, off | Boolean | TRUE |
dbs.enable_pg_bigm | on, off | Boolean | TRUE |
dbs.enable_pg_cron | on, off | Boolean | TRUE |
dbs.enable_pg_hint_plan | on, off | Boolean | TRUE |
dbs.enable_pg_squeeze | on, off | Boolean | TRUE |
dbs.enable_pg_wait_sampling | on, off | Boolean | TRUE |
pg_bigm.enable_recheck | on, off | Boolean | FALSE |
pg_bigm.gin_key_limit | [0, 2147483647] | Integer | FALSE |
pg_bigm.similarity_limit | [0, 1] | Float | FALSE |
pg_hint_plan.debug_print | off, on, detailed, verbose, 0, 1, 2, 3, no, yes, false, true | Enum | TRUE |
pg_hint_plan.enable_hint | on, off | Boolean | FALSE |
pg_hint_plan.enable_hint_table | on, off | Boolean | FALSE |
pg_hint_plan.message_level | debug5, debug4, debug3, debug2, debug1, debug, info, notice, warning, error, log | Enum | FALSE |
pg_hint_plan.parse_messages | debug5, debug4, debug3, debug2, debug1, debug, info, notice, warning, error, log | Enum | FALSE |
pg_stat_statements.max | [100, 2147483647] | Integer | TRUE |
pg_stat_statements.save | on, off | Boolean | FALSE |
pg_stat_statements.track | none, top, all | Enum | FALSE |
pg_stat_statements.track_utility | on, off | Boolean | FALSE |
pg_wait_sampling.history_period | [1, 2147483647] | Integer | FALSE |
pg_wait_sampling.history_size | [1, 2147483647] | Integer | FALSE |
pg_wait_sampling.profile_period | [1, 2147483647] | Integer | FALSE |
pg_wait_sampling.profile_pid | on, off | Boolean | FALSE |
pg_wait_sampling.profile_queries | on, off | Boolean | FALSE |
pgaudit.log | read, write, function, role, ddl, misc, misc_set, all, none , -read, -write, -function, -role, -ddl, -misc, -misc_set, -all, -none |
Repeated string | FALSE |
pgaudit.log_client | on, off | Boolean | FALSE |
pgaudit.log_parameter | on, off | Boolean | FALSE |
pgaudit.log_level | debug5, debug4, debug3, debug2, debug1, info, notice, warning, error, log |
Enum | FALSE |
pgaudit.log_relation | on, off | Boolean | FALSE |
pgaudit.log_catalog | on, off | Boolean | FALSE |
pgaudit.role | String | FALSE | |
pgaudit.log_statement_once | on, off | Boolean | FALSE |
pglogical.batch_inserts | on, off | Boolean | TRUE |
pglogical.conflict_log_level | debug5, debug4, debug3 , debug2, debug1 , info, notice , warning, error , log, fatal , panic | Enum | FALSE |
pglogical.conflict_resolution | error, apply_remote, keep_local, last_update_wins, first_update_wins | Enum | FALSE |
pglogical.extra_connection_options | String | FALSE | |
pglogical.synchronous_commit | on, off | Boolean | TRUE |
pglogical.use_spi | on, off | Boolean | TRUE |
pgtt.enabled | on, off | Boolean | FALSE |
plv8.execution_timeout | [1, 65536] | Integer | FALSE |
plv8.memory_limit | [256, 3096] | Integer | FALSE |
plv8.start_proc | String | FALSE |