所以后来,Oracle引入了一个新的schema--"APPS",其他schema下的数据,在apps下都能看到,这样我们就不用每次都要加前缀才能查看其他模块的数据了,用户可以轻松的访问任何模块的表数据。同样,如果想要增加一个新的表到系统中,我们需要做以下几件事情: Step 1. Connect to po/po@XX_DEVDB
Create table PO_HEADERS_ALL ( ...all columns here )
Step2. Grant all on po_headers_all to apps ;
Step 3. connect to apps/apps@XX_DEVDB
Create or replace synonym PO_HEADERS_ALL for PO.PO_HEADERS_ALL
通过以上的几步,你就会发现,APPS schema不用加前缀(po.po_headers_all)就可以访问PO_HEADERS_ALL了。
现在在Oracle ERP里,我们已经有超过100个schema了,比如:po, ar, ap, gl...,Form,Report,workflow里我们只需要连接到apps schema下即可所有模块的数据,ALL ROADS LEAD TO ROME,这里ALL Schema Lead to APPS.因此假设你想关联ap_invoices_all table( AP schema) 和PO_HEADERS_ALL table( AP schema),你只需要简单的连上APPS,然后写:
Selelct 'x’ from po_headers_all p, ap_invoices_all a where a.po_Id = p.po_Id
在10.6版本前你不得不这么写: Selelct 'x’ from PO.po_headers_all p, AP.ap_invoices_all a where a.po_Id = p.po_Id
Moral of the Story is:
所有的PL/SQL Package要在APPS Schema下创建