Wikipedia's B2B Definition:
Business-to-business or “B2B” is a term commonly used to describe the transaction of goods or services between businesses, as opposed to that between businesses and other groups, such as transactions between business and individual consumers (B2C) or business to public administration (B2G) transactions.

It is a term that originated and is almost exclusively used in electronic commerce and usually takes the form of automated processes between trading partners. It is typically performed in much higher volumes than (B2C) applications.

Oracle B2B

Oracle's B2B offering is based on it's Application Server stack. Extensive protocol support (EDI, RosettaNet, UBL, UCCnet, custom) is included. A document editor powered by EDIFECS provides an easy to use tool to define message formats based on built in and custom guidelines. The EDIFECS runtime engine provides validation and translation (to and from XML) of inbound and outbound documents.


In the 10g release the B2B product is not part of the SOA suite. This means that one needs to install it separately. Note that you need the Application server and NOT 10.1.3.


  • Install Oracle database 10g. Note that there may be problems working with XE so use the "regular" database. If you are using 10.2.x then note that you will also need to install the companion cd to install the Ultrasearch schemas. Also, you would need patch 4547817 to upgrade your database to
  • Create the current release of the Oracle Application Server Metadata Repository in Oracle Database 10g.
  • Install the current release of the J2EE and Web Cache installation type of the Oracle Application Server middle tier.
  • Install the current release of OracleAS Integration B2B on the Oracle Application Server middle tier in the same Oracle home as J2EE and Web Cache.

See the detailed installation guide for more details. Installation is something that I am not happy with in this version of the product. Am looking forward to 11g when B2B will come packaged in the SOA fabric.

Identifying Trading Partners (EDI)

In case multiple partners send EDI files to a single location (e.g. FTP directory), then the B2B server can identify the appropriate trading partner using various criteria:

  1. File Naming convention : This approach is a bit rigid as it enforces a specific file naming format to be used. See B2B File transport Tech Note
  2. Based on ISA/GS ID: This approach is far more flexible. I especially like the feature which enables users to identify messages using either one of these identifiers. This can be turned on by setting

in the ip/config/tip.properties file. See this Blog Entry for more.

B2B Reports and Auditing

  • The B2B schema includes a view called "b2b_instancemessage" which provides useful information for auditing and custom reporting.
  • EDI messages (and other B2B messages) are stored as BLOB's. Lets say you want to extract the first 250 chars of the EDI native data for a specific b2b message, then you could use:
select UTL_RAW.CAST_TO_VARCHAR2 (DBMS_LOB.SUBSTR(wirepayload,250, 1))
        from b2b_instancemessage where b2bmessageid = '<b2bMessageID>';

This could be enhanced to a PL/SQL procedure to write out the message to a file.

  • The B2B view includes a system generated message id which can be used to search for specific messages. However, some use cases might have scenarios where messages need to be tracked based on a document reference number like a PO number. In such a case, one can create a custom view with this additional identifier. In the specific case that I worked on, we needed to keep track of the messages via a PO/Invoice number. These numbers are present in the EDI payload field of the view as well as the EDI XML field - both of which are BLOB's. Hopefully in future versions the view will offer XMLType's for easily extracting this information. For now, I created a custom view via:
select (custom_b2breports.GETIDENTIFIER_FROM_DOCTYPE(msgs.B2BMESSAGEID, msgs.PAYLOAD, msgs.DOCUMENTTYPE,msgs.DIRECTION)) msgIdentifier,  .............
               from b2b_instancemessage msgs

The GETIDENTIFIER_FROM_DOCTYPE() function would extract the PO/Invoice number from the XML payload.

  • If you are using AQ as your internal delivery channel then you might need to check which messages have been queued up for a specific consumer. The following query should be useful:
, user_data.action_name
, user_data.msg_id
, user_data.from_party
, user_data.to_party
from aq$ip_qtab
where queue ='IP_IN_QUEUE' and consumer_name = '850_Consumer';

EDI Functional Acknowledgments

x12 uses the 997 format and EDIFACT uses CONTRL messages. So for example if your company sends out an invoice (x12 810) then the remote trading partner would send you a 997 confirmation. To co-relate these messages, you can extract the original b2b message id from:

select B2BMESSAGEID from tip_businessmessage_rt where id = (select REFERTOID from b2b_instancemessage where B2BMESSAGEID = '<997 message id>');

The above query and discussion can be seen at: B2B Forum entry.


Add a New Comment
or Sign in as Wikidot user
(will not be published)
- +
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License