I have installed oracle 12c in my ubuntu. I use oracle through sqldeveloper and I can successfully connect to user sys
with my password. I want to be able to use all databases provided by oracle by default. When I try to connect with username hr
with the same password as in sys
I get error username not found.
select * from all_users
doesn't list user hr
. So I assume the user is not created at all.
I have installed oracle 12c in my ubuntu. I assume the user is not created at all.
You have created the 12c database as a container. Now you might be connecting to the container database while the sample schemas reside in the pluggable database.
Oracle 12c has introduced multi-tenant architecture. There are some mandatory post-installation steps. Please read Oracle 12c Post Installation Mandatory Steps.
The most common misunderstanding is about “SQLPLUS / AS SYSDBA
” usage.
Since we have checked the option to create a single CDB, the “SQLPLUS / AS SYSDBA
” command will always log into CDB. Usually developers used to unlock the “SCOTT/HR
” account directly after logging as SYSDBA
. But here is the trick :
“SCOTT,HR” and other sample schemas are in the PDB and not in the CDB. So, you need to login as sysdba
into PDB.
For example,
sqlplus SYS/password@PDBORCL AS SYSDBA
SQL> ALTER USER scott ACCOUNT UNLOCK IDENTIFIED BY tiger;
sqlplus scott/tiger@pdborcl
SQL> show user;
USER is "SCOTT"
UDPATE Seems OP has not installed the sample schemas. It could be done manually or via DBCA.
You need to run the hr_main.sql script. All scripts necessary to create the Human Resource (HR) schema reside in $ORACLE_HOME/demo/schema/human_resources
.
From documentation,
Installing the HR Schema
All scripts necessary to create the Human Resource (HR) schema reside in $ORACLE_HOME/demo/schema/human_resources.
You need to call only one script, hr_main.sql, to create all the objects and load the data
Running hr_main.sql accomplishes the following tasks:
- Removes any previously installed HR schema
- Creates user HR and grants the necessary privileges
- Connects as HR
- Calls the scripts that create and populate the schema objects
you should unlock the HR
user , connect to SQL and run this command
ALTER USER HR ACCOUNT UNLOCK IDENTIFIED BY password;
read more about it in the document
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With