Skip to content

Metabolomics Fiehn Lab

Sections
Personal tools
You are here: Home » Members » Gert Wohlgemuth » oracle » disable table locks

disable table locks

Document Actions
this is a small plsql script which disables locking for all tables in a schema to optimize performance
--script to disable begin--

DECLARE
CURSOR GET_TABLES IS
SELECT TABLE_NAME FROM user_tables;

BEGIN
FOR v_table IN GET_TABLES LOOP
EXECUTE IMMEDIATE ('ALTER TABLE ' || v_table.table_name || ' DISABLE TABLE LOCK');
END LOOP;
END;
/
exit


--script to disable end--

--script to enable begin--

DECLARE
CURSOR GET_TABLES IS
SELECT TABLE_NAME FROM user_tables;

BEGIN
FOR v_table IN GET_TABLES LOOP
EXECUTE IMMEDIATE ('ALTER TABLE ' || v_table.table_name || ' ENABLE TABLE LOCK');
END LOOP;
END;
/
exit

--script to enable end--
Created by zwluxx
Last modified 2006-11-01 03:26 PM
 

Powered by Plone

This site conforms to the following standards: