今天做测试发现Oracle服务器磁盘使用率达到100%导致Oracle Server 不能够正常运行,花了好久时间最后请教Linux高手清理了出了100GB的空间,下面列出用到的一些Linux Command, as Following:
1. Use 'df' to check file system disk usage
df -k
df -l
the outputs:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
145787328 36632352 101629808 27% /
/dev/sda1 101086 17504 78363 19% /boot
tmpfs 1733140 916028 817112 53% /dev/shm
2. Use 'du' check current folder disk usage and sort by size
du -sm * | sort -nr | more
the outputs sample:
16856 u01
14346 root
3210 usr
2455 home
895 dev
132 lib
112 etc
109 var
100 opt
40 sbin
29 lib64
12 boot
9 bin
1 tmp
1 tftpboot
1 srv
1 mnt
1 media
1 lost+found
0 sys
3. A very useful command for connect to oracle from root user:
su - oracle
sqlplus / as sysdba;
outputs:
SQL*Plus: Release 11.2.0.2.0 Production on Thu Sep 29 20:55:15 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
4. Shutdown oracle instance:
shutdown immediate;
outputs:
Database closed.
Database dismounted.
ORACLE instance shut down.
5. Exit from sqlplus and stop tns listener:
exit
tnslsnr stop
ps -ef|grep oracle
outputs:
oracle 23955 1 0 20:27 ? 00:00:00 /u01/oracle/bin/tnslsnr LISTENER -inherit
root 24508 21559 0 20:54 pts/1 00:00:00 su - oracle
oracle 24509 24508 0 20:54 pts/1 00:00:00 -bash
root 24569 24538 0 20:55 pts/1 00:00:00 su - oracle
oracle 24570 24569 0 20:55 pts/1 00:00:00 -bash
oracle 24635 24570 0 21:04 pts/1 00:00:00 ps -ef
oracle 24636 24570 0 21:04 pts/1 00:00:00 grep oracle
6. execute 'lsnrctl stop'
lsnrctl stop
outputs:
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 29-SEP-2011 21:06:58
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
The command completed successfully
7. start tns listener:
lsnrctl start
outputs:
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 29-SEP-2011 21:09:32
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Starting /u01/oracle/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.2.0 - Production
System parameter file is /u01/oracle/network/admin/listener.ora
Log messages written to /u01/diag/tnslsnr/yinjidan-lt/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=yinjidan-lt.tibco-support.com)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date 29-SEP-2011 21:09:32
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/oracle/network/admin/listener.ora
Listener Log File /u01/diag/tnslsnr/yinjidan-lt/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=yinjidan-lt.tibco-support.com)(PORT=1521)))
The listener supports no services
The command completed successfully
8. start oracle instance
sqlplus / as sysdba
startup
outputs:
ORACLE instance started.
Total System Global Area 1419685888 bytes
Fixed Size 2226472 bytes
Variable Size 1073743576 bytes
Database Buffers 335544320 bytes
Redo Buffers 8171520 bytes
Database mounted.
Database opened.