/* Create a tablespace
Create a tablespace tbs_01 in 1 MB local management and specify the data file D:/oradata/tbs_01.dbf;
View the created tablespace information.
*/
Create tablespace tbs_01 datafile 'd:/oradata/tbs_01.dbf 'size 1 m extent management local;
Select * From dba_free_space where tablespace_name = 'tbs _ 01 ';
/*
Modify tablespace
Change the tablespace data file to D:/oradata/tbs_01_new.dbf.
Add a 5 MB data file for the preceding tablespace.
View the modified tablespace information from the data dictionary. */
Alter tablespace tbs_01 offline;
Alter tablespace tbs_01
Rename datafile 'd:/oradata/tbs_01.dbf'
To 'd:/oradata/tbs_01_new.dbf ';
Alter tablespace tbs_01 online;
Alter tablespace tbs_01 add datafile 'tbs _ 02. dbf' size 5 m;
Select * From dba_free_space where tablespace_name = 'tbs _ 01 ';
/*
Move tablespace
Move the tablespace file from D:/oradata/to the C:/oradata/directory. */
Alter tablespace tbs_01
Rename datafile 'd:/oradata/tbs_01_new.dbf'
To 'C:/oradata/tbs_01_new.dbf ';
/* Delete a tablespace
Delete the tablespace created in the preceding step, including the content of the tablespace and the files occupied. */
Drop tablespace tbs_01 including contents and datafiles;
/* Change the password of the local Oracle user SYS and system to Oracle .*/
Alter user system identified by Oracle;
Alter user SYS identified by Oracle;
/* Create a locally managed tablespace tbs_estore and set the partition (extent) to 128 K */
Create tablespace tbs_estore datafile 'estore. dbf' size 2 m
Extent management local uniform size 128 K;
/* Create a user estore and set the password to estore. The default tablespace is tbs_estore.
Set the following permissions for your estore:
Connect to database
Create and execute PL/SQL programs
Any table can be created, modified, or deleted.
Any view can be created or deleted.
*/
Create user estore identified by estore default tablespace tbs_estore;
Grant connect to estore;
Grant resource to estore;
Grant create any table to estore;
Grant create any view to estore;
-- Oracle logon --
Connect estore/estore as normal