国内有哪些同步盘?好用的同步网盘有哪些?
729
2022-07-08
linux上asm添加磁盘方法划分磁盘[root@localhost init.d]# fdisk /dev/sdd
Command (m for help): nCommand action e extended p primary partition (1-4)pPartition number (1-4): 1First cylinder (1-261, default 1): 130Last cylinder or +size or +sizeM or +sizeK (130-261, default 261): Using default value 261
Command (m for help): n Command action e extended p primary partition (1-4)pPartition number (1-4): 2First cylinder (1-261, default 1): Using default value 1Last cylinder or +size or +sizeM or +sizeK (1-129, default 129): Using default value 129
Command (m for help): wThe partition table has been altered!
Calling ioctl() to re-read partition table.Syncing disks.[root@localhost init.d]# fdisk -lskiping................Disk /dev/sdd: 2147 MB, 2147483648 bytes255 heads, 63 sectors/track, 261 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System/dev/sdd1 130 261 1060290 83 Linux/dev/sdd2 1 129 1036161 83 Linux
Partition table entries are not in disk order[root@localhost init.d]# 创建为asm磁盘
[root@localhost init.d]# ./oracleasm createdisk VOL5 /dev/sdd1Marking disk "VOL5" as an ASM disk: [ OK ][root@localhost init.d]# ./oracleasm createdisk VOL6 /dev/sdd2Marking disk "VOL6" as an ASM disk: [ OK ]
创建磁盘组[root@localhost init.d]# su - oracle[oracle@localhost ~]$ export ORACLE_SID=+ASM[oracle@localhost ~]$ sqlplus "/ as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jun 30 10:31:42 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining options
SQL> create diskgroup disk_group_3 normal redundancy 2 failgroup VOL6 disk 'ORCL:VOL6' name VOL6 3 failgroup VOL5 disk 'ORCL:VOL5' name vol5;
Diskgroup created.
SQL> drop diskgroup disk_group_3 including contents; 删除磁盘组
Diskgroup dropped.
SQL>
--把asm划分磁盘加到已经存在的磁盘组里,
SQL> l 1* alter diskgroup disk_group_1 add disk 'ORCL:VOL5'SQL> /
Diskgroup altered.
删除添加的磁盘
SQL> l 1 select group_number,disk_number,name,label,path from v$asm_disk 2*SQL> /
GROUP_NUMBER DISK_NUMBER NAME LABEL PATH------------ ----------- ----- ----- ---------- 0 0 VOL6 ORCL:VOL6 1 0 VOL1 VOL1 ORCL:VOL1 1 1 VOL2 VOL2 ORCL:VOL2 2 0 VOL3 VOL3 ORCL:VOL3 2 1 VOL4 VOL4 ORCL:VOL4 1 2 VOL5 VOL5 ORCL:VOL5SQL> alter diskgroup disk_group_1 drop disk VOL5;
Diskgroup altered.
select group_number,disk_number,bytes_written/1024/1024 from v$asm_disk_stat1 0 79.740722656251 1 77.857910156252 0 41.990722656252 1 41.990722656251 2 3.8515625其中disk2中的vol5可以缩小到4MB;也可以写一个resize,如果太小,会报错如下
SQL> alter diskgroup disk_group_1 resize disk VOL5 size 3M;alter diskgroup disk_group_1 resize disk VOL5 size 3M*ERROR at line 1:ORA-15032: not all alterations performedORA-15037: disk 'ORCL:VOL5' is smaller than mimimum of 4 MBs
SQL> c /3/4 1* alter diskgroup disk_group_1 resize disk VOL5 size 4MSQL> /
Diskgroup altered.
其中第二组都是41MB,因此可以一次设置为50MB;
SQL> alter diskgroup disk_group_2 resize all size 50M;
Diskgroup altered.
发表评论
暂时没有评论,来抢沙发吧~