oracle 数据库打不开

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6946586/
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-10 03:26:50  来源:igfitidea点击:

database not open

oracleoracle11gr2

提问by usermma

I am trying to create database using Oracle 11g R2 on windows 2008 server, when I run script to create database instance I will get the following error message

我正在尝试在 Windows 2008 服务器上使用 Oracle 11g R2 创建数据库,当我运行脚本来创建数据库实例时,我将收到以下错误消息

ERROR at line 1: ORA-01109: database not open

ERROR at line 1: ORA-01109: database not open

grant select on ALL_MVIEW_DETAIL_PARTITION to public with grant option *

grant select on ALL_MVIEW_DETAIL_PARTITION to public with grant option *

ERROR at line 1: ORA-01109: database not open

ERROR at line 1: ORA-01109: database not open

logged on as administrator.`

以管理员身份登录。`

Thanks, usermma

谢谢,usermma

回答by Ankam Shyamsundar

Login to Oracle with root

使用 root 登录到 Oracle

su - oracle
sqlplus / as sysdba
create user username identified by password;
Exception : ORA-01109 Database not open

To resolve this i trie below steps and succesfully created the schema.

为了解决这个问题,我尝试了以下步骤并成功创建了架构。

  1. Please verify the ORA_HOMEPATH/dbs/sgadef.dbf
  2. Make ensure that after shutting down the Oracle server,if you find any services running on machine by entering below command

    ps -ef | grep ora_ | grep DBName(sid)
    
  3. Kill the processes if you find any by using kill command

    kill -9 PID
    
  4. Please check below file exists in mentioned path; if not please create.

    ORACLE_HOMEPATH/dbs/lk<sid>
    
  5. start mount;If the server is started use close immediate

    SQL> alter database close;
    
    Database altered.
    
    SQL> shutdown immediate
    ORA-01109: database not open
    
    Database dismounted.
    ORACLE instance shut down
    
    SQL> startup mount
    ORACLE instance started.
    
    Total System Global Area  126951228 bytes
    Fixed Size                   454460 bytes
    Variable Size             109051904 bytes
    Database Buffers           16777216 bytes
    Redo Buffers                 667648 bytes
    Database mounted.
    
    SQL> select open_mode from v$database;
    
    OPEN_MODE
    ----------
    MOUNTED
    
    SQL> alter database open;
    
    Database altered.
    
  6. Now you can create your own schema as the database is open

    SQL> create user schemaname identified by password;
    
    SQL> grant resource,connect to schema name;
    
    grant permission succeded.
    
  1. 请验证 ORA_HOMEPATH/dbs/sgadef.dbf
  2. 确保在关闭 Oracle 服务器后,如果您通过输入以下命令发现机器上正在运行任何服务

    ps -ef | grep ora_ | grep DBName(sid)
    
  3. 如果发现任何进程,请使用 kill 命令终止进程

    kill -9 PID
    
  4. 请检查以下文件是否存在于上述路径中;如果没有,请创建。

    ORACLE_HOMEPATH/dbs/lk<sid>
    
  5. start mount;如果服务器已启动,请立即关闭

    SQL> alter database close;
    
    Database altered.
    
    SQL> shutdown immediate
    ORA-01109: database not open
    
    Database dismounted.
    ORACLE instance shut down
    
    SQL> startup mount
    ORACLE instance started.
    
    Total System Global Area  126951228 bytes
    Fixed Size                   454460 bytes
    Variable Size             109051904 bytes
    Database Buffers           16777216 bytes
    Redo Buffers                 667648 bytes
    Database mounted.
    
    SQL> select open_mode from v$database;
    
    OPEN_MODE
    ----------
    MOUNTED
    
    SQL> alter database open;
    
    Database altered.
    
  6. 现在您可以在数据库打开时创建自己的架构

    SQL> create user schemaname identified by password;
    
    SQL> grant resource,connect to schema name;
    
    grant permission succeded.
    

I have done above steps to create a schema when database is not open.

我已经完成了上述步骤来在数据库未打开时创建架构。

回答by MADHAIYAN M

Execute below Commands Sequentially....

依次执行以下命令....

> sqlplus 

username/password = sys/*******

用户名/密码 = sys/*******

SQL> shutdown immediate;
SQL> startup mount;
SQL> recover database;
SQL> alter database open;

回答by DCookie

How did you create the script(s)? What does it do? Is there some reason you're not using the Database Configuration Assistant to do this? It may be simply a matter of not having the service for the instance created via oradim.

您是如何创建脚本的?它有什么作用?是否有某些原因您不使用数据库配置助手来执行此操作?可能只是没有为通过以下方式创建的实例提供服务的问题oradim.