View Feed
group-icon
Coffee Room
Discuss anything here - everything that you wish to discuss with fellow engineers.
12796 Members
Join this group to post and comment.

creating a database in sql

Hi,

Once I have logged in to the SQL server, I am supposed to create my own database. Then this database is to contain tables etc. pertaining to my project. Right.

The problem is that once I log in to my SQL server, I am not able to create my database.

When I try to create my own database using CREATE DATABASE db_name; I get the message that the database is already mounted.

Though I am able to perform my work (by creating tables, writing queries etc.), I am not able to create a database where I can put related tables in one separate space. I am working on two projects simultaneously, and all the tables seem to be there in one location (as I am not able to create separate databases for the two projects).
@Neeraj Sharma Tagging the DB guy
Manish Goyal
Manish Goyal • Aug 4, 2015
ask your db admin if you have rights to create new database
Aashish Joshi
Aashish Joshi • Aug 8, 2015
You may get this error if you're trying to create a new database when you have another one already mounted. The DB in use needs to be unmounted first before you can create a new DB.

If you're using Oracle try the following steps and see if you're able to create a database:

1. First log in using Sqlplus. Open command prompt or terminal and enter the following command:

sqlplus /nolog
2. Sign in as a user that has create database privilege. For example, if you have the sysdba privilege you an use this to sign in:
connect username as sysdba
3. If the database is already running then you'll need to shut it down first:
shutdown normal
4. Now start the database without mounting it:
startup nomount
Now you should be able to create a new database.

Note: If you use Oracle's free eXpress Edition DB additional steps are required before you can create more than 1 database.

Share this content on your social channels -