Copying tables as a backup

Hi,

I understand there's a means to backup a table via vbr.py, but as far as I understand this script can be invoked only by the dbadmin.

We're looking at backing up our tables by creating a backup table using the CREATE TABLE statement along with the LIKE clause and then performing a COPY.  In this case, will all the data be copied over to the new table, or under the hood will there be only a rearrangement of pointers? We're trying to evaluate the space requirements associated with performing a full COPY of the table.

 

Thanks! 

Comments

  • Hi ,

    Using this method you will have two separate objects with separate data ( full duplication ) 

    Thanks 

  • Perfect, thank you Eli!

  • There is a much faster way to copy tables in Vertica 8.0.

     

    It's a simple meta-function, called copy_table. syntax is:

     

    =>select copy_table('source_table','dest_table');

     

    That's it. This is the fastest way to copy a table as a backup, no disk IO involved, 1000X faster than Create Table .. As Select..

     

    Disk space: no need to have additional disk space upfront, but as two tables diverge (deletes/updates/inserts/merge out), they will get their own storage.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file