Visualizzazione post con etichetta sqlplus. Mostra tutti i post
Visualizzazione post con etichetta sqlplus. Mostra tutti i post

mercoledì 27 febbraio 2013

Oracle - rimuovere tabelle utente

Comando

BEGIN FOR cur_rec IN (SELECT object_name, object_type FROM user_objects WHERE object_type IN ('TABLE', 'VIEW', 'PACKAGE', 'PROCEDURE', 'FUNCTION', 'SEQUENCE' )) LOOP BEGIN IF cur_rec.object_type = 'TABLE' THEN EXECUTE IMMEDIATE 'DROP ' || cur_rec.object_type || ' "' || cur_rec.object_name || '" CASCADE CONSTRAINTS'; ELSE EXECUTE IMMEDIATE 'DROP ' || cur_rec.object_type || ' "' || cur_rec.object_name || '"'; END IF; EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.put_line ( 'FAILED: DROP ' || cur_rec.object_type || ' "' || cur_rec.object_name || '"' ); END; END LOOP; END; /

Note

lo script permette di rimuovere tutte le tabelle dell'utente con cui viene eseguito



Collegamenti Esterni


How to drop all user tables?

venerdì 6 novembre 2009

Oracle - elenco tabelle utente


Comando
select table_name from user_tables;


Note
Il comando elenca il nome delle tabelle dell'utente con cui si è fatto accesso sul db.
Sostituire table_name con il carattere * per avere maggior dettaglio sulle tabelle presenti.

Collegamenti Esterni
Getting Started With Oracle