ITPub博客

首页 > 数据库 > Oracle > [转载]修改数据库名(不用ORACLE的工具)

[转载]修改数据库名(不用ORACLE的工具)

原创 Oracle 作者:love2008 时间:2007-04-13 00:16:48 0 删除 编辑

在网上有这篇文章,我就写在自己BLOG上,留个记录

(此文章我还没有测试过)

http://www.manning-sandbox.com/thread.jspa?threadID=1690&tstart=120

[@more@]

Step 1. First of all, it is a good idea to backup the database.

Step 2. Once you have backed up the datbaase, you can then dump
the controlfile to trace. Issue the ALTER DATABASE BACKUP
CONTROLFILE TO TRACE statement.

Step 3. Shutdown the Database.

Step 4. Edit the INIT.ORA file or CONFIG.OR
Change the DB_NAME to the new DATABASE NAME:
- DB_NAME =

Step 5. Edit CONTROL.FILE (trace file)
- Remove all lines from the control file preceding the STARTUP
NOMOUNT command (these are comments/header info etc).
- Change the "CREATE CONTROLFILE" statement from
CREATE CONTROLFILE REUSE DATABASE "ORCL" NORESETLOGS NOARCHIVELOG
TO
CREATE CONTROLFILE REUSE SET DATABASE "PROD" RESETLOGS NOARCHIVELOG
(Here we have :
- Added the word "SET" before the DATABASE
- Changed the DB name from ORCL(Source) TO PROD(Target)
- Changed NORESETLOGS to RESETLOGS
- Also remove all lines after the CREATE CONTROLFILE statement.
- Save control file to dbname.sql to any other name.


Step 6. STARTUP DATABASE
Now connect to the database using internal and run the
control file saved as dbname.sql. This should startup
the instance and create new control files. After that
reset the logs by issuing the ALTER DATABASE command.

SVRMGR> connect internal
Connected to an idle instance.
SVRMGR> @dbname
Statement processed.
SVRMGR> ALTER DATABASE OPEN RESETLOGS;
Statement processed.
SVRMGR>

Step 7. BACKUP THE DATABASE.
Now shutdown the database and take a backup.

Step 8. Startup the new DBNAME database.

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

上一篇: 修改归档方式
请登录后发表评论 登录
全部评论

注册时间:2007-12-10

  • 博文量
    78
  • 访问量
    1128395