In today’s discussion, we will talk about the following.
What is read only? Why we need to alter the table into read-only? These are some important question that comes into one’s mind.
As you know, you can alter the table as well as you can add, delete, and modify columns and their data types. However, today I’ll tell you that you can also convert the table in read-only mode. This read-only status of the table will disable the box (Object) from any modification of any record that is already available in the table.
Why we need to change table read only?
We usually do this cause we do not allow anyone to modify the information that we already have. Generally we do this for reporting tables.
Let’s make it more concrete by completing an example.
Examples:
ALTER TABLE SCOTT.EMP READ ONLY;
SELECT * FROM SCOTT.EMP;
UPDATE SCOTT.EMP SET SAL=1000 WHERE EMPNO=7369;
ALTER TABLE SCOTT.EMP READ WRITE;
First pick the table that you want to convert it into read-only. In our case we have chosen SCOTT.EMP3
ALTER TABLE SCOTT.EMP3 READ ONLY;
Note: Scott.emp3 is the table name you can replace with your table name.
ERROR at line 1:
ORA-12081: update operation not allowed on table “SCOTT”.”EMP3″
ERROR at line 1:
ORA-12081: update operation not allowed on table “SCOTT”.”EMP3″
In order to resolve this error or back table into read and write mode, you need to run the following query if you have privileges otherwise contact you DBA.
ALTER TABLE SCOTT.EMP3 READ WRITE;
Note: Scott.emp3 is a table name you can replace with your table name.
I hope today we have covered this Read only feature.
What is the Main Cause of a Heart Attack? What is its Solution? A heart attack is the blockage of… Read More
In the vast economic arena, one term that often takes center stage, inciting extensive debates and discussions, is the "debt… Read More
De-Dollarization: The Changing Face of Global Finance The financial landscape is in a state of flux, with an intriguing economic… Read More
The curtains closed on a dramatic Bundesliga season with Bayern Munich standing tall once again, clinching their 11th straight title.… Read More
The Unfolding Story of Celine Dion's Health In recent news that has left fans across the globe stunned, iconic singer… Read More
As the echoes of the recent NBA season start to fade, the attention of enthusiasts is firmly glued to one… Read More