Procedure compiles on Oracle 10g but fails to do so on Oracle 9i

Hi,
We have an application which supports both Oracle 9i and Oracle 10g dbs, recently we added a new procedure to get a report from the applications statistics schema, the procedure uses two other schemas also to get the report and uses a query which does not use any Oracle specific feature (pure ANSI SQL), it compiled successfully on Oracle 10g but gives the following error on 9i db
SQL> show err
Errors for PROCEDURE SPGETNONCOMPLOGBASEDONEMP:
LINE/COL ERROR
22/8 PL/SQL: SQL Statement ignored
31/37 PL/SQL: ORA-00907: missing right parenthesis
the 9i version
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
PL/SQL Release 9.2.0.1.0 - Production
CORE 9.2.0.1.0 Production
TNS for 32-bit Windows: Version 9.2.0.1.0 - Production
NLSRTL Version 9.2.0.1.0 - Production
10g version
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Prod
PL/SQL Release 10.1.0.2.0 - Production
CORE 10.1.0.2.0 Production
TNS for 32-bit Windows: Version 10.1.0.2.0 - Production
NLSRTL Version 10.1.0.2.0 - Production
If any body knows the soln, please help
Thanks in advance
Gibs
Procedure
CREATE OR REPLACE PROCEDURE Spgetnoncomplogbasedonemp (
in_emp_id IN VARCHAR,
in_start_date IN DATE,
in_end_date IN DATE,
non_complog OUT Types.ref_cursor
IS
BEGIN
OPEN non_complog
FOR
SELECT end_date AS end_date, employee_id AS emp_id, NAME AS emp_name,
vcname AS plan_name, start_date, nid AS nid
FROM (SELECT *
FROM ((SELECT employee_id, NAME
FROM hrsample_bridge.ath_employee
WHERE ( (in_emp_id IS NULL AND 1 = 1)
OR (in_emp_id IS NOT NULL
AND employee_id = in_emp_id
)) CROSS JOIN (SELECT vcname
FROM orahrsamplecore.athobjectinstance
WHERE compliance_status = 1
AND ( (in_start_date IS NULL
OR (dtcompreissue
BETWEEN in_start_date
AND in_end_date
)))) LEFT OUTER JOIN COMPTRACKLOG c ON c.emp_id =
employee_id
AND c.plan_name =
vcname
WHERE c.emp_id IS NULL
AND ( ( (in_emp_id IS NULL)
OR ( in_emp_id IS NOT NULL
AND NOT EXISTS (
SELECT 1
FROM COMPTRACKLOG
WHERE plan_name = vcname
AND c.emp_id = in_emp_id )
AND ( (in_start_date IS NULL)
OR ( (in_start_date IS NOT NULL)
AND c.end_date BETWEEN in_start_date AND in_end_date
ORDER BY c.emp_id, c.plan_name ASC;
END;
/

Hi,
We have an application which supports both Oracle 9i and Oracle 10g dbs, recently we added a new procedure to get a report from the applications statistics schema, the procedure uses two other schemas also to get the report and uses a query which does not use any Oracle specific feature (pure ANSI SQL), it compiled successfully on Oracle 10g but gives the following error on 9i db
SQL> show err
Errors for PROCEDURE SPGETNONCOMPLOGBASEDONEMP:
LINE/COL ERROR
22/8 PL/SQL: SQL Statement ignored
31/37 PL/SQL: ORA-00907: missing right parenthesis
the 9i version
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
PL/SQL Release 9.2.0.1.0 - Production
CORE 9.2.0.1.0 Production
TNS for 32-bit Windows: Version 9.2.0.1.0 - Production
NLSRTL Version 9.2.0.1.0 - Production
10g version
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Prod
PL/SQL Release 10.1.0.2.0 - Production
CORE 10.1.0.2.0 Production
TNS for 32-bit Windows: Version 10.1.0.2.0 - Production
NLSRTL Version 10.1.0.2.0 - Production
If any body knows the soln, please help
Thanks in advance
Gibs
Procedure
CREATE OR REPLACE PROCEDURE Spgetnoncomplogbasedonemp (
in_emp_id IN VARCHAR,
in_start_date IN DATE,
in_end_date IN DATE,
non_complog OUT Types.ref_cursor
IS
BEGIN
OPEN non_complog
FOR
SELECT end_date AS end_date, employee_id AS emp_id, NAME AS emp_name,
vcname AS plan_name, start_date, nid AS nid
FROM (SELECT *
FROM ((SELECT employee_id, NAME
FROM hrsample_bridge.ath_employee
WHERE ( (in_emp_id IS NULL AND 1 = 1)
OR (in_emp_id IS NOT NULL
AND employee_id = in_emp_id
)) CROSS JOIN (SELECT vcname
FROM orahrsamplecore.athobjectinstance
WHERE compliance_status = 1
AND ( (in_start_date IS NULL
OR (dtcompreissue
BETWEEN in_start_date
AND in_end_date
)))) LEFT OUTER JOIN COMPTRACKLOG c ON c.emp_id =
employee_id
AND c.plan_name =
vcname
WHERE c.emp_id IS NULL
AND ( ( (in_emp_id IS NULL)
OR ( in_emp_id IS NOT NULL
AND NOT EXISTS (
SELECT 1
FROM COMPTRACKLOG
WHERE plan_name = vcname
AND c.emp_id = in_emp_id )
AND ( (in_start_date IS NULL)
OR ( (in_start_date IS NOT NULL)
AND c.end_date BETWEEN in_start_date AND in_end_date
ORDER BY c.emp_id, c.plan_name ASC;
END;
/

Similar Messages

  • Query can run in Oracle 10g but very slow in 11g

    Hi,
    We've just migrated to Oracle 11g and we noticed that some of our view are very slow (it takes seconds in 10g and takes 30 minutes in 11g), and the tables are using the local table.
    Do any of you face the same issue?
    This is our query:
    SELECT
    A.wellbore
    ,a.depth center
    ,d.MD maxbc
    ,d.XDELT xbc
    ,d.YDELT ybc
    ,e.MD minac
    ,e.XDELT xac
    ,e.YDELT yac
    from
    table_A d,table_A e, table_B a
    where a.wellbore = d.WELLBORE (+)
    and a.wellbore = e.WELLBORE(+)
    and d.MD = (select max(MD) from table_A b where b.MD < a.depth and
    d.wellBORE = b.wellBORE)
    and e.md = (select min(md) from table_A c where c.MD > a.depth and
    e.wellBORE = c.wellBORE);

    Thanks I will move to the correct one..
    Rafi,
    Build the Indexes and it is still slow. I am querying from a view from another database, which is in 10g instances.
    Moved: Query can run in Oracle 10g but very slow in 11g
    Edited by: 924400 on Apr 1, 2012 6:03 PM
    Edited by: 924400 on Apr 1, 2012 6:26 PM

  • Could Oracle 10g (in a server)  work with existing Oracle 9i client

    Hello!
    I am new in Oracle, and I was wondering if it’s possible to use Oracle 10g in a server with clients using Oracle 9i. Would that work? Are they compatible?.
    Thanks!

    my 9.2 client can not connect to 10g server,
    It says that "this application requires that you have been granted to select any dictionary privelege".
    my 10 g client connecting normally, but i have many terminal computers with 9 client.
    Tell me how to connect to 10g server from 9 client please.

  • Query works on Oracle 9i, but fails on Oracle 10g - puzzling...

    In porting an application from Oracle 9i to Oracle 10g, I hit a problem that for a while I assumed was some bug of mine. But I eventually isolated the problem and can reproduce this using a single sql script and then a single delete. The amazing thing is that it works fine on Oracle 9i (always) and fails on Oracle 10g (always).
    Have I found a bug? (I would be pretty amazed).
    Here's the situation. I have four tables and a trigger set on one of those tables.
    The tables are configured so that there is the "parent" table (A). Table B has a foreign key dependency on A's primary key, with "on delete cascade". Table B also has a trigger that runs on the delete. Table C (which has no data) has an integrity constraint on A's primary key. Table D holds information used by the trigger to determine if/when table C should be dropped. (I have a script that sets all this up).
    After setting up the tables and the few data records needed, I delete a record from Table A. This causes the records in Table B to be deleted. That fires the trigger, which determines that Table C can be dropped, so the trigger drops Table C. Then, Oracle decides it still needs to check the integrity constraint on Table C (after all, C depended on A and we have deleted a record in A). Oracle then issues a query against table C, but of course table C has already been dropped and an error results.
    The exact same script followed by the delete works fine on Oracle 9i. Is this a bug or is this a documented change in behavior? Any known workarounds? Unfortunately, the application needs all the integrity constraints that are present in the schema and also runs on SQL Server, so modifications in the integrity constraints are probably not what I am seeking).
    Thanks so much!
    RB

    I wasn't sure how to post the script, but it is short enough to include below. Many thanks for the quick response.
    To connect the script below to my original post, the names are:
    Table A = OT_AW_PROCESSDEF
    Table B = OT_AW_PROCESS_APPDATADEF
    Table C = OT_AW_AD_OneLoop_1
    Table D = OT_AW_APPDATA_TABLEINFO
    The trigger is also included in the script. After running this script, the command:
    delete from OT_AW_ProcessDef where processdefId = 101
    will cause the failure on Oracle10g, but succeeds on Oracle 9i.
    Thanks again!
    RB
    /* *********************** CLEAN UP ********************************** */
    /* Order the dropping of objects in reverse of creation */
    DROP TABLE OT_AW_AD_OneLoop_1 CASCADE CONSTRAINTS
    DROP TABLE OT_AW_PROCESS_APPDATADEF CASCADE CONSTRAINTS
    DROP TABLE OT_AW_APPDATA_TABLEINFO CASCADE CONSTRAINTS
    DROP TABLE OT_AW_PROCESSDEF CASCADE CONSTRAINTS
    /* ******************* DATA TABLES *********************************** */
    /* OT_AW_PROCESSDEF(Process Definition) Table */
    /* ********** NOTE: OT_AW_PROCESSDEF and AW_PROCESS TABLES SHOULD ALWAYS HAVE THE SAME SET OF COLUMNS ********* */
    create table OT_AW_PROCESSDEF (
    processDefId NUMBER /* Id for the process definition */
    , processDefName NVARCHAR2(255) /* Name of the process definition */
    , CONSTRAINT OT_AW_PROCESSDEF_PK PRIMARY KEY(processDefId)
    insert into OT_AW_PROCESSDEF (
    processDefId, processDefName
    values (
    1, 'ADHOC'
    /* OT_AW_APPDATA_TABLEINFO(List of all application Data tables in the system) Table */
    create table OT_AW_APPDATA_TABLEINFO (
    namespace VARCHAR2(65) NOT NULL, /* name of the namespace to which it belongs */
    tableName VARCHAR2(128) , /* Name of the appdata table */
    adLevel NUMBER(38) NOT NULL /* Appdata table level: 0=>PROCESS, 1=>CONVERSATION */
    , CONSTRAINT OT_AW_APPDATA_TABLEINFO_PK PRIMARY KEY ( tableName )
    , CONSTRAINT OT_AW_APPDATA_TABLEINFO_UNQ UNIQUE( namespace, tableName, adLevel )
    /* OT_AW_PROCESS_APPDATADEF(Process level application data definition) Table */
    create table OT_AW_PROCESS_APPDATADEF (
    processDefId NUMBER NOT NULL /* Id for the process definition */
    , name VARCHAR2(65) NOT NULL /* Name of the application data field, This name may be pointing to a shared namespace field */
    , tableName VARCHAR2(128) /* Name of the table that holds the value for the field, may be same as local namespace table name */
    , namespace VARCHAR2(65) NOT NULL /* Name of the namespace to which this field belongs */
    , mappedNamespace VARCHAR2(65) null /* Name of the shared namespace to which this field is mapped, if there is any mapping */
    , CONSTRAINT OT_AW_PROCESS_APPDATADEF_PK PRIMARY KEY (namespace, processDefId, name)
    , CONSTRAINT OT_AW_PROCESS_APPDATADEF_FK FOREIGN KEY (processDefId) REFERENCES OT_AW_PROCESSDEF(processDefId) on delete cascade
    CREATE TABLE OT_AW_AD_OneLoop_1(processDefId number , processId number ,FromRole number null, ToRole number null, Anyone number null,
    CONSTRAINT OT_AW_AD_OneLoop_1_FK1 FOREIGN KEY (processDefId) REFERENCES OT_AW_PROCESSDEF(processDefId) )
    /* TRIGGERS */
    CREATE OR REPLACE TRIGGER OT_AW_PROCESS_APPDATADEF_DEL
    AFTER DELETE ON OT_AW_PROCESS_APPDATADEF
    FOR EACH ROW
    DECLARE
    PRAGMA AUTONOMOUS_TRANSACTION;
    tableName_var OT_AW_PROCESS_APPDATADEF.tableName%TYPE;
    tempStr_var varchar2(128) :=null;
    deletedId OT_AW_PROCESS_APPDATADEF.processDefId%TYPE;
    deletedMNsp OT_AW_PROCESS_APPDATADEF.mappedNamespace%TYPE;
    numReferences number :=-1;
    tableExists number :=0;
    CURSOR ADPTable_cursor
    IS
    SELECT apa.tableName, apa.processDefId, apa.mappedNamespace
    FROM OT_AW_PROCESS_APPDATADEF apa
    WHERE apa.tableName = :old.tableName
    AND apa.processDefId = :old.processDefId;
    BEGIN
    dbms_output.put_line('Starting TRIGGER OT_AW_PROCESS_APPDATADEF_DEL');
    OPEN ADPTable_cursor;
    LOOP
    FETCH ADPTable_cursor
    INTO tableName_var, deletedId, deletedMNsp;
    EXIT WHEN ADPTable_cursor%NOTFOUND;
    BEGIN
    IF (deletedMNsp IS NULL) THEN
    BEGIN
    select count(*) into numReferences from OT_AW_PROCESS_APPDATADEF where tableName = tableName_var
    and processDefId <> deletedId;
    IF ( numReferences = 0 ) THEN
    BEGIN
    SELECT count(*) INTO tableExists FROM OT_AW_APPDATA_TABLEINFO where
              tableName=tableName_var;
    IF (tableExists > 0) THEN
    BEGIN
    --dbms_output.put_line('About to alter first table');
    -- EXECUTE IMMEDIATE 'ALTER TABLE ' || tableName_var || ' DROP CONSTRAINT ' || tableName_var ||'_FK1';
    --dbms_output.put_line('About to alter second table');
    -- EXECUTE IMMEDIATE 'ALTER TABLE ' || tableName_var || ' DROP CONSTRAINT ' || tableName_var ||'_FK2';
    dbms_output.put_line('About to drop table named: ' || tableName_var);
    tempStr_var := 'DROP TABLE ' || tableName_var;
    EXECUTE IMMEDIATE tempStr_var;
    dbms_output.put_line(tempStr_var);
    dbms_output.put_line('Table dropped');
    --dbms_output.put_line('Not dropping table now');
    END;
    END IF;
    delete from OT_AW_APPDATA_TABLEINFO where
              tableName=tableName_var;
    dbms_output.put_line('OT_AW_APPDATA_TABLEINFO updated');           
    END;
    END IF;
    END;
    END IF;
    END;
    END LOOP;
    dbms_output.put_line('Loop ended');
    CLOSE ADPTable_cursor;
    dbms_output.put_line('Cursor closed');
    COMMIT WORK;
    dbms_output.put_line('Work committed');
    dbms_output.put_line('Ending TRIGGER OT_AW_PROCESS_APPDATADEF_DEL');
    END;
    show errors;
    /* Set up data to simulate the creation of OT_AW_AD_OneLoop_1 */
    insert into OT_AW_PROCESSDEF (
    processDefId, processDefName
    values (
    101, 'OneLoop'
    insert into OT_AW_PROCESS_APPDATADEF (
    processDefId, name, tableName, namespace
    values (
    101, 'FromRole', 'OT_AW_AD_OneLoop_1', 'OneLoop'
    insert into OT_AW_PROCESS_APPDATADEF (
    processDefId, name, tableName, namespace
    values (
    101, 'ToRole', 'OT_AW_AD_OneLoop_1', 'OneLoop'
    insert into OT_AW_APPDATA_TABLEINFO (
    namespace, tablename, adlevel
    values (
    'OneLoop', 'OT_AW_AD_OneLoop_1', 0
    /

  • XQuery works outside of Oracle JDeveloper but fails in JDev

    Hi,
    I created an XQuery script that transform an XML file. It works fine in XMLSpy and Stylus, but fails with error in Oracle JDev 10.1.3.1:
    XPST0008: It is a static error if an expression refers to an element name, attribute name, schema type name, namespace prefix, or variable name that is not defined in the static context, except within an ElementTest or an AttributeTest.
    Detail: invalid type 'xs:anyAtomicType'
    Does that mean Oracle JDev doesn't fully support XQuery 1.0?
    Thanks.

    Michelle,
    Can you post your code?
    Regards,
    Geoff

  • OracleAS 10g Infrastructure fails to start after reboot.

    Hi,
    I have installed OracleAS 10g Infrastructure. Whenever I restart my machine I get the opmn.exe error messages and it don't go away. The components are also down. The other thing is that the memory usage behaviour of "opmn.exe" is strange. It is utilizing 100% cpu and the memory taken is 1.36 Gb. I have to stop and restart it.
    Actually I want to install "Portal" component on it and I am stucked by this problem in Infrastructure.
    Any Idea as how to solve this problem?
    Regards,
    Shah

    I found in another post that suggested I needed to update my listener.ora file. I did that and the error went to telling me that oracle was unavailable. Then I found a post that suggested this:
    Set oracle_sid=orcl
    SQLPLUS /NOLOG
    CONN SYS/????@orcl AS SYSDBA
    STARTUP
    EXIT
    Ran this and sure enough, the database was ok but sitting idle. It went through some initialization steps and mounted so I can now launch the manager tool and have access to my database.
    So, ok, this is running on VMware and that "might" be causing the problems but this is very strange since it survived three reboots then out of the blue this issue comes up. I can live with running a batch file everytime I reboot in my little test environment so I'm ok :]
    Thanks for your time.

  • I have completed installation of Oracle 10g but I could not login into the

    Please I have completed installation of Oracle 10g into my laptop but I could not login into the database to create my new tables through SQL*Plus.
    I don't know what to type into these text fields. (1) Name, (2)Password and (3) Host.
    Please can someone help me urgently
    Fola

    There are different things here to know about.
    Did you also create database while installation ?
    If yes then
    C:\> set oracle_sid=yoursid
    C:\> sqlplus username/password
    If not then, please create the database first.
    For "I don't know what to type into these text fields. (1) Name, (2)Password and (3) Host."
    (1) Name : This is user name.
    (2) Password: This is password.
    (3) Host: This is oracle net service name configured in tnsnames.ora. Please refer to http://download-uk.oracle.com/docs/cd/B19306_01/network.102/b14212/toc.htm
    -aijaz

  • Connection to Oracle 10g database failing

    Not sure if I should post this here or on another newsgroup, but I am having a problem trying to connect, using WebLogic Server 9.2, to an Oracle 10g database (10.2.0.2), that has been upgraded from Oracle 9i.
    I can connect to the same database using WebLogic 7.0.2, and I can also connect using WebLogic Server 9.2 to an Oracle 9i database.
    I keep getting the 'Authentication denied: Boot identity is not valid' error, but I know that the username/password I am using in the boot.properties file is valid, because I have connected to the same database using WebLogic Server 7.0.2.
    I suspect that the error could be with the drivers I am using, but I have checked and I have the latest oracle jar file in the WL_HOME/server/lib directory.
    I did previously have a version of WebLogic 7.0.2 on the machine but this was deleted.
    On the database in question the listener logs show that a connection was established, but that's it.
    Any help would be greatly appreciated.

    Simon Kearn wrote:
    Not sure if I should post this here or on another newsgroup, but I am having a problem trying to connect, using WebLogic Server 9.2, to an Oracle 10g database (10.2.0.2), that has been upgraded from Oracle 9i.
    I can connect to the same database using WebLogic 7.0.2, and I can also connect using WebLogic Server 9.2 to an Oracle 9i database.
    I keep getting the 'Authentication denied: Boot identity is not valid' error, but I know that the username/password I am using in the boot.properties file is valid, because I have connected to the same database using WebLogic Server 7.0.2.
    I suspect that the error could be with the drivers I am using, but I have checked and I have the latest oracle jar file in the WL_HOME/server/lib directory.
    I did previously have a version of WebLogic 7.0.2 on the machine but this was deleted.
    On the database in question the listener logs show that a connection was established, but that's it.
    Any help would be greatly appreciated.Can you show me the pool definition, and the whole stack trace of the
    exception?
    Joe

  • Shared services  9.3.1  configuration  to connect to oracle 10g xe fails

    I am trying to install Hyperion shared services on Windows XP media center. I have Apache Tomcat running as localhost and Oracle 10g express edition running as database. When I try to install hyperion shared services, the installation process goes well until database configuration details.
    I can see my server name, Port: 1521. Then I have a table with other details
    Product SID User Name Password DataTablespace Index Tablespace.
    I enter the password used to connect to oracle database as "admin" in shared services.
    User Name = hypuser
    SID = hypdb
    Product = Hyperion
    Then I click next. I keep receiving this error message " Unable to connect to the database for product hyperion shared services".
    Can some one tell me what the problem is?
    Backuperror notepad shows: System error 1060 has occurred.
    The specified service does not exist as an installed service.
    Thanks.

    Hi,
    First of all "Windows XP media center" is not an officially supported O/S so you may experience issues.
    Before you configure the database you will have you have created a schema for HSS in Oracle, for example if you created a schema called HSS with password of hyperion then the connection details will be
    SID : XE
    username : HSS
    password : hyperion
    The SID is usally XE by default on oracle express editions.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • I HAVE INSTALLED ORACLE 10G BUT FORGOT THE ADMIN PASSWORD.

    DEAR FRIENDS,AFTER INSTALLING ORACLE 10G EXPRESS EDITION APPLICATION I FORGOT THE PASSWORD. IS THERE ANY WAY TO RECOVER THAT PASSWORD OR ELSE SHOULD I RE INSTALL ONCE AGAIN.......................?

    user12110193 wrote:
    DEAR FRIENDS,AFTER INSTALLING ORACLE 10G EXPRESS EDITION APPLICATION I FORGOT THE PASSWORD. IS THERE ANY WAY TO RECOVER THAT PASSWORD OR ELSE SHOULD I RE INSTALL ONCE AGAIN.......................?YOU DO NOT NEED TO SHOUT.
    Log on as the internal user (sys) from the local machine. Usually
    sqlplus / as sysdba
    will do the trick. And then you can change the passwords using the standard 'ALTER USER SYS IDENTIFIED Y newpass;' command.
    This is a fairly common question - a quick network search could have saved you a frustrating and anxious wait.

  • Oracle 10g connectivity with sql server 2000 through oracle transpa gateway

    dear gurus.
    i am to connecto oracle 10g with sql server 2000 through oracle transparent gateway.
    i have installed transparent gateway and proper configured. also link is created.
    but when i execute query "select * from city@inventory" , so an error displayed.
    ORA-12500: TNS:listener failed to start a dedicated server process.
    kindly suggest me what could be the cause.
    regards,

    if the listener fails to spawn a dedicated server process it is commonly indicating an issue with the listener. So posting the listener and also a listener trace including a description of the env where you installed the gateway into which directory would be helpfull. Please keep also in mind if you have for example a 10.2.0.3 database and you install into this directoty a 10.2.0.1 gateway you have to reapply the patchset again do get consistent file version.
    So please describe more detailed your env.

  • Oracle 10g (10.1.3.1.0) ant-oracle-classes.jar

    Hi,
    I dint find Ant Task for stopping/starting/restarting the Oracle Application Server, but the http://download-uk.oracle.com/docs/cd/B31017_01/web.1013/b28951/anttasks.htm#BEIHFIIC specifies that you can do so with the Ant Tasks. I went through "ant-lib.xml" present in the ant-oracle-classes.jar, even it does not have these tasks.
    Is it by any chance that Oracle shipped a wrong library of "ant-oracle-classes.jar" in Oracle 10g (10.1.3.1.0) is with that of Oracle 10g Release 3 (10.1.3), since this Release 3 does not support the stopping and starting of the server with the Ant tasks.
    If any one has any idea, please let me know.
    Whom should I report/ask?
    Can anyone give some pointers for the same. I would be very very thankful.
    Rgds,
    Prashanth Babu.

    Thanks a lot Mike.
    But then, the problems donot stop there.
    I went though the decompiled code of JSR88StartServer.java and JSR88ShutdownServer.java and found that doStartServer() of JSR88StartServer and doShutdownServer() of JSR88ShutdownServer, both call only one method ie deploymentManager.shutdown(), which is present in J2EEDeploymentManager class.
    Ideally, JSR88StartServer should start the server by invoking deploymentManager.restart(). But then, looks like there is a problem here too, since both these methods simply call shutdown only.
    And also, whenever I tried restarting the App Server from EnterpriseManager Console, it never restarts. It simply stops and does not do anything apart from that.
    Iam in a project where our applications have to be up and running on OAS 10g through automation of deployment ie either thru Ant Tasks or the J2EE Deployment API provided by Oracle. But, both the ways, it looks like there are one-too-many hurdles.
    Any inputs to the same would be of great help.
    I would just like to know, if any one has done the above. Please let me know.
    Rgds,
    Prashanth Babu.

  • Oracle 10g OCI based application talking to an Oracle 9i database

    Hi all,
    Got a question. I have an OCI C++ application that is written using the Oracle 10g OCI includes, etc ... This of course is running on a 10g client. The client OS is actually a Windows x64 system since 10g is the only native OCI client right now for 64 bit Windows systems. So this all works fine. Now, I am communicating with an Oracle 9i database server. Is there anything wrong or invalid about this configuration ? I didn't think that there was but I was asked to confirm this, that is having an Oracle 10g client communicating with an Oracle 9i database. Our application is making very straight forward OCI calls, and we are not using any of the newer OCI calls that were introduced in 10g, just the ones that are available in 9i OCI.
    Thanks in advance,
    Nick

    Thanks for the reply.
    Actually I thought that the OCCI forum was for Object oriented OCI, so while I'm using C++, I'm not using the object oriented side of OCI, just using the normal OCI calls. Guess I should have been a little clearer in my original post.
    But my main question really concerned the version of the client and the version of the database which you answered.
    Thanks,
    Nick

  • Stored procedure runs fine from SSMS but fails when called from the C# app

    I'm using SS Express 2012 so I doubt I have all possible debugging capabilities at my disposal, although I'm still trying to figure this out myself.
    The compiled C# application has logging to insure that the the SP is being invoked, the appropriate line of code is  definitely being reached. The logging always reports 'success' suggesting that the SP was successfully executed (and no exception is thrown
    to the C# app), but the indexes aren't getting rebuilt (I have a fragmentation query proving they are not rebuilt). Yet it runs successfully if I
        (1) set a breakpoint in the C# app and step through the code line by line OR
        (2) run the SP from the SSMS GUI.
    The fragmentation query confirms sucess for both 1 and 2.
    -I can't rely on the GUI because I want to run this overnight immediately after the C# app is finished inserting new records.
    - The SP loops through all the tables, and all the indexes in each table, checking for fragmentation and rebuilding any indexes over 7% fragmented.
    ALTER Procedure [dbo].[usp_RebuildIndexes]
    AS
    Declare @fetch_TableName NVARCHAR(256)
    DECLARE Cursor_Tables CURSOR FOR
    SELECT Name FROM sysobjects WHERE xtype ='U'
    OPEN Cursor_Tables
    While 1 = 1 -- Begin to Loop through all tables
    BEGIN
    FETCH NEXT FROM Cursor_Tables INTO @fetch_TableName -- fetches the next table
    if @@FETCH_STATUS <> 0 break
    print '---------' + @fetch_TableName
    Declare @fetch_indexName NVARCHAR(256) -- loops through al indexes of the current table
    DECLARE Cursor_Indexes CURSOR FOR -- Looking for indexes fragmented more than 7 percent.
    SELECT name as indexName
    FROM sys.dm_db_index_physical_stats (DB_ID(DB_Name()), OBJECT_ID(@fetch_TableName), NULL, NULL, NULL) AS a
    JOIN sys.indexes AS b ON a.object_id = b.object_id AND a.index_id = b.index_id
    Where Name is not null and avg_fragmentation_in_percent > 7
    OPEN Cursor_Indexes
    WHILE 1= 1 -- Begin to Loop through all Indexes
    BEGIN
    FETCH NEXT FROM [Cursor_Indexes] INTO @fetch_indexName
    if @@FETCH_STATUS <> 0 break
    Declare @SqL nvarchar(2000) = N'ALTER INDEX ' + @fetch_indexName + ' ON ' + DB_Name() + '.dbo.' + @fetch_TableName + ' Rebuild'
    print @Sql
    Begin TRy
    Execute sp_executeSQL @sql
    End Try
    Begin Catch
    Declare @err nvarchar(2000) = ERROR_MESSAGE();
    throw 51000, @err, 1
    End Catch
    End -- Ends looping through all indexes
    CLOSE [Cursor_Indexes]
    DEALLOCATE [Cursor_Indexes]
    End -- Ends looping through all tables
    CLOSE Cursor_Tables
    DEALLOCATE Cursor_Tables
    foreach (objDB DB in oUserPrefs.DBs) {
    report += DB.Real_Name;
    if (DB.cn == null) DB.cn = sqlCn(DB.Real_Name, SystemInformation.ComputerName);
    try {
    if (DB.cn.State != ConnectionState.Open) DB.cn.Open();
    } catch (Exception ex) {
    report += " - Failed because can't open a connection.\r\n";
    continue;
    DB.OpenedAConnection = true;
    DataTable dt = null;
    try {
    dt = oParam.fillDt("dbo.usp_RebuildIndexes", DB.cn, null);
    } catch (Exception ex) {
    report += " -failed because " + ex.Message + "\r\n\r\n";
    continue;
    report += " - success.\r\n";
    DB.LastTimeRebuiltIndexes = DateTime.Now;

    Your proc is a bit of a mess and hard to read. This should get you what you need though. I added a little logic in the middle that determines if the index should be reorged, or rebuilt.
    You were right that my script was too messy and I used your code/logic to rewrite mine. Thanks! I tried it this morning and it worked fine, but I will have to see how it runs overnight to be sure.
    Here's the weird thing. My original code should have worked. In fact I'm actually using it in 3 c-sharp apps each of which has 3 to 7  Express 2012 databases (about 10 million records per database). For about a month it's been working fine on two of the
    apps. Furthermore this morning I used a commercial file-comparison tool to verify that the 3rd app has been running an identical version of the SP. So I'm at a total loss as to what went wrong in the 3rd app.
    Here's my rewrite.
    Alter Procedure [dbo].[usp_RebuildIndexes]
    As
    Declare @Messages Table(Msg nvarchar(2000))
    Declare @IndexName nvarchar(256), @TableName NVARCHAR(256)
    DECLARE Cursor_Indexes CURSOR FAST_FORWARD FOR -- GEt a list of all indexes for all tables.
    select idxs.name as indexName, o.Name as TableName
    from sys.indexes idxs
    inner join sysobjects o on idxs.object_id = o.id
    inner join sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL,NULL,NULL) as stats
    on stats.object_id = idxs.object_id and stats.index_id = idxs.index_id
    where xtype = 'u' and idxs.name is not null And avg_fragmentation_in_percent > 7
    OPEN Cursor_Indexes
    While 1 = 1
    BEGIN
    FETCH NEXT FROM Cursor_Indexes INTO @IndexName, @TableName
    if @@FETCH_STATUS <> 0 break
    Declare @SqL nvarchar(2000) = N'ALTER INDEX ' + @IndexName + ' ON ' + DB_Name() + '.dbo.' + @TableName + ' Rebuild'
    insert @Messages(Msg)VALUES(@sql)
    Execute sp_executeSQL @sql
    End
    CLOSE [Cursor_Indexes]
    DEALLOCATE [Cursor_Indexes]
    Select * From @Messages

  • Procedure runs in SQL Plus, but not when called from my Oracle Form

    Hi. I have this code to send an email alert as the user updates a record on my base table from my Oracle Form. I use dbms_scheduler so that it's submitted as a background job and so the email processing does not delay my Oracle Form from saving quickly. If I submit this code in SQL Plus it executes and I receive the email as expected.
    begin
    dbms_scheduler.create_job ( 
         job_name            => 'IMMEDIATE_JOB', 
         job_type            => 'PLSQL_BLOCK', 
         job_action          => 'begin TTMS.dropperVacationConflict_Notify (62547, ''01-SEP-11'', ''02-SEP-11''); end;', 
         number_of_arguments => 0, 
         start_date          => sysdate +1/24/59, -- sysdate + 1 minute 
         enabled             => TRUE, 
         auto_drop           => TRUE, 
         comments            => 'Immediate, one-time run');
    end;However if I submit this code from a Post-Update trigger in my form the code runs without error, but my email is never received (the same parameter values would be passed to this trigger):
    begin
    -- Submit the email notification in the background so as to not slow down the screen while saving.   
    dbms_scheduler.create_job ( 
         job_name            => 'IMMEDIATE_JOB', 
         job_type            => 'PLSQL_BLOCK', 
         job_action          => 'begin TTMS.dropperVacationConflict_Notify (:dropper_vacations.dropper_id, :dropper_vacations.begin_dt, :dropper_vacations.end_dt); end;', 
         number_of_arguments => 0, 
         start_date          => sysdate +1/24/59, -- sysdate + 1 minute 
         enabled             => TRUE, 
         auto_drop           => TRUE, 
         comments            => 'Immediate, one-time run');
    end;     Any ideas why this might be happening?

    Wow, so I changed the two procedures so that I'm only passing in one number parameter and one char parameter...
    CREATE OR REPLACE procedure TTMS.job_vacationconflict_notify (p_dropper_id number, p_other char) IS
    CREATE OR REPLACE PROCEDURE TTMS.dropperVacationEmailURL_new (in_dropper_id number, in_other char) ISIf I execute it like this it works and I get the email:
    TTMS.job_vacationconflict_notify(62547, 99999);or like this it works and I get the email:
    TTMS.job_vacationconflict_notify(62547, '99999');But if I execute it like this (I get no errors) the email is not sent:
    TTMS.job_vacationconflict_notify(62547, 'ababa');So this problem really has nothing to do with date formats. It seems to have to do with whether parameter two has characters in it!!! What the heck.
    Any ideas on this?
    Here is the procedure I'm calling:
    CREATE OR REPLACE procedure TTMS.job_vacationconflict_notify (p_dropper_id number, p_other char) IS
    begin
      dbms_scheduler.create_job ( 
         job_name            => 'IMMEDIATE_JOB', 
         job_type            => 'PLSQL_BLOCK', 
         job_action          => 'begin TTMS.dropperVacationemailurl_new ('||p_dropper_id||','||p_other||'); end;', 
         number_of_arguments => 0, 
         start_date          => sysdate +1/24/59, -- sysdate + 1 minute 
         enabled             => TRUE, 
         auto_drop           => TRUE, 
         comments            => 'Immediate, one-time run');
    end;
    /And the above procedure is calling this procedure which should be sending the email alert:
    CREATE OR REPLACE PROCEDURE TTMS.dropperVacationEmailURL_new (in_dropper_id number, in_other char) IS
          myguid varchar2(15):=null;
          pcm_contact varchar2(3):=null;
          guid_contact varchar2(15):=null;
          conflict_cnt number(8):=0;
          -- Various declarations
          PSENDER VARCHAR2(200);            --  From
          PRECIPIENT VARCHAR2(200);         --  To
          P_CC_RECIPIENT VARCHAR2(200);     --  CC
          P_BCC_RECIPIENT VARCHAR2(200);    --  BCC
          PSUBJECT VARCHAR2(200);           --  Subject
          PMESSAGE VARCHAR2(6000);          --  Message Body
          PPARAMETER NUMBER;                --  Parameter Value
          guid_valid varchar2(15);          --  Used to grab the validation value of
          -- Grab name details of e-mail targets
          cursor targets is
          select guid, initcap(first_name) first_name, initcap(first_name)||' '||initcap(last_name) fullname
          from pwc_employee
          where upper(guid) = upper(guid_contact);
    BEGIN
            select count(*)
            into conflict_cnt
            from dropper_bundle_assign
            where
                dropper_sched = in_dropper_id and
                trunc(sched) <> '31-DEC-29' AND        
                trunc(sched) between '01-SEP-11' and '02-SEP-11' and
                trunc(sched) > trunc(sysdate);
            select distinct pcm
            into pcm_contact
            from dropper_bundle_assign
            where
                  dropper_sched = in_dropper_id and
                  trunc(sched) <> '31-DEC-29' AND        
                  trunc(sched) between '01-SEP-11' and '02-SEP-11' and
                  trunc(sched) > trunc(sysdate);
            select guid
            into guid_contact
            from pwc_employee
            where initials = pcm_contact;
        -- Ensure required parameters have been passed
        if guid_contact is not null
           and in_dropper_id is not null then
               Begin
                    select guid
                    into guid_valid
                    from pwc_employee
                    where upper(guid) = upper(guid_contact);
               Exception
                    when no_data_found then
                    raise_application_error(-20000,'Invalid Recipient.  Please check the employee table.  Please try again.');
               End;
               -- In the event there are multiple targets then we will loop thru and send individual emails
               for thisone in targets loop
                    PSENDER := lower(user)||'@us.ibm.com';
                    PRECIPIENT := lower(thisone.guid)||'@us.ibm.com';
                    P_CC_RECIPIENT := lower(thisone.guid)||'@us.ibm.com';
                    P_BCC_RECIPIENT := 'ssbuechl'||'@us.ibm.com';
                    PPARAMETER := TO_NUMBER(lower(in_dropper_id));
                    PSUBJECT := 'TEST: Dropper Vacation '||in_other||' Conflict Notification for dropper '||in_dropper_id||' - Action Required';
                    PMESSAGE := thisone.first_name||'-<br><br>There is an induction conflict due to a new or updated dropper vacation.<br><br>Click here to the dropper''s vacation conflicts: <u><a href="http://9.35.32.205:7777/forms/frmservlet?config=TTMSMENU&form=dropper_vacations&otherparams=p_dropper='||PPARAMETER||'">Dropper Id: '||PPARAMETER||'</a></u> (note: use your Oracle credentials when prompted for log-on information).<br><br>Thanks.';
                    SEND_MAIL ( PSENDER, PRECIPIENT, P_CC_RECIPIENT, P_BCC_RECIPIENT, PSUBJECT, PMESSAGE );  -- Procedure to physically send the e-mail notification
               end loop;
        else
              raise_application_error(-20001,'Recipient and Parameter Value are required. Please try again.');
        end if;
    exception
        when no_data_found then
             raise_application_error(-20002,'Note: Email will not be sent because no PCM was identified as the manager or the PCM does not have a record in the Employee table.  See ITS for assistance.');
         when too_many_rows then
             raise_application_error(-20003,'Note: Email will not be sent because multiple PCMs manage this dropper. Please notify each PCM manually.');
    END dropperVacationEmailURL_new;
    /Edited by: sharpe on Aug 17, 2011 4:38 PM
    Edited by: sharpe on Aug 17, 2011 5:03 PM

Maybe you are looking for

  • ASP Delete File from server

    I have made a file sharing app, and the description and file name are stored in my access db, when i delete the recordset for the file i also want to delete the actual file. i am able to delete the file with the full path entered and the file name as

  • Problem with JTree editing icons

    Hello, I want to edit another icons than the default icons in JTree object. I look in the javadoc at the several methods, but I do not find a method witch can give me the possibility to setup the collapsed and expanded icon. If some one now how to do

  • QT Pro key - Migrating from PB to MBP

    Hello there, I just got a MacBook Pro and transfered (just about everything transferable) from my old PB using the Migration Assistant. I can see that my QT Pro key was transfered over with the migration process that was part of the original configur

  • Integrated Iviews in portal to set in proper way.

    Hi Experts, I integrated URL,webdynpro,Transactional,Bw&BSP iviews into the portal. Here my question is how to set these iviews in a proper way. i mean i need to give first priority to Transactional iview.then webdynpro,BSP,BW and Url iview. I heard

  • Creating a hierarchy in SAP DIR.

    Hello, I want to create a hierarchy for some of our dir. Does it exist a particular transaction for that? In CV02N, the superior hierarchy document area is already fiiled by the number of the document for which I need to declare a superior document.