Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Create oracle database using linux shell script

In this script useful for how to create oracle database with archive mode using shell script in linux 7.3 and oracle 11gr2 version of softwre.
dbk1.sh
mkdir k1
cd k1
mkdir admin oradata
cd admin
mkdir pfile diag create
cd ..
cd oradata
mkdir control log archive data
cd
cp /home/oracle/pfk1  /home/oracle/k1/admin/pfile/initk1.ora
cd
export ORACLE_SID=k1
sqlplus / as sysdba <<EOF
startup pfile='/home/oracle/k1/admin/pfile/initk1.ora' nomount;
create database k1
datafile '/home/oracle/k1/oradata/data/system01.dbf' size 400m
sysaux datafile '/home/oracle/k1/oradata/data/systemaux01.dbf' size 300m
undo tablespace undo01 datafile '/home/oracle/k1/oradata/data/undo01.dbf' size 100m
default temporary tablespace temp01 tempfile '/home/oracle/k1/oradata/data/temp01.dbf' size 100m
logfile group 1 '/home/oracle/k1/oradata/log/log01.log' size 10m,
        group 2 '/home/oracle/k1/oradata/log/log02.log' size 10m;
@?/rdbms/admin/catalog.sql;
@?/rdbms/admin/catproc.sql;
create table kf(id number(10));
create tablespace tbs datafile '/home/oracle/k1/oradata/data/tbs.dbf' size 500m;
alter database close;
alter database archivelog;
shut immediate;
!
export ORACLE_SID=k1
sqlplus / as sysdba   <<EOF
startup pfile='/home/oracle/k1/admin/pfile/initk1.ora';
create spfile from pfile='/home/oracle/k1/admin/pfile/initk1.ora';
EOF
vi pfk1 
db_name=k1
sga_target=600m
control_files='/home/oracle/k1/oradata/control/control01.ctl'
diagnostic_dest='/home/oracle/k1/admin/diag'
log_archive_dest_1='LOCATION=/home/oracle/k1/oradata/archive' 
log_archive_dest_state_1=enable 
log_archive_format=%%ORACLE_SID%%_%t_%s_%r.arc
run the dbk1.sh file like following your oracle databse will be create automatically.
$ sh dbk1.sh

Comments

Popular posts from this blog

VMWARE WORKSTATION 3,4,5,6,7,8,9,10,11,12,14,15...etc LICENSE KEYS COLLECTION

Top 10 Highest Paying URL Shortener Companies - Best URL Shorteners To Earn Fast

How to find the server is whether standby (slave) or primary(master) in Postgresql replication ?

rman interview and scenario based questions and answer and also rman(backup and recovery) discussions panel

aireplay-ng