oracle 匯出資料再壓縮

來源:互聯網
上載者:User
oracle|匯出資料|壓縮
mybat.bat
sqlplus -s a/a@mydb @d:\a\mysql.sql

mysql.sql

set time off echo off head off                              --此行設定不計算時間  不顯示sql語句 不每隔幾行現一下列名
set pagesize 0                                              --去掉沒格幾行就顯示一下的空行或多餘的空格
set trims on                                                --去掉全部空格,預設長度不夠填充空格
set feedback off                                            --不顯示選擇行數 不能和上一行和在一起
spool d:\a\aa1.txt                                          --輸出
select TNAME||'|'||TABTYPE||'|'||CLUSTERID   from tab;      --內容  
spool off                                                   --停止輸出 
host d:\rar.exe a  d:\a\aa1   d:\a\aa1.txt                  --壓縮      
spool d:\a\aa2.txt
select TNAME||'|'||TABTYPE||'|'||CLUSTERID   from tab;
spool off
host d:\a\rar.exe a  d:\a\aa2   d:\a\aa2.txt
host d:\a\rar.exe a  d:\a\yswj   d:\a\*.txt
host d:\a\rar.exe e -o+ d:\a\yswj.rar  *  d:\a\a\          --解壓檔案,如果重複則覆蓋
host del d:\a\a\aa1.txt                                    --刪除檔案

測試檔案全部放到d:\a\目錄下進行 有mysql.sql檔案 和 rar.exe 檔



聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.