Beruflich Dokumente
Kultur Dokumente
Charles Kim
HSYS, Inc.
Real Application
Clusters
Flashback
RMAN & Oracle
Secure Backup
ASM
Data Guard
Streams
Audience Poll
Get a show of hands of people running RH 4 or
5, OEL 4 or 5, SUSE or OTHER?
Get a show hands of people running RAC on
Linux?
Show of people running 10g, 11g R1, 11g R2
Show of hands of who are running VM for
databases VMWARE? OVM?
RAC on VM?
Show of hands who are DBAs? SAs?
Developers?
Show of hands who are running VM on laptops
or personal desktops?
6
Presentations at OOW
ID#: S315642
IOUG User Forum Session
Title: Linux Recipes for DBAs
Track: Database and Linux
Date: 19-SEP-10 (SUNDAY)
Time: 12:30 - 13:30
Venue: Moscone West L2
Room: Rm 2006
ID#: S315627
Title: Build and Maintain Oracle
Data Guard with DG Menu
Track: Database
Date: 23-SEP-10 (THURSDAY)
Time: 13:30 - 14:30
Venue: Moscone South
Room: Rm 200
Agenda
* Introduction to OEL and Red Hat
File and Directory Management
Package Management
RPM Requirements
Automated Startup
Oracle Installation and Configuration
WebLogic and Grid Control 11g Installation and
Configuration
Mass Agent Deployment
OS Watcher
8
http://DBAExpert.com
10
oracle-validated install
up2date
yum
rpm
up2date
yum
rpm
http://www.dbaexpert.com/
blog/2009/09/public-yumwith-oracle/
11
12
useradd.ksh
$ cat useradd.ksh
groupadd -g 500 oinstall
groupadd -g 501 dba
groupadd -g 502 asmadmin
mkdir -p /u01/app/oracle
mkdir -p /var/opt/oracle
useradd -u 500 -d /home/oracle -g oinstall -G dba,asmadmin -s /bin/bash oracle
chown oracle:dba /u01/app/oracle /var/opt/oracle
# passwd oracle
15
16
17
set_hangcheck.ksh
[root@rac55san ~]# cat set_hangcheck.ksh
export MODPROBE_FILE=/etc/modprobe.conf
RC=$(grep -i hangcheck-timer ${MODPROBE_FILE} |wc -l)
if [ "$RC" -eq 0 ]; then
echo "Hangcheck-Timer settings are not set ... "
echo "Setting up hangcheck-timer in $MODPROBE_FILE"
# -- Making copy of /etc/modprobe.conf file to /tmp
cp ${MODPROBE_FILE} /tmp/modprobe.conf.$$
cat << !! >> ${MODPROBE_FILE}
# --Setting up hangcheck-timer for Oracle RAC Database
installation
#
options hangcheck-timer hangcheck_tick=1 hangcheck_margin=10
hangcheck_reboot=1
!!
18
# up2date --register
19
<name>-<version>-<release>.<architecture>.rpm
List contents
of rpm
Example: unixODBC-2.2.11-7.1.i386.rpm
1. Version of the RPM is 2.2.11
2. Release of the RPM is 7.1
3. RPM architecture is 32-bit Intel IA32 (x86) CPU
AMD64/Intel em64t RPM will have the architecture
name x86_64.
20
RPM Update
$rpm e PACKAGE_NAME
RPM query
21
up2date screen
up2date d perl
Note:
-d or download
https://linux.oracle.com/switch.html
rpm -Uhv
up2date-5.10.1-40.8.el5.i386.rpm \
up2date-gnome-5.10.1-40.8.el5.i386.rpm
rpm --import /usr/share/rhn/RPM-GPG-KEY
up2date --register
http://DBAExpert.com
22
http://DBAExpert.com
23
24
rng-utils-2
make-3.81
binutils-2.17.50.0.6
gcc-4.1.1
libaio-0.3.106
glibc-common-2.3.4-2.9
compat-libstdc++-296 -2.96-132.7.2
libstdc++-4.1.1
libstdc++-devel-4.11
setarch-1.6-1
sysstat-5.0.5-1
compat-db-4.1.25-9
binutils-2.17.50.0.6
gcc-4.1.1
libstdc++-4.1.1
25
64-bit
binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
compat-libstdc++-33-3.2.3 (32 bit)
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
gcc-4.1.1
gcc-c++-4.1.1
glibc-2.5-12
glibc-2.5-12 (32 bit)
glibc-common-2.5
glibc-devel-2.5
glibc-devel-2.5-12 (32 bit)
libaio-0.3.106
libaio-0.3.106 (32 bit)
libaio-devel-0.3.106
libgcc-4.1.1
libgcc-4.1.1 (32 bit)
libstdc++-4.1.1
libstdc++-4.1.1 (32 bit)
libstdc++-devel 4.1.1
make-3.81
sysstat-7.0.0
27
libaio-0.3.106
binutils-2.17.50.0.6
libaio-0.3.106 (32 bit)
compat-libstdc++-33-3.2.3 libaio-devel-0.3.106
compat-libstdc++-33-3.2.3 libaio-devel-0.3.106
(32 bit)
(32 bit)
elfutils-libelf-0.125
libgcc-4.1.2
elfutils-libelflibgcc-4.1.2 (32 bit)
devel-0.125
libstdc++-4.1.2
gcc-4.1.2
libstdc++-4.1.2
gcc-c++-4.1.2
libstdc++-devel
glibc-2.5-24
make-3.81
glibc-2.5-24 (32 bit)
sysstat-7.0.2
glibc-common-2.5
unixODBC-2.2.11
glibc-devel-2.5
unixODBC-2.2.11
glibc-devel-2.5 (32 bit) unixODBC-devel-2.2.11
glibc-headers-2.5
unixODBC-devel-2.2.11
28
ksh-20060214
(32 bit)
Parameters
fs.file-max = 6553600
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.ipv4.tcp_rmem = 4194304 4194304 4194304
net.ipv4.tcp_wmem = 262144 262144 262144
net.ipv4.ip_local_port_range = 9000 65500
net.core.wmem_max=1048576
http://DBAExpert.com
sysctl p
List Kernel Parameters
sysctl -a
29
30
31
32
appsora
0:off
1:off
2:off
3:on
4:on
5:on
6:off
35
Agenda
1. Database Installation and Configuration
2. Weblogic and Grid Control Installation
and Patching
3. Mass Agent Deployment
36
#!/bin/sh
# Uncomment the following two lines for normal
desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] &&xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP
Desktop" &
#twm&
37
11.1.0.7
11.1.0.7.4
CRS
CRS
CRS PSU
11.1.0.6
11.1.0.7
11.1.0.7.4
11.1.0.7.4
ASM
ASM
CRS PSU
to ASM
DB PSU to
ASM
11.1.0.7.4
Clone ASM
to DB
38
39
1. export PATH=/u01/app/oracle/product/11.1.0/asm/
OPatch:$PATH
2. opatch lsinventory -detail -oh /u01/app/oracle/
product/11.1.0/asm |tee /tmp/
asm.before.crs.patch.txt
3. cd /export/home/oracle/downloads/downloads/
9294495
4. custom/server/9294495/custom/scripts/prepatch.sh
-dbhome /u01/app/oracle/product/11.1.0/asm
5. opatch napply custom/server/ -local -oh /u01/app/
oracle/product/11.1.0/asm -id 9294495
6. custom/server/9294495/custom/scripts/postpatch.sh
-dbhome /u01/app/oracle/product/11.1.0/asm
7. opatch lsinventory -detail -oh /u01/app/oracle/
product/11.1.0/asm |tee /tmp/
asm.after.crs.patch.txt
41
11.2.0.1.2 DB
42
43
44
45
11.2.0.2
DB
DB Inplace
upgrade
11.2.0.2
Fresh DB Installation
47
48
http://java.sun.com/products/archive/j2se/6u18/index.html
Per metalink note: 1063587.1 this is more stable
[oracle@gc11g jdk]$ chmod 700 *.bin
[oracle@gc11g jdk]$ ./jdk-6u18-linux-x64.bin
Sun Microsystems, Inc. Binary Code License Agreement
for the JAVA SE DEVELOPMENT KIT (JDK), VERSION 6
WebLogic Installation
50
Patch WebLogic
Patch WebLogic to recommended level to WDJ7
Install PATCH WDJ7 with BEA Smart Update
/apps/oracle/product/MW/utils/bsu
./bsu.sh
After installation, confirm that patch is installed
/apps/oracle/product/MW/utils/bsu
[oracle@gc11g bsu]$ ./bsu.sh -report -patch_id_mask=WDJ7
Patch Report
============
Report Info
Report Options
bea_home.................. ### OPTION NOT SET
product_mask.............. ### OPTION NOT SET
release_mask.............. ### OPTION NOT SET
profile_mask.............. ### OPTION NOT SET
patch_id_mask............. WDJ7
Report Messages
BEA Home.................. /apps/oracle/product/MW
Product Description
Product Name.............. WebLogic Server
Product Version........... 10.3.2.0
51
52
Passed
Passed
Actual
53
54
$ cat agent_down.ksh
export AGENT_INSTALL_PASSWORD=ob1grid
./agentDownload.linux_x64 -b /u01/app/oracle/product m
grid.dbaexpert.com -r 4900 -y
..
Configuration assistant "Agent Add-on Plug-in" Succeeded
Querying Agent status: Agent is running
Removing the copied stuff.....
Removed: /home/oracle/work/agentDownload11.1.0.1.0Oui/
oui_linux_x64.jar
Removed: /home/oracle/work/agentDownload11.1.0.1.0Oui/
agent_download.rsp
Removed:/home/oracle/work/agentDownload11.1.0.1.0Oui/Disk1
Log name of installation can be found at: /u01/app/oracle/
product/agentDownload.linux_x64071110152826.log"
55
56
58
59
60
UNIX_GROUP_NAME
FROM_LOCATION ORACLE_BASE
ORACLE_HOME
ORACLE_HOME_NAME
n_configurationOption
UNIX_GROUP_NAME=oinstall
FROM_LOCATION="/apps/oracle/software/
database/stage/products.xml"
ORACLE_BASE=/apps/oracle
ORACLE_HOME=/apps/oracle/product/
11.1.0/DB
ORACLE_HOME_NAME=11gDBHome1
n_configurationOption=3
$ ./runInstaller -ignoreSysPrereqs -force silent responseFile /apps/oracle/software/
database/response/enterprise.rsp
62
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
64
66
Copyright Information
Neither DBAExpert.com nor the author guarantee this
document to be error-free. Please provide comments
and feedback to linuxdba@gmail.com
APress Copyright 2008. This document or any
portions of this document may not be reproduced
without the expressed written consent from APress
Senior Editors or authors of the Linux for DBAs book.
Contact Information:
Charles Kim linuxdba@gmail.com
67
68
app
/bin
/dev
/etc
/home
* diag
oracle product 11.2.0
admin
cfgtoollogs
db
oracleasm
oracle / init.d
oracle
.oracle
.ssh
/usr
local
bin
/var
opt
oracle
/var
log
/u01
app
/lib
logs
/proc
/tmp
grid
product
grid
69
asm
app
clients
crs
diag
rdbms lsnrctl
netcman
ofm
diagtool
tnslsnr
db_name
$hostname
INSTANCE_NAME1
listener_$hostname
+asm
+ASM1
oracle
trace
trace
trace
alert
log.xml
core_dump_dest
background_dump_dest
$ORACLE_BASE/diag/db_name/$INSTANCE_NAME/
cdump
$ORACLE_BASE/diag/db_name/$INSTANCE_NAME/trace
user_dump_dest
ORACLE_BASE/diag/db_name/$INSTANCE_NAME/trace
70
71
Delete audit records thats older than find $ORACLE_HOME/rdbms/audit name "*.aud" -mtime +30 -exec rm
30 days
{} \;
Delete files in /tmp thats older than
30 days
-type f {} \;
dba -type f {} \;
Delete *.trc files more than 5 days old. find $TRACE_DIR -name '*.trc' type f -mtime +5 -exec rm {} \;
72
ls -alS | head -5
73
cd /u01/app/oracle/product/11.1.0/
asm
tar cvf - * | ( cd /u01/app/oracle/
product/11.1.0/db; tar xvfp - )
+%y%m%d-%H%M)
cd $ORACLE_BASE/diag/tnslsnr/`hostname`/${LISTENER_NAME}/
trace
lsnrctl << EOF
set current_listener ${LISTENER_NAME}
set log_status off
mv ${LISTENER_NAME}.log ${LISTENER_NAME}.${DATETIME}.log
set log_status on
EOF
75
76
Agenda
77
oswatcher
OS Watcher User Guide [ID 301137.1]
Manually Start OSWatcher
./startOSW.sh 60 720 &
Note:
1. collect statistics every 60 seconds
2. the 720 means to retain archive data for 30 days (24*30)
Add OSWatcher as part of the startup scripts in the /etc/rc.d/
rc.local file:
runuser oracle -c "/u01/app/oracle/UTIL/osw/startOSW.sh 60 720
http://DBAExpert.com
78
79
OSW Configuration
Modify /etc/sysconfig/osw configuration file:
[root@jin1 ~]# vi/etc/sysconfig/osw
# Set OSWHOME to the directory where your
OSWatcher tools are installed
#OSWHOME=/opt/osw-2.1.1
OSWHOME=/u01/app/oracle/UTIL/osw
# Set OSWINTERVAL to the number of seconds
between collections
OSWINTERVAL=60
# Set OSRETENTION to the number of hours logs are
to be retained
OSWRETENTION=72
# Set OSUSER to the owner of the OSWHOME
directory
OSWUSER=oracle
http://DBAExpert.com
80
OSWg
OS Watcher Graph (OSWg) User Guide [ID 461053.1]
OS Watcher Graph (OSWg) is a data parsing and graphing
utility which comes bundled with OSW v2.0.0 and higher.
Parses all the OSW vmstat and iostat log files contained in
an archive directory.
Requires java version 1.4.2 or higher
$ export DISPLAY=HOST_IP:0
$ java -jar oswg.jar -i $UTIL/osw/archive
http://DBAExpert.com
81