export partition 的par file

Summary

Trying to use Datapump Expdp to export a table partition using an INCLUDE parameter fails with errors like:

Export: Release 11.2.0.3.0 - Production on Tue Feb 16 15:37:32 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

;;;

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

ORA-39071: Value for INCLUDE is badly formed.

ORA-00920: invalid relational operator

The relevant part of the expdp command used to specify the objects to export is like:

...

QUERY = <TABLE 12>":WHERE <Col 1> IN (SELECT <Alias>.<Col 1> FROM <Table 1> PARTITION(<PARTITION NAME>) <Alias>)"

QUERY = <TABLE 13>:"WHERE <Col 1> IN (SELECT <Alias>.<Col 1> FROM <Table 1> PARTITION(<PARTITION NAME>) <Alias>)"

QUERY = <TABLE 14>:"WHERE <Col 1> IN (SELECT <Alias>.<Col 1> FROM <Table 1> PARTITION(<PARTITION NAME>) <Alias>)"

QUERY = <TABLE 15>:"WHERE <Col 1> IN (SELECT <Alias>.<Col 1> FROM <Table 1> PARTITION(<PARTITION NAME>) <Alias>)"

INCLUDE=TABLE:"IN ('<TABLE 2>', '<TABLE 3>', '<TABLE 4>', '<TABLE 5>', '<TABLE 6>', '<TABLE 7>', '<TABLE 8>', '<TABLE 9>', '<TABLE 10>', '<TABLE 11>', '<TABLE 12>', '<TABLE 13>', '<TABLE 14>', '<TABLE 15>')"

INCLUDE=TABLE:<Table 1>:<PARTITION NAME>

Solution

Specifying datapump EXCLUDE or INCLUDE parameters often require some careful preparation and testing.

There isn't any detailed ready queries or syntax while using datapump include and exclude parameters.One will have to go through the reference documents from MOS and prepare the queries as per their requirement.

Please refer to the Oracle 12c Database Utilities Guide, sections:

  • Filtering During Import Operations
  • Filtering During Export Operations

To check for objects that are valid for export and can be specified with INCLUDE or EXCLUDE, you can query the following views:

  • DATABASE_EXPORT_OBJECTS for full mode

  • SCHEMA_EXPORT_OBJECTS for schema mode

  • TABLE_EXPORT_OBJECTS for table and tablespace mode

    The values listed in the OBJECT_PATH column are the valid object types.

For the discussed issue, syntax like below can be used for specifying a table partition with the INCLUDE parameter:

tables= <OWNER>.<Table 1> <<<< Table_name

include=table_data:"IN ('<PARTITION NAME>')" <<<< Partition name

dumpfile=exp_test.dmp

logfile=exp_test.log

directory=exp_dir

Alternatively, you can use a a command like:

expdp '/ as sysdba' schemas=<SCHEMA NAME> parfile=exp_test.par

with a parfile like:

INCLUDE=TABLE:"IN ('<TABLE 2>')"

include=table_data:"IN ('<PARTITION NAME>')" <<<< Partition name

dumpfile=exp_test.dmp

logfile=exp_test.log

directory=exp_dir

Attachments :

Cause

ORA-39071: Value for INCLUDE is badly formed.

ORA-00920: invalid relational operator

The syntax for the INCLUDE parameter to include the table partition as specified below is incorrect:

...

INCLUDE=TABLE:"IN ('<TABLE 2>', '<TABLE 3>', '<TABLE 4>', '<TABLE 5>', '<TABLE 6>', '<TABLE 7>', '<TABLE 8>', '<TABLE 9>', '<TABLE 10>', '<TABLE 11>', '<TABLE 12>', '<TABLE 13>', '<TABLE 14>', '<TABLE 15>')"

INCLUDE=TABLE:<Table 1>:<PARTITION NAME> <<<< Wrong syntax for including partition of a table.

Above error is syntax issue when using datapump EXCLUDE or INCLUDE parameters.


Applies To

All Users

Summary

The Data Pump export using the exclude option for table data in order to export only metadata, does not do this for partitioned tables.

Expdp ignores the request and exports the data as well.

Solution

To exclude partition rows, we need to mention the partition name instead of the table name.

The documentation (for 11gR1) shows:

Table 74-11 DBMS_METADATA: Object Types

Type Name Meaning Attributes Notes


TABLE_DATA metadata describing nested table or partition SND For partitions, the object row data for a table, name,...

For example, the following is seen to work as desired for partitioned table SALES in the SH schema:

  1. Next does not exclude the rows in partitions of SALES table.

!expdp sh/<password> directory=t dumpfile=t.dmp exclude=TABLE_DATA:"IN('SALES')" reuse_dumpfiles=yes

  1. Next successfully excludes the rows in ONLY partition SALES_Q1_1998 of SALES table.

!expdp sh/<password> directory=t dumpfile=t.dmp exclude=TABLE_DATA:"IN('SALES_Q1_1998')" reuse_dumpfiles=yes

  1. Next command successfully excludes the rows in all partitions, starting with SALES_Q% of SALES table.

!expdp sh/<password> directory=t dumpfile=t.dmp exclude=TABLE_DATA:"like'SALES_Q%'" reuse_dumpfiles=yes

Summary

With the classic export client you were able to export with one single export session, tables that were owned by different users.

For example to export the following tables:

  • table EMP owned by user SCOTT

  • table EMPLOYEES owned by user HR

  • table CATEGORIES_TAB owned by user OE

% exp system/<PASSWORD> FILE=<DUMP_NAME>.dmp LOG=<LOG_NAME>.log \
TABLES=scott.emp,hr.employees,oe.categories_tab

Export: Release 11.1.0.6.0 - Production on Wed Nov 28 10:04:10 2007

Copyright (c) 1982, 2007, Oracle. All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export done in WE8ISO8859P15 character set and AL16UTF16 NCHAR character set

About to export specified tables via Conventional Path ...

Current user changed to SCOTT

. . exporting table EMP 14 rows exported

Current user changed to HR

. . exporting table EMPLOYEES 107 rows exported

Current user changed to OE

. . exporting table CATEGORIES_TAB 22 rows exported

. . exporting table PRODUCT_REF_LIST_NESTEDTAB 288 rows exported

. . exporting table SUBCATEGORY_REF_LIST_NESTEDTAB 21 rows exported

Export terminated successfully without warnings.

However, with Export Data Pump you get the following error:

% expdp system/<PASSWORD> DIRECTORY=<DIRECTORY_NAME> \

DUMPFILE=<DUMP_NAME>.dmp LOGFILE=<LOG_NAME>.log \
TABLES=scott.emp,hr.employees,oe.categories_tab

Export: Release 11.1.0.6.0 - Production on Wednesday, 28 November, 2007 10:07:13

Copyright (c) 2003, 2007, Oracle. All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

UDE-00012: table mode exports only allow objects from one schema

This is caused by a restriction for the TABLES parameter of Data Pump:
"The table name that you specify can be preceded by a qualifying schema name. All table names specified must reside in the same schema."

An enhancement request has been filed to make the syntax similar to that of the original export client, <Bug 6860716> - EXPORT&FILTER TABLES FROM MULTIPLE SCHEMAS IN DATA PUMP (which was closed referencing the existing enhancement request <Bug 18110701 > - PROVIDE SUPPORT FOR SCHEMA.OBJECT_NAME IN DATAPUMP METADATA FILTERS).

This is implemented in version 11.2.

How to achieve the same kind of export with Oracle Data Pump ?

Solution

Solution 1: Use combination of SCHEMAS and INCLUDE parameters.

When using Data Pump you can use the combination of the SCHEMAS and INCLUDE parameters.

Example:

File: expdp_tabs.par


DIRECTORY = <DIRECTORY_NAME>
DUMPFILE = expdp_tabs.dmp
LOGFILE = expdp_tabs.log
SCHEMAS = scott,hr,oe
INCLUDE = TABLE:"IN ('EMP', 'EMPLOYEES', 'CATEGORIES_TAB')"

% expdp system/<PASSWORD> PARFILE=<PARFILE_NAME>.par

Export: Release 11.1.0.6.0 - Production on Wednesday, 28 November, 2007 10:25:56

Copyright (c) 2003, 2007, Oracle. All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

FLASHBACK automatically enabled to preserve database integrity.

Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01": system/******** parfile=<PARFILE_NAME>.par

Estimate in progress using BLOCKS method...

Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA

Total estimation using BLOCKS method: 320 KB

Processing object type SCHEMA_EXPORT/TABLE/TABLE

Processing object type SCHEMA_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT

Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX

Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT

Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS

Processing object type SCHEMA_EXPORT/TABLE/COMMENT

Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT

Processing object type SCHEMA_EXPORT/TABLE/TRIGGER

Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS

. . exported "HR"."EMPLOYEES" 16.80 KB 107 rows

. . exported "OE"."CATEGORIES_TAB" 14.15 KB 22 rows

. . exported "OE"."PRODUCT_REF_LIST_NESTEDTAB" 12.51 KB 288 rows

. . exported "OE"."SUBCATEGORY_REF_LIST_NESTEDTAB" 6.593 KB 21 rows

. . exported "SCOTT"."EMP" 8.570 KB 14 rows

Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded

******************************************************************************

Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:

<PATH>\<DUMP_NAME>.DMP

Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed at 10:26:57

Remarks :

  1. Note that all specified tables in the selected schemas are exported, together with their dependent objects. It is not possible to include or exclude tables owned by a specific schema with a full database export Data Pump job, or schema level export Data Pump job with multiple schema's.

  2. Note that if you want to specify these parameters on the command line, you have to use the escape character for special characters:

Example for Windows (place all parameters on a single line):

% expdp system/<PASSWORD> DIRECTORY=<DIRECTORY_NAME> DUMPFILE=<DUMP_NAME>.dmp

LOGFILE=<LOG_NAME>.log SCHEMAS=scott,hr,oe

INCLUDE=TABLE:\"IN ('EMP', 'EMPLOYEES', 'CATEGORIES_TAB')\"

Example for Unix/Linux (escape all special characters):

% expdp system/<PASSWORD> DIRECTORY=<DIRECTORY_NAME> \

DUMPFILE=<DUMP_NAME>.dmp LOGFILE=<LOG_NAME>.log SCHEMAS=scott,hr,oe \

INCLUDE=TABLE:\"IN \(\'EMP\', \'EMPLOYEES\', \'CATEGORIES_TAB\'\)\"

Applies To

All Users

Oracle Communications Order and Service Management - Version 7.0.1 and later

Summary

This document outlines how to export a range of OSM orders from a non partitioned schema and import to a partitioned schema.

Solution

Document ID: KB662917 - Export and import from a large OSM database schema > Document ID: 1613284.1

Export/Import Setup

Check for the OSM export/import utility om_exp_imp_util_pkg package

The OSM export/import utility om_exp_imp_util_pkg package is used to dynamically generate the export files (PARFILEs), and prepare and finalize the target schema.

  1. To check if this package exists, log in to SQL Plus as the OSM core schema user and execute the following SQL command: SQL> select count(*) from user_objects where object_type = 'PACKAGE' and OBJECT_NAME = 'OM_EXP_IMP_UTIL_PKG';

    COUNT(*)


    1

    If the count returned is 1, the om_exp_imp_util_pkg package exists and does not need to be created.

Note: The version of the om_exp_imp_util_pkg created by the OSM installer supersedes the package version attached to KM note 1594152.1. Use the version created by the installer. If it does not exist in your installation, you can download and create it.

Create the OSM export/import utility om_exp_imp_util_pkg package

If your OSM version does not include the om_exp_imp_util_pkg, download and create it as follows

  1. Download the attached file for 7.0 releases om_exp_imp_util_pkg.sql (7.0.x) or for 7.2 releases om_exp_imp_util_pkg.sql (7.2.x).

  2. To check your OSM version, log in to SQL Plus as the OSM core schema user and execute the following SQL command: SQL> select value from om_parameter where mnemonic = 'oms_db_version';

    VALUE


    7.2.4.0.21

  3. Navigate to the directory where the file was downloaded. cd <directory containing script>

  4. Log in to SQL Plus as the OSM core schema user and execute the om_exp_imp_util_pkg.sql SQL script to create the om_exp_imp_util_pkg package. SQL> @om_exp_imp_util_pkg.sql

  5. The om_exp_imp_util_pkg.sql SQL script completes successfully if the following messages appear: Package created.

    Package body created.

    If there are errors the following message appears:

    Warning: Package created with compilation errors.

    To get more information about the errors, execute the following:

    SQL> show errors

Take OSM offline

If the orders that you want to export are open, take the server offline before you export. To do this, stop all the processes running against OSM and shut down the OSM WebLogic instance.

  1. To check if the orders that you want to export are open, log in to SQL Plus as the OSM core schema user and execute the following SQL commands: SQL> set serveroutput on

    SQL> exec om_exp_imp_util_pkg.print_open_order_count;

    If the order range specified does not contain open orders and the server does not need to be taken offline, the following message appears:

    There are no open orders

    If the order range specified does contain open orders and the server should be taken offline, the following message appears:

    The open order count is: <number of open orders>

  2. This is verify OM_T_ORCH_PROCESS type in both OSM schemas are same, so partitioned OSM schema should have been created In none-partitioned OSM schema, do

    SQL> desc OM_T_ORCH_PROCESS

    And in partitioned OSM schema, do the same

    SQL> desc OM_T_ORCH_PROCESS

    Compare M_COORD_SET_ID in both output, if you see none-partitioned schema output is "M_COORD_SET_ID NUMBER(9)" and partitioned OSM schema output is "M_COORD_SET_ID NUMBER(18)", then do the following in none-partitioned OSM schema

    alter type OM_T_ORCH_PROCESS modify attribute (m_coord_set_id number(18)) cascade;

Export the OSM order data

The order data to be exported is selected from the order tables by querying the order ID. Most tables store the order ID in the order_seq_id column. There are a few exceptions, which must be exported and imported separately.

Part one: Export order tables that define an order_seq_id
  1. Generate a PARFILE with options for exporting the OSM orders by logging into SQL Plus as the OSM core schema user and executing the om_exp_imp_util_pkg.generate_expdp_order_parfile procedure.

    Use the following commands to generate the option file.

    1. Log in to SQL Plus as the OSM core schema user.

    2. Set the server output to on to allow the output to be generated.

      SQL> set serveroutput on

    3. Set trimspool to on . This prevents extra white space in the generated PARFILE, which causes the export to fail with this error: UDE-00014: invalid value for parameter, 'include'.

      SQL> set trimspool on

    4. Set spool to on to capture the generated output from SQL Plus.

      SQL> spool osm_expdp_orders_parfile.txt

    5. Execute the om_exp_imp_util_pkg.generate_expdp_order_parfile procedure. SQL> exec om_exp_imp_util_pkg.generate_expdp_order_parfile;

      DIRECTORY=DATA_PUMP_DIR

      DUMPFILE=osm_expdp_orders%U.dmp

      FILESIZE=1GB

      LOGFILE=osm_expdp_orders.log

      CONTENT=DATA_ONLY

      PARALLEL=1

      QUERY=" where order_seq_id > 0"

      TABLES=(

      OM_ATTACHMENT,

      OM_HIST$DATA_CHANGE_NOTIF,

      OM_HIST$FALLOUT,

      OM_HIST$FALLOUT_NODE_INSTANCE,

      OM_HIST$FLOW,

      OM_HIST$NOTIFICATION,

      OM_HIST$ORDER_HEADER,

      OM_HIST$ORDER_INSTANCE,

      OM_HIST$ORDER_STATE

      ...

      OM_JMS_THREAD,

      OM_SYSTEM_EVENT

      )

      PL/SQL procedure successfully completed.

    6. Set spool to off to stop capturing the generated output from SQL Plus.

      SQL> spool off

  2. (Optional) Modify PARFILE options as needed in osm_expdp_orders_parfile.txt. Do not modify the CONTENT and TABLES options.

    Notes about modifying the PARFILE:

    1. From OSM version 7.2 and onwards, the order in which the tables are exported (and generated in the PARFILE) is important due to reference partitioning. As a result, the TABLES option should not be modified.

    2. For exports or imports performed in a RAC environment using Automatic Storage Management, update the DIRECTORY option to point to the shared location. See the Data Pump Oracle RAC considerations documentation for more information.

  3. Workaround for bug 18155781:
    Modify the CONTENT option in osm_expdp_orders_parfile.txt to be: CONTENT=ALL
    Modifying this option is not typically recommended. However it is required in this case to workaround bug 18155781 .

  4. To export the order tables, execute the following command: expdp <SourceOSMCoreSchemaUserName> PARFILE=osm_expdp_orders_parfile.txt

Part two: Export order tables that use a different name for the order ID column
  1. Generate a PARFILE with options for exporting the additional OSM order tables by logging into SQL Plus as the OSM core schema user and executing the om_exp_imp_util_pkg.generate_expdp_order_parfile2 procedure.

    Use the following commands to generate the option file.

    1. Log in to SQL Plus as the OSM core schema user.

    2. Set the server output to on to allow the output to be generated.

      SQL> set serveroutput on

    3. Set trimspool to on . This prevents extra white space in the generated PARFILE, which causes the export to fail with this error: UDE-00014: invalid value for parameter, 'include'.

      SQL> set trimspool on

    4. Set spool to on to capture the generated output from SQL Plus.

      SQL> spool osm_expdp_orders_parfile2.txt

    5. Execute the om_exp_imp_util_pkg.generate_expdp_order_parfile procedure. SQL> exec om_exp_imp_util_pkg.generate_expdp_order_parfile2;

      DIRECTORY=DATA_PUMP_DIR

      DUMPFILE=osm_expdp_orders2%U.dmp

      FILESIZE=1GB

      LOGFILE=osm_expdp_orders2.log

      CONTENT=DATA_ONLY

      PARALLEL=1

      INCLUDE=TABLE:"IN ('OM_HIST$COMPENSATION_PLAN', 'OM_ORCH_COMPLETION_DEPENDENCY',

      'OM_ORDER_COMPENSATION_PLAN', 'OM_ORDER_FLOW_COORDINATOR')"

      QUERY=OM_HIST$COMPENSATION_PLAN:" where order_target_seq_id > 0"

      QUERY=OM_ORCH_COMPLETION_DEPENDENCY:" where successor_order_seq_id > 0"

      QUERY=OM_ORDER_COMPENSATION_PLAN:" where order_target_seq_id > 0"

      QUERY=OM_ORDER_FLOW_COORDINATOR:" where coord_set_id in (select coord_set_id

      from om_coord_node_instance where order_seq_id > 0)"

      PL/SQL procedure successfully completed.

    6. Set spool to off to stop capturing the generated output from SQL Plus.

      SQL> spool off

  2. (Optional) Modify PARFILE options as needed in osm_expdp_orders_parfile2.txt. Do not modify the CONTENT and INCLUDE options.

    Note about modifying the PARFILE: For exports or imports performed in a RAC environment using Automatic Storage Management, update the DIRECTORY option to point to the shared location. See the Data Pump Oracle RAC considerations documentation for more information.

  3. Workaround for bug 18155781:
    Modify the CONTENT option in osm_expdp_orders_parfile2.txt to be: CONTENT=ALL
    Modifying this option is not typically recommended. However it is required in this case to workaround bug 18155781 .

  4. To export the additional order tables, execute the following command: expdp <SourceOSMCoreSchemaUserName> PARFILE=osm_expdp_orders_parfile2.txt

Export the OSM model data

Note: Model tables that are system managed, or contain system managed parameters, are excluded from the export (e.g. om_part_table, om_part_index, om_order_id_block and om_parameter).

  1. Generate a PARFILE with options for exporting the OSM model by logging into SQL Plus as the OSM core schema user and executing the SQL stored procedure om_exp_imp_util_pkg.generate_expdp_model_parfile.

    1. Log in to SQL Plus as the OSM core schema user.

    2. Set the server output to on to allow the output to be generated.

      SQL> set serveroutput on

    3. Set trimspool to on . This prevents extra white space in the generated PARFILE, which causes the export to fail with this error: UDE-00014: invalid value for parameter, 'include'.

      SQL> set trimspool on

    4. Set spool to on to capture the generated output from SQL Plus.

      SQL> spool osm_expdp_model_parfile.txt

    5. Execute the om_exp_imp_util_pkg.generate_expdp_model_parfile procedure. SQL> exec om_exp_imp_util_pkg.generate_expdp_model_parfile;

      DIRECTORY=DATA_PUMP_DIR

      DUMPFILE=osm_expdp_model%U.dmp

      FILESIZE=1GB

      LOGFILE=osm_expdp_model.log

      CONTENT=DATA_ONLY

      PARALLEL=1

      INCLUDE=TABLE:"IN (

      'OM_APPLICATION_FUNCTION',

      'OM_APP_FUNC_WORKGROUP',

      'OM_ATTRIBUTE_CODE_LOOKUP',

      'OM_ATTRIBUTE_TYPE',

      'OM_AUTOMATION_CORRELATION',

      ...

      'OM_WORKGROUP_ORDER_VIEW',

      'OM_WORKGROUP_SET',

      'OM_XCHG_TABLE',

      'OM_XML_SCHEMA'

      )"

      PL/SQL procedure successfully completed.

    6. Set spool to off to stop capturing the generated output from SQL Plus.

      SQL> spool off

  2. (Optional) Modify PARFILE options as needed in osm_expdp_model_parfile.txt. Do not modify the CONTENT and INCLUDE options.

    Note about modifying the PARFILE: For exports or imports performed in a RAC environment using Automatic Storage Management, update the DIRECTORY option to point to the shared location. See the Data Pump Oracle RAC considerations documentation for more information.

  3. Workaround for bug 18155781:
    Modify the CONTENT option in osm_expdp_model_parfile.txt to be: CONTENT=ALL
    Modifying this option is not typically recommended. However it is required in this case to workaround bug 18155781 .

  4. Execute the following command to export the model tables. expdp <SourceOSMCoreSchemaUserName> PARFILE=osm_expdp_model_parfile.txt

Print out the schema information

Generate a text file containing information about the schema being exported by logging into SQL Plus as the OSM core schema user and executing the om_exp_imp_util_pkg.print_schema_info procedure. This text file should be kept with the OSM dmp files because it contains information that will be used when importing the dmp files.

  1. Log in to SQL Plus as the OSM core schema user.

  2. Set the server output to on to allow the output to be generated.

    SQL> set serveroutput on

  3. Set spool to on to capture the generated output from SQL Plus.

    SQL> spool osm_expdp_schema_info.txt

  4. Execute the om_exp_imp_util_pkg.print_schema_info procedure. SQL> exec om_exp_imp_util_pkg.print_schema_info;

  5. Set spool to off to stop capturing the generated output from SQL Plus.

    SQL> spool off

Prepare the target OSM schema before import

Note: When importing, if the source and target schema and tablespace are the same, the REMAP_SCHEMA and REMAP_TABLESPACE options are redundant and do not need to be specified.

Create the target OSM schema

If the target schema does not already exist, run the OSM installer (of the same OSM version as the source schema) to create it.

Add partitions

As the target schema for this scenario is partitioned, you must ensure that the order IDs that you want to import map to existing partitions. If any order ID is greater than or equal to the greatest partition upper bound, add one or more partitions as needed.

Partitions can be added by doing the following

  1. Log in to SQL Plus as the OSM core schema user and execute the following SQL (replace 3 with the number of partitions that you want to add): SQL> exec om_part_maintain.add_partitions(3);

  2. Query the user_tab_partitions table to view the newly added partitions. SQL> select * from user_tab_partitions where table_name = 'OM_ORDER_HEADER' ;

For more information about adding partitions, see Document ID: KB218565 - OSM 7 Database Management.

Note: If you are not on the latest version of your OSM release, the add_partitions procedure may not be declared. In this case, see OSM System Administrator's Guide for information about how to add partitions.

Disable constraints, triggers, and stop jobs, purge orders/models before import

From SQL Plus execute the om_exp_imp_util_pkg.pre_impdp_setup procedure to disable constraints, triggers, and stop jobs. This ensures that there are no errors when importing the OSM data.

SQL> exec om_exp_imp_util_pkg.pre_impdp_setup;

SQL> exec om_exp_imp_util_pkg.PURGE_ORDERS;

SQL> exec om_exp_imp_util_pkg.PURGE_MODEL;

Import the OSM model data

Execute the following command to import the model tables:

impdp <TargetOSMCoreSchemaUserName> DIRECTORY=DATA_PUMP_DIR DUMPFILE=osm_expdp_model%U.dmp LOGFILE=osm_impdp_model.log REMAP_SCHEMA=<SourceOSMCoreSchemaUserName>:<TargetOSMCoreSchemaUserName> REMAP_TABLESPACE=<SourceOSMTablespace>:<TargetOSMTablespace> TABLE_EXISTS_ACTION=APPEND

Workaround for bug 18155781:

The TABLE_EXISTS_ACTION=APPEND option was added to the import command.

This will result in the following message during import for each of the model tables and can be ignored:

Table "<TargetOSMCoreSchemaUserName>"."<TableName>" exists. Data will be appended to existing table but all dependent metadata will be skipped due to table_exists_action of append

Import the OSM order data

Note: As with the export, importing the order data is done in two steps.

Part one: Import order tables that use a different name for the order ID column

Execute the following command to import the order tables that do not define an order_seq_id:

impdp <TargetOSMCoreSchemaUserName> DIRECTORY=DATA_PUMP_DIR DUMPFILE=osm_expdp_orders2%U.dmp LOGFILE=osm_impdp_orders2.log REMAP_SCHEMA=<SourceOSMCoreSchemaUserName>:<TargetOSMCoreSchemaUserName> REMAP_TABLESPACE=<SourceOSMTablespace>:<TargetOSMTablespace> TABLE_EXISTS_ACTION=APPEND

Workaround for bug 18155781:

The TABLE_EXISTS_ACTION=APPEND option was added to the import command.

This will result in the following message during import for each of the order tables that do not define an order_seq_id and can be ignored:

Table "<TargetOSMCoreSchemaUserName>"."<TableName>" exists. Data will be appended to existing table but all dependent metadata will be skipped due to table_exists_action of append

Part two: Import order tables that define an order_seq_id

Execute the following command to import the order tables that define an order_seq_id:

impdp <TargetOSMCoreSchemaUserName> DIRECTORY=DATA_PUMP_DIR DUMPFILE=osm_expdp_orders%U.dmp LOGFILE=osm_impdp_orders.log REMAP_SCHEMA=<SourceOSMCoreSchemaUserName>:<TargetOSMCoreSchemaUserName> REMAP_TABLESPACE=<SourceOSMTablespace>:<TargetOSMTablespace> TRANSFORM=oid:n TABLE_EXISTS_ACTION=APPEND

Workaround for bug 18155781:

The TABLE_EXISTS_ACTION=APPEND option was added to the import command.

This will result in the following message during import for each of the order tables that define an order_seq_id and can be ignored:

Table "<TargetOSMCoreSchemaUserName>"."<TableName>" exists. Data will be appended to existing table but all dependent metadata will be skipped due to table_exists_action of append

Finalize the target OSM schema after import

From SQL Plus, log in as the target OSM core schema user and execute the om_exp_imp_util_pkg.post_impdp_setup procedure. This enables the constraints and triggers, and resubmits the jobs that were disabled and stopped before importing the OSM data.

SQL> exec om_exp_imp_util_pkg.post_impdp_setup;

References

MOS document id: 1613284.1

Product Versions

product: Oracle Communications Order and Service Management - min_version: 7.0.1 - max_version: none; Information in this article applies to GENERIC (All Platforms)

相关推荐
空中海5 小时前
Redis知识图谱和回顾
数据库·redis·知识图谱
不甘先生5 小时前
PostgreSQL 数据库基础一览表
数据库·postgresql
DBdoctor官方5 小时前
2026 DBA实测推荐:5款数据库管理工具 监控、SQL审核、AI能力横评
数据库·sql·dba
qq_196976175 小时前
硬核项目管理:Gemini境像站驱动的WBS自动分解、关键路径识别与风险登记册生成(国内免费镜像实测)
数据库
迷枫7125 小时前
DM8 读写分离集群学习总结:从部署规划到扩容排查
数据库·学习
yuzhiboyouye5 小时前
聚合与分组统计 (GROUP BY)常用于web前端什么场景中
数据库
AllData公司负责人5 小时前
亲测丝滑,体验跃迁|AllData通过集成开源项目StreamPark,实时流任务调度更省心!
java·大数据·数据库·人工智能·算法·实时计算·实时开发平台
可涵不会debug6 小时前
工业大数据时序数据库选型方法论:核心指标与技术适配分析
大数据·数据库·时序数据库
DolphinDB智臾科技6 小时前
时序数据库国产替代的下一站:从能用到好用,再到敢用作核心
数据库·人工智能·时序数据库