How to implement multi-companies schemas?
I need to implement a multi-companies data base. There will be only one server and all the clients of the differents companies will have access to this server.
How can I do this?
- Tables with a company column
- A schema per company
Any suggestion?
Regards
In my mind, the simplest possible thing that could work would be a single schema where most if not all tables had a COMPANY_ID column, a context that gets populated with the COMPANY_ID, and a view layer that reads the data from the context to limit the set of rows that the current session can access. That way there is only one view that provides company-specific data regardless of the company rather than one view per company. This would be relatively similar to the VPD solution replacing policies on tables with views.
You can create a context
CREATE OR REPLACE CONTEXT your_context_name USING your_authorization_pkg;where YOUR_AUTHORIZATION_PKG is a package that determines which COMPANY_ID a particular session will have access to. That's one of the more vulnerable pieces of the infrastructure here, so you'll want to make sure that it is well secured. Within YOUR_AUTHORIZATION_PKG, you would set the value of the context
DBMS_SESSION.SET_CONTEXT( 'YOUR_CONTEXT_NAME', 'COMPANY_ID', <<computed company id>> )where <<computed company id>> is the company ID that your package has determined the user has access to. Your view layer can then reference the value in the context
CREATE OR REPLACE VIEW vw_employee
AS
SELECT *
FROM employee
WHERE company_id = SYS_CONTEXT( 'YOUR_CONTEXT_NAME', 'COMPANY_ID' );This isn't as easy or as secure as VPD, but it's often close enough.
Justin
Similar Messages
-
How to implement multi-source XSLT mapping in 11g PS3 BPEL ?
Hi
How to implement multi-source (single destination) XSLT mapping in 11g PS3 BPEL ? Is there any good example step by step ?
thx
dHi d,
Also there's a sample available at samplecode.oracle.com mapper-105-multiple-sources.zip.
Regards,
Neeraj Sehgal -
How should implement multi-thread in single-threaded Operating system using
How should implement multi-thread in single-threaded Operating system using java?
Java supports "Multi-threading".Is there is any way run the multiple threads (Implementing multi threading) using java in a Single-threaded Operating system (That is the operating system does not support for multi-threading).Previous questions from OP suggest they are using J2ME, so the question might be possible.
806437 wrote:
How should implement multi-thread in single-threaded Operating system using java?
What is the actual question/problem?
A java app doesn't do threads or not do threads. It uses classes. The VM does threads.
So if you have a platform that does not have threads and you want to support the thread class then the VM, not a java app, must provide some pseudo mechanism, such as green threads, to support that.
If your question is about java code and not the VM then you must build a task engine and insure that the tasks are of short enough duration that it is an effective use for your system. -
How to implement multi threading in pl/sql
Hi,
I have to run a pl/sql procedure which calls multiple instances of another procedure of some other package.
How should I proceed to do it?
Bhaskar.Actually the final table that need to be updated has
millions of records.
Hence I am thinking of multithreading.1) Why are you updating millions of records? Frequently, it is more efficient to do a direct path insert of the final data from a staging table into the final table rather than trying to update millions of rows in place.
2) Are you using parallel DML? SQL already provides the ability to enable parallelism if that is going to improve the performance of your queries. There is, in general, no need to re-implement that in PL/SQL.
And all the information are communicated within the
same session.I'm not sure I understand what you're saying here...
Justin -
EJB3 Stateful Sessionbean how to implement multi business interfaces?
Hi All,
I met up some issue, can't make the session bean implement 2 business interfaces? Please kindly throw me some light! thanks
Business sessionbean
@Stateful
@ConversationScoped
@Named
@Local( { IWizard.class, IRegisterWizard.class })
public class RegisterWizard extends WizardBean {
@Local
public interface IWizard extends Serializable {
public String back();
public boolean hasBack();
public boolean hasNext();
public String next();
public String abort();
@Local
public interface IRegisterWizard{
public String submit();
}error message of glassfish3 below:
Caused by: java.lang.IllegalArgumentException: Not enough type information to resolve ejb for ejb name class wizard.RegisterWizard
at org.glassfish.weld.services.EjbServicesImpl.resolveEjb(EjbServicesImpl.java:121)
at org.jboss.weld.bean.SessionBean.createReference(SessionBean.java:422)
at org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.<init>(EnterpriseBeanProxyMethodHandler.java:76)
at org.jboss.weld.bean.SessionBean.create(SessionBean.java:298)
... 53 moreThere does appear to be a bug in the handling of the bean with multiple business interfaces. I filed an issue for it :
https://glassfish.dev.java.net/issues/show_bug.cgi?id=11826. The inheritance is a separate issue. Are you getting the same error or a different one after applying @LocalBean. -
How to implement multi threading without using Java's synchronization
I have a shared Object called "tradeObj" whose attributes are "Price" and "Quantity".
Thread1 is going to change the price and Thread2 is going to change the quantity but not stepping on each other's update.
Because of the cost of synchronization, I dont want to use "Synchronize", but still want to make sure both threads make their update in a proper manner.
Any ideas?Soph wrote:
I have a shared Object called "tradeObj" whose attributes are "Price" and "Quantity".
Thread1 is going to change the price and Thread2 is going to change the quantity but not stepping on each other's update.given above I would guess [your interviewer|http://forums.sun.com/thread.jspa?messageID=10976469#10976469|interview] had in mind reducing locks contention (google for "java concurrency locks granularity" or "java concurrency locks contention" if you're interested)
// disclaimer: I didn't test this code with compiler
class TradeObj {
private int price, quantity;
// locks
private final Object priceLock = new Object();
private final Object quantityLock = new Object();
public int getPrice() {
synchronized (priceLock) { return price; }
public void setPrice(int price) {
synchronized (priceLock) { this.price = price; }
public int getQuantity() {
synchronized (quantityLock) { return quantity; }
public void setQuantity(int quantity) {
synchronized (quantityLock) { this.quantity = quantity; }
Because of the cost of synchronization, I dont want to use "Synchronize", but still want to make sure both threads make their update in a proper manner.what you want above doesn't make much sense to me sorry
Any ideas?Edited by: gnat on Apr 23, 2010 9:44 AM -
How to design a database for multi Companies
I like to hear your comments if you have a database that serves multi companies or if you have good knowledge about this subject.
Our data is sensitive and I was thinking on creating a schema for each company but seems that's a lots of work specially when the schema will change.
Do you keep your multi companies data in one schema, if so, what kind of care we need to take to avoid any mishap??
Thanks
Mouser4018813 wrote:
I'm just getting started attempting to implement Label Security to move our product from a single to a multi-tenant (i.e. customer) architecture. What is the best way to debug Label Security problems? I've tried trace levels 10730 and 10060 using commands like this:
ALTER SESSION SET EVENTS '10730 trace name context forever';
but didn't get a trace file.
I did get a trace file for a 10046 trace. Here's a SQL statement that resulted from that trace:
SELECT "C1","MI_ROWLABEL_3" FROM "MT_DB1"."T3" "T3" WHERE (1=2 )
I didn't specify that 1=2 predicate, so where is that coming from?
Any help would be greatly appreciated.try instead
Event 10730 - Trace Fine Grained Access Predicates
This event traces find grained access (RLS) predicates
ALTER SESSION SET EVENTS
'10730 trace name context forever, level 1'; -
How to implement the schema validation with XSD in adapter module
Dear All,
I am trying to develop a EJB as the file adapter mudule.
Please guide me how to implement the schema validation of the source message with XSD.
Or provide me the relative resources about this task.
Thanks & Regards,
Red
Edited by: Grace Chien on Nov 19, 2008 8:23 AMHi Grace,
You can do the xml scema validation in PI7.1 version directly.
To develop the adapter module for xml schema validation
Validating messages in XI using XML Schema
Schema Validation of Incoming Message
Regards
Goli Sridhar -
How can I implement Multi Factor authentication with IAM products?
Hi I would like to implement multi factor authentication that can be made generic with all IAM produts. Can anyone suggest an MFA factor like that? It shudnt be an add on or plug in. Instead it should be an in built feature. Can anyone suggest any idea?
Opensso has such feature built-in. You can create an authentication chain in which you can add as many authentication mechanisms as you need.
Although it is a built-in feature, there's no full support for all sorts of authentication methods. Some of them exist as plugins, like authentication modules for smart cards and biometrics because they are not sold by Sun Microsystems. However, there's a solution for you requrement even tough you might add some auth modules as plugins like biobex, activcard or auth modules from other vendors.
Regards. -
How to Implement HTTP Request Status Code Processing
I actually have two questions. First, I wondering how to add multiple status code processing to an http request. Secondly, I was wondering how to go about using alternate http requests to different servers in case the primary server is down. What kind of parameter would the program use to determine that the server is unavailable and switch to another server??
Currently, the program I've written calls an rdf server (http://www.rdfabout.com/sparql) using a sparql query,
the server returns an xml string, the program parses it, and calculates numbers
from the string. The program works, but the problem is that the server is down occasionally.
When the server is down, we need to add calls to another server to
increase reliability. So, the next task is to call this server:
http://www.melissadata.com/lookups/ZipDemo2000.asp
I need to do exactly the same things I did with the rdf server. The
difference will be constructing a request and a bit different parsing of
the response.
current SPARQL query is defined as follows:
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX census: <http://www.rdfabout.com/rdf/schema/census/>
PREFIX census1: <tag:govshare.info,2005:rdf/census/details/100pct/>
DESCRIBE ?table WHERE {
<http://www.rdfabout.com/rdf/usgov/geo/census/zcta/90292> census:details
?details .
?details census1:totalPopulation ?table .
?table dc:title "SEX BY AGE (P012001)" .
}current HTTP Request is defined as follows:
import java.net.*;
import java.net.URL;
import java.net.URLConnection;
import java.io.*;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.StringReader;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.Arrays;
public class MyConnection
static Scanner sc = new Scanner(System.in);//allows user to input zipcode
public static void main(String[] args) throws Exception
int zip;//zipcode is declared as integer format
//User defines zip through input
//proceed to put SPARQL query into string, which is then used to call the server
String requestPart1 =
"query=PREFIX+dc%3A++%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%3E+%0D%0APREFIX+census%3A+%3Chttp%3A%2F%2Fwww.rdfabout.com%2Frdf%2Fschema%2Fcensus%2F%3E+%0D%0APREFIX+census1%3A+%3Ctag%3Agovshare.info%2C2005%3Ardf%2Fcensus%2Fdetails%2F100pct%2F%3E+%0D%0A%0D%0ADESCRIBE+%3Ftable+WHERE+%7B+%0D%0A+%3Chttp%3A%2F%2Fwww.rdfabout.com%2Frdf%2Fusgov%2Fgeo%2Fcensus%2Fzcta%2F";
String requestPart2 = "" + zip; // zipcode is transformed from int to string format and plugged into SPARQL query here
String requestPart3 =
"%3E+census%3Adetails+%3Fdetails+.+%0D%0A+%3Fdetails+census1%3AtotalPopulation+%3Ftable+.+%0D%0A+%3Ftable+dc%3Atitle+%22SEX+BY+AGE+%28P012001%29%22+.+%0D%0A%7D%0D%0A&outputMimeType=text%2Fxml";
String response = "";
URL url = new URL("http://www.rdfabout.com/sparql");//designates server to connect to
URLConnection conn = url.openConnection();//opens connection to server
// Set connection parameters.
conn.setDoInput (true);
conn.setDoOutput (true);
conn.setUseCaches (false);
// Make server believe we are form data
conn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
DataOutputStream out = new DataOutputStream (conn.getOutputStream ());
// Write out the bytes of the content string to the stream.
out.writeBytes(requestPart1 + requestPart2 + requestPart3);
out.flush ();
out.close ();
// Read response from the input stream.
BufferedReader in = new BufferedReader (new InputStreamReader(conn.getInputStream ()));
String temp;
while ((temp = in.readLine()) != null)
response += temp + "\n";
temp = null;
in.close ();
//parsing stuff is taken care of after here
}What remains now is to:
1) add status code processing: notify if the server is not available, ect.
2) add ability to connect to additional server if primary server is down.
I'm thinking an if/else statement, which I've tried a few different ways,
but I don't quite know how to implement that...Also trying to add the
status code processing/error handling, but I'm not sure how to do that
for multiple/different errors, such as 404, 503, 504, ect.. try/catch statements?
So yeah, just been scratching my head on this trying to figure out how to work it..
If you can help me out on this, I've been going nuts trying to figure this out...I think your issue comes form the fact that you are not casting URLConnection to HttpURLConnection.
Doing the cast would allow you to use getResponseCode() - among other methods - and test for a response different than 200.
Read: [http://mindprod.com/jgloss/urlconnection.html|http://mindprod.com/jgloss/urlconnection.html] -
How to make multi-tenant business rules
hi'
I want to write tenant specific Business rules in multi-tenant application, please give me some tips of making multi-tenat business rule.
I know how to write common business rule for all the tenants.
thanks
YatanI'd suggest using Flash Media Interactive Server if you wish to make this type of application and use Flash as the interface. I can't give you the details on exactly how to implement it, but using Remote Shared Object and FMIS would serve as the basis. I believe that the package comes with examples of Shared Objects that can serve as a simple basis from which to proceed. After that you might want to see if you can find an available whiteboard app that can be leveraged to do as you wish.
I apologize in advance if using this type of solution is a non-starter, I've been using FMIS locally and have plans to eventually implement something similar to this type of drawing app as well. -
How to make multi user drawing application
how to make multi user drawing application in as 3.0
I'd suggest using Flash Media Interactive Server if you wish to make this type of application and use Flash as the interface. I can't give you the details on exactly how to implement it, but using Remote Shared Object and FMIS would serve as the basis. I believe that the package comes with examples of Shared Objects that can serve as a simple basis from which to proceed. After that you might want to see if you can find an available whiteboard app that can be leveraged to do as you wish.
I apologize in advance if using this type of solution is a non-starter, I've been using FMIS locally and have plans to eventually implement something similar to this type of drawing app as well. -
How to install multi language in Portal?
Hi,
Can someone give me the directions in how to install multi
language in Portal? I found the "langinst.cmd" file under
ORACLE_HOME\portal30\admin\plsql, also another
file "langinst.sql" under ORACLE_HOME\portal30
\admin\plsql\nlsres.
I am not quite sure how I can do that, which file I should use.
And once I installed the multi language, can I just go into
portal to create a new content area and using the multi language?
Thanks for any comment in advance!
Kelly.Hi Kelly
You need to identify parameters for this file and run file. Its
langinst.cmd for WINNT and langinst.csh for UNIX.
1. From the dos prompt , go to the following directory on
your server.
Oracle/iSuites/portal30/admin/plsql/
2. Set the Oracle_Home to = oracle/iSuites/
3. Run the command
langinst.csh -s portal30 -p portal30 -o
PORTAL30_SSO -d PORTAL30_SSO -c oid -l ar -available
s - schema
p - password
o - < login server - in your case it may be portal30_SSO >
d - <password- maybe portal30_sso>
c - connect string
l - language (which is set to ar )
ar is arabic which i ve set
Good Luck
Regards
Yogesh -
HOW TO INSTALL THE "SH SCHEMA" IN 9I as guided by tutorial
Please guide me how to implement the SCHEMA(*SH*)that has been given in this tutorial
link.
as I want to use the whole demo for learing as I have alreay installed the siebel Analytics(7.8..)and oralce 9i,(the default loading) for pracice,so that I can use
the sh.rpd for practice further more
I am little bit confused
This is the path in orcle site ,where u can have a cliear view on my question..
--http://www.oracle.com/technology/obe/obe_bi/bi_ee_1013/index.html
then click on the 2nd linke"Creating a Repository Using the Oracle Business Intelligence Administration Tool "it is better to read it alone....
but there are some steps that you must have in mind!
1.copy *.rpd and fix the config file
2.copy the catalog and fix the config file
2.set the appropriate security
that's all
i hope i helped....
http://greekoraclebi.blogspot.com/
/////////////////////////////////////// -
How to implement redundant with 1 CE router to 2 MPLS service providers
Dear all,
Our head-office are currently have 1 Cisco CPE 3825 router with 2 WAN connections to our branches. We are now using static routing protocol in our network infrastructure, we consider how to implement the redundancy for networks by the redundant circuits connection to 2 MPLS providers, only when the primary connection to the primary MPLS L3 provider fail, the backup link to the second MPLS Layer 2 provider automatically active. Anybody knows where can I find information, tips or examples, how we'd handle the routing for that?
We are now have:
1 G0/1 interface connect to primary MPLS L3 Provider (the 2nd G0/2 interface is a leased-line connection to our partner, and we not consider here)
1 HWIC (layer 2) card, with 4 ports, which has interface F0/2/3 connected to the backup MPLS Layer 2 provider.
Thanks in advance.
PS: Current configuration : 3727 bytes
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
hostname Router
boot-start-marker
boot system flash c3825-entservicesk9-mz.123-11.T7.bin
boot-end-marker
logging buffered 4096 debugging
logging monitor xml
no aaa new-model
ip subnet-zero
ip cef
no ftp-server write-enable
no spanning-tree vlan 4
no spanning-tree vlan 5
interface GigabitEthernet0/1
description connect to VDC MPLS$ETH-WAN$
mtu 1480
ip address 222.x.x.66 255.255.255.252
ip flow ingress
ip flow egress
service-policy output SDM-QoS-Policy-1
ip route-cache flow
duplex auto
speed auto
media-type rj45
fair-queue 64 256 256
no cdp enable
interface FastEthernet0/2/0
switchport access vlan 2
no cdp enable
interface FastEthernet0/2/3
description ToTBToverFPT
switchport access vlan 5
no cdp enable
interface Vlan2
description CONNECT TO MPLS_VDC
ip address 192.168.201.9 255.255.248.0
interface Vlan5
description Connect to HoChiMinhCity
ip address 172.16.1.5 255.255.255.252
ip classless
ip route 0.0.0.0 0.0.0.0 Dialer1
ip route 172.16.244.0 255.255.255.0 222.255.33.65
ip route 192.168.0.0 255.255.248.0 222.255.33.65
ip route 192.168.24.0 255.255.254.0 222.255.33.65
ip route 192.168.30.0 255.255.254.0 222.255.33.65
ip route 192.168.32.0 255.255.254.0 222.255.33.65
ip route 222.x.x.68 255.255.255.252 222.255.33.65
ip route 222.255.33.72 255.255.255.252 222.255.33.65
ip route 222.x.x.196 255.255.255.252 222.255.33.65
ip route 222.x.x.200 255.255.255.252 222.255.33.65
ip http server
ip http authentication local
no ip http secure-server
ip http max-connections 3
control-plane
line con 0
logging synchronous
stopbits 1
line aux 0
stopbits 1
line vty 0 4
password
login
transport input telnet
line vty 5 14
privilege level 15
password
login
transport input telnet
line vty 15
privilege level 15
password
login
transport input telnet
parser view SDM_Monitor
scheduler allocate 20000 1000
endHi Mr jianqu,
Because of our customer now has 2 main central offices, and all other sub branches are now connected to each of these main central office via one primary full-meshed MPLS VPN of 1st Service Provider, so If I use the float static routes, and when there is a failure at one link at a CENTRAL CE Router to primary link to primary MPLS VPN Service Provider, but still there is no failure at the other site from a router CE sub branch with the the PE of the primary full-meshed MPLS VPN Layer 3 Service Provider,so It cannot cause a failover to a second redundant link of the 2nd Service Provider?
So with our system, do we only have one solution like this:
-Configure BGP as the routing protocol between the CE and the PE routers.
-Use local preference and Multi Exit Discriminator (MED) when running BGP inside a our customer VPN to select the primary and backup links.
-Use AS-override feature to support overlapping AS numbers between customer sites
Maybe you are looking for
-
ITunes 6.02 problem ("not enough memory error")
I attempted to update iTunes to the newest version yesterday, and for the most part everything went as planned. The application updated, everything seemed to be working afterwards. The next time I went to open iTunes I get an error of "The iTunes app
-
Hi All, Can someone please let me know an appropriate FM to update database table T100? TIA. Regards, Richa
-
DCN Case Study 3: ONS 15454 Linear Topology with DCN Connections at Both Ends Using OSPF
Hi, I need advise regarding design of Network Connectivity - DCN Case Study 3: ONS 15454 Linear Topology with DCN Connections at Both Ends Using OSPF. Am I need area 100 and 200 on Router 1 and Router 2 or I can don't do that? Am
-
Under "File" drop down menu the 'Import' tab is disabled - I am therefore unable to import the Favorites from Internet Explorer. What should I do ?
-
Pb update itunes 11.1.4 for XP
As usual when an update comes I launched it yesterday but a bug came and installation have not been able to finalize. I had to kill the update process after 3 attemps and finally completely frozen. When I open itunes now, I got a dll missing (MSVCR80