記錄一次sqlplus匯出檔案

wzq609發表於2015-07-28

【說明】本文件介紹通過sqlplus匯出資料的辦法

 

【1】遠端桌面登入到伺服器

 

【2】進行指令碼的編輯,指令碼檔案為D:\export.sql,用記事本開啟

注意:請注意修改匯出檔案的名稱和匯出條件

set termout off

set pagesize 0

set verify off

set echo off

set heading on;

spool D:\export\201413.csv #修改輸出的檔名

select FKDAT||','||VKORG||','||KTGRM||','||FKIMG||','||NETWR||','||MWSBP||','||TOTAL FROM VW_TOTAL_R WHERE FKDAT='20140113'; #修改輸出的條件,匯出20140113這一天的資料

spool off

exit

 

【3】執行指令碼

C:\Users\Administrator>sqlplus datachk/datachk@db1 #輸入指令碼

 

SQL*Plus: Release 11.2.0.1.0 Production on 星期一 4月 6 10:33:58 2015

 

Copyright (c) 1982, 2010, Oracle. All rights reserved.

 

 

連線到:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

 

SQL> @d:\export.sql 輸入指令碼

從 Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options 斷

 

【4】 匯出的結果檔案,在D:export下面

227659435

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12679300/viewspace-1754090/,如需轉載,請註明出處,否則將追究法律責任。

相關文章