Showing posts with label ASM. Show all posts
Showing posts with label ASM. Show all posts

Monday, September 30, 2013

Oracle RAC Virtual Server Plan

Information Outline for Oracle RAC Virtual Server sandbox Plan
This document describes the proposed plan to implement a two-node Oracle RAC cluster on the ESXi R710 Dev Host for sandbox purposes.  Below you will find detailed technical specifications for building the RAC-Virtual Sandbox


Document Creator Todd Walters  

Virtual Servers Configurations
  • Will build two virutal servers on ESXi Host srv0esxt01 TEST.
  • Oracle  Virtual Servers will adhere to these specifications on Dell r710 Host:
      • 4gb Memory
      • 50gb Hard Drive
      • 4 Virtual CPU
      • Vlan 126 for Test
      • Storage for Virtual Servers on l0esxt01vmfs02
  • Virtuals Servers information:
    • Hostname: srv0sbox01 IP:  192.168.91.31 VIP=192.168.9.33 IC=192.168.4.91
    • Hostname: srv0sbox02 IP:  192.168.91.32 VIP=192.168.9.34 IC=192.168.4.92
ASM Storage Considerations
  • Create 5 5gb ASM Disks with following configurations:
    • 4 ASM Disks would become sandbox_data1 Diskgroup: 20gb ASM Storage
    • 1 ASM disk would become sandbox_backup1 diskgroup: 5gb ASM Backup
  • ASM Storage has two options:
    • Store ASM disks on SAN on r710 storage as virtual storage.
    • Create LUN consiting of mirror pair on SAN, then create ASM virtual disks on SAN.
Virtual Server Diagram 



How to Remove Node From Oracle RAC Cluster

Information about How to Remove Node from Oracle RAC Cluster
This document describes the process to remove a node from an active Oracle RAC Cluster.

Document Creator Todd Walters  

Remove Node from Oracle RAC Cluster
  1. > srvctl remove instance -d dwakdb -i dwakdb3
    Remove instance dwakdb3 from the database dwakdb? (y/[n]) y
    PRKP-1075 : Instance dwakdb3 is the last preferred instance for service
    APPDWAK.
  2. > srvctl remove instance -d dwakdb -i dwakdb3
    Remove instance dwakdb3 from the database dwakdb? (y/[n]) y

  3. > srvctl start service  -d dwakdb -s appdwak -i dwakdb2
    srv0dbxd01 | ORA1020 | /export/home/oracle
    > showcrs
  4. > srvctl stop asm -n srv0dbxd03
    srv0dbxd01 | ORA1020 | /export/home/oracle
    > srvctl remove asm -n srv0dbxd03
    srv0dbxd01 | ORA1020 | /export/home/oracle 
    Verisrfy it was removed:
    > srvctl config asm -n srv0dbxd03
  5. Before removing node, determine node name and CRS-assigned node number in OCR
    srv0dbxd01 | CRS | /u00/app/oracle/product/10.2.0/CRS/bin
    > ./olsnodes -n
    srv0dbxd01     1
    srv0dbxd02     2
    srv0dbxd03     3
  6. run netca and remove listener on node
  7. or use crs_unregister
  8. [root@srv0dbxd01 bin]# ./srvctl remove nodeapps -n srv0dbxd03
    Please confirm that you intend to remove the node-level applications on node srv0dbxd03 (y/[n]) y
    PRKO-2112 : Some or all node applications are not removed successfully on node: srv0dbxd03
  9. > crs_unregister -q ora.srv0dbxd03.LISTENER_SRV0dbxd03.lsnr
    srv0dbxd01 | ORA1020 | /export/home/oracle
    > crs_unregister -q ora.srv0dbxd03.vip

  10. Update the node list using OUI on DB
    /runInstaller -ignoreSysPrereqs -updateNodeList ORACLE_HOME=/u00/app/oracle//product/10.2.0/DB CLUSTER_NODES=srv0dbxd01,srv0dbxd02
  11. Update the node list using OUI on CRS
    /runInstaller -ignoreSysPrereqs -updateNodeList ORACLE_HOME=/u00/app/oracle//product/10.2.0/CRS CLUSTER_NODES=srv0dbxd01,srv0dbxd02
  12. Delete the node from the cluster
    [root@srv0dbxd01 install]# ./rootdeletenode.sh srv0dbxd03,3
    CRS-0216: Could not stop resource 'ora.srv0dbxd03.LISTENER_SRV0dbxd03.lsnr'.
    CRS-0210: Could not find resource 'ora.srv0dbxd03.ons'.
    CRS-0216: Could not stop resource 'ora.srv0dbxd03.vip'.
    CRS-0210: Could not find resource 'ora.srv0dbxd03.gsd'.
    PRKO-2112 : Some or all node applications are not removed successfully on node: srv0dbxd03
    CRS nodeapps are deleted successfully
    clscfg: EXISTING configuration version 3 detected.
    clscfg: version 3 is 10G Release 2.
    CSS indicates failure 17 acknowledging the deletion.
    Attempting to roll back the deletion.
    Rollback of node deletion successful.
    Node deletion failed but configuration is intact.
    'srv0dbxd03,3' deleted successfully

  13. To add Node - run $ORACLE_HOME/CRS/oui/bin/addNode.sh
    run for each home (ASM & DB)
    will see exclude file errors
    run each script on node it says to excute on
  14. configure asm as root with /etc/init.d/oracleasm
    set TNS_ADMIN for new node  (had to run this as root)
    ./srvctl setenv nodeapps -n srv0dbxd03 -T TNS_ADMIN=/u00/app/oracle/product/10.2.0/ASM/network/admin
  15. should be able to start listener


How to Remove ASM Diskgroups and ASM Instance

Information about How to Remove ASM Diskgroups and ASM Instance
This document will describe how to remove an ASM instance from a RAC node. It will also describe the entire process for removing ASM, removing ASM Diskgroups, and reinstalling ASM Instance.
This process is used to clean up a failed ASM install and wipe all ASM Instance/Diskgroups to prepare systems for a new ASM installation.

Document Creator Todd Walters

How to Remove ASM Instance and DiskGroups
  1. Check ASM status on RAC Nodes
    • Login via oracle and run showcrs  to view status.
  2. Stop ASM instance on each node:
    • srvctl stop asm -n node (where node is node name, ie srv0dbxd11)
  3. Login to node 2 and 3 and run . oraenv and source +ASMx where X=instance number, ie. +ASM2 for node2.
  4. Go to sqlplus with sqlplus sys as sysdba and do the following on node 2 & 3 first:
    • SQL> Alter diskgroup all dismount;
  5. Back on Node1, run sqlplus again and list all ASM Diskgroups with this command:
    • SQL> select name,total_mb from v$asm_diskgroup;
    • NAME                             TOTAL_MB
      ------------------------------ ----------
      DWAK_BACKUP_01                      40954
      DWAK_DATA_01                       225252
  6. To remove these ASM Diskgroups, complete the following command (Make sure you want to remove these)
    • SQL> drop diskgroup dwak_data_01 including contents;
    • Should see: Dropped dwakdb_data_01 successfully
    • Run drop command again for any other ASM diskgroups to remove.
  7. Next while logged in as Oracle on Node 1, remove all ASM instances
    • srvctl remove asm -n nodeX (where nodeX=srv0dbxd13 for example)
    • run for each node in RAC cluster.
  8. Next edit the /etc/oratab file on all nodes in RAC Cluster and remove the following line:
    • +ASM1:/u00/app/oracle/product/10.2.0/ASM:N  (remove this on all nodes)
  9. As root, verify all Oracle ASM disks are listed properly and run scandisks
    • [root@srv0dbxd11 init.d]# ./oracleasm listdisks
      G_BACKUP_ASM1
      H_ASM1
      I_ASM1
      J_ASM1
      K_ASM1
    • [root@srv0dbxd11 init.d]# ./oracleasm scandisks
      Scanning system for ASM disks:                             [  OK  ]
    • then run ./oracleasm restart to restart ASM
  10. Once everything is okay, you can reinstall ASM Instance.
    • Login to node 1 with VNC.
    • Run xhost +
    • su - oracle
    • . oraenv
    • +ASM1 and enter /u00/app/oracle/product/10.2.0/ASM for ORACLE_HOME
    • cd $ORACLE_HOME/bin and run ./dbca
    • choose Install ASM
    • Follow How to Install Oracle 10gR4 ASM Instance  guide. 

How to Relocate OCR and Voting Disks on Virtual Servers

Information about How to Reconfigure ASM Disks on Virtual Servers
This document will describe how to relocate OCR and Voting Disks on RAC Virtual Servers. We will relocate the OCR & Voting disks from one Datastore to another.

Document Creator   Todd Walters
Reason for OCR and Voting disk Relocation
  1. Was originally built using 15k 73gb FC Drives on EMC SAN
  2. Dev & Test required more storage for dwak/twak
  3. There were empty SATA Slots on existing DAE
  4. Ordered 6 1tb 7200 SATA Drives and create new Raid Group 102 R5
Overview of OCR & Voting Disk Relocation
  • Relocate during scheduled downtime to remove the old 55gb ASM vmdk disks from each virtual server
  • During downtime relocate OCR and Voting Storage vmdk files to new SATA Datastore
  • Update SAN Storage Layout diagram and create/update any relevant how-to documentation.
  • New datastore path = /vmfs/volumes/cx3c-1lun102/shared with dev and test sub-directories below.
  • See How to Reconfigure ASM Disks on Virtual Servers  for additional information.
How to Relocate Existing OCR & Voting Disks
  1. Shutdown Oracle RAC Dev or Test using crs_stop -all
  2. Remove the four 55gb ASM disks from all 3 nodes using vSphere client.
  3. Prior to moving the vmdk files, write down the scsi id:x layout for all asm,ocr, & voting disks.
    • disk 1 = SCSI (0:0) will always be OS Disk
    • example layout (OCR, voting, and ASM Backup)disk 2 = SCSI (1:0) - Voting 1
      disk 3 = SCSI (1:1) - Voting 2
      disk 8 = SCSI (1:2) - Voting 3
      disk 9 = SCSI (1:3) - OCR 1
      disk 10 = SCSI (1:4) - OCR 2
      disk 11 = SCSI (1:5) - ASM Backup
    • standard layout (node 3)disk 2 = SCSI (1:0) - Voting 1
      disk 3 = SCSI (1:1) - Voting 2
      disk 8 = SCSI (1:2) - Voting 3
      disk 9 = SCSI (1:3) - OCR 1
      disk 10 = SCSI (1:4) - OCR 2
      disk 4 = SCSI (1:13) - XASM1 Disk
      disk 5 = SCSI (1:14) - XASM2 Disk
      disk 11 = SCSI (1:5) - ASM Backup Disk
      disk 6 = SCSI (1:15) - NFS Backup Disk
  4. Manually move (since no storage vmotion on esxi) the 3 Voting and 2 OCR disks from old 73gb 15k disk datastore to the new 1tb disk drive datastore.
    • Login to ESXi host via ssh/putty
    • change directory to /vmfs/volumes/emc-cx3-1lun100/shared (for test)
    • run following command to list flat files and  size (remember there are other vmdk files w/out -flat)
      • #  ls -lh | grep flat | awk '{ print $5,$9 }' 55.0G asm1-flat.vmdk
        55.0G asm2-flat.vmdk
        55.0G asm3-flat.vmdk
        55.0G asm4-flat.vmdk
        250.0M ocr1-flat.vmdk
        250.0M ocr2-flat.vmdk
        250.0M voting1-flat.vmdk
        250.0M voting2-flat.vmdk
        250.0M voting3-flat.vmdk
    • run the following command to move all the vmdk's to new location from old cx3-1lun100
      • mv *.vmdk /vmfs/volumes/emc-cx3-1lun102/shared/test/.
      • note: In this step we will relocate the  existing OCR & Voting disks to a different datastore. This will require the vm to be powered off to add the virtual hard disk.  Once ESXi hosts are licensed this will not be required.
    • Verify all files moved properly by changing directory to new location and running following command
      •  ls -lh | awk '{ print $5,$9 }'
    • Move the ASM backup 50gb vmdk to the 1tb storage area as well.
      • Use Datastore Browser to move vmdk or cmd line command.
      • Change directory to /vmfs/volumes/lesxit01-vmfs02/oracle/shared
      • run - mv *.vmdk /vmfs/volumes/emc-cx3-1lun102/shared/test/.
  • Manually remove all old ASM virtual disks from each node.
    • Login to vSphere Client and power off all 3 nodes
    • Edit the settings of each node and remove all 55gb ASM Disks
  • Add each voting, ocr, and the single nfs backup disk to each node. Carefully making sure the right virtual scsi controller and ID. use SCSI (1:5) for ASM_Backup (matching standard layout above)
  • Bring one node online at a time and verify everything is online. Check Oracle status using 'showcrs'
  • Verify with DBA that everything was online for RAC
  • Once everything is verify, remove the emc-cx3-1lun100 datastore (73gb 15k drives)from ESXi Test R710 via vSphere Client
  • Login to NaviSphere and remove disk group
    • Follow How to Remove Storage from SAN guide
    • Unbind LUN, Remove from Storage Group, Destroy Raid Group.
Disk Layout Paths
There are some minor cleanup with the paths. All devices past the OCR/Voting disk path changed. For example, the first ASM Disk changed from /dev/sdl1 to /dev/sdh1
  1. Here's output of all the old disks:
[root@csrv0dbxd11 ~]# fdisk -l | grep Disk
Disk /dev/sda: 53.6 GB, 53687091200 bytes
Disk /dev/sdb: 268 MB, 268435456 bytes
Disk /dev/sdc: 268 MB, 268435456 bytes
Disk /dev/sdd: 268 MB, 268435456 bytes
Disk /dev/sde: 268 MB, 268435456 bytes
Disk /dev/sdf: 268 MB, 268435456 bytes
Disk /dev/sdg: 42.9 GB, 42949672960 bytes
Disk /dev/sdh: 59.0 GB, 59055800320 bytes
Disk /dev/sdi: 59.0 GB, 59055800320 bytes
Disk /dev/sdj: 59.0 GB, 59055800320 bytes
Disk /dev/sdk: 59.0 GB, 59055800320 bytes
Disk /dev/sdl: 214.7 GB, 214748364800 bytes
Disk /dev/sdm: 214.7 GB, 214748364800 bytes

New disks (well disk paths)
[root@csrv0dbxd11 init.d]# fdisk -l | grep Disk
Disk /dev/sda: 53.6 GB, 53687091200 bytes
Disk /dev/sdb: 268 MB, 268435456 bytes
Disk /dev/sdc: 268 MB, 268435456 bytes
Disk /dev/sdd: 268 MB, 268435456 bytes
Disk /dev/sde: 268 MB, 268435456 bytes
Disk /dev/sdf: 268 MB, 268435456 bytes
Disk /dev/sdg: 42.9 GB, 42949672960 bytes
Disk /dev/sdh: 214.7 GB, 214748364800 bytes
Disk /dev/sdi: 214.7 GB, 214748364800 bytes
Voting & OCR paths stayed the same
# Voting Disks
/dev/raw/raw1   /dev/sdb1
/dev/raw/raw2   /dev/sdc1
/dev/raw/raw3   /dev/sdd1
# OCR disks
/dev/raw/raw4   /dev/sde1
/dev/raw/raw5   /dev/sdf1

Old Datastore path
/vmfs/volumes/emc-cx3-1lun101/shared # ls -l | awk ' { print $9 }'
asm01-flat.vmdk
asm01.vmdk
asm02-flat.vmdk
asm02.vmdk
asm03-flat.vmdk
asm03.vmdk
asm04-flat.vmdk
asm04.vmdk
ocr1-flat.vmdk
ocr1.vmdk
ocr2-flat.vmdk
ocr2.vmdk
voting1-flat.vmdk
voting1.vmdk
voting2-flat.vmdk
voting2.vmdk
voting3-flat.vmdk
voting3.vmdk

new Datastore path
/vmfs/volumes/cx3c-1lun102/shared/dev # ls -l | awk ' { print $9 }'
backup_asm01-flat.vmdk
backup_asm01.vmdk
dasm1-flat.vmdk
dasm1.vmdk
dasm2-flat.vmdk
dasm2.vmdk
ocr1-flat.vmdk
ocr1.vmdk
ocr2-flat.vmdk
ocr2.vmdk
voting1-flat.vmdk
voting1.vmdk
voting2-flat.vmdk
voting2.vmdk
voting3-flat.vmdk
voting3.vmdk