技术头条 - 一个快速在微博传播文章的方式     搜索本站
您现在的位置首页 --> Oracle --> Oracle数据恢复:格式化会损坏多少数据?

Oracle数据恢复:格式化会损坏多少数据?

浏览:1791次  出处信息

    有用户误操作格式化硬盘,导致数据丢失,以Oracle数据库为例,格式化会损失多少数据呢?

    以下是我格式化一块硬盘,创建一个1T的磁盘分区,mkfs的输出:

    Disk /dev/sdb: 2089.0 GB, 2089072092672 bytes

    255 heads, 63 sectors/track, 253981 cylinders

    Units = cylinders of 16065 * 512 = 8225280 bytes

     Device Boot      Start         End      Blocks   Id  System

    Command (m for help): n

    Command action

     e   extended

     p   primary partition (1-4)

    p

    Partition number (1-4): 1

    First cylinder (1-253981, default 1):

    Using default value 1

    Last cylinder or +size or +sizeM or +sizeK (1-253981, default 253981): +1024000M

    Command (m for help): p

    Disk /dev/sdb: 2089.0 GB, 2089072092672 bytes

    255 heads, 63 sectors/track, 253981 cylinders

    Units = cylinders of 16065 * 512 = 8225280 bytes

     Device Boot      Start         End      Blocks   Id  System

    /dev/sdb1               1      124495  1000006056   83  Linux

    Command (m for help): w

    The partition table has been altered!

    Calling ioctl() to re-read partition table.

    Syncing disks.

    [root@sms-db-b /]# mkfs /dev/sdb1

    mke2fs 1.35 (28-Feb-2004)

    Filesystem label=

    OS type: Linux

    Block size=4096 (log=2)

    Fragment size=4096 (log=2)

    125009920 inodes, 250001514 blocks

    12500075 blocks (5.00%) reserved for the super user

    First data block=0

    Maximum filesystem blocks=4294967296

    7630 block groups

    32768 blocks per group, 32768 fragments per group

    16384 inodes per group

    Superblock backups stored on blocks:

     32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

     4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,

     102400000, 214990848

    Writing inode tables: .done                           

    Writing superblocks and filesystem accounting information: 

    done

    This filesystem will be automatically checked every 39 mounts or

    180 days, whichever comes first.  Use tune2fs -c or -i to override.

    这期间,mkfs的输出提示最为关键,mkfs创建了7630个块组,每个Group 32768个数据块,每个Group 16384个inodes。那么这里的inodes分配的空间就应该是覆盖了原始数据的部分。

    那么每个inode要分配多少空间呢?

    [root@db eygle]# dumpe2fs -h /dev/sdb1|grep node

    dumpe2fs 1.35 (28-Feb-2004)

    Filesystem features:      resize_inode filetype sparse_super large_file

    Inode count:              125009920

    Free inodes:              125009909

    Inodes per group:         16384

    Inode blocks per group:   512

    First inode:              11

    Inode size:               128

    这里的Inode Size 是128 Bytes,16384 * 128 / 1024 /1024 结果就是2M,7630个Block Group,就是14G左右的空间。

    参考文章:

    http://it.dianping.com/inode-related-conceptions-in-linux-file-system.htm

建议继续学习:

  1. 这样恢复 Linux 分区下误删的文件    (阅读:4060)
  2. 利用binlog来恢复数据库    (阅读:4065)
  3. 恢复删除的数据表,数据库    (阅读:3838)
  4. Oracle数据恢复专题    (阅读:3711)
  5. Mysql .frm损坏后如何恢复    (阅读:3440)
  6. Oracle数据恢复 - Linux / Unix 误删除的文件恢复    (阅读:3367)
  7. MySQL数据库InnoDB数据恢复工具使用总结    (阅读:3098)
  8. linux上ext2文件系统中,用debugfs来恢复被删除的文件    (阅读:2852)
  9. 实例:Linux EXT3文件系统下成功恢复误删的文件    (阅读:2671)
  10. Oracle数据恢复:格式化,Raid损坏,文件覆盖恢复    (阅读:2357)
QQ技术交流群:445447336,欢迎加入!
扫一扫订阅我的微信号:IT技术博客大学习
© 2009 - 2024 by blogread.cn 微博:@IT技术博客大学习

京ICP备15002552号-1