一般在要在命令列模式下要將MySQL的資料匯出成CSV,我通常都是直接mysql -e "SQL Statement" > /tmp/output.csv,然後SQL Statement用CONCAT組成逗號分隔的字串出來
2016年1月27日 星期三
2015年12月15日 星期二
無法開啟SQL Server Error Log
今天在檢查某台SQL Server,在本機上透過SSMS要開啟Error Log,等了好久居然打不開?出現如下錯誤
An exception occurred while executing a Transect-SQL statement or batch.
(Microsoft.SqlServer.ConnectionInfo)
A severe error occurred on the currentcommand. The results, if any, should be discarded
An exception occurred while executing a Transect-SQL statement or batch.
(Microsoft.SqlServer.ConnectionInfo)
A severe error occurred on the currentcommand. The results, if any, should be discarded
2015年8月27日 星期四
[SSIS][Error]ADO NET Source: Object reference not set to an instance of an object.
Description: System.NullReferenceException: Object reference not set to an instance of an object.
Description: ADO NET Source failed the pre-execute phase and returned error code 0x80004003.
突然有天,運行數月的SSIS排程失敗了,這SSIS主要是從MySQL匯入資料到SQL Server上,錯誤訊息如上,用的是MySQL ODBC Provider
為什會有NullReferenceException的異常讓我百思不解?最後研究發現應該是網路的問題,詢問網管後才得知,公司前一天有被DDOS攻擊,防火牆有做調整,造成大資料量的傳輸會被封鎖,小資料量的傳輸就都沒有問題,DB間使用的網段加入白名單就解了,很瞎吧
Description: ADO NET Source failed the pre-execute phase and returned error code 0x80004003.
突然有天,運行數月的SSIS排程失敗了,這SSIS主要是從MySQL匯入資料到SQL Server上,錯誤訊息如上,用的是MySQL ODBC Provider
為什會有NullReferenceException的異常讓我百思不解?最後研究發現應該是網路的問題,詢問網管後才得知,公司前一天有被DDOS攻擊,防火牆有做調整,造成大資料量的傳輸會被封鎖,小資料量的傳輸就都沒有問題,DB間使用的網段加入白名單就解了,很瞎吧
2015年7月25日 星期六
[SSAS]Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host
原本運作正常的Cube,突然間連線時出現下面這個錯誤
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host
查了半天,想說我什都沒動啊,到底哪出了錯,該不會遇到什bug吧,因為用2014的,結果是個愚蠢的錯,windows account忘了勾永不過期,預設45天就過期了XD
2015年6月30日 星期二
[Oracle優化]CPU使用率突然飆高了!
某天管理的Oracle,它的CPU使用率突然飆高了一倍,平常使用率很低的,所以飆高了一倍還好。對一個穩定的系統來講,CCU沒有多一倍,CPU卻飆高一倍是很奇怪的,而且接下公司有辦活動,要是CCU暴增就不敢保證不會有問題了,所以要想辦法找出什麼原因造成CPU飆高
首先看飆高當天的AWR,下圖是Top 5 Timed Foreground Events,第一名的DB CPU約佔73%,第二名的library cache: mutex X只佔10%左右,這還算正常
首先看飆高當天的AWR,下圖是Top 5 Timed Foreground Events,第一名的DB CPU約佔73%,第二名的library cache: mutex X只佔10%左右,這還算正常
2015年6月22日 星期一
[SSIS][PostgreSQL]Error code:0x80040E21 Description: Multiple-step OLE DB operation generated errors.
在SSIS Project裡,我打算從PostgreSQL匯入資料到SQL Server上,然後執行時出現如下錯誤,從錯誤訊息裡得知好像是欄位型態轉換的問題
[OLE DB Destination [29]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E21.
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0x80040E21
Description: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.".
[OLE DB Destination [29]] Error: An error occurred while setting up a binding for the "name" column. The binding status was "DT_NTEXT".
The data flow column type is "DBBINDSTATUS_UNSUPPORTEDCONVERSION".
The conversion from the OLE DB type of "DBTYPE_IUNKNOWN" to the destination column type of "DBTYPE_WVARCHAR" might not be supported by this provider.
PostgreSQL該欄位上是TEXT,而SQL端對應欄位是NVARCHAR,我中間沒有加入資料轉換元件,對於異質資料轉換,我習慣在來源端就先轉掉好了,比較不容易出問題,所以直接在PostgreSQL來源端用cast轉換就好,例子如下
[OLE DB Destination [29]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E21.
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0x80040E21
Description: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.".
[OLE DB Destination [29]] Error: An error occurred while setting up a binding for the "name" column. The binding status was "DT_NTEXT".
The data flow column type is "DBBINDSTATUS_UNSUPPORTEDCONVERSION".
The conversion from the OLE DB type of "DBTYPE_IUNKNOWN" to the destination column type of "DBTYPE_WVARCHAR" might not be supported by this provider.
PostgreSQL該欄位上是TEXT,而SQL端對應欄位是NVARCHAR,我中間沒有加入資料轉換元件,對於異質資料轉換,我習慣在來源端就先轉掉好了,比較不容易出問題,所以直接在PostgreSQL來源端用cast轉換就好,例子如下
select id,cast(name as varchar(32)) as name from accounts這樣就沒再出錯囉
2015年6月17日 星期三
[SSIS]如何連到PostgreSQL
首先去下載psqlodbc,因Server是64 bit的,用Visual Studio開發SSIS Project得用32 bit,而我開發佈署都在同一台Server上,所以兩種Driver都得裝喔
安裝完Driver後,設定ODBC Data Source Administrator,也是32 bit與64 bit都要設,記得名稱要設一樣的,下面會講一下設定
安裝完Driver後,設定ODBC Data Source Administrator,也是32 bit與64 bit都要設,記得名稱要設一樣的,下面會講一下設定
訂閱:
文章 (Atom)




