Through I have explained the procedure to delete/drop the user with tablespace and datafiles. I though of giving information about creating a user with custom tablespace and datafile.
Pre-requisites
- Oracle database
- Login as sys as sysdba
Procedure
Create tablespace
Syntax: CREATE TABLESPACEExample: CREATE TABLESPACE sample_tablespace DATAFILE 'C:\\samplets.dbf' SIZE 100M;
Example: CREATE TABLESPACE sample_tablespace DATAFILE '\usr\local\datafiles\samplets.dbf' SIZE 100M;
User creation
Alter sessionALTER SESSION SET "_ORACLE_SCRIPT"=true;
Create User
Syntax: CREATE USER
Example: CREATE USER sampleuser IDENTIFIED BY samplepwd DEFAULT TABLESPACE sample_tablespace;
Grant privilieges
Syntax: GRANT ALL PRIVILEGES to
Example: GRANT ALL PRIVILEGES to sampleuser;
Commit the commands
commit;
Now, you should be able to create the tablespace and made that as default tablespace for the newly created user.
Hope, this information helps you.
Please send your comments and feedback to psrdotcom@gmail.com