-
软
件
系
p>
统
运
维
指
导
手
册
精
编
W
O
R
< br>D
版
IBM system office room
【
A0816H-A0912AAAHH-
GX8Q8-
系统日常维护
指导手册
目录
1
、目的
.
..................................................
........
4
2
、适用范围
.................................................
......
4
3
、服务器及数据库概述
............................................ .
4
3.1
服务器概述
...........
.....................................
4
3.2
数据库概述
...........
.....................................
4
4
、系统服务程序的详细说明
.........................................
5
4.1
系统服务程序的构成
.
...............................
.........
5
4.2
系统服务程序的启动、关闭及维护管理
........................
5
4.2.1
dhcp
主服务
.
< br>.........................................
5
4.2.1.1
dhcp
主服务说明
.
...............................
5
4.2.1.2
dhcp
启动、关闭及进程查看方法
.
.................
5
4.2.1.3
配置说明
......................................
6
4.2.2
dhcp
从服务
.
< br>.........................................
6
4.2.2.1
dhcp
从服务说明
.
...............................
6
4.2.2.2
dhcp
启动、关闭及进程查看方法
.
.................
6
4.2.2.3
配置说明
......................................
7
4.2.3
web
管理模块
.
< br>........................................
7
4.2.3.1
web
管理模块中主要目录说明
.
....................
7
4.2.5.2
web
管理模块中各程序说明
.
......................
8
4.2.5.3
web
站点启动、关闭及进程查看方法
.
..............
8
4.2.5.4
web
日志说明
.
< br>..................................
8
4.2.5.5
日常维护
......................................
8
5
、服务器硬件维护(略)
...........................................
9
6
、
p>
linux
系统的日常维护
.
.................................
..........
9
6.1
定期检查磁盘空间
........
..................................
9
6.2
使用
top
工具监视
cpu
及内存的使用率
.......................
10
6.3
定期查看
root
邮件
........................................
10
6.4
定期查看系统日志
........
.................................
11
7
、备份策略
.................................................
.....
11
7.1
备份方式
............
.....................................
11
7.2
备份计划
............
.....................................
11
7.3
常见故障恢复
..........
...................................
11
7.3.1
实例故障
............
...............................
12
7.3.2
介质故障
............
...............................
12
9
、数据库的日常维护
.............................................
.
14
9.1
检查数据库的基本状况
.....................................
14
9.1.1
< br>检查
oracle
的进程
..................................
14
9.1.2
< br>检查
oracle
监听进程
................................
15
9.1.3
检查
oracle
实例状态
................................
16
9.2
检查数据库日志文件
.......................................
17
9.3
检查
oracle
对象的状态
....................................
17
9.3.1
< br>检查
oracle
控制文件状态
............................
17
9.3.2
< br>检查
oracle
在线日志状态
............................
18
9.3.3
< br>检查
oracle
表空间的状态
............................
18
9.3.4
< br>检查
oracle
所有数据文件状态
........................
18
9.3.5
检查
Oracle
所有回滚段的状态
.
........................
19
9.3.6
检查
Oracle
所有表、索引、存储过程、触发器等对象
的状
态
.............
..........................................
19
9.4
监控数据库表空间的使用情况(字典管理表空间)
.
.............
19
9.4.1
判断是否需要碎片整理
...............................
20
9.4.2
判断是否需要扩展表空间
.............................
20
9.5
查看数据库的连接情况
.....................................
21
9.6
术语解释
.
....................................
.............
22
10
、命令解释
................................................ .....
22
1
、目的
网
e
通宽带网络运营支撑系统使用的服务器中,服务器均采用
p>
red hat
linux as 4
操
作系统
,
数据库版本为:
oracle
10g
,随着业务的开展,
oracle
数据库中存储的数据量也不断增大,这样操作系统和数据库的日常
维护就显得十分重
要。
本手册详细描述了程序模块,
l
inux
操作系统,
DHCP
双机热备
、负载平
衡及
oracle
数据库等日
常检查的主要步骤,指导现场工程师对其进行监控和
维护。
2
、适用范围
使用者为网
e
通宽带网络运营支撑系统维护工程师
3
、服务器及数据库概述
3.1
服务器概述
服务器数量:
4
台,基本信息如下:
服务
器
机器型号
操作系统
安装的模
块
主机名
Ip
地址
主服
务器
DELL PC
RedHat
linux
Cm
鉴权数
AS
4.0
据库
oracle01
eth0:192.168.20.60
业务支撑
数据库
主
DHCP
服务
从服
务器
DELL PC
RedHat
linux
从
DHCP
AS
4.0
服务
oracle02
eth0:
192.168.20.61
3.2
数据库概述
数据库软件分别安装在主服务器上。
/dev/mapper/VolGroup00-LogVol00
逻辑卷上
ORACLE_BASE=/opt/oracle
ORACLE_HOME=/opt/oracle/product/
10.2.0
ORACLE_SID=oracmts
4
、系统
服务程序的详细说明
4.1
系统服务程序的构成
DHCP
主程序:
所在服务器
主服务器(
ip:
192.168.20.60
)
程序名称
Dhcpd
所在目录
/opt/dpcp
DHCP
从程序:
所在服务器
从服务器(
ip:
192.168.20.61
)
程序名称
Dhcpd
所在目录
/opt/dpcp
4.2
系统服务程序的启动、关闭及维护管理
4.2.1 dhcp
主服务
4.2.1.1 dhcp
主服务说明
所在目录
程序名称
程序简要说明
/opt/dpcp
Dhcpd
Dhcp
主程序
/etc/
主程序的配置文件
/var/state/dhcp/
租约数据库
4.2.1.2
dhcp
启动、关闭及进程查看方法
1
、启动方法:
输入
:
cd
/opt/dpcp
./dhcpd
即可
注意:请首先确认数据库服务正常,数据库监听正常。
输出
:
[root@localhost dhcp]$$
./dhcpd
Internet Systems Consortium DHCP Server
V3.0.4
Copyright 2004-2006
Internet Systems Consortium.
All rights reserved.
For info, please visit
/sw/dhcp/
Wrote 1 leases to
leases file.
Listening on LP
F/eth0/00:0c:29:fb:d4:32/192.168.50/24
Sending on LPF/eth0/00:0c:29:fb:d4:32
/192.168.50/24
Sending on
Socket/fallback/fallback-net
说明
:
dhcp
启动时,会启动
p>
1
个进程,正常情况下,
dhcp
启动的进程数为
1
个。
2
、关闭方法
输入:
kill pid
说明
:
pid
为进程号,
可使用进程查看获得。如
|-dhcpd(4665)
,则进程
id
为
4665
,则
kill 4665
就可关闭
d
hcp
。
3
、进程查看
输入:
[root@localhost dhcp]#
pstree -p | grep dhcp
输出
:
|-dhcpd(4665)
4.2.1.3
配置说明
启动配置文件:
etc/
可使用
more
或者
tail
命令查看
配置服务配置,更改后需要
重新启动才能生效,该配置文件的设置需要与从
服务器的配置文件吻合。配置文件全文如
下:
#
#
DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/
#
ddns-update-style none;
failover peer
{
primary;
address
192.168.20.60;
port
519;
peer address
192.168.20.61;
peer
port 520;
max-
response-delay 60;
max-unacked-updates 10;
mclt 600;
split
128;
load balance
max seconds 3;
}
subnet 192.168.20.0 netmask
255.255.255.0{
}
p>
#---------------cisico1_cm---------------
------------
subnet
10.10.128.0 netmask 255.255.240.0{
option routers
10.10.128.1;
filename
next-
server 192.168.20.60;
default-lease-time 3600;
pool
{
failover
peer
deny
dynamic bootp clients;
range 10.10.128.2 10.10.143.254;
}
}
#--------------
-cisico1_iad---------------------------
shared-network
cisico1_iad{
subnet 10.8.80.0 netmask
255.255.255.0{
option routers 10.8.80.1;
option domain-
name-servers 219.150.32.132,
219.150.150.150,
219.146.0.130;
default-lease-time 3600;
pool
{
failover peer
deny dynamic
bootp clients;
range 10.8.80.2
10.8.80.254;
}
}
}
#--------------
-cisico1_cpe---------------------------
shared-network cisico1_cpe{
subnet 219.234.16.0 netmask
255.255.248.0{
option routers 219.234.16.1;
option domain-name-
servers 219.150.32.132,
219.150.150.150,
219.146.0.130;
default-lease-time 3600;
pool
{
failover peer
deny dynamic bootp clients;
range 219.234.16.2 219.234.23.254;
}
}
}
租约数
据库
/var/state/dhcp/
可使用
more
或者
tail
命令查看
记录当前服务器与对方服务
器的服务状态与分配的
ip
租约。
示例如下:
lease
192.168.5.254 {
starts 2
2007/11/27 13:15:22;
ends
3 2007/11/28 13:15:22;
tstp 3 2007/11/28 13:15:22;
binding state active;
next
binding state free;
hardware ethernet 00:11:1a:07:2e:8e;
uid
option
-id 0:11:1a:7:2e:8e;
}
Dhcp
状态如下:
failover peer
my
state
normal
at
2007/11/27 13:15:22
peer
state
normal
at
2007/11/27 13:15:22
}
4.2.2 dhcp
从服务
4.2.2.1 dhcp
从服务说明
所在目录
程序名称
程序简要说明
/opt/dpcp
Dhcpd
Dhcp
主程序
/etc/
主程序的配置文件
/var/state/dhcp/
租约数据库
所在目录
程序名称
程序简要说明
/opt/dpcp
Dhcpd
Dhcp
主程序
/etc/
主程序的配置文件
/var/state/dhcp/
租约数据库
4.2.2.2
dhcp
启动、关闭及进程查看方法
1
、启动方法:
输入
:
cd
/opt/dpcp
./dhcpd
即可
注意:请首先确认数据库服务正常,数据库监听正常。
输出
:
[root@localhost dhcp]$$
./dhcpd
Internet Systems
Consortium DHCP Server V3.0.4
Copyright 2004-2006 Internet Systems
Consortium.
All rights
reserved.
For info, please
visit /sw/dhcp/
Wrote 1 leases to leases
file.
Listening on LPF/eth0/
00:0c:29:fb:d4:32/192.168.50/24
Sending on LPF/eth0/00:0c:29:fb:d4:32
/192.168.50/24
Sending on
Socket/fallback/fallback-net
说明
:
dhcp
启动时,会启动
p>
1
个进程,正常情况下,
dhcp
启动的进程数为
1
个。
2
、关闭方法
输入:
kill pid
说明
:
pid
为进程号,
可使用进程查看获得。如
|-dhcpd(4665)
,则进程
id
为
4665
,则
kill 4665
就可关闭
d
hcp
。
3
、进程查看
输入:
[root@localhost dhcp]#
pstree -p | grep dhcp
输出
:
|-dhcpd(4665)
4.2.2.3
配置说明
启动配置文件:
etc/
可使用
more
或者
tail
命令查看
.
配置服务配置,更改后需要重新启动才能生效,该配置文件的设置需要与主
服务器的配置
文件吻合。配置文件全文如下:
#
# DHCP Server Configuration
file.
# see
/usr/share/doc/dhcp*/
#
ddns-update-
style none;
failover peer
{
secondary;
address
192.168.20.61;
port 520;
peer address
192.168.20.60;
peer
port 519;
max-
response-delay 60;
max-unacked-updates 10;
mclt 600;
#split
128;
load balance
max seconds 3;
}
subnet 192.168.20.0 netmask
255.255.255.0{
}
#--------------
-cisico1_cm---------------------------
subnet 10.10.128.0 netmask
255.255.240.0{
option routers 10.10.128.1;
filename
next-server
192.168.20.60;
default-lease-time 3600;
pool
{
failover
peer
deny
dynamic bootp clients;
range 10.10.128.2 10.10.143.254;
}
}
#--------------
-cisico1_iad---------------------------
shared-network cisico1_iad{
subnet 10.8.80.0 netmask
255.255.255.0{
option routers 10.8.80.1;
option domain-name-servers
219.150.32.132,
219.150.150.150,
219.146.0.130;
default-lease-time 3600;
pool
{
failover peer
deny dynamic
bootp clients;
range 10.8.80.2
10.8.80.254;
}
}
}
p>
#---------------cisico1_cpe--------------
-------------
shared-network
cisico1_cpe{
subnet
219.234.16.0 netmask 255.255.248.0{
option routers 219.234.16.1;
option domain-name-
servers 219.150.32.132,
219.150.150.150,
219.146.0.130;
default-lease-time 3600;
pool
{
failover peer
deny dynamic bootp clients;
range 219.234.16.2 219.234.23.254;
}
}
}
租约数据库
/var/state/dhcp/
记录当前服务器与对方
服务器的服务状态与分配的
ip
租约。
示例如下:
lease
192.168.5.254 {
starts 2
2007/11/27 13:15:22;
ends
3 2007/11/28 13:15:22;
tstp 3 2007/11/28 13:15:22;
binding state active;
next
binding state free;
hardware ethernet 00:11:1a:07:2e:8e;
uid
option
-id 0:11:1a:7:2e:8e;
}
Dhcp
状态如下:
failover peer
my
state
normal
at
2007/11/27 13:15:22
peer state
normal
at
2007/11/27 13:15:22
}
4.2.3
web
管理模块
4.2.3.1
web
管理模块中主要目录说明
/o
pt/apache-2.0.52
为
apache
模块所在目录
/opt/taiyuan
为
web
程序存储目录
4.2.5.2
web
管理模块中各程序说明
命令所
在目录:
/opt/apache/bin
命令
命令说明
apachectl
Apache
HTTP
服务器控制接口
httpd
Apache
超文本传输协议服务器
ab
Apache
HTTP
服务器性能测试工具
apxs
APache
功能扩展工具
dbmmanage
建立和更新
p>
DBM
形式的基本认证文件
htdigest
建立和更新摘要认证文件
htpasswd
建立和更新基本认证文件
logresolve
将
Apache
日志文件中的
IP
< br>地址解析为主机名
rotatelogs
滚动
Apache
日志而无须终止服务器
4.2.5.3
web
站点启动、关闭及进程查看方法
命令所在目录
命令
命令说明
/opt/apache/bin
./apachectl start
启动
httpd
/opt/apache/bin
./apachectl startssl
启动
httpd
并加载
SSL
服务
/opt/apache/bin
./apachectl stop
关闭
apache
/opt/apache/bin
./apachectl status
查看
apache
的状态
4.2.5.4 web
日志说明
<
/p>
Log
存放目录为:
/opt/apac
he/logs
/opt/apache/logs/access_log
为所有访问网站的
日志
/opt/apache/logs/error_lo
g
为错误信息日志
/opt/apa
che/logs/
为主进程的
pid
号
/opt/apache/logs/ssl_engine_log
为
ssl
引擎日志,即
ssl
的运行日志,
可以通过查看此日志了解运行状态及错误。
/opt/apache/logs/ssl_request_log
为
ssl
请求日志
即是哪个
ip
使用
h
ttps ssi
协议登录
web
站点
,请求的时间,内容,访问
的页面等。
4.2.5.5
日常维护
维护分为:业务维护及系统维护
业务维护就是,利用系统管理员的身份,查看操作日志
系统维护是:定期查看系统日志,
apache
日志等,看是否有运行错误,并
定期备份日志。
5
、服务器硬件维护(略)
6
、
linux
系统的
日常维护
6.1
定期检查磁盘空间
使用
df
显示磁盘空间
输入:
[oracle@localhost server]$$
df
输出:
Filesystem 1K-blocks
Used Available Use%
Mounted
on
/dev/cciss/c0d0p2
107938336 7612144 94843208 8%
/
/dev/cciss/c0d0p1 101086
12308 83559 13% /boot
none
2073908 4 2073904 1%
/dev/shm
/dev/cciss/c0d0p5 30976636
185056 29218016 1%
/home
说明:
p>
这里显示了
/
、
/boot
、
/home
分区
挂载的系统分区使用的大小,磁盘
空间以
p>
k
为单位。
可以加参数
-h
[oracle@localhost server]$$ df
-h
Filesystem
Size Used Avail Use% Mounted on
/dev/cciss/c0d0p2 103G 7.3G 91G
8% /
/dev/cciss/c0d0p1
99M 13M 82M 13% /boot
none 2.0G 4.0K 2.0G
1% /dev/shm
/dev/cciss/c0d0p5 30G 181M 28G
1% /home
注意:
当某空间使用率超过
85
%时,通过
du
查看是哪些文件占用的空间比较大
例如
/home
使用了
85
%
cd
/home
以
root
用户查看
su
输入
r
oot
用户密码
[root@localhost /]# du -m --max-
depth=1
-m
是以
M
大小显示
--max-depth=1
表示只是一级子目录的大小,如果
想查看二级的就写为
2
找出占用很大的文件,经判断后决定删除或转移。
6.2
使用
top
< br>工具监视
cpu
及内存的使用率
每隔
5
秒,
t
op
工具确定哪些进程消耗最多的
cpu
时间,并按递减顺序在
屏幕显示。
输入:
[oracle@localhost /]$$
top
输出:
top - 10:52:46 up 6 days, 39 min, 2
users, load average:
0.12, 0.09,
0.02
Tasks: 123 total, 1
running, 122 sleeping, 0 stopped, 0
zombie
Cpu(s): 0.2% us, 0.2% sy,
0.0% ni, 99.3% id, 0.4% wa,
0.0% hi,
0.0% si
Mem: 8247956k
total, 1828612k used, 6419344k free,
119476k buffers
Swap: 8385920k total, 0k used,
8385920k free,
1526064k cached
PID USER PR NI VIRT RES
SHR S %CPU %MEM TIME+ COMMAND
1 root 16 0 3004 552 472 S
0.0 0.0 0:01.02
init
2 root RT 0 0
0 0 S 0.0 0.0 0:01.28
migration/0
3 root 34 19 0
0 0 S 0.0 0.0 0:00.04
ksoftirqd/0
4 root RT 0 0
0 0 S 0.0 0.0 0:01.28
migration/1
5 root 34 19 0
0 0 S 0.0 0.0 0:00.04
ksoftirqd/1
6
root RT 0 0 0 0 S 0.0 0.0
0:00.65
migration/2
说明:
当发现个别进程占用率很高,可以通过用“
ps
–
axj | grep
进程名”<
/p>
查看这个进程在进行什么操作,如果发现这个进程持续的时间很长,而且非
系统必要进程;可以通过“
kill
–
9
”
p>
进程的
PID
号,将进程杀死。(不确
p>
定情况下,请不要使用);
退出
top
用
ctrl+c
。
6.3
定期查看
root
邮件
输入:
[oracle@localhost log]$$ su
-l
Password:
[root@localhost root]# mail
输出:
1 root@
Fri Sep 8 16:23 18/704
Insight
Management Agents Trap Alarm
-
-
-
-
-
-
-
-
-
上一篇:NCBI使用方法
下一篇:Proteus的用法