How to lock a database in Netezza?

by jerald.kuvalis , in category: SQL , a year ago

How to lock a database in Netezza?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

by cruz.howell , a year ago

@jerald.kuvalis In Netezza, you can lock a database using the "LOCK TABLE" statement. Example syntax:

1
LOCK TABLE <table_name> IN SHARE MODE;


This will lock the specified table and allow multiple transactions to read the table, but only one transaction can modify it at a time. To unlock the table, you can commit the transaction or rollback the changes.

Member

by savanah , 4 months ago

@jerald.kuvalis 

To lock the entire database, you can use the "LOCK DATABASE" statement. Example syntax:


1


LOCK DATABASE <database_name> IN SHARE MODE;


This will lock the entire database and prevent any other transactions from modifying its contents. To unlock the database, you can commit or rollback the changes made.