ORA-01109: Database not open - I can't create a user account - oracle

I've recently installed Oracle 11g on an Ubuntu 12.04 machine.
I can't create a user; the following is the error I got
SQL> create user rachid identified by rachid;
create user rachid identified by rachid
*
ERROR at line 1:
ORA-01109: database not open
The instance is started :
SQL> select status from v$instance;
STATUS
------------------------------------
STARTED
Do you have any solution to overcome this issue ?

You can try to open it using
ALTER DATABASE OPEN
or you can try to shut it and start again and then try to create the user:
$ sqlplus sys/Change12345#orc01 as sysdba
SQL> shut immediate
SQL> startup

Related

Connect and create a local Oracle databse

I am new to Oracle. I had created a local Oracle database but I needed to drop it, so I dropped it using below commands.
sqlplus / as sysdba
SQL> shutdown immediate;
SQL> startup mount exclusive restrict
SQL> drop database;
Now I need to recreate local Oracle db so I tried below commands but I am getting errors now.
sqlplus / as sysdba
SQL> shutdown abort
SQL> startup
Getting errors on above command execution:
Also tried creating tablespace but getting below error:
Please help me.

ORA-12514 TNS:listener does not currently know of service requested in connect descriptor in oracle 11g

Already read all the question related to this error, but couldnt resolve the issue.
As of yesterday, the oracle SMALLWORLD service has stopped working and the error is
ORA-12514 TNS:listener does not currently know of service requested in connect descriptor
the following are the system information to better understand the situation:
LISTENER.ORA content :Listener.ora
TNSNAMES.ORA content :TNSNAMES.ORA
SQLNET.ORA content :SQLNET.ORA CONTENT
the following is the result of
LSNRCTL SERVICES
command.
LSNRCTL.SERVICES result
as you can see the service name ATTACHMENTDB is recognisable, but service SMALLWORLD is not.
while trying to logon with sysdba, the result is
ORA-01017 invalid user name/password; logon denied
while trying to logon with SYSTEM user, the result is
ORA-01034 : ORACLE not available
and
ORA-27101 : shared memory realm does not exist
below image, is the result of SQLPLUS /NOLOG command
SQLPLUS /NOLOG
i already tried stopping and starting the ORACLE services and the Listener in the SERVICES.MSC, but nothing worked.
i don't understand why ATTACHMENTDB service works but not the SMALLWORLD service.
any hint appreciated.
I have this problem in windows 10 and Oracle19C.
You should try the following ways and one of them may work for you.
Way-1: In windows: use this video: restart services OracleOraDB19Home1TNSListener then OracleServiceORCL.
Way-2: connect with system user password to sql plus as shown as:
Enter user-name: system/ as sysdba
Enter password: your_password
SQL> shutdown
SQL> startup nomount
SQL> alter system set db_recovery_file_dest_size=4G scope=both;
SQL> alter database mount;
SQL> alter database open;
And now check your problem fixed? If no set below code then check again.
SQL> alter system set local_listener='(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp) (HOST=127.0.0.1) (PORT=1521)))';
This work for me.

SP2-0606: Cannot create SPOOL file

I use Oracle 12c R2 on Windows 10 pro x64. I get sample script by
cd E:\github.com\oracle
git clone https://github.com/oracle/db-sample-schemas.git
in CMD
E:\github.com\oracle\db-sample-schemas\human_resources>sqlplus sys/summer as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Wed Jun 28 11:15:24 2017
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> #hr_main.sql
specify password for HR as parameter 1:
Enter value for 1: 123456
specify default tablespeace for HR as parameter 2:
Enter value for 2: hr_tablespace
specify temporary tablespace for HR as parameter 3:
Enter value for 3: hr_temp_tablespace
specify password for SYS as parameter 4:
Enter value for 4: summer
specify log path as parameter 5:
Enter value for 5: C:\vy\
specify connect string as parameter 6:
Enter value for 6: localhost:1521/orcl
SP2-0606: Cannot create SPOOL file "C:\vy\hr_main.log"
DROP USER hr CASCADE
*
ERROR at line 1:
ORA-01918: user 'HR' does not exist
CREATE USER hr IDENTIFIED BY 123456
*
ERROR at line 1:
ORA-65096: invalid common user or role name
ALTER USER hr DEFAULT TABLESPACE hr_tablespace
*
ERROR at line 1:
ORA-01918: user 'HR' does not exist
ALTER USER hr TEMPORARY TABLESPACE hr_temp_tablespace
*
ERROR at line 1:
ORA-01918: user 'HR' does not exist
GRANT CREATE SESSION, CREATE VIEW, ALTER SESSION, CREATE SEQUENCE TO hr
*
ERROR at line 1:
ORA-01917: user or role 'HR' does not exist
GRANT CREATE SYNONYM, CREATE DATABASE LINK, RESOURCE , UNLIMITED TABLESPACE TO hr
*
ERROR at line 1:
ORA-01917: user or role 'HR' does not exist
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
Warning: You are no longer connected to ORACLE.
SP2-0640: Not connected
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
SP2-0640: Not connected
SP2-0640: Not connected
SP2-0310: unable to open file "E:\github.com\oracle\db-sample-schemas\human_resources\human_resources\hr_cre.sql"
SP2-0310: unable to open file "E:\github.com\oracle\db-sample-schemas\human_resources\human_resources\hr_popul.sql"
SP2-0310: unable to open file "E:\github.com\oracle\db-sample-schemas\human_resources\human_resources\\hr_idx.sql"
SP2-0310: unable to open file "E:\github.com\oracle\db-sample-schemas\human_resources\human_resources\\hr_code.sql"
SP2-0310: unable to open file "E:\github.com\oracle\db-sample-schemas\human_resources\human_resources\\hr_comnt.sql"
SP2-0310: unable to open file "E:\github.com\oracle\db-sample-schemas\human_resources\human_resources\\hr_analz.sql"
not spooling currently
SQL>
How to fix these error:
SP2-0606: Cannot create SPOOL file
ORA-01918: user 'HR' does not exist
ORA-65096: invalid common user or role name
The easy ones first:
ORA-01918: user 'HR' does not exist
The script starts with a precautionary drop user statement. You haven't run the script before so there is no HR user to drop. Hence the message. You can ignore it.
ORA-65096: invalid common user or role name
You have given an invalid password: Enter value for 1: 123456. For whatever reasons Oracle passwords follow similar rules to object names, which means the password must start with a letter - unless it's wrapped in double-quotes.
Now this is a trickier issue:
SP2-0606: Cannot create SPOOL file
So, does directory C:\vy exist? Does your user have write access to it?
I had same issue.
You need create HR user before runnig "hr_main.sql". Follow next steps::
SQL> connect sys as sysdba
Enter password:
Connected.
SQL> create user HR identified by oracle;
User created.
SQL> #?/demo/schema/human_resources/hr_main.sql
and next step as in guide:
https://docs.oracle.com/database/121/COMSC/installation.htm#COMSC109

"ORA-01109 database did not open" error while configuring Oracle

I am currently having issues configuring Oracle DB 11g on Ubuntu 14.04. I have successfully installed Oracle but the problem comes when I start configuring it.
First it was a invalid listener issue, after some extensive searching I found out that I had to put my domain name on 127.0.0.1 which I did (my domain name also contains dashes). After I made those changes, I ran into another error:
ORA-01109 database not open
I have had no luck with this one. What causes the "database not open" error and how could I fix it?
Try
ALTER DATABASE OPEN
It should work I guess.
Or Give this a try
$ sqlplus sys/Change12345#orc01 as sysdba
SQL> shut immediate
SQL> startup
and check the status of the instance use
SQL> select status from v$instance;

oracle initialization or shutdown in progress error

While I am trying to connect to my Oracle 11g DB, I am getting error "ORA-01033: oracle initialization or shutdown in progress error". To resolve this I am following following steps:
SQL> connect / as sysdba
SQL> shutdown abort
SQL> startup nomount
SQL> alter database mount;
SQL> alter database open;
But when I am executing "alter database open" command, I am getting another error - ORA-00333: redo log read error block 15472 count 3189.
I found out that we can resetlogs to fix this so I tried
ALTER DATABASE OPEN RESETLOGS; -- it gives an error that we can use RESETLOGS only after incomplete database recovery.
I am seeking help to resolve this issue and to find out where I am going wrong.
Seems that your redo log file is corrupted. It's required to clear redo log.....
You can follow following steps for the same:
Assuming that your database is on mount state and login as a sys with sysdba privilege:
alter system set "_allow_resetlogs_corruption"=true scope=spfile;
shutdown immediate;
Again, login as a sys with sysdba privileges(i.e. sqlplus sys as sysdba)
startup mount;
alter database open resentlogs;
recover database until cancel; --Here, you need to press when it prompts to specify a log.
alter database open resetlogs;
startup;
alter system set "_allow_resetlogs_corruption"=false scope=spfile; --Reverting back and bouncing the db for applying the changes.
shutdown immedaite;
startup;
try this pls:
connect /no log
(((connect with SYS user))
shutdown immediate
((start service in windows services))
alter database open
recover database using(logfile)

Resources