Reputation: 513
I have three schemas that each need a row sharing the same data in a key column. The processes can enter via any of the 3, but the source of the key value must only be held on one. This can easily be shared via grants.
What are the pros and cons of keeping the key value in an Oracle sequence, vs. creating a table in one of the schemas that realistically holds a sequence?
Upvotes: 1
Views: 550
Reputation: 369
One big problem with a table for sequence is concurrency problem. oracle manages the sequences so there is no problem with duplicate numbers but it is difficult to assign unique numbers with a table. If you want to make customized IDs you can use sequence and in a trigger change it to a customized value based on a formula for example. However, it is recommended not to use IDs as a business column. Therefore it is better to use sequence rather than using some tables for IDs.
Upvotes: 3