-
Notifications
You must be signed in to change notification settings - Fork 7
/
test.md
690 lines (641 loc) · 18.8 KB
/
test.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
#!/bin/sh
MOUNTDIR=/dev/cdrom #光盘路径/
MOUNTPOINT=/mnt/cdrom/ #光盘挂载路径#
RPM=/mnt/cdrom/Packages/
#ERRORLOG=/tmp/ERROR_$(date +"%Y-%m-%d").log
log="/tmp/install_software_$(date +"%Y-%m-%d").log" #操作日志存放路径
fsize=2000000
exec 1>>$log #操作日志信息均输出到日志文件
loglevel=0 #debug:0; INFO:1; WARNINGINGINGING:2; ERROR:3 #日志级别
log=$0".log"
function log {
#localtext;locallogtype
# logfile="/tmp/install_software_$(date +"%Y-%m-%d").log"
logtype=$1
text=$2
now_time='['$(date +"%Y-%m-%d %H:%M:%S")']'
case $logtype in
ERROR)
echo -e "\033[31m$now_time [$1]$2\033[0m" | tee -a $logfile;;
INFO)
echo -e "\033[37m$now_time [$1]$2\033[0m" | tee -a $logfile;;
WARNING)
echo -e "\033[37m$now_time [$1]$2\033[0m" | tee -a $logfile;;
esac
}
sleep 1
INFO() {
log INFO " Start trying to mount a CD-ROM ..."
}
INFO
sleep 1
#检测光盘挂载路径是否存在
if [ -d $MOUNTPOINT ]; then
INFO() {
log INFO " Folder $MOUNTPOINT already exists!"
}
INFO
else
WARNING() {
log WARNING " Folder $MOUNTPOINT does not exist!"
}
WARNING
mkdir $MOUNTPOINT #创建路径
sleep 2
INFO() {
log INFO " Folder $MOUNTPOINT creation completed!"
}
INFO
fi
sleep 2
#yum源设置
file=/etc/yum.repos.d/CentOS-Base.repo
if [ ! -f "$file" ]; then
WARNING() {
log WARNING " File $file does not exist! Continue"
}
WARNING
else
mv $file /etc/yum.repos.d/CentOS-Base.repo.bak
WARNING() {
log WARNING " File $file move completed!"
}
WARNING
fi
file1=/etc/yum.repos.d/CentOS-Media.repo
if [ ! -f "$file1" ]; then
WARNING() {
log WARNING " File $file1 does not exist! Quit!"
}
WARNING
else
sed -i -e 's|enabled=0|enabled=1|' $file1
sed -i -e "s|baseurl=file:///media/CentOS/|baseurl=file://$MOUNTPOINT|" $file1
fi
if grep -q enabled=1 $file1 ; then
INFO() {
log INFO " Repo [enabled] set up completed!"
}
INFO
else
ERROR() {
log ERROR " Repo [enabled] setting failure,Now exit procedure!"
}
ERROR
exit
fi
sleep 2
if grep -q baseurl=file:///mnt/cdrom $file1 ; then
INFO() {
log INFO " Repo [baseurl] set up completed!"
}
INFO
else
ERROR() {
log ERROR " Repo [baseurl] setting failure,Now exit procedure!"
}
ERROR
exit
fi
INFO() {
log INFO " Repo set completed! Continue!"
}
INFO
sleep 2
#挂载光盘镜像
mount -o loop $MOUNTDIR $MOUNTPOINT &> /dev/null
if [ -d $RPM ]; then
INFO() {
log INFO " CD-ROM mount completed!"
}
INFO
else
ERROR() {
log ERROR " time:`date` ERR: CD-ROM Mount Fail"
}
ERROR
exit
fi
sleep 2
service iptables stop
chkconfig iptables off
INFO() {
log INFO " Closing the Linux firewall successfully"
}
INFO
sleep 2
INFO() {
log INFO " Start detecting the installation of RPM packages ..."
}
INFO
sleep 2
yum -y install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc gcc-c++ libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel pdksh compat-db control-center libstdc++ libstdc++-devel xscreensaver openmotif21 ksh* compat-libcap* zip unzip &> /dev/null
packagecheck()
{
for package in binutils compat-libcap1 compat-libstdc++ gcc gcc-c++ glibc glibc-devel ksh libgcc libstdc++ libstdc++-devel libaio libaio-devel make sysstat
do
rpm -q $package
if [ $? != 0 ];then
yum -y install $package &> /dev/null
INFO() {
log INFO " RPM package installation completed"
}
INFO
sleep 2
else
ERROR() {
log ERROR " RPM package Installation failure!"
}
ERROR
exit
fi
done
}
INFO() {
log INFO " Start creating Oracle Users | Groups | Directories"
}
INFO
sleep 2
if grep -q oinstall:x:501: /etc/group ; then
INFO() {
log INFO " Oracle Group oinstall already creation completed!"
}
INFO
else
/usr/sbin/groupadd -g 501 oinstall &> /dev/null
fi
sleep 2
if grep -q dba:x:502: /etc/group ; then
INFO() {
log INFO " Oracle Group dba already creation completed!"
}
INFO
else
/usr/sbin/groupadd -g 502 dba &> /dev/null
fi
sleep 2
if grep -q oracle /etc/shadow ; then
INFO() {
log INFO " Oracle User oracle already creation completed!"
}
INFO
else
/usr/sbin/useradd -g oinstall -G dba oracle &> /dev/null
fi
sleep 2
if grep -q oinstall:x:501: /etc/group && grep -q dba:x:502: /etc/group && grep -q oracle /etc/shadow ; then
sleep 2
else
ERROR() {
log INFO " Oracle users | groups | directories creating failure! "
}
ERROR
EXIT
fi
sleep 2
DBHOME=/u01/app/oracle
DBHOME1=/u01/app/oradata
DBHOME2=/u01/app/oraInventory
if [ ! -d $DBHOME ]&&[! -d $DBHOME1 ]&& [! -d $DBHOME2 ]; then
ERROR() {
log ERROR " ORACLE Folder Create Failed! Now exit procedure "
}
ERROR
exit
else
INFO() {
mkdir -p $DBHOME
mkdir -p $DBHOME1
mkdir -p $DBHOME2
chown -R oracle:oinstall /u01/app/oracle/ /u01/app/oradata/ /u01/app/oraInventory
chmod -R 755 /u01/app/oracle/ /u01/app/oradata/ /u01/app/oraInventory
log INFO " ORACLE Folder Create Completed! "
}
INFO
fi
sleep 2
echo "oracle" | passwd --stdin oracle &> /dev/null
INFO() {
log INFO " ORACLE USER Password Create Completed!"
}
INFO
sed -i /::/d /etc/hosts
sleep 2
INFO() {
log INFO " Create ORACLE user | group | directory completion"
}
INFO
sleep 2
if grep -q oracle /etc/security/limits.conf ; then
WARNING() {
log WARNING " File [/etc/security/limits.conf] already set successfully!"
}
WARNING
else
echo "#ORACLE SETTING " >> /etc/security/limits.conf
echo "oracle soft nproc 2047 " >> /etc/security/limits.conf
echo "oracle hard nproc 16384" >> /etc/security/limits.conf
echo "oracle soft nofile 1024 " >> /etc/security/limits.conf
echo "oracle hard nofile 65536" >> /etc/security/limits.conf
INFO() {
log INFO " File [/etc/security/limits.conf] set completed!"
}
INFO
fi
sleep 2
if grep -q fs.aio-max-nr /etc/sysctl.conf ; then
WARNING() {
log WARNING " File [/etc/sysctl.conf] already set successfully!"
}
WARNING
else
sed -i /kernel.shmmax/d /etc/sysctl.conf
sed -i /kernel.shmall/d /etc/sysctl.conf
echo "#ORACLE SETTING " >> /etc/sysctl.conf
echo "fs.aio-max-nr = 1048576 " >> /etc/sysctl.conf
echo "fs.file-max = 6815744 " >> /etc/sysctl.conf
echo "kernel.shmall = 2097152 " >> /etc/sysctl.conf
echo "kernel.shmmax = 12884901888 " >> /etc/sysctl.conf
echo "kernel.shmmni = 4096 " >> /etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128 " >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 9000 65500" >> /etc/sysctl.conf
echo "net.core.rmem_default = 262144 " >> /etc/sysctl.conf
echo "net.core.rmem_max = 4194304 " >> /etc/sysctl.conf
echo "net.core.wmem_default = 262144 " >> /etc/sysctl.conf
echo "net.core.wmem_max = 1048586 " >> /etc/sysctl.conf
sysctl -p &> /dev/null
INFO() {
log INFO " File [/etc/sysctl.conf] set completed!"
}
INFO
fi
sleep 2
if grep -q oracle /etc/profile; then
WARNING() {
log WARNING " File [/etc/profile] already set successfully!"
}
WARNING
else
echo "if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
">> /etc/profile
INFO() {
log INFO " File [/etc/profile] set set completed!"
}
INFO
fi
sleep 2
if grep -q oracle /home/oracle/.bash_profile; then
WARNING() {
log WARNING " File [/home/oracle/.bash_profile] already set successfully!"
}
WARNING
else
echo "PATH=\$PATH:\$ORACLE_HOME/bin " >> /home/oracle/.bash_profile
echo "export PATH " >> /home/oracle/.bash_profile
echo "umask 022 " >> /home/oracle/.bash_profile
echo "ORACLE_BASE=/u01/app/oracle " >> /home/oracle/.bash_profile
echo "ORACLE_SID=orcl " >> /home/oracle/.bash_profile
echo "ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 " >> /home/oracle/.bash_profile
echo "PATH=\$ORACLE_HOME/bin/:\$PATH " >> /home/oracle/.bash_profile
echo "LANG=en_US.UTF-8 " >> /home/oracle/.bash_profile
echo "export ORACLE_BASE ORACLE_HOME ORACLE_SID " >> /home/oracle/.bash_profile
source /home/oracle/.bash_profile
INFO() {
log INFO " File [/home/oracle/.bash_profile] set completed!"
}
INFO
fi
sleep 1
INFO() {
log INFO " The environment variable is configured,Now start unpacking the installation package"
}
INFO
sleep 2
# unzip
# unzip
chmod 777 /tools
chown oracle:dba /tools -R
file1=p13390677_112040_Linux-x86-64_1of7.zip
file2=p13390677_112040_Linux-x86-64_2of7.zip
if [ -d /tools/database ]
then
rm -rf /tools/database
fi
if [ -f /tools/$file1 ]
then
ls /tools/$file1 &> /dev/null
unzip /tools/$file1 -d /tools &> /dev/null
fi
if [ -f /tools/$file2 ]
then
ls /tools/$file2 &> /dev/null
unzip /tools/$file2 -d /tools &> /dev/null
fi
INFO() {
log INFO " The ORACLE installation package is unzip"
}
INFO
sleep 2
##################################################
# parameter files
##################################################
# create install_db.rsp
install=`sed -n '/oracle.install.option/p' /tools/database/response/db_install.rsp` &> /dev/null
hostname=`sed -n '/ORACLE_HOSTNAME/p' /tools/database/response/db_install.rsp` &> /dev/null
group_name=`sed -n '/UNIX_GROUP_NAME/p' /tools/database/response/db_install.rsp` &> /dev/null
inventory=`sed -n '/INVENTORY_LOCATION/p' /tools/database/response/db_install.rsp` &> /dev/null
languages=`sed -n '/^SELECTED_LANGUAGES=en$/p' /tools/database/response/db_install.rsp` &> /dev/null
oracle_home=`sed -n '/ORACLE_HOME/p' /tools/database/response/db_install.rsp` &> /dev/null
oracle_base=`sed -n '/ORACLE_BASE/p' /tools/database/response/db_install.rsp` &> /dev/null
InstallEdition=`sed -n '/oracle.install.db.InstallEdition/p' /tools/database/response/db_install.rsp` &> /dev/null
dba_group=`sed -n '/oracle.install.db.DBA_GROUP/p' /tools/database/response/db_install.rsp` &> /dev/null
oper_group=`sed -n '/oracle.install.db.OPER_GROUP/p' /tools/database/response/db_install.rsp` &> /dev/null
updates=`sed -n '/^DECLINE_SECURITY_UPDATES=$/p' /tools/database/response/db_install.rsp` &> /dev/null
hostname1=`sed -n '/HOSTNAME/p' /etc/sysconfig/network| sed -s "s/=/ /g"|gawk '{print $2}'` &> /dev/null
if [ "$install" = "oracle.install.option=" ]
then
sed -i "s/oracle.install.option=/oracle.install.option=INSTALL_DB_SWONLY/g" /tools/database/response/db_install.rsp &> /dev/null
INFO() {
log INFO " INSTALL $install update succeeful!"
}
INFO
else
ERROR() {
log ERROR " INSTALL $install parameter don't update!"
}
ERROR
EXIT
fi
sleep 2
if [ "$hostname" = "ORACLE_HOSTNAME=" ]
then
sed -i "s/ORACLE_HOSTNAME=/ORACLE_HOSTNAME=$hostname1/g" /tools/database/response/db_install.rsp &> /dev/null
INFO() {
log INFO " HOSTNAME $hostname update succeeful!"
}
INFO
else
ERROR() {
log ERROR " HOSTNAME $hostname parameter don't update!"
}
ERROR
EXIT
fi
sleep 2
if [ "$group_name" = "UNIX_GROUP_NAME=" ]
then
sed -i "s/UNIX_GROUP_NAME=/UNIX_GROUP_NAME=dba/g" /tools/database/response/db_install.rsp &> /dev/null
INFO() {
log INFO " GROUP_NAME $group_name update succeeful!"
}
INFO
else
ERROR() {
log ERROR " GROUP_NAME $group_name parameter don't update!"
}
ERROR
EXIT
fi
sleep 2
if [ "$inventory" = "INVENTORY_LOCATION=" ]
then
sed -i "s/INVENTORY_LOCATION=/INVENTORY_LOCATION=\/u01\/app\/oraInventory/g" /tools/database/response/db_install.rsp &> /dev/null
INFO() {
log INFO " INVENTORY $inventory update succeeful!"
}
INFO
else
ERROR() {
log ERROR " INVENTORY $inventory parameter don't update!"
}
ERROR
EXIT
fi
sleep 2
if [ "$languages" = "SELECTED_LANGUAGES=en" ]
then
sed -i "s/SELECTED_LANGUAGES=en/SELECTED_LANGUAGES=en,zh_CN/g" /tools/database/response/db_install.rsp &> /dev/null
INFO() {
log INFO " LANGUAGES $languages update succeeful!"
}
INFO
else
ERROR() {
log ERROR " LANGUAGES $languages parameter don't update!"
}
ERROR
EXIT
fi
sleep 2
if [ "$oracle_home" = "ORACLE_HOME=" ]
then
sed -i "s/ORACLE_HOME=/ORACLE_HOME=\/u01\/app\/oracle\/product\/11.2.0\/dbhome_1/g" /tools/database/response/db_install.rsp &> /dev/null
INFO() {
log INFO " ORACLE_HOME $oracle_home update succeeful!"
}
INFO
else
ERROR() {
log ERROR " ORACLE_HOME $oracle_home parameter don't update!"
}
ERROR
EXIT
fi
sleep 2
if [ "$oracle_base" = "ORACLE_BASE=" ]
then
sed -i "s/ORACLE_BASE=/ORACLE_BASE=\/u01\/app\/oracle/g" /tools/database/response/db_install.rsp &> /dev/null
INFO() {
log INFO " ORACLE_BASE $oracle_base update succeeful!"
}
INFO
else
ERROR() {
log ERROR " ORACLE_BASE $oracle_base parameter don't update!"
}
ERROR
EXIT
fi
sleep 2
if [ "$InstallEdition" = "oracle.install.db.InstallEdition=" ]
then
sed -i "s/oracle.install.db.InstallEdition=/oracle.install.db.InstallEdition=EE/g" /tools/database/response/db_install.rsp &> /dev/null
INFO() {
log INFO " InstallEdition $InstallEdition update succeeful!"
}
INFO
else
ERROR() {
log ERROR " InstallEdition $InstallEdition parameter don't update!"
}
ERROR
EXIT
fi
sleep 2
if [ "$dba_group" = "oracle.install.db.DBA_GROUP=" ]
then
sed -i "s/oracle.install.db.DBA_GROUP=/oracle.install.db.DBA_GROUP=dba/g" /tools/database/response/db_install.rsp &> /dev/null
INFO() {
log INFO " DBA_GROUP $dba_group update succeeful!"
}
INFO
else
ERROR() {
log ERROR " DBA_GROUP $dba_group parameter don't update!"
}
ERROR
EXIT
fi
sleep 2
if [ "$oper_group" = "oracle.install.db.OPER_GROUP=" ]
then
sed -i "s/oracle.install.db.OPER_GROUP=/oracle.install.db.OPER_GROUP=dba/g" /tools/database/response/db_install.rsp &> /dev/null
INFO() {
log INFO " OPER_GROUP $oper_group update succeeful!"
}
INFO
else
ERROR() {
log ERROR " OPER_GROUP $oper_group parameter don't update!"
}
ERROR
EXIT
fi
sleep 2
if [ "$updates" = "DECLINE_SECURITY_UPDATES=" ]
then
sed -i "s/DECLINE_SECURITY_UPDATES=/DECLINE_SECURITY_UPDATES=true/g" /tools/database/response/db_install.rsp &> /dev/null
INFO() {
log INFO " UPDATES $updates update succeeful!"
}
INFO
else
ERROR() {
log ERROR " UPDATES $updates parameter don't update!"
}
ERROR
EXIT
fi
sleep 2
#create dbca.rsp
gdbname1=`sed -n '/GDBNAME = "orcl11g.us.oracle.com"/p' /tools/database/response/dbca.rsp` &> /dev/null
sid1=`sed -n '/SID = "orcl11g"/p' /tools/database/response/dbca.rsp` &> /dev/null
oradata=`sed -n '/DATAFILEDESTINATION =/p' /tools/database/response/dbca.rsp` &> /dev/null
flash=`sed -n '/RECOVERYAREADESTINATION=/p' /tools/database/response/dbca.rsp` &> /dev/null
charset=`sed -n '/CHARACTERSET =/p' /tools/database/response/dbca.rsp` &> /dev/null
ncharset=`sed -n '/NATIONALCHARACTERSET=/p' /tools/database/response/dbca.rsp` &> /dev/null
if [ "$gdbname1" = "GDBNAME = \"orcl11g.us.oracle.com\"" ]
then
sed -i "s/GDBNAME = \"orcl11g.us.oracle.com\"/GDBNAME = \"orcl\"/g" /tools/database/response/dbca.rsp &> /dev/null
INFO() {
log INFO " GDBNAME1 $gdbname1 update succeeful!"
}
INFO
else
ERROR() {
log ERROR " GDBNAME1 $gdbname1 not update"
}
ERROR
EXIT
fi
sleep 2
if [ "$sid1" = "SID = \"orcl11g\"" ]
then
sed -i "s/SID = \"orcl11g\"/SID = \"orcl\"/g" /tools/database/response/dbca.rsp &> /dev/null
INFO() {
log INFO " SID1 $sid1 update succeeful!"
}
INFO
else
ERROR() {
log ERROR " SID1 $sid1 not update"
}
ERROR
EXIT
fi
sleep 2
if [ "$oradata" = "#DATAFILEDESTINATION =" ]
then
sed -i "s/#DATAFILEDESTINATION =/DATAFILEDESTINATION = \"\/oradata\"/g" /tools/database/response/dbca.rsp &> /dev/null
INFO() {
log INFO " ORADATA $oradata update succeeful!"
}
INFO
else
ERROR() {
log ERROR " ORADATA $oradata not update"
}
ERROR
EXIT
fi
sleep 2
if [ "$flash" = "#RECOVERYAREADESTINATION=" ]
then
sed -i "s/#RECOVERYAREADESTINATION=/RECOVERYAREADESTINATION= \"\/u01\/app\/oracle\/flash_recovery_area\"/g" /tools/database/response/dbca.rsp &> /dev/null
INFO() {
log INFO " FLASH $flash update succeeful!"
}
INFO
else
ERROR() {
log ERROR "FLASH $flash not update!"
}
ERROR
EXIT
fi
sleep 2
if [ "$charset" = "#CHARACTERSET = \"US7ASCII\"" ]
then
sed -i "s/#CHARACTERSET = \"US7ASCII\"/CHARACTERSET = \"AL32UTF8\"/g" /tools/database/response/dbca.rsp &> /dev/null
INFO() {
log INFO " CHARSET $charset update succeeful!"
}
INFO
else
ERROR() {
log ERROR " CHARSET $charset not update!"
}
ERROR
EXIT
fi
sleep 2
if [ "$ncharset" = "#NATIONALCHARACTERSET= \"UTF8\"" ]
then
sed -i "s/#NATIONALCHARACTERSET= \"UTF8\"/NATIONALCHARACTERSET = \"UTF8\"/g" /tools/database/response/dbca.rsp &> /dev/null
INFO() {
log INFO " NCHARSET $ncharset update succeeful!"
}
INFO
else
ERROR() {
log ERROR " NCHARSET $ncharset is not update!"
}
ERROR
EXIT
fi
chmod 777 /tools
# netca.rsp
## 注意: 以下命令可单独执行,因为软件装完需要执行脚本 ##
#install
INFO() {
log INFO " Starting Oracle Universal Installer... Please wait ..."
}
INFO
sleep 2
su - oracle <<EOF
cd /tools/database/
./runInstaller -silent -responseFile /tools/database/response/db_install.rsp
sleep 300
cd /tools/database/install/
netca -silent -responsefile /tools/database/response/netca.rsp
sleep 60
cd /tools/database/install/
dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbName orcl -sysPassword oracle -systemPassword oracle
EOF