how to open a database in sqlplus which is already created

25,906

I assume you're getting an error such as ORA-01219: database not open: queries allowed on fixed tables/views only. In that case, the fix is to connect as SYS and execute 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

If you get an error ORA-01507: database not mounted when you run ALTER DATABASE OPEN, run ALTER DATABASE MOUNT before ALTER DATABASE OPEN.

There might a reason why the database isn't open and/or mounted. Perhaps it failed to open? In that case, ALTER DATABASE OPEN is likely to result in an error other than ORA-01507. If so, the folks on https://dba.stackexchange.com/ should be able to help you.

Share:
25,906
user2173592
Author by

user2173592

Updated on July 22, 2022

Comments

  • user2173592
    user2173592 almost 2 years

    In SQL*plus i can't open the databse which is already created in my computer....

    the error it shows that "the database is not yet open" and i want to know that in what command is suitable to open database.