ITPub博客

首页 > 应用开发 > IT综合 > Rename Tablespace

Rename Tablespace

原创 IT综合 作者:pentium 时间:2011-03-23 21:02:05 0 删除 编辑

Oracle10g Rename Tablespace

Another great new feature in tablespace management is rename tablespace.

Tablespace Rename Overview

In Oracle 10g, you can simply rename a tablespace TBS01 to TBS02 by issuing the following command:

ALTER TABLESPACE tbs01 RENAME TO tbs02;


[@more@]

However, you must follow the rules when renaming a tablespace:

  • You must set compatibility level to at least 10.0.1.
  • You cannot rename the SYSTEM or SYSAUX tablespaces.
  • You cannot rename an offline tablespace.
  • You cannot rename a tablespace that contains offline datafiles.
  • Renaming a tablespace does not changes its tablespace identifier.
  • Renaming a tablespace does not change the name of its datafiles.

Tablespace Rename Benefits

Tablespace rename provides the following benefits:

  • It simplifies the process of tablespace migration within a database.
  • It simplifies the process of transporting a tablespace between two databases.

Examples

Example 1: Rename a tablespace within a database. In Oracle9i or earlier releases, you must take the following steps to rename a tablespace from OLD_TBS to NEW_TBS:

  1. Create a new tablespace NEW_TBS.
  2. Copy all objects from OLD_TBS to NEW_TBS.
  3. Drop tablespace OLD_TBS.

In Oracle 10g, you can accomplish the same thing in one step and rename tablespace OLD_TBS to NEW_TBS.

ALTER TABLESPACE old_tbs RENAME TO new_tbs;

Example 2: Transport a tablespace between two databases. In the following example (see figure 3.2), you cannot transport a tablespace TBS01 from database A to database B in the previous release of Oracle server because database B also has a tablespace called TBS01. In Oracle 10g, you can simply rename TBS01 to TBS02 in database B before transporting tablespace TBS01.

Oracle Tips by Burleson

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/14377/viewspace-1047642/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: RMAN 备份
请登录后发表评论 登录
全部评论

注册时间:2010-09-30

  • 博文量
    191
  • 访问量
    327263