修改数据库名称:
SQL> alter database backup controlfile to trace resetlogs;
在/u01/app/oracle/admin/qhfpcdb01/udump下找到刚创建的跟踪文件,并把REUSE修改为SET,同时修改数据库名称.
CREATE CONTROLFILE REUSE DATABASE "QHFPCDB01" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 200
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 (
'/u01/oradata/qhfpcdb01/redo01a.log',
'/u02/oradata/qhfpcdb01/redo01b.log',
'/u03/oradata/qhfpcdb01/redo01c.log'
) SIZE 100M,
GROUP 2 (
'/u01/oradata/qhfpcdb01/redo02a.log',
'/u02/oradata/qhfpcdb01/redo02b.log',
'/u03/oradata/qhfpcdb01/redo02c.log'
) SIZE 100M,
GROUP 3 (
'/u01/oradata/qhfpcdb01/redo03a.log',
'/u02/oradata/qhfpcdb01/redo03b.log',
'/u03/oradata/qhfpcdb01/redo03c.log'
) SIZE 100M
-- STANDBY LOGFILE
DATAFILE
'/u02/oradata/qhfpcdb01/system01.dbf',
'/u02/oradata/qhfpcdb01/undotbs01.dbf',
'/u02/oradata/qhfpcdb01/sysaux01.dbf',
'/u02/oradata/qhfpcdb01/users01.dbf',
'/u02/oradata/qhfpcdb01/tbs_swr01.dbf',
'/u02/oradata/qhfpcdb01/ndx_swr01.dbf'
CHARACTER SET ZHT16MSWIN950;
创建pfile文件
SQL> create pfile from spfile;
关闭数据库,并修改pfile中db_name及db_unique_name参数,
备份控制文件并删除之,若不删除会在后续创建控制文件时提示错误.
用修改后的pfile启动数据库:
SQL> startup nomount pfile='/u01/app/oracle/product/10.2.0/db_1/dbs/initqhfpcdb01.ora';
创建spfile:
SQL> create spfile from pfile;
使用修改后的trace文件创建控制文件:
SQL> @2.sql
Control file created.
使用RESETLOGS方式打开数据库.
SQL> alter database open RESETLOGS;
Database altered.
SQL> select name from v$database;
NAME
---------
QHFPCDB
修改完毕.
延伸阅读:Oracle数据库入门心得Oracle 系统表大全Oracle数据类型简介Oracle常用命令详解Oracle常见问题及解决方案