Oracle® Fusion Middleware User's Guide for Oracle B2B 11g Release 1 (11.1.1) Part Number E10229-01 |
|
|
View PDF |
This chapter describes how to archive and restore B2B business messages using SQL scripts. These features are in preview mode for this release.
This chapter contains the following topics:
See Chapter 10, "Importing and Exporting Data," for information on importing and exporting design-time data.
Oracle B2B uses Oracle Data Pump, an Oracle Database 11g feature that enables fast bulk data and metadata movement, to archive B2B run-time instance data in Oracle databases.Foot 1
You can specify criteria for archiving (and optionally purging) business messages based on start date, end date, and message state. The targeted business messages are marked with JOB_ID
, a column in the B2B run-time tables that is used to synchronize archive and purge activity. B2B invokes the Data Pump PL/SQL API using JOB_ID
. Hence, when you archive business messages, all the associated tables are also archived. Archived business messages can also be restored by using the Data Pump to import the run-time data into Oracle B2B (Oracle Metadata Service repository) and accessing it through B2B reports.
To archive business messages, set up the archive directory and permissions and then run the archive procedure. The procedure provides an option to purge the archived rows.
To set up the archive directory and permissions:
On the computer running the database, create a directory for the archive file. For example,
mkdir /tmp/archive
Give permissions to this directory so that the database process can write to it. For example,
chmod 777 /tmp/archive
Log in to the database as sysdba
.
sqlplus /as sysdba
Set up B2B_EXPORT_DIR
.
SQL> create or replace B2B_EXPORT_DIR as '/tmp/archive'
Grant the SOA schema user (for example, b2b_soainfra
) permission for the export.
SQL> grant read, write on directory B2B_EXPORT_DIR to b2b_soainfra; SQL> grant exp_full_database to b2b_soainfra;
To archive, with an option to purge:
Set up the archive directory and permissions before using the following PL/SQL API.
Log in as the SOA schema user.
$ sqlplus b2b_soainfra/password
Execute the archive procedure, for example,
SQL> exec b2b_archive_procedure('21-JAN-2008','28-JAN-2008','MSG_COMPLETE','JAN.dmp','N');
The signature of the procedure is
b2b_archive_procedure(fromDate, toDate, messageState, fileName, shouldPurge);
Table 19-1 lists the parameters for the b2b_archive_procedure
API.
Table 19-1 b2b_archive_procedure Parameters
Parameter | Example | Description |
---|---|---|
|
21-JAN-2008 |
Starting date for archival, |
|
28-JAN-2008 |
Ending date for archival, |
|
MSG_COMPLETE |
State of the business message. The |
|
JAN.dmp |
Name of the archive file to be created by the database. Ensure that a file with this name does not exist in the archive directory. |
|
N |
|
To restore business messages, set up the import directory and permissions and then run the restore procedure.
To set up the import directory and permissions:
On the PC running the database, create a directory for the import file.
mkdir /tmp/import
Give permissions to this directory so that the database process can read from it.
chmod 777 /tmp/import
Log in to the database as sysdba
.
sqlplus /as sysdba
Set up B2B_IMPORT_DIR
.
SQL> create or replace B2B_IMPORT_DIR as '/tmp/import'
Grant the SOA schema user (b2b_soainfra
) permission for the export.
SQL> grant read, write on directory B2B_IMPORT_DIR to b2b_soainfra; SQL> grant imp_full_database to b2b_soainfra;
To restore business messages:
Set up the import directory and permissions before using the following PL/SQL API.
Log in as the SOA infra schema user.
$ sqlplus soa_infra_user/password
Execute the import procedure, for example
SQL> exec b2b_restore_procedure('JAN.dmp');
The signature of the procedure is
b2b_restore_procedure(fileName)
Use the Reports tab to search for and display the imported data.
Footnote Legend
Footnote 1: For non-Oracle databases, external database archiving tools can be used to export and import run-time data.