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).

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Vishal Sharma

    @vishal-pysGmK • Aug 3, 2015

    #-Link-Snipped-# Tagging the DB guy

  • Manish Goyal

    @manish-r2Hoep • Aug 3, 2015

    ask your db admin if you have rights to create new database

  • Aashish Joshi

    @aashish-VrevFC • Aug 7, 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.