E.2 Network Data Model (NDM) Network Administration

The Oracle Routing Engine requires an Oracle Spatial and Graph network data model (NDM) network, built on the routing engine data, to process route requests and to generate responses.

The following are related to NDM network administration operations:

Network Creation Example describes the steps for creating a sample NDM network for routing engine use.

E.2.1 CREATE_ROUTER_NETWORK Procedure

Syntax:

SDO_ROUTER_PARTITION.CREATE_ROUTER_NETWORK(
  LOG_FILE_NAME IN VARCHAR2 := 'sdo_router_partition.log',
  NETWORK_NAME IN VARCHAR2 := 'ROUTER_NETWORK');

The CREATE_ROUTER_NETWORK procedure must be run from a routing engine schema that contains routing engine Oracle Data Format (ODF) data.

The LOG_FILE_NAME parameter is the name of the log file written during network creation. This log file is created in the SDO_ROUTER_LOG_DIR directory. You can choose to log network creation in its own log file or write to the default partitioning log file, sdo_router_partition.log.

The NETWORK_NAME parameter names the network being created. The name of the network is at the discretion of the user. Oracle recommends including the country code and data version in the name for clarity. For example, for North American data released in the first quarter of 2012 a suitable network name would be ROUTER_NA_Q112.

Creating a network using a name of an already existing network simply replaces the old network with the new network. This is not recommended. The old network should be deleted first (using the DELETE_ROUTER_NETWORK Procedure), then the new network created.

E.2.2 DELETE_ROUTER_NETWORK Procedure

Syntax:

SDO_ROUTER_PARTITION.DELTE_ROUTER_NETWORK(
  LOG_FILE_NAME IN VARCHAR2 := 'sdo_router_partition.log',
  NETWORK_NAME  IN VARCHAR2 := 'ROUTER_NETWORK',
  LOG_DELETE    IN BOOLEAN DEFAULT TRUE);

The DELETE_ROUTER_NETWORK procedure must be run from a routing engine schema, and a network matching the network name parameter must exist within the schema.

The LOG_FILE_NAME parameter is the name of the log file written during network deletion. This log file is created in the SDO_ROUTER_LOG_DIR directory. You can choose to log network deletion in its own log file or write to the default partitioning log file, sdo_router_partition.log.

The NETWORK_NAME parameter is name of the network being deleted. If a network of this name does not exist, an exception is thrown and an error message is written to the log file.

The LOG_DELETE parameter controls whether the delete operation is logged to the log file. This parameter is used primarily for debugging.

E.2.3 Network Creation Example

This section describes the steps for creating a sample NDM network for routing engine use.

  1. Validate the routing engine log directory in the routing engine schema. SDO_ROUTER_LOG_DIR must exist and have the correct privileges. Log in to the routing engine schema and execute the following statement:

    EXECUTE SDO_ROUTER_PARTITION.VALIDATE_ROUTER_LOG_DIR(
        'validate_log.log');
    

    When validation completes successfully, the validate_log.log file should contain the following messages:

    [INFO] PLSQL logging OK (ROUTER_SCHEMA)
    [INFO] Java logging OK (ROUTER_SCHEMA)
    [INFO] PLSQL logging OK (MDSYS)
    [INFO] Java logging OK (MDSYS)
    
  2. Validate the routing engine log directory in the MDSYS schema. SDO_ROUTER_LOG_DIR must exist and have the correct privileges. Log in to the MDSYS schema and execute the same statement as is step 1.

  3. In the routing engine schema, use the following query to find the name of any existing networks:

    SELECT SUBSTR(view_name, 0, LENGTH(view_name)-7) Network_Name
     FROM user_views 
     WHERE view_name LIKE '%PBLOB$';
    

    If no results are returned, go to step 5. If a result similar to the following is returned, go to the next step to delete the network before creating a new network.

    NETWORK_NAME
    ------------
    <any-network-name>
    
  4. Use the DELETE_NETWORK procedure to delete an existing network. For example, if the existing network is named ROUTER_NA_Q112:

    EXECUTE SDO_ROUTER_PARTITION.DELETE_ROUTER_NETWORK(
        'delete_net.log', 'ROUTER_NA_Q112');
    

    When deletion completes successfully, the delete_net.log file should contain the following message:

    INFO: deleting the Routeserver network: ROUTER_NA_Q112
    
  5. Use the CREATE_ROUTER_NETWORK procedure to build a new network. For example:

    EXECUTE SDO_ROUTER_PARTITION.CREATE_ROUTER_NETWORK(
        'create_net.log', 'ROUTER_NA_112');
    

    When the create operation completes successfully, the create_net.log file should contain the following messages:

    INFO: creating the Routeserver network: ROUTER_NA_Q112
    INFO: rebuild edge table statistics
          creating views
          generating metadata