A.1 重命名空间命令
TablespaceRename Overview
In Oracle 10g, you can simply rename a tablespace TBS01 to TBS02by issuing the following command:
ALTER TABLESPACE tbs01 RENAME TO tbs02;
A.2 重命名空间限制
However, you must follow the rules whenrenaming a tablespace:
1) You must set compatibility level to at least 10.0.1.
2) You cannot rename the SYSTEM or SYSAUXtablespaces.
3) You cannot rename an offline tablespace.
4) You cannot rename a tablespace that containsoffline datafiles.
5) Renaming a tablespace does not changes itstablespace identifier.
6) Renaming a tablespace does not change the nameof its datafiles.
A.3 重命名空间使用场景
Tablespace Rename Benefits
Tablespace rename provides the followingbenefits:
1) It simplifies the process of tablespacemigration within a database.
2) It simplifies the process of transporting atablespace between two databases.
Examples
Example 1: Rename a tablespace within adatabase. In Oracle9i or earlier releases, you must take the following steps torename a tablespace from OLD_TBS to NEW_TBS:
Create a new tablespace NEW_TBS.
Copy all objects from OLD_TBS to NEW_TBS.
Drop tablespace OLD_TBS.
In Oracle 10g, you can accomplish the same thing in one step andrename tablespace OLD_TBS to NEW_TBS.
ALTER TABLESPACE old_tbs RENAME TO new_tbs;
Example 2: Transport a tablespace betweentwo databases. In the following example (see figure 3.2), you cannot transporta tablespace TBS01 from database A to database B in the previous release ofOracle server because database B also has a tablespace called TBS01. In Oracle 10g, you can simply rename TBS01 to TBS02 in database B before transportingtablespace TBS01.