Views Relevant to Oracle Data Guard

Posted by Sagar Patil
LOGICAL DBA_LOGSTDBY_EVENTS Contains information about the activity of the logical standby database system. It can be used to determine the cause of failures that occur when SQL Apply is applying redo to logical standby databases.
LOGICAL DBA_LOGSTDBY_LOG Shows the log files registered for logical standby databases.
LOGICAL DBA_LOGSTDBY_NOT_UNIQUE Identifies tables that have no primary and no non-null unique indexes.
LOGICAL DBA_LOGSTDBY_PARAMETERS Contains the list of parameters used by SQL apply.
LOGICAL DBA_LOGSTDBY_PROGRESS Describes the progress of SQL Apply on the logical standby database.
LOGICAL DBA_LOGSTDBY_SKIP Lists the tables that will be skipped by SQL Apply.
LOGICAL DBA_LOGSTDBY_SKIP_TRANSACTION Lists the skip settings chosen.
  DBA_LOGSTDBY_UNSUPPORTED Identifies the schemas and tables (and columns in those tables) that contain unsupported datatypes. Use this view when you are preparing to create a logical standby database.
PHYSICAL/LOGICAL V$ARCHIVE_DEST

Describes, for the current instance, all of the destinations in the Data Guard configuration, including each destination’s current value, mode, and status.
Note: The information in this view does not persist across an instance shutdown.

PHYSICAL/LOGICAL V$ARCHIVE_DEST_STATUS

Displays runtime and configuration information for the archived redo log destinations.
Note: The information in this view does not persist across an instance shutdown.

PHYSICAL/LOGICAL V$ARCHIVE_GAP Displays information to help you identify a gap in the archived redo log files.
PHYSICAL/LOGICAL V$ARCHIVED_LOG Displays archive redo log information from the control file, including names of the archived redo log files.
PHYSICAL/LOGICAL V$DATABASE Provides database information from the control file.
PHYSICAL/LOGICAL V$DATABASE_INCARNATION Displays information about all database incarnations. Oracle Database creates a new incarnation whenever a database is opened with the RESETLOGS option. Records about the current and the previous incarnation are also contained in the V$DATABASE view.
PHYSICAL/LOGICAL V$DATAFILE Provides datafile information from the control file.
PHYSICAL/LOGICAL V$DATAGUARD_CONFIG Lists the unique database names defined with the DB_UNIQUE_NAME and LOG_ARCHIVE_CONFIG initialization parameters.
PHYSICAL/LOGICAL V$DATAGUARD_STATUS Displays and records events that would typically be triggered by any message to the alert log or server process trace files.
PHYSICAL/LOGICAL V$LOG Contains log file information from the online redo log files.
PHYSICAL/LOGICAL V$LOGFILE Contains information about the online redo log files and standby redo log files.
PHYSICAL/LOGICAL V$LOG_HISTORY Contains log history information from the control file.
PHYSICAL V$MANAGED_STANDBY

Displays current status information for Oracle database processes related to physical standby databases.
Note: The information in this view does not persist across an instance shutdown.

PHYSICAL/LOGICAL V$STANDBY_LOG Contains log file information from the standby redo log files.

Multimaster Replication :How to resolve Replication Errors

Posted by Sagar Patil

While using multimaster replication often you would be bombarded with errors like “No data found”, “Unique Key Violated” etc .

These are purely data mismatch errors and a user intervention needed to resolve them.

I often come across these errors when we run applications at multiple sites which are part of same replication group/tables when they are designed to run at one replication site at any given time.

You can get list of these errors at DEFERROER view with transaction ids but there is no easy way to locate the parameters,columns and tables on which these errors occurred.

Thankfully there is a solution if you have EM installed.

Read more…

10g RAC Install under RHEL/OEL 4.5

Posted by Sagar Patil

1.Objectives

5 Installation
5.1 CRS install
2 System Configuration 5.2 ASM Install
2.1 Machine Configuration 5.3 Install Database Software
2.2 External/Shared Storage 5.4 create RAC Database
2.3 Kernel Parameters 6 Scripts and profile files
5.4 .bash_profile rac01
3 Oracle Software Configuration 5.5 .bash_profile rac02
3.1 Directory Structure
3.2 Database Layout
3.3 Redo Logs 6 RAC Infrastructure Testing
3.4 Controlfiles 6.1 RAC Voting Disk Test
6.2 RAC Cluster Registry Test
4 Oracle Pre-Installation tasks 6.3 RAC ASM Tests
4.1 Installing Redhat 6.4 RAC Interconnect Test
4.2 Network Configuration 6.5 Loss of Oracle Config File
4.3 Copy Oracle 10.2.0.1 software onto server
4.4 Check installed packages Appendix
4.5 validate script 1. OCR/Voting disk volumes INAccessible by rac02 87
4.6 Download ASM packages 2. RAC cluster went down On PUBLIC network test. 88
4.7 Download OCFS packages
4.8 Creating Required Operating System Groups and Users.
4.9 Oracle required directory creation
4.10 Verifying That the User nobody Exists
4.11 Configuring SSH on Cluster Member Nodes For oracle
4.12 Configuring SSH on Cluster Member Nodes for root.
4.13 VNC setup
4.14 Kernel parameters
4.15 Verifying Hangcheck-timer Module on Kernel 2.6
4.16 Oracle user limits
4.17 Installing the cvuqdisk Packeage for linux.
4.18 Disk Partitioning
4.19 Checking the Network Setup with CVU
4.20 Checking the Hardware and Operating System Setup with CVU
4.21 Checking the Operating System Requirements with CVU.
4.22 Verifying Shared Storage
4.23 Verifying the Clusterware Requirements with CVU
4.24 ASM package install
4.25 OCFS package install
4.26 disable SELinux
4.27 OCFS2 Configuration
4.28 OCFS2 File system format
4.29 OCFS2 File system mount

Read more…

Compare and copy files remotely using SCP

Posted by Sagar Patil

Following script will only work if your servers were enabled with password less login ( How to for linux /HP UNIX)

For TRUE64 Unix , I am using cksum here instead of linux md5sum. To use same script for linux just change cksum to md5sum or un comment lines in script.

Usage :

1. Your Archive Space filled up and database is stuck until you make space available. Rman backup runs every night and you don’t have access to netbackup scheduler. You want to keep on pushing archive files to a secure directory ASAP.

2. Your trace dump (udump/bdump) is filling up and you want to save trace files for future use by copying files at different location.

3. You have a dataguard standby server . Standby was down for couple of days and somehow MRP has not copied files and complaining about archives in an apply process.

How this script works? : This script will compare md5sum with local & remote files , and only copy files not available at remote site.It will also spool script “remove-$timeStamp.sh.old” to delete files once copied. I have not integrated delete functionality in script but you can delete files by running this script manually.

Parameters :

Name of Instance/File Name  : My archive files are named as “INSTANCE_NAME_%%Sequence%%.arc” like CVD_LIVE_00100.arc so I will run as “<script_name> CVD_LIVE”

Delete Days : If you pass  “<script_name> delete 5” it will delete files older than 5 days excluding today

#!/bin/bash

# Define the target host
host=”%backup_server%”

# Define the remote storage path
remotePath=”/backup2/oracle/CPI_L2_A”

# Command to use for removing files
rmCommand=”rm -f” # -f recommended, to prevent missing files breaking the script

#define the pattern to use when removing old files
# this removes old backups
removePattern=”*.[Aa][Rr][Cc]”
#this removes old remove scripts
#removePattern=”remove-*.sh”

# make sure to get a parameter
if [ “${1}” = “” ]; then
echo “Parameter required”
exit
fi

# if the parameter is delete, act specially
if [ “${1}” = “delete” ]; then
# delete needs an numeric augment
if [ “${2}” = “” ]; then
echo “delete requires an argument”
exit
fi
# remove all matching files modified in the last few days
# excluding those modified today
#    touch -t $(date +%m%d)0000 .tmp.$$
find $removePattern -mtime -${2} -and ! -newer .tmp.$$ -exec echo {} \;
rm .tmp.$$
exit
fi

# otherwise, act as if its the first part of a .arc file
list=`ls ${1}_*.[aA][rR][cC]`

timeStamp=`date +%Y-%m-%d-%H%M`

for i in $list
do
#    remoteres=`ssh $host md5sum $remotePath/$i 2>&1`
remoteres=`ssh $host cksum $remotePath/$i 2>&1`

#  localres=`md5sum $i 2>&1`
localres=`cksum $i 2>&1`

remoteMD5=`echo $remoteres | awk ‘{ print $1; }’`
localMD5=`echo $localres | awk ‘{ print $1; }’`

# these show the md5’s being returned above, just disable them not to see it
echo $i $remoteMD5
echo $i $localMD5

if [ “$remoteMD5” != “$localMD5” ]; then
# the files dont match, or the remote doesn’t have the file …
echo “$rmCommand $i” >> remove-$timeStamp.sh.old
scp $i $host:$remotePath/$i
fi
done

# make sure you can run the remove script …
if [ -f remove-$timeStamp.sh ]; then
chmod +x remove-$timeStamp.sh.old
fi

Top of Page

Top menu