Linux服务器磁盘扩展和Oracle表空间文件迁移操作记(2)

注:这里填写分区的end柱面,或者填写+??M,K的方式,linux会自动算出柱面号。我这里要把剩余的硬盘空间全都分到这个分区,所以使用默认值。

Command (m for help): p

Disk /dev/sdb: 299.4 GB, 299439751168 bytes

255 heads, 63 sectors/track, 36404 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start        End      Blocks  Id  System

/dev/sdb1              1        7296    58605088+  83  Linux

/dev/sdb2            7297      14592    58605120  83  Linux

/dev/sdb3          14593      32829  146488702+  5  Extended

/dev/sdb5          14593      21888    58605088+  83  Linux

/dev/sdb6          21889      32829    87883551  83  Linux

再次查看下分区情况,发现/dev/sdb6/已经创建好了。

Command (m for help): w

The 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.

执行W命令,写入分区表。

注意:以上操作中如果有误,可以随时撤销,但执行写入后,就不能更改了。

发现,写入后系统提示错误,资源正忙,新的分区表重启后有效。

于是,重启机器,注意重启前,关闭生产程序进程,和oracle数据:

$xxx/bin/xxx_stop

[root@ccsvr ~]# su - oracle

[oracle@ccsvr ~]$ sqlplus / as sysdba;

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL>

重启后,对/dev/sdb5,/dev/db6格式化:

[root@ccsvr /]# mkfs -t ext3 /dev/sdb6

mke2fs 1.35 (28-Feb-2004)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

10993664 inodes, 21970887 blocks

1098544 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=25165824

671 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

Writing inode tables: done                         

Creating journal (8192 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 24 mounts or

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

然后,创建需要挂载的目录,将分区挂载:

[root@ccsvr /]# mkdir AFC_DB5

[root@ccsvr /]# mkdir AFC_DB6

[root@ccsvr /]# ll

total 216

drwxr-xr-x    6 afc    aas      4096 Dec  2  2013 AAS

drwxrwxr-x  13 afc    aas      4096 Dec 27 00:32 AFC

drwxr-xr-x    5 oracle oinstall  4096 Apr 14  2014 AFC_DB

drwxr-xr-x    6 oracle oinstall  4096 Apr 14  2014 AFC_DB2

drwxr-xr-x    4 oracle oinstall  4096 Apr 14  2014 AFC_DB3

drwxr-xr-x    2 root  root      4096 May 17 21:18 AFC_DB5

drwxr-xr-x    2 root  root      4096 May 17 21:18 AFC_DB6

这里有一步失误,目录AFC_DB5和AFC_DB6是用来存放oracle数据文件的,最好用oracle账号创建,

我已经用root账号创建了,就给它最高权限算了。

[root@ccsvr /]# chmod 777 AFC_DB5

[root@ccsvr /]# chmod 777 AFC_DB6

然后,进行挂载:

[root@ccsvr /]# mount /dev/sdb5 /AFC_DB5

[root@ccsvr /]# mount /dev/sdb6 /AFC_DB6

修改fstab文件,使开机启动时自动挂载,

这是原fstab文件:

[root@ccsvr /]# more  /etc/fstab

# This file is edited by fstab-sync - see 'man fstab-sync' for details

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/a2d6bd216eded82d07aaad88a272f826.html