Updated on 2025-01-09 GMT+08:00

Commands for Creating a Release

Function

The create-publication command is used to create a fine-grained DR release.

Syntax

python3 $GPHOME/script/DisasterFineGrained.py -t create-publication --disaster-object-list-file <disasterObjectListFile> --config-file <configFile>

Parameter Description

Long Option

Short Option

Data Type

Description

Range

Default Value

Example

-t

N/A

String

The interface supports multiple functions. create-publication creates a release.

  • -t generate-config
  • -t prepare
  • -t create-publication
  • -t alter-publication
  • -t cancel-publication
  • -t get-current-disaster

N/A

-t create-publication

--disaster-object-list-file

N/A

String

DR object list file

N/A

N/A

--disaster-object-list-file /home/userA/disaster_object_list.txt

--config-file

N/A

String

Path of the dual-cluster DR configuration file.

NOTE:

N/A

N/A

--config-file /home/userA/config.ini

Usage Guide

  • The create-publication command must be executed on the active node of the active cluster. After the current backup process is complete, this command stops the subsequent periodic backup.
  • The --disaster-object-list-file parameter in the create-publication command must be set to a full DR object.
  • When a database or schema is initially released, the enable_disaster_cstore setting in the database or schema is not set to on. However, tables that support enable_disaster_cstore=on are automatically converted to DR tables and synchronized. New tables added to the database or schema will be automatically synchronized only after enable_disaster_cstore=on is set.
  • Only released tables that support enable_disaster_cstore=on can be synchronized.
  • DR objects that fail to be released are written into $HOME/config/fail_disaster_object.txt after the command is executed.
  • The default path of the publication parameter file is $HOME/config/pub.list.
  • You need to manually create the DR object list file --disaster-object-list-file. The file format is as follows:
    db_name   //DB level
    db_name.schema_name   //Schema level
    Level db_name.schema_name.table_name  //Table level

Example Command

Create a release task.

python3 $GPHOME/script/DisasterFineGrained.py -t create-publication --disaster-object-list-file $HOME/config/disaster_object_list.txt --config-file /home/mpp/mppcases_c10/cluster/gs_rch_DR-v6/test/backupRestore.ini

System Response

[perfadm@ecs-env-2988 config]$ python3 $GPHOME/script/DisasterFineGrained.py -t create-publication --disaster-object-list-file $HOME/config/disaster_object_list.txt --config-file /home/mpp/mppcases_c10/cluster/gs_rch_DR-v6/test/backupRestore.ini
[Start ESL disaster fine grained process]
Stop backup loop.
Stop crontab for backup
Stop crontab successfully.
Stop backup successfully.
Start parse disaster object file.
parse disaster object file end, [disaster object num]: 1, [time]: 0.000s.
Start filter disaster object.
filter disaster object end, [db num]: 1, [schema num]: 0, [table num]: 0, [time]: 0.020s.
Start transfer disaster object.
transfer disaster object end, [db num]: 1, [schema num]: 0, [table num]: 0, [time]: 0.018s.
Start alter publication.
Start cancel all publication.
cancel all publication end, [pub num]: 0, [time]: 0.044s.
Start add publication.
add publication end, [db num]: 1, [schema num]: 0, [table num]: 0, [time]: 0.030s.
alter publication end, [time]: 0.074s.
The publication file path: /home/perfadm/config/pub.list
[Finished ESL disaster fine grained process]