ORACLE Query,Resource Trace
Hi,
I worked on SQL Server,what's the Oracle equivalent to SQL Server Profiler.How to Trace Queries in Oracle.
Regards
Sri
ALTER SESSION SET SQL_TRACE=TRUE;
-- invoke the SQL code
ALTER SESSION SET SQL_TRACE=FALSE;
now find the trace file within ./udump folder
tkprof <trace_file.trc> trace_results.txt explain=<username>/<password>
the contents of trace_results.txt contains the results
Similar Messages
-
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
Report Builder 10.1.2.0.2
ORACLE Server Release 10.1.0.4.2
Oracle Procedure Builder 10.1.2.0.2
Oracle ORACLE PL/SQL V10.1.0.4.2 - Production
Oracle CORE 10.1.0.4.0 Production
Oracle Tools Integration Services 10.1.2.0.2
Oracle Tools Common Area 10.1.2.0.2
Oracle Toolkit 2 for Windows 32-bit platforms 10.1.2.0.2
Resource Object Store 10.1.2.0.2
Oracle Help 10.1.2.0.2
Oracle Sqlmgr 10.1.2.0.2
Oracle Query Builder 10.1.2.0.2 - Production
PL/SQL Editor (c) WinMain Software (www.winmain.com), v1.0 (Production)
Oracle ZRC 10.1.2.0.2
Oracle XML Developers Kit 10.1.0.4.2 - Production
Oracle Virtual Graphics System 10.1.2.0.2
Oracle Image 10.1.2.0.2
Oracle Multimedia Widget 10.1.2.0.2
Oracle Tools GUI Utilities 10.1.2.0.2
I have enclosed sample data and also table structure. I need help in getting the query.
select dept_id,proc_code,override_goal,goal_override_date
from table2
where goal_override_date between '02-jan-2014' and '11-jan-2014'
and dept_id = 10
and proc_code = 'CP'
select DEPT_ID, PROC_CODE, DAY_SUNDAY, DAY_MONDAY,
DAY_TUESDAY, DAY_WEDNESDAY, DAY_THURSDAY,
DAY_FRIDAY, DAY_SATURDAY
from table1
where dept_id =10
and proc_code = 'CP';
Table1 is kind of maintenance table.
In Table2 values can be overridden.
Requirement
Check to see if there is data in table 2 for the date range . If table2 has no value then take value from table1 for that day the date falls into. Any more clarification please ask me.
Sundays are all zeros.
I want this data. and the sum for the date range.
2-jan-2014 - 3
3-jan-2014 - 3
4-jan-2014 - 3
5-jan-2014 - 0
6-jan-2014 - 1
7-jan-2014 - 3
8-jan-2014 - 5
9-jan-2014 - 5
10-jan-2014 - 3
11-jan-2014 - 3
Sum for the date range has to be 29
Sample table and data
CREATE TABLE TABLE1
DEPT_ID NUMBER NOT NULL,
PROC_CODE VARCHAR2(2 BYTE) NOT NULL,
DAY_SUNDAY NUMBER(4) NOT NULL,
DAY_MONDAY NUMBER(4) NOT NULL,
DAY_TUESDAY NUMBER(4) NOT NULL,
DAY_WEDNESDAY NUMBER(4) NOT NULL,
DAY_THURSDAY NUMBER(4) NOT NULL,
DAY_FRIDAY NUMBER(4) NOT NULL,
DAY_SATURDAY NUMBER(4) NOT NULL
Insert into TABLE1
(DEPT_ID, PROC_CODE, DAY_SUNDAY, DAY_MONDAY, DAY_TUESDAY,
DAY_WEDNESDAY, DAY_THURSDAY, DAY_FRIDAY, DAY_SATURDAY)
Values
(10, 'CP', 0, 3, 3,
3, 3, 3, 3);
COMMIT;
CREATE TABLE TABLE2
DEPT_ID NUMBER NOT NULL,
PROC_CODE VARCHAR2(2 BYTE) NOT NULL,
OVERRIDE_GOAL NUMBER(4),
GOAL_OVERRIDE_DATE DATE NOT NULL
Insert into TABLE2
(DEPT_ID, PROC_CODE, OVERRIDE_GOAL, GOAL_OVERRIDE_DATE)
Values
(10, 'CP', 1, TO_DATE('01/06/2014 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into TABLE2
(DEPT_ID, PROC_CODE, OVERRIDE_GOAL, GOAL_OVERRIDE_DATE)
Values
(10, 'CP', 3, TO_DATE('01/07/2014 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into TABLE2
(DEPT_ID, PROC_CODE, OVERRIDE_GOAL, GOAL_OVERRIDE_DATE)
Values
(10, 'CP', 5, TO_DATE('01/08/2014 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into TABLE2
(DEPT_ID, PROC_CODE, OVERRIDE_GOAL, GOAL_OVERRIDE_DATE)
Values
(10, 'CP', 5, TO_DATE('01/09/2014 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into TABLE2
(DEPT_ID, PROC_CODE, OVERRIDE_GOAL, GOAL_OVERRIDE_DATE)
Values
(10, 'CP', 3, TO_DATE('01/10/2014 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into TABLE2
(DEPT_ID, PROC_CODE, OVERRIDE_GOAL, GOAL_OVERRIDE_DATE)
Values
(10, 'CP', 3, TO_DATE('01/11/2014 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
COMMIT;
Help is highly appreciated.SELECT dates,
override_goal,
SUM(override_goal) OVER()
FROM(SELECT dates,
CASE WHEN EXISTS(SELECT 1
FROM table2 t2
WHERE t2.goal_override_date = qry1.dates
AND t2.dept_id = 10
AND t2.proc_code = 'CP')
THEN (SELECT override_goal
FROM table2 t2
WHERE t2.goal_override_date = qry1.dates
AND t2.dept_id = 10
AND t2.proc_code = 'CP')
ELSE (SELECT DECODE(days,'SUN',day_sunday,
'MON',day_monday,
'TUE',day_tuesday,
'WED',day_wednesday,
'THU',day_thursday,
'FRI',day_friday,
'SAT',day_saturday )
FROM table1)
END as override_goal
FROM (SELECT in_dt1+(LEVEL-1) dates,
TO_CHAR(in_dt1+(LEVEL-1),'DY') days
FROM(SELECT TO_DATE(&from_date,'DD-MON-YYYY') in_dt1,
TO_DATE(&to_date,'DD-MON-YYYY') in_dt2
FROM dual)
CONNECT BY LEVEL <= (in_dt2 - in_dt1)+1) qry1);
Now run the query it will prompt you for the inputs. You can pass the date values and check the result. Otherwise replace &from_date,&to_date with user inputs -
Adding the Oracle Database Resource to the Fail Safe Group
Hi,
I am installtin MSCS cluster for my EP system. After Adding the Oracle Database Resource to the Fail Safe Group my CI jcontrol.exe has been stopped. I tried to connect my SAPSR3DB user by sqlplus but it is giving follwoing error.
SQL> conn SAPEPPDB
Enter password:
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
Warning: You are no longer connected to ORACLE.
but DB startup is running properly and DB is coming in open state properly. After that I have perform R3trans -d. following error
C:\>R3trans -d
This is R3trans version 6.14 (release 700 - 12.06.09 - 15:20:00).
unicode enabled version
2EETW169 no connect possible: "DBMS = ORACLE --- dbs_o
ra_tnsname = 'EPP'"
R3trans finished (0012).
I added Oracle database resource to fail safe group as per installation guide.
Please help me out.
Regards,
Dinesh BhattC:\>lsnrctl status
LSNRCTL for 64-bit Windows: Version 10.2.0.2.0 - Production on 11-APR-2010 20:39
:38
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (ADDRESS=(COMMUNITY=SAP.WORLD)(PROTOCOL=TCP)(HOST=192.1.20.7)(PORT
=1527))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for 64-bit Windows: Version 10.2.0.2.0 - Produ
ction
Start Date 11-APR-2010 20:39:23
Uptime 0 days 0 hr. 0 min. 14 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File F:\oracle\EPP\102\network\admin\listener.ora
Listener Log File F:\oracle\EPP\102\network\log\listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.1.20.7)(PORT=1527)))
The listener supports no services
The command completed successfully
listener start but without any instance.
listerer.ora file
This file is written by Oracle Services For MSCS
on Sun Apr 11 10:53:11 2010
LISTENER =
(ADDRESS_LIST=
(ADDRESS=
(COMMUNITY=SAP.WORLD)
(PROTOCOL=TCP)
(HOST=192.1.20.7)
(PORT=1527)
STARTUP_WAIT_TIME_LISTENER = 0
CONNECT_TIMEOUT_LISTENER = 10
TRACE_LEVEL_LISTENER = OFF
ADMIN_RESTRICTIONS_LISTENER = on
Fsloracleepp =
(ADDRESS_LIST=
(ADDRESS=
(PROTOCOL=IPC)
(KEY=EPP)
(ADDRESS=
(PROTOCOL=IPC)
(KEY=EPP.WORLD)
(ADDRESS=
(COMMUNITY=SAP.WORLD)
(PROTOCOL=TCP)
(Host=192.1.20.43)
(Port=1527)
SID_LIST_Fsloracleepp =
(SID_LIST=
(SID_DESC=
(SID_NAME=EPP)
(ORACLE_HOME=F:\oracle\EPP\102)
STARTUP_WAIT_TIME_Fsloracleepp = 0
ADMIN_RESTRICTIONS_Fsloracleepp = on
TRACE_LEVEL_Fsloracleepp = OFF
CONNECT_TIMEOUT_Fsloracleepp = 10
dbms_sid added
please help.
Dinesh Bhatt -
Query to trace who updated the data
query to trace who updated the data
date
and time
and usernameahh, ok - there's a few articles around that will assist.
I suggest first
you experiment with triggers to familiarise yourself with them:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/triggers.htm#CNCPT118
this article here explains the process of putting in some audit processes using triggers:
http://www.oracle-base.com/articles/9i/CompleteDataAudit.php
it details creating the tables etc and then provides a procedure that will create the trigger text for you for each table you want to audit. it would be good to write your own trigger from scrath in order to learn and understand exactly what's happening, but it's up to you.
let us know if you encounter any problems and we can help your specific problem -
Error initializing the Oracle JMS Resource provider for Topics
Getting this error when starting OC4J 9.0.3 standlone on Windows2000.
Resource provider config'd as
<resource-provider class="oracle.jms.OjmsContext" name="ojms">
<description> OJMS/AQ </description>
<property name="datasource" value="jdbc/ProlianceDS"></property>
</resource-provider>
Datasource config'd as
<data-source
class="com.evermind.sql.OrionCMTDataSource"
name="ProlianceDS"
location="jdbc/ProlianceDS"
xa-location="jdbc/xa/ProlianceDS"
ejb-location="jdbc/ProlianceDS"
connection-driver="oracle.jdbc.driver.OracleDriver"
username="proliance"
password="******"
url="jdbc:oracle:thin:@aps67.ere.com:1538:ifstst"
inactivity-timeout="30"
/>
ejb-jar config'd as
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<enterprise-beans>
<message-driven>
<description>Proliance Message Driven Bean</description>
<display-name>ProlianceMDB</display-name>
<ejb-name>ProlianceMDB</ejb-name>
<ejb-class>com.lendlease.bll.ProlianceMDB</ejb-class>
<transaction-type>Container</transaction-type>
<message-selector>
<method>
<ejb-name>ProlianceMDB</ejb-name>
<method-name>onMessage</method-name>
</method>
</message-selector>
<message-driven-destination>
<destination-type>javax.jms.Topic</destination-type>
<subscription-durability>Durable</subscription-durability>
</message-driven-destination>
<resource-ref>
<res-ref-name>java:comp/resource/ojms/Topics/PROLIANCE.OUT_AQ</res-ref-name>
<res-type>javax.jms.Topic</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>java:comp/resource/ojms/TopicConnectionFactories/aqTcf</resource-env-ref-name>
<resource-env-ref-type>javax.jms.TopicConnectionFactory</resource-env-ref-type>
</resource-env-ref>
</message-driven>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>ProlianceMDB</ejb-name>
<method-name>onMessage</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
orion-ejb-jar config'd as:
<?xml version = '1.0'?>
<!DOCTYPE orion-ejb-jar PUBLIC "-//Evermind//DTD Enterprise JavaBeans 1.1 runtime//EN" "http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd">
<orion-ejb-jar deployment-time="e7f1ce76f6" deployment-version="1.0.2.2">
<enterprise-beans>
<message-driven-deployment
name="ProlianceMDB"
connection-factory-location="java:comp/resource/ojms/TopicConnectionFactories/aqTcf"
destination-location="java:comp/resource/ojms/Topics/PROLIANCE.OUT_AQ"
subscription-name="PROLIANCE_SUBSCRIBER">
</message-driven-deployment>
</enterprise-beans>
</orion-ejb-jar>
Full startup trace is:
C:\ora\oc4j_9.0.3\j2ee\home>java -Djdbc.connection.debug=true -jar oc4j.jar
Node started with id=-2143203582
Auto-unpacking C:\ora\oc4j_9.0.3\j2ee\home\applications\ProlianceMDB.ear... done.
Auto-unpacking C:\ora\oc4j_9.0.3\j2ee\home\applications\ProlianceMDB\ProlianceMDB.war... done.
Auto-deploying ProlianceMDB (New server version detected)...
Copying default deployment descriptor from archive at C:\ora\oc4j_9.0.3\j2ee\home\applications\ProlianceMDB/ProlianceMDB
.jar/META-INF/orion-ejb-jar.xml to deployment directory C:\ora\oc4j_9.0.3\j2ee\home\application-deployments\ProlianceMDB
\ProlianceMDB.jar...
Auto-deploying ProlianceMDB.jar (New server version detected)... done.
Error initializing the Oracle JMS Resource provider for Topics: Not an OracleConnection
Error deploying file:/C:/ora/oc4j_9.0.3/j2ee/home/applications/ProlianceMDB/ProlianceMDB.jar homes: No javax.jms.Destina
tion found at the specified destination-location (java:comp/resource/ojms/Topics/PROLIANCE.OUT_AQ) for MessageDrivenBean
ProlianceMDB
OrionCMTConnection not closed, check your code!
Logical connection not closed, check your code!
Created at:
java.lang.Throwable: OrionCMTConnection created
at com.evermind.sql.OrionCMTConnection.<init>(OrionCMTConnection.java:42)
at com.evermind.sql.OrionCMTDataSource.getConnection(OrionCMTDataSource.java:82)
at oracle.jms.AQjmsConnection.newDBConnection(AQjmsConnection.java:1681)
at oracle.jms.AQjmsConnection.<init>(AQjmsConnection.java:537)
at oracle.jms.AQjmsTopicConnectionFactory.createTopicConnection(AQjmsTopicConnectionFactory.java:232)
at oracle.jms.OjmsResource.initT(OjmsResource.java:512)
at oracle.jms.OjmsResource.initAQ(OjmsResource.java:411)
at oracle.jms.OjmsResource.init(OjmsResource.java:214)
at oracle.jms.OjmsContextFactory.getObjectInstance(OjmsContextFactory.java:103)
at oracle.jms.OjmsContext.getResource(OjmsContext.java:328)
at com.evermind.server.Application.lookupResource(Application.java:2548)
at com.evermind.server.Application.lookupResource(Application.java:2563)
at com.evermind.server.ApplicationContext.handleResourceLookup(ApplicationContext.java:639)
at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:162)
at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:66)
at com.evermind.server.ejb.MessageDrivenHome.<init>(MessageDrivenHome.java:236)
at com.evermind.server.ejb.EJBPackageDeployment.bindHomes(EJBPackageDeployment.java:304)
at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:595)
at com.evermind.server.Application.postInit(Application.java:431)
at com.evermind.server.Application.setConfig(Application.java:136)
at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1635)
at com.evermind.server.ApplicationServer.initializeApplications(ApplicationServer.java:1585)
at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1240)
at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:93)
at java.lang.Thread.run(Thread.java:484)
Auto-deploying ProlianceMDB Poster (New server version detected)...
Oracle9iAS (9.0.3.0.0) Containers for J2EE initialized
Using native aqapi.jar with OC4J -didn't copy from 9.2.0.2 DB. 9.2.0.2 patchset ran fully, completed fine. What's going wrong?
BrianShouldn't I be getting a com.evermind.sql.OrclCMTConnection created instead of a com.evermind.sql.OrionCMTConnection (per the stack trace)? OJMS is complaining that it doesn't have an OracleCOnnection but how do I tell it to use the "OrclCMTConnection" class instead?
Brian -
Query on using Variables in Oracle Query
Hi
i am new to Oracle, i have tried extracting data from the Oracle Database using the following Query which includes 1 variable SYSDATE_UTS, however when i try to execute the Query i get an error. Please let me know what am i doing wrong and how can i correct it.
Error Message
ORA-06550: line 4, column 1:
PLS-00428: an INTO clause is expected in this SELECT statement
Oracle Query
DECLARE SYSDATE_UTS NUMBER := (sysdate-to_date('19700101','yyyymmdd'))*86400;
BEGIN
SELECT
INCIDENT_NUMBER,
to_date(to_char((1/86400*REPORTED_DATE)+to_date('19700101','yyyymmdd'),'mm/dd/yyyy hh24:mi:ss'),'mm/dd/yyyy hh24:mi:ss') as REPORTED_DATE_TIME,
,GROUP_TRANSFERS
,LAST_MODIFIED_BY
,to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * LAST_MODIFIED_DATE,'mm/dd/yyyy hh24:mi:ss'),'mm/dd/yyyy hh24:mi:ss') as LAST_MODIFIED_DATE
,(to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) as AGE
,CASE
WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 0 AND 1 THEN '0-1 Days'
WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS, 'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 2 AND 4 THEN '2-4 Days'
WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 5 AND 9 THEN '5-9 Days'
WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 10 AND 19 THEN '10-19 Days'
WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) >20 THEN '20+ Days'
ELSE 'UNKNOWN'
END AS AGE_GROUP
FROM IncidentDataBase
and STATUS not in (4,5,6)
and rownum <10;
END;Hi Frank
i am using the following Oracle Version
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
PL/SQL Release 10.2.0.5.0 - Production
CORE 10.2.0.5.0 Production
TNS for Linux: Version 10.2.0.5.0 - Production
NLSRTL Version 10.2.0.5.0 - Production
and Quest Toad for Oracle to write and execute the queries:
Toad for Oracle Xpert
Version 10.1.1.8
The code i am using is:
variable SYSDATE_UTS NUMBER;
exec SYSDATE_UTS := (sysdate-to_date('19700101','yyyymmdd'))*86400;
SELECT
INCIDENT_NUMBER,
to_date(to_char((1/86400*REPORTED_DATE)+to_date('19700101','yyyymmdd'),'mm/dd/yyyy hh24:mi:ss'),'mm/dd/yyyy hh24:mi:ss') as REPORTED_DATE_TIME
,GROUP_TRANSFERS
,LAST_MODIFIED_BY
,to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * LAST_MODIFIED_DATE,'mm/dd/yyyy hh24:mi:ss'),'mm/dd/yyyy hh24:mi:ss') as LAST_MODIFIED_DATE
,(to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) as AGE
,CASE
WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 0 AND 1 THEN '0-1 Days'
WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS, 'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 2 AND 4 THEN '2-4 Days'
WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 5 AND 9 THEN '5-9 Days'
WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 10 AND 19 THEN '10-19 Days'
WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) >20 THEN '20+ Days'
ELSE 'UNKNOWN'
END AS AGE_GROUP
FROM IncidentDataBase
WHERE STATUS not in (4,5,6)
and rownum <10;
Notes:
1. When i put the cursor before "variable" (starting of the query) and execute the script i get an Error: ORA-00900: invalid SQL statement.
2. When i put the cursor just before "SELECT" i get a pop up.
a. it is a Toad window which displays the available variables (in this case :SYSDATE_UTS).
b. gives me a dropdown option to select the type (by default VARCHAR2 is selected).
c. there is a value field where i need to enter the value for the Variable.
d. the SQL statement shown in this dilog box does not include the 1st 2 lines
variable SYSDATE_UTS NUMBER;
exec SYSDATE_UTS := (sysdate-to_date('19700101','yyyymmdd'))*86400;
Q: is there something wrong in the syntax i am using?
Sven W. - I have been using your method all these days, which works just fine. i wanted to know how i could use a variable instead.
Business Requirement - My whole intent is to calculate the Age of an incident (Difference between "Reported Date" and current date) and to assign Age Groups (0-1 Days, 2-4 Days,....,20+ Days).
Edited by: 921713 on Mar 19, 2012 12:23 PM -
Error while adding oracle database resource to the fail safe group
Hi,
we are installaing ERP 6.0 EHP4 , oracle10.2.04 in MSCS
During the step, Adding the oracle Database Resource to the fail safe
group , I am getting the error.
28 13:21:57 ** WARNING : FS-10288: Parameter file C:\oracle\BCP\102\database\init<SID>_OFS.ora is not located on a cluster disk
29 13:21:57 ** WARNING : FS-10404: The database uses a nonclustered disk in one of the system parameters. Value of parameter is C:\ORACLE\<SID>\102\RDBMS\AUDIT
30 13:21:58 ** ERROR : FS-10036: The resource uses disk SAP HDD, which is also used by cluster resource SAP VIP in another group
31 13:21:58 ** ERROR : FS-10778: The Oracle Database resource provider failed to configure the cluster resource <SID>.WORLD
32 13:21:58 ** ERROR : FS-10890: Oracle Services for MSCS failed during the add operation
33 13:21:58 ** ERROR : FS-10497: Starting clusterwide rollback of the operation
34 13:21:58 FS-10488:<primary node name> : Starting rollback of operation
35 13:21:58 > FS-10090: Rolling back Oracle Net changes on node <primary node name>
I am having one local disk C: one shared disk Z: and quorum disk Q:
Shared disk Z: is already used for SAP<sid> group.
Regards,
JoelJoeldhanaraj wrote:>
> Hi,
>
> we are installaing ERP 6.0 EHP4 , oracle10.2.04 in MSCS
>
> During the step, Adding the oracle Database Resource to the fail safe
> group , I am getting the error.
>
> 28 13:21:57 ** WARNING : FS-10288: Parameter file C:\oracle\BCP\102\database\init<SID>_OFS.ora is not located on a cluster disk
> 29 13:21:57 ** WARNING : FS-10404: The database uses a nonclustered disk in one of the system parameters. Value of parameter is C:\ORACLE\<SID>\102\RDBMS\AUDIT
> 30 13:21:58 ** ERROR : FS-10036: The resource uses disk SAP HDD, which is also used by cluster resource SAP VIP in another group
> 31 13:21:58 ** ERROR : FS-10778: The Oracle Database resource provider failed to configure the cluster resource <SID>.WORLD
> 32 13:21:58 ** ERROR : FS-10890: Oracle Services for MSCS failed during the add operation
> 33 13:21:58 ** ERROR : FS-10497: Starting clusterwide rollback of the operation
> 34 13:21:58 FS-10488:<primary node name> : Starting rollback of operation
> 35 13:21:58 > FS-10090: Rolling back Oracle Net changes on node <primary node name>
>
> I am having one local disk C: one shared disk Z: and quorum disk Q:
>
> Shared disk Z: is already used for SAP<sid> group.
Hi Joel,
how about following the advice given by the error message and moving the mentioned files/folder (init<sid>_OFS.ora, AUDIT folder) to a clustered resource disk?
just my 2 pence... -
How to enforce index in oracle query
Hi all
how to enforce index in oracle query
RegardsUse INDEX hint to force Optimizer to use the specfied index.
You really need to investigate why Optimizer doesn't choose the index. Remember, INDEX SCAN are not always GOOD.
Jaffar -
Passing parameters to oracle query
Hi Everyone,
I'm a newbie to oracle and need help passing parameters to an oracle query. For example, I need to show all the employees in a certain department.So a list of "DEPT_CODE"'s will be displayed on a webpage and then the selected value will be passed to the query. I currently have this query in MS Access and use the bracket for user input ("[Dept]"). But how can this be done in oracle?
I am using ASP.NET 2.0 and Crystal Reports XI. Basically I have a webform where users can select the date range and department from a listbox. When the submit button is clicked, the values are passed to the query in crystal reports. For example, I have a query with "DEPT" as a parameter. So I pass the value of the selected listbox item from the webform to the crystal report. But now I have to select data from an oracle database and provide parameters. This is where I need help.
Thanks in advance
-SamDuplicate post.
Refer to this thread
Passing parameters to oracle query -
Hi,
I need to run an Oracle query with the following fields in the AWR report:
First Query:
DB Name
Begin Snap Time
End Snap Time
Begin Snap
End Snap
Event
Waits
Time(s)
Avg wait (ms)
% DB time
Wait Class
Second Query:
DB Name
Begin Snap Time
End Snap Time
Begin Snap
End Snap
Elapsed Time (s)
Executions
Elapsed Time per Exec(s)
%Total
%CPU
%IO
SQL Id
SQL Module
SQL Text
How Can I write this query?
Thanks in advance!R.Royal wrote:
Thanks,
I know how to generate an AWR report but I would like to write a query that takes these fields from oracle views. (DBA_ or V$)
And the link I sent to you shows you the views required to do that.
Cheers, -
Oracle query hints in JPQL - is it possible?
Sorry, posted to wrong forum... I don't know how to delete it - only edit...
Hello,
I am using Sun Java Application Server 9.1 (GlassFish), EJB 3.0 and JPA (TopLink). My database is Oracle.
Is there any way to specify Oracle query hints (for example, /*+ rule */ in JPQL queries? Or the only way to do it is using native queries?
Many thanks in advance
Edited by: Troff_2 on Nov 27, 2007 5:50 AMYes.It is possible.Only need to modify the view for order tracker query need to change.
You can use decode statement in the query to add status as Processing .
Please refer the IBE_ORDER_SUM_V view for details.
Eg:
decode(oel.meaning,'Booked',"Processing",oel.meaning) from
oe_lookups
oel, -
Converting MS SQL Server Query to Oracle Query
Hi There,
I've a strange problem. My project uses both MS SQL Server and Oracle server at run time. I've lot of queries which are written in MS SQL Style. Now, iam planning to write a helper class whic converts MS SQL Query to Oracle Query. Please Help me if any one has that kind of Helper with you.
Thanks And Regards,
Sasi KanthThat is why persistence applications like Hibernate or
CMP get used for apps that will use more than one DB,
but it takes upfront planning.
If you have a set of automated unit tests that work
with SQL Server, they will be a big help in getting
your Oracle code up and running.Indeed - JUnit and Ant would be a big help here.
It sounds like you have SQL in your JSPs, that will
work against you as well if so. If you are using a
DAO pattern, this will be much easier, as you can
re-implement each DAO for Oracle.If you'd layered this app properly, you might just implement an OracleDAOFactory and be done with it. Interfaces and a DAO layer would go a long way.
This is why layering is such a good idea. It isolates changes in a smaller subset of classes.
But your problem sounds pretty big. It'd be daunting even if it were well designed. -
Lately I've been looking into WebCenter Content customization. My efforts are being delayed however by the frequent restarts required to evaluate my work effort.
I found the startup goes a bit faster when I disable diagnostics in the WLS console for my locally installed managed UCM server. However, of the total time (starting up takes roughly 3-4 minutes) it spends roughly 2-3 minutes on generating a lot of warnings about policy access:
<18-jul-2012 14:21:04 uur CEST> <Warning> <oracle.wsm.resources.policyaccess> <WSM-06212> <An instance of the interface oracle.wsm.policymanager.IUsageTracker b
ean for a remote repository was not available for configuring the oracle.wsm.policymanager.accessor.BeanAccessor repository accessor for context "ResourcePatter
n [pattern=DOMAIN/weblogic/WebCenter, subjectType=MANAGED_DOMAIN, terms={PLATFORM=weblogic, SUBJECT_TYPE=MANAGED_DOMAIN, DOMAIN=WebCenter}]".>
<18-jul-2012 14:21:15 uur CEST> <Warning> <oracle.wsm.resources.policyaccess> <WSM-06212> <An instance of the interface oracle.wsm.policymanager.IDocumentManage
r bean for a remote repository was not available for configuring the oracle.wsm.policymanager.accessor.BeanAccessor repository accessor for context "ResourcePat
tern [pattern=DOMAIN/weblogic/WebCenter, subjectType=MANAGED_DOMAIN, terms={PLATFORM=weblogic, SUBJECT_TYPE=MANAGED_DOMAIN, DOMAIN=WebCenter}]".>
<18-jul-2012 14:21:25 uur CEST> <Warning> <oracle.wsm.resources.policyaccess> <WSM-06210> <An instance of the interface oracle.wsm.policymanager.IUsageTracker b
ean for the local repository at path "" was not available for configuring the oracle.wsm.policymanager.accessor.BeanAccessor repository accessor for context "Re
sourcePattern [pattern=DOMAIN/weblogic/WebCenter, subjectType=MANAGED_DOMAIN, terms={PLATFORM=weblogic, SUBJECT_TYPE=MANAGED_DOMAIN, DOMAIN=WebCenter}]".>
<18-jul-2012 14:21:36 uur CEST> <Warning> <oracle.wsm.resources.policyaccess> <WSM-06210> <An instance of the interface oracle.wsm.policymanager.IDocumentManage
r bean for the local repository at path "" was not available for configuring the oracle.wsm.policymanager.accessor.BeanAccessor repository accessor for context
"ResourcePattern [pattern=DOMAIN/weblogic/WebCenter, subjectType=MANAGED_DOMAIN, terms={PLATFORM=weblogic, SUBJECT_TYPE=MANAGED_DOMAIN, DOMAIN=WebCenter}]".>
<18-jul-2012 14:21:47 uur CEST> <Warning> <oracle.wsm.resources.policyaccess> <WSM-06210> <An instance of the interface oracle.wsm.policymanager.IUsageTracker b
ean for the local repository at path "" was not available for configuring the oracle.wsm.policymanager.accessor.BeanAccessor repository accessor for context "Re
sourcePattern [pattern=DOMAIN/weblogic/WebCenter, subjectType=MANAGED_DOMAIN, terms={PLATFORM=weblogic, SUBJECT_TYPE=MANAGED_DOMAIN, DOMAIN=WebCenter}]".>
<18-jul-2012 14:21:58 uur CEST> <Warning> <oracle.wsm.resources.policyaccess> <WSM-06210> <An instance of the interface oracle.wsm.policymanager.IDocumentManage
r bean for the local repository at path "" was not available for configuring the oracle.wsm.policymanager.accessor.BeanAccessor repository accessor for context
"ResourcePattern [pattern=DOMAIN/weblogic/WebCenter, subjectType=MANAGED_DOMAIN, terms={PLATFORM=weblogic, SUBJECT_TYPE=MANAGED_DOMAIN, DOMAIN=WebCenter}]".>
<18-jul-2012 14:22:08 uur CEST> <Warning> <oracle.wsm.resources.policyaccess> <WSM-06210> <An instance of the interface oracle.wsm.policymanager.IUsageTracker b
ean for the local repository at path "" was not available for configuring the oracle.wsm.policymanager.accessor.BeanAccessor repository accessor for context "Re
sourcePattern [pattern=DOMAIN/weblogic/WebCenter, subjectType=MANAGED_DOMAIN, terms={PLATFORM=weblogic, SUBJECT_TYPE=MANAGED_DOMAIN, DOMAIN=WebCenter}]".>
etc...
The admin server is up & running, all other managed servers are down.
I'm not sure what's happening in the background here. To me it feels like it's timing out a lot. After the warnings the server starts almost immediately.
I tried to display more status information by changing log levels, to no avail, and Google provided me with little help as well.
So I've come here hoping someone can speed me up :-)
Edited by: 930408 on Jul 18, 2012 6:30 AMThanks Srinath, your comment gave me an idea.
I created a new domain with just WebCenter Content Server which solved my issue. Overtime my old domain had been extended quite a few times and likely the WSM PolicyManager had been inluded somewhere.
The warnings are still there during startup but it proceeds immediately and my startup time has been reduced to 30-40 seconds. Still high but much more acceptable. Don't think I can squeeze more out of it though.
Lesson learnt; keep you dev environment as minimalistic as possible. -
Help..Oracle could not trace my WDP hands on course for OCP 10g
Dear All,
Can somebody on Oracle (OTN team) could help me to validate & check my WDP hands on course as below detail :
Class Name :
ORACLE DATABASE 10G: ADMINISTRATION WORKSHOP II RELEASE 2 - WDP (D17092GC31S)
Location : CV Informit Indonesia
Student Id : 62156
Student Name : Zulfirman
Schedule : 25 March 2011 - 10 April 2011
(10 sessions @ 3 Hours)
I have put above information on VUE, but then come up an email response from oracle asking my hardcopy certificate course.
I have contacted the INFORMIT, they said it takes 2 up to 3 month to get the certification from OU indonesia.
Since it take long time to get the training certification, I come back emailing the oracle to ask for speed up, then they said they need to check further about my training detail.
FInally they come up with an email that asking me to ask INFORMIT to email the oracle confirming that i have already completed that course.
Worstly, i have not in that city anymore where the INFORMIT located, but i drop informit an email just now to forward oracle request to them.
Question :
1. Can someone help me to validate my training instead of waiting oracle with the emailing back - forward ?
2.Why ORacle unable to trace my detail WDP class above ? Is it because of a cheap WDP training so they dont provide a connected server between WDP training provider & OU or Oracle headquarter ?
3. The Hardcopy certification for WDP student take too long. What is the std lead time for WDP student to have thier training certifiaction ?
Thank You,
Zulfirman,PMP,OCAuser4761616 wrote:
Hi Brandye Barrington,
No,
they didnt provide me an exam voucer. For your info, i have already passed all the exam required for OCP track.Which is an indicator of something not right. Mabe not your fault. Maybe the Institution. Maybe WDP.
My goal to get this training is to refresh me about the topic & to claim my OCP status.
you can check my exam history using my ORacle Testing ID (or Oracle Certification Program ID): XXXXXXXXXXWell you've just 3.2 (iv) No Misconduction of the http://education.oracle.com/education/pdf/ocp_candidate_agreement_V0810.pdf of the agreement you make before taking this exam by disclosiing your Oracle Testing Id to another person ... aka the whole internet!
>
For your info,
I hve just got confirmation from my WDP training centre (Informit). They have emailed "[email protected]" to confirm that i have officialy registered with WDP training centre by showing to them (them = oracle) the screen shot or print screen of regsitration form from WDP website, where my name alrady been registered inside the WDP system.
Ho Ho Ho !! The WDP training center are well enoughton the ball to know that email address have been withdrawn. ( http://blogs.oracle.com/certification/2011/03/email_alias_ocpexam_wworacleco.html ).
Perhaps that document does show a registration number.
Now i can only wait, wheter oracle still could not accpet that email from INFORMIT as a proof or i have to wait for my certification hardcopy (take 2 or 3 months ahead)
Emails can be faked. And I am reasonably certain a percentage of WDP Training centers would not apply the rules properly if they could get away with it.
If i still have to wait for the scan hardcopy certification, then for sure, i really upset with ORACLE, due they could not manage best communication & sychronization database between ORACLE - WDP TRanining Centre, & me as a unlucky candidate due to their bad communication on both system.
IMHO I can see from this and other threads that WDP or the training centers fail to publish clear and precise information of what is involved so the students can authoratively check on an oracle website. IMHO The WDP Traiing centers have a degree of control which they can use to mislead students.
And I assume you have access to the following :: https://workforce.oracle.com/pdf/html_rd/wdp_stu_reg.html?wdp0 ... and if not why not ? ( I dont .. i am not WDP).
If ORACLE is a great database company, then they must already predict such issue in early as possible instead of waiting such complaint raised in.
Oracle is Great. Larry is Great. Any Oracle RDBMS version with a zero in it may be a bad vintage.
But IMHO you may be right wrt WDP.
Again, Pls help me on this..
Besr Regards,
Zulfirman,PMP,OCAWhen one does training at OU the attendance is properly recorded and there are nless real issues with attendance not being recorded.
With WDP institutions as far as I can tell this is not perhaps as well auditted and there is perhaps room for shenanigans; faked attendance, etc.
As far as i know when WDP was started (oracle 9i) the students used to have to attend the whole track of a specially constructed coiurse to get the credi ( I used to call it a never mind the quality feel the width training). And the training was spread to ensure the pupil had time to absorb the training. And it might be taught by non Oracle Professionals. WDP can however now be used for a single session set of part of track being sufficient for the training requirement (This may be simply a never mind the quality appreciatethe cheapness approach).
This may all seem off topic for you.
However please realise Oracle Certification (whcih operates independently of WDP who do there own thing) need to establish training has been properaly attended. And if there is a loophole many WDP candidates wll rush towards it.
This however does give me a chance to kick Oracle to ensure WDP has its house in order.
bigdelboy. -
Some diffrence in oracle query and mysql query
sir i see both query in SessionBean1
mysql query
SELECT ALL usert.username,
usert.userid,
usert.camid FROM usert
this not use user name
oracle query
SELECT ALL MFA.LUSER.USERID,
MFA.LUSER.TITLE,
MFA.LUSER.CAMPID,
MFA.LUSER.PWD,
MFA.LUSER.USERNAME
FROM MFA.LUSER
the user name mfa is use in this query you can see
this is main diffrence
but i yse both in code but not get result
try {
RowKey userRowKey = luserDataProvider.findFirst
(new String[] { "MFA.LUSER.USERNAME" },
new Object[] { textField4.getText()});
if (userRowKey == null) {
textField3.setText("11111");
return null;
} else {
textField3.setText("22222");
return null;
catch (Exception e) {
log("Cannot perform login for userid " + textField3.getText(), e);
error("Cannot perform login for userid " + textField3.getText() + ": " + e);
textField3.setText("77777");
return null;
problem in only oracle not in mysql
please give me idea how i get result
thank youcan you post your query with explain plan for both 9i version and 10g version.
Thanks,
karthick.
Maybe you are looking for
-
Program doesn't recognise keyboard input. PLease help.
Hi guys, I managed with help from some of you to build my Dice Game. It works the way it should be however I still have a small issue. It should be working in a way that when user in the beginning puts 'r' the dice roll is performed. At the moment no
-
How do i play windows games on mac?
its probably a simple software install or something but i do not know, and are new to the apple computer system. i have a macbook pro that i just bought and i didnt realize half of the games on my steam wernt mac compatable, thanks
-
Reversal of Clearing document (Mass)
Dear Experts, I have given a payment run through F110 (Authomatic Payment Run). Around 700 payment documents has been generated. For some technical reason with HDFC Bank we have to reverse all the payment documents and again payment run has to be pro
-
Can't get Anonymous FTP folder to work
According to this Apple doc you can set up a folder for anonymous FTP users. But when I add the "uploads" folder to my ftp root directory, which was relocatd as mentioned bellow. It doesn't seem to work. Anonymous users are sent directly to the ftp r
-
HT1657 why i cant download rented movie when says not enough storage when I actually do
why i cant download rented movie when says not enough storage when I actually do