Wednesday, November 6, 2013

Analyzing physical RAM on the server to determine whether an increase needed

Check the total physical RAm on the server by running
lsattr -El sys0 -a realmem
Result would look something like this:
> lsattr -El sys0 -a realmem
realmem 25165824 Amount of usable physical memory in Kbytes False
The go through each end every database running on the server and do the following steps:
  1. Login to sqlplus
  2. Check MEMORY_TARGET parameter:
    SQL>SHOW PARAMETER MEMORY_TARGET
    
    If value is not 0, then use it, but if it is 0, then use sum of values of SGA and PGA
    SQL>SHOW PARAMETER SGA_TARGET
    
    and
    SQL>SHOW PARAMETER PGA_AGGREGATE_TARGET
    
  3. After adding up all the values for each and every running database, calculate the percentage currently taken up. If it is no more than 50-70%, no change needed.

Monday, November 4, 2013

Oracle DataGuard switchiver vs. failover

Switchover is a planned role reversal between primary and standby databases in DataGuard configuration. it guarantees no data loss and is typically done for maintenance. There is no need to re-enable either database when the transition occurs.

Failover is not planned and is typically performed in event of primary database failure event, when there is no possibility of recovering primary database in a timely fashion. When failure occurs, standby database is taking over the primary role. Failover may result in data loss, depending on the protection mode enabled at the time failover occurs.

If a DataGuard broker is enabled, we can automate the failover, however if DataGuard broker is not enabled, we will have to perform manual failover.

If a DataGuard broker cannot detect the heartbeat of the primary DB, it will automatically perform the failover.

Friday, October 25, 2013

ksh: /usr/bin/rm: 0403-027 The parameter list is too long.

Error: ksh: /usr/bin/rm: 0403-027 The parameter list is too long.

Details: This error occurs when attempting to remove old files using rm *.aud

Cause:There are too many files to remove

Solution:Use the following command instead to delete first all files that are older than 5 days:
find /oracle/admin/testP/adump/ -name '*.aud' -mtime +5 -exec rm {} \;

Thursday, October 24, 2013

ORA-00119: invalid specification for system parameter LOCAL_LISTENER

Error: ORA-00119: invalid specification for system parameter LOCAL_LISTENER ORA-00132: syntax error or unresolved network name 'LISTENER_'

Details: This error occurs when attempting to start the database

Cause:The lack of a LOCAL_LISTENER, that must be defined in the TNSNAMES.ORA

Solution:In TNSNAMES.ORA (not in LISTENER.ORA) define the following entry for the local listener:
LISTENER_ =  (ADDRESS = (PROTOCOL = TCP)(HOST = servername)(PORT = 1521)) 

Wednesday, October 23, 2013

sp2-1503 unable to initialize oracle call interface

Error: sp2-1503 unable to initialize oracle call interface

Details: This error occurs when attempting to start sqlplus

Cause:PATH variable is not set correctly

Solution:Set and export PATH variable
export PATH=$ORACLE_HOME/bin:$PATH

Tuesday, October 22, 2013

TNS-03505: Failed to resolve name

Error: TNS-03505: Failed to resolve name

Details: This error occurs when doing tnsping DBName

Cause:ORACLE_HOME and/or PATH variables are not set correctly

Solution:Set and export both correct ORACLE_HOME and PATH
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/client_1
export PATH=$PATH:$ORACLE_HOME/bin

Thursday, October 10, 2013

ORA-12514: TNS:listener does not currently know of service

Error: ORA-12514: TNS:listener does not currently know of service

Possible Cause:The database might not have been registered with a listener

Diagnosing the error:The following things should eb done to diagnoze the error
  1. Check what listener is running:
    > lsnrctl status
    
  2. Check LOCAL_LISTENER parameter
    SQL> show parameter local_listener
    
    Usually it is blank by default and thus at startup the database is dynamically registered with the listener that is currently running. If LOCAL_LISTENER does have a value, then it means that database is trying to register with the configuration of the listener listed in LOCAL_LISTENER

Possible Solution:Clearing the value of LOCAL_LISTENER:


SQL> alter system set local_listener='';
SQL>lsnrctl reload
or

SQL> alter system set local_listener='' scope=both sid='*';
SQL>lsnrctl reload