新建控制文件,改数据库名db_name的方法:
1、先把原来的控制文件备份成文本文件格式(@ORACLE_BASE/admin/udump/目录下)
SQL>alter database backup controlfile to trace;
2、再把原来的控制文件重命名
$cd $ORADATA/testdb2/
$mv control01.ctl control01.ctl.old
$mv control01.ctl control02.ctl.old
$mv control01.ctl control03.ctl.old
3、创建新的控制文件的SQL,把db_name改掉
initnew_sid.ora里面db_name参数已经改成新名称testdb2
SQL>STARTUP NOMOUNT PFILE=$ORACLE_HOME/dbs/inittestdb2.ora
SQL>CREATE CONTROLFILE SET DATABASE "testdb2" RESETLOGS NOARCHIVELOG
MAXLOGFILES 32
MAXLOGMEMBERS 3
MAXDATAFILES 500
MAXINSTANCES 8
MAXLOGHISTORY 907
LOGFILE
GROUP 1 '/oradata/testdb2/redo01.log' SIZE 50M,
GROUP 2 '/oradata/testdb2/redo02.log' SIZE 50M,
GROUP 3 '/oradata/testdb2/redo03.log' SIZE 50M
DATAFILE
'/oradata/testdb2/system01.dbf',
'/oradata/testdb2/undotbs01.dbf',
'/oradata/testdb2/sysaux01.dbf',
'/oradata/testdb2/users01.dbf'
CHARACTER SET ZHS16GBK
;
SQL>ALTER DATABASE OPEN RESETLOGS;