如何使用Linked Server連線Oracle與SQL Server
How to use SQL Analyzer with the Oracle Provider for OLE DB and SQL Server 2000
PURPOSE
-------
The purpose of this document is to show the steps needed to use the Microsoft SQL Analyzer query tool, which comes with Microsoft SQL Server, with the Oracle Provider for OLE DB. This will enable the user to use the 4 part query naming convention in SQL Analyzer.
SCOPE & APPLICATION
-------------------
This note is intended for all audiences that have some knowledge of SQL Analyzer, Oracle Provider for OLE and Microsoft SQL Server. How to use Microsoft SQL Analyzer with the Oracle Provider for OLE DB
------------------------------------------------------------------------ Configuration:
==============
Microsoft SQL Server 2000 SP 1 or 2 Microsoft Windows 2000 Server SP 2 Oracle Provider for OLE DB 8.1.7.3.0 Oracle Client 8.1.7.3.0 Oracle Database 8.1.7.3.0 Instructions to Setup the Linked Server Connection: ===================================================
1. Open SQL Server Enterprise Manager
2. Click on the + to expand the tree for the database server. You will need to expand it three times. Note: If the SQL Server does not appear here, you will need to right click and go through the Wizard for SQL Server Registration. - The first level of the tree is called Microsoft Sql Server, The second level of the tree is called SQL Server Group, and the third level of the tree is your SQL Server Database. For these instructions we will call our SQL Server Database, 'Scott'.
3. Under the Scott Database, click on the + to expand the tree control for 'Security'
4. Under Security, right click on Linked Servers and select "New Linked Server"
5. In the Linked Server Properties do the following:
a. Type in a Linked Server Name, for this example we will call it 'Tiger'
b. Under Server Type select Other data source
- For the provider name select Oracle Provider for OLE DB.
c. In the Data Source field, type in the Oracle Service name (SQL Net Alias)
d. Leave the Product Name and Provider String blank.
e. Click on the Provider Options button. - Check the check boxes for "Dynamic
Parameters" and "Allow InProcess"
f. Click Apply & then click OK. - The Provider Options dialog closes.
6. Go to the "Security" tab in the Linked Server Properties.
a. Select the radio button "Be made using this security context" at the bottom of the box.
b. Type in the User ID (your Oracle login), ie. Scott in the "Remote login" field and your Password, ie. Tiger in the "With Password" field.
7. Go to the "Server Options" tab in the Linked Server Properties.
a. While leaving the default selections selected, also check the checkbox for "Collation Compatible".
b. Click OK This will create your Linked Server named Tiger.
Test the Linked Connection
==================================
To test the Linked Server, open up Microsoft Query Analyzer (It is found under the Microsoft SQL Server menu option).
1. Select your SQL Server in the Connect to SQL Server box.
a. Since we have the SQL Server installed on the same machine, we select (local).
b. Select the appropriate Connect using option. This is determined when you
Installed/Created your SQL Server database. For our example here we use
Windows Authentication. And click on the Ok button.
2. In the Query screen you can type a query. The query will follow this format: SELECT * FROM...
IE. SELECT * FROM TIGER..SCOTT.EMP
3. If you have the default scott/tiger schema installed in your Oracle database you can use the following query: SELECT * FROM TIGER..SCOTT.EMP
4. Type it into the Query box.
5. Click on the Green Arrow to run the query.
6. You should see the contents of the Emp table in the Grid.
PURPOSE
-------
The purpose of this document is to show the steps needed to use the Microsoft SQL Analyzer query tool, which comes with Microsoft SQL Server, with the Oracle Provider for OLE DB. This will enable the user to use the 4 part query naming convention in SQL Analyzer.
SCOPE & APPLICATION
-------------------
This note is intended for all audiences that have some knowledge of SQL Analyzer, Oracle Provider for OLE and Microsoft SQL Server. How to use Microsoft SQL Analyzer with the Oracle Provider for OLE DB
------------------------------------------------------------------------ Configuration:
==============
Microsoft SQL Server 2000 SP 1 or 2 Microsoft Windows 2000 Server SP 2 Oracle Provider for OLE DB 8.1.7.3.0 Oracle Client 8.1.7.3.0 Oracle Database 8.1.7.3.0 Instructions to Setup the Linked Server Connection: ===================================================
1. Open SQL Server Enterprise Manager
2. Click on the + to expand the tree for the database server. You will need to expand it three times. Note: If the SQL Server does not appear here, you will need to right click and go through the Wizard for SQL Server Registration. - The first level of the tree is called Microsoft Sql Server, The second level of the tree is called SQL Server Group, and the third level of the tree is your SQL Server Database. For these instructions we will call our SQL Server Database, 'Scott'.
3. Under the Scott Database, click on the + to expand the tree control for 'Security'
4. Under Security, right click on Linked Servers and select "New Linked Server"
5. In the Linked Server Properties do the following:
a. Type in a Linked Server Name, for this example we will call it 'Tiger'
b. Under Server Type select Other data source
- For the provider name select Oracle Provider for OLE DB.
c. In the Data Source field, type in the Oracle Service name (SQL Net Alias)
d. Leave the Product Name and Provider String blank.
e. Click on the Provider Options button. - Check the check boxes for "Dynamic
Parameters" and "Allow InProcess"
f. Click Apply & then click OK. - The Provider Options dialog closes.
6. Go to the "Security" tab in the Linked Server Properties.
a. Select the radio button "Be made using this security context" at the bottom of the box.
b. Type in the User ID (your Oracle login), ie. Scott in the "Remote login" field and your Password, ie. Tiger in the "With Password" field.
7. Go to the "Server Options" tab in the Linked Server Properties.
a. While leaving the default selections selected, also check the checkbox for "Collation Compatible".
b. Click OK This will create your Linked Server named Tiger.
Test the Linked Connection
==================================
To test the Linked Server, open up Microsoft Query Analyzer (It is found under the Microsoft SQL Server menu option).
1. Select your SQL Server in the Connect to SQL Server box.
a. Since we have the SQL Server installed on the same machine, we select (local).
b. Select the appropriate Connect using option. This is determined when you
Installed/Created your SQL Server database. For our example here we use
Windows Authentication. And click on the Ok button.
2. In the Query screen you can type a query. The query will follow this format: SELECT * FROM
IE. SELECT * FROM TIGER..SCOTT.EMP
3. If you have the default scott/tiger schema installed in your Oracle database you can use the following query: SELECT * FROM TIGER..SCOTT.EMP
4. Type it into the Query box.
5. Click on the Green Arrow to run the query.
6. You should see the contents of the Emp table in the Grid.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35489/viewspace-596511/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- SQL Server 連結伺服器(Linked Servers)SQLServer伺服器
- NavicatPremium 連線SQL Server 、MySQL等REMServerMySql
- SQL Server如何判斷哪些會話/連線是長連線?SQLServer會話
- Python連線三大資料庫MS Sql Server、Oracle、MySQLPython大資料資料庫ServerOracleMySql
- 使用SSMS連線和查詢 SQL Server 例項SSMSQLServer
- python 怎麼連線 sql server,不是連線 mysqlPythonServerMySql
- Windows 下 Laravel 7.0 連線 sql serverWindowsLaravelSQLServer
- Sqlserver 如何truncate linked server的表SQLServer
- 允許本地Sql Server 遠端連線SQLServer
- SQL Server 2008連線字串寫法大全SQLServer字串
- c#連線SQL Server資料庫C#SQLServer資料庫
- sql server 使用SQLServer
- Oracle透過ODBC連線SQL Server資料庫後ORA-12514OracleSQLServer資料庫
- 配置SQL server遠端連線(區域網)SQLServer
- 連線sql server時,不能使用127.0.0.1的解決辦法SQLServer127.0.0.1
- dbForge Studio for SQL Server入門教程:如何連線到資料庫SQLServer資料庫
- SQL Server中GROUP BY(連結)SQLServer
- telnet連線socket serverServer
- SQL Server與伺服器連線時出錯的解決方案SQSQLServer伺服器
- sql serverSQLServer
- 在 SQL Server 中查詢活動連線和死鎖SQLServer
- Oracle\MS SQL Server Update多表關聯更新OracleSQLServer
- MySql/Oracle和SQL Server的分頁查MySqlOracleServer
- SQL Server AlwaysOn的Oracle等價技術SQLServerOracle
- sqlserver建立linked server到redshift的方法SQLServer
- SQL Server建立使用者函式與應用SQLServer函式
- 解決無法連線SQL Server資料庫的方法BWSQLServer資料庫
- 動態網頁(JSP 檔案)如何連線資料庫(SQL Server)--看這裡網頁JS資料庫SQLServer
- Moebius for SQL ServerSQLServer
- SQL Server教程SQLServer
- Blazor使用sql server 資料庫BlazorSQLServer資料庫
- KCSQL SERVER實現連線與合併查詢dinSQLServer
- mybatis-plus連線SQL Server2012分頁查詢異常MyBatisSQLServer
- 雲伺服器SQL Server 2008 允許遠端連線的配置伺服器SQLServer
- SQL Server如何配置cdc進行ETLSQLServer
- SQL Server 如何合併組內字串SQLServer字串
- SQL Server中的版本號如何理解SQLServer
- sqlserver的waitresource等待事件是linked server連結伺服器的問題SQLServerAI事件伺服器
- SQL SERVER優化SQLServer優化