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_ADMIN它指向包含tnsnames.ora文件的文件夹。这是本文在下面讨论。如果您使用easy connectstrings then this environment variable will not be required.
请注意,每个路径或其它环境变量发生变化时,FME需要重新启动。外界变化不会影响任何正在运行的进程,或正在运行的进程的任何新创建子进程。
如果FME或FME Server不会用正确的文件查找/ lib文件夹不会承认的Oracle客户端。直接设置LD_LIBRARY_PATH可以克服一些问题 - 一些客户已经成功报道做这种方式。在Oracle完整的客户端安装的说明:如果使用的是Oracle完整的客户端安装的安装文件夹将包含一个/ lib子文件夹和ORACLE_HOME应足以将其设置为FME将使用ORACLE_HOME路径,找到并确认了“LIB”的存在文件夹,并将其应用到LD_LIBRARY_PATH追加/ lib添加到它。在Instant客户端的“LIB”文件夹不存在,所以这是用于创建lib文件夹和文件复制到该文件夹(步骤3-5)的原因的情况。对于FME Server的这些环境变量应被添加到startEngines.sh脚本/ fmeserver /服务器目录中找到。
> LD_LIBRARY_PATH = /导出/家庭/ SD / instantclient_10_2 / lib目录下:$ {LD_LIBRARY_PATH}>出口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
For example
scott/tiger@//amidala:1521/orcl
使用这个字符串就不需要输入用户名或密码 - 这些都包含在轻松连接字符串。
注意:如果您收到有关访问NLS数据文件的投诉,你将不得不建立NLS_LANG环境变量您的语言环境。下面类似的方法来设置上述路径,定义一个名为NLS_LANG与一个值,如AMERICAN_AMERICA.WE8ISO8859P1或JAPANESE_JAPAN.JA16EUC有时,这种变量在Windows注册表中定义了一个新的环境变量,并尽可能甲骨文可能有无效值关心。
如果你不喜欢使用上述指定您的连接的语法,你必须创建一个tnsnames.ora文件来配置你的连接选项。tnsnames.ora中可以在任何地方驻留在系统上,但是为了方便,可以放在同一个目录中安装即时客户端在哪里。这个文本文件包含了一系列的服务定义,这是形式的:
= (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = )(PORT = <1521>)) ) (CONNECT_DATA =(SERVICE_NAME= ) ) )
例如:
阿米达拉=(DESCRIPTION =(ADDRESS_LIST =(ADDRESS =(PROTOCOL = TCP)(HOST =阿米达拉)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = ORCL)))
一旦你创建tnsnames.ora文件,则必须设置TNS_ADMIN环境变量是路径的tnsnames.ora,但不包括在tnsnames.ora文件名本身。例如,
TNS_ADMIN = C:\ win32apps \ ORACLE \ instantclient_10_2
注意:看来,TNS_ADMIN不喜欢带空格的路径名。如果遇到问题,请尝试将在tnsnames.ora中不具有名称包含空格的目录中。此外,还有可以在文本制表符等等,而不是复制粘贴此示例条目最好是建立一个从头开始的问题。
笔记2: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.
注3: 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.
注4:Mac用户,请参阅本文章for 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.
如果您收到“fmeocilink.so" error when running a workspace on Linux, see这里故障排除提示。
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
©2020安全亚搏在线软件公司|法律