安裝 Oracle Client (10.2g) On SharePoint 2010

  • 8677
  • 0
  • 2011-08-01

接到新的任務, 把 ERP 的資訊在我們的 SharePoint Portal 上呈現,
但是公司 ERP DB 是 Oracle Base, 所以需安裝 Oracle Client 來連接...

接到新的任務, 把 ERP 的資訊在我們的 SharePoint Portal 上呈現,

但是公司 ERP DB 是 Oracle Base,  所以需安裝 Oracle Client 來連接

PS. 是 Oracle Client , 不是 Oracle Instant Client

特別注意需 X64 & X86 兩個不同位元版本一同安裝至主機上

不然會出現

Exception message: 嘗試載入 Oracle 用戶端程式庫時傳出 BadImageFormatException。當與具有 32 位元的 Oracle 用戶端元件執行 64 位元模式安裝時,會出現此問題。

Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.

原因請參考 :

我的奮鬥-System.Data.OracleClient on Windows 2008 x64

並在安裝前需將兩種位元版本的 Oracle Installer 個別安裝檔設定做些調整

參考 : Checking operating system version: must be 5.0, 5.1, 5.2 or 6.0 . Actual 6.1 Failed <<<<

1. 在 \stage\prereq\client\refhost.xml 加入下列參數

 
<OPERATING_SYSTEM>
<VERSION VALUE="6.1"/>
</OPERATING_SYSTEM>

2. 在 \client\install\oraparam.ini 加入下列參數

 
[Certified Versions]
# You can customise error message shown for failure, provide value for 
CERTIFIED_VERSION_FAILURE_MESSAGE
Windows = 5.0,5.1,5.2,6.0,6.1 
 
[Windows-6.1-required]
# Minimum display colors for OUI to run
MIN_DISPLAY_COLORS = 256
# Minimum CPU speed required for OUI
# CPU = 300 

在兩種位元板本 Oracle Client 裝完後

在SharePoint 上新增 ASPX 空白頁面

並在頁面上加入 GridView 及 SQLDataSource 控制項測試

 
<asp:GridView runat="server" id="GridView1" DataSourceID="SqlDataSource1" 
AutoGenerateColumns="False" BorderStyle="None" BackColor="White" 
GridLines="Vertical" BorderColor="#DEDFDE" BorderWidth="1px" ForeColor="Black" 
CellPadding="4" p="" AllowPaging="True" 
AllowSorting="True">
</asp:GridView>
<asp:SqlDataSource 
id="SqlDataSource1" runat="server" selectcommand="select * from sn_test_data " 
connectionstring="Data Source=TEST;Password=tiger;User ID=scott" 
providername="System.Data.OracleClient" />

即可在 SharePoint 上 Query Oracle 內的資料

image