CARIS HPD : Database Administration : Exporting and Importing HPD Schemas (Oracle) : Exporting HPD Schemas : Export using the HPD Data Pump
 

Export using the HPD Data Pump

The HPD Data Pump exports a subset of an HPD schema to an Oracle export file (*.dmp) in the DATA_PUMP_DIR directory. The export can be restored in another database.

hpd_data_pump.ExportPaperProduct exports an HPD paper chart and associated source data.

hpd_data_pump.ExportVectorProduct exports an HPD vector product and associated source data.

hpd_data_pump.ExportByUserGroup exports usages and products that are accessible by a specified user group.553337.1.

hpd_data_pump.ExportSchema has various options for exporting a subset of a schema.

Export Paper Product

Export an HPD paper chart and associated source data.

Parameters

PROCEDURE exportPaperProduct(

p_chartversion_id IN chart_version.chartver_id%type);

Input

Parameter 

Type

Description

p_chartversion_id 

NUMBER

Chart version ID [Mandatory]

Example

exec hpd_data_pump.exportPaperProduct(&&chartver_id);

Export Vector Product

Export an HPD vector product and associated source data.

Parameters

PROCEDURE exportVectorProduct(

v_product_version_id IN productversion.productversion_id%type);

Input

Parameter 

Type

Description

v_product_version_id 

NUMBER

Product version ID [Mandatory]

Example

exec hpd_data_pump.exportVectorProduct(&&product_version_id);

Export by User Group

Export usages and products that are accessible by a specified user group to an Oracle export file (*.dmp).

Parameters

PROCEDURE ExportByUserGroup(

p_dumpfile IN VARCHAR2, p_usergroup in usergroup.name%Type);

Input

Parameter

Type

Description

p_dumpfile

VARCHAR2

Name of the Oracle data pump export file (*.dmp) [Mandatory]

p_usergroup

VARCHAR2

Name of an HPD user group [Mandatory]

Example

The sample procedure below creates an Oracle data pump export file. In this example, a user group called Public has been created. Usages and products accessible by users belonging to this user group are exported to the Oracle data pump export file.

SQL> exec hpd_data_pump.ExportByUserGroup(‘Export-HPDDatabase-Public-20150721.dmp’,’Public’);

Export Schema

Export an HPD schema to an Oracle export file.

Parameters

PROCEDURE exportSchema (

    p_dumpfile IN VARCHAR2,

    p_geometry IN SDO_GEOMETRY,

    p_included_usages IN HPDNUMBER$TABLE_TYPE DEFAULT NULL,

    p_included_objectclasses IN STRING_TABLE DEFAULT NULL,

    p_included_charts IN HPDNUMBER$TABLE_TYPE DEFAULT NULL,

    p_included_vectors IN HPDNUMBER$TABLE_TYPE DEFAULT NULL);

Input

Parameter

Type

Description

p_dumpfile 

VARCHAR2

Name of the Oracle data pump export file (*.dmp) [Mandatory]

p_geometry 

SDO_GEOMETRY

Geographic area to export. [Mandatory]
This is specified in the "HPD source" coordinate reference system, which is WGS84 by default.

p_included_usages 

HPDNUMBER$TABLE_TYPE

Usages to export. If null, all usages are exported.

p_included_objectclasses 

STRING_TABLE

Object classes to be included in the export. If null, all object classes are included in the export.

p_included_charts 

HPDNUMBER$TABLE_TYPE

Paper chart products to export. If null, all charts in the geographic area are exported.

p_included_vectors 

HPDNUMBER$TABLE_TYPE

Vector products to be exported. If null, all vector products in the geographic area are exported.

Example 1

When executed, the sample PL/SQL procedure below creates an Oracle data pump export file.

In this example, features inside the specified export area and not in one of the excluded usages are exported to the Oracle data pump export file with the related products.

DECLARE
    v_geom constant SDO_GEOMETRY :=
        SDO_GEOMETRY(2003, NULL, NULL, SDO_ELEM_INFO_ARRAY (1, 3, 3),
        SDO_ORDINATE_ARRAY (
            -113.78666666666667, 
            48.16666666666667,
            -110.41666666666667,
            62.83333333333333));
    v_date DATE;
    v_included_usages HPDNUMBER$TABLE_TYPE := HPDNUMBER$TABLE_TYPE ();
    v_included_objectclasses CONSTANT string_table := NULL;
    v_included_charts HPDNUMBER$TABLE_TYPE;
    v_included_vectors HPDNUMBER$TABLE_TYPE;

 

    cursor usages_cur is
        SELECT usages_id
        FROM usages
        WHERE name not IN (‘Overview(500000-10000000)’, ‘General(100000-499999)’);
BEGIN

    FOR rec IN usages_cur LOOP
        v_included_usages.EXTEND ();
        v_included_usages (v_included_usages.LAST) := HPDNUMBER$ROW_TYPE (rec.usages_id);
    END LOOP;

 

    HPD_DATA_PUMP.EXPORTSCHEMA (
        ‘HPD_DATA_PUMP’||to_char(sysdate,’hhmiss’),
        v_GEOM,
        v_included_usages,
        v_included_objectclasses,
        v_included_charts,
        v_included_vectors);
END;
/

Example 2: Export two vector products defined by the IDs in products_cur below.

DECLARE

    v_geom sdo_geometry;
    v_included_usages hpdnumber$table_type := hpdnumber$table_type();
    v_included_objectclasses CONSTANT string_table := NULL;
    v_included_charts CONSTANT hpdnumber$table_type := hpdnumber$table_type();
    v_included_vectors hpdnumber$table_type := hpdnumber$table_type();

    cursor products_cur is
    select product_id, productversion_id
    from VECTOR_PRODUCT_VIEW
    where productversion_id in (203870, 277873);

    cursor usages_cur(c_included_vectors IN hpdnumber$table_type) is
    select distinct usage_id
    from vector_product_usage
    where product_id IN (select thenumber from table(c_included_vectors));
begin
    for rec in products_cur loop
        v_included_vectors.extend();
        v_included_vectors(v_included_vectors.last) :=
hpdnumber$row_type(rec.product_id);
    end loop;

    if v_included_vectors.last is null then
        raise_application_error(-20000, 'No products found');
    end if;

    for rec in usages_cur(v_included_vectors) loop
        v_included_usages.extend ();
        v_included_usages (v_included_usages.last) := hpdnumber$row_type(rec.usage_id);
    end loop;

    select SDO_AGGR_MBR(geom) into v_geom
    from enc_source_extraction se
    where se.product_id IN
(select thenumber from table(v_included_vectors));

    HPD_DATA_PUMP.EXPORTSCHEMA (
       ‘HPD_DATA_PUMP’||to_char(sysdate,’hhmiss’),
        v_geom,
        v_included_usages,
        v_included_objectclasses,
        v_included_charts,
        v_included_vectors);
END;
/