DUMP ALL TABLES OF A SCHEMA
You can use expdp
util given by Oracle. All you have to do is open a command prompt and navigate to the SQLDeveloper installation directory and run the following command.
expdp username/password@database SCHEMAS=schema_name DIRECTORY=directory_name DUMPFILE=backup_file_name.dmp
This will dump all your table along with data in one go.
Please change the values of username
, password
, database
, schema_name
etc. accordingly.
TRUNCATE ALL TABLES IN ONE SHOT
Use the following anonymous block
BEGIN
FOR tbl IN (SELECT table_name FROM user_tables) LOOP
EXECUTE IMMEDIATE 'TRUNCATE TABLE ' || tbl.table_name;
END LOOP;
END;
Please change the query accordingly and add WHERE
if required.