greenplum 資料匯入 匯出

2021-09-02 22:30:21 字數 588 閱讀 1786

匯出語句 匯出為csv格式的資料:

新增欄位頭匯出

psql -d  databasename   -h  localhost     -p 5432  -c "\copy (select * from  tablename  limit 10000 ) to /tmp/my_data2.csv  with csv header  delimiter '|' "  

不新增欄位頭匯出

psql -d  databasename   -h  localhost     -p 5432  -c "\copy (select * from  tablename  limit 10000 ) to /tmp/my_data2.csv  with csv delimiter '|' "  

匯入語句

注意:若匯入的是csv格式的資料,需要刪除匯入文件中第一行欄位的資料。

psql -h localhost -p 5432 -d databasename   -u gpadmin  -c "\\copy tablename  from '/tmp/my_data.csv' with delimiter as '|' null as 'null string'"

匯入匯出資料

從檔案中裝載資料 hive load data local inpath overwrite into table t2 partition province beijing local linux本地的檔案。無local 是hdfs的檔案 注意 從本地檔案系統中將資料匯入到hive表的過程中,其實...

資料匯入匯出

資料匯入匯出是指sql server資料庫系統與外部系統之間進行資料交換的操作。匯入資料是草外部資料來源中查詢或指定資料,並將其插入到sql server的資料表中的過程,也就是說把其他系統的資料引入到sql server的資料庫中 而匯出資料是將sql server資料庫中的資料轉換為使用者指定格...

匯入匯出資料

1.按使用者匯出及匯入 匯出 1.用sys登陸orcl 源資料庫 2.建立邏輯目錄 create directory yandata1 as d test dump d test dump 必須物理存在且空間足夠.3.給scott付給許可權可以讀寫邏輯目錄.grant read,write on d...