| |
|
If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
|
 |

04-09-08, 07:54
|
|
Registered User
|
|
Join Date: Mar 2008
Posts: 11
|
|
|
How to make already existing table to be read-only?
|
|
Hi,
I want to make a already existing DB2 table to be read-only. Can anyone let me know the command for doing that?
I am using DB2 - V8.1/Linux OS
Thanks,
Arunvijay.
|
|

04-09-08, 07:56
|
|
:-)
|
|
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
|
|
You could use the REVOKE statement to revoke insert, update, and delete authorization from certain users or groups.
|
|

04-09-08, 09:03
|
|
Registered User
|
|
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
|
|
|
|
Or you create a small program that locks the table in shared mode, which will also prevent DBAs from bypassing the privilege checking. (But then, a SYSADM could force this program and it wouldn't be water-tight.)
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
|
|

04-09-08, 19:10
|
|
Registered User
|
|
Join Date: May 2003
Location: USA
Posts: 5,196
|
|
Quote:
|
Originally Posted by stolze
Or you create a small program that locks the table in shared mode, which will also prevent DBAs from bypassing the privilege checking. (But then, a SYSADM could force this program and it wouldn't be water-tight.)
|
I wonder if that would cause the logs to go into secondary extents because the transaction is still open?
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
|
|

04-10-08, 03:29
|
|
Registered User
|
|
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
|
|
No, it wouldn't. Since the lock does not cause a log record to be written, the locking transaction does not refer to any active log file.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
|
|

04-10-08, 04:50
|
|
Registered User
|
|
Join Date: May 2003
Location: USA
Posts: 5,196
|
|
Quote:
|
Originally Posted by stolze
No, it wouldn't. Since the lock does not cause a log record to be written, the locking transaction does not refer to any active log file.
|
Doesn't DB2 have to record the beginning of the UOW? Maybe not, but in any case, I don't think it is a good idea to hold locks like that.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
|
|

04-10-08, 04:55
|
|
Registered User
|
|
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
|
|
The beginning of the UOW is needed only when the first data modification occurs. In fact, transactions with only queries do not appear at all in the log - at least that's how things worked in DB2 LUW V8, and I doubt that this changed in V9.
And I fully agree: holding locks like that is not smart at all, for example, if lock timeout is set to infinity...
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|