[英]how to open a database in sqlplus which is already created
在SQL * plus中,我无法打开计算机中已经创建的数据库。
该错误表明“数据库尚未打开”,我想知道哪种命令适合打开数据库。
我假设您收到诸如ORA-01219: database not open: queries allowed on fixed tables/views only
的错误ORA-01219: database not open: queries allowed on fixed tables/views only
。 在这种情况下,解决方法是以SYS
身份连接并执行ALTER DATABASE OPEN
:
C:\Users\Luke>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Sun Mar 17 10:31:40 2013
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
SQL> select count(*) from user_tables;
select count(*) from user_tables
*
ERROR at line 1:
ORA-01219: database not open: queries allowed on fixed tables/views only
SQL> alter database open;
Database altered.
SQL> select count(*) from user_tables;
COUNT(*)
----------
935
如果你得到一个错误ORA-01507: database not mounted
当您运行ALTER DATABASE OPEN
,运行ALTER DATABASE MOUNT
之前ALTER DATABASE OPEN
。
可能没有打开和/或挂载数据库的原因。 也许它无法打开? 在这种情况下, ALTER DATABASE OPEN
可能会导致错误,而不是ORA-01507
。 如果是这样, https: //dba.stackexchange.com/上的人们应该可以为您提供帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.