Beruflich Dokumente
Kultur Dokumente
Managing Tablespaces
Creating Tablespaces
Use the CREATE TABLESPACE statement to create a tablespace, which is an allocation of space in the database that can contain schema objects. A permanent tablespace contains persistent schema objects, are stored in data files. A temporary tablespace contains schema objects only for the duration of a session. An undo tablespace is a type of permanent tablespace used by Oracle Database to manage undo data. Mdulo II ADMINISTRAO
Managing Tablespaces
Creating Tablespaces
The primary tablespace in any database is the SYSTEM tablespace The SYSAUX tablespace, is also always created when you create a database To create a new tablespace, use the SQL statement CREATE TABLESPACE or CREATE TEMPORARY TABLESPACE CREATE TABLESPACE system privilege to create a tablespace CREATE UNDO TABLESPACE statement to create a special type of tablespace called an undo tablespace Mdulo II ADMINISTRAO
Managing Tablespaces
Optimizing tablespace use by reserving a tablespace for a particular type of database use, such as high update activity, read-only activity, or temporary segment storage. Back up individual tablespaces.
Mdulo II ADMINISTRAO
Managing Tablespaces
Mdulo II ADMINISTRAO
Managing Tablespaces
CREATE TABLESPACE lmtbsb DATAFILE '/u02/oracle/data/lmtbsb01.dbf' SIZE 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;
LOCAL UNIFORM, then you must ensure that each extent contains at least 5 database blocks.
Mdulo II ADMINISTRAO
Managing Tablespaces
Mdulo II ADMINISTRAO
Managing Tablespaces
CREATE TABLESPACE lmtbsb DATAFILE '/u02/oracle/data/lmtbsb01.dbf' SIZE 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K BLOCKSIZE 8K;
Mdulo II ADMINISTRAO
Managing Tablespaces
Mdulo II ADMINISTRAO
Managing Tablespaces
Mdulo II ADMINISTRAO
Managing Tablespaces
Clause
NORMAL
Description
A tablespace can be taken offline normally if no error conditions exist for any of the datafiles of the tablespace. NORMAL is the default. When you specify OFFLINE TEMPORARY, the database takes offline the datafiles that are not already offline. If one or more files of the tablespace are offline because of write errors, and you take the tablespace offline temporarily, the tablespace requires recovery before you can bring it back online. When you specify OFFLINE IMMEDIATE, media recovery for the tablespace is required before the tablespace can be brought online. You cannot take a tablespace offline immediately if the database is running in NOARCHIVELOG mode.
TEMPORARY
IMMEDIATE
Mdulo II ADMINISTRAO
Managing Tablespaces
Mdulo II ADMINISTRAO
Managing Tablespaces
The following statement makes the flights tablespace writable: ALTER TABLESPACE flights READ WRITE;
Mdulo II ADMINISTRAO
Managing Tablespaces
Drop items, such as tables or indexes, Cannot create or alter objects Can execute statements that update the file description,such as ALTER TABLE...ADD or ALTER TABLE...MODIFY, Will not be able to use the new description until the tablespace
Mdulo II ADMINISTRAO
Managing Tablespaces
Mdulo II ADMINISTRAO
Managing Tablespaces
Mdulo II ADMINISTRAO
Managing Tablespaces
Temporary Tablespaces
Only for the duration of the session Temporary tablespaces are used to store the following: Intermediate sort results Temporary tables and temporary indexes Temporary LOBs Temporary B-trees By default, a single temporary tablespace named TEMP is created . You can assign a temporary tablespace to each database user with the CREATE USER or ALTER USER statement. Mdulo II ADMINISTRAO
Managing Tablespaces
Mdulo II ADMINISTRAO
Managing Tablespaces
Mdulo II ADMINISTRAO
Managing Tablespaces
Renaming Tablespaces
Mdulo II ADMINISTRAO
Managing Tablespaces
Dropping Tablespaces
You cannot drop a tablespace that contains any active segments.
DROP TABLESPACE users INCLUDING CONTENTS;
Mdulo II ADMINISTRAO
Managing Tablespaces
Mdulo II ADMINISTRAO
Managing Tablespaces
Mdulo II ADMINISTRAO
Managing Tablespaces
Mdulo II ADMINISTRAO
Managing Tablespaces
Mdulo II ADMINISTRAO
Managing Tablespaces
Mdulo II ADMINISTRAO
Managing Tablespaces
Mdulo II ADMINISTRAO
Managing Tablespaces
Dvidas ???
Mdulo II ADMINISTRAO
Managing Tablespaces