3

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

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

grant select on ALL_MVIEW_DETAIL_PARTITION to public with grant option *

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

以管理员身份登录。`

谢谢,用户

4

3 回答 3

4

使用 root 登录到 Oracle

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

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

  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;如果服务器已启动,请立即使用 close

    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.
    

当数据库未打开时,我已完成上述步骤来创建模式。

于 2012-04-14T10:08:33.877 回答
2

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

> sqlplus 

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

SQL> shutdown immediate;
SQL> startup mount;
SQL> recover database;
SQL> alter database open;
于 2015-11-19T08:23:51.200 回答
0

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.

于 2011-08-04T19:11:19.103 回答