ITPub博客

首页 > 数据库 > 数据库开发技术 > 一个sql创建数据库

一个sql创建数据库

原创 数据库开发技术 作者:sepulcrum 时间:2007-08-27 08:32:36 0 删除 编辑
$ more create9idb.sql
spool CreateDB.log
-- shutdown immediate;
-- shutdown abort;
-- !strings /oracle/305/oracle/product/9.2.0/dbs/spfileinstance.ora > /oracle/305/oracle/product/9.2.0/dbs/pfileinstance.ora
startup nomount pfile=/oracle/app/oracle/product/9.2.0/dbs/pfileinstance.ora;
!mkdir -p /oracle/305/oradata/instance
!mkdir -p /oracle/305/redo1/instance
!mkdir -p /oracle/305/redo2/instance
!mkdir -p /oracle/305/arch/instance
!rm /oracle/305/oradata/instance/*.ctl
!rm /oracle/305/oradata/instance/*.dbf
!rm /oracle/305/redo1/instance/redo*.log
!rm /oracle/305/redo2/instance/redo*.log
CREATE DATABASE "instance"
MAXINSTANCES 8
MAXLOGHISTORY 58478
MAXLOGFILES 32
MAXLOGMEMBERS 4
MAXDATAFILES 1022
DATAFILE '/oracle/305/oradata/instance/system01.dbf' SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '/oracle/305/oradata/instance/temp01.dbf' SIZE 1000M REUSE AUTOEXTEND ON MAXSIZE UN
LIMITED
UNDO TABLESPACE "UNDOTBS1" DATAFILE '/oracle/305/oradata/instance/undotbs01.dbf' SIZE 2000M REUSE AUTOEXTEND ON MAXSIZE UNLIMI
TED
CHARACTER SET WE8ISO8859P1
NATIONAL CHARACTER SET AL16UTF16
LOGFILE GROUP 1 ('/oracle/305/redo1/instance/redo1a.log','/oracle/305/redo2/instance/redo1b.log') SIZE 100M,
GROUP 2 ('/oracle/305/redo1/instance/redo2a.log','/oracle/305/redo2/instance/redo2b.log') SIZE 100M,
GROUP 3 ('/oracle/305/redo1/instance/redo3a.log','/oracle/305/redo2/instance/redo3b.log') SIZE 100M
USER SYS IDENTIFIED BY "sys" USER SYSTEM IDENTIFIED BY "system";
create spfile from pfile='/oracle/app/oracle/product/9.2.0/dbs/pfileinstance.ora';
shutdown immediate;
!rm /oracle/app/oracle/product/9.2.0/dbs/orapwinstance
!orapwd file=/oracle/app/oracle/product/9.2.0/dbs/orapwinstance password=password
startup;
CREATE TABLESPACE "USERS" LOGGING DATAFILE '/oracle/305/oradata/instance/users01.dbf' SIZE 50M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO ;
/oracle/app/oracle/product/9.2.0/rdbms/admin/catalog.sql;
@/oracle/app/oracle/product/9.2.0/rdbms/admin/catblock.sql;
@/oracle/app/oracle/product/9.2.0/rdbms/admin/catproc.sql;
@/oracle/app/oracle/product/9.2.0/rdbms/admin/catexp.sql;
@/oracle/app/oracle/product/9.2.0/rdbms/admin/catoctk.sql;
@/oracle/app/oracle/product/9.2.0/rdbms/admin/owminst.plb;
@/oracle/app/oracle/product/9.2.0/rdbms/admin/utlmail.sql;
@/oracle/app/oracle/product/9.2.0/rdbms/admin/prvtmail.plb;
connect SYSTEM/system
@/oracle/app/oracle/product/9.2.0/sqlplus/admin/pupbld.sql;
connect SYSTEM/system
@/oracle/app/oracle/product/9.2.0/sqlplus/admin/help/hlpbld.sql helpus.sql;
spool off
exit;[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10897379/viewspace-966313/,如需转载,请注明出处,否则将追究法律责任。

下一篇: 常用的分析函数
请登录后发表评论 登录
全部评论
  • 博文量
    26
  • 访问量
    169977