Skip to main content

Backing up Tables

Exporting tables from the database to the Linux server (Backup)

Log on to the accelerator server and check that you have enough space to take backups of data.

Note: The backup process creates uncompressed copies of the tables, and hence will consume disk space. Best practice recommendation is to create an NFS mount or similar to a remote server to store the backup of your accelerator data.

  1. Create a directory to hold the backups:

    mkdir /tmp/<Backup_Directory_Name>

  2. Navigate to the new directory:

    cd /tmp/<Backup_Directory_Name>

  3. Optionally, if required you can create subdirectories for each schema you are backing up.

    The command that is used to take a backup of the table and data is called copydb. The function will create two files, copy.in and copy.out. These files are then used to create the export data files (copy.out) and then to restore the tables and data (copy.in).

    The copydb command takes the following parameters:

    • To copy all the tables in the schema owned by the database user:

      copydb <database_name> -u<DB_UserName>

    • To copy one or multiple tables from the schema owned by the database user:

      copydb <database_name> -u<DB_UserName> -r<TableName1> <TableName2>

  4. Running the copydb command will create two files, copy.in and copy.out. For example, if you want to back up TableA from the replication schema, you would run:

    copydb db -ureplication -rTableA

    This will create copy.in and copy.out into the directory where I ran the command.

  1. Run the export command to generate the data file backup, based on the copy.out file. The syntax for the export command is:

    sql <database_name> -u<DB_UserName> < copy.out

    For example:

    sql db -ureplication < copy.out

    This will create individual data files named <tablename>.<schema> in the directory that where I ran the command from. In our example, TableA.replication.