1

Does it make any difference to store tables inside container database or pluggable database? I'm a new to Oracle database. I've got Enterprise edition 21. I'm just using it for testing purposes.

I've googled for any kind of information, but didn't find anything.

alexzhvv
  • 11
  • 2

2 Answers2

1

It makes a HUGE difference, don't put your application tables into the Container (CDB) unless you have a very specific reason to do so.

Treat the pluggable database as your application instance. The safest way to go is to create a CDB with a single PDB and treat that PDB as 'your database.'

For clarification and details, see the Docs.

Oracle-Base also has some great commentary and advice.

thatjeffsmith
  • 20,522
  • 6
  • 37
  • 120
  • I see. Can you explain to me, which differences there are? Maybe I didn't precisely define the difference I am looking for. I'm talking about performance in terms of queries like SELECT, INSERT, DELETE, UPDATE and when compression is applied. – alexzhvv Aug 30 '23 at 06:54
  • The container database's only job is to take care of central tasks, your application's data is meant to be stored in the pluggable database. As you create more and more pluggable databases, the central work provided by the container database saves you LOTS of resources, as opposed to creating multiple, standalone instances of Oracle. As you're getting started, every single thing you do, should be done in the PDB. CREATE TABLE..INSERT..SELECT, etc – thatjeffsmith Aug 30 '23 at 12:05
  • @thatjeffsmith I agree with you on not putting application tables into the CDB. But I'm skeptical of the claim that "the central work provided by the container database saves you LOTS of resources." Using a non-trivial amount of PDBs costs $17,500 per processor. Even with a steep discount, does that feature really save resources compared to spending the money on buying more server memory? Are there any real world studies comparing investing in the feature versus investing in better hardware? – Jon Heller Aug 30 '23 at 14:24
  • @JonHeller it's the entire conceit of the architecture, if it doesn't do that, we just wasted years of developer time and i dont' know how many millions of dollars. I have lots of friends in sales that would love to help you on your consolidation project, email me. – thatjeffsmith Aug 30 '23 at 15:02
-1

Most data should be stored in a pluggable database instead of the CDB root. From the manual:

The CDB root does not store user data. Oracle recommends that you do not add common objects to the root or modify Oracle-supplied schemas in the root. However, you can create common users and roles for database administration. A common user with the necessary privileges can switch between containers.

While you can create tables on the CDB, it will likely eventually lead to weird problems that will annoy your DBAs - users won't work as expected, data won't be stored in the expected tablespaces, etc.

This is a seemingly-simple question, but your confusion is entirely understandable because Oracle's multitenant architecture is incredibly stupid. Don't even get me started.

Jon Heller
  • 34,999
  • 6
  • 74
  • 132