SP2-0606: Cannot create SPOOL file - oracle

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

Related

Unable to create Oracle XE HR sample

I'm completely new to Oracle database and trying to follow steps in the 2 day guide: https://docs.oracle.com/en/database/oracle/oracle-database/21/tdddg/two-day-developer-intro.html
I downloaded an installed the XE database. I am trying to install the HR sample:
https://docs.oracle.com/en/database/oracle/oracle-database/21/comsc/installing-sample-schemas.html#GUID-CB945E4C-D08A-4B26-A12D-3D6D688467EA
However, the script failed. I've tried to narrow down the issue.
I logged in using sqlplus:
>sqlplus "/as sysdba"
and then tried to create a user:
SQL*Plus: Release 18.0.0.0.0 - Production on Tue Mar 16 00:05:06 2021
Version 18.4.0.0.0
Copyright (c) 1982, 2018, Oracle. All rights reserved.
SQL>CREATE USER hr identified by password;
ORA-65096: invalid common user or role name
after this error, I read on another form to try the following:
SQL> alter session set container = XEPDB1;
Session altered.
after the above command, I can create the user:
SQL> create user hr identified by password;
User created.
I also a sent the command:
SQL>GRANT CREATE SESSION TO hr;
Grant succeeded.
But when I try below, I get an error:
SQL>connect hr/password
ERROR:
ORA-01017: invalid username/password; logon denied
Warning: You are no longer connected to ORACLE.
Any ideas? I don't know what I need to do to connect as the hr user.
I was able to connect as follows:
sqlplus hr/password#//localhost:1521/XEPDB1

On startup of database it denies with error ORA-01078: failure in processing system parameters | LRM-00109: could not open parameter file?

SQL*Plus: Release 12.2.0.1.0 Production on Thu Jul 9 15:06:37 2020
Copyright (c) 1982, 2016, Oracle. All rights reserved.
SQL> conn sys#Databasename as sysdba
Enter password:
Connected to an idle instance.
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup nomount;
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file 'C:\APP\ADMINISTRATOR\VIRTUAL\PRODUCT\12.2.0\DBHOME_1\DATABASE\INITdatabasename.ORA'
SQL>
If I go to C:\APP\ADMINISTRATOR\VIRTUAL\PRODUCT\12.2.0\DBHOME_1\DATABASE\ There is no file with this name INITdatabasename.ORA
After search I found that I should create a pfile from spfile.
SQL> create pfile from spfile;
create pfile from spfile
*
ERROR at line 1:
ORA-01565: error in identifying file '?=\DATABASE\SPFILE%ORACLE_SID%.ORA'
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 5) Access is denied.
SPfile is available in database folder. But is unable to open. Please help.
You can specify spfile and pfile locations:
create pfile='path_to_pfile' from spfile='path_to_spfile';
Maybe you could try to restore it from backups if you have any.
Bellow you have a good guide:
https://www.thegeekstuff.com/2014/11/oracle-rman-restore/

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.

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

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

"insufficient privileges" error creating a new user

I have installed Oracle 11g on my PC. When I try to create a user in SQL*Plus I get an error:
SQL>create user scott identified by scott;
*
ERROR at Line 1:
ORA-01031:insufficient privilages
What am I doing wrong?

Resources