Import and export of database Vertica script mode

Source: Internet
Author: User

Need to enter under Vsql:

Import:

Copy emp from '/tmp/emp.csv ' DELIMITER ', ' ESCAPE as ' \ ' enclosed by ' "' DIRECT EXCEPTIONS '/log file path/log filename. log '
Directly on the server command line where the Vertica is located:
vsql-d db Instance-u user name-w password-c "copy corresponding database table from ' file name ' DELIMITER ', '" DIRECT EXCEPTIONS '/log file path/log filename. log ';

Such as:

vsql-d ncell-u dbadmin-w 1-c "copy emp from '/tmp/emp.csv ' DELIMITER ', '" DIRECT EXCEPTIONS '/tmp/emp.log ';

Export:

The current path to the server where the database is located is exported

vsql-d db Instance-u user name-W password-f ', '-at-o exported filename-C ' select * from corresponding database table; "

Such as:

vsql-d ncell-u dbadmin-w 1-f ', '-at-o emp.csv-c ' select * from NCell. EMP; "

In fact other databases (Oracle,mysql ...) Import and export are similar to this

The Vertica of the above command is on the Linux server.

Import and export of database Vertica script mode

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.