/*Note: If you already have the appropriate user and table space, you will need to delete the appropriate user and tablespace before re-establishing all*/--Delete UserDrop UserUSERNAMECascade;--Delete Table SpaceDropTablespace data_temp including contents anddatafiles;DropTablespace DATA including contents anddatafiles;--Create a temporary table spaceCreate TemporaryTablespace data_temp Tempfile'data_temp. DBF'size 500M autoextend on;--CREATE TABLE SpaceCreateTablespace DATA Logging DataFile'DATA. DBF'size 500M autoextend on;--Create a user and specify a tablespaceCreate UserUSERNAME identified byUSERNAMEdefaulttablespace DATATemporarytablespace data_temp profiledefault;--grant a user permissions to a roleGrantConnect toUSERNAME;GrantResource toUSERNAME;GrantDba toUSERNAME;--granting system permissions to usersGrantUnlimited tablespace toUSERNAME;Exit;
Oracle creates tablespace, temp tablespace, create user and specify Tablespace, authorize, delete user and table space