ORACLE 10G
REDHAT 5.3 64BIT
错误原因:
通过DBNEWID 工具修改DBID
[@more@]由于通过RMAN的recover新建备用库后需要将新库的DBID进行修改,但是按照正常的操作运行到修改DBID的时候居然报错,错误内容如下:
[oracle@qqdb bk]$ nid target=sys/sys123@back
DBNEWID: Release 10.2.0.1.0 - Production on Fri Dec 3 16:43:29 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to database BACK (DBID=4055002079)
NID-00135: There are 1 active threads
Change of database ID failed during validation - database is intact.
DBNEWID - Completed with validation errors.
通过检查各个环节发现没有什么异常:
[oracle@qqdb bk]$ ps -ef|grep -u oracle
oracle 2650 1 0 15:47 ? 00:00:01 /u01/app/10.2.1/db_1/bin/tnslsnr LISTENER -inherit
root 3334 3295 0 15:53 pts/0 00:00:00 su - oracle
oracle 3335 3334 0 15:53 pts/0 00:00:00 -bash
root 3407 3376 0 15:54 pts/1 00:00:00 su - oracle
oracle 3408 3407 0 15:54 pts/1 00:00:01 -bash
oracle 3733 3335 0 16:26 pts/0 00:00:00 sqlplus as sysdba
oracle 3736 1 0 16:26 ? 00:00:00 ora_pmon_back
oracle 3738 1 0 16:26 ? 00:00:00 ora_psp0_back
oracle 3740 1 0 16:26 ? 00:00:00 ora_mman_back
oracle 3742 1 0 16:26 ? 00:00:00 ora_dbw0_back
oracle 3744 1 0 16:26 ? 00:00:00 ora_lgwr_back
oracle 3746 1 0 16:26 ? 00:00:01 ora_ckpt_back
oracle 3748 1 0 16:27 ? 00:00:00 ora_smon_back
oracle 3750 1 0 16:27 ? 00:00:00 ora_reco_back
oracle 3752 1 0 16:27 ? 00:00:00 ora_mmon_back
oracle 3754 1 0 16:27 ? 00:00:00 ora_mmnl_back
oracle 3830 3408 0 16:43 pts/1 00:00:00 ps -ef
oracle 3831 3408 0 16:43 pts/1 00:00:00 grep -u oracle
SQL> startup mount;
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 2019320 bytes
Variable Size 113246216 bytes
Database Buffers 50331648 bytes
Redo Buffers 2174976 bytes
Database mounted.
SQL> select status from v$instance;
STATUS
------------
MOUNTED
SQL>
最后的解决方案:
原来在使用DBNEWID工具的时候首先要保证
1、数据库处于mount状态
2、数据库处于归档状态
SQL> archive log list;3、归档目录必须存在
[oracle@qqdb bk]$ cd /u01/app/10.2.1/db_1/dbs/arch
-bash: cd: /u01/app/10.2.1/db_1/dbs/arch: No such file or directory
4、数据文件必须处于online状态
FILE# STATUS NAME
---------- ------- ----------------------------------------
1 SYSTEM /u01/oradata/back/system01.dbf
2 ONLINE /u01/oradata/back/undotbs01.dbf
3 ONLINE /u01/oradata/back/sysaux01.dbf
4 ONLINE /u01/oradata/back/users01.dbf
5 ONLINE /u01/oradata/back/test_tran01.dbf
很明显在我的环境中第三个要素没有满足,也就是归档目录不存在。
下面指定一个存在的归档目录:
[oracle@qqdb rman]$ pwd
/u02/rman
SQL> alter system set log_archive_dest_1='location=/u02/rman';
System altered.
SQL> alter database open;
Database altered.
SQL> alter system archive log current;
System altered.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 2019320 bytes
Variable Size 113246216 bytes
Database Buffers 50331648 bytes
Redo Buffers 2174976 bytes
Database mounted.
然后重新执行,问题才得以解决:
[oracle@qqdb bk]$ nid target=sys/sys123@back
DBNEWID: Release 10.2.0.1.0 - Production on Fri Dec 3 16:50:30 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to database BACK (DBID=4055002079)
NID-00121: Database should not be open
Change of database ID failed during validation - database is intact.
DBNEWID - Completed with validation errors.
[oracle@qqdb bk]$ nid target=sys/sys123@back
DBNEWID: Release 10.2.0.1.0 - Production on Fri Dec 3 16:51:14 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to database BACK (DBID=4055002079)
Connected to server version 10.2.0
Control Files in database:
/u01/oradata/back/control01.ctl
/u01/oradata/back/control02.ctl
/u01/oradata/back/control03.ctl
Change database ID of database BACK? (Y/[N]) => y
Proceeding with operation
Changing database ID from 4055002079 to 4055580995
Control File /u01/oradata/back/control01.ctl - modified
Control File /u01/oradata/back/control02.ctl - modified
Control File /u01/oradata/back/control03.ctl - modified
Datafile /u01/oradata/back/system01.dbf - dbid changed
Datafile /u01/oradata/back/undotbs01.dbf - dbid changed
Datafile /u01/oradata/back/sysaux01.dbf - dbid changed
Datafile /u01/oradata/back/users01.dbf - dbid changed
Datafile /u01/oradata/back/temp01.dbf - dbid changed
Control File /u01/oradata/back/control01.ctl - dbid changed
Control File /u01/oradata/back/control02.ctl - dbid changed
Control File /u01/oradata/back/control03.ctl - dbid changed
Instance shut down
Database ID for database BACK changed to 4055580995.
All previous backups and archived redo logs for this database are unusable.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database ID.
DBNEWID - Completed succesfully.
[oracle@qqdb bk]$
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10130206/viewspace-1042560/ ,如需转载,请注明出处,否则将追究法律责任。