Sometime we need to make sure that no DML operation done to a specific table, however unlike setting a tablespace as read only, there is no dedicated command or syntax to set a table as read only.
To set a table read only in Oracle database, we can use a quick and easy workaround by using a check constraint on the table while specifying disable validate.
ALTER TABLE table_name ADD CONSTRAINT table_name_read_only check(1=1) disable validate;
Trying to insert, delete or update that table would give an error code ORA-25128: No insert/update/delete on table with constraint disabled and validated error, and prevent all DML operations.
Linux, Oracle & Oracle Apps
Collection of tips and trick for combination of Oracle Database, Oracle EBS and Linux OS
18 March 2010
05 March 2010
Linux Magic SysRq
Linux is a robust and stable operating system kernel, but there are instances where it can panic, be it due to bad hardware or bad software. It does not happen often, but it can happen.
On local systems, it is also convenient to be able to reboot the system with a key-press in the case of a panic. Instead of having the system reboot automatically on a local system, consider using the magic SysRq keys to reboot your system if X locks up or keyboard entry is being ignored.
To enable magic SysRq support, you must again edit /etc/sysctl.conf; some Linux distributions have this enabled by default whereas others do not.
kernel.sysrq = 1
If the time comes when the SysRq keys are required, use the magic SysRq combination, which is: [ALT]+[SysRq]+[COMMAND], where the [SysRq] key is the "print screen" key and [COMMAND] is one of the following:
b - reboot immediately without syncing or unmounting disks
e - sends a SIGTERM to all running processes, except for init
o - shut down system
s - attempt to sync all mounted filesystems
u - attempt to remount all mounted filesystems as read-only
These keys need to be pressed together simultaneously to take effect.
Auto-rebooting is great for remote systems, and the magic SysRq combo is very useful for local systems.
On local systems, it is also convenient to be able to reboot the system with a key-press in the case of a panic. Instead of having the system reboot automatically on a local system, consider using the magic SysRq keys to reboot your system if X locks up or keyboard entry is being ignored.
To enable magic SysRq support, you must again edit /etc/sysctl.conf; some Linux distributions have this enabled by default whereas others do not.
kernel.sysrq = 1
If the time comes when the SysRq keys are required, use the magic SysRq combination, which is: [ALT]+[SysRq]+[COMMAND], where the [SysRq] key is the "print screen" key and [COMMAND] is one of the following:
b - reboot immediately without syncing or unmounting disks
e - sends a SIGTERM to all running processes, except for init
o - shut down system
s - attempt to sync all mounted filesystems
u - attempt to remount all mounted filesystems as read-only
These keys need to be pressed together simultaneously to take effect.
Auto-rebooting is great for remote systems, and the magic SysRq combo is very useful for local systems.
Subscribe to:
Posts (Atom)