Connecting Oracle with MS
This article shows how Oracle's Heterogeneous Services can be configured to allow a database to connect to a Microsoft Access database using standard databases links. The method described can be used to connect to MS-Access from about any platform - Unix/ Linux or Windows.
MS-Access 2003 and Oracle 10g Release 1 are used to illustrate the concepts. However, this procedure should work with Oracle 8i, 9i and 10g databases, as well as various versions of MS-Access.
Step 1: Prepare the MS-Access environment
If you do not have a MS-Access environment, start by installing the required software and create a test table.
Step 2: Define ODBC connectivity
Use the ODBC Administrator Utility to define a local System DSN that can be used to connect to the Access database (same machine). Ensure that the correct *.MDB database file is selected.
Step 3: Prepare the Oracle Environment
Install the Oracle Database Server software on the same machine where MS-Access is installed.
NOTE: It is not sufficient to only install Client Software, as we require an Oracle Net Listener and the Heterogeneous Services (ORACLE_HOME\hs directory) software to be installed as well.
Step 4: Configure and Start the Oracle Listener
Configure the Oracle Listener on the Windows machine. Here is a sample LISTENER.ORA entry that can be used. Change the HOST, PORT and ORACLE_HOME entries to match your setup. You may also use a different SID_NAME if required.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = my_windows_machine_name)(PORT = 1521))
)
)
)
SID_LIST_LISTENER=
(SID_LIST =
(SID_DESC =
(SID_NAME = hsodbc)
(ORACLE_HOME = c:\Oracle\Ora101)
(PROGRAM = hsodbc)
)
)
Stop and start the listener service or from the command line:
C:\> lsnrctl stop
C:\> lsnrctl start
Step 5: Configure Oracle HS:
Edit the ORACLE_HOME\hs\admin\inithsodbc.ora file and add your ODBC System
Ïà¹ØÎĵµ£º
oracle±í¿Õ¼ä²Ù×÷Ïê½â
1
2
3×÷Õߣº À´Ô´£º ¸üÐÂÈÕÆÚ£º2006-01-04
5
6
7½¨Á¢±í¿Õ¼ä
8
9CREATE TABLESPACE data01
10DATAFILE '/ora ......
oracle10gÐÂÌØÐÔ£ºÉÁ»Ø»Ö¸´Çø(Flash recovery area)
Oracle9i¿ªÊ¼ÌṩÉÁ»Ø²éѯ£¬ÒÔ±ãÄÜÔÚÐèÒªµÄʱºò²éµ½¹ýȥij¸öʱ¿ÌµÄÒ»ÖÂÐÔÊý¾Ý£¬ÕâÊÇͨ¹ýUndoʵÏֵġ£Õâ¸ö¹¦ÄÜÓкܴóµÄÏÞÖÆ£¬¾ÍÊÇÏà¹ØÊÂÎñµÄundo²»Äܱ»¸²¸Ç£¬·ñÔò¾ÍÎÞÁ¦»ØÌìÁË¡£oracle10g´ó´óµÄÔöÇ¿ÁËÉÁ»Ø²éѯµÄ¹¦ÄÜ£¬²¢ÇÒÌṩÁ˽«Õû¸öÊý¾Ý¿â»ØÍ˵½¹ýȥij¸öʱ¿ÌµÄÄÜÁ¦£¬ ......
Êý¾Ý¿âÁ¬½ÓÊÇÒ»ÖֹؼüµÄÓÐÏ޵ݺ¹óµÄ×ÊÔ´£¬ÕâÒ»µãÔÚ¶àÓû§µÄÍøÒ³Ó¦ÓóÌÐòÖÐÌåÏÖµÃÓÈΪͻ³ö¡£¶ÔÊý¾Ý¿âÁ¬½ÓµÄ¹ÜÀíÄÜÏÔÖøÓ°Ïìµ½Õû¸öÓ¦ÓóÌÐòµÄÉìËõÐԺͽ¡×³ÐÔ£¬Ó°Ïìµ½³ÌÐòµÄÐÔÄÜÖ¸±ê¡£Êý¾Ý¿âÁ¬½Ó³ØÕýÊÇÕë¶ÔÕâ¸öÎÊÌâÌá³öÀ´µÄ¡£
Êý¾Ý¿âÁ¬½Ó³Ø¸ºÔð·ÖÅä¡¢¹ÜÀíºÍÊÍ·ÅÊý¾Ý¿âÁ¬½Ó£¬ËüÔÊÐíÓ¦ÓóÌÐòÖØ¸´Ê¹ÓÃÒ»¸öÏÖÓеÄÊý¾Ý¿ ......
1. create table people (age int, id int);
2. ´´½¨Êý¾ÝÎļþPeopleDate.txt.
Êý¾ÝΪ£º
20,1
30,2
3. ´´½¨ ......
oracle and sqlsever ³£ÓÃÊýѧº¯Êý¶Ô±È
Êýѧº¯Êý
¡¡¡¡1.¾ø¶ÔÖµ
¡¡¡¡S:select abs(-1) value
¡¡¡¡O:select abs(-1) value from dual
¡¡¡¡2.È¡Õû(´ó)
¡¡¡¡S:select ceiling(-1.001) value
¡¡¡¡O:select ceil(-1.001) value from dual
¡¡¡¡3.È¡Õû£¨Ð¡£©
¡¡¡¡S:select floor(-1.001) value ......