I have one database that contains all tables of salary details of company's employees and this database is used by other three companies for their employees.i want to make separate database for three companies so that if one company changes the database then the changes does not changes my database structure and also want that this database should not consume large space in server.so please suggest me what should I do to permit the companies to change my database without affecting actual database.
Awaiting for ur response sir
There's no hard and fast rule for this. As you only have four companies, if:
- This number is unlikely to increase
- Each company is likely to have lots of custom changes to the tables
Then separate schemas may be the best approach. On the other hand if you're expecting:
- Lots more companies to come online and
- They're all mostly standard (few tables/columns specific to a given company)
Then a single schema with customer_id added to the relevant tables may be better. Ultimately you need to trade-off the extra complexity of more schemas vs. the likelihood they will be different.
As you're storing salary data you should make doubly sure you're securing this so companies can't see each-others information. Separate schemas makes this easier. VPD can help if you're sticking with one schema.
You can find thoughts on a more extreme version of this problem at:
https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:9526095800346914577