ITPub博客

首页 > 数据库 > 数据库开发技术 > How does one rename a database?

How does one rename a database?

原创 数据库开发技术 作者:tsinglee 时间:2007-10-28 15:44:19 0 删除 编辑

摘自Orafaq

Follow these steps to rename a database:

  1. Start by making a full database backup of your database (in case you need to restore if this procedure is not working).

  2. Execute this command from sqlplus while connected to 'SYS AS SYSDBA':
    ALTER DATABASE BACKUP CONTROLFILE TO TRACE RESETLOGS;

  3. Locate the latest dump file in your USER_DUMP_DEST directory (show parameter USER_DUMP_DEST) - rename it to something like dbrename.sql.

  4. Edit dbrename.sql, remove all headers and comments, and change the database's name. Also change "CREATE CONTROLFILE REUSE ..." to "CREATE CONTROLFILE SET ...".

  5. Shutdown the database (use SHUTDOWN NORMAL or IMMEDIATE, don't ABORT!) and run dbrename.sql.

  6. Rename the database's global name:

    ALTER DATABASE RENAME GLOBAL_NAME TO new_db_name;

[@more@]

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

请登录后发表评论 登录
全部评论
  • 博文量
    740
  • 访问量
    1930223