Wednesday, October 1, 2014

DATAGUARD: Oracle Physical standby database Log shipping issue

Symptom:
  Physical standby was sync with primary a day ago, but stopped receiving logs. All logs are still available on primary site.

Error message:
   'ORA-01031: insufficient privileges'

Cause:
  sys password was changed on primary side.

Solution:
  copy password file from primary to standby site

Check sql:
select sequnece#, applied from v$archived_log;
select process, status, sequence# from v$managed_standby;
select dest_id, status, error from v$archive_dest;
alter database recover managed standby database using current logfile disconnect;
(alter database recover managed standby database disconnect from session;)
alter database recover managed standby database cancel;
show parameter fal_client
show parameter fal_server
show parameter log
alter system witch logfile;
alter system set log_archive_dest_state_3=enable;
alter database register logfile 'path/filename';
rman> catalog start with '/var/arch';

Check step:
1. check network
tnsping fal_client and fal_server and service_name of log_archive_dest_state_3
2. check instance are up
3. check password
login as sys to both primary and standby database.
4. check error for log_dest

Processes:
primary database

There are a number of Oracle background processes that play a key role, first the primary database
•LGWR - log writer process flushes from the SGA to the ORL files
•LNS - LogWriter Network Service reads redo being flushed from the redo buffers by the LGWR    and performs a network send of the redo to the standby
•ARCH - archives the ORL files to archive logs, that also used to fulfill gap resolution requests, one ARCH processes is dedicated to local redo log activity only and never communicates with a

standby database

The standby database will also have key processes
•RFS - Remote File Server process performs a network receive of redo transmitted from the primary and writes the network redo to the standby redo log (SRL) files.
•ARCH - performs the same as the primary but on the standby
•MRP - Managed Recover Process coordinates media recovery management, recall that a physical standby is in perpetual recovery mode
•LSP - Logical Standby Process coordinates SQL apply, this process only runs in a logical standby
•PR0x - recovery server process reads redo from the SRL or archive log files and apply this redo to the standby database.

reference:
http://www.dba-oracle.com/t_physical_standby_missing_log_scenario.htm
http://www.datadisk.co.uk/html_docs/oracle_dg/cheatsheet.htm
http://arup.blogspot.com/2009/12/resolving-gaps-in-data-guard-apply.html
http://jarneil.wordpress.com/2008/05/16/registering-archive-logfiles-on-a-standby/
http://www.syksky.com/oracle/oracle-11g-data-guard-log-shipping-fails-with-error-ora-16191.html

Monday, July 7, 2014

Change Monitor resolution from terminal

Problem:
default resolution is not support by my moniter. There is black screen on the monitor but remote ssh login is available.

Solution:

1. check /var/log/xorg.0.log to find out monitor name and allowed resolution. or run command to findout

[root@test log]# xrandr -d :0
Screen 0: minimum 320 x 200, current 1280 x 1024, maximum 8192 x 8192
HDMI-0 disconnected (normal left inverted right x axis y axis)
DVI-0 disconnected (normal left inverted right x axis y axis)
VGA-0 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 384mm x 306mm
   1280x1024      56.3*+   60.0
   1280x960       60.0
   1152x864       75.0
   1024x768       75.1     70.1     60.0
   832x624        74.6
   800x600        72.2     75.0     60.3     56.2
   640x480        72.8     75.0     66.7     60.0
   720x400        70.1



2. change resolution with command from termial

  xrandr -d :0 --output VGA-0 --mode 1152x864

reference:
http://askubuntu.com/questions/405645/how-to-enable-monitor-from-terminal

Thursday, June 26, 2014

Generate multiple files using each line of a file in Linux

ISSUE:

Sometimes a file or a command need be used against to a list of servers or databases. So a general file or command need be generated with specific information as a general pattern such as database name.

SOLUTION:

A simple While statement can do this task.  So general while statement is provided for easy access

Statement:

while read line
do
host_name=`echo $line | cut -d ' ' -f 1` #get first field of input line
host_ip=`echo $line | cut -d ' ' -f 2`       # get second field of input line
short_hname=${host_name%%\.*}      # remove domain port of hostname
alias_hname=${short_hname:9:5}        # extract 5 character starting at 9 as alias name
if [ ${short_hname:0:3} == "tet" ] ; then # extract 3 character to setup environment name
env_name=test
else
env_name=${short_hname:4:3}
fi
echo "sshpass -e ssh -o StrictHostKeyChecking=no test@$host_ip" > ${env_name}_${alias_hname}_${short_hname}.sh  # generate a sh file for ssh login for each server
chmod 700 ${env_name}_${alias_hname}_${short_hname}.sh # make gererated file executable
done < serverlist.txt

Wednesday, June 18, 2014

Xlib: Client is not authorized to connect to Server Exceed

ISSUE:

Remote display is refused by local exceed server.

Cause:

host acceptence ACL is not configured for the remote server.

Solution:

configure exceed to accept anyhost or the remote servers you want

1.  click Start -> all program -> Hummingbird Connectivity 2008 x64 -> exceed tools -> Xconfig



2. click icon "Security, Access Control and System Administration" category.


3. select file if you need input a list of servers or any host access for all hosts

4. save and exit

Friday, January 24, 2014

ERROR OGG-01224 Address already in use.

PROBLEM:
mgr cannot start. "ERROR   OGG-01224  Address already in use and ERROR   OGG-01668  PROCESS ABENDING." appear in mgr.rpt

CAUSE:
Previous mgr process is still runing, which used port 7810 according to parameter file.

SOLUTION:

as root:
root> netstat -nap | grep 7810
tcp        0      0 :::7810                     :::*                        LISTEN      7590/./mgr
root> kill -9 7590

restart mgr process.

ERROR OGG-01668 Oracle GoldenGate Manager for Oracle, mgr.prm: PROCESS ABENDING.

PROBLEM:
mgr process can not start. "ERROR   OGG-01668  Oracle GoldenGate Manager for Oracle, mgr.prm:  PROCESS ABENDING" appears in ggserr.log. "ERROR   OGG-01091  Oracle GoldenGate Manager for Oracle, mgr.prm:  Unable to open file "/app/oracle/gg/bin/dirrpt/MGR.rpt" (error 2, No such file or directory)." appears in ggserr.log.

CAUSE:
subdirectory is not created.

SOLUTION:
create subdirectories.