14

I Am using oracle 11g and SQL developer tool. When i tried to retrieve rows from db i am getting error message as :-

ORA-01219: database not open: queries allowed on fixed tables/views only)

I looked for sgadef.dbf file and it was missing in home directory.. Can someone help me to make it working.

Srini V
  • 11,045
  • 14
  • 66
  • 89
Devoloper250
  • 753
  • 2
  • 8
  • 12
  • Why are you looking for that particular file, and why in your home directory? What does the alert log say is wrong? – Alex Poole Apr 08 '14 at 15:00

4 Answers4

29

First of all check the status of the instance you work with (this may need to connect under administrator account):

select status from v$instance;

Probably you will get

STATUS
------------
MOUNTED

Under sys account try to complete

ALTER DATABASE OPEN;

and check that it's completed successfuly. If not - please share the result of output and alert log in your question.

Srini V
  • 11,045
  • 14
  • 66
  • 89
Dmitry Nikiforov
  • 2,988
  • 13
  • 12
  • 2
    I get the following error by running the command "ALTER DATABASE OPEN;", Error is - "ERROR at line 1: ORA-00600: internal error code, arguments: [kcratr_nab_less_than_odr], [1], [22], [117], [119], [], [], [], [], [], [], []" in sqlplus. what can I do??? – parita porwal Nov 23 '16 at 11:48
6

just in case if someone comes to here for this question

RECOVER DATABASE; and then ALTER DATABASE OPEN;

fixed my issue.

nalpara
  • 131
  • 4
  • 11
4

If the problem is related to a pluggable database then you can do the following:

  1. Check the status of the PDB
> SELECT name, open_mode FROM v$pdbs ORDER BY name;

NAME      OPEN_MODE
-------------------
ORCLPDB   MOUNTED
  1. Change the status to OPEN if it is not (like MOUNTED for example)

ALTER PLUGGABLE DATABASE orclpdb OPEN READ WRITE;

Marcell
  • 809
  • 8
  • 23
  • this throws out this error : `code`ERROR at line 1: ORA-65054: Cannot open a pluggable database in the desired mode.`code` – Amine Hammou Apr 07 '21 at 02:43
  • @AmineHammou Have you checked the status of the PDB beforehand (step #1)? What is the status? – Marcell Apr 07 '21 at 07:30
1

SQL>

ALTER DATABASE OPEN;
ALTER DATABASE OPEN *

ERROR at line 1:
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: 'C:\APP\ADMINISTRATOR\ORADATA\WIND\SYSTEM01.DBF'
Roy G
  • 901
  • 10
  • 25
S. Rahul
  • 41
  • 2