Creating a new database in oracle using cmd

To create a new database in Oracle using the Command Prompt (Cmd), you'll need to follow these steps:

Prerequisites:

  1. Oracle Database software installed on your machine.
  2. Oracle Database Configuration Assistant (DBCA) installed and configured.
  3. You have the necessary permissions to create a new database.

Step 1: Open the Command Prompt

  1. Press the Windows key + R to open the Run dialog box.
  2. Type cmd and press Enter to open the Command Prompt.

Step 2: Navigate to the Oracle Home Directory

  1. In the Command Prompt, navigate to the Oracle Home directory by typing the following command and pressing Enter:

    cd %ORACLE_HOME%

    Replace %ORACLE_HOME% with the actual path to your Oracle Home directory. For example:

    cd C:\oracle\product\12.2.0\dbhome_1

    Step 3: Run the Database Creation Script

  2. Run the following command to create a new database:

    dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname ORCL -sid ORCL -password <password>

    Replace <password> with the password you want to use for the database.

Here's a breakdown of the options used:

Step 4: Wait for the Database Creation to Complete

  1. The DBCA will create the new database and configure it according to the specified template. This process may take several minutes to complete.

Step 5: Verify the Database Creation

  1. Once the database creation is complete, you can verify that the database has been created by running the following command:
    sqlplus / as sysdba

    This will connect you to the database as the SYS user. You can then run queries to verify that the database has been created successfully.

That's it! You have now created a new database in Oracle using the Command Prompt.