PostgreSQL link operations via CLI
dSource creation from CLI
To create a dSource via CLI, you must create a source configuration first. For more information on creating a source configuration, refer to Add Source Config using CLI.
To create a dSource and perform operations via CLI, login to the Delphix Continuous Data Engine using the admin user account.
ssh admin@<CONTINUOUS-DATA-FQDN-or-IP>
Set default linking parameters
Run the following commands to set the default linking parameters. The following example uses testscfg
source config.
ip-10-110-238-142> database link
ip-10-110-238-142 database link *> set linkData.type=AppDataStagedLinkData
ip-10-110-238-142 database link *> set name=testds
ip-10-110-238-142 database link *> set group=Untitled
ip-10-110-238-142 database link *> set linkData.config=testscfg
ip-10-110-238-142 database link *> set linkData.environmentUser=rh83-pg14-tec.dlpxdc.co/postgres
ip-10-110-238-142 database link *> set linkData.stagingEnvironment=rh83-pg14-tec.dlpxdc.co
ip-10-110-238-142 database link *> set linkData.stagingEnvironmentUser=rh83-pg14-tec.dlpxdc.co/postgres
ip-10-110-238-142 database link *> set linkData.syncParameters.parameters={\"resync\":true}
Link parameters for Delphix initiated backup with memory and DB config
Run the following commands to link parameters for Delphix-initiated backup with memory and DB configuration.
set linkData.parameters="{\"mountLocation\":\"/tmp/DIBR\",\"externalBackup\":[], \"delphixInitiatedBackupFlag\":true, \"privilegedOsUser\":\"\", \"delphixInitiatedBackup\":[{\"userName\":\"delphix\",\"userPass\":\"password\", \"sourceHostAddress\":\"c78-pg12-s2.dlpxdc.co\", \"postgresSourcePort\":5432}], \"singleDatabaseIngestionFlag\":false,\"singleDatabaseIngestion\":[], \"postgresPort\":5442, \"configSettingsStg\":[{\"propertyName\":\"wal_keep_segments\", \"value\": \"9\"}]}"
Link parameters for log shipping with externally initiated backup
Run the following commands to link parameters for Log Shipping with Externally Initiated Backup.
set linkData.parameters="{\"mountLocation\":\"/tmp/DIBR\",\"externalBackup\":[], \"delphixInitiatedBackupFlag\":true, \"privilegedOsUser\":\"\", \"delphixInitiatedBackup\":[{\"userName\":\"delphix\",\"userPass\":\"password\", \"sourceHostAddress\":\"c78-pg12-s2.dlpxdc.co\", \"postgresSourcePort\":5432}], \"singleDatabaseIngestionFlag\":false,\"singleDatabaseIngestion\":[], \"postgresPort\":5442, \"configSettingsStg\":[{\"propertyName\":\"wal_keep_segments\", \"value\": \"9\"}]}"
Link parameters for PostgreSQL streaming replication with externally initiated backup:
Run the following commands to link parameters for PostgreSQL streaming replication with externally initiated backup.
set linkData.parameters="{\"mountLocation\":\"/tmp/mntp\",\"externalBackup\":[{\"backupPath\":\"/tmp/backup\", \"walLogPath\":\"/tmp/backup\", \"keepStagingInSync\":false}], \"delphixInitiatedBackupFlag\":false, \"delphixInitiatedBackup\":[], \"singleDatabaseIngestionFlag\":false,\"singleDatabaseIngestion\":[], \"stagingPushFlag\":true,\"postgresPort\":5436, \"configSettingsStg\":[]}"
Link parameters for Delphix-initiated single database backup ingestion
Run the following commands to link parameters for Delphix-initiated Single Database backup ingestion.
set linkData.parameters="{\"mountLocation\":\"/tmp/singledb2\",\"privilegedOsUser\":\"\",\"externalBackup\":[], \"delphixInitiatedBackupFlag\":false, \"delphixInitiatedBackup\":[],\"singleDatabaseIngestionFlag\":true,\"singleDatabaseIngestion\":[{\"databaseName\":\"postgres\", \"databaseUserName\":\"postgres\", \"databaseUserPassword\":\"postgres\", \"sourceHost\":\"rh83-pg14-sec.dlpxdc.co\", \"sourcePort\":5432, \"dumpDir\":\"/home/postgres\", \"dumpJobs\":2, \"restoreJobs\":2, \"postgresqlFile\":\"\"}],\"stagingPushFlag\":false,\"postgresPort\":5435, \"configSettingsStg\":[]}"
Link parameters for staging push
Run the following commands to link parameters for staging push.
set linkData.parameters="{\"mountLocation\":\"/tmp/pg_basebackupD\",\"privilegedOsUser\":\"\",\"externalBackup\":[], \"delphixInitiatedBackupFlag\":false, \"delphixInitiatedBackup\":[],\"singleDatabaseIngestionFlag\":false,\"singleDatabaseIngestion\":[],\"stagingPushFlag\":true,\"postgresPort\":5433, \"configSettingsStg\":[]}"
Commit
Run the following command to commit the change.
commit;
Disable
Run the following command to disable the dSource.
source
select testdb
disable
commit
Enable
Run the following command to enable the dSource.
source
select testdb
enable
commit