CREATE DATABASE "oracyx"
CONTROLFILE REUSE
maxdatafiles 254
maxinstances 8
maxloghistory 100
maxlogmembers 2
maxlogfiles 64
character set ZHS16CGB231280
national character set ZHS16CGB231280
DATAFILE '/data4/ora817/oradata/oracyx/system.dbf'
SIZE 240M REUSE AUTOEXTEND OFF
REM ********** ALTER SYSTEM TABLESPACE *********
ALTER TABLESPACE SYSTEM
DEFAULT STORAGE (
INITIAL 640K NEXT 640K MINEXTENTS 1
MAXEXTENTS UNLIMITED PCTINCREASE 0);
ALTER TABLESPACE SYSTEM MINIMUM EXTENT 64K;
REM ********** TABLESPACE FOR TOOLS**********
CREATE TABLESPACE TOOLS DATAFILE '/data4/ora817/oradata/oracyx/tools_01.dbf'
SIZE 4000M REUSE AUTOEXTEND OFF
MINIMUM EXTENT 512K
DEFAULT STORAGE ( INITIAL 512K NEXT 512K MINEXTENTS 8 MAXEXTENTS 4096);
REM ********** TABLESPACE FOR INDX1 **********
CREATE TABLESPACE INDX1 DATAFILE '/data2/oradata/oracyx/indx1_01.dbf'
SIZE 4000M REUSE AUTOEXTEND OFF
MINIMUM EXTENT 512K
DEFAULT STORAGE ( INITIAL 512K NEXT 512K MINEXTENTS 8 MAXEXTENTS 4096);
REM ********** TABLESPACE FOR USER**********
CREATE TABLESPACE USER1 DATAFILE '/data6/oradata/oracyx/user1_01.dbf'
SIZE 4000M REUSE AUTOEXTEND OFF
MINIMUM EXTENT 512K
DEFAULT STORAGE ( INITIAL 512K NEXT 512K MINEXTENTS 8 MAXEXTENTS 4096);
REM ********** TABLESPACE FOR TEMP **********
CREATE TABLESPACE TEMP DATAFILE '/data7/oradata/oracyx/temp_01.dbf'
SIZE 4000M REUSE AUTOEXTEND OFF
MINIMUM EXTENT 512K
DEFAULT STORAGE ( INITIAL 512K NEXT 512K MINEXTENTS 8 MAXEXTENTS 4096);
REM ********** TABLESPACE FOR RBS **********
CREATE TABLESPACE RBS DATAFILE '/data3/oradata/oracyx/rbs1_1.dbf'
SIZE 4000M REUSE AUTOEXTEND OFF
MINIMUM EXTENT 512K
DEFAULT STORAGE ( INITIAL 512K NEXT 512K MINEXTENTS 8 MAXEXTENTS 4096);
REM **** Creating Six Rollback Segments ****************
CREATE PUBLIC ROLLBACK SEGMENT RBS_01 TABLESPACE RBS
STORAGE (INITIAL 10m NEXT 10m MINEXTENTS 20 OPTIMAL 200m);
ALTER ROLLBACK SEGMENT RBS_01 ONLINE;
CREATE PUBLIC ROLLBACK SEGMENT RBS_02 TABLESPACE RBS
STORAGE (INITIAL 10m NEXT 10m MINEXTENTS 20 OPTIMAL 200m);
ALTER ROLLBACK SEGMENT RBS_02 ONLINE;
CREATE PUBLIC ROLLBACK SEGMENT RBS_03 TABLESPACE RBS
STORAGE (INITIAL 10m NEXT 10m MINEXTENTS 20 OPTIMAL 200m);
ALTER ROLLBACK SEGMENT RBS_03 ONLINE;
CREATE PUBLIC ROLLBACK SEGMENT RBS_04 TABLESPACE RBS
STORAGE (INITIAL 10m NEXT 10m MINEXTENTS 20 OPTIMAL 200m);
ALTER ROLLBACK SEGMENT RBS_04 ONLINE;
CREATE PUBLIC ROLLBACK SEGMENT RBS_05 TABLESPACE RBS
STORAGE (INITIAL 10m NEXT 10m MINEXTENTS 20 OPTIMAL 200m);
ALTER ROLLBACK SEGMENT RBS_05 ONLINE;
CREATE PUBLIC ROLLBACK SEGMENT RBS_06 TABLESPACE RBS
STORAGE (INITIAL 10m NEXT 10m MINEXTENTS 20 OPTIMAL 200m);
ALTER ROLLBACK SEGMENT RBS_06 ONLINE;
disconnect
spool off
exit
EOF
#-------------------END----------------------------------------------------
3、 创立数据字典
在本局部中将挪用oracle自带的剧本创立数据字典。个中catalog.sql用于创立相对体系基表的视图和体系静态功能视图和他们的同义词。同时该剧本将运转创立其他对象的剧本,次要有根基的PL/SQL情况(包含PL/SQL的声明:数据类型、预界说破例、内建的进程和函数、SQL操作等),审计,导入/导出,SQL*Loader和装置选项等。
Catproc.sql用于创立PL/SQL的利用情况。另外,还创立几个PL/SQL包用于扩大RDBMS功效。该剧本同时还为上面的一些RDBMS功效创立别的的一些包和视图: 正告、管道、日记剖析、对象、大对象、初级队列、复制选项和其他的一些内建包和选项等。
以上两个是必需运转的,其他的则依据实践需求了,这里对用到的几个作一下申明:
caths.sql用于装置异类办事办理包。
helpbld.sql和helpus.sql用于创立SQL*PLUS匡助所用到的表(to create the help facility tables)。
别的一个pupbld.sql,关于低版本需求运转,不然在登录时会呈现“Product user profile does not exit”的提醒信息,pupbld.sql用于创立PUP(Product_User_Profile)表,以在用户级别平安性的基本上,供应产物级(product_level)的平安机制。
alter user sys temporary tablespace TEMP;
alter user system default tablespace TOOLS;
alter user system temporary tablespace TEMP;
shutdown normal;
startup mount pfile='/data4/ora817/app/oracle/product/8.1.7/dbs/initoracyx.ora';
alter database archivelog;
alter database open;
alter system archive log start;
alter system switch logfile;
disconnect
spool off
exit
EOF
#------------------END----------------------------------------------------