span8
span4
span8
span4
Intro: Getting Started with Oracle |Next Section: Converting from Oracle
Connecting to a database differs slightly from selecting a file/folder based format.Establishing a database connection requires first that database connection parameters be supplied.The basic database connection parameters include:
Parameters will differ depending on the database format being used,but changes to parameter settings will always be made by clicking on the "Parameters.." button on the dataset selection dialog.
Follow these steps to connect to an Oracle Spatial database in FME.
There are two methods that can be used to connect to database services;Embed Connections,and Database Connections (also referred to as Named Connections).Embed connections requires the user to enter connection parameters each time a user reads from or writes to a database.Database connections provide a simple and secure way to store and reuse connection parameters.Database connections are specified once,and then it is possible to reuse a previously saved connection,rather than having to re-enter connection parameters each time.For more information regarding database connections,please seeUsing Database Connections.
It is possible to connect to an Oracle database using different methods.
Note:This tutorial series does not provide public access to an Oracle database;rather,it is expected that you follow along through the exercises using your own Oracle instance.Therefore,you will need to replace the database connection parameters with your system-specific parameters.
The Easy Connect connection string is the easiest way of connecting to your Oracle database.Use this type of connection string as your "dataset" in FME.When using this string it is not necessary to enter a username or password - these are included in the Easy Connect string.
user/password@//hostname:port/sid
For example
scott/tiger@//amidala:1521/orcl
Using the Oracle Easy Connect Connection String
Another method for configuring an Oracle database connection involves the use of a tnsnames.ora file.The tnsnames.ora file could reside anywhere on the system,but for convenience it should be placed in the same directory as where the instant client was installed.A tnsnames.ora 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= ) ))
For example:
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 of the tnsnames.ora,(NOT including the tnsnames.ora filename itself).For example,
TNS_ADMIN=C:\win32apps\oracle\instantclient_10_2
Note: TNS_ADMIN may have problems resolving path names with spaces in them,and it is recommended to avoid paths that include them.Also,there can be an issue with tab characters in a tnsnames.ora file,so rather than copying and pasting the text from the example provided above,it is recommended that a new file be created.
Using the TNSNAMES (tnsnames.ora) file to Connect to Oracle
The Firehalls table,which includes both geometry and attributes,is displayed in the FMEData Inspector.
Performing spatial queries on database tables using the FeatureReader
Let the Database Do the Work: Reading
Using Data Inspector to view GeoMedia Text Features in an Oracle database
FME is loading features with invalid geometries into my Database
Working with Foreign Keys: Writing Database Tables
Working with Alternatives or Versions in Smallworld
© 2019 亚搏在线Safe Software Inc |Legal