Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Task#3

Tablespace and Datafile Management


IMPORTANT NOTE:
Create a spool file while working in SQL*Plus to save all your work in an SQL session.
If you prefer to use Oracle Enterprise Manager, do not forget to add either SQL commands or
Screen Shots in your report. (Easier way )
Format your output as necessary to make it easy to read.
COLUMN <column_name> FORMAT A#;
(i.e:COLUMN tablespace_name Format A10;)
Steps:
1. Connect as the DBA user for your database.
2. Create permanent tablespaces as follows
DATA01 with the following requirements.
Must have a data file of 5MB in size which should extend dynamically, 5MB, but should
not exceed 30 MB.
DATA02 that allows extents to be different sizes such that extent size is automatically
allocated by the DBMS.
Query the DBA_TABLESPACES and V$DATAFILE view to display information
about the tablespaces you just created
3. Alter the DBA user
Alter the DBA user accounts for your database such that each DBA is assigned a default
tablespace of DATA01.
Verify the result by querying DBA_USERS as shown here:
SELECT username, default_tablespace FROM dba_users;
4. Alter tablespaces
Allocate 20MB additional space to tablespace DATA01
Add another data file to DATA01 and DATA02 which should remain 4MB
Verify the result by querying DBA_DATA_FILES
5. Create temporary tablespaces as follows
UTEMP01 with the following requirements
Must have a temporary file of size 15 MB in size which should increase dynamically, by
5MB, but should not exceed 50 MB.
UTEMP02 must have a temporary file of size 10B.
6. Alter temporary tablespace
Increase the temporary file size of UTEMP02 and make it of maximum 80 MB while it
should be allowed to extend dynamically on every 20 MB.

7. Create a tablespace using OMF (Oracle-Managed File)


Alter the system to set the DB_CREATE_FILE_DEST parameter to a valid directory.
(Hint: use ALTER SYSTEM command and copy the correct path for tablespaces.
(Check Enterprise manager))
Create a tablespace named OMFDATA with size 100K. Do not specify a file location.
Verify the result by querying DBA_DATA_FILES:
SELECT tablespace_name, file_name, status FROM dba_data_files;
Drop the tablespace that you just created including the contents and datafile.
8. Drop tablespace
Delete the tablespace DATA02 including its contents (i.e. data files) in a single
command.

You might also like