Oracle 11g XE 安装不起作用。“创建控制文件失败”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23968230/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 02:22:31  来源:igfitidea点击:

Oracle 11g XE installation not working. "Create CONTROLFILE failed"

oracleoracle11g

提问by Mandeep Singh

I installed Oracle 11g XE on my Windows computer (running on Windows XP Pro), but unfortunately, can't get it to work. There are no errors that the GUI installer shows up during the installation and I get the "installed successfully" message, but when I try to connect to Oracle using the SQL command prompt, I get the following error:

我在我的 Windows 计算机上安装了 Oracle 11g XE(在 Windows XP Pro 上运行),但不幸的是,无法让它工作。GUI 安装程序在安装过程中没有出现任何错误,并且我收到“安装成功”消息,但是当我尝试使用 SQL 命令提示符连接到 Oracle 时,我收到以下错误:

SQL> connect
Enter user-name: system
Enter password:
ERROR:
ORA-01033: ORACLE initialization or shutdown in progress
Process ID: 0
Session ID: 0 Serial number: 0

The 'Get Started' shortcut icon takes me to :

“开始使用”快捷方式图标将我带到:

http://127.0.0.1:8080/apex/f?p=4950

which gives me an "Unable to Connect" message

这给了我一个“无法连接”的消息

After having spent 2 days doing research on this, I found out that apart from this being a Listener issue, my 'oradata\XE'folder located at: E:\oraclexe\app\oracle\oradata\XEis empty. I think it should have contained the control files etc.

在花了 2 天的时间对此进行研究后,我发现除了这是一个侦听器问题之外,我的'oradata\XE'文件夹位于:E:\oraclex\app\oracle\oradata\XE空的。我认为它应该包含控制文件等。

There are some errors related to creation of control files etc. reported in the log files located at : E:\oraclexe\app\oracle\product\11.2.0\server\config\logand am pasting them here ->

在位于以下位置的日志文件中报告了一些与创建控制文件等相关的错误:E:\oraclex\app\oracle\product\11.2.0\server\config\log并将它们粘贴到这里 ->

cloneDBCreation.log

克隆数据库创建日志

SQL> Create controlfile reuse set database "XE"
  2  MAXINSTANCES 8
  3  MAXLOGHISTORY 1
  4  MAXLOGFILES 16
  5  MAXLOGMEMBERS 3
  6  MAXDATAFILES 100
  7  Datafile
  8  'E:\oraclexe\app\oracle\oradata\XE\system.dbf',
  9  'E:\oraclexe\app\oracle\oradata\XE\undotbs1.dbf',
 10  'E:\oraclexe\app\oracle\oradata\XE\sysaux.dbf',
 11  'E:\oraclexe\app\oracle\oradata\XE\users.dbf'
 12  LOGFILE
 13  GROUP 1 SIZE 51200K,
 14  GROUP 2 SIZE 51200K,
 15  RESETLOGS;
Create controlfile reuse set database "XE"
*
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed 
ORA-01565: error in identifying file 
'E:\oraclexe\app\oracle\oradata\XE\system.dbf' 
ORA-27041: unable to open file 
OSD-04002: unable to open file 
O/S-Error: (OS 2) The system cannot find the file specified. 


SQL> exec dbms_backup_restore.zerodbid(0);
BEGIN dbms_backup_restore.zerodbid(0); END;

*
ERROR at line 1:
ORA-00210: cannot open the specified control file 
ORA-06512: at "SYS.X$DBMS_BACKUP_RESTORE", line 4754 
ORA-06512: at line 1 


SQL> shutdown immediate;
ORA-01507: database not mounted 


ORACLE instance shut down.
SQL> startup nomount pfile="E:\oraclexe\app\oracle\product.2.0\server\config\scripts\initXETemp.ora";
ORACLE instance started.

Total System Global Area  535662592 bytes                                       
Fixed Size                  1384760 bytes                                       
Variable Size             226496200 bytes                                       
Database Buffers          301989888 bytes                                       
Redo Buffers                5791744 bytes                                       
SQL> Create controlfile reuse set database "XE"
  2  MAXINSTANCES 8
  3  MAXLOGHISTORY 1
  4  MAXLOGFILES 16
  5  MAXLOGMEMBERS 3
  6  MAXDATAFILES 100
  7  Datafile
  8  'E:\oraclexe\app\oracle\oradata\XE\system.dbf',
  9  'E:\oraclexe\app\oracle\oradata\XE\undotbs1.dbf',
 10  'E:\oraclexe\app\oracle\oradata\XE\sysaux.dbf',
 11  'E:\oraclexe\app\oracle\oradata\XE\users.dbf'
 12  LOGFILE
 13  GROUP 1 SIZE 51200K,
 14  GROUP 2 SIZE 51200K,
 15  RESETLOGS;
Create controlfile reuse set database "XE"
*
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed 
ORA-01565: error in identifying file 
'E:\oraclexe\app\oracle\oradata\XE\system.dbf' 
ORA-27041: unable to open file 
OSD-04002: unable to open file 
O/S-Error: (OS 2) The system cannot find the file specified. 


SQL> alter system enable restricted session;

System altered.

SQL> alter database "XE" open resetlogs;
alter database "XE" open resetlogs
*
ERROR at line 1:
ORA-01507: database not mounted 


SQL> alter database rename global_name to "XE";
alter database rename global_name to "XE"
                                     *
ERROR at line 1:
ORA-01109: database not open 


SQL> alter system switch logfile;
alter system switch logfile
*
ERROR at line 1:
ORA-01109: database not open 


SQL> alter system checkpoint;
alter system checkpoint
*
ERROR at line 1:
ORA-01109: database not open 


SQL> alter database drop logfile group 3;
alter database drop logfile group 3
*
ERROR at line 1:
ORA-01507: database not mounted 


SQL> ALTER TABLESPACE TEMP ADD TEMPFILE 'E:\oraclexe\app\oracle\oradata\XE\temp.dbf' SIZE 20480K REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED;
ALTER TABLESPACE TEMP ADD TEMPFILE 'E:\oraclexe\app\oracle\oradata\XE\temp.dbf' SIZE 20480K REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED
*
ERROR at line 1:
ORA-01109: database not open 


SQL> select tablespace_name from dba_tablespaces where tablespace_name='USERS';
select tablespace_name from dba_tablespaces where tablespace_name='USERS'
                            *
ERROR at line 1:
ORA-01219: database not open: queries allowed on fixed tables/views only 


SQL> select sid, program, serial#, username from v$session;

       SID PROGRAM                                                              
---------- ----------------------------------------------------------------     
   SERIAL# USERNAME                                                             
---------- ------------------------------                                       
         1 ORACLE.EXE (PMON)                                                    
         1                                                                      

         2 ORACLE.EXE (VKTM)                                                    
         1                                                                      

         3 ORACLE.EXE (DIAG)                                                    
         1                                                                      


       SID PROGRAM                                                              
---------- ----------------------------------------------------------------     
   SERIAL# USERNAME                                                             
---------- ------------------------------                                       
         4 ORACLE.EXE (DIA0)                                                    
         1                                                                      

         5 ORACLE.EXE (DBW0)                                                    
         1                                                                      

         6 ORACLE.EXE (RECO)                                                    
         1                                                                      


       SID PROGRAM                                                              
---------- ----------------------------------------------------------------     
   SERIAL# USERNAME                                                             
---------- ------------------------------                                       
         8 ORACLE.EXE (CKPT)                                                    
         1                                                                      

         9 sqlplus.exe                                                          
         3 SYS                                                                  

        10 ORACLE.EXE (MMNL)                                                    
         5                                                                      


       SID PROGRAM                                                              
---------- ----------------------------------------------------------------     
   SERIAL# USERNAME                                                             
---------- ------------------------------                                       
        88 ORACLE.EXE (PSP0)                                                    
         1                                                                      

        89 ORACLE.EXE (GEN0)                                                    
         1                                                                      

        90 ORACLE.EXE (DBRM)                                                    
         1                                                                      


       SID PROGRAM                                                              
---------- ----------------------------------------------------------------     
   SERIAL# USERNAME                                                             
---------- ------------------------------                                       
        91 ORACLE.EXE (MMAN)                                                    
         1                                                                      

        92 ORACLE.EXE (LGWR)                                                    
         1                                                                      

        93 ORACLE.EXE (SMON)                                                    
         1                                                                      


15 rows selected.

SQL> alter user sys identified by "&&sysPassword";
alter user sys identified by "tiger"
                             *
ERROR at line 1:
ORA-01109: database not open 


SQL> alter user system identified by "&&systemPassword";
alter user system identified by "tiger"
                                *
ERROR at line 1:
ORA-01109: database not open 


SQL> alter system disable restricted session;

System altered.

SQL> @E:\oraclexe\app\oracle\product.2.0\server\config\scripts\postScripts.sql
SQL> connect "SYS"/"&&sysPassword" as SYSDBA
Connected.
SQL> set echo on
SQL> spool E:\oraclexe\app\oracle\product.2.0\server\config\log\postScripts.log

CloneRmanRestore.log

CloneRmanRestore.log

SQL> startup nomount pfile="E:\oraclexe\app\oracle\product.2.0\server\config\scripts\init.ora";
ORACLE instance started.

Total System Global Area  535662592 bytes                                       
Fixed Size                  1384760 bytes                                       
Variable Size             226496200 bytes                                       
Database Buffers          301989888 bytes                                       
Redo Buffers                5791744 bytes                                       
SQL> @E:\oraclexe\app\oracle\product.2.0\server\config\scripts\rmanRestoreDatafiles.sql;
SQL> set echo off;

TO_CHAR(SYSTIMEST                                                               
-----------------                                                               
20140530 06:00:59                                                               

Allocating device....                                                           
Specifying datafiles...                                                         
Specifing datafiles...                                                          
Restoring ...                                                                   
declare
*
ERROR at line 1:
ORA-19624: operation failed, retry possible 
ORA-19870: error while restoring backup piece 
E:\ORACLEXE\APP\ORACLE\PRODUCT.2.0\SERVER\CONFIG\SEEDDB\EXPRESS.DFB 
ORA-19504: failed to create file "E:\ORACLEXE\APP\ORACLE\ORADATA\XE\SYSTEM.DBF" 
ORA-27044: unable to write the header block of file 
OSD-04008: WriteFile() failure, unable to write to file 
O/S-Error: (OS 112) There is not enough space on the disk. 
ORA-06512: at "SYS.X$DBMS_BACKUP_RESTORE", line 5827 
ORA-06512: at line 16 



TO_CHAR(SYSTIMEST                                                               
-----------------                                                               
20140530 06:01:02                                                               

Connected.
SQL> spool E:\oraclexe\app\oracle\product.2.0\server\config\log\cloneDBCreation.log

postDBCreation.log

后DBCreation.log

SQL> connect "SYS"/"&&sysPassword" as SYSDBA
Connected.
SQL> set echo on
SQL> //create or replace directory DB_BACKUPS as 'E:\oraclexe\app\oracle\fast_recovery_area';
SP2-0103: Nothing in SQL buffer to run.
SQL> begin
  2     dbms_xdb.sethttpport('8080');
  3     dbms_xdb.setftpport('0');
  4  end;
  5  /
   dbms_xdb.sethttpport('8080');
   *
ERROR at line 2:
ORA-06550: line 2, column 4: 
PLS-00201: identifier 'DBMS_XDB.SETHTTPPORT' must be declared 
ORA-06550: line 2, column 4: 
PL/SQL: Statement ignored 
ORA-06550: line 3, column 4: 
PLS-00201: identifier 'DBMS_XDB.SETFTPPORT' must be declared 
ORA-06550: line 3, column 4: 
PL/SQL: Statement ignored 


SQL> create spfile='E:\oraclexe\app\oracle\product.2.0\server\dbs/spfileXE.ora' FROM pfile='E:\oraclexe\app\oracle\product.2.0\server\config\scripts\init.ora';

File created.

SQL> shutdown immediate;
ORA-01507: database not mounted 


ORACLE instance shut down.
SQL> connect "SYS"/"&&sysPassword" as SYSDBA
Connected to an idle instance.
SQL> startup ;
ORACLE instance started.

Total System Global Area  535662592 bytes                                       
Fixed Size                  1384760 bytes                                       
Variable Size             226496200 bytes                                       
Database Buffers          301989888 bytes                                       
Redo Buffers                5791744 bytes                                       
ORA-00205: error in identifying control file, check alert log for more info 


SQL> select 'utl_recomp_begin: ' || to_char(sysdate, 'HH:MI:SS') from dual;

'UTL_RECOMP_BEGIN:'||TO_CH                                                      
--------------------------                                                      
utl_recomp_begin: 06:01:55                                                      

SQL> execute utl_recomp.recomp_serial();
BEGIN utl_recomp.recomp_serial(); END;

      *
ERROR at line 1:
ORA-06550: line 1, column 7: 
PLS-00201: identifier 'UTL_RECOMP.RECOMP_SERIAL' must be declared 
ORA-06550: line 1, column 7: 
PL/SQL: Statement ignored 


SQL> select 'utl_recomp_end: ' || to_char(sysdate, 'HH:MI:SS') from dual;

'UTL_RECOMP_END:'||TO_CH                                                        
------------------------                                                        
utl_recomp_end: 06:01:55                                                        

SQL> alter user hr password expire account lock;
alter user hr password expire account lock
*
ERROR at line 1:
ORA-01109: database not open 


SQL> alter user ctxsys password expire account lock;
alter user ctxsys password expire account lock
*
ERROR at line 1:
ORA-01109: database not open 


SQL> alter user outln password expire account lock;
alter user outln password expire account lock
*
ERROR at line 1:
ORA-01109: database not open 


SQL> alter user MDSYS password expire;
alter user MDSYS password expire
*
ERROR at line 1:
ORA-01109: database not open 


SQL> @E:\oraclexe\app\oracle\product.2.0\server\apex\apxxepwd.sql "&1"
SQL> Rem  Copyright (c) Oracle Corporation 1999 - 2006. All Rights Reserved.
SQL> Rem
SQL> Rem    NAME
SQL> Rem      apxxepwd.sql
SQL> Rem
SQL> Rem    DESCRIPTION
SQL> Rem      Changes the password for the INTERNAL ADMIN user
SQL> Rem
SQL> Rem    NOTES
SQL> Rem      Assumes the SYS user is connected.
SQL> Rem
SQL> Rem    REQUIRENTS
SQL> Rem      - Oracle 10g
SQL> Rem
SQL> Rem
SQL> Rem    MODIFIED   (MM/DD/YYYY)
SQL> Rem      jstraub   08/01/2006 - Created
SQL> Rem      jkallman  09/29/2006 - Adjusted current_schema to FLOWS_030000
SQL> Rem      jkallman  08/02/2007 - Change FLOWS_030000 references to FLOWS_030100
SQL> Rem      jkallman  07/08/2008 - Change FLOWS_030100 references to FLOWS_040000
SQL> Rem      jkallman  10/02/2008 - Change FLOWS_040000 references to APEX_040000
SQL> 
SQL> Rem
SQL> 
SQL> set define '&'
SQL> 
SQL> set verify off
SQL> 
SQL> alter session set current_schema = APEX_040000;
ERROR:
ORA-01435: user does not exist 


SQL> 
SQL> prompt ...changing password for ADMIN
...changing password for ADMIN
SQL> 
SQL> begin
  2  
  3      wwv_flow_security.g_security_group_id := 10;
  4      wwv_flow_security.g_user := 'ADMIN';
  5      wwv_flow_security.g_import_in_progress := true;
  6  
  7      for c1 in (select user_id
  8               from wwv_flow_fnd_user
  9              where security_group_id = wwv_flow_security.g_security_group_id
 10                and user_name = wwv_flow_security.g_user) loop
 11  
 12          wwv_flow_fnd_user_api.edit_fnd_user(
 13          p_user_id   => c1.user_id,
 14          p_user_name     => wwv_flow_security.g_user,
 15          p_web_password  => '&1',
 16          p_new_password  => '&1');
 17      end loop;
 18  
 19      wwv_flow_security.g_import_in_progress := false;
 20  
 21  end;
 22  /
    wwv_flow_security.g_security_group_id := 10;
    *
ERROR at line 3:
ORA-06550: line 3, column 5: 
PLS-00201: identifier 'WWV_FLOW_SECURITY.G_SECURITY_GROUP_ID' must be declared 
ORA-06550: line 3, column 5: 
PL/SQL: Statement ignored 
ORA-06550: line 4, column 5: 
PLS-00201: identifier 'WWV_FLOW_SECURITY.G_USER' must be declared 
ORA-06550: line 4, column 5: 
PL/SQL: Statement ignored 
ORA-06550: line 5, column 5: 
PLS-00201: identifier 'WWV_FLOW_SECURITY.G_IMPORT_IN_PROGRESS' must be declared 
ORA-06550: line 5, column 5: 
PL/SQL: Statement ignored 
ORA-06550: line 8, column 23: 
PL/SQL: ORA-01219: database not open: queries allowed on fixed tables/views 
only 
ORA-06550: line 7, column 16: 
PL/SQL: SQL Statement ignored 
ORA-06550: line 13, column 32: 
PLS-00364: loop index variable 'C1' use is invalid 
ORA-06550: line 12, column 9: 
PL/SQL: Statement ignored 
ORA-06550: line 19, column 5: 
PLS-00201: identifier 'WWV_FLOW_SECURITY.G_IMPORT_IN_PROGRESS' must be declared 
ORA-06550: line 19, column 5: 
PL/SQL: Statement ignored 


SQL> commit;

Commit complete.

SQL> spool off;

XE.bat.log

XE.bat.log

Instance created.

I have not pasted the contents of the postScripts.logas it was causing the body of this question to exceed the allowed limit of characters.

我没有粘贴postScripts.log的内容,因为它导致这个问题的正文超出了允许的字符限制。

As suggested in some articles/posts on the internet, I tried connecting to Oracle as sysdba to view the control_file parameter. This is what I got:

正如互联网上的一些文章/帖子所建议的那样,我尝试以 sysdba 身份连接到 Oracle 以查看 control_file 参数。这是我得到的:

SQL> connect / as sysdba
Connected.

SQL> show parameter control_files

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_files                        string      E:\ORACLEXE\APP\ORACLE\ORADATA
                                                 \XE\CONTROL.DBF

I am sorry for posting all the information from the log files, but I thought it might be necessary.

我很抱歉发布日志文件中的所有信息,但我认为这可能是必要的。

Also, pls be aware of the following:

另外,请注意以下事项:

  • I am logged in as a User which is a part of the Administrators group.
  • I am using a dual boot system, so my Windows XP is installed on drive E:
  • I have used the GUI installer only and did not meddle in the installation process
  • 我以属于管理员组的用户身份登录。
  • 我使用的是双引导系统,所以我的 Windows XP 安装在驱动器 E 上:
  • 我只使用了 GUI 安装程序,并没有干预安装过程

Can some Oracle expert please help ? What is wrong with the installation and how do I get it to work ? I have tried reinstalling it several times, but am stuck with the same issues.

可以请一些 Oracle 专家帮忙吗?安装有什么问题,我该如何让它工作?我曾多次尝试重新安装它,但还是遇到了同样的问题。

回答by takeiteasybrah

This helped me with a similar issue.

这帮助我解决了类似的问题。

  1. Uninstall OracleXE.
  2. Go to services and check to see if there are any services that start with Oracle.
  3. Manually remove any existing Oracle services by opening an administrator command prompt and typing in the command sc delete servicename (e.g., sc delete OracleServiceXE).
  4. Go to your environment variables and set your Oracle_home to the appropriate location (e.g., c:\oraclexe\app\product\11.2.0\server) and add the appropriate string to the beginning of the PATH variable (e.g., c:\oraclexe\app\product\11.2.0\server\bin).
  5. Reinstall OracleXE.
  1. 卸载 OracleXE。
  2. 进入services,查看是否有以Oracle开头的服务。
  3. 通过打开管理员命令提示符并输入命令 sc delete servicename(例如,sc delete OracleServiceXE)手动删除任何现有的 Oracle 服务。
  4. 转到您的环境变量并将 Oracle_home 设置为适当的位置(例如,c:\oraclex\app\product\11.2.0\server)并将适当的字符串添加到 PATH 变量的开头(例如,c:\oraclex \app\product\11.2.0\server\bin)。
  5. 重新安装 OracleXE。

回答by Daniel Nor

i had this problem too, just reinstall with run as administrator solve the problems and create databases

我也有这个问题,只需以管理员身份运行重新安装即可解决问题并创建数据库

回答by Harish

I faced the same problem:

我遇到了同样的问题:

Enter user-name: system
Enter password:
ERROR:
ORA-01033: ORACLE initialization or shutdown in progress
Process ID: 0
Session ID: 0 Serial number: 0

输入用户名:system
输入密码:
ERROR:
ORA-01033:ORACLE 正在初始化或关闭
进程 ID:0
会话 ID:0 序列号:0

After reading the above conversation I realized that I am unableto create any file in "E:\oraclexe\app\oracle\oradata\XE".

阅读上述对话后,我意识到我无法在“E:\oraclex\app\oracle\oradata\XE”中创建任何文件。

I can only create folders because it is Read-only. I finally uninstalled, created a folder in F drive and re-installed in it. This solved my problem and now I'm connected.

我只能创建文件夹,因为它是只读的。我终于卸载了,在F盘中创建了一个文件夹并重新安装在其中。这解决了我的问题,现在我已经连接上了。

回答by miracle173

The key is the error in CloneRmanRestore.logduring the installation

关键是安装过程中CloneRmanRestore.log中的错误

ERROR at line 1:
ORA-19624: operation failed, retry possible 
ORA-19870: error while restoring backup piece 
E:\ORACLEXE\APP\ORACLE\PRODUCT.2.0\SERVER\CONFIG\SEEDDB\EXPRESS.DFB 
ORA-19504: failed to create file "E:\ORACLEXE\APP\ORACLE\ORADATA\XE\SYSTEM.DBF" 
ORA-27044: unable to write the header block of file 
OSD-04008: WriteFile() failure, unable to write to file 
O/S-Error: (OS 112) There is not enough space on the disk. 
ORA-06512: at "SYS.X$DBMS_BACKUP_RESTORE", line 5827 
ORA-06512: at line 16 

Oracle wants create a database by restoring it from the files that are delivered with the OracleExpressEdition. But it cannot write the files to "E:\ORACLEXE\APP\ORACLE\ORADATA\XE\SYSTEM.DBF". The error message is

Oracle 希望通过从随 OracleExpressEdition 提供的文件中恢复数据库来创建数据库。但它不能将文件写入“E:\ORACLEXE\APP\ORACLE\ORADATA\XE\SYSTEM.DBF”。错误信息是

There is not enough space on the disk

This may be true, or as other user already wrote, this may mean that you don't have the privilege to write to this location. All other error messages are caused by this problem, because Oracle couldn't create the database. I will skip the details her.

这可能是真的,或者因为其他用户已经写过,这可能意味着您没有写入该位置的权限。所有其他错误消息都是由这个问题引起的,因为 Oracle 无法创建数据库。我会跳过她的细节。

Check if you are able to write to this location, e.g. copy a file to this location. If you can't copy then resolve the problem and retry the installation. As other user pointed out this may be a problem of privileges. You always should do the installation with admin privileges.

检查您是否能够写入此位置,例如将文件复制到此位置。如果您无法复制,请解决问题并重试安装。正如其他用户指出的那样,这可能是权限问题。您应该始终使用管理员权限进行安装。