[17:00:56ora10@rhel6_0 goldengate]>sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Sun Apr 29 17:01:33 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
idle> CREATE CONTROLFILE REUSE DATABASE "ORA10" RESETLOGS ARCHIVELOG
2 MAXLOGFILES 16
3 MAXLOGMEMBERS 3
4 MAXDATAFILES 100
5 MAXINSTANCES 8
6 MAXLOGHISTORY 292
7 LOGFILE
8 GROUP 1 '/data/ora10/oradata/ORA10/onlinelog/o1_mf_1_7dkgh8vs_.log' SIZE 50M,
9 GROUP 2 '/data/ora10/oradata/ORA10/onlinelog/o1_mf_2_7dkgho38_.log' SIZE 50M,
10 GROUP 3 '/data/ora10/oradata/ORA10/onlinelog/o1_mf_3_7dkgj0hl_.log' SIZE 50M
11 -- STANDBY LOGFILE
12 DATAFILE
13 '/data/ora10/oradata/ORA10/datafile/o1_mf_system_7dkgj97r_.dbf',
14 '/data/ora10/oradata/ORA10/datafile/o1_mf_undotbs1_7dkgkfd2_.dbf',
15 '/data/ora10/oradata/ORA10/datafile/o1_mf_sysaux_7dkgkyrn_.dbf',
16 '/data/ora10/oradata/ORA10/datafile/o1_mf_users_7dkgldxr_.dbf',
17 '/data/ora10/oradata/ORA10/datafile/wang.dbf',
18 '/data/oradata/ORA10/datafile/o1_mf_ggs_data_7gr5r1v5_.dbf'
19 CHARACTER SET ZHS16GBK
20 ;
CREATE CONTROLFILE REUSE DATABASE "ORA10" RESETLOGS ARCHIVELOG
*
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-01276: Cannot add file
/data/ora10/oradata/ORA10/controlfile/o1_mf_7dkgh89v_.ctl. File has an Oracle
Managed Files file name.
官方解释
[17:48:04ora10@rhel6_0 data]>oerr ora 01276
01276, 00000, "Cannot add file %s. File has an Oracle Managed Files file name."
// *Cause: An attempt was made to add to the database a datafile, log file,
// control file, snapshot control file, backup control file,
// datafile copy, control file copy or backuppiece with an Oracle
// Managed Files file name.
// *Action: Retry the operation with a new file name.
解决办法
修改控制文件的名字即可;
需要注意的是:由于控制文件创建脚本中只有日志文件和数据文件的名字,并且显然都使用了OMF方式命名,所以大家很可能误以为要去修改控制文件创建脚本中的这些文件名,但实际需要进行修改的是初始化参数文件中控制文件的名字,而不是控制文件创建脚本中的日志文件和数据文件的名字;我一开始就是去修改这些名字,结果问题依旧,最后是修改了参数文件中控制文件的名字【直接注释掉了控制文件的名字】,问题得以解决。
idle> show parameter spfile;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string /u01/app/oracle/product/10.2.0
/db_1/dbs/spfileora10.ora
发现当前使用的是spfile,先生成pfile,然后修改参数文件
idle> create pfile from spfile;
File created.
[17:28:50ora10@rhel6_0 goldengate]>cd /u01/app/oracle/product/10.2.0/db_1
[17:29:04ora10@rhel6_0 db_1]>cd dbs
[17:29:18ora10@rhel6_0 dbs]>vi initora10.ora
ora10.__db_cache_size=784334848
ora10.__java_pool_size=4194304
ora10.__large_pool_size=4194304
ora10.__shared_pool_size=251658240
ora10.__streams_pool_size=4194304
*.audit_file_dest='/u01/app/oracle/admin/ora10/adump'
*.background_dump_dest='/u01/app/oracle/admin/ora10/bdump'
*.compatible='10.2.0.5.0'
#*.control_files='/data/ora10/oradata/ORA10/controlfile/o1_mf_7dkgh89v_.ctl' --此处直接注释掉了control_files这个参数
*.core_dump_dest='/u01/app/oracle/admin/ora10/cdump'
*.db_block_size=8192
*.db_create_file_dest='/data/oradata'
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='ora10'
*.db_recovery_file_dest='/data/ora10/flash'
*.db_recovery_file_dest_size=2147483648
*.job_queue_processes=10
*.local_listener='LISTENER_ORA10'
*.log_checkpoints_to_alert=TRUE
*.open_cursors=300
*.pga_aggregate_target=351272960
*.processes=80
*.recovery_parallelism=4
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=93
*.sga_target=1054867456
*.sql_trace=FALSE
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u01/app/oracle/admin/ora10/udump'
~
[17:29:52ora10@rhel6_0 dbs]>sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Sun Apr 29 17:29:54 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
idle> startup nomount pfile=initora10.ora force
ORA-32006: SQL_TRACE initialization parameter has been deprecated
ORACLE instance started.
Total System Global Area 1056964608 bytes
Fixed Size 2101608 bytes
Variable Size 264244888 bytes
Database Buffers 784334848 bytes
Redo Buffers 6283264 bytes
idle> CREATE CONTROLFILE REUSE DATABASE "ORA10" RESETLOGS ARCHIVELOG
2 MAXLOGFILES 16
3 MAXLOGMEMBERS 3
4 MAXDATAFILES 100
5 MAXINSTANCES 8
6 MAXLOGHISTORY 292
7 LOGFILE
GROUP 1 '/data/ora10/oradata/ORA10/onlinelog/o1_mf_1_7dkgh8vs_.log' SIZE 50M,
GROUP 2 '/data/ora10/oradata/ORA10/onlinelog/o1_mf_2_7dkgho38_.log' SIZE 50M,
10 GROUP 3 '/data/ora10/oradata/ORA10/onlinelog/o1_mf_3_7dkgj0hl_.log' SIZE 50M
11 -- STANDBY LOGFILE
12 DATAFILE
13 '/data/ora10/oradata/ORA10/datafile/o1_mf_system_7dkgj97r_.dbf',
14 '/data/ora10/oradata/ORA10/datafile/o1_mf_undotbs1_7dkgkfd2_.dbf',
15 '/data/ora10/oradata/ORA10/datafile/o1_mf_sysaux_7dkgkyrn_.dbf',
16 '/data/ora10/oradata/ORA10/datafile/o1_mf_users_7dkgldxr_.dbf',
17 '/data/ora10/oradata/ORA10/datafile/wang.dbf',
18 '/data/ora10/oradata/ORA10/datafile/ggs_data.dbf'
19 CHARACTER SET ZHS16GBK
20 ;
Control file created.
问题解决