Oracle Grid Infrastructure 11g: Manage Clusterware and ASM: Student Guide - Volume II
Oracle Grid Infrastructure 11g: Manage Clusterware and ASM: Student Guide - Volume II
Oracle Grid Infrastructure 11g: Manage Clusterware and ASM: Student Guide - Volume II
Infrastructure 11g:
Manage Clusterware
and ASM
D59999GC30
Edition 3.0
December 2012
D78227
Note : all the passwords in these practices are oracle1.
2) As the root user, check that the following directories exist. Perform this step on all
three of your nodes.
/u01/app/11.2.0/grid
/u01/app/oracle/product/11.2.0/db_1
3) View the /etc/sysconfig/ntpd file and confirm that the –x option is specified. If
necessary, change the file, and then restart the ntpd service
with the service ntpd restart command. Perform this step on all three of your
nodes.
4) Check the content of the /etc/security/limits.conf file. The oracle related parameters of
the kernel are in this file. Perform this step on all three of your nodes.
In each case, the sequence of answers is "n", "p", "1", "Return", "Return" and “w".
Once all the disks are partitioned, the results can be seen by repeating the previous "ls"
command.
# cd /dev
# ls sd*
e) On the "Specify Cluster Configuration" screen, enter the SCAN name and click
the "Add" button.
Enter the details of the second node in the cluster, then click the "OK" button.
f) Click the "SSH Connectivity..." button and enter the password for the
"oracle" user. Click the "Setup" button to configure SSH connectivity, and the "Test"
button to test it once it is complete.
g) Click the "Identify network interfaces..." button and check the public and
private networks are specified correctly. Once you are happy with them, click the "OK"
button and the "Next" button on the previous screen.
h) Enter "/u01/app/11.2.0/grid" as the software location and "Automatic Storage
Manager" as the cluster registry storage type. Enter the ASM password(oracle1), enter
dba as OSASM group and click the "Next" button.
i)On the Create ASM Disk Group page, make sure that Disk Group Name is
DATA and Redundancy is Normal. In the Add Disks region, select DISK1, DISK2,
DISK3, DISK4. Click Next.
j) On the Create Inventory page, Inventory Directory should be
/u01/app/oraInventory and the oraInventory Group Name should be oinstall. Click Next.
k)Wait while the prerequisite checks complete. If you have any issues, fix
them and click the "Next" button.
l) Click the "Finish" button.
m) Wait while the setup takes place.
n) When prompted, run the configuration scripts on the first node. When
it completes on the first node, then run them on the second one (do not run them at the
same time).
o) The output from the "orainstRoot.sh" file should look something like that
listed below.
# cd /u01/app/oraInventory
# ./orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
The output of the root.sh will vary a little depending on the node it is run on.
Example output can be seen here (Node1, Node2).
p) Once the scripts have completed, return to the "Execute
Configuration Scripts" screen on the first node and click the "OK" button.
Wait for the configuration assistants to complete.
If you have errors related to nodeapps, don’t mind, we will start these resources later.
We expect the verification phase to fail with an error relating to the SCAN.
r) When the installation finishes, you should verify the installation. You should
check to make sure that the software stack is running, as it should. Execute the crsctl stat
res –t command on both nodes. The resources which have target state ONLINE should be
ONLINE.
$ grid_env
$ crsctl stat res -t
Practice 4-3: Creating Additional ASM Disk Groups
In this practice, you create additional ASM disk groups to support the activities in the rest
of the course. You create a disk group to hold the Fast Recovery Area (FRA).
1) From the same terminal window you used to install Grid Infrastructure, set the
oracle user environment with the grid_env tool to the +ASM1 instance.
$ . grid_env
$ echo $ORACLE_SID (should be ASM1)
c) Next, log in as the oracle user on ol5-112-rac3 and perform the following commands
cd ~/.ssh
cat id_rsa.pub >> authorized_keys
scp authorized_keys ol5-112-rac1:/home/oracle/.ssh/
d) The "authorized_keys" file on both servers now contains the public keys
generated on all nodes.
e) To enable SSH user equivalency on the cluster member nodes issue the following
commands on ol5-112-rac1 and ol5-112-rac3.
ssh ol5-112-rac1 date
ssh ol5-112-rac3 date
ssh ol5-112-rac1.localdomain date
ssh ol5-112-rac3.localdomain date
exec /usr/bin/ssh-agent $SHELL
/usr/bin/ssh-add
You should now be able to SSH and SCP between servers without entering
passwords.
2) We will now add the node
a) Log into ol5-112-rac1 as oracle and run this to set the grid variables
$ . grid_env
$ echo $ORACLE_SID (should be ASM1)
b) Check your pre-grid installation for your third node using the Cluster Verification
Utility.
$ cluvfy stage -pre crsinst -n ol5-112-rac3 (should be
succesfull)
c) Use the Cluster Verification Utility to make sure that you can add your third
node to the cluster (type this command, do not copy/paste).
$ cluvfy stage -pre nodeadd –n ol5-112-rac3 (should be
successful)
d) Add your third node to the cluster(type and check this command, do not
copy/paste):
$ cd $ORACLE_HOME/oui/bin
$ ./addNode.sh -silent "CLUSTER_NEW_NODES={ ol5-112-
rac3}" "CLUSTER_NEW_VIRTUAL_HOSTNAMES={ ol5-112-rac3-
vip}"
e) Connected as the root user on your third node using a terminal session, execute
the following scripts: /u01/app/oraInventory/orainstRoot.sh and
/u01/app/11.2.0/grid/root.sh
f)Make sure that local and cluster resources are placed properly and that the FRA
ASM disk group is mounted on all three nodes (connected as oracle):
$ . grid_env
$ echo $ORACLE_SID
$ crsctl stat res -t
Practices for Lesson 6
In these practices, you will verify, stop, and start Oracle Clusterware.
You will add and remove Oracle Clusterware configuration files and
back up the Oracle Cluster Registry and the Oracle Local Registry.
Practice 6-1: Verifying, Starting, and Stopping
Oracle Clusterware
In this practice, you check the status of Oracle Clusterware using both the operating
system commands and the crsctl utility. You will also start and stop Oracle Clusterware.
1) Connect to the first node of your cluster as the oracle user. You can use the
grid_env script to define ORACLE_SID, ORACLE_HOME, PATH,
ORACLE_BASE for your environment.
$ . grid_env
2) Using the operating system commands, verify that the Oracle Clusterware
daemon processes are running on the current node. (Hint: Most of the Oracle
Clusterware daemon processes have names that end with d.bin.)
$ pgrep -l d.bin
3) Using the crsctl utility, verify that Oracle Clusterware is running on the current node.
$crsctl check crs
4) Verify the status of all cluster resources that are being managed by Oracle
Clusterware for all nodes.
$ crsctl stat res –t
5) Attempt to stop Oracle Clusterware on the current node while logged in as the
oracle user. What happens ?
$ crsctl stop crs
6) Switch to the root account and stop Oracle Clusterware only on the current node.
Exit the switch user command when the stop succeeds.
$su
$ crsctl stop crs
7) Attempt to check the status of Oracle Clusterware now that it has been
successfully stopped.
$ crsctl check crs
$crsctl check cluster
8) Connect to the second node of your cluster and verify that Oracle Clusterware is
still running on that node. You may need to set your environment for the second
node by using the grid_env utility.
$ crsctl check crs
9) Restart Oracle Clusterware on the first node as the root user. Return to the grid
account and verify the results. Note: You may need to check the status of all the
resources several times until they all have been restarted.
$crsctl start crs
$crsctl stat res –t
Practice 6-2: Adding and Removing Oracle Clusterware
Configuration Files
In this practice, you determine the current location of your voting disks and Oracle
Cluster Registry (OCR) files. You will then add another OCR location and remove it.
1) Use the crsctl utility to determine the location of the voting disks that are
currently used by your Oracle Clusterware installation.
$ crsctl query css votedisk
2) Use the ocrcheck utility to determine the location of the Oracle Clusterware Registry
(OCR) files.
$ ocrcheck
3) Verify that the FRA ASM disk group is currently online for all nodes using the crsctl
utility.
$ crsctl stat res ora.FRA.dg –t
4) If the FRA ASM disk group is not online, use the asmcmd utility to mount the FRA disk
group as the oracle user. Note: This step may not be necessary if it is already in an online
state on each node. Verify the results. You may have to run the commands on each node.
$ asmcmd mount FRA
$ crsctl stat res ora.FRA.dg –t
5) Switch to the root account and add a second OCR location that is to be stored in
the FRA ASM disk group. Use the ocrcheck command to verify the results.
$ su
$ocrconfig -add +FRA
$ocrcheck
$ cat /etc/oracle/ocr.loc
6) On your second node, as the root user, remove the second OCR file that was
added from the first node. Verify the results when completed.
$ocrconfig -delete +FRA
$ocrcheck
Practice 6-3: Performing a Backup of the OCR and OLR
In this practice, you determine the location of the Oracle Local Registry (OLR) and
perform backups of the OCR and OLR files.
1) Use the ocrconfig utility to list the automatic backups of the Oracle Cluster
Registry (OCR) and the node or nodes on which they have been performed.
Note: You will see backups listed only if it has been more than four hours
since Grid Infrastructure was installed.
$ocrconfig –showbackup
3) Display only the manual backups that have been performed and identify the
node for which the backup was stored. Do logical backups appear in the
display?
$ocrconfig -showbackup manual
4) Determine the location of the Oracle Local Registry (OLR) using the ocrcheck
utility.
$ocrcheck –local
Practices for Lesson 8
In this practice, you will work with Oracle Clusterware log files and learn to
use the ocrdump and cluvfy utilities.
Practice 8-1: Working with Log Files
In this practice, you will examine the Oracle Clusterware alert log and then package
various log files into an archive format suitable to send to My Oracle Support.
1) While connected as the oracle user to your first node, locate and view the
contents of the Oracle Clusterware alert log.
$ cd /u01/app/11.2.0/grid/log/host01ol5-112-rac1
$ view alerthost01*.log
Accept the "Create and configure a database" option by clicking the "Next" button.
Accept the "Server Class" option by clicking the "Next" button.
Make sure both nodes are selected, then click the "Next" button.
Click on SSH Connectivity, enter the oracle users’s password and click on Setup.
Accept the "Typical install" option by clicking the "Next" button.
Enter "/u01/app/oracle/product/11.2.0/db_1" for the software location. The storage type
should be set to "Automatic Storage Manager". Enter the appropriate passwords and
database name, in this case oracle1.
Wait for the prerequisite check to complete. If there are any problems either fix them, or
check the "Ignore All" checkbox and click the "Next" button.
If everything is ok in the summary information, click the "Finish" button.
If you have an error related to nodeapps, then run this from the first node:
$ srvctl stop nodeapps -n ol5-112-racn
$ srvctl start nodeapps -n ol5-112-racn
ol5-112-racn is the node for which the error is reported.
Wait while the installation takes place.
Once the software installation is complete the Database Configuration Assistant (DBCA)
will start automatically.
Once the Database Configuration Assistant (DBCA) has finished, click the "OK" button.
When prompted, run the configuration scripts on each node. When the scripts have been
run on each node, click the "OK" button.
1) Disk groups are reconfigured occasionally to move older data to slower disks. Even
though these operations occur at scheduled maintenance times in off-peak hours, the
rebalance operations do not complete before regular operations resume. There is some
performance impact to the regular operations. The setting for the ASM_POWER_LIMIT
initialization parameter determines the speed of the rebalance operation. Determine the
current setting and increase the speed by 2.
a) Open a terminal window on the first node, become the grid user, and set the
environment to use the +ASM1 instance. Connect to the +ASM1 instance as SYS with
the SYSASM privilege. What is the setting for ASM_POWER_LIMIT?
b)This installation uses an SPFILE. Use the ALTER SYSTEM command to
change ASM_POWER_LIMIT for all nodes.
SQL> show parameter SPFILE
SQL> ALTER SYSTEM set ASM_POWER_LIMIT=3 SCOPE=BOTH
SID='*';
SQL> show parameter ASM_POWER_LIMIT
2) You have decided that due to other maintenance operations you want one instance
+ASM1 to handle the bulk of the rebalance operation, so you will set the ASM
POWER_LIMIT to 1 on instance +ASM2 and 5 on instance +ASM1.
SQL> ALTER SYSTEM set ASM_POWER_LIMIT=1 SCOPE=BOTH
SID='+ASM2';
SQL> ALTER SYSTEM set ASM_POWER_LIMIT=5 SCOPE=BOTH
SID='+ASM1';
SQL> show parameter ASM_POWER_LIMIT NAME
SQL> column NAME format A16
SQL> column VALUE format 999999
SQL> select inst_id, name, value from GV$PARAMETER
where name like 'asm_power_limit';
4)
a) Examine the disk I/O statistics using the lsdsk --statistics command.
ASMCMD > lsdsk –statistics
b)Examine the disk statistics bytes and time for the DATA disk group with
the iostat –t –G DATA command.
ASMCMD> iostat -t -G DATA Group
Practices for Lesson 13
In this practice, you will administer ASM files, directories, and templates.
Practice 13-1: Administering ASM Files, Directories, and
Templates
In this practice, you use several tools to navigate the ASM file hierarchy and manage
aliases.
1) ASM is designed to hold database files in a hierarchical structure. After setting up
the grid environment, navigate the RAC database files with ASMCMD. Use the cd
and ls commands (like OS).
2) The default structure may not be the most useful for some sites. Create a set of
aliases for directories and files to match a file system. Use EM.
4) Create another data file for the XYZ tablespace. Allow the file to receive a
default name. Did both the files get system-assigned names?