Creating a Virtual IP Resource Creating a Shared Disk Resource

Using Oracle Cluster Ready Services 13-7

13.4 Using ASCRS to Manage Resources

With the ascrsctl command line you manage CRS resources created for Fusion Middleware components. With this tool you can create, update, start, stop, switch and delete resources. As mentioned in a previous section, a resource refers to an object that is created by CRS to identify the entity to be managed, such as an application, a virtual IP, or a shared disk. If the auto start for a resource is set to 1, CRS ensures this resource starts when CRS starts. Since Fusion Middleware resources depend on each other, start or stop of one resource may affect other resources. Resource dependency is enforced in the resource creation through ascrsctl syntax. At runtime, CRS uses this dependency knowledge for startstop.

13.4.1 Creating CRS Managed Resources

On Unix and Windows 2008, ASCRS supports WebLogic Server, OPMN managed instance, Oracle database, Oracle database listener, virtual IP and shared disk. After a CRS managed resource is created for one of these components, it can be managed by CRS. CRS resources created with the ascrsctl command line follow a naming convention. Follow this naming convention to ensure that the resources function correctly. To avoid unexpected errors, Oracle recommends using the CRS installation exclusively for Oracle Fusion Middleware, so that all the CRS managed resources are created with ascrsctl. Under this naming convention, the canonical name for a resource has the following format: ora.name.cfctype Where name refers to the short name of the resource, for example, sharedisk, or myvip, and type refers to one of the resource types, such as vip, disk, db, dblsnr or as. For example, on Linux, the following command creates a virtual IP resource named ora.myvip.cfcvip from the IP address 192.168.1.10 on network interface eth0 with netmask 255.255.255.0: ascrsctl create -name myvip -type vip -ipAddr 192.168.1.10 -netmask 255.255.255.0 -interface eth0 On Windows: ascrsctl create -name myvip -type vip -ipAddr 192.168.1.10 -netmask 255.255.255.0 -interface Public network

13.4.1.1 Creating a Virtual IP Resource

The following information is required for creating a virtual IP resource: ■ A valid virtual host name or IP address and it is not used by any host in the network ■ A valid netmask number for this host name or IP Note: If a resource has a dependent resource, set the check interval for the dependent resource higher or at least equal to that of the resource on which it depends. 13-8 Oracle Fusion Middleware High Availability Guide ■ One or more valid network interface names and they are present on all the cluster nodes where this IP is used. On Windows, the interface name is the same as the network connection name. ■ On Windows, the interface name refers to the network connection name, such as Public network. Since a virtual IP resource is a system resource, on Unix, the create or update command generates a script that must be executed by root user to complete the operation. The following command creates a virtual IP resource named ora.myvip.cfcvip on Linux: ascrsctl create -name myvip -type vip -ipAddr 192.168.1.10 -netmask 255.255.255.0 -interface eth0

13.4.1.2 Creating a Shared Disk Resource

In a Fusion Middleware environment, shared disks are those disk storages that are used to hold Oracle database software, the database data files, WebLogic servers, OPMN managed components, and their Oracle homes. Shared disks allow the use of the same data when application resources are switched among the nodes within a cluster. When creating a shared disk resource, carefully consider the following: On Unix: ■ Before creating a shared disk resource, create an empty signature file named .ascrssf on the root of the shared disk. The owner of the CRS home should own this file. This file is used by CRS after the resource is created. ■ You can specify nop for either the mount or unmount command. You can use it for the mount command if the shared disk is never offline. If the disk does go off line for some reason, CRS will detects it and mark it as down. The nop command can be used for the unmount command if the disk does not need to be unmounted by CRS. In such a case, be absolutely sure that the disk does not need to be unmounted. There are potential disk corruption issues if the shared disk is mounted on two nodes without protection. Again, the signature file is always needed on the shared disk. ■ The unmount command, may fail if there are active processes using the shared disk. To prevent this command failure, avoid accessing this disk from other applications while this disk resource is in online state. ■ For complex mount and unmount commands, encapsulate the logic in executable scripts and specify the full path of these scripts as the mount and unmount commands. A proper unmount script is capable of killing other processes that are using this disk to ensure a successful and clean disk unmount. If the unmount command is in a script, do some basic file system checking, such as running a fsck command. Such a script should return 0 for success and 1 for failure. ■ A shared disk resource is a system resource. Create, update, or delete commands generate scripts that must be executed as root to complete the create operation. Follow the instructions from the screen output. ■ If the signature file is at the mount point of the shared disk, the startstop operation may fail. Having the signature file on the mount point signals ASCRS that the disk is mounted, even if its not. Using Oracle Cluster Ready Services 13-9 ■ Validate the mountunmount command before using it in the mc or umc parameters or in the script file. There is no validation from ASCRS for the commands. ■ If the shared disk is not protected by a cluster file system, it could be corrupted if it is mounted from multiple nodes. To avoid this, before creating the ASCRS resource, mount the disk only on the node where you create the resource. On Windows Server 2008: ■ Open Microsoft Disk Management and take note of the shared disk number. A disk number is a non-negative integer, such as 0, 2, or 5. ■ Create an empty mount directory on the system drive on each cluster node, such as c:\oracle\asdisk. ■ Ensure this disk is no longer used by any application on any node. ■ From one node, in Disk Management, right click the drive and, online it, remove all partitions on it, create a single partition on this hard drive, and format it with NTFS. Remove any drive letter that may be assigned to it, and mount it to the directory you just created. Right click the drive again and offline it. ■ On each other node, open Microsoft Disk Management, online this drive, remove the drive letter, if any, and mount it to the directory you just created. Right click the drive and offline it. ■ Go to the node where you will create the disk resource, online the disk. ■ This disk root should be accessible from the mount directory. ■ Create an empty signature file named .ascrssf on the root of the shared disk. The CRS home owner should own this file. This file is used by CRS after the resource is created. ■ The mount command is diskmgr online disknumber and unmount command is diskmgr offline disknumber, where diskmgr is an ASCRS built-in command. There is no need to install any additional software to use the diskmgr command. To create a shared disk resource, on Unix, run the following ascrsctl command that includes a valid mount point, a mount command, and an unmount command: ascrsctl create -n sharedisk -type disk -path asdisk -mc binmount devsda asdisk -umc binumount asdisk To create a shared disk resource on Windows Server 2008, run an ascrsctl command similar to the following: ascrsctl create -n sharedisk -type disk -path c:\oracle\asdisk -mc diskmgr online 2 -umc diskmgr offline 2 After a resource is created, start it explicitly on the node where the create command is executed to make sure the already mounted disk is under ASCRS control: ascrsctl start -n ora.sharedisk.cfcdisk -node disk resource creation node Note: On Windows Server 2008, mapped drives cannot be used as shared disk resources, and no general cluster file systems have been certified for this purpose. 13-10 Oracle Fusion Middleware High Availability Guide

13.4.1.3 Creating an Oracle Database Listener Resource