Configuring the Map Tile Server for Oracle Maps Defining Permanent Map Data Sources

1-34 Oracle Fusion Middleware Users Guide for Oracle MapViewer keyword_list sdo_epsg_mapfile ..configepsg_srids.properties sdo_epsg_mapfile wms_config The host attribute specifies the host part of the service request URL that the client should use for future WMS requests made to this MapViewer server. The port attribute specifies the port part of the service request URL that the client should use for future WMS requests made to this MapViewer server. The protocol attribute specifies the protocol part of the service request URL that the client should use for future WMS requests made to this MapViewer server. The default_datasource attribute specifies the base data source used to retrieve the capabilities response. If this attribute is not defined, the data source WMS is used, and that data source must exist in this MapViewer server. The public_datasources attribute specifies which data source contents are to be listed in the GetCapabilities response. If this attribute is not defined, all data source contents will be listed. The title element specifies the service title to be included as part of the response. The abstract element specifies the abstract to be included as part of the response. The keyword_list element specifies a list of keywords that best describe the types of layers served by this MapViewer server. The sdo_epsg_mapfile element specifies a text file that defines mappings from Oracle Spatial SDO SRID values to the corresponding EPSG SRID values that are typically used in most WMS requests and responses. For information about this mapping file, see Section E.1.3 .

1.5.2.13 Configuring the Map Tile Server for Oracle Maps

The Oracle Maps feature of MapViewer can pre-generate base map image tiles and cache them through the map tile server. You can use the map_tile_server element to provide configuration information to the map tile server, such as default location for map tile file storage, and logging information, as shown in the following example: map_tile_server tile_storage default_root_path=scratchtilecache logging log_level=finest log_thread_name=false log_time=true log_output name=System.err logging map_tile_server The tile_storage element specifies the default root directory where all map image tiles generated by this MapViewer server will be stored. The logging element specifies logging information specific to the map tile server.

1.5.2.14 Defining Permanent Map Data Sources

Every map request must have a data source attribute that specifies a map data source, which is a database user with geospatial data. You can predefine available map data sources by using the map_data_source element. For example: map_data_source name=mvdemo jdbc_host=mapsrus.us.oracle.com jdbc_sid=orcl Introduction to MapViewer 1-35 jdbc_port=1521 jdbc_user=scott jdbc_password=password jdbc_mode=thin number_of_mappers=5 max_connections=100 allow_jdbc_theme_based_foi=true plsql_package=web_user_info You can specify the following information as attributes of the map_data_source element: ■ The name attribute specifies a unique data source name to MapViewer. You must specify the data source name in all map requests that identify a data source. ■ You must specify all necessary connection information, or a container data source name, or a net service name TNS name. That is, you must specify only one of the following, which are described in this section: jdbc_host, jdbc_sid, jdbc_ port, and jdbc_user; or container_ds; or jdbc_tns_name. Note that if the database on which you defined a data source on is restarted, and if the data source is created from jdbc_hostjdbc_sidjdbc_port or jdbc_ tns_name attributes, MapViewer will resume normal operation for example responding to map requests with properly created maps as soon as the database is back online. ■ The jdbc_host, jdbc_sid, jdbc_port, and jdbc_user attributes specify the database connection information and the database user name. As an alternative to specifying these attributes and the jdbc_password and jdbc_mode attributes, you can specify the container_ds attribute, described later in this section. ■ The jdbc_password attribute specifies the database users login password. It must be prefixed with an exclamation point when you specify the password for the first time. When MapViewer next restarts, it will automatically obfuscate and replace the clear text password. Note that MapViewer does not change this password string in any way; no conversion to upper or lower case is performed. If the database uses case-sensitive passwords, the specified password must exactly match the password in the database. ■ The jdbc_mode attribute tells MapViewer which Oracle JDBC driver to use when connecting to the database. The default is thin for the thin driver. The other possible value is oci8, which requires that you also have the Oracle Database client installed on the same host on which MapViewer is running. ■ The container_ds attribute lets you specify the J2EE container name from the ejb-location attribute value instead of specifying the jdbc_host, jdbc_sid, jdbc_port, jdbc_user, jdbc_password, and jdbc_mode attributes. For example, assume that the data_source element in the data-source.xml file for the standalone OC4J instance contains ejb-location=jdbcOracleDS. In this case, instead of using the example at the beginning of this section, you can define the permanent MapViewer data source as follows: map_data_source name=mvdemo container_ds=jdbcOracleDS number_of_mappers=5 max_connections=100 1-36 Oracle Fusion Middleware Users Guide for Oracle MapViewer To use the container_ds attribute in the MapViewer configuration file, you must start the OC4J instance with the -userThreads option. MapViewer processes its configuration file in a separate user thread; if the -userThreads option is not specified, the container’s context information is not available to user threads. However, if you are dynamically defining a data source through the MapViewer Administration page, you can use the container_ds attribute regardless of whether you started the OC4J instance with the -userThreads option. If you use the container_ds attribute, and if you want MapViewer to resume normal operation for example responding to map requests with properly created maps automatically after the database on which you defined a data source on is restarted, you must instruct the container data source to always validate a connection before it can be returned to the application. Check your middleware documentation for whether this option is supported and, if it is supported, how to enable it. ■ The jdbc_tns_name attribute identifies a net service name that is defined in the tnsnames.ora file. ■ The number_of_mappers attribute identifies the maximum number of map renderers available and thus the maximum number of map requests that MapViewer can process in parallel for the data source for this data source. Any unprocessed map requests are queued and eventually processed. For example, if the value is 3, MapViewer will be able to process at most three mapping requests concurrently. If a fourth map request comes while three requests are being processed, it will wait until MapViewer has finished processing one of the current requests. Specifying a large number_of_mappers value such as 50 or 100 can improve the overall throughput, but it will also increase run-time memory and CPU usage at times of peak loads, since MapViewer will attempt to process more concurrent map requests. It will also increase the number of active database sessions. Therefore, be sure that you do not set too large a number for this attribute. ■ The max_connections attribute specifies the maximum number of database connections or sessions open for the data source at any given time. In most cases you should not specify this attribute, and accept the default value of 100. If you specify a value that is too small, the effect on performance can be significant. For example, if you specify max_connections=5 for a map request with 12 predefined themes, 12 connections will still be created temporarily to meet the demand, but 7 of them will be closed immediately upon the completion of the request leaving only 5 open connections. MapViewer will then dynamically create database connections whenever it needs more than 5 to meet the demand when processing map requests, because the number of permanently open database connections will never exceed the specified max_connections attribute value. Specifying a value that is too small will almost certainly increase the time it takes to process a map request, because opening a new database connection involves significant processing overhead. ■ The allow_jdbc_theme_based_foi attribute lets you specify whether to allow JDBC theme-based FOI requests to be performed against this data source. A JDBC theme-based FOI request is based on a dynamic SQL query constructed by the JavaScript client application. By default, such FOI requests are not allowed unless you set this attribute to true. Due to the potential security threat, JDBC theme-based FOI requests should be Introduction to MapViewer 1-37 used with caution. You should only allow JDBC theme-based FOI requests on database connections that are granted very low privilege and contain only data that you want to expose. See Section 8.3.1.3 for more information about JDBC theme-based FOI requests. ■ The plsql_package attribute lets you specify a PLSQL package to be used for secure map rendering, as explained in Section 1.8 . ■ The web_user_type attribute not shown in the example in this section lets you specify the source for the authenticated user’s name. It is especially useful for getting the authenticated user’s name from a cookie, in conjunction with specifying a PLSQL package to be used for secure map rendering. For more information about the web_user_type attribute and an example of its use, see Section 1.8.2 .

1.5.3 Performing MapViewer Administrative Tasks