Databases Reference
In-Depth Information
The ASMCMD utility will also allow you to view and display information about your ASM environment. Before
running the asmcmd , ensure that you set the ORACLE_SID variable of the ASM instance as follows:
C:\> set ORACLE_SID=+ASM
If the ORACLE_SID variable is not properly set to the correct ASM instance, then you will get the following
error message:
asmcmd: command disallowed by current instance type
Also ensure that ORACLE_HOME is set properly. If it isn't, then Oracle will display an error such as this:
asmcmd: the environment variable ORACLE_HOME is not set.
Once you set your environment variables, you should be able to invoke the ASMCMD utility and use its
Linux/Unix-like commands to manage your ASM environment. If you want to view more information about ASM
commands, use the help option:
ASMCMD> help
ASMCMD> help md_backup
The asmcmd is not available by default in oracle Database 10 g release 1, but you can copy the two required
files from the oracle Database 10g release 2 installation, namely, asmcmdcore and asmcmd for linux/unix or asmcmd.
bat for Windows. You can find these files in the oraCle_hoMe/bin directory.
Note
Automatically Determining Whether Backups Are Working
Problem
You want an automated method of determining whether RMAN backups are running successfully.
Solution
Use a combination of SQL, shell scripting, and a scheduler such as cron to automatically detect when the RMAN
backups have not completed successfully. The following shell script queries the data dictionary to determine whether
backups have run within a specified number of days:
#!/bin/bash
#
if [ $# -ne 2 ]; then
echo "Usage: $0 SID threshold"
exit 1
fi
# source oracle OS variables
. /var/opt/oracle/oraset $1
crit_var=$(sqlplus -s <<EOF
/ as sysdba
 
 
Search WWH ::




Custom Search