作品展示网站 源码,wordpress简介,怎么制作网页链接,河南省建设资格注册中心网站虚拟机中的Oracle运行的久了#xff0c;归档、数据文件不断增长#xff0c;原来安装ORACLE的分区空间不足。此时可以重新向虚拟机增加一块硬盘#xff0c;将ORACLE的数据文件或归档的目录挂载到新增加的磁盘分区上。--我这里未新增加磁盘#xff0c;而是将原磁盘未划分分区…虚拟机中的Oracle运行的久了归档、数据文件不断增长原来安装ORACLE的分区空间不足。此时可以重新向虚拟机增加一块硬盘将ORACLE的数据文件或归档的目录挂载到新增加的磁盘分区上。--我这里未新增加磁盘而是将原磁盘未划分分区的部分重新分区、格式化来挂载使用。--原理和新增加磁盘来分区并格式化再挂载是一样了。1.磁盘空间使用情况的查看--需要经常关注磁盘空间使用情况--如果空间使用达到100%ORACLE数据库正在运行会HANG住此时通过SQLPLUS登陆也会有出错提示-具体提示未记录。如未启动不能启动**。http://blog.csdn.net/q947817003/article/details/12308099 一次因磁盘空间不足归档无法完成导致DML操作HANG住。[rootoel-01 ~]# df -hFilesystem Size Used Avail Use% Mounted on/dev/sda2 19G 13G 5.4G 71% //dev/sda1 99M 21M 74M 22% /boottmpfs 3.0G 528M 2.5G 18% /dev/shm/dev/sda5 4.6G 3.2G 1.2G 73% /backup计划重新挂载的就是这个目录---仅为测试具体根据实际需要来确定需要挂载到新分区的目录。[rootoel-01 ~]# du -sh /home/oracle/rmanlog/44K /home/oracle/rmanlog/[rootoel-01 ~]# ls /home/oracle/rmanlog/back01.log back11.log back13.log back22.log back24.logback02_1.log back12.log back21.log back23.log rmanarch2013061815-40.log############2.使用fdisk查看分对磁盘分区--我这里因知道我的磁盘未使用完直接就可以用fdisk来分区。如是新增加磁盘可以使用 fdisk -l 来查看出新磁盘的名称。 --fdisk用法可以百度。开始分区--软件、系统提示为节约篇幅已经省略。[rootoel-01 ~]# fdisk /dev/sdaCommand (m for help): pDisk /dev/sda: 32.2 GB, 32212254720 bytes255 heads, 63 sectors/track, 3916 cylindersUnits cylinders of 16065 * 512 8225280 bytesDevice Boot Start End Blocks Id System/dev/sda1 * 1 13 104391 83 Linux/dev/sda2 14 2563 20482875 83 Linux/dev/sda3 2564 2824 2096482 82 Linux swap / Solaris/dev/sda4 2825 3916 8771490 5 Extended/dev/sda5 2825 3433 4891761 83 LinuxCommand (m for help): nFirst cylinder (3434-3916, default 3434):Using default value 3434Last cylinder or size or sizeM or sizeK (3434-3916, default 3916): 100M ----测试用所以只划分了100M。Command (m for help): p --验证已经划分了新分区Disk /dev/sda: 32.2 GB, 32212254720 bytes255 heads, 63 sectors/track, 3916 cylindersUnits cylinders of 16065 * 512 8225280 bytesDevice Boot Start End Blocks Id System/dev/sda1 * 1 13 104391 83 Linux/dev/sda2 14 2563 20482875 83 Linux/dev/sda3 2564 2824 2096482 82 Linux swap / Solaris/dev/sda4 2825 3916 8771490 5 Extended/dev/sda5 2825 3433 4891761 83 Linux/dev/sda6 3434 3446 104391 83 LinuxCommand (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.WARNING: Re-reading the partition table failed with error 16: Device or resource busy.The kernel still uses the old table. ----重读分区表失败用的扔是旧的分区表--直接格式时会出错找不到新分区。The new table will be used at the next reboot.Syncing disks.##################3.格式化分区--附格式化时出错解决[rootoel-01 ~]# mkfs -t ext3 /dev/sda6mke2fs 1.39 (29-May-2006)Could not stat /dev/sda6 --- No such file or directory ---因为新分区表未被读取The device apparently does not exist; did you specify it correctly?对于这个出错提示方法一重启后系统重新读取分区表即可解决。方法二使用partprobe命令partprobe包含在parted的rpm软件包中。partprobe可以修改kernel中分区表使kernel重新读取分区表。因此使用该命令就可以创建分区并且在不重新启动机器的情况下系统能够识别这些分区。[rootoel-01 ~]# rpm -q partedparted-1.8.1-29.el5[rootoel-01 ~]# partprobeError: Error opening /dev/md0: No such file or directory[rootoel-01 ~]# partprobe[rootoel-01 ~]#mkfs -t ext3 /dev/sda6---使用这个语句来格式化新分区mke2fs 1.39 (29-May-2006)Filesystem labelOS type: LinuxBlock size1024 (log0)Fragment size1024 (log0)26104 inodes, 104388 blocks5219 blocks (5.00%) reserved for the super userFirst data block1Maximum filesystem blocks6737100813 block groups8192 blocks per group, 8192 fragments per group2008 inodes per groupSuperblock backups stored on blocks:8193, 24577, 40961, 57345, 73729Writing inode tables: doneCreating journal (4096 blocks): doneWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 32 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.#####################################4.挂载目录的测试之直接挂载这种方式不考虑原目录下是否存在文件原目录有数据而未移出时直接挂载无法访问到原目录下数据此时原目录下文件仍在原目录所在的磁盘上。[rootoel-01 ~]# mount /dev/sda6 /home/Oracle/rmanlog/[rootoel-01 ~]# cd /home/oracle/rmanlog/[rootoel-01 rmanlog]#lslostfound[rootoel-01 rmanlog]# umount /dev/sda6 ---不能在挂载的目录内执行 umountumount: /home/oracle/rmanlog: device is busyumount: /home/oracle/rmanlog: device is busy[rootoel-01 rmanlog]# cd[rootoel-01 ~]# umount /dev/sda6[rootoel-01 ~]# cd /home/oracle/rmanlog/[rootoel-01 rmanlog]# lsback01.log back13.log back24.logback02_1.log back21.log rmanarch2013061815-40.logback11.log back22.logback12.log back23.log###################################4.挂载目录之先移动数据再挂载适用于所需要重新挂载的目录下有文件[rootoel-01 Oracle]# pwd/home/oracle[rootoel-01 oracle]# mkdir rmanlogbak[rootoel-01 oracle]# mv rmanlog/* ./rmanlogbak/[rootoel-01 oracle]# ls ./rmanlogbak/back01.log back13.log back24.logback02_1.log back21.log rmanarch2013061815-40.logback11.log back22.logback12.log back23.log[rootoel-01 oracle]# ls ./rmanlog/[rootoel-01 oracle]#mount /dev/sda6 /home/oracle/rmanlog/[rootoel-01 oracle]# ls ./rmanloglostfound[rootoel-01 oracle]# mv ./rmanlogbak/* ./rmanlog 把之前移出的数据再移动回来[rootoel-01 oracle]# ls ./rmanlog/ 查看文件都在重新挂载完成。back01.log back13.log back24.logback02_1.log back21.log lostfoundback11.log back22.log rmanarch2013061815-40.logback12.log back23.log[rootoel-01 oracle]# ls ./rmanlogbak/[rootoel-01 oracle]# df -hFilesystem Size Used Avail Use% Mounted on/dev/sda2 19G 13G 5.4G 71% //dev/sda1 99M 21M 74M 22% /boottmpfs 3.0G 528M 2.5G 18% /dev/shm/dev/sda5 4.6G 3.2G 1.2G 73% /backup/dev/sda6 99M 5.6M 89M 6% /home/oracle/rmanlog##############5.修改/etc/fstab实现开机自动挂载分区红色语句为新增的因为格式时未指定LABEL直接写上分区名就可以。[rootoel-01 ~]# vi /etc/fstabLABEL/ / ext3 defaults 1 1LABEL/boot /boot ext3 defaults 1 2tmpfs /dev/shm tmpfs defaults,size3G 0 0devpts /dev/pts devpts gid5,mode620 0 0sysfs /sys sysfs defaults 0 0proc /proc proc defaults 0 0LABELSWAP-sda3 swap swap defaults 0 0LABEL/backup /backup ext3 defaults 0 0/dev/sda6 /home/oracle/rmanlog ext3 defaults 0 0/etc/fstab 10L, 634C written[rootoel-01 ~]# mount -a ---这里没有错误提示(执行语句无输出)就证明写入的语句没问题。[rootoel-01 ~]# mount -o remount,rw,auto /home/oracle/rmanlog ---同样无出错提示注mount -a -a代表auto 是将 /etc/fstab 文件中的挂载内容全部重新挂载一次mount -o remount,rw,auto / -o remount 参数为重新挂载 rw为挂载为可读写 auto 是指定此文件系统是否以允许被mount -a 自动挂载查看分区及挂载目录已经挂载到新分区进入挂载的目录查看文件都在。--完成。[rootoel-01 ~]# df -hFilesystem Size Used Avail Use% Mounted on/dev/sda2 19G 13G 5.4G 71% //dev/sda1 99M 21M 74M 22% /boottmpfs 3.0G 528M 2.5G 18% /dev/shm/dev/sda5 4.6G 3.2G 1.2G 73% /backup/dev/sda6 99M 5.6M 89M 6% /home/oracle/rmanlog[rootoel-01 ~]# cd /home/oracle/rmanlog[rootoel-01 rmanlog]# lsback01.log back11.log back13.log back22.log back24.log rmanarch2013061815-40.logback02_1.log back12.log back21.log back23.log lostfound