Oracle sets a table as read-only

Source: Internet
Author: User

Oracle 11g starts with the ability to set a table as read-only, which prevents modifications to certain tables and provides a certain degree of security.

Settings are as follows:

-- Set table as read-only permission (locking) ALTER TABLE READ  only  ; -- set Read and Write permissions for a table (unlock) ALTER TABLE READ WRITE;

When the table needs to be updated, adding and deleting records, you can reset the read and write permissions, after the table modification operation, set to read-only properties again.

Expansion: In some specific situations, it may be necessary to increase the record of a table, can not delete, how can this be achieved?

One way to refer to this table is to add a trigger, when the table is updated, deleted, and so on, the trigger throws an exception, insert, do not trigger an exception.

Oracle sets a table as read-only

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.