A database link is a path through which a remote user in another database can connect to any other database. Once created the database link exists as an object in the user schema.

Type of DB Links
There are 3 types of DB links. They are as follows:

1. PRIVATE: When the DB links is created, it is created under Private mode as default. The Private DBLINK is only available to the user who has created it. It is not possible for a user to grant access on a private DBLINK to other users.

2. PUBLIC: The Public DBLINK is available to all the users and all users can have the access without any restrictions.

3. SHARED: Shared database link uses share the server connection to support database link connection. If there are multiple concurrent database link access into a remote database, shared database link can be used to reduce the number of server connections required. Without the shared clause each database link connection requires a separate connection to the remote database.

Types of Logins:
In dblink we can use 2 types of login. They are as follows:

1. DEFAULT LOGIN: The User name and Password is same in both the databases.
Syntax
======
CREATE [PUBLIC] DATABASE LINK CONNECT TO CURRENT_USER USING
Code: (Text)
Create public database link daslink connect to current_user using ‘ORCL’


2. EXPLICIT LOGIN: The User Name and Password is different in both the databases.
Syntax
======
CREATE [PUBLIC|SHARED] DATABASE LINK CONNECT TOIDENTIFIED BY USING
Code: (text)
CREATE PUBLIC DATABASE LINK DDLNK CONNECT TO SCOTT IDENTIFIED BY TIGER USING ‘ORCL’

Note: To create the public DBLINK the user must have create public database link system privileges.

Oracle inventory main reporting tables.
——————————————————————————–

MTL_MATERIAL_TRANSACTIONS
Base table for all transactions (etc RCV,Issuance,Sub Inv Transfer,Inter Org Transfer,Misl Transactions…).

MTL_SYSTEM_ITEMS
Table contains all System items organization wise. It is Base table for items.
This table holds the definitions for inventory items, engineering items, and purchasing items. The flexfield code is MSTK. The primary key for an item is the INVENTORY_ITEM_ID and the ORGANIZATION_ID. The same item could be defined in more than one organization. Each row represents an item in an organization.

MTL_SYSTEM_ITEMS_TL
Table contains translated description of each master item.
The primary key is INVENTORY_ITEM_ID, ORGANIZATION_ID and LANGUAGE.

MTL_TRANSACTION_TYPES
Transaction types and names.

ORG_ACCT_PERIODS
Organization wise accounting periods.

GL_CODE_COMBINATIONS
Stores valid Accounting Flexfield segment value combinations for each accounting flexfield structure within your General Ledger. Primary key: CODE_COMBINATION_ID.

MTL_SECONDARY_INVENTORIES
This table is the definition table for the subinventory. Subinventories are assigned to items, indicating a list of valid places in which this item may be located. The primary key is SECONDARY_INVENTORY_NAME, ORGANIZATION_ID.

 MTL_ITEM_CATEGORIES
This table stores the item assignments to categories within a category set. For each assignment, this table stores the item, category set, and the category. Items can be assigned to multiple categories and category sets, but can be assigned to only one category in a given category set. This table is populated through either the Define Item or the Update Item/Org Attributes forms. It can also be populated by performing item assignments when a category set is defined. The primary key is INVENTORY_ITEM_ID, ORGANIZATION_ID, CATEGORY_SET_ID.
 
Oracle Purchasing main reporting tables.
——————————————————————————–
RCV_TRANSACTIONS
You can get data of all receiving transactions in this table.
Important columns
TRANSACTION_TYPE like  DELIVER,REJECT,ACCEPT,CORRECT,RETURN TO RECEIVING
TRANSFER, RETURN TO VENDOR, RECEIVE.
Also you can directly connect to shipment and purchase order tables for rcv_transactions
By  SHIPMENT_HEADER_ID and PO_HEADER_ID.
PO_HEADERS_ALL
Get purchase order header level information from this table.
Important Columns
TYPE_LOOKUP_CODE indicates purchase order type like RFQ, STANDARD.
PO_LINES_ALL
Get purchase order live level information from this table.
Important columns
ITEM_ID join with table MTL_SYSTEM_ITEMS column ITEM_ID to get item all information.
PO_VENDORS
Get vendor level information from this table.
Important columns
PO_VENDOR_SITES_ALL
Get vendor sites information from this table in detail.

 

After defining System item flexfield next step to do is to define Item categories flexfield .
1. Go to Inventory responsibility and open Key Fleffield 
    Flexfield -> Key -> Segments

Key Flex Field

In flexfield title search for Item Categories.

Item Categories

2. Enter new record in this case ORK Item Categories. Now click on segments to enter segments summary.

3. You can define any number of segments according to your business requirement  here is this example we   will define three segments.

4. Enter first segment as Super Category. assign column and value set to this segment.
5. Repeatedly do above step for both next segments.Column indicates the database fields that will hold entered value for specific segment. Now enter your desired item segments name and their corresponding value sets.
6. Now freeze flexfield and compile it.
Optional step before defining inventory organization
Define Location.
1. Now In Inventory responsibility navigate to
    Setup -> Organizations -> Organizations

Enter organization name and type from pre defined list.
In this case this organization is defined as Master Org.
2. To define a location navigate to
     Setup -> Organizations -> locations


There are two options for scope Global and Local
Global: If global selected then this location will be available for all modules.
After entering name and description move to address details tab.


3. Choose your address style as address styles are defined according to your country.
    Enter remaining details and save you work. 

4. Now select location ORK Locations in organization definition form.

    Save your work as it is required before proceeding to next step.
    In classification tab select inventory organization from list of values and check it.

5. Now click on others to add additional organizational information.
1.EGO_ITEM_PUB.Assign_Item_To_Org

This API provide functionality to assign one/more items to an organization(s)
How to Assign Item Using Assign_item_to_org 


2. Item Creation and Updation Public API.
This API used to create items.
EGO_ITEM_PUB.Process_item(s)

 3. Category Code Creation Public API.
This API provides functionality to create a category.
INV_ITEM_CATEGORY_PUB.Create_Category

4. Item Category Assignment Public API
EGO_ITEM_PUB.Process_Item_Cat_Assignment

5. Item Catalog Descriptive Element Public API.

EGO_ITEM_PUB.Process_item_descr_elements

6. Item Revision Creation and Updation Public API.

EGO_ITEM_PUB.Process_Item_Revision
7. Implement Item Pending Changes Public API.

This API provides functionality to implement pending changes (phase and/or status) for an item/item revision.

EGO_ITEM_PUB.Implement_Item_Pending_Changes
8. Item Lifecycle Public API.

EGO_ITEM_PUB.Process_item_phase_and_status
9. Item Grant public API

EGO_ITEM_PUB.Process_item_role
10. Item User-Defined Attributes Data Public API.

EGO_ITEM_PUB.Process_User_Attrs_For_Item
11. Item Assignment to an Organization Public API.