Some basic concepts:
A tablespace can belong to only one database at a time;
In addition to the SYSTEM tablespace or the tablespace with active rollback segments, other tablespaces can be taken offline;
Table space can be switched between read/write and read-only statuses;
A data file can belong to only one tablespace;
Segments cannot span tablespaces, But segments can span multiple data files belonging to the same tablespace;
A zone may not span data files; it must exist in a data file;
For Oracle, tablespaces are mainly divided into system and other non-system tablespaces, or into important and unimportant tablespaces, how can I store my business data in the XXX tablespace? But oracle does, because the database can run as long as the system tablespace exists.
Some commands:
Create a tablespace
Create tablespace mytb1 datafile '/u01/oradata/mytb01.dfb 'size 10 m autoextend on next 5 m maxsize 1024 M;
Create tablespace mytb1 datafile '/u01/oradata/mytb01.dfb' SIZE 10 m autoextend on next 5 m maxsize unlimited;
Create tablespace mytb1 datafile '/u01/oracle/9i/oradata/gt9i/mytb01.dbf' size 10 m autoextend off, '/u01/oracle/9i/oradata/gt9i/mytb02.dbf' size 10 m autoextend off;
Create temporary tablespace mytbtmp1 TEMPFILE '/u01/oradata/mytbtmp1.dfb 'size 10 m autoextend on next 5 m maxsize 10240 M;
CREATE undo TABLESPACE mytbtmp1 TEMPFILE '/u01/oradata/mytbtmp1.dfb 'size 10 m autoextend on next 5 m maxsize 10240 M;
About temporary tablespace
Cannot set read-only
Cannot rename
Always nologging
Not backed up
Not restored
Offline tablespace
Alter tablespace mytb1 offline; -- note that there are four options. The default value is normal, TEMPORARY | IMMEDIATE | for recover.
Bring tablespaces online
Alter tablespace mytb1 online;
Read-Only tablespace
Alter tablespace mytb1 read only;
Read and Write tablespaces
Alter tablespace mytb1 read write;
Add data files
Alter tablespace mytb1 add datafile '/u01/oracle/9i/oradata/gt9i/mytb01.dbf' size 10 m;
Resize data files
Alter tablespace mytb1 datafile '/u01/oracle/9i/oradata/gt9i/mytb01.dbf' resize 10 m;
Move data files
Alter tablespace mytb1 rename datafile '/u01/oracle/9i/oradata/gt9i/mytb01.dbf' to '/u01/oracle/9i/oradata/gt9i/mytb02.dbf ';
Database-level mobile data files
Alter database rename file '/u01/oracle/9i/oradata/gt9i/mytb01.dbf' to '/u01/oracle/9i/oradata/gt9i/mytb02.dbf ';
Delete a tablespace
Drop tablespace mytb1 including contents and datafiles;
Drop tablespace mytb1 including contents cascade constraints;
-The End-
For more information about Oracle, see Oracle topics page http://www.bkjia.com/topicnews.aspx? Tid = 12