Tagged Tags:

[20180806]tune2fs调度保留块百分比.txt

–//生产系统一台dg磁盘空间满了.笔者前一阵子已经将*convert参数修改,增添磁盘,不过这么些分区里面包车型大巴数据文件还能升高,那样仍旧存
–//在磁盘空间不足的事态,平常应该移动数据文件到其他分区,然后rename.陡然想起创设分区时有一定的保留区给root用户,我们这一个分
–//区磁盘不小临近2T,那样依据5%的比重计算,有将近100G的长空或然浪费了.

–//参照他事他说加以考察从前测量试验的链接:
–//注意若是在mount状态下修改无效!!

1.环境:
# cat /proc/version
Linux version 2.6.39-300.26.1.el5uek
(mockbuild@ca-build56.us.oracle.com) (gcc version 4.1.2 20080704 (Red
Hat 4.1.2-52)) #1 SMP Thu Jan 3 18:31:38 PST 2013

# df -h /u02
Filesystem            Size  Used Avail Use% Mounted on
/dev/cciss/c0d1p1     1.7T  1.6T   20G  99% /u02
–//剩余20G.

# tune2fs -l /dev/cciss/c0d1p1
tune2fs 1.39 (29-May-2006)
Filesystem volume name:   /u02
Last mounted on:          <not available>
Filesystem UUID:          d9c0c411-25ea-4e21-b383-3ef446d2c064
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal resize_inode dir_index filetype
needs_recovery sparse_super large_file
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              219774976
Block count:              439520246
Reserved block count:     21976012

Free blocks:              432573167  
Free inodes:              219774965  
First block:              0  
Block size:               4096

Fragment size:            4096
Reserved GDT blocks:      919
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         16384
Inode blocks per group:   512
但是这个分区里面的数据文件还可以增长。Filesystem created:       Thu Feb 23 09:42:17 2017
但是这个分区里面的数据文件还可以增长。Last mount time:          Thu Feb 23 09:55:13 2017
Last write time:          Thu Feb 23 09:55:13 2017
Mount count:              3
Maximum mount count:      -1
Last checked:             Thu Feb 23 09:42:17 2017
Check interval:           0 (<none>)
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               128
Journal inode:            8
Default directory hash:   tea
Directory Hash Seed:      6e38ec2b-9916-496f-a143-b9b22a7e1f09
Journal backup:           inode blocks

–//21976012*但是这个分区里面的数据文件还可以增长。但是这个分区里面的数据文件还可以增长。4096/1024/1024/1024 = 83.83183288574218750000,保留84G.
但是这个分区里面的数据文件还可以增长。–//实际上-m 1也是萧条,笔者使用-r参数保留一定数量的块.
–//保留1G ,1024*1024*1024/4096 = 262144

2.调动保留块百分比:
–//关闭数据库.
但是这个分区里面的数据文件还可以增长。SYS@xxxxdg> shutdown immediate ;
Database closed.
Database dismounted.
ORACLE instance shut down.

# umount /dev/cciss/c0d1p1
umount: /u02: device is busy
umount: /u02: device is busy

# lsof /u02
COMMAND  PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
tnslsnr 9361 oracle  cwd    DIR 104,17     4096    2 /u02
–//奇怪.监听进度怎会涉嫌到/u02

# cat /proc/9361/environ  | tr ‘\0’ ‘\n’| grep u02
PWD=/u02

–//原本当时监听运行时的目录是/u02,截止监听进度.
$ lsnrctl stop
LSNRCTL for Linux: Version 11.2.0.4.0 – Production on 06-AUG-2018
08:29:12
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.100.76)(PORT=1521)))
The command completed successfully

# sync;sync
# umount /dev/cciss/c0d1p1
# tune2fs -r 262144 /dev/cciss/c0d1p1
tune2fs 1.39 (29-May-2006)
Setting reserved blocks count to 262144

# tune2fs -l /dev/cciss/c0d1p1 | egrep “Reserved block count”
Reserved block count:     262144

# mount /u02
# df -h /u02
Filesystem            Size  Used Avail Use% Mounted on
/dev/cciss/c0d1p1     1.7T  1.6T  103G  94% /u02

–//未来多了83G,应该不会再碰着磁盘空间不足的难点在/u02分区.

3.起动数量库.略.
$ lsnrctl start

SYS@xxxxdg> startup open read only;
ORACLE instance started.

Total System Global Area 8.0973E+10 bytes
Fixed Size                  2261968 bytes
Variable Size            9663679536 bytes
Database Buffers         7.1135E+10 bytes
Redo Buffers              171487232 bytes
Database mounted.
Database opened.

DGMGRL> show database xxxxdg
Database – xxxxdg
  Enterprise Manager Name: xxxx_dg
  Role:                    PHYSICAL STANDBY
  Intended State:          APPLY-ON
  Transport Lag:           0 seconds (computed 0 seconds ago)
  Apply Lag:               0 seconds (computed 0 seconds ago)
  Apply Rate:              34.40 MByte/s
  Real Time Query:         ON
  Instance(s):
    xxxxdg
Database Status:
SUCCESS

发表评论

电子邮件地址不会被公开。 必填项已用*标注