span8
span4
span8
span4
Can I connect to Oracle using FME and an Oracle Instant Client?
Yes - however be aware that you need the same platform level - i.e. if you have 32-bit FME, then you need a 32-bit Oracle Client. If you have 64-bit FME, then you need a 64-bit Oracle client. This is regardless of what platform your Oracle database is running onand is especially important when using a 64-bit OS. More details on platform issues are available这里。
Using 32-bit Oracle with 64-bit FME may produce the following error in the FME Workspace log:
Could not open the Enterprise Geodatabase. The error number from ArcObjects is: '-2147155644'. The error message from ArcObjects is: {Cannot connect to database because the database client software failed to load. Be sure the database client software is installed and configured correctly.}
Also, if you plan to use tns aliases via the tnsnames.ora file, then it is often necessary to create an environment variable calledTNS_ADMINthat points to the folder containing the tnsnames.ora file. This is discussed below in this article. If you useeasy connectstrings then this environment variable will not be required.
请注意,每个路径或其它环境变量发生变化时,FME需要重新启动。外界变化不会影响任何正在运行的进程,或正在运行的进程的任何新创建子进程。
If FME or FME Server doesn't find the /lib folder with the correct files it will not recognize the Oracle Client. Directly setting the LD_LIBRARY_PATH may overcome some issues - some customers have reported success doing it this way. A note on Oracle Full Client Installations: If using an Oracle full client installation the install folder will contain a /lib subfolder and the ORACLE_HOME should be sufficient to set as FME will use the ORACLE_HOME path, locate and confirm the existence of the 'lib' folder and apply it to the LD_LIBRARY_PATH appending /lib to it. In the case of the Instant client the 'lib' folder doesn't exist and so that is the reason for creating the lib folder and copying the files to this folder (step 3-5). For FME Server these environment variables should be added to the startEngines.sh script found in /fmeserver/Server directory.
> LD_LIBRARY_PATH=/export/home/sd/instantclient_10_2/lib:${LD_LIBRARY_PATH} > export LD_LIBRARY_PATH
With certain platforms, the name of the Oracle client library distributed with the instant client contains versioning information that FME doesn't expect. For example, on Solaris it is called something like libclnsh.so.10.1. Fix this by creating a symbolic link in the instant client directory to what FME is expecting:ln -s libclntsh.so.10.1libclntsh.so
简易连接的连接字符串连接到Oracle数据库的最简单的方法。使用这种连接字符串作为FME你的“数据集”。
user/password@//hostname:port/sid
对example
scott/tiger@//amidala:1521/orcl
使用这个字符串不necessary to enter a username or password - these are included in the Easy Connect string.
Note:If you get a complaint about accessing NLS data files, you will have to set up the NLS_LANG environment variable for your locale. Following a similar method to setting the PATH above, define a new environment variable called NLS_LANG with a value such as AMERICAN_AMERICA.WE8ISO8859P1 or JAPANESE_JAPAN.JA16EUC Sometimes this variable is defined in the Windows registry, and might have an invalid value as far as Oracle is concerned.
If you prefer not to use the syntax above for specifying your connection, you have the option to create a tnsnames.ora file to configure your connections. tnsnames.ora could reside anywhere on the system, but for convenience it can be placed in the same directory as where the instant client was installed. This text file consists of a series of service definitions, which are of the form:
= (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = )(PORT = <1521>)) ) (CONNECT_DATA =(SERVICE_NAME= ) ) )
例如:
AMIDALA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = AMIDALA)(PORT = 1521)) ) (CONNECT_DATA =(SERVICE_NAME = ORCL) ) )
Once you've created the tnsnames.ora file, you must then set the TNS_ADMIN environment variable to be the path to the tnsnames.ora, but NOT including the tnsnames.ora filename itself. For example,
TNS_ADMIN=C:\win32apps\oracle\instantclient_10_2
Note:It seems that TNS_ADMIN doesn't like path names with spaces in them. If you run into problems, try placing tnsnames.ora in a directory that does not have spaces in the name. Also, there can be an issue with tab characters in the text so rather than copying and pasting this example entry it is better to create one from scratch.
Note2:For some scenarios, users reported that having the tnsnames.ora file in the oracle\instantclient_xx_x\client\network\admin directory saved them from having to define the TNS_ADMIN environment variable.
Note3: If you have a requirement for both 32bit and 64bit clients, TNS_ADMIN environment variable can be used to inform both clients of the one tnsnames.ora file. This allows you to maintain only one file for both clients.
Note4: Mac users, refer to thisarticlefor a helpful tip in creating the TNS_ADMIN environment variable.
If the Oracle formats are still greyed out in your Formats Gallery see这里for more troubleshooting tips. In addition, we recommend using a third-party tool such as SQLDeveloper or Toad to test your connection. If you can access the Oracle database via these tools using a TNS connection then FME should also work. Testing from SQLPlus is not sufficient.
If you receive an "fmeocilink.so" error when running a workspace on Linux, see这里for troubleshooting tips.
If you are using tns aliases (tnsnames.ora) and are still having issues connecting, try testing with the easy connection as indicated above. Instead of the tns alias value try the hostname and service name.
hostname:port/sid or hostname:port/servicename
Geodatabase Direct Connect returning error - "TNS: could not resolve the connect identifier"
Connecting to an Oracle database with an older client (9.x)
FME, macOS and the Oracle Client - a tip for setting the TNS_ADMIN Env Variable
Database License Editions of FME Desktop
fmeocilink.so was found but could not be loaded
© 2020 Safe Software Inc |Legal