开发者

Oracle: make WORM (write-once, read-many) table?

开发者 https://www.devze.com 2023-01-21 21:58 出处:网络
Context: logging table changes, and we don\'t want to accidentally mess up the log entries.This is an internal, non-financial app, so we\'re not worried about hostile modification.

Context: logging table changes, and we don't want to accidentally mess up the log entries. This is an internal, non-financial app, so we're not worried about hostile modification.

I thought I could just revoke delete/update, but it turns out you can't do that to yourself:

ORA-01749: you may not GRANT/REVOKE privileges to/from yourself

What's the most canonic开发者_运维技巧al way to do this?


You should not use triggers to enforce security requirements.

You should create the table owned by another schema, then only grant the necessary privileges (e.g. INSERT).


Make a BEFORE UPDATE and/or a BEFORE DELETE trigger on the table, which will ALWAYS raise an exception.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号