利用nid工具修改db_name時hang住

2008081036發表於2014-07-01
問題描述:

在發出nid命令後,執行到最後,等待了很長時間都沒有執行完畢,如下:

[oracle@HQ-CICUTESTDB-01 bin]$ nid target=sys/oracle dbname=tpuktest

DBNEWID: Release 10.2.0.4.0 - Production on Mon Jun 30 08:09:43 2014

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

Connected to database CICUKNEW (DBID=1737794697)

Connected to server version 10.2.0

Control Files in database:
    /oradata/cicuknewtest/cicuknew/control01.ctl
    /oradata/cicuknewtest/cicuknew/control02.ctl
    /oradata/cicuknewtest/cicuknew/control03.ctl

Change database ID and database name CICUKNEW to TPUKTEST? (Y/[N]) => y

Proceeding with operation
Changing database ID from 1737794697 to 922964040
Changing database name from CICUKNEW to TPUKTEST
    Control File /oradata/cicuknewtest/cicuknew/control01.ctl - modified
    Control File /oradata/cicuknewtest/cicuknew/control02.ctl - modified
    Control File /oradata/cicuknewtest/cicuknew/control03.ctl - modified
    Datafile /oradata/cicuknewtest/cicuknew/system01.dbf - dbid changed, wrote new name
    Datafile /oradata/cicuknewtest/cicuknew/undotbs01.dbf - dbid changed, wrote new name
    Datafile /oradata/cicuknewtest/cicuknew/sysaux01.dbf - dbid changed, wrote new name
    Datafile /oradata/cicuknewtest/cicuknew/users01.dbf - dbid changed, wrote new name
    Datafile /oradata/cicuknewtest/cicuknew/tblspace_claim01.dbf - dbid changed, wrote new name
    Datafile /oradata/cicuknewtest/cicuknew/tblspace_claimidx01.dbf - dbid changed, wrote new name
    Datafile /oradata/cicuknewtest/cicuknew/TBLSPACE_CSMIG01.dbf - dbid changed, wrote new name
    Datafile /oradata/cicuknewtest/cicuknew/tblspace_oth01.dbf - dbid changed, wrote new name
    Datafile /oradata/cicuknewtest/cicuknew/tblspace_othidx01.dbf - dbid changed, wrote new name
    Datafile /oradata/cicuknewtest/cicuknew/tblspace_payment01.dbf - dbid changed, wrote new name
    Datafile /oradata/cicuknewtest/cicuknew/tblspace_paymentidx01.dbf - dbid changed, wrote new name
    Datafile /oradata/cicuknewtest/cicuknew/tblspace_prp01.dbf - dbid changed, wrote new name
    Datafile /oradata/cicuknewtest/cicuknew/tblspace_prpidx01.dbf - dbid changed, wrote new name
    Datafile /oradata/cicuknewtest/cicuknew/tblspace_reins01.dbf - dbid changed, wrote new name
    Datafile /oradata/cicuknewtest/cicuknew/tblspace_reinsidx01.dbf - dbid changed, wrote new name
    Datafile /oradata/cicuknewtest/cicuknew/tblspace_visa01.dbf - dbid changed, wrote new name
    Datafile /oradata/cicuknewtest/cicuknew/tblspace_visaidx01.dbf - dbid changed, wrote new name
    Datafile /oradata/cicuknewtest/cicuknew/temp01.dbf - dbid changed, wrote new name
    Control File /oradata/cicuknewtest/cicuknew/control01.ctl - dbid changed, wrote new name
    Control File /oradata/cicuknewtest/cicuknew/control02.ctl - dbid changed, wrote new name
    Control File /oradata/cicuknewtest/cicuknew/control03.ctl - dbid changed, wrote new name


然後在後臺檢視alert日誌,如下:

*** DBNEWID utility started ***
DBID will be changed from 1737794697 to new DBID of 922964040 for database CICUKNEW
DBNAME will be changed from CICUKNEW to new DBNAME of TPUKTEST
Starting datafile conversion
Setting recovery target incarnation to 1
Datafile conversion complete
Database name changed to TPUKTEST.
Modify parameter file and generate a new password file before restarting.
Database ID for database TPUKTEST changed to 922964040.
All previous backups and archived redo logs for this database are unusable.
Database has been shutdown, open with RESETLOGS option.
Succesfully changed database name and ID.
*** DBNEWID utility finished succesfully ***
Shutting down instance: further logons disabled
Mon Jun 30 08:57:37 2014
Shutting down instance (immediate)
License high water mark = 2
All dispatchers and shared servers shutdown
Mon Jun 30 09:02:38 2014
SHUTDOWN: Active processes prevent shutdown operation
Mon Jun 30 09:07:39 2014
SHUTDOWN: Active processes prevent shutdown operation

從日誌中可以看到,nid已經執行成功了,並且在後臺對資料庫執行了關庫,但是由於nid執行會話其實還是在執行沒有退出,所以提示 Active processes prevent shutdown operation。從官方文件來看,nid執行成功的提示應該是顯示在nid執行會話當中,然後手動關庫,而不是在後臺提示並且自動關庫。這就造成了類似死鎖的現象。


解決辦法:
Ctrl+C把nid執行會話停掉,並退出會話,資料庫便會停掉。

NID-00600: Internal Error - [28] [1013] [0] [0]

Change of database name and ID failed during validation - database is intact.
DBNEWID - Completed with validation errors.

雖然會提示上面的錯誤,但其實db_name已經成功轉換了。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25465866/viewspace-1201069/,如需轉載,請註明出處,否則將追究法律責任。

相關文章