设为首页 加入收藏

TOP

修改Oracle 10G数据库名和DBID(三)
2014-11-24 02:21:46 来源: 作者: 【 】 浏览:3
Tags:修改 Oracle 10G 数据库 DBID
with operation

Changing database ID from 4061806388 to 737391906

Changing database name from ORCL to ORCL2

Control File /u01/app/oradata/orcl/control01.ctl - modified

Control File /u01/app/oradata/orcl/control02.ctl - modified

Control File /u01/app/oradata/orcl/control03.ctl - modified

Datafile /u01/app/oradata/orcl/system01.dbf - dbid changed, wrote new name

Datafile /u01/app/oradata/orcl/undotbs01.dbf - dbid changed, wrote new name

Datafile /u01/app/oradata/orcl/sysaux01.dbf - dbid changed, wrote new name

Datafile /u01/app/oradata/orcl/users01.dbf - dbid changed, wrote new name

Datafile /u01/app/oradata/orcl/example01.dbf - dbid changed, wrote new name

Datafile /u01/app/oradata/orcl/rman01.dbf - dbid changed, wrote new name

Datafile /u01/app/oradata/orcl/sjb02.dbf - dbid changed, wrote new name

Datafile /u01/app/oradata/orcl/sjb01.dbf - dbid changed, wrote new name

Datafile /u01/app/oradata/orcl/t_drop01.dbf - dbid changed, wrote new name

Datafile /u01/app/oradata/orcl/undotbs201.dbf - dbid changed, wrote new name

Datafile /u01/app/oradata/orcl/temp01.dbf - dbid changed, wrote new name

Control File /u01/app/oradata/orcl/control01.ctl - dbid changed, wrote new name

Control File /u01/app/oradata/orcl/control02.ctl - dbid changed, wrote new name

Control File /u01/app/oradata/orcl/control03.ctl - dbid changed, wrote new name

Instance shut down

Database name changed to ORCL2.

Modify parameter file and generate a new password file before restarting.

Database ID for database ORCL2 changed to 737391906.

All previous backups and archived redo logs for this database are unusable.

Database is not aware of previous backups and archived logs in Recovery Area.

Database has been shutdown, open database with RESETLOGS option.

Succesfully changed database name and ID.

DBNEWID - Completed succesfully.

2.3 修改相关目录和文件

[oracle@rhel6 ~]$ mv /u01/app/oradata/orcl/ /u01/app/oradata/orcl2

[oracle@rhel6 ~]$ mv /u01/app/flash_recovery_area/ORCL/ /u01/app/flash_recovery_area/ORCL2

[oracle@rhel6 ~]$ mv /u01/app/admin/orcl/ /u01/app/admin/orcl2

[oracle@rhel6 ~]$ cd $ORACLE_HOME/dbs

[oracle@rhel6 dbs]$ mv initorcl.ora initorcl2.ora

[oracle@rhel6 dbs]$ mv spfileorcl.ora spfileorcl2.ora

[oracle@rhel6 dbs]$ mv orapworcl orapworcl2

[oracle@rhel6 dbs]$ sed -i 's/orcl/orcl2/g' initorcl2.ora

[oracle@rhel6 dbs]$ export ORACLE_SID=orcl2

2.4 将数据库启动到mount状态,修改控制文件中数据文件和日志文件的路径

[oracle@rhel6 ~]$ sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jul 15 17:05:39 2011

Copyright (c) 1982, 2005, Oracle. All rights reserved.

SQL> conn /as sysdba

Connected to an idle instance.

SQL> create spfile from pfile;

File created

SQL> startup mount

ORACLE instance started.

Total System Global Area 629145600 bytes

Fixed Size 2022824 bytes

Variable Size 218104408 bytes

Database Buffers 402653184 bytes

Redo Buffers 6365184 bytes

Database mounted.

SQL> alter database rename file '/u01/app/oradata/orcl/system01.dbf' to '/u01/app/oradata/orcl2/system01.dbf';

Database altered

SQL> alter database rename file '/u01/app/oradata/orcl/undotbs01.dbf' to '/u01/app/oradata/orcl2/undotbs01.dbf';

Database altered.

SQL

首页 上一页 1 2 3 4 下一页 尾页 3/4/4
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇设置Oracle 11Gr2 RAC的归档模式 下一篇批量导入TXT文件

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: