Home   My Faqts   Contributors   About   Help   Link to FAQTS  

faqts : Computers : Databases : Oracle

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

3 of 4 people (75%) answered Yes
Recently 3 of 4 people (75%) answered Yes

Entry

How do I create database in oracle using PL/SQL ?

Apr 15th, 2008 08:23
Taksh Verdhan, Deepak Sharma, Steven Luu,


Refer to the following scripts:
1) Creating the Database Install Script
Create a script file called makedb.sql in the $ORACLE_HOME/dbs 
directory:
    connect internal
    startup nomount
    set echo on
    spool makedb.log
    create database orcl
            maxinstances 1
            maxlogfiles  8
            datafile '$ORACLE_HOME/dbs/orcl_syst_01.dbf' size 40M reuse
            logfile
                    '$ORACLE_HOME/dbs/orcl_redo_01.dbf' size 1M reuse,
                    '$ORACLE_HOME/dbs/orcl_redo_02.dbf' size 1M reuse,
                    '$ORACLE_HOME/dbs/orcl_redo_03.dbf' size 1M reuse;
    @$ORACLE_HOME/rdbms/admin/catalog.sql
    create tablespace rollback
            datafile '$ORACLE_HOME/dbs/orcl_roll_01.dbf' size 8.5M 
reuse;
    create tablespace temp
            datafile '$ORACLE_HOME/dbs/orcl_temp_01.dbf' size 5M reuse 
            temporary;
    create tablespace users
            datafile '$ORACLE_HOME/dbs/orcl_user_01.dbf' size 10M reuse;
    create rollback segment r1 tablespace rollback
            storage ( optimal 5M );
    alter rollback segment r1 online;
    connect system/manager
    @$ORACLE_HOME/rdbms/admin/catdbsyn.sql
    connect internal
    @$ORACLE_HOME/rdbms/admin/catproc.sql
    connect system/manager
    @$ORACLE_HOME/sqlplus/admin/pupbld.sql
    spool off
    exit
2) Running the Database Installation Script
Start svrmgrl and run the script:
    $ cd $ORACLE_HOME/dbs
    $ svrmgrl
    Oracle Server Manager Release 2.3.3.0.0 - Production
    Copyright (c) Oracle Corporation 1994, 1995. All rights reserved.
    Oracle7 Server Release 7.3.3.0.0 - Production Release
    PL/SQL Release 2.3.3.0.0 - Production
    SVRMGR> connect internal
    Connected.
    SVRMGR> startup nomount
    ORACLE instance started.
    Total System Global Area       4313312 bytes
    Fixed Size                       41876 bytes
    Variable Size                  4140364 bytes
    Database Buffers                122880 bytes
    Redo Buffers                      8192 bytes
    SVRMGR> @makedb
    <loads of messages>
    SVRMGR> exit
    Server Manager complete.
Hope this helps
Deepak
http://www.blueappleonline.com http://www.seoenable.com
http://downloadwebscripts.blogspot.com/
http://aaatravel.blogspot.com/
http://trtraveltrailer.blogspot.com/
http://511-tactical.blogspot.com/
http://galcoholster.blogspot.com/
http://nokiaseries40themestudio22.blogspot.com/
http://ipodtouch7.blogspot.com/
http://autoaccessory.blogspot.com/
http://themesforsonyericssonw200i.blogspot.com/
http://nokiaseriesthemestudio22keygen.blogspot.com/
http://nokiaseries40themestudio22crac.blogspot.com/
http://nokian3themesandfunnyvideos.blogspot.com/
http://s40themestudio22serial.blogspot.com/
http://appleipod7.blogspot.com/
http://ipodaccessories7.blogspot.com/
http://nokian70gamesfreedownloads.blogspot.com/
http://mortgagecompanynewjersey.blogspot.com/
http://custom-pcs.blogspot.com/
http://freedownloadbollywoodmovies.blogspot.com/
http://shakirabeyonce.blogspot.com/
http://aishwaryarai7.blogspot.com/
http://1bollywoodmovie.blogspot.com/