How To Create Oracle Asm Disk Linux
Building Virtual File System for ASM Disks Automatic Storage Management (ASM) employs provisioned disks for creating disk groups. The following steps instantiate the virtual disks used to create a virtual file system, without creating disks partitioning. § Create zero-filled flat files Run the 'dd' command to create the zero-filled flat files. Optionally, in between each 'dd' command, the Operating System 'sync' command is executed to write buffered data to the disk, releasing memory for the next 'dd' command. The size of the file is specified using the 'count' attribute. The following example creates a zero-filled file of size 20GB. #dd if=/dev/zero of=/u01/asmdsks/_asm_file_vdisk_01 bs=1k count=20971520 § Attach a loopback device for each file Use the Operating System utility 'losetup' to attach the first Linux loopback device with the flat file created. Ensure the loopback devices /dev/loop1 to /dev/loop7 are available. Test each loopback device availability; to test the first loopback device, type the following the command: # /sbin/losetup /dev/loop1 § Link the virtual loopback device Use the command 'ln' to alias the loopback devices to be presented as virtual block devices. § Create the ASM Disk The last step is to use Oracle ASM command 'oracleasm createdisk' to provision the files as virtual ASM disk. Warning! This virtual disk setup is for training purposes. It should not be employed for a production environment. The script is designed to create up to 7 ASM disks only. #----------------------------------------------------------------- #-- DISCLAIMER: #-- #-- This script is provided for educational purposes only. #-- The script has been tested on an Oracle Database 11g instance #-- and run as intended. However; prior to using the script on #-- production systems, a dynamic test should be conducted prior #-- to deployment. #-- #-- Copyright (c) Rampant TechPress. 2015. All Rights Reserved. #------------------------------------------------------------------ # #!/bin/bash echo `date` echo "Enter non-existing ASM directory or press ENTER to exit, " echo "Example: /u01/ASMDSKS: "; read vdir if [ -d $vdir ]; then echo "Directory exit"; exit -1 elif [[ $vdir != /* ]]; then echo "Invalid directory, example /u01/ASMDSKS"; exit -1 else echo "Enter number of virtual disks followed by size, " echo "Example: 4 4194304: "; read vdsk vsize if [[ "$vdsk" = *[!2-7]* ]]; then echo "Invalid argument value, Example: 2 4096"; exit -1 else mkdir -p $vdir for i in $(eval echo "{1..$vdsk}") do sync; echo 3 > /proc/sys/vm/drop_caches echo "Creating $vdir/_asm_file_vdisk_0$i" dd if=/dev/zero of=$vdir/_asm_file_vdisk_0$i\ bs=1024 obs=1024 count=$vsize status=noxfer echo "De-attaching /dev/loop$i" /sbin/losetup -d /dev/loop$i /sbin/losetup /dev/loop$i $vdir/_asm_file_vdisk_0$i case "$i" in 2) echo "Creating ASM_DISK0$i"; ln -s /dev/loop$i /dev/xvdd; /usr/sbin/oracleasm createdisk ASM_DISK0$i /dev/xvdd;; 3) echo "Creating ASM_DISK0$i"; ln -s /dev/loop$i /dev/xvde; /usr/sbin/oracleasm createdisk ASM_DISK0$i /dev/xvde;; 4) echo "Creating ASM_DISK0$i"; ln -s /dev/loop$i /dev/xvdf; /usr/sbin/oracleasm createdisk ASM_DISK0$i /dev/xvdf;; 5) echo "Creating ASM_DISK0$i"; ln -s /dev/loop$i /dev/xvdg; /usr/sbin/oracleasm createdisk ASM_DISK0$i /dev/xvdg;; 6) echo "Creating ASM_DISK0$i"; ln -s /dev/loop$i /dev/xvdh; /usr/sbin/oracleasm createdisk ASM_DISK0$i /dev/xvdh;; 7) echo "Creating ASM_DISK0$i"; ln -s /dev/loop$i /dev/xvdi; /usr/sbin/oracleasm createdisk ASM_DISK0$i /dev/xvdi;; esac done echo "Scanning ASM disk..." echo "" /usr/sbin/oracleasm listdisks fi fi Oracle GoldenGate 12c Burleson is the American Team Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals. Feel free to ask questions on our Oracle forum. Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications. Errata? Oracle technology is changing and we strive to update our BC Oracle support information. If you find an error or have a suggestion for improving our content, we would appreciate your feedback. Just e-mail: Copyright © 1996 - 2020 All rights reserved by Burleson Oracle ® is the registered trademark of Oracle Corporation.
The above is an excerpt from the upcoming 12c book Oracle GoldenGate 12c: A Hands-on Guide to Data Replication & Integration using Oracle & SQL Server.
and include the URL for the page.
How To Create Oracle Asm Disk Linux
Source: http://www.dba-oracle.com/t_goldengate_building_virtual_file_systems_for_asm_disks.htm
Posted by: robinsongree1943.blogspot.com

0 Response to "How To Create Oracle Asm Disk Linux"
Post a Comment