1

My Background is MySQL/PhpMyAdmin and there I can create easily new database by entering the name in Phpmyadmin, But I'm facing problem to creating database in Oracle SQL Developer... I already connected HR_ORACLE default database and test the connection. But I don't know how to create new database?

1 Answer 1

3

You usually only have one database (=instance) in Oracle. A database in Oracle is something completely different than a database in MySQL. Actually MySQL calls databases "schemas" and that's what they are best mapped to in Oracle.

To create a new schema in Oracle, you create a new user. Those two things are more or less the same (there are some subtle differences, but as you are a beginner just assume that it's the same for now).

To create a new user, you need to connect as a privileged user (typically SYSTEM or SYS) and run the CREATE USER command.

I don't use SQL Developer but I think it has some DBA tools built-in that can probably help you with that. Just seach for "user management" or something similar. You do not want to create a new database if you have Oracle up and running.

Further reading:

Edit (as you seem to be confused about the new user):

Each user can (by default) only access the tables that were created under that user (the ones that user owns). So if you create a second user NEWBIE and log in with that user, you won't be able to access the tables of the user (schema) HR_ORACLE. If you create a new table as NEWBIE that table is created in the schema NEWBIE and is owned by the user NEWBIE. The user HR_ORACLE can not access the tables owned by NEWBIE (unless given the necessary grants)

Sign up to request clarification or add additional context in comments.

7 Comments

Good answer, but "one database (=instance)" ... sucks-teeth
@DavidAldridge: what's wrong with that? Having just one instance is pretty much what most people do. I rarely see multi-instance installations.
It's just not technically correct, is all, and it's something people get confused on without even realising it.
@DavidAldridge: hmm, are you saying that when you create a new database (through dbca) you do not create a new instance? (pluggable databases aside for now)
Well I suppose I am in a way. The instance is just the process and memory structures, so the instance is started separately anyway. It's not a big deal, I just think it's important not to conflate these separate and easily confused items.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.