Tuesday, August 31, 2010

ORA-13516: AWR Operation failed: SWRF Schema not initialized

Problem Description
While executing dbms_workload_repository package the following error message is reported.
sql> exec dbms_workload_repository.modify_snapshot_settings(interval=>0);

BEGIN dbms_workload_repository.modify_snapshot_settings(interval=>0); END;
ERROR at line 1:
ORA-13516: AWR Operation failed: SWRF Schema not initialized
ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 85
ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 133
ORA-06512: at line 1

Cause of the Problem
These errors have happened because of wrong or invalid objects with respect to AWR.

Solution of the Problem
In order to resolve the issue you need to drop and recreate the AWR objects, which you can do by running CATNOAWR.SQL and CATAWR.SQL scripts.

Note that from 10.2 onwards, the script name has changed. The catalog script for AWR Tables, used to create the Workload Repository Schema is CATAWRTB.SQL .

In case of Oracle 10gR1,
To re-create the AWR objects, by running the catnoawr.sql and catawr.sql scripts located in $ORACLE_HOME/rdbms/admin.
SQL> @$ORACLE_HOME/rdbms/admin/catnoawr.sql
SQL> @$ORACLE_HOME/rdbms/admin/catawr.sql
SQL> shut immediate
SQL> startup
In case of Oracle 10gR2,
SQL> @$ORACLE_HOME/rdbms/admin/CATAWRTB.sql
SQL> shut immediate;
SQL> startup
On re-start of the database instance, the AWR tables will be populated with the required data.

Note that, the CATNOAWR.SQL scripts is no longer available in 10.2 and cannot be found
in the $ORACLE_HOME/rdbms/admin directory.

BSLN_MAINTAIN_STATS_JOB fails with ORA-12012, ORA-06502, ORA-06512

Problem Description
The BSLN_MAINTAIN_STATS_JOB doesn't run anymore.
From the trace file we see the following information.
ORA-12012: error on auto execute of job 11689
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "DBSNMP.BSLN_INTERNAL", line 2073

Cause of the Problem
Table DBSNMP.BSLN_BASELINES contains inconsistent information. In this case, after database cloning, existing records in table "DBSNMP.BSLN_BASELINES" conflict with new baseline information inserted in the cloned database.

Solution of the Problem
The DBSNMP user needs to be dropped and re-created.

Login as sys user.

SQL> sqlplus / as sysdba

From the sqlplus execute the following:

Drop the user by executing catnsnmp.sql script.
SQL> @$ORACLE_HOME/rdbms/admin/catnsnmp.sql

Create the DBSNMP user by executing catsnmp.sql
SQL> @$ORACLE_HOME/rdbms/admin/catsnmp.sql

Datapump export or import fails with ORA-31626, ORA-31633, ORA-00955

Problem Description
While doing datapump export or import operation it fails with following error messages:

ORA-31626: job does not exist
ORA-31633: unable to create master table "ARJU.SYS_EXPORT_TABLE_05"
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPV$FT", line 863
ORA-00955: name is already used by an existing object

Cause of the Problem
Error is caused by a stopped job that remained in the DBA_DATAPUMP_JOBS. The new expdp/impdp job has the same name as the old expdp/impdp job.

Solution of the Problem
Clear the old job or specify a different name for the new job.

Step 01. Determine in SQL*Plus which Data Pump jobs exist in the database:
select owner_name, job_name, operation, job_mode, 
state, attached_sessions
from dba_datapump_jobs
where job_name not like 'BIN$%'
order by 1, 2;

Step 02. Ensure that the listed jobs in DBA_DATAPUMP_JOBS are not active DataPump export/import jobs. The status should be 'NOT RUNNING'.

Step 03. Check with the job owner that the job with status 'NOT RUNNING' in DBA_DATAPUMP_JOBS is not an export/import DataPump job that has been temporary stopped, but is actually a job that failed.

Step 04. Determine in SQL*Plus the related master tables:
select o.status, o.object_id, o.object_type, 
o.owner||'.'||object_name "OWNER.OBJECT"
from dba_objects o, dba_datapump_jobs j
where o.owner=j.owner_name and
o.object_name=j.job_name and
j.job_name not like 'BIN$%'
order by 4, 2;

Step 05. For jobs that were stopped in the past and won't be restarted anymore, delete the master table.
drop table ARJU.SYS_EXPORT_TABLE_05 ;

Related Documents
Expdp fails with ORA-01950 and ORA-01536
Expdp fails with ORA-31626, ORA-31633, ORA-06512, ORA-01031
Data pump export fails with ORA-39000, ORA-31641,ORA-27038

Troubleshoot ORA-06512: at line

ORA-06512 is a common error faced by Oracle DBA, programmers as well as end users. ORA-06512 does not identify the root cause of the problem, rather it only prints the line number where the errors or exception happened. So just before ORA-06512 there will be additional error which we may need to investigate. If the errors come from any function or package or package body or procedure then with ORA-06512 there exists the name of the function or package or package body or procedure as well as the line number of those objects where error is occurred.

A simple demonstration of ORA-06512 error using PL/SQL anonymous block is shown below.
SQL> declare
2 var1 number(3);
3 begin
4 var1:=1000;
5 end;
6 /
declare
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: number precision too large
ORA-06512: at line 4
As this one is simply anonymous block and no package, function or procedure involved, so it does not generate any additional ORA-06512 error. However, just before ORA-06512 error there contains the root cause of the problem which is due to "ORA-06502: PL/SQL: numeric or value error: number precision too large". ORA-06512 simply notifies the problem happened at line number 4 of the anonymous block because we declare var1 length as 3 digits but we were going to insert 4 digits.

Now let's look a small variation of above error. Same code with a procedure.
SQL> create or replace procedure ORA06512_demo as
2 var1 number(3);
3 begin
4 var1:=1000;
5 end;
6 /

Procedure created.

SQL> exec ORA06512_demo
BEGIN ORA06512_demo; END;

*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: number precision too large
ORA-06512: at "ARJU.ORA06512_DEMO", line 4
ORA-06512: at line 1
Here notice as the code is run by a procedure and procedure contains same error so ORA-06512 is generated twice. If there is several ORA-06512 error then you should first take care of the first one. It is specified in which procedure as well as in which line problem happened. Then step by step you should fix second, third and so on if after fixing first one you get any more. Here "ORA-06512: at line 1" error is generated for the statement "exec ORA06512_demo".

To make you more clear, I will show you a more detail example.
SQL> create or replace procedure ORA06512_DEMO_SUB2(var1in number, string1in varchar2) as
2 var1 number;
3 var2 number;
4 var3 number;
5 begin
6 var1:=var1in;
7 var2:=string1in;
8 var3:='a';
9 end;
10 /

Procedure created.

SQL> create or replace procedure ORA06512_DEMO_SUB1(string1 varchar2) as
2 var1 number ;
3 begin
4 var1:=100;
5 ORA06512_DEMO_SUB2(var1,string1);
6 end;
7 /

Procedure created.

SQL> create or replace procedure ORA06512_DEMO_MAIN as
2 begin
3 ORA06512_DEMO_SUB1('This is a string');
4 end;
5 /

Procedure created.

SQL> exec ORA06512_DEMO_MAIN;
BEGIN ORA06512_DEMO_MAIN; END;

*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at "ARJU.ORA06512_DEMO_SUB2", line 7
ORA-06512: at "ARJU.ORA06512_DEMO_SUB1", line 5
ORA-06512: at "ARJU.ORA06512_DEMO_MAIN", line 3
ORA-06512: at line 1
Here you see the first ORA-06512 is generated for the procedure "ARJU.ORA06512_DEMO_SUB2" and line 7. So you should take care of that first. The main cause of the problem is for ORA-06502 which is shown just before very first of ORA-06512 error. So fix the "ARJU.ORA06512_DEMO_SUB2" procedure first by changing datatype and then "ARJU.ORA06512_DEMO_SUB1" and so on.

Let's try to fix the problem. So deal with "ARJU.ORA06512_DEMO_SUB2" procedure. We see input parameter string1in is datatype of varchar2. Within procedure it is assigned to variable var2 which is number datatype, so we need to change it to varchar2. Also var3 is number datatype, so we will assign number variable into it not any char type. So doing these two changes and then run the main procedure ORA06512_DEMO_MAIN.
SQL> create or replace procedure ORA06512_DEMO_SUB2(var1in number, string1in varchar2) as
2 var1 number;
3 var2 varchar2(20);
4 var3 number;
5 begin
6 var1:=var1in;
7 var2:=string1in;
8 var3:=10;
9 end;
10 /

Procedure created.

SQL> exec ORA06512_DEMO_MAIN;

PL/SQL procedure successfully completed.
It looks perfect.

Related Documents
ORA-39127 ORA-04063 ORA-06508 ORA-06512 package body "WMSYS.LT_EXPORT_PKG" has errors
ORA-13600, QSM-00775, ORA-06512 when running DBMS_ADVISOR
Expdp fails with ORA-31626, ORA-31633, ORA-06512, ORA-01031
Export Full=y fails with PLS-00201 ORA-06510 ORA-06512
Expdp fails with ORA-39001,ORA-39169,ORA-39006,ORA-39022

Monday, August 30, 2010

Oracle DBA Interview Questions - Part 1

Question 01: When Oracle database implemented PL/SQL Language?
Answer: The first version of the PL/SQL language is introduced in Oracle version 6. In oracle Oracle7, released in 1992, introduced PL/SQL stored procedures and triggers.

Question 02: In which version of Oracle RAC is implemented?
Answer: Oracle 9i database introduced Oracle RAC in year 2001. Later Oracle Database 10g introduced grid computing in 2003.


Question 03: What is Oracle database instance?
Answer: An Oracle instance is a set of memory structures that manage different database files. It consists of Shared/System Global Area (SGA) and a set of background processes.

Question 04: Name the Oracle schema object types.
Tables, Indexes, Partitions, Views, Sequences, Dimensions, Synonyms, PL/SQL subprograms and packages.

Question 05: What are the characteristics of Materialized Views?
i) Just like table materialized views contain data and consume storage space.
ii) They can be refreshed when the data in their master tables changes.
iii) They can improve performance of SQL execution when used for query rewrite operations.
iv) The existence of materialize view is transparent to SQL applications and users. So if optimizer sees use of materialize view is more efficient than accessing original table then for that query materialize view will be automatically used.

Question 06: Name the different types of Constraints
NOT NULL, Unique, Primary, Foreign, Check.

Question 07: What are the DDL statements?
DDL statements do structural changes or drop schema objects. For example: CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE, AUDIT, NOAUDIT, COMMENT.

Question 08: What are the DML statements?
Data manipulation language (DML) statements query or manipulate data in existing schema objects. For example: SELECT, INSERT, UPDATE, MERGE, DELETE, EXPLAIN PLAN, LOCK TABLE.

Question 09: What are the TC statements?
Transaction control statements manage the changes made by DML statements and group DML statements into transactions. For example: COMMIT, ROLLBACK, ROLLBACK TO SAVEPOINT, SAVEPOINT, SET TRANSACTION.

Question 10: What are the Session Control statements?
Session Control Statements dynamically manage the properties of a user session. For example: ALTER SESSION, SET ROLE.

Question 11: What are the System Control statements?
System control statements change the properties of the database instance. The only system control statement is ALTER SYSTEM.

Question 12: What are the Embedded SQL statements?
Embedded SQL statements incorporate DDL, DML, and transaction control statements within a procedural language program.
For example:
- Define, allocate, and release cursors (DECLARE CURSOR, OPEN, CLOSE).
- Specify a database and connect to it (DECLARE DATABASE, CONNECT).
- Assign variable names (DECLARE STATEMENT).
- Initialize descriptors (DESCRIBE).
- Specify how error and warning conditions are handled (WHENEVER).
- Parse and run SQL statements (PREPARE, EXECUTE, EXECUTE IMMEDIATE).
- Retrieve data from the database (FETCH).

Sunday, August 29, 2010

Time synchronization in Oracle clusterware 11gR2

Oracle clusterware 11gR2 requires time synchronization across all nodes within a cluster when Oracle RAC is deployed. Through two ways you can do time synchronization across the cluster.
1) An operating system configured network time protocol (NTP)
2) Oracle Cluster Time Synchronization Service (ctss).

While installing Oracle Grid Infrastructure, if you don't have NTP daemons then (Oracle Cluster Time Synchronization daemon)ctssd starts up in active mode and synchronizes time among cluster members without contacting an external time server.

When Oracle sees there is NTP, then the Oracle Cluster Time Synchronization daemon (ctssd)
starts up in observer mode and no active time synchronization is performed by
Oracle Clusterware within the cluster.

In fact Oracle Cluster Time Synchronization Service is designed for organizations whose cluster servers are unable to access NTP services. For example your RAC database does not have way to access any external time server, then you can use ctssd for your clusterware installation.

If you have NTP daemons on your server but you cannot configure them to synchronize time with a time server, and you want to use Cluster Time Synchronization Service to provide synchronization service in the cluster then do the following steps.

1) Stop the existing ntpd service
# /sbin/service ntpd stop

2) Disable ntpd service from the initialization sequences
# chkconfig ntpd off

3) Remove or move the ntp.conf file.
# rm /etc/ntp.conf
or,
# mv /etc/ntp.conf /etc/ntp.conf.org

4) Also remove the ntpd.pid file which maintains the pid for the NTP daemon.
# rm /var/run/ntpd.pid

However if you are using NTP and you you prefer to continue using it instead of Cluster Time
Synchronization Service, then you need to modify the NTP configuration to set the -x flag, which prevents time from being adjusted backward.

1) Edit the /etc/sysconfig/ntpd file to add the -x flag
# vi /etc/sysconfig/ntpd
OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"

2) Restart the NTP service.
# /sbin/service ntp restart

Note that on SUSE systems, you have to modify the configuration file /etc/sysconfig/ntp with the
following settings:
NTPD_OPTIONS="-x -u ntp"

Related Documents
ORA-15018, ORA-15072 on 11gR2 grid node 2 when running root.sh
In 11gR2 RAC after server reboot crsd fails to startup on 2nd node
PRKP-1001, CRS-0215 while starting instance using srvctl
NTP and csstd time synchronization option to install Oracle Clusterware 11gR2
cluvfy fails with PRVF-5436 PRVF-9652 Cluster Time Synchronization Services check failed
In 11gR2 Grid root.sh fails with CRS-2674: Start of 'ora.cssd' failed
What to do after failure of Oracle 11gR2 Grid Infrastructure (CRS) Installation
Enable Archive log Mode for RAC database
List of Parameters that must have identical in RAC database
CRS Stack Fails to Start After Reboot ORA-29702 CRS-0184

Saturday, August 28, 2010

ORA-15018, ORA-15072 on 11gR2 grid node 2 when running root.sh

Problem Description
Observation 01:
During installation of Oracle 11gR2 Grid Infrastructure whenever you run root.sh script on second node it fails with error ORA-15018 and ORA-15072 like below.

DiskGroup DATA1 creation failed with the following message:
ORA-15018: diskgroup cannot be created
ORA-15072: command requires at least 1 regular failure groups, discovered only 0

But root.sh ran successfully on node 1.

Observation 02:
On 2nd node after throwing the error crs fails to start and if you look for logfile rootcrs_2ndnodename.log you will see an entry like,

2010-08-09 15:20:12: Configuring ASM via ASMCA
2010-08-09 15:20:12: Executing as oracle: /u01/app/1120/grid/bin/asmca -silent -diskGroupName DATA1 -diskList ORCL:DATA1 -redundancy EXTERNAL -configureLocalASM
2010-08-09 15:20:12: Running as user oracle: /u01/app/1120/grid/bin/asmca -silent -diskGroupName DATA1 -diskList ORCL:DATA1 -redundancy EXTERNAL -configureLocalASM
2010-08-09 15:20:12: Invoking "/u01/app/1120/grid/bin/asmca -silent -diskGroupName DATA1 -diskList ORCL:DATA1 -redundancy EXTERNAL -configureLocalASM" as user "oracle"
2010-08-09 13:20:16: Configuration of ASM failed, see logs for details

Observation 03:
If you look for /etc/oratab file on second node you will see an interesting observation. There is an entry about +ASM1 instead of +ASM2.

Observation 04:
The following commands on the 2nd node show the ASM disk information correctly.
# /etc/init.d/oracleasm listdisks
# /etc/init.d/oracleasm scandisks
# ls -ltr /dev/oracleasm/disks

Observation 05:
While installing Oracle 11gR2 Grid Infrastructure on ASM, it automatically shows all the disks and disk groups without needing to click on "Disk Discovery Path". It showed disk but it added ORCL in the disk name. Suppose, it was shown disk name as ORCL:DATA1, ORCL:DATA2 etc instead of showing as only DATA1, DATA2.

Cause of the Problem
This problem is actually due to oracle bug. All disks were configured properly but due to bug it could not detect the disk rightly and an ORCL is appended which later caused the problem. There is also possible problem if within /etc/sysconfig/oracleasm file, ORACLEASM_SCANORDER and ORACLEASM_SCANEXCLUDE attribute is configured improperly.

Solution of the Problem
Step 01: Deinstall the oracle clusterware installation.
To know how to deinstall oracle clusterware have a look at http://arjudba.blogspot.com/2010/03/what-to-do-after-failure-of-oracle.html

Step 02: While installation whenever it shows the ASM disk automatically, just click on "Disk discovery path" and type the path manually and let the installer to search path there.

However, if there were improper parameters set within /etc/sysconfig/oracleasm file then do the following:

1. In all RAC nodes modify the /etc/sysconfig/oracleasm with:

ORACLEASM_SCANORDER="dm"
ORACLEASM_SCANEXCLUDE="sd"


2. In all nodes restart the asmlib by,

# /etc/init.d/oracleasm restart

3. As root, run "$GRID_HOME/crs/install/rootcrs.pl -verbose -deconfig -force" on all nodes, except the last one. If you have two nodes cluster then only run at first node.
# $GRID_HOME/crs/install/rootcrs.pl -verbose -deconfig -force

$su
# $GRID_HOME/crs/install/rootcrs.pl -verbose -deconfig -force


4. As root, run "$GRID_HOME/crs/install/rootcrs.pl -verbose -deconfig -force -lastnode" on last node. This command will zero out OCR and VD disk also. If you have two nodes cluster then run on second node.

# $GRID_HOME/crs/install/rootcrs.pl -verbose -deconfig -force -lastnode

5. As root, run $GRID_HOME/root.sh on all nodes.
# $GRID_HOME/root.sh
Related Documents
In 11gR2 RAC after server reboot crsd fails to startup on 2nd node
PRKP-1001, CRS-0215 while starting instance using srvctl
NTP and csstd time synchronization option to install Oracle Clusterware 11gR2
cluvfy fails with PRVF-5436 PRVF-9652 Cluster Time Synchronization Services check failed
In 11gR2 Grid root.sh fails with CRS-2674: Start of 'ora.cssd' failed
What to do after failure of Oracle 11gR2 Grid Infrastructure (CRS) Installation
Enable Archive log Mode for RAC database
List of Parameters that must have identical in RAC database
CRS Stack Fails to Start After Reboot ORA-29702 CRS-0184

Wednesday, August 25, 2010

In 11gR2 RAC after server reboot crsd fails to startup on 2nd node

Problem Description
Oracle Grid Infrastructure, Oracle software Installation went successfully and so creation of oracle database. After installation it is checked CRS daemon on both domains and it is shown all services are online like below.

# crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
However, after both server rebooted cluster ready service on second node does not start, but on first node it works fine.

Some output from second node,
# crs_stat -t
CRS-0184: Cannot communicate with the CRS daemon.
# crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
If you look for the Grid alert log on second node it shows,
[crsd(26294)]CRS-1013:The OCR location in an ASM disk group is inaccessible. Details in /u01/app/11.2.0/grid/log/dc-db-02/crsd/crsd.log.
2010-08-25 12:06:55.475
[ohasd(25303)]CRS-2765:Resource 'ora.crsd' has failed on server 'dc-db-02'.
2010-08-25 12:06:56.553
[crsd(26305)]CRS-1013:The OCR location in an ASM disk group is inaccessible. Details in /u01/app/11.2.0/grid/log/dc-db-02/crsd/crsd.log.
2010-08-25 12:06:57.499
[ohasd(25303)]CRS-2765:Resource 'ora.crsd' has failed on server 'dc-db-02'.
2010-08-25 12:06:57.499
[ohasd(25303)]CRS-2771:Maximum restart attempts reached for resource 'ora.crsd'; will not restart.
If you look for crsd.log file, it will show
2010-08-25 12:06:56.552: [  OCRASM][1855820272]proprasmo: Error in open/create file in dg [DATA]
[ OCRASM][1855820272]SLOS : SLOS: cat=7, opn=kgfoAl06, dep=15077, loc=kgfokge
ORA-15077: could not locate ASM instance serving a required diskgroup

2010-08-25 12:06:56.553: [ OCRASM][1855820272]proprasmo: kgfoCheckMount returned [7]
2010-08-25 12:06:56.553: [ OCRASM][1855820272]proprasmo: The ASM instance is down
2010-08-25 12:06:56.553: [ OCRRAW][1855820272]proprioo: Failed to open [+DATA]. Returned proprasmo() with [26]. Marking location as UNAVAILABLE.
2010-08-25 12:06:56.553: [ OCRRAW][1855820272]proprioo: No OCR/OLR devices are usable
2010-08-25 12:06:56.554: [ OCRASM][1855820272]proprasmcl: asmhandle is NULL
2010-08-25 12:06:56.554: [ OCRRAW][1855820272]proprinit: Could not open raw device
2010-08-25 12:06:56.554: [ OCRASM][1855820272]proprasmcl: asmhandle is NULL
2010-08-25 12:06:56.554: [ OCRAPI][1855820272]a_init:16!: Backend init unsuccessful : [26]
2010-08-25 12:06:56.554: [ CRSOCR][1855820272] OCR context init failure. Error: PROC-26: Error while accessing the physical storage ASM error [SLOS: cat=7, opn=kgfoAl06, dep=15077, loc=kgfokge
ORA-15077: could not locate ASM instance serving a required diskgroup
] [7]
2010-08-25 12:06:56.554: [ CRSD][1855820272][PANIC] CRSD exiting: Could not init OCR, code: 26
2010-08-25 12:06:56.554: [ CRSD][1855820272] Done.
Cause of the Problem
Whenever you look for "CRS-4535: Cannot communicate with Cluster Ready Services" error immediate investigate in the grid alert log as well as crsd.log file. There you would get more information regarding CRS-4535 error. From the crsd.log file we see the oracle error message
ORA-15077: could not locate ASM instance serving a required diskgroup

If we try to run ls command after inside amdcmd it fails with ASMCMD-08102
$ export ORACLE_SID=+ASM2
$ amdcmd
ASMCMD> ls
ASMCMD-08102: no connection to ASM; command requires ASM to run"
Whenever it is tried to start ASM instance manually on the second node you get error message like below.
amdcmd> startup;
ORA-27154: post/wait create failed
ORA-27300: OS system dependent operation:semget failed with status: 28
ORA-27301: OS failure message: No space left on device
ORA-27302: failure occurred at: sskgpsemsper
This error message may mislead you because there is sufficient space in your disk. df -h command proves that. This error entirely related to kernel parameter settings. If you check your semaphores setting you see there does not have enough semaphores allowed for creating more processes.

Solution of the problem
As this problem is lower settings of semaphores value so solution is to increase the semaphores value.

- Check your current semapores settings by looking for value of the parameter "kernel.sem" inside the file /etc/sysctl.conf
# cat /etc/sysctl.conf

or issue,
# /sbin/sysctl -a | grep sem

- Modify SEMMNI value in the /etc/sysctl.conf like below.
# vi /etc/sysctl.conf
kernel.sem = 250 32000 100 200
On Red Hat Linux system, in order the affect the setting of the value immediately use,
# /sbin/sysctl -p

Now starting up the asm instance is just fine and also CRS daemon is ok. Restart the node to make sure everything is working perfect.
Related Documents
ORA-15018, ORA-15072 on 11gR2 grid node 2 when running root.sh
PRKP-1001, CRS-0215 while starting instance using srvctl
NTP and csstd time synchronization option to install Oracle Clusterware 11gR2
cluvfy fails with PRVF-5436 PRVF-9652 Cluster Time Synchronization Services check failed
In 11gR2 Grid root.sh fails with CRS-2674: Start of 'ora.cssd' failed
What to do after failure of Oracle 11gR2 Grid Infrastructure (CRS) Installation
Enable Archive log Mode for RAC database
List of Parameters that must have identical in RAC database
CRS Stack Fails to Start After Reboot ORA-29702 CRS-0184

Sunday, August 8, 2010

Help to the flood affected people in Pakistan

Assalamalaikum,
Dear all,

How are you.

Please pray for the victims of the flood in pakistan, and try helping them or atleast we can pray for them.
May Allah forgive us all for not being thankful for what we have and how we are.


Also, if you have ability, please donate for them.






It is only the start of the monsoon season, but already Pakistan is experiencing some of the worst flooding it has seen in over 80 years. Entire villages have been washed away, an early estimate of over 1,600 deaths so far and over 2 million displaced or otherwise affected. Not only is the immediate water damage causing havoc, the floods have inundated crop-producing areas, dealing a crippling blow to the agricultural-based economy and threatening a food crisis. The Pakistani government now struggles to rescue and provide aid to millions - while still fighting with militant Islamist forces in many of the hardest-hit regions. With even more heavy rains predicted in the coming days, here are a handful of recent photographs of Pakistanis as they cope with this latest disaster.

A boy hangs on to the front of a cargo truck while passing through a flooded road in Risalpur, located in Nowshera District in Pakistan's Northwest Frontier Province July 30, 2010.










2
Men take refuge on a boat during heavy rain in Pakistan's Nowshera District on July 29, 2010.










3
Residents watch water pour through a street on the outskirts of Peshawar, Pakistan on July 28, 2010.








4
Pakistani villagers move to high ground escaping a flood-hit village near Nowshera, Pakistan on Thursday, July 29, 2010.








5
Nimra, a three-year-old girl, who was rescued along with her family from Kaalam in the northern area, kisses the window glass of an army helicopter after their arrival at Khuazakhela in Swat district located in Pakistan's northwest Khyber-Pakhtunkhwa Province on August 1, 2010.








6
Residents watch from a nearby hill as army helicopters rescued trapped residents from Nowshera, Pakistan on July 31, 2010.








7
Residents stand by flood water that entered a residential area of Muzaffarabad, Pakistan on July 30, 2010.








8
An aerial view of a man and his animals surrounded by floodwater in Taunsa near Multan, Pakistan, flooded on Sunday, Aug. 1, 2010.








9
A Pakistani villager struggles to reach his village through a fast-moving flood water caused by heavy monsoon rain in Bakhtiarabad, 250 km (155 mi) north of Quetta, Pakistan on Friday, July 23, 2010.








10
An aerial view shows Nowshera city submerged in flooding caused by heavy monsoon rains in Pakistan on Friday, July 30, 2010.








11
A Pakistani volunteer uses a small boat to evacuate locals in a flood-hit area of Nowshera on July 30, 2010.








12
Pakistani flood survivors cross a bridge near a damaged home in Medain, a town of Swat valley on August 2, 2010.








13
Pakistan army soldiers pass a baby across a channel in the floodwater as they help people flee from their flooded village following heavy monsoon rains in Taunsa, Pakistan on Sunday, Aug. 1, 2010.








14
Villagers try to catch trees floating in the flooded Nelum river in Muzaffarabad, the capital of Pakistani Kashmir on Friday, July 30, 2010.








15
Residents help a man untie a chicken from his neck after he evacuated his flooded home with the fowl by swimming to higher grounds in Nowshera, Pakistan on August 1, 2010.








16
A family being rescued by army soldiers passes a cargo truck with men on top taking shelter from heavy floods in Nowshera, Pakistan on July 31, 2010.









17
A soldier evacuating residents carries a flood victim to a helicopter in Sanawa, Pakistan's on August 5, 2010.









18
A Pakistani boy named Jeeshan stands outside his tent in a camp set up by the Pakistani army inside a college on the outskirts of Nowshera on August 2, 2010.










19
Pakistani flood survivors line up beside a damaged bridge in Medain, a town of Swat Valley on August 2, 2010.









20
A boy is flung back by the force of a Pakistan Air Force helicopter rotors as it drops water supplies to residents on August 2, 2010 in Nowshera, Pakistan.









21
Evacuees wade through a flooded area following heavy monsoon rains in Peshawar on Saturday, July 31, 2010.








22
People wait to cross a flooded road in Bannu, northwestern Pakistan on Tuesday, Aug. 3, 2010.








23
A boy walks through flood destroyed homes on August 4, 2010 in Pabbi, near Nowshera, Pakistan.









24
A family portrait is seen, attached to a bookcase buried in mud on August 4, 2010 in Pabbi, Pakistan.








25
An aerial view of floodwater covering the land as far as the eye can see, around Taunsa near Multan, Pakistan, Sunday, Aug. 1, 2010.









26
A flood survivor carries a soaked mat in a flooded area of Nowshera on August 3, 2010.









27
A man gathers up some of his belongings outside his flooded house in Nowshera, Pakistan on August 2, 2010.








28
Pakistani women pray at sunset by the Ravi river in Lahore on August 2, 2010.









29
A boy sits on a bed as his family members salvage belongings from their destroyed house in Pabbi, Pakistan on August 5, 2010.










30
Flood victims line up to collect relief supplies from the Army in Nowshera, Pakistan on August 2, 2010. Islamist charities, some with suspected ties to militants, stepped in on Monday to provide aid for Pakistanis hit by the worst flooding in memory, piling pressure on a government criticized for its response to the disaster that has so far killed more than 1,000 people.










31
Flood-affected people jostle for food relief in Nowshera in northwest Pakistan on Friday, Aug. 6, 2010.











32
A Pakistani worker pushes back flood-stricken women who are trying to enter a relief center to get food supplies on the outskirts of Peshawar, Pakistan, Wednesday, Aug. 4, 2010.








33
Families set in for the evening in their makeshift tent homes located on a median strip after having abandoned their flood-destroyed homes, on August 3, 2010 in Pabi, Pakistan.









34
Children, whose families have declined to be rescued, wade in rising flood waters on August 6, 2010 in the village of Panu Akil, near Sukkur, Pakistan. Rescue workers and armed forces continued rescue operations evacuating thousands in Pakistan's heartland province of Sindh.









35
Residents evacuate to safety in a flood-hit area of Nowshera, Pakistan on July 30, 2010.









36
Onlookers perched on a damaged bridge watch a flood survivor use a rope to cross the river in Chakdara in Pakistan's Swat Valley on August 3, 2010.









37
A young flood survivor cools herself with water at a makeshift camp in Nowshera, Pakistan on August 5, 2010.









38
A man tries to cross a makeshift bridge to escape his flooded home in Nowshera, Pakistan on July 31, 2010.









39
A Pakistan army helicopter evacuates stranded villagers in Nowshera, Pakistan on Friday, July 30, 2010.








40
A family takes refuge on top of a mosque while awaiting rescue from flood waters in Sanawa, a town located in the Muzaffar Ghar district of Pakistan's Punjab province on August 5, 2010.










41
A woman yells as her child is evacuated from the roof of a mosque where residents were taking refuge from flood waters in Sanawa, Pakistan on August 5, 2010.







Friday, August 6, 2010

Huge number of oracle processes and oracle is not releasing process

Problem Symptoms
In the database there is huge number of Oracle database processes and within several hours the processes reached the max limit of PROCESSES parameter. No one then can connect to database and therefore it is needed to restart the Server or need to kill the oracle process from operating system.

Recent changes are the,
1)Enable DCD.
2)SQLNET.EXPIRE_TIME is set to 1 or more.

Cause of the Problem
This problem is specific with Oracle Database release 10.2.0.3 and on Windows Platform. It is due to the the DCD (dead connection detection) mechanism. The orphaned processes are not being cleaned up even though DCD is enabled and SQLNET.EXPIRE_TIME is set to 1 or more.

Also the number of processes exceeds too much than the number of sessions.
SQL> select count(*) from v$session;

COUNT(*)
----------
55

SQL> select count(*) from v$process;

COUNT(*)
----------
600
In this case, the orphaned resources are not released if only the client application is terminated. After only the client computer has been rebooted, the DCD releases those resources. For example, a Windows application is killed but Windows machine remains running, the probe packet may be received and discarded as if the connection is still active. As it currently stands, it appears that DCD detects dead client machines, but not dead client processes.

Solution of the Problem
1. Comment the SQLNET.EXPIRE_TIME parameter in your sqlnet.ora file.
2. Reboot the server. Server reboot is funny thing to solve the problem.
3. Set KeepAlive mechanism in Windows 2000/NT.
To do so,
- Start > Run > Regedit.exe
- In the Registry, navigate to:
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters

- Edit - Add value: KeepAliveTime (REG_DWORD)
Decimal -> 180000 (for example = 3 minutes)

- The parameter will not be present the first time you modify the parameter, so you will need to add it. The default value is 2 hours.
4. Watch to see if there are any check if orphaned SHAD processes that exist.

Monday, August 2, 2010

ORA-28056: Writing audit records to Windows Event Log failed

Problem Description
Connecting as sysdba fails with ORA-28056.

$ sqlplus / as sysdba
ORA-28056: Writing audit records to Windows Event Log failed.

Cause of the Problem
The problem happened because Event Viewer log is full and not able to log anymore events.

Solution of the Problem
You need to free an event log.

- Log in as a administrator or a member of the Administrators group in order to free an event log.

- Open Event Viewer. To do so click on Start Menu, click Control Panel, click Performance and Maintenance, click Administrative Tools, and then double-click Event Viewer.

Or, click on Start Menu, click Control Panel, click Administrative Tools, and then double-click Event Viewer.

- Now you can follow any of the following steps.

1) When a log is full, it stops recording new events. Clearing the log is one way to free the log and start recording new events. To do so, on the Action menu (left click)or on the left side Application/System/Security (as available) right click and select Clear All events.

2) You can also free a log and start recording new events by overwriting old events. To overwrite events, on the Action menu, or on the left side Application/System/Security (as available) click Properties, and then click Overwrite events as needed. This ensures that all new events are written to the log, even when the log is full.

3) You can also start logging new events by increasing the maximum log size. To increase the log size, on the Action menu or on the left side Application/System/Security (as available) click Properties, and then increase the Maximum log size by typing a bigger value.

Sunday, August 1, 2010

ORA-12640, ORA-21561: OID generation failed

Problem Description
In the sqlnet.ora file there is an entry SQLNET.AUTHENTICATION_SERVICES=NONE and now whenever you connect to database using RMAN it fails with following error.
ORA-21561: OID generation failed

Whenever you change the sqlnet.ora entry to SQLNET.AUTHENTICATION_SERVICES=NTS, it fails with error ORA-12640: Authentication adapter initialization failed.

Cause of the Problem
The problem happened due to lower value of Windows SharedSection heap size.

Solution of the Problem
1. Click on start menu on your windows machine and then go to Run.

2. Type regedit in the Run box and press Enter.

3. In the Registry Editor window navigate to
\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems\
You will see key name Windows.

4. Right click on windows name and select modify. You should see value data field containing an entry like below.

%SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,3072,512 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=winsrv:ConServerDllInitialization,2 ProfileControl=Off MaxRequestThreads=16

From the field value data the parameter SharedSection's third value (512) is the size of the desktop heap for each desktop that is associated with a "noninteractive" window station.

Increase the desktop heap size that is modify the third value to 1024, so the values are now listed as 1024, 3072, 1024.

After you modify the entry try to connect to database using RMAN and it should resolve the problem.

General Solutions of ORA-12547: TNS: lost contact

In the post Troubleshoot ORA-12547: TNS: lost contact it is already discussed about the specific causes and solutions of ORA-12547: TNS: lost contact. If you don't have those specific scenarios then this post will provide you general solutions for error ORA-12547 which might help you to avoid this error.

1. Verify that environmental variable ORACLE_HOME, ORACLE_SID, PATH, LD_LIBRARY_PATH are correct.

$ echo $ORACLE_HOME
$ echo $ORACLE_SID
$ echo $LD_LIBRARY_PATH
$ echo $PATH


2. On AIX, HP-UX, Linux, MacOSX, Solaris, Tru64 system make sure kernel parameters settings are ok. To set, check and modify your kernel parameters have a look at the post How to check and modify Kernel Parameters in Linux
and Install Oracle on Linux.

3. There may have incorrect permissions on the ORACLE.exe
The 'ls' command should show permissions 6751 (as follows)

$ cd $ORACLE_HOME/bin
$ ls -l oracle


The output should be
-rwsr-s--x 1 oracle dba

If not then please execute the following
$ chmod 6751 oracle

4. Check whether current ulimit settings is ok.
$ ulimit -a

A sample output is,
$ ulimit -a 
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
open files (-n) 256
pipe size (512 bytes, -p) 10
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 29995
virtual memory (kbytes, -v) unlimited
If open files (-n) is set to lower then make it unlimited or set it to a higher value, for example:
$ulimit -n 4096

5. Check the permission on the library files under $ORACLE_HOME/lib and $ORACLE_HOME/lib32 are ok. Since since sqlplus and other binaries require these libraries so if sqlplus does not have permission on these file it may throw ORA-12517: TNS: lost contact. It should have 755 on unix system.

You can give 755 permissions to $ORACLE_HOME/lib and $ORACLE_HOME/lib32
$ chmod -R 755 $ORACLE_HOME/lib
$ chmod -R 755 $ORACLE_HOME/lib32
$ cd $ORACLE_HOME/bin
$ relink all