Restoring a GaussDB Instance to a Specific Point in Time
Scenarios
You can use an instance-level automated backup to restore a GaussDB instance to a specified point in time.
You can restore backup data to the original GaussDB instance, an existing instance, or a new one.
Video Tutorial
Precautions
- Only instances of version V2.0-2.1 or later can be restored to any point in time. Single-replica instances are not supported. For details about how to view the instance version, see Checking the DB Engine Version.
- Data from the time period of the following operations cannot be restored: nodes are being added to an instance, the instance version is being upgraded, or the instance data is being restored.
- If an instance is faulty or a CN is removed, archive logs cannot be generated, and data from the affected time period cannot be restored.
- If you restore backup data to a new DB instance:
- The DB engine and major version are the same as those of the original DB instance and cannot be changed.
- The administrator password needs to be reset.
- If you restore backup data to the original DB instance, data on the original instance will be overwritten and the original DB instance will be unavailable during the restoration. Additionally, log archiving stops. After the restoration is complete, the Confirm Data Integrity button is displayed. Before clicking Confirm Data Integrity, you can restore data for multiple times. Once data integrity has been confirmed, any logs archived after the point in time data was restored from will be lost, but normal log archiving will be restored.
- When a DB instance is deleted, all archive logs are deleted by default and cannot be retained. After an instance is deleted, it cannot be rebuilt or restored to any point in time.
- If parallel restoration is enabled, all primary and standby replicas will simultaneously download backup data from the storage server. Compared to serial restoration, this process demands a multiple of the bandwidth from the storage server equal to the number of replicas in each shard. If your instance has more than five shards, consult O&M personnel about the available bandwidth of the OBS server before deciding whether to enable parallel restoration. This will prevent a decrease in restoration speed due to bandwidth exhaustion.
- Centralized instances support only parallel restoration.
- Parallel restoration cannot be enabled if the DB engine version is earlier than V2.0-1.4.
Restoring an Instance to a Specific Point in Time
- Log in to the management console.
- Click
in the upper left corner and select a region and project.
- Click
in the upper left corner of the page and choose .
- On the Instances page, click the name of the target instance to go to the Basic Information page.
- In the navigation pane on the left, choose Backups. On the displayed page, click Restore to Point in Time.
- Set Restoration Method to Create New Instance and click OK.
Figure 1 Restoring data to a specified point in time
- The new DB instance must have the same major version as the original instance when it was backed up. For example, backup data can only be restored from version V2.0-1.4.x to version V2.0-1.4.y.
- The storage space of the new instance is the same as that of the original DB instance by default and the new instance must be at least as large as the original DB instance.
- The administrator password needs to be reset.
- The backup media, CPU architecture, OS type and version, instance type (distributed or centralized), deployment model, replica consistency protocol, and transaction consistency settings of the new instance must be the same as those of the original instance to be restored.
- By default, the instance specifications of the new instance are the same as those of the original instance. To change the instance specifications, ensure that the instance specifications of the new instance are at least those of the original instance.
- If there are M-compatible databases in the instance to be restored, the Table Names in M-compatible Databases parameter of the new instance must be set to the same value as that of the original instance. The default value is Case-sensitive.
- On the displayed page, configure parameters of the new instance and click Next.
Table 1 Basic information Parameter
Description
Billing Mode
GaussDB provides yearly/monthly billing and pay-per-use billing.
- Yearly/Monthly: You pay upfront for the amount of time you expect to use the DB instance for. You will need to make sure you have a top-up account with a sufficient balance or have a valid payment method configured first.
For distributed instances using the combined deployment model, yearly/monthly billing is only available to authorized users. To apply for the permissions needed, submit a service ticket.
- Pay-per-use: You can start using the DB instance first and then pay as you go. Pricing is listed on a per-hour basis, but bills are calculated based on the actual usage duration.
DB Instance Name
The instance name is case-sensitive, must start with a letter, and can contain 4 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.
Failover Priority
This parameter is only available for distributed instances.
This parameter is only available for authorized users. To apply for the permissions needed, submit a service ticket. The default value is Reliability. For details about how to change the failover priority for an existing instance, see Changing Failover Priority.
- Reliability: Data consistency is prioritized during a failover. This is recommended for applications whose highest priority is data consistency.
- Availability: Database availability is given priority during a failover. This is recommended for applications that require their databases to provide uninterrupted online services.
If Availability is selected, exercise caution when modifying the following database parameters. For details about how to modify parameters, see Modifying Instance Parameters.
- recovery_time_target: If the value of this parameter is changed, the instance will experience frequent forced failovers. Contact technical support before modifying this parameter.
- audit_system_object: If the value of this parameter is changed, DDL audit logs will be lost. Contact technical support before modifying this parameter.
AZ
An AZ is a physical region where resources have their own independent power supply and networks. AZs are physically isolated but interconnected through an internal network.
A DB instance can be deployed in one AZ or three AZs. Three AZs are recommended.
Time Zone
Select a time zone according to the region hosting your DB instance when you buy the instance.
Table 2 Specifications and storage Parameter
Description
Instance Specifications
CPU and memory specifications of the instance. Different instance specifications support different numbers of database connections.
For details, see Instance Specifications.
Storage Space
The storage space contains the file system overhead required for inodes, reserved blocks, and database operations.
The storage for a single shard starts from 40 GB and can be increased at a step of 4 GB.
Disk Encryption
- Disable: Encryption is disabled.
- Enable: Encryption is enabled, which improves data security but affects system performance.
Key Name: If disk encryption is enabled, you need to select or create a key.
NOTE:- When creating a pay-per-use instance with disk encryption enabled, ensure that your account has been granted the following action:
- When you create a yearly/monthly instance with disk encryption enabled, if the KMS key shared by RAM is used for the first time, create an agency as prompted.
- When using the KMS key shared by RAM to create an instance, ensure that your account has also been granted the following actions:
- iam:agencies:listAgencies
- iam:agencies:createAgency
- iam:roles:listRoles
- iam:permissions:listRolesForAgency
- iam:permissions:grantRoleToAgency
- kms:cmk:createGrant
If a shared KMS key is used, the corresponding CTS event is createGrant. Only the key owner can receive this event.
Table 3 Network and database configuration Parameter
Description
VPC
A virtual network where your GaussDB instances are located. A VPC isolates networks for different workloads. You need to create or select the required VPC. If no VPC is available, GaussDB allocates a default VPC for you.
After the GaussDB instance is created, the VPC cannot be changed.
For details about how to create a VPC, see Creating a VPC.
With VPC sharing, you can also use a VPC and subnet shared by another account.
VPC owners can share the subnets in a VPC with one or multiple accounts through Resource Access Manager (RAM). This allows for more efficient use of network resources and reduces O&M costs.
For more information about VPC subnet sharing, see VPC Sharing in the Virtual Private Cloud User Guide.
Subnet
A subnet provides dedicated network resources that are logically isolated from other networks for network security. Subnets take effect only within a specific AZ. Dynamic Host Configuration Protocol (DHCP) is enabled by default for subnets in which you plan to create GaussDB instances and cannot be disabled. GaussDB supports automatic IP address allocation during instance creation.
NOTE:- By default, a subnet supports up to 256 IP addresses. A distributed instance can require up to 1,286 IP addresses. You are advised to use a subnet that can provide 2,048 IP addresses.
Security Group
Controls access to and from an instance. When you buy an instance, the selected security group must meet the following requirements:
- When buying a distributed instance, ensure that the TCP ports in the inbound rule include the following: 40000-60480, 20050, 5000-5001, 2379-2380, 6000, 6001, 6500, and <database_port>-(<database_port> + 100). (For example, if the database port is 8000, the security group must contain ports 8000 to 8100.) Additionally, ensure that the outbound security group rules allow all outbound traffic.
- When buying a centralized instance, ensure that the TCP ports in the inbound rule include the following: 20050, 5000-5001, 2379-2380, 6000, 6500, and <database_port>-(<database_port> + 100). (For example, if the database port is 8000, the TCP ports for the security group must include 8000-8100.)
The security group enhances security by controlling access to GaussDB from other services. Ensure that the security group you selected allows your client to access the instance. If you do not need to specify a security group when creating an instance, you can submit a service ticket.
If no security group is available, GaussDB allocates a default security group for you.
Database Port
The port is used by applications to access the database. Value range: 1024 to 39989. Default value: 8000. The following ports are used by the system and cannot be used: 2378 to 2380, 2400, 4999 to 5001, 5100, 5500, 5999 to 6001, 6009 to 6010, 6500, 8015, 8097, 8098, 8181, 9090, 9100, 9180, 9187, 9200, 12016, 12017, 20049, 20050, 21731, 21732, 32122 to 32126, and 39001.
Single Private IP Address
Specifies whether to enable the single private IP address policy. If this policy is enabled, only one private IP address is assigned to an instance and is bound to the primary node. The private IP address does not change after a primary/standby switchover. If this policy is disabled, each node is bound to a private IP address, and the private IP address changes after a primary/standby switchover.
The constraints on the single private IP address policy are as follows:
- This policy is only available for centralized instances of version V2.0-3.207 or later.
- This policy is configurable only at the time of instance creation and cannot be changed afterward.
Table 4 Database configuration Parameter
Description
Administrator
Database administrator. The default username is root.
Administrator Password
Enter a strong password and periodically change it to improve security, preventing security risks such as brute force cracking.
The password must contain:
- 8 to 32 characters.
- At least three types of the following: uppercase letters, lowercase letters, digits, and special characters. Supported special characters: ~!@#%^*-_=+?,
Keep the password secure. Password retrieval is not supported.
Confirm Password
Enter the administrator password again.
Parameter Template
A template of parameters for creating an instance. The template contains engine configuration values that are applied to one or more instances. After creating an instance, you can modify the parameter template.
Enterprise Project
If the instance has been associated with an enterprise project, select the target project from the Enterprise Project drop-down list.
You can also go to the Enterprise Project Management console to create a project. For details, see Enterprise Management User Guide.
Tag
This parameter is optional. Adding tags helps you better identify and manage your DB instances. Each instance can have up to 20 tags.
If your organization has configured tag policies for GaussDB, add tags to instances based on the policies. If a tag does not comply with the policies, instance creation may fail. Contact your organization administrator to learn more about tag policies.
- Yearly/Monthly: You pay upfront for the amount of time you expect to use the DB instance for. You will need to make sure you have a top-up account with a sufficient balance or have a valid payment method configured first.
- View the restoration results.
A new instance that contains the same data as the backup is created. When the instance status changes from Creating to Available, the restoration is complete.
The new instance is independent of the original one.
- Click
in the upper left corner and select a region and project.
- Click
in the upper left corner of the page and choose .
- On the Instances page, click the name of the target instance to go to the Basic Information page.
- In the navigation pane on the left, choose Backups. On the displayed page, click Restore to Point in Time.
- Set Restoration Method to Restore to Original, select the confirmation check box, and click Next.
- The instance version and node configuration must be the same as those of the original instance when the backup was created.
- Restoring to the original DB instance will overwrite all data on it and cause the DB instance to be unavailable during the restoration.
- You are advised to manually back up data before the restoration.
- If you use a backup created before advanced compression is enabled to restore data to the original instance, you must enable this feature for the instance again.
- Confirm the backup task information and click OK.
- View the restoration results.
On the Instances page, when the instance status changes from Restoring to Available, the restoration is complete. After the restoration is complete, a full backup will be automatically triggered.
After the restoration is complete, check whether the restored data is consistent with the time point to which the data is restored.
- Click
in the upper left corner and select a region and project.
- Click
in the upper left corner of the page and choose .
- On the Instances page, click the name of the target instance to go to the Basic Information page.
- In the navigation pane on the left, choose Backups. On the displayed page, click Restore to Point in Time.
- Set Restoration Method to Restore to Existing, select the confirmation check box, select an existing instance, and click Next.
- Restoring data to an existing instance will overwrite all data on it and cause the instance to be unavailable during the restoration.
- Manually backing up data of the selected DB instance before the restoration.
- If there are M-compatible databases in the instance to be restored, the Table Names in M-compatible Databases parameter of the target instance must be set to the same value as that of the original instance. The default value is Case-sensitive.
- The selected instance must have the same engine type, engine version, OS, resource type, topology, CPU architecture, case sensitivity of M-compatible table names (for a centralized instance), replica consistency (for a centralized instance), and transaction consistency (for a distributed instance) settings as the original instance had when it was backed up.
- The storage capacity of the selected instance must be at least equal to what the original instance had when it was backed up. (For an independently deployed distributed instance whose shards have different storage: Original instance storage = Maximum shard storage x Shard quantity; Target instance storage = Minimum shard storage x Shard quantity.)
- The specifications of the selected instance must be at least equal to what the original instance had when it was backed up.
- The selected instance cannot contain read replicas.
- An existing instance cannot be selected as the restoration target if it is currently undergoing a full or differential backup. If the backup is not required, you can stop it before proceeding with the restoration.
- If transparent data encryption (TDE) is enabled for the original instance, TDE must also be enabled for the selected target instance and the same key must be used.
- Confirm the backup task information and click OK.
- View the restoration results.
On the Instances page, when the instance status changes from Restoring to Available, the restoration is complete. After the restoration is complete, a full backup will be automatically triggered.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot