| CS 3540 |
Week 6 Lab Part 1
Complete in class |
This assignment is designed to help you to setup an environment to facilitate performance testing.
- Use SQL*Plus to connect to the database as SYSTEM.
- Begin spooling to file CS3540Lab6p1.txt
- Create a new Tablespace named TBTest using only the required parameters: datafile and size.
Set the size to 1M.
Name the datafile tbtest01.dbf
and place it with the other datafiles in your OFA tree.
(hint: Find CREATE TABLESPACE syntax in your text page 79 and/or Internet resources)
- Check to see what default values Oracle supplied in the table space by querying DBA_TABLESPACES for the new tablespace.
- Check the OFA tree to see that the datafile was indeed created.
- Remove the tablespace by:
ALTER TABLESPACE TBTest offline;
DROP TABLESPACE TBTest INCLUDING CONTENTS AND DATAFILES;
- Query DBA_TABLESPACES again to insure that the tablespace has been dropped.
- Check the OFA tree to insure that the datafile has been deleted.
- Recreate the tablespace with a size of 500M.
- Query DBA_TABLESPACES to insure that the tablespace was created with the correct size.
- Create a new user named lab6user with a password of testing123
Set the user's default tablespace to be the new tablespace that you created.
Set the temporary tablespace to be temp
- Give the new user privileges to create a session, connect, create a cluster, create a table
create a sequence and to create a procedure.
- Connect as the new user.
- Attempt to create a new table named TESTTABLE with a single VARCHAR2(50) column named col1.
(hint: CREATE TABLE syntax on page 182)
- Connect as system
- Give the user some space to create objects with the syntax:
alter user lab6user quota unlimited on tbtest;
- Attempt to create a new table named TESTTABLE with a single VARCHAR2(50) column named col1.
- Query the USER_TABLES user view to insure that the table was created.
- Query all rows of TESTTABLE;
- DROP TESTTABLE;
- Stop Spooling
- Research: Why did the create table fail in step 14?
- Research: What is the proper amount of object space to grant to users?
- Research: What is the risk of granting an unlimited quota to a user?
- Research: What will happen if a user exceeds their quota? What if the quota is unlimited?
Use Assignment Uploader to
submit