The asmcmd Utility
Oracle Database Tips by Donald Burleson
A new command line tool is included with 10g
release 2 called asmcmd.
Figure 11.3 shows that it is launched by first setting the environment
for +ASM, then calling it with the asmcmd command. The idea of this
tool is to make administering the asm files similar to administering
standard operating system files.
Two Methods for
Deleting Orphaned ASM Files
is a great tool for deleting orphaned files; files left over from
previously dropped tablespaces. We have learned that if a datafile is
created using only the diskgroup name, it will be automatically
deleted if the tablespace is dropped. However, if a datafile is
explicitly named, and its tablespace is dropped, it will become
orphaned, taking up unnecessary space with no purpose.
Figure 11.4 demonstrates creating a new tablespace
with two named datafiles and then dropping it.
Now, there are two files stored on ASM that need
to be deleted. This gives us the opportunity to remove these files
with two different methods. The first method is the only method
available in 10g release 1.
Figure 11.5 demonstrates deleting one file using
sqlplus connected to the +ASM1 instance.
Figure 11.6 demonstrates deleting a file using
asmcmd. Of course,
this method is only available after 10g release 2 software is
utility does not provide a command history with the up-arrow
key. With rlwrapinstalled, this
can be fixed by adding the following entry to the ~oracle/.bashrc
Creating a Database
with Database Configuration Assistant
With the ASM instances running on both nodes, try
creating an ASM dependant database with dbca. During this attempt, the
message seen in Figure 11.7 will appear.
This is odd. The ASM instance is running but it is
not detected! This never happened with release 1 software, so what has
The problem is caused by the entry in the /etc/oratab
file where ASM is listed using its database name instead of the
instance name. Edit the file as in this example for oracle1:
Keep in mind that with this change, racenv cannot
be used to change the environment to connect to +ASM. Use oraenv
Another consistent problem that has been
experienced with the release 2 dbca is the error seen in Figure 11.8.
To fix this problem, simply run the
update_tns.sh script on each
node to populate the tnsnames.ora
in the release 2 home before database creation begins. It is not
necessary to restart dbca to
fix this problem. Click abort and start database creation anew. When
the database is finished, edit the tnsnames.ora to check that all
service entries are properly written.
An important new feature of
dbca release 2 is the
ability to configure only ASM. In release 1, it had to be done
manually or as part of creating a database. This feature can be
accessed from the screen depicted in Figure 11.9.
If you want to learn RAC at home, get the bestselling book "Personal
Oracle Real Application Clusters" by Edward Stoever.
You can buy it direct from the publisher for 30%-off and get
instant access to the code depot of Oracle tuning scripts.