#partition
fdisk /dev/sde
#create pv
pvcreate /dev/sde1
#create vg
vgcreate oradata /dev/sde1
#create lv
lvcreate -L 500m -n system01 oradata
lvcreate -L 500m -n sysaux01 oradata
lvcreate -L 500m -n undo01 oradata
lvcreate -L 500m -n users01 oradata
lvcreate -L 500m -n temp01 oradata
lvcreate -L 300m -n data01 oradata
lvcreate -L 300m -n index01 oradata
lvcreate -L 100m -n control01 oradata
lvcreate -L 100m -n control02 oradata
lvcreate -L 50m -n redo1 oradata
lvcreate -L 50m -n redo2 oradata
lvcreate -L 50m -n redo3 oradata
#create link file
ln -s /dev/mapper/oradata-control01 /u01/oradata/dbtest/control01.ctl
ln -s /dev/mapper/oradata-control02 /u01/oradata/dbtest/control02.ctl
ln -s /dev/mapper/oradata-data01 /u01/oradata/dbtest/data01.dbf
ln -s /dev/mapper/oradata-index01 /u01/oradata/dbtest/index01.dbf
ln -s /dev/mapper/oradata-redo1 /u01/oradata/dbtest/redo1.rdo
ln -s /dev/mapper/oradata-redo2 /u01/oradata/dbtest/redo2.rdo
ln -s /dev/mapper/oradata-redo3 /u01/oradata/dbtest/redo3.rdo
ln -s /dev/mapper/oradata-sysaux01 /u01/oradata/dbtest/sysaux01.dbf
ln -s /dev/mapper/oradata-system01 /u01/oradata/dbtest/system01.dbf
ln -s /dev/mapper/oradata-temp01 /u01/oradata/dbtest/temp01.dbf
ln -s /dev/mapper/oradata-undo01 /u01/oradata/dbtest/undo01.dbf
ln -s /dev/mapper/oradata-users01 /u01/oradata/dbtest/users01.dbf
#create parameter file
cd $ORACLE_HOME/dbs
cat > initdbtest.ora <dbtest.__db_cache_size=289406976
dbtest.__java_pool_size=4194304
dbtest.__large_pool_size=4194304
dbtest.__shared_pool_size=113246208
dbtest.__streams_pool_size=0
*.background_dump_dest='/u01/app/oracle/admin/dbtest/bdump'
*.control_files='/dev/mapper/oradata-control01','/dev/mapper/oradata-control02'
*.core_dump_dest='/u01/app/oracle/admin/dbtest/cdump'
*.db_file_multiblock_read_count=8# SMALL
*.db_files=80# SMALL
*.db_name='dbtest'
*.global_names=TRUE
*.log_archive_dest_1='LOCATION=/u01/arch'
*.log_checkpoint_interval=10000
*.max_dump_file_size='10240'# limit trace file size to 5 Meg each
*.parallel_max_servers=5# SMALL
*.processes=50# SMALL
*.sga_target=400m
*.undo_management='auto'
*.undo_tablespace='undotbs'
*.user_dump_dest='/u01/app/oracle/admin/dbtest/udump'
EOF
#create password file
orapwd file=orapwdbtest password=oracle
#create db script
cat > dbtest.sql <create database dbtest
user sys identified by oracle
user system identified by oracle
maxinstances 2
maxdatafiles 2048
maxlogmembers 5
maxloghistory 20
datafile '/dev/mapper/oradata-system01' size 300m autoextend on next 30m maxsize unlimited
sysaux datafile '/dev/mapper/oradata-sysaux01' size 300m autoextend on next 30m maxsize unlimited
default temporary tablespace temp tempfile '/dev/mapper/oradata-temp01' size 300m
undo tablespace undotbs datafile '/dev/mapper/oradata-undo01' size 200m autoextend on next 10m maxsize unlimited
default tablespace users datafile '/dev/mapper/oradata-users01' size 200m
logfile
group 1 ('/dev/mapper/oradata-redo1') size 40m,
group 2 ('/dev/mapper/oradata-redo2') size 40m,
group 3 ('/dev/mapper/oradata-redo3') size 40m;
EOF
#create directory
mkdir -p /u01/app/oracle/admin/dbtest/bdump
mkdir -p /u01/app/oracle/admin/dbtest/cdump
mkdir -p /u01/app/oracle/admin/dbtest/udump
mkdir -p /u01/oradata/dbtest
sqlplus / as sysdba
startup nomount
@?/rdbms/admin/catalog
@?/rdbms/admin/catproc
conn system/oracle
@?/sqlplus/admin/pupbld
阅读(1261) | 评论(0) | 转发(0) |