Schema-level Import and Export
The gs_dump tool can be used to back up a single schema and you are advised to use the gs_dump tool and the -n parameter to do so. Multiple -n parameters can be used to back up multiple schemas.
For details about how to use the gs_dump tool, see "Data Import and Export Tools > gs_dump for Exporting Database Information" in Tool Reference.

If the exported schema depends on objects that are not exported, an error message may be displayed indicating that the dependent objects are missing when the schema is imported. Therefore, ensure that the dependent objects have been created before importing the schema.
-- Plain-text nohup gs_dump my_database -U root -W ******** -p 8000 -F p -f /data/backup/my_schema_backup.sql -n my_schema > /data/backup/my_schema_backup.log & -- Custom nohup gs_dump my_database -U root -W ******** -p 8000 -F c -f /data/backup/my_schema_backup.dmp -n my_schema > /data/backup/my_schema_backup.log & -- Directory nohup gs_dump my_database -U root -W ******** -p 8000 -F d -f /data/backup/my_schema_backup -n my_schema > /data/backup/my_schema_backup.log & -- .tar archive nohup gs_dump my_database -U root -W ******** -p 8000 -F t -f /data/backup/my_schema_backup.tar -n my_schema > /data/backup/my_schema_backup.log &
-- Run the following gsql meta-command to view the database attribute information: \l+ -- Create a target database based on the queried attribute information. create database my_database2 encoding='xxxxx' LC_COLLATE='xxxxx' LC_CTYPE ='xxxxx' TEMPLATE=xxx DBCOMPATIBILITY 'xxx';
-- Plain-text nohup gsql -d my_database2 -p 8000 -U root -W ******** -f /data/backup/my_schema_backup.sql -a > /data/backup/my_schema_restore.log & -- Custom nohup gs_restore /data/backup/my_database_backup.dmp -d my_database2 -p 8000 -U root -W ******** -F c -v -n my_schema > /data/backup/my_schema_restore.log & -- Directory nohup gs_restore /data/backup/my_database_backup -d my_database2 -p 8000 -U root -W ******** -F d -v -n my_schema > /data/backup/my_schema_restore.log & -- .tar archive nohup gs_restore /data/backup/my_database_backup.tar -d my_database2 -p 8000 -U root -W ******** -F t -v -n my_schema > /data/backup/my_schema_restore.log &
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