Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create db script for windows

Status
Not open for further replies.

Thargy

Technical User
Nov 15, 2005
1,348
GB
I am under time pressure to produce a 'ready to rock and roll' db creation script for a windows environment.

Can anyone help fast?

Regards

Tharg

Grinding away at things Oracular
 
Hi Tharg. I have only one Windows Oracle database, but these were the creation scripts if they're any good to you:

Code:
CreateDB.sql

connect SYS/change_on_install as SYSDBA
set echo on
spool C:\oracle\ora92\assistants\dbca\logs\CreateDB.log
startup nomount pfile="C:\oracle\admin\name\scripts\init.ora";
CREATE DATABASE name
MAXINSTANCES 1
MAXLOGHISTORY 1
MAXLOGFILES 5
MAXLOGMEMBERS 3
MAXDATAFILES 100
DATAFILE 'C:\oracle\oradata\name\system01.dbf' SIZE 250M REUSE AUTOEXTEND ON NEXT  10240K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL
DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE 'C:\oracle\oradata\name\temp01.dbf' SIZE 40M REUSE AUTOEXTEND ON NEXT  640K MAXSIZE UNLIMITED
UNDO TABLESPACE "UNDOTBS1" DATAFILE 'C:\oracle\oradata\name\undotbs01.dbf' SIZE 200M REUSE AUTOEXTEND ON NEXT  5120K MAXSIZE UNLIMITED
CHARACTER SET WE8MSWIN1252
NATIONAL CHARACTER SET AL16UTF16
LOGFILE GROUP 1 ('C:\oracle\oradata\name\redo01.log') SIZE 102400K,
GROUP 2 ('C:\oracle\oradata\name\redo02.log') SIZE 102400K,
GROUP 3 ('C:\oracle\oradata\name\redo03.log') SIZE 102400K;
spool off
exit;

CreateDBFiles.sql:

connect SYS/change_on_install as SYSDBA
set echo on
spool C:\oracle\ora92\assistants\dbca\logs\CreateDBFiles.log
CREATE TABLESPACE "INDX" LOGGING DATAFILE 'C:\oracle\oradata\name\indx01.dbf' SIZE 25M REUSE AUTOEXTEND ON NEXT  1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT  AUTO ;
CREATE TABLESPACE "TOOLS" LOGGING DATAFILE 'C:\oracle\oradata\name\tools01.dbf' SIZE 10M REUSE AUTOEXTEND ON NEXT  320K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT  AUTO ;
CREATE TABLESPACE "USERS" LOGGING DATAFILE 'C:\oracle\oradata\name\users01.dbf' SIZE 25M REUSE AUTOEXTEND ON NEXT  1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT  AUTO ;
spool off
exit;

CreateDBCatalog.sql:

connect SYS/change_on_install as SYSDBA
set echo on
spool C:\oracle\ora92\assistants\dbca\logs\CreateDBCatalog.log
@C:\oracle\ora92\rdbms\admin\catalog.sql;
@C:\oracle\ora92\rdbms\admin\catexp7.sql;
@C:\oracle\ora92\rdbms\admin\catblock.sql;
@C:\oracle\ora92\rdbms\admin\catproc.sql;
@C:\oracle\ora92\rdbms\admin\catoctk.sql;
@C:\oracle\ora92\rdbms\admin\owminst.plb;
connect SYSTEM/manager
@C:\oracle\ora92\sqlplus\admin\pupbld.sql;
connect SYSTEM/manager
set echo on
spool C:\oracle\ora92\assistants\dbca\logs\sqlPlusHelp.log
@C:\oracle\ora92\sqlplus\admin\help\hlpbld.sql helpus.sql;
spool off
spool off
exit;

PostDBcreation.sql:

connect SYS/change_on_install as SYSDBA
set echo on
spool C:\oracle\ora92\assistants\dbca\logs\postDBCreation.log
@C:\oracle\ora92\rdbms\admin\utlrp.sql;
shutdown ;
connect SYS/change_on_install as SYSDBA
set echo on
spool C:\oracle\ora92\assistants\dbca\logs\postDBCreation.log
create spfile='C:\oracle\ora92\database\spfilename.ora' FROM pfile='C:\oracle\admin\name\scripts\init.ora';
startup ;

Hoep this helps at least point you in the right direction.





Alan Bennett said:
I don't mind people who aren't what they seem. I just wish they'd make their mind up.
 
Ken,

thanks for the assist.

I've searched other threads and used the dbca sript generation option as well. In conjunction with your sample, I believe I'll get there.

Regards

T

Grinding away at things Oracular
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top