Notifications
Clear all

Does a deleteData.sh or similar script exist for production installs?

2 Posts
3 Users
0 Reactions
885 Views
0
Topic starter

I am looking to run a command that can quickly delete the contents of a production installed database, so that we can then run the loadData.sh script to arrive at a clean, new dataset. Does this sort of script currently exist?

2 Answers
0

I think you can run the delete_data command yourself.

What that script does is make this call:

SQLPLUS -S -L wks_yyildiz_esg_1_0/password@localhost:1521/ORCL @delete_user_data.sql

and delete_user_data.sql does:

execute dtb.delete_data();

so you can connect to the database and run execute dtb.delete_data(); command. But I recommend you try this locally before using it in prod.

0

There is a stored proc which does this. From SQL Developer, run:

exec dtb.delete_data()

This deletes ALL rows from ALL tables. So I assume you know what you're doing by running this. 🙂