Showing posts from May, 2012

ORA-01045:user name lacks CREATE SESSION privilege; logon denied

The Solution For this Error Is Simple :

sqlplus / as sysdbagrant create session to "USER-NAME";

Thank you
Osama Mustafa

Clean Concurrent Manager Tables

The Below Script "CMCLEAN.SQL" For Cleaning ConCurrent Manager In Oracle EBS VERSION : -10.7 -11.0 -11.5 -12.1.3
REM cmclean.sql
REM Clean out the concurrent manager tables
REM Usage: sqlplus @cmclean
REM $Id: cmclean.sql,v 1.4 2001/04/07 15:55:07 pferguso Exp $
REM +======================================================================+

set verify off;
set head off;
set timing off
set pagesize 1000

column manager format a20 heading 'Manager short name'
column pid heading 'Process id'
column pscode format a12 heading 'Status code'
column ccode format a12 heading 'Control code'
column request heading 'Request ID'
column pcode format a6 heading 'Phase'
column scode format a6 heading 'Status'



WARNING : Do not run this script without explicit instructions
from Oracle Support

*** Make sure that the managers are…

PRVF-5436 PRVF-9652 Cluster Time Synchronization Services check failed

$GRID_HOME/bin/cluvfy comp clocksync
Cause of the Problem
The problem happened because the time service (such as NTP) is not running or doesn't have slew option set.

Solution of the Problem
The problem happened because time service NTP is not running or doesn't have slew option set.
So, ensure that NTP service is up and running.
Based on the operating system solutions are given below.

1) Linux:

To verify service as root user issue,
# /sbin/service ntpd status
ntpd (pid 4423) is running...

Check process is running or not by.
# ps -ef|grep ntp
ntp 4209 1 0 Mar10 ? 00:00:00 ntpd -u ntp:ntp -p /var/run/ -x

# grep OPTIONS /etc/sysconfig/ntpd
OPTIONS="-u ntp:ntp -p /var/run/ -x"

If NTP service is not started then to start the service issue,
To start the service issue,

# /sbin/service ntpd start

2) Solaris:

To verify the service issue,

# /usr/bin/svcs ntp
online 3:29:11 svc:/network/ntp:default

# ps -ef|grep ntp
root 21223 1 0 Mar 10 ? 0:21 /usr/lib/i…

Article About Data Recovery Method

1-  If you lost all data files
SQL> startup mount; RMAN> restore database; RMAN> recover database; SQL> alter database open;2- If you lost a tablespace

SQL> alter tablespace users offline; RMAN> restore tablespace users; RMAN> recover tablespace users; SQL> alter tablespace users online; if you can not offline tablespace;

$ sqlplus “/ as sysdba” SQL> shutdown abort; SQL> startup mount; $ rman target / catalog_user/catalog_user_password@catalogdb RMAN> restore tablespace users; RMAN> recover tablespace users; SQL> alter database open;
3- if you lost a datafile

SQL> alter database datafile '/oracle/oradata/users.dbf' offline; RMAN> restore datafile '/oracle/oradata/users.dbf' RMAN> recover datafile '/oracle/oradata/users.dbf' SQL> alter database datafile '/oracle/oradata/users.dbf' online;if you cannot offline datafile;

$ sqlplus “/ as sysdba” SQL> shutdown abort; SQL> startup mount; $ rman target / catal…

ORA-01110 When trying to Open Database

ERROR at line 1:
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 5: ' /u01/test/users02.dbf'

This Error Maybe Appear On Different Database Files Because DBF Not Exists .

1-Restore From Rman if its Not Found .


SQL> select file#,name, status from v$datafile where file#=5;
———- ————————————————- ———–
5 /u01/test/users02.dbf ONLINE

SQL> alter database datafile ‘/u01/test/users02.dbf’ offline drop;
Database altered.

SQL> alter database open;
Database altered.
Thank you
Osama Mustafa

Using FAN callouts (relocate a service back)

In Oracle 10g RAC, every time a node/instance/service goes up/down, that event can be trapped and used to make user defined callouts. So every time a state change occurs, a FAN event is posted to ONS immediately. When a node receives an event through ONS, it will asynchronously execute all executables in the server side callouts directory.

There could be lot of applications to using this feature of callouts. For example, when an instance goes down, we all know that services running on that instance are relocated to other available instances. But when that instance comes back up, those relocated services need to be manually put back to their preferred instance. By using FAN callouts, we can automate this task.

1. Go to $ORA_CRS_HOME/racg and create usrco directory on all the nodes. So the server side callout directory would look something like this:

2. Place your callout scripts under this dir. This will be called on every state change. You could use any …

CRS-4640 Error on Starting 11gR2 clusterware

ERROR : [root@RAC01 cssd]# /oragrid/product/11.2/bin/crsctl check crs CRS-4638: Oracle High Availability Services is online CRS-4535: Cannot communicate with Cluster Ready Services CRS-4530: Communications failure contacting Cluster Synchronization Services daemon CRS-4534: Cannot communicate with Event ManagerWhen Trying To start Oracle Cluster with following Command :[root@RAC01 cssd]# /oragrid/product/11.2/bin/crsctl start crs CRS-4640: Oracle High Availability Services is already active CRS-4000: Command Start failed, or completed with errors. When Trying To Stop Oracle Cluster With Following Command : crsctl stop crs command failed

[root@RAC01 cssd]# /oragrid/product/11.2/bin/crsctl stop crs CRS-2796: The command may not proceed when Cluster Ready Services is not running CRS-4687: Shutdown command has completed with errors. CRS-4000: Command Stop failed, or completed with errors.
Solution is Simple :Just Run [root@RAC01 cssd]# /oragrid/product/11.2/bin/crsctl start cluster

Repair Database Corrpution Using 11g New Tools

As Database Administrator you Face Some Issue About The Database Corruption  But In 11g You have Some New Tool Called "data recovery advisor" .

With DRA you check the block corruptions and loss of data files and control files. The GUI feature also available from Enterprise manager.

Lets Start Using This Tool :

Starting backup at 01-FEB-12

21 FAILED 0 169474 2048000 1046708826
File Name: /dbs1/orcl/system01.dbf
Block Type Blocks Failing Blocks Processed  To Use This Tool Follow The Below Step :

RMAN> LIST FAILURE List of Database Failures
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
1041 HIGH OPEN 01-FEB-12 Datafile 21: '/dbs1/orcl/system.dbf ' contains one or more corrupt blocks

RMAN> ADVISE FAILURE; List of Database Failures
Failure ID Priority Status Time Detected Summary

Change to Archive Log Mode In Oracle Rac

1. Disable clustering putting cluster_database parameter FALSE.
$sqlplus "/ as sysdba"
Check the status of archive mode of the database:

SQL>archive log list
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     407
Current log sequence           408

SQL> alter system set cluster_database=false scope=spfile sid='ORCL1';
2. Shutdown all instances using srvctl utilty
$ srvctl stop database -d cobra
3. Mount tha database using one of the instance:
$ sqlplus "/ as sysdba"

SQL> startup mount
4. Enable archivelog using following command:
SQL> alter database archivelog;

5. Re-enable clustering putting instance parameter cluster_database to TRUE from the current instance:

SQL> alter system set cluster_database=true scope=spfile sid='ORCL1';

6. Shutdown the local instance:

SQL> shutdown immediate

7. Sta…

Steps To Clone Oracle EBS R12

There's Two major Parts In This Topics :
1- Pre Clone Steps .
2 - Post Clone Steps.


1- Pre Clone Steps : 

On Application Tier : 
1-    Execute Apps environment file
3-    ./
4-    Perl appsTier

Database Tier : 

1-    Execute Database environment ( under ORACLE_HOME)
2-    cd $ORACLE_HOME/appsutil/scripts/(CONTEXT_NAME)
3-    ./
4-    perl dbTier

shutdown application and database Copy your virtual nodes on new servers .

Post clone Steps:

Database Server

1-    cd $ORACLE_HOME/appsutil/clone/bin
2-    perl dbTier

Application Server:

1-    cd $COMMON_TOP/clone/bin
2-    perl appsTier


Thank you
Osama mustafa

ORA-00020: maximum number of processes (%s) exceeded

SQL> show parameter processes NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ processes integer 150 SQL> select count(*) from v$process; COUNT(*) ---------- 149 SQL> alter system set processes=300 scope=spfile; System altered. SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> startup ORACLE instance started. SQL> show parameter processes NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ processes integer 300

Thank you
Osama mustafa

ORA-16038 ORA-19504

Archiver Hung in Oracle database 

Summary 1. check how much space is used by archiver 2. check the last good backup of the database 3. delete archive log files older than last good backup 4. crosscheck archive log 1. check how much space is used by archiver   Sql>  select count(*),sum(blocks*block_size) from v$archived_log where    backup_count=0 and      deleted='NO';
   Sql> select * from v$flash_recovery_area_usage; 2. check the last good backup of the database   set pages 999 lines 120
   col STATUS format a9    col hrs format 999.99    col start_time format a15    col end_time format a15    col dev format a5    col inbytes format a10    col outbytes format a10    select        INPUT_TYPE, STATUS,        to_char(START_TIME,'mm/dd/yy hh24:mi') start_time,        to_char(END_TIME,'mm/dd/yy hh24:mi')   end_time,        elapsed_seconds/3600                   hrs,        output_device_type dev,        input_bytes_display inbytes,        output_bytes_disp…

ORA-19566: exceeded limit of 0 corrupt blocks for file

I already Talk about this Error but this Topics Share Another Solution For it :

RMAN> backup database; RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03009: failure of backup command on ORA_DISK_1 channel at 12/22/2011 11:45:40 ORA-19566: exceeded limit of 0 corrupt blocks for file /oracle/oradata/orcl/system01.dbf

SQL> select * from V$DATABASE_BLOCK_CORRUPTION; FILE# BLOCK# BLOCKS CORRUPTION_CHANGE# CORRUPTIO ---------- ---------- ---------- ------------------ --------- 5 2684 1 0 CHECKSUM
RMAN> blockrecover datafile 5 block 2684;

Thank you
Osama mustafa

ORA-06512: at "SYS.DBMS_SNAPSHOT_UTL", line 960

This Error Appear when you try to createMATERIALIZED VIEW On remote View 

First you have to know it
Bug 5583712  ORA-942 on create materialized view on remote view

Product (Component)Oracle Server (Rdbms)Range of versions believed to be affectedVersions < 11 Versions confirmed as being affected10.2.0.3Platforms affectedGeneric (all / most platforms affected
You can check Metalink Doc : 5583712.8 

But I would Share this solution All you Have to do is follow the below steps :

  AS SELECT * FROM vw_RHC@remotedb;

ORA-00942: TABLEORVIEW does NOT exist
ORA-06512: AT "SYS.DBMS_SNAPSHOT_UTL", line 960
ORA-06512: AT line 1

The Solution is :
  AS   AS SELECT * FROM (SELECT * FROM vw_employees@remotedb);

Materialized VIEW …

OAS process type = OC4J:Home unable to start

After Trying All The Solutions , Metalink note nothing Works But Never Give up I provide Solution For The
below Error :

--> Process (pid=8337)
time out while waiting for a managed process to start

Note : Try This Solution After Have been Increase timeout On Opmn.xml

Solution :

1- Create New OC4J instance By

createinstance -instanceName OC4J_instanceName
Enter Password That you want .

2- Check /etc/hosts On you server, Its must Contain localhost.localdomain localhost 3-group must be change from default_group to your new Group (that you Create it in Step 1 ) .

cd $ORACLE_HOME/opmn/conf/
vi opmn.xml

Search For Default_group (its Default Group in Installation) and Change it to New One
For Example :

You New OC4J_instance_name : test
Default group Should be : test_group
 Search For Default_group and Change it with test_group. 
4-aftre the above steps :

opmnctl stopall
opmnctl startall

Thank you

ORA-01034: ORACLE not available When Create DBCONSOLE

ORA-01034: ORACLE not available When Create DBCONSOLE / DBCONTROL

If you are using the following Command :

    $ emca -deconfig dbcontrol db -repos drop

    $ emca -config dbcontrol db -repos create

Try Use

emca -config dbcontrol db -repos recreate -ORACLE_HOSTNAME "Hostname"

It Should be Work

Thank you
Osama mustafa

ORA-19566 exceeded limit of %s corrupt blocks for file %s

Cause: The user specified limit of allowable corrupt blocks was exceeded while reading the specified datafile for a datafile copy or backup. Action: None. The copy or backup operation fails. The session trace file contains detailed information about which blocks were corrupt.But The Below is Work around : 1)Run DBVerify utility. Have a look at Verify Physical Data Structure For example,$ dbv file=/oradata2/data1/dbase1/system01.dbf Also run this operation for against the all datafiles you suspect which has corrupt block. 2)While taking backup within RUN block specify SET MAXCORRUPT in order to say how many corruption it can handle. I ran dbverify utility and I saw 1 block corrupt each in SYSTEM(1) and SYSAUX(3) datafile. 3)Now backup database with SET MAXCORRUPT option.Syntax : SET MAXCORRUPT FOR DATAFILE File_id For DatabaseFiles to ;SET MAXCORRUPT FOR DATAFILE to ;RMAN> RUN{ 2> SET MAXCORRUPT FOR DATAFILE 1,3 to 1; 3> BACKUP DATABASE; 4> } For data…

Check RMAN Backup Status

The Below Scripts To Check Backup Status Via Sqlplus , Maybe you will find Same Or Another Scripts In the Same way : 

Sqlplus / as sysdba
This script will report on all backups – full, incremental and archivelog backups -

col STATUS format a9 col hrs format 999.99 select SESSION_KEY, INPUT_TYPE, STATUS, to_char(START_TIME,'mm/dd/yy hh24:mi') start_time, to_char(END_TIME,'mm/dd/yy hh24:mi') end_time, elapsed_seconds/3600 hrs from V$RMAN_BACKUP_JOB_DETAILS order by session_key;This script will report all on full and incremental backups, not archivelog backups -

col STATUS format a9 col hrs format 999.99 select SESSION_KEY, INPUT_TYPE, STATUS, to_char(START_TIME,'mm/dd/yy hh24:mi') start_time, to_char(END_TIME,'mm/dd/yy hh24:mi') end_time, elapsed_seconds/3600 hrs from V$RMAN_BACKUP_JOB_DETAILS where input_type='DB INCR' order by session_key;

I would Love to Thank gavin soorma - OCM For His Amazing Effort . Sh…

Working with RMAN Stored Scripts

Creating Stored Scripts: CREATE SCRIPTMake sure RMAN is connected to the right target database and the recovery catalog. Then run the CREATESCRIPT command, as shown in this example:
CREATE SCRIPT full_backup { BACKUP DATABASE PLUS ARCHIVELOG; DELETE OBSOLETE; }  you can also provide a COMMENT with descriptive information:CREATE GLOBAL SCRIPT global_full_backup COMMENT 'use only with ARCHIVELOG mode databases' { BACKUP DATABASE PLUS ARCHIVELOG; DELETE OBSOLETE; }
Running Stored Scripts: EXECUTE SCRIPTRUN { EXECUTE SCRIPT full_backup; }
Displaying a Stored Script: PRINT SCRIPTPRINT SCRIPT full_backup;PRINT SCRIPT full_backup TO FILE 'my_backup.txt';
DELETE SCRIPT 'full_backup';DELETE GLOBAL SCRIPT 'global_full_backu…

DBCONSOLE For Real Application Cluster

Drop DBCONSOLE FOR RAC (Uninstall) : 

we will user the following command :
emca -deconfig dbcontrol db -repos drop -cluster
Make sure you have the below information :

Database unique nameListener port numberPassword for SYS userPassword for SYSMAN user
Create DBCONSOLE FOR RAC ( Install) : 

In this case you have more than one choice you can use what you want depend on your requirements :

emca -config dbcontrol db -repos create -cluster

 emca -reconfig dbcontrol –cluster –EM_NODE node1 -EM_NODE_LIST node2,node3,node4
emca -reconfig dbcontrol –cluster –EM_NODE node5 -EM_NODE_LIST node6,node7,node8
 The below Information for installing DBCONSOLE :

The Database unique nameThe Listener port numberThe Cluster nameThe Password for SYS userThe Password for DBSNMP userThe Password for SYSMAN userThe Email address for notifications (optional)The Outgoing Mail (SMTP) server for notifications (optional)The ASM ORACLE_HOME e.g. /u01/app/asm/product/10.2.0The ASM port e.g. 1521The ASM user role …

FRM-92100 : your connection to the server was interrupted


NLS_LANG has been set to an invalid value in the environment of the user starting Oracle Forms Services.


Set NLS_LANG to a valid value like AMERICAN_AMERICA.AR8MSWIN1256 in the default.env file or any custom environment file which is being used.

You can go to regedit and also set the NLS_LANG value to the one mentioned above and check if this resolves the issue. 

 If the Above Solution Doesn't Work For you Try The Below One :

1) FRM-92100 occurs when invoking a new forms session from existing form session, or another URL is invoked from the parent browser window of the forms applet?

To work-around use the applet parameter separateFrame="True". This parameter is set in the static html file or formsweb.cfg

2) If using Oracle Jinitiator, try clearing the Jinitiator JAR or jcache:

For versions 1.3.x.x.x : Control Panel - Jinitiator Control Panel - Cache Tab Page - Clear JAR Cache button

3) If using MS Internet Explorer check that permissions / security …

All About Oracle WorkFlow Mailer

In this Topic We will discuss the Workflow mailer In Oracle Apps ad how to check it Let Start :

Workflow: version

check workflow status.

set linesize 120
set pagesize 50
column COMPONENT_NAME format a45
column STARTUP_MODE format a15
column COMPONENT_STATUS format a15
select fsc.COMPONENT_NAME,fsc.STARTUP_MODE,fsc.COMPONENT_STATUS,fcq.last_update_date
from APPS.FND_CONCURRENT_QUEUES_VL fcq, fnd_svc_components fsc
where fsc.concurrent_queue_id = fcq.concurrent_queue_id(+)

check if workflow is used by only one instance
col value format a20 select p.parameter_id, p.parameter_name, v.parameter_value value from apps.fnd_svc_comp_param_vals_v v, apps.fnd_svc_comp_params_b p, apps.fnd_svc_components c where c.component_type = 'WF_MAILER' and v.component_id = c.component_id and v.parameter_id = p.parameter_id and p.parameter_name in ( 'INBOUND_SERVER','ACCOUNT', 'REPLYTO') order …


As We All Know if you need to start/shutdown Oracle Apps you need go $ADMIN_SCRIPT_HOME In R12 Or $CONTEXT_HOME in R11

This Article Explain What These Scripts Do : Master script to start all components/services of middle tier or application tier. This script will use Service Control API to start all services which are enabled after checking them in context file (SID_HOSTNAME.xml or CONTEXT_NAME.xml) Master script to stop all components/services of middle tier or application tier Script to start / stop apps listener (FNDFS and FNDFS). This listener will file will be in 10.1.2 ORACLE_HOME (i.e. Forms & Reports Home)
listener.ora file will be in $INST_TOP/apps/$CONTEXT_NAME/ora/10.1.2/network/admin directory
(Mostly similar to one in 11i with only change in ORACLE_HOME i.e. from 8.0.6 to 10.1.2) Script to start/stop Web Server or Oracle HTTP Server. This script uses opmn (Oracle Process Manager and Notification Server) with syntax simila…

check Oracle Apps/EBS version

This is Simple Script To Check Version For Oracle APP/EBS For Any Version :

select RELEASE_NAME from fnd_product_groups;
output  :


Thank you
Osama mustafa

Useful Query To check Some Privileges

Check for whether user has full database export/import privilege 

Query : 

SQL>SET lines 100 COL privilege FOR a50 SELECT grantee, granted_role, default_role FROM dba_role_privs WHERE granted_role IN ('DBA', 'EXP_FULL_DATABASE', 'IMP_FULL_DATABASE') ORDER BY 1,2;
Check for user has create table or create session privilege.


SQL>SET lines 100 pages 100 COL privilege FOR a40 SELECT grantee, privilege FROM dba_sys_privs WHERE (grantee IN ('TEST', 'PUBLIC') OR grantee IN (SELECT granted_role FROM dba_role_privs WHERE grantee IN ('TEST', 'PUBLIC'))) AND privilege IN ('CREATE SESSION', 'CREATE TABLE') ORDER BY 1,2;
Check for granted privileges on directory objects.

Query :

SET lines 110 COL privilege FOR a12 COL grantee FOR a25 COL owner FOR a25 SELECT p.grantee, p.privilege, p.owner, d.directory_name FROM dba_tab_privs p, dba_directories d WHERE p.table_name…

RW-50015 : Installation Error On Oracle EBS R12

RW-50015: Error: - HTTP Listener is not responding. The service might not have started on the port yet. Please check the service and use the retry button.

the Rapid Install window will show many errors for HTTP.

Checking status of OPMN managed Oracle HTTP Server (OHS) instance ...

Processes in Instance:
ias-component | process-type | pid | status
OC4J | oafm | 21168 | Alive
OC4J | forms | 21078 | Alive
OC4J | oacore | 20943 | Alive
HTTP_Server | HTTP_Server | N/A | Down
Download and apply the patch 6078836 from OracleMetaLink to fix an issue with the Oracle HTTP Server bundled with the E-Business Suite technology stack. We unzip the patch:

[oracle@ebs oracle]$ unzip
Archive: p60788…