【Linux】将Oracle安装目录从根目录下迁移到逻辑卷

本文详细记录了如何将Oracle在Linux系统中的安装目录从根目录迁移到逻辑卷的过程,包括磁盘现状分析、分区创建物理卷、卷组和逻辑卷建立,以及迁移后启动数据库的验证步骤,旨在解决根目录空间不足的问题并优化磁盘管理。
摘要由CSDN通过智能技术生成

Linux】将Oracle安装目录从根目录下迁移到逻辑卷

1.1  BLOG文档结构图

 

1.2  前言部分

1.2.1  导读和注意事项

各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O(∩_∩)O~:

① Linux逻辑卷的创建和管理(重点)

Tips:

① 本文在itpub(http://blog.itpub.net/26736162)、博客园(http://www.cnblogs.com/lhrbest)和微信公众号(xiaomaimiaolhr)上有同步更新。

② 文章中用到的所有代码、相关软件、相关资料及本文的pdf版本都请前往小麦苗的云盘下载,小麦苗的云盘地址见:http://blog.itpub.net/26736162/viewspace-1624453/。

③ 若网页文章代码格式有错乱,请下载pdf格式的文档来阅读。

④ 在本篇BLOG中,代码输出部分一般放在一行一列的表格中。

本文有错误或不完善的地方请大家多多指正,您的批评指正是我写作的最大动力。

1.2.2  相关文章链接

linux逻辑卷管理:http://blog.itpub.net/26736162/viewspace-2124620/,这篇文章非常不错。

1.2.3  本文简介

由于Oracle版本太多,鉴于学习使用,所以,小麦苗在RHEL6.5上安装了Oracle 11.2.0.3、Oracle 10.2.0.1和Oracle 10.2.0.4。但是由于没有采用逻辑卷的管理方式,现在根目录磁盘空间不足,而且也添加了好几块硬盘了,管理非常不方便。以后等Oracle 12cR2出来后还得安装在一起,想了想还是一次性将这些Oracle的安装目录都迁移到逻辑卷中,以后也好管理。本文记录了迁移过程,以备有同样需求的朋友使用。

1.3  迁移过程

1.3.1  磁盘现状

 

最后操作的结果就是把磁盘2、3、4和5去掉,只剩下1块或2块磁盘。

1.3.2  分区并创建物理卷

[root@rhel6_lhr ~]# df -h

Filesystem                 Size  Used Avail Use% Mounted on

/dev/sda2                   48G   43G  3.0G  94% /

tmpfs                      2.0G  432M  1.6G  22% /dev/shm

/dev/sda1                  283M   58M  210M  22% /boot

/dev/mapper/testvg-testlv  380M  321M   40M  90% /var/lib/mysql

/dev/sdc1                  9.9G  4.0G  5.5G  43% /u03

/dev/sde1                   20G  7.3G   12G  39% /u04

/dev/sdf1                   50G   30G   18G  63% /u05

[root@rhel6_lhr ~]# fdisk -l |grep dev

Disk /dev/sda: 107.4 GB, 107374182400 bytes

/dev/sda1   *           1          39      307200   83  Linux

/dev/sda2              39        6401    51104768   83  Linux

/dev/sda3            6401        6528     1015808   82  Linux swap / Solaris

/dev/sda4            6528       13054    52427455    5  Extended

Disk /dev/sdc: 10.7 GB, 10737418240 bytes

/dev/sdc1               1        1305    10482381   83  Linux

Disk /dev/sdd: 5368 MB, 5368709120 bytes

Disk /dev/sdf: 53.7 GB, 53687091200 bytes

/dev/sdf1               1        6527    52428096   83  Linux

Disk /dev/sdg: 21.5 GB, 21474836480 bytes

Disk /dev/sde: 21.5 GB, 21474836480 bytes

/dev/sde1               1        2610    20964793+  83  Linux

Disk /dev/mapper/testvg-testlv: 419 MB, 419430400 bytes

[root@rhel6_lhr ~]#

[root@rhel6_lhr ~]# fdisk /dev/sda

WARNING: DOS-compatible mode is deprecated. It’s strongly recommended to

         switch off the mode (command ‘c’) and change display units to

         sectors (command ‘u’).

Command (m for help): p

Disk /dev/sda: 107.4 GB, 107374182400 bytes

255 heads, 63 sectors/track, 13054 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x000bd0a0

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          39      307200   83  Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2              39        6401    51104768   83  Linux

/dev/sda3            6401        6528     1015808   82  Linux swap / Solaris

Command (m for help): m

Command action

   a   toggle a bootable flag

   b   edit bsd disklabel

   c   toggle the dos compatibility flag

   d   delete a partition

   l   list known partition types

   m   print this menu

   n   add a new partition

   o   create a new empty DOS partition table

   p   print the partition table

   q   quit without saving changes

   s   create a new empty Sun disklabel

   t   change a partition’s system id

   u   change display/entry units

   v   verify the partition table

   w   write table to disk and exit

   x   extra functionality (experts only)

Command (m for help): l

0  Empty           24  NEC DOS         81  Minix / old Lin bf  Solaris       

1  FAT12           39  Plan 9          82  Linux swap / So c1  DRDOS/sec (FAT-

2  XENIX root      3c  PartitionMagic  83  Linux           c4  DRDOS/sec (FAT-

3  XENIX usr       40  Venix 80286     84  OS/2 hidden C:  c6  DRDOS/sec (FAT-

4  FAT16 <32M      41  PPC PReP Boot   85  Linux extended  c7  Syrinx        

5  Extended        42  SFS             86  NTFS

  • 22
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

刘浩亮

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值