Sunday, September 21, 2025

READ-ONLY PDB users in Oracle 23ai - Secure Multitenancy

Oracle 23ai has introduced a new feature, READ-ONLY PDB user to improve security, developer productivity and performance. This helps multi-tenant environment where data access is critical.

The READ-ONLY user cannot perform any DDL or DML activities.

Create a Read-Only PDB User: To create a Read-Only PDB use the new READ ONLY clause in the CREATE USER statement.

Connect to PDB user
SQL> ALTER SESSION SET CONTAINER = my_pdb;

Create readonly “hr_user”
SQL> CREATE USER hr_user IDENTIFIED BY passwordxxx READ ONLY;

Grant create session to hr_user
SQL> GRANT CREATE SESSION TO hr_user;

Note that the “hr_user” cannot be able to perform below tasks
  • User cannot run INSERT, DELETE, UPDATE or MERGE.
  • User Cannot create or modify tables, indexs, views or procedures
  • User cannot change roles or privileges
  • User cannot modify session-level settings
When you try any of the above user will receive “ORA-28194: Can perform read operations only " error.

Run below view to see the user is read-only or not
SQL> SELECT username, read_only from dba_users where username='HR_USER';
USERNAME      READ_ONLY
--------------------  -----------------
HR_USER           YES

SQL> Connect hr_user/paswordxxx;
Connected.

SQL> CREATE TABLE employee_test (emp_id number, emp_name varchar2(50));
*
ERROR at line 1:
ORA-28194: Can perform read operations only

SQL> DELETE FROM employee;
*
ERROR at line 1:
ORA-28194: Can perform read operations only

Note that READ-ONLY users can execute PL/SQL if it doesn’t have any DDL or DML.
The below procedure rev_salary has update statement and cannot perform the operation.
 
SQL> exec REV_SALARY;
ERROR at line 1:
ORA-28194: Can perform read operations only
ORA-06512: at "HR_USER.REV_SALARY", line 3
ORA-06512: at line 1

The READ-ONLY user can run a SELECT query without any issues.

SQL> SELECT emp_id, emp_name from employee;
EMP_ID EMP_NAME
-------------- ----------------------------
1 test_user1
2 test_user2
3 test_user3
SQL>

The Read-Only PDB Users provide a clean way to enforce non-modifiability of users at the database level. This helps with read intensive applications, as these users restricted to only SELECT and users cannot perform any DDL or DML activities.

Thanks & Regards,

20 comments:

  1. That’s an interesting topic! If you’re looking for secure and exciting gameplay, TigerXplay offers just that. With its engaging rummy game players can enjoy smooth performance, fair competition, and real rewards. Whether you’re a beginner or a seasoned player, TigerXplay ensures a safe and fun environment where every move counts. Dive in, play smart, and experience nonstop entertainment with the thrilling rummy game on TigerXplay.

    ReplyDelete
  2. Amazing write up. Thanks for sharing this information.

    If you are looking for Digital Marketing classes in Hyderabad , you can get in depth training at Whitescholars. Most of the companies are looking for Digital marketers who have undergone Digital marketing training in Hyderabad

    digital marketing course in hyderabad

    ReplyDelete
  3. What an exciting cricket match today! Non-stop action from start to finish. Loved tracking live moments on Gurubhai247 and betbook247 —both made the game even more thrilling for fans!

    ReplyDelete
  4. Helpful career-focused post.This Android developer training includes live projects.

    ReplyDelete
  5. The Lotus365 download APK installs easily and runs perfectly.


    https://winbuzz-247.com/

    ReplyDelete
  6. I usually don’t trust new platforms, but77bet gameseems decent so far. Found this guide useful before trying it myself.

    ReplyDelete
  7. I was specifically searching for 5222 game download apk old versionsince my phone is old. Glad someone mentioned it.

    ReplyDelete
  8. Great explanation on managing read-only PDB users in Oracle 23c AI the step-by-step examples and clarity here make it much easier to grasp, especially for DBAs and developers working with pluggable databases and security configurations. Thanks for breaking it down so thoughtfully!

    For anyone reading through this and also looking to grow their digital skills in today’s competitive landscape, you might find value in checking out the Digital Marketing Training Institute in Coimbatore and the UI UX Design Course in Coimbatore. These are great resources for building practical expertise that complements technical knowledge.

    ReplyDelete
  9. Really enjoying the content here! The layout is clean and easy to navigate, making it a pleasant experience to browse through the posts. Keep up the great work — it’s refreshing to see such well-organized and informative content.

    For anyone looking to level up their design skills, this UI/UX design course syllabus is a fantastic resource to explore.

    ReplyDelete
  10. Great technical breakdown thanks for sharing such clear and practical insights on Oracle 23AI! This kind of content really helps developers understand advanced features and best practices. For anyone curious about how digital strategies help technical content reach a wider audience, here’s a helpful guide on What is Digital Marketing?

    Keep up the informative posts!

    ReplyDelete
  11. This article gives a clear and practical explanation of the new READ-ONLY PDB user feature in Oracle 23ai and its benefits for secure multitenant environments. The step-by-step examples make it easy to understand how restricting DDL and DML operations improves data protection and system stability. It’s especially useful for DBAs managing read-intensive workloads and controlled access scenarios.

    For those looking to enhance their technical and digital skills, you can also explore this helpful resource:
    Best Digital Marketing Training Institute

    ReplyDelete
  12. This is a great piece of content. I enjoyed reading through it.
    You’ve explained things in a simple and effective way.
    Also sharing a useful link:
    Data Science or Data Analytics

    ReplyDelete
  13. Great content, easy to understand and very informative.
    You can also check Learn Data Science vs Data Analytics for more clarity.

    ReplyDelete
  14. Great read! Designers can improve their craft with the Figma UI/UX Course. Developers should also check out the Full Stack Developer Course in Chennai.

    ReplyDelete
  15. Very well written and easy to understand.
    I enjoyed reading this article.
    Here’s a helpful link for learners:
    Data Science Course with Placement
    Also check out:
    Best IT Training Institute in Coimbatore

    ReplyDelete