| « | 十月 2008 | » | ||||
|---|---|---|---|---|---|---|
| 一 | 二 | 三 | 四 | 五 | 六 | 日 |
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | 31 | ||
最近做了一个rac数据库的迁移,中间涉及到很多部分内容,包括rac环境的搭建、ASM的设置、数据库的迁移、升级等。
本文是这次迁移工作的第七部分:后续工作。
为了与正式系统区分,需要修改还原过来的数据库名称。在rac中修改db_name的步骤与单实例步骤差不多,主要是要修改一些与cluster相关的参数。停止所有实例,然后把其中一个实例启动到mount状态下:SQL> startup mountORACLE instance started.Total System Global Area 1476395008 bytesFixed Size 2030200 bytesVariable Size 268436872 bytesDatabase Buffers 1191182336 bytesRedo Buffers 14745600 bytesDatabase mounted.SQL> alter system set cluster_database=false scope=spfile;System altered.SQL> shutdown immediateORA-01109: database not openDatabase dismounted.ORACLE instance shut down.SQL> startup mountORACLE instance started.Total System Global Area 1476395008 bytesFixed Size 2030200 bytesVariable Size 268436872 bytesDatabase Buffers 1191182336 bytesRedo Buffers 14745600 bytesDatabase mounted.SQL> exitbash-3.00$ nid target=sys/testpass dbname=pretrade logfile=~/nid2.log重新把cluster_database设置为true,并把db_name参数修改为新的名称:bash-3.00$ sqlplus "/as sysdba"SQL*Plus: Release 10.2.0.3.0 - Production on 星期四 9月 27 23:04:19 2007
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.Connected to an idle instance.SQL> startup mountORACLE instance started.Total System Global Area 1476395008 bytesFixed Size 2030200 bytesVariable Size 268436872 bytesDatabase Buffers 1191182336 bytesRedo Buffers 14745600 bytesORA-01103: database name 'PRETRADE' in control file is not 'TRADEDB'SQL> alter system set db_name=pretrade scope=spfile;System altered.SQL> alter system set cluster_database=true scope=spfile;System altered.SQL> shutdown immediateORA-01109: database not openDatabase dismounted.ORACLE instance shut down.SQL> startup mountORACLE instance started.Total System Global Area 1476395008 bytesFixed Size 2030200 bytesVariable Size 268436872 bytesDatabase Buffers 1191182336 bytesRedo Buffers 14745600 bytesDatabase mounted.最后在打开的时候open resetlogs即可。SQL> alter database open resetlogs;