SIGN UP MEMBER LOGIN:
   
ARTICLE

How to create database through the command in Oracle on the Linux.

Posted by Sapna Malik Articles | DB Administration February 16, 2011
We will Create new database through the command in Oracle on the Linux. We will create directories, pfile, spfile, password file, export command use, shut Immediate command, startup command etc.
Reader Level:

We can see this article step by step and create new database through the command in Oracle on the Linux. We will create directories, pfile, spfile, password file, export command use, shut Immediate command, startup command etc.

  1. First of all, we will create all required directories for dump directories.

    mkdir - p /u01/app/oracle/oradata/demo
    mkdir - p /u01/app/oracle/admin/demo/adump
    mkdir - p /u01/app/oracle/admin/demo/dpdump
    mkdir - p /u01/app/oracle/diag/bdump
    mkdir - p /u01/app/oracle/diag/udump
    mkdir -p /u01/app/oracle/diag/cdump

  2. We will create pfile:

    SQL> Create pfile from spfile;
            
    OR
    We will copy and past existing pfile.
    Rename that pfile according to your database.
    We will use replace option for change database name into pfile.


  3. We will create password file:

    $orapwd file=orapwddemo
    password=oracle
    entries=200 (This option we can add otherwise no because by default like infinity values)


  4. # export ORACLE_SID=demo

  5. # sqlplus

  6. SQL> /as sysdba

  7. SQL> Startup Nomount pfile='/dbs/initdemo.ora'
         O
    SQL> Create spfile from pfile;
    SQL> Startup Nomount;


  8. We will create datafile:

    SQL> Create database demo
    logfile group1('/u01/app/oracle/oradata/demo/redo1.log') size 30M,
    group2('/u01/app/oracle/oradata/demo/redo2.log') size 30M,
    datafile '/u01/app/oracle/oradata/demo/system.dbf') size 30M autoextent on
    sysaux datafile '/u01/app/oracle/oradata/demo/sysaux.dbf') size 30M autoextent on
    undo tablespace undotbs1 datafile '/u01/app/oracle/oradata/demo/ undotbs1.dbf') size 30M
    Default temporary tablespace temp tempfile '/u01/app/oracle/oradata/demo/ temp.dbf') size 30M


    After this command your database is completely create.

  9. Catalog and catproc file:

    SQL> @/u01/app/oracle/product/11.2.0/db_1/rdbms/admin/catalog.SQL
    SQL> @/u01/app/oracle/product/11.2.0/db_1/rdbms/admin/catproc.SQL


  10. SQL> Shut Immediate

  11. SQL> startup

Login to add your contents and source code to this article
This Feature is Sponsored By
post comment
COMMENT USING