SQLLODER匯入WIn效能資料

gaopengtttt發表於2013-03-24

"(PDH-CSV 4.0) ()(-480)"," KBytes"," Idle Time",". Disk Queue Length",". Disk sec/Read",". Disk sec/Write"," Idle Time"
"10/16/2012 10:10:36.459","8825532"," "," "," "," "," "," "
"10/16/2012 10:10:51.459","8830616","412.44303858134458","79.362825411250697","0.2632983148907847","0.0032208791208791208","0.0052627118644067794","98.150413837351437"


 create table per
   (gettime timestamp,
    mem_free_kb number(30),
     mem_pages_sec number(30),
     phy_disk_total_pct number(30),
    phy_Disk_total_Que_len number(30),
     phy_Disk_total_sec_read number(30),
    phy_Disk_total_sec_write number(30),
    cpu_Idle_time_pct number(30));
    alter table per add constraint pk_p primary key(gettime);


LOAD DATA
INFILE '/home/oracle/per_000003.csv'
into table PER
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
(gettime timestamp "mm/dd/YYYY hh24:mi:ss.ffx",mem_free_kb,mem_pages_sec,phy_disk_total_pct,phy_Disk_total_Que_len,phy_Disk_total_sec_read,phy_Disk_total_sec_write,cpu
_Idle_time_pct)

select to_char(gettime, 'yyyy-mm-dd hh24:mi:ss') time_per,
       mem_free_kb,
       mem_pages_sec,
       NET_FACE_BYTE_SEC,
       phy_disk_total_pct,
       phy_Disk_total_Que_len,
       phy_Disk_total_sec_read,
       phy_Disk_total_sec_write,
       cpu_Idle_time_pct
  from per
  order by time_per ;

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

相關文章