Method: 1. Use the "drop user user_name cascade;" statement; 2. Use the "select 'drop table '||table_name||';' from cat where table_type='TABLE'" statement.
ORACLE method of deleting all tables under the current user
1 . If you have the permission to delete the user, you can:
drop user user_name cascade;
After adding cascade, you can delete all the data associated with the user.
Delete and then create this user.
--Create administrator user
create user 用户名 identified by 密码 default tablespace space_data(表空间名称) temporary tablespace space_temp(临时表空间名称);
--Authorization
grant connect,dba to 用户名;
--Modify quota
ALTER USER "用户名" QUOTA UNLIMITED ON SPACE_DATA(表空间名称);
--View all user objects
select uo.object_name,uo.object_type from user_objects uo where uo.object_type<>'LOB' order by uo.object_type desc
2. If you do not have the permission to delete the user, you can execute:
select 'drop table '||table_name||';' from cat where table_type='TABLE'
A batch of sql statements for deleting the table will be output. Just execute these SQL statements. (Requires permission to drop table)
Recommended tutorial: "Oracle Tutorial"
The above is the detailed content of How to delete all tables under a user in Oracle?. For more information, please follow other related articles on the PHP Chinese website!