|
最简单能用的init.ora:
- *.control_files='+DATA/orcl/controlfile/current.260.816169631','+FRA/orcl/controlfile/current.256.816169633'
- *.db_block_size=8192
- *.db_name='orcl'
- *.db_recovery_file_dest='+FRA'
- *.db_recovery_file_dest_size=4070572032
- *.memory_target=6681526272
- *.processes=300
- *.undo_tablespace='UNDOTBS1'
复制代码 实验环境:
- [root@station8 ~]# fdisk -l
- WARNING: GPT (GUID Partition Table) detected on '/dev/loop0'! The util fdisk doesn't support GPT. Use GNU Parted.
- Disk /dev/loop0: 3887 MB, 3887071232 bytes
- 255 heads, 63 sectors/track, 472 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: 0x375a1b73
- Device Boot Start End Blocks Id System
- /dev/loop0p1 * 1 473 3795968 0 Empty
- Partition 1 has different physical/logical endings:
- phys=(1023, 63, 32) logical=(472, 146, 58)
- Partition 1 does not end on cylinder boundary.
- /dev/loop0p2 1 1 376 ef EFI (FAT-12/16/32)
- Partition 2 has different physical/logical beginnings (non-Linux?):
- phys=(1023, 254, 63) logical=(0, 54, 39)
- Partition 2 has different physical/logical endings:
- phys=(1023, 254, 63) logical=(0, 66, 34)
- Disk /dev/sda: 240.1 GB, 240057409536 bytes
- 255 heads, 63 sectors/track, 29185 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: 0xc73ac73a
- 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 5878 46899200 8e Linux LVM
- /dev/sda3 5878 7152 10240000 8e Linux LVM
- /dev/sda4 7152 29186 176983040 5 Extended
- /dev/sda5 7153 8045 7168000 8e Linux LVM
- /dev/sda6 8045 8938 7168000 8e Linux LVM
- /dev/sda7 8938 9830 7168000 8e Linux LVM
- /dev/sda8 9830 10723 7168000 8e Linux LVM
- /dev/sda9 10723 11245 4194304 82 Linux swap / Solaris
- /dev/sda10 7152 7152 984+ 83 Linux
- /dev/sda11 11245 15161 31460829 8e Linux LVM
- Partition table entries are not in disk order
- Disk /dev/mapper/vg_station8-LogVol00: 80.2 GB, 80232841216 bytes
- 255 heads, 63 sectors/track, 9754 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: 0x00000000
- [root@station8 ~]# df -h
- Filesystem Size Used Avail Use% Mounted on
- /dev/mapper/vg_station8-LogVol00
- 74G 36G 35G 51% /
- tmpfs 2.0G 155M 1.8G 8% /dev/shm
- /dev/sda1 283M 42M 226M 16% /boot
- /data/rhel-server-6.9-x86_64-dvd.iso
- 3.7G 3.7G 0 100% /mount_iso
- [root@station8 ~]# pwd
- /root
- [root@station8 ~]# oracleasm-discover
- Using ASMLib from /opt/oracle/extapi/64/asm/orcl/1/libasm.so
- [ASM Library - Generic Linux, version 2.0.4 (KABI_V2)]
- Discovered disk: ORCL:ASMDISK01 [14336000 blocks (7340032000 bytes), maxio 512]
- Discovered disk: ORCL:ASMDISK02 [14336000 blocks (7340032000 bytes), maxio 512]
- Discovered disk: ORCL:ASMDISK03 [14336000 blocks (7340032000 bytes), maxio 512]
- Discovered disk: ORCL:ASMDISK04 [14336000 blocks (7340032000 bytes), maxio 512]
- Discovered disk: ORCL:ASMDISK05 [20480000 blocks (10485760000 bytes), maxio 512]
- [root@station8 ~]# dd if=/dev/zero of=ASMDISK06.img bs=1K count=7168000
- 记录了7168000+0 的读入
- 记录了7168000+0 的写出
- 7340032000字节(7.3 GB)已复制,42.0847 秒,174 MB/秒
- [root@station8 ~]# losetup /dev/loop6 ASMDISK06.img
- [root@station8 ~]# losetup /dev/loop6
- /dev/loop6: [fd00]:1845418 (/root/ASMDISK06.img)
- [root@station8 ~]# oracleasm-discover
- Using ASMLib from /opt/oracle/extapi/64/asm/orcl/1/libasm.so
- [ASM Library - Generic Linux, version 2.0.4 (KABI_V2)]
- Discovered disk: ORCL:ASMDISK01 [14336000 blocks (7340032000 bytes), maxio 512]
- Discovered disk: ORCL:ASMDISK02 [14336000 blocks (7340032000 bytes), maxio 512]
- Discovered disk: ORCL:ASMDISK03 [14336000 blocks (7340032000 bytes), maxio 512]
- Discovered disk: ORCL:ASMDISK04 [14336000 blocks (7340032000 bytes), maxio 512]
- Discovered disk: ORCL:ASMDISK05 [20480000 blocks (10485760000 bytes), maxio 512]
- [root@station8 ~]# oracleasm createdisk ASMDISK06 /dev/loop6
- Writing disk header: done
- Instantiating disk: done
- [root@station8 ~]# oracleasm-discover
- Using ASMLib from /opt/oracle/extapi/64/asm/orcl/1/libasm.so
- [ASM Library - Generic Linux, version 2.0.4 (KABI_V2)]
- Discovered disk: ORCL:ASMDISK01 [14336000 blocks (7340032000 bytes), maxio 512]
- Discovered disk: ORCL:ASMDISK02 [14336000 blocks (7340032000 bytes), maxio 512]
- Discovered disk: ORCL:ASMDISK03 [14336000 blocks (7340032000 bytes), maxio 512]
- Discovered disk: ORCL:ASMDISK04 [14336000 blocks (7340032000 bytes), maxio 512]
- Discovered disk: ORCL:ASMDISK05 [20480000 blocks (10485760000 bytes), maxio 512]
- Discovered disk: ORCL:ASMDISK06 [14336000 blocks (7340032000 bytes), maxio 128]
- [root@station8 ~]#
复制代码
rawdevices的/etc/init.d/rawdevices脚本内容(要加可执行位):
- #!/bin/bash
- #
- # rawdevices This shell script assignes rawdevices to block devices
- #
- # chkconfig: 345 56 44
- # description: This scripts assignes raw devices to block devices \
- # (such as hard drive partitions). This is for the use \
- # of applications such as Oracle. You can set up the \
- # raw device to block device mapping by editing \
- # the file /etc/sysconfig/rawdevices.
- #
- # config: /etc/sysconfig/rawdevices
- [ -f /bin/raw ] || exit 0
- [ -f /etc/sysconfig/rawdevices ] || exit 0
- # Exit if the file just has the default comments.
- LC_ALL=C /bin/egrep -q -v "^ *#" /etc/sysconfig/rawdevices 2>/dev/null || exit 0
- . /etc/init.d/functions
- function assign_raw()
- {
- LC_ALL=C egrep -v '^ *#' /etc/sysconfig/rawdevices |
- while read RAW BLOCK; do
- if [ -n "$RAW" -a -n "$BLOCK" ]; then
- rawdirname=${RAW%/*}
- if [ "$rawdirname" = "/dev" -a -d /dev/raw ]; then
- echo [ DISCUZ_CODE_2 ]quot; Please correct your /etc/sysconfig/rawdevices:"
- echo [ DISCUZ_CODE_2 ]quot; rawdevices are now located in the directory /dev/raw/ "
- echo [ DISCUZ_CODE_2 ]quot; If the command 'raw' still refers to /dev/raw as a file."
- echo [ DISCUZ_CODE_2 ]quot; you'll have to upgrade your util-linux package"
- exit 0
- fi
- if [ "$rawdirname" = "/dev/raw" -a -f /dev/raw ]; then
- echo [ DISCUZ_CODE_2 ]quot; Please correct your /etc/sysconfig/rawdevices:"
- echo [ DISCUZ_CODE_2 ]quot; rawdevices are now located in the directory /dev/raw/ "
- echo [ DISCUZ_CODE_2 ]quot; If the command 'raw' still refers to /dev/raw as a file."
- echo [ DISCUZ_CODE_2 ]quot; you'll have to upgrade your util-linux package"
- exit 0
- fi
- echo " $RAW --> $BLOCK";
- raw $RAW $BLOCK
- fi
- done
- }
- # See how we were called.
- case "$1" in
- start)
- # Assign devices
- echo [ DISCUZ_CODE_2 ]quot;Assigning devices: "
- assign_raw
- sleep 3
- chown -R oracle:asmadmin /dev/raw/
- echo [ DISCUZ_CODE_2 ]quot;done"
- ;;
- stop)
- # No action to be taken here
- ;;
- status)
- ID=`id -u`
- if [ $ID -eq 0 ]; then
- raw -qa
- else
- echo [ DISCUZ_CODE_2 ]quot;You need to be root to use this command ! "
- fi
- ;;
- restart|reload)
- $0 start
- ;;
- *)
- echo [ DISCUZ_CODE_2 ]quot;Usage: $0 {start|stop|status|restart}"
- exit 1
- esac
- exit 0
复制代码
rawdevices的配置文件:/etc/sysconfig/rawdevices:
- /dev/raw/raw1 /dev/loop3
- /dev/raw/raw2 /dev/loop4
- /dev/raw/raw3 /dev/loop5
复制代码
使其生效:
[root@station8 init.d]# chkconfig rawdevices on
[root@station8 init.d]# service rawdevices start
创建磁盘组的命令:
- create diskgroup highdata high redundancy failgroup f1
- 2 disk '/dev/raw/raw1' name d1, '/dev/raw/raw2' name d2
- 3 failgroup f2
- 4 disk '/dev/raw/raw3' name d3, '/dev/raw/raw4' name d4
- 5 failgroup f3
- 6* disk '/dev/raw/raw5' name d5 , '/dev/raw/raw6' name d6
- SQL> /
复制代码
ASM的参数,负责找磁盘的路径:
- SQL> alter system set asm_diskstring='/dev/oracleasm/disks/*','/dev/raw/raw*' ;
复制代码 https://station90.example.com:5500/em/console/database/osm/osmSitemap?fromAsm=true&type=osm_instance&target=%2BASM_station90.example.com&event=doLoad
快速镜像重同步:
- [oracle@station90 ~]$ sqlplus /nolog
- SQL*Plus: Release 11.2.0.1.0 Production on Sun Mar 25 11:57:50 2018
- Copyright (c) 1982, 2009, Oracle. All rights reserved.
- SQL> conn / as sysasm
- Connected.
- SQL> alter diskgroup data offline disk DATA_0000 drop after 5h;
- alter diskgroup data offline disk DATA_0000 drop after 5h
- *
- ERROR at line 1:
- ORA-15032: not all alterations performed
- ORA-15283: ASM operation requires compatible.rdbms of 11.1.0.0.0 or higher
- SQL> alter diskgroup data set attribute 'compatible.rdbms'='11.2';
- Diskgroup altered.
- SQL> alter diskgroup data offline disk DATA_0000 drop after 5h;
- Diskgroup altered.
- SQL>
复制代码
|
|