Crear un Tablespace

Un tablespace es el archivo donde se almacenarán las tablas y datos de usuario. No es mas que un archivo físico donde oracle almacenará esos datos

Ejemplo

  CREATE TABLESPACE MD_DATA
    DATAFILE 
             'mddata01.dbf' SIZE 1000M,
             'mddata02.dbf' SIZE 1000M
    AUTOEXTEND ON NEXT 5M MAXSIZE 200000M;

Sintaxis

CREATE TABLESPACE tablespace [DATAFILE clause] [MINIMUM EXTENT integer[K|M]] [BLOCKSIZE integer [K]] [LOGGING|NOLOGGING] [DEFAULT storage_clause ] [ONLINE|OFFLINE] [PERMANENT|TEMPORARY] where:tablespace is the name of the tablespace to be created

    DATAFILE specifies the data file or data files that make up the tablespace
   MINIMUM EXTENT
                 ensures that every used extent size in the tablespace is
                 a multiple of the integer. Use Kor M to specify this
                 size in kilobytes or megabytes.
                 specifies that, by default, all tables, indexes, and partitions
   LOGGING
                 within the tablespace have all changes written to redo.
                 LOGGING is the default.
                 specifies that, by default, all tables, indexes, and partitions
   NOLOGGING
                 within the tablespace do not have all changes written to redo.
                 NOLOGGING affects only some DML and DDL commands,
                 for example, direct loads.
                 specifies the default storage parameters for all objects created
   DEFAULT
                 in the tablespace creation
                 makes the tablespace unavailable immediately after creation
   OFFLINE
                 specifies that the tablespace can be used to hold permanent
   PERMANENT
                 objects
                 specifies that the tablespace be used only to hold temporary
   TEMPORARY
                 objects; for example, segments used by implicit sorts caused
                 by an ORDER BY clause extent_management_clause
                 specifies how the extents of the tablespace are managed. This
                 clause is discussed in a subsequent section of this lesson.
datafile_clause :== filename
[SIZE integer[K|M] [REUSE] | REUSE ] [ autoextend_clause ]

where: is the name of a data file in the tablespace

       filename
                                specifies the size of the file. Use K or M to
       SIZE
                                specify the size in kilobytes or megabytes.
                                allows the Oracle server to reuse an existing file
       REUSE
                                enables or disables the automatic extension of
       autoextend_clause
                                the data file. This clause is discussed in a
                                subsequent section of this lesson.

Alterar un Tablespace

Alterar el tamaño de un tablespace

ALTER DATABASE DATAFILE '/mi/tablespace/datafile.dbf' RESIZE 300M;

Alterar el tamaño máximo

alter database datafile 'mi/tablespace.dbf' autoextend on maxsize 1000M

Añadir un datafile a un tablespace

alter tablespace MI_TABLESPACE add datafile '/path/del/datafile.dbf' size 2048M  AUTOEXTEND ON NEXT 50M MAXSIZE 4096M;

Borrar un Tablespace

   DROP TABLESPACE tablespace_name [INCLUDING CONTENTS [AND DATAFILES]
      [CASCADE CONSTRAINTS]];
 
ora/tablespace0.txt · Última modificación: 2009/07/21 16:35 por juantxu
 
Excepto donde se indique lo contrario, el contenido de esta wiki se autoriza bajo la siguiente licencia:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki