-- Create a user and grant corresponding Permissions
Create user test identified by "test ";
Grant dba to test;
Grant unlimited tablespace to test;
Grant create any table to test;
-- Create a tablespace
Create tablespace SM10001
Logging datafile 'd: \ oracle \ test_data01.dbf size 32 m
Autoextend (Auto scaling) on next 32 m maxsize 2048 m extent (width) management (management, processing) local;
-- Assign tablespace to users
Alter user smchannel default tablespace SM10001
-- The following two sentences solve the problem that function indexes cannot be dynamically created,
For example:
Create index I _USER on T_USER (SUBSTR (USER_NAME, 1, 2 ))
Alter system set query_rewrite_enabled = true;
Grant query rewrite to test;
-- Deleting a user actually removes the user and the created database objects from the data dictionary. After the user is deleted, the entity created by the user is also deleted.
-- Note: the user name cannot be modified, the online user cannot be deleted, and the user's tablespace cannot be deleted.
Drop user test cascade;