6

I've just installed Oracle 11g and linked it to SQL Developer.

I want to create a database for my django install.

CREATE database 'django';

Error starting at line 1 in command:
create database 'django'
Error at Command Line:1 Column:0
Error report:
SQL Error: ORA-01501: CREATE DATABASE failed
ORA-01100: database already mounted
01501. 00000 -  "CREATE DATABASE failed"
*Cause:    An error occurred during create database
*Action:   See accompanying errors.

(I have also tried without the '')

Why isn't this working?

Is there another way I'm meant to create databases?

0

3 Answers 3

6

One of the key differences between these platforms is that a database in MySQL is a schema in Oracle. Since a schema in Oracle is also a user, the command you are looking for is CREATE USER. I highly recommend that you read the Oracle Concepts Guide before continuing. You may also find this documentation on MySQL>>Oracle migrations using SQL Developer useful. Here is the part relevant to your situation:

When migrating MySQL databases to Oracle, SQL Developer maps each MySQL database to a tablespace in Oracle. Database objects, such as tables, indexes and views are stored in the respective tablespaces and are referenced from the Oracle schema for the user that owns them.

From the error message perspective, the salient part to pull out is "ORA-01100: database already mounted". This indicates that a database has already been created and mounted. It may also be open. Here is an example reproducing your issue, opening the database (which may not be necessary if it is already open) and creating a django user.

SQL> create database django;
create database django
*
ERROR at line 1:
ORA-01501: CREATE DATABASE failed
ORA-01100: database already mounted


SQL> SELECT status FROM v$instance;

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

SQL> ALTER DATABASE OPEN;

Database altered.

SQL> SELECT status FROM v$instance;

STATUS
------------
OPEN

SQL> create database django;
create database django
*
ERROR at line 1:
ORA-01501: CREATE DATABASE failed
ORA-01100: database already mounted


SQL> CREATE USER django IDENTIFIED BY "No More ORA-001100.";

User created.

You should also assign permissions and create a django tablespace setting it as the default tablespace for django.

0
4

It is not so easy to create the database on the command line. Look here for the description: http://download.oracle.com/docs/cd/E11882_01/server.112/e17120/create003.htm#CIAEJDBE

For beginners, it is much easier to create the Database with the DBCA (Database Configuration Assistant).

2
  • Thanks, but I can't find DBCA on Oracle 11g Express (Windows). Any ideas where I can download it?
    – A T
    Sep 21, 2011 at 14:15
  • You should always mention your Database edition & version. I have rarely encountered an Express Edition, but I think there is no DBCA available. Your Database gets created during the Software Installation already there.
    – Uwe Hesse
    Sep 21, 2011 at 15:24
0

As of my personal expereince, i think you should have instanlled Oracle Express Edition and not the Oracle Entrpise Edition. In the case of Oracle Express Edition we cannot create new database since we have default database XE is already in place.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.