Using wallet generated with OPENSSL in Oracle XE

Hi there,
I think this is related to oracle security in general rather than XE, that is why I am posting this here.
I am using Oracle XE 11g on Ubuntu 12.04.2 and I need to send emails from APEX using SSL.
As Oracle XE doesn't have a wallet manager, I manually created a wallet using openssl. All seems to have gone well but when I try to use utl_smtp using SSL I get the cryptic error message ORA-28788: user provided invalid information, or an unknown error.
See below the code I used to create the wallet and the utl_smpt call that is generating the error. Any ideas to fix this?
Thanks
Luis
* Generate wallet in linux shell using openssl *
openssl genrsa -out self.key 2048
openssl req -new -config /usr/lib/ssl/openssl.cnf -key self.key -out self.csr
openssl x509 -req -days 1450 -in self.csr -signkey self.key -out self.crt
cat self.key self.crt > self.pem
openssl pkcs12 -export -in self.pem -out  self.p12 -name self-test
cp self.p12 /u01/app/oracle/ewallet.p12
SQL> declare
  2      l_connection utl_smtp.connection;
  3  begin
  4      l_connection := utl_smtp.open_connection(
  5                          host => 'smtp.gmail.com',
  6                          port => 587,
  7                          wallet_path => 'file:/u01/app/oracle',
  8                          wallet_password => 'password01',
  9                          secure_connection_before_smtp => TRUE);
10      utl_smtp.close_connection(l_connection);
11  end;
12  /
declare
    l_connection utl_smtp.connection;
begin
    l_connection := utl_smtp.open_connection(
                        host => 'smtp.gmail.com',
                        port => 587,
                        wallet_path => 'file:/u01/app/oracle',
                        wallet_password => 'password01',
                        secure_connection_before_smtp => TRUE);
    utl_smtp.close_connection(l_connection);
end;
ORA-28788: user provided invalid information, or an unknown error
ORA-06512: at "SYS.UTL_TCP", line 59
ORA-06512: at "SYS.UTL_TCP", line 284
ORA-06512: at "SYS.UTL_SMTP", line 174
ORA-06512: at "SYS.UTL_SMTP", line 197
ORA-06512: at line 4

Do you still wait for the answer
here is a sample code how it is done.
c := utl_smtp.open_connection(host => v_smtp_host,
port => v_smtp_port ,
wallet_path => 'file:c:\google',
wallet_password => 'wallet_password,
secure_connection_before_smtp => FALSE);
utl_smtp.helo(c, v_smtp_host);
utl_smtp.starttls(c);
UTL_SMTP.AUTH( c => c, username => v_auth_login, password => v_auth_pass,schemes => 'PLAIN' );
it is working for sure.
I am using mail.gmail.com port 587 which supports STARTTLS.
I believe you can use port 465 but then you have to set secure_connection_before_smtp => TRUE and remove the utl_smtp.starttls(c) line, but I didn't test that.
Edited by: user1832618 on May 22, 2013 11:28 AM

Similar Messages

  • SSRS 2008 Using Stored Procedure with SysRef Cursor Oracle

    Hi,
    I am new to SSRS.
    I have a ssrs procedure which runs to Return Result of Select Query. ( In form of SYS REF Cursor in Oracle ).
    When I am trying to see the Value in Test Window. It is showing Output. But when I m Running the Report in the environment it is giving me error.
    Please help me if there is a better way of handling it.
    As I read in some forum as SSRS has issue handling SYS Ref Cursor...
    Thanks
    Priyank
    Thanks Priyank Piyush

    Hi Priyank,
    According to your description, you are use a Stored Procedure from SysRef Cursor Oracle as the report dataset. The query works well in Dataset Query Designer, while an error occurs when you render the report.
    As per my understanding, the problem is that there are something wrong with the report design. Please double-check the design of the report. In order to trouble shoot the problem more efficiently, could you please post the detail error message? Then we can
    make further analysis.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to use insert row with BLOB to Oracle when use connection pool?

    Hi, All,
    I am writing a program to store files (mapped to be a column with BLOB datatype
    in the table) to Oracle database.
    But I always get java.lang.ClassCastException:weblogic.jdbc.rmi.SerialBlob
    Here is my code, please help. Thanks a lot!!
    String sqlNewRow = "insert into documents (id, companyid, updatedate, description,
    document, addby, title) ";
    sqlNewRow += "values (?, ?, TO_DATE(?, 'MM/DD/YY'), ?, EMPTY_BLOB(), ?,
    con.setAutoCommit(false);
    ps = con.prepareStatement(sqlNewRow);
    ps.setInt(1, documentid);
    ps.setInt(2, companyid);
    ps.setString(3, updatedate);
    ps.setString(4, description);
    ps.setString(5, username);
    ps.setString(6, filename);
    ps.executeUpdate();
    ps.close();
    String sqlLockRow = "select document from documents where id = ? for update";
    java.sql.PreparedStatement pst = con.prepareStatement(sqlLockRow);
    pst.setInt(1, documentid);
    java.sql.ResultSet rset = pst.executeQuery();
    rset.next();
    java.sql.Blob dbBlob = rset.getBlob(1);
    out.println("it's=" + dbBlob.getClass());
    OutputStream dbBlobOut = ((weblogic.jdbc.vendor.oracle.OracleThinBlob)dbBlob).getBinaryOutputStream();
    dbBlobOut.write(oneString.getBytes());
    dbBlobOut.close();
    rset.close();
    pst.close();

    Have you defined
    OutputStream dbBlobOut
    as weblogic.jdbc.vendor.oralce.OracleThinBlob?
    Mitesh
    Almond wrote:
    Hi, All,
    I am writing a program to store files (mapped to be a column with BLOB datatype
    in the table) to Oracle database.
    But I always get java.lang.ClassCastException:weblogic.jdbc.rmi.SerialBlob
    Here is my code, please help. Thanks a lot!!
    String sqlNewRow = "insert into documents (id, companyid, updatedate, description,
    document, addby, title) ";
    sqlNewRow += "values (?, ?, TO_DATE(?, 'MM/DD/YY'), ?, EMPTY_BLOB(), ?,
    con.setAutoCommit(false);
    ps = con.prepareStatement(sqlNewRow);
    ps.setInt(1, documentid);
    ps.setInt(2, companyid);
    ps.setString(3, updatedate);
    ps.setString(4, description);
    ps.setString(5, username);
    ps.setString(6, filename);
    ps.executeUpdate();
    ps.close();
    String sqlLockRow = "select document from documents where id = ? for update";
    java.sql.PreparedStatement pst = con.prepareStatement(sqlLockRow);
    pst.setInt(1, documentid);
    java.sql.ResultSet rset = pst.executeQuery();
    rset.next();
    java.sql.Blob dbBlob = rset.getBlob(1);
    out.println("it's=" + dbBlob.getClass());
    OutputStream dbBlobOut = ((weblogic.jdbc.vendor.oracle.OracleThinBlob)dbBlob).getBinaryOutputStream();
    dbBlobOut.write(oneString.getBytes());
    dbBlobOut.close();
    rset.close();
    pst.close();

  • Anyone used PL/FLOW with APEX in Oracle 11g?

    Greetings.
    I'm trying to find out if any of you have successfully used SourceForge's PL/FLOW with APEX in an 11g environment. References to PL/FLOW seem to be limited to 9i and I need to have some assurance that it would be compatible in a more updated setting.
    And do you have any advice on installation and use cases?
    http://plflow.sourceforge.net/
    Thanks very much!
    Chris

    Hi Chris,
    I've used it in a 10g DB without any problems, I have no reason to suspect (without trying it) that it wouldn't work in 11g.
    Did you try it, did you have some problems?
    John
    Blog: http://jes.blogs.shellprompt.net
    Work: http://www.apex-evangelists.com
    Author of Pro Application Express: http://tinyurl.com/3gu7cd
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!

  • Unable to use the with clause in oracle 9.0.2

    Hi,
    I need to use oracle SQL with clause in oracle 9.0.2 database. Its a 9i feature but i am unable to use it.
    It is giving internal error, when i try to execute it.
    Even for simple query:
    WITH acct_summary as ( select TOT_COLL_AMT from tdc_acct)
    select TOT_COLL_AMT from acct_summary WHERE TOT_COLL_AMT>100;
    Error message while using 8.0.5 sql plus client:
    SP2-0642: SQL*Plus internal error state 2091, context 0:0:0
    Unsafe to proceed
    Please help to find out why i am not able to use the sql with clause in oracle 9.0.2 database.
    Thanks and regards,
    Raajkathir

    Hi Jens Petersen,
    Yes, You are correct. Thank you very much.
    Regards,
    Raja

  • Uses for the Action Property with SQL and Oracle DB Adapters

    This thread is a complement to the Wiki Article
    BizTalk: Streamlining WCF SQL and Oracle Messaging-Only and Other Patterns
    The question.  In what circumstances is explicitly setting the Action value with the WCF SQL and Oracle DB bindings useful or beneficial. 
    A complimentary question.  Is it even possible to set the Action value to anything other than exactly what is required by the Message.
    I ask because of three very specific behaviors of the bindings themselves:
    The binding enforces a match between the Action and the Message, therefore...
    There is a one-to-one relationship between the Message and Action, but...
    The binding is able to correctly derive and perform the requested operation with the unspecific CompositeOperation.
    For clarity, I understand how to set the Action. I. understand what the Action represents in the SOAP scheme. I understand how Action can be used as an abstraction for SOAP operations.
    Thoughts?

    Do you have any good suggestion to learn how to use action property with SQL and Oracle DB adapters?  I learn a lot from your replies for years in BizTalk forum. :)

  • Creating Oracle Wallets (pkcs#12 files) with OpenSSL

    I am attempting to create pkcs12 file that will be recoginized by the Oracle Wallet Manager.
    I found a procedure here:
    http://web.metacircles.com/oracle%20wallet%20manager
    but I'm not having much luck with it.
    This is what I have done:
    1. Created a private key with the command:
         openssl genrsa -des3 -out privkey.pem 2048
    2. Used the private key to create a certificate request:
         openssl req -new -key privkey.pem -out cert.csr
    3. Used cert.csr to generate a test site certificate from Thawte (http://www.thawte.com/)
    4. Converted the Thawte ServerCA certificate into PEM format:
         openssl x509 -inform der -in ThawteServerCA.cer -outform pem -out serverCA.pem
    5. Created the pkcs#12 file:
              openssl pkcs12 -export -certfile serverCA.pem -inkey privkey.pem -in sitetest.crt -name "Test Wallet"
              -certpbe PBE-SHA1-RC2-40 -keypbe PBE-SHA1-3 DES -noiter -out ewallet.p12
    However, the Oracle Wallet Manager does not like the resulting pkcs#12 file. I am getting the unhelpful "Invalid Password" error even though I am using the same password I used when I created the private key.
    If anyone has had any success creating an Oracle ewallet with OpenSSL, I would be appreciative to any suggestions they may have.
    Jim

    Which one is it supposed to be? I have both versions installed side-by-side in /usr/lib, the prefix was /usr. Also, I was thinking about openssl installing header files into /usr/include. Aren't they needed to compile this php extension? openssl098 basically installs just the library:
    $ pacaur -Ql openssl098
    openssl098 /usr/
    openssl098 /usr/bin/
    openssl098 /usr/bin/openssl098
    openssl098 /usr/lib/
    openssl098 /usr/lib/libcrypto.so.0.9.8
    openssl098 /usr/lib/libssl.so.0.9.8
    openssl098 /usr/share/
    openssl098 /usr/share/licenses/
    openssl098 /usr/share/licenses/openssl098
    Maybe I should go with compiling openssl from sources after all...
    On a side note
    x33a wrote:In case you do try out an older version, make sure to use one with the heartbleed patch.
    Does it matter? I'm going to use it for development.

  • Using OleDbDataAdapter Update with InsertCommands and getting blocking locks on Oracle table

    The following code snippet shows the use of OleDbDataAdapter with InsertCommands.  This code is producing many inserts on the Oracle table and is now suffering from contention... all on the same table.  How does the OleDbDataAdapter produce
    inserts from a dataset... what characteristics do these inserts inherent in terms of batch behavior... or do they naturally contend for the same resource. 
    oc.Open();
    for (int i = 0; i < xImageId.Count; i++)
    // Create the oracle adapter using a SQL which will not return any actual rows just the structure
    OleDbDataAdapter da =
       new OleDbDataAdapter("SELECT BUSINESS_UNIT, INVOICE, ASSIGNMENT_ID, END_DT, RI_TIMECARD_ID, IMAGE_ID, FILENAME, BARCODE_LABEL_ID, " +
       "DIRECT_INVOICING, EXCLUDE_FLG, DTTM_CREATED, DTTM_MODIFIED, IMAGE_DATA, PROCESS_INSTANCE FROM sysadm.PS_RI_INV_PDF_MERG WHERE 1 = 2", oc);
    // Create a data set
    DataSet ds = new DataSet("documents");
    da.Fill(ds, "documents");
    // Loop through invoices and write to oracle
    string[] sInvoices = invoiceNumber.Split(',');
    foreach (string sInvoice in sInvoices)
        // Create a data set row
        DataRow dr = ds.Tables["documents"].NewRow();
        ... map the data
        // Populate the dataset
        ds.Tables["documents"].Rows.Add(dr);
    // Create the insert command
    string insertCommandText =
        "INSERT /*+ append */ INTO PS_table " +
        "(SEQ_NBR, BUSINESS_UNIT, INVOICE, ASSIGNMENT_ID, END_DT, RI_TIMECARD_ID, IMAGE_ID, FILENAME, BARCODE_LABEL_ID, DIRECT_INVOICING, " +
        "EXCLUDE_FLG, DTTM_CREATED, DTTM_MODIFIED, IMAGE_DATA, PROCESS_INSTANCE) " +
        "VALUES (INV.nextval, :BUSINESS_UNIT, :INVOICE, :ASSIGNMENT_ID, :END_DT, :RI_TIMECARD_ID, :IMAGE_ID, :FILENAME,  " +
        ":BARCODE_LABEL_ID, :DIRECT_INVOICING, :EXCLUDE_FLG, :DTTM_CREATED, :DTTM_MODIFIED, :IMAGE_DATA, :PROCESS_INSTANCE)";
    // Add the insert command to the data adapter
    da.InsertCommand = new OleDbCommand(insertCommandText);
    da.InsertCommand.Connection = oc;
    // Add the params to the insert
    da.InsertCommand.Parameters.Add(":BUSINESS_UNIT", OleDbType.VarChar, 5, "BUSINESS_UNIT");
    da.InsertCommand.Parameters.Add(":INVOICE", OleDbType.VarChar, 22, "INVOICE");
    da.InsertCommand.Parameters.Add(":ASSIGNMENT_ID", OleDbType.VarChar, 15, "ASSIGNMENT_ID");
    da.InsertCommand.Parameters.Add(":END_DT", OleDbType.Date, 0, "END_DT");
    da.InsertCommand.Parameters.Add(":RI_TIMECARD_ID", OleDbType.VarChar, 10, "RI_TIMECARD_ID");
    da.InsertCommand.Parameters.Add(":IMAGE_ID", OleDbType.VarChar, 8, "IMAGE_ID");
    da.InsertCommand.Parameters.Add(":FILENAME", OleDbType.VarChar, 80, "FILENAME");
    da.InsertCommand.Parameters.Add(":BARCODE_LABEL_ID", OleDbType.VarChar, 18, "BARCODE_LABEL_ID");
    da.InsertCommand.Parameters.Add(":DIRECT_INVOICING", OleDbType.VarChar, 1, "DIRECT_INVOICING");
    da.InsertCommand.Parameters.Add(":EXCLUDE_FLG", OleDbType.VarChar, 1, "EXCLUDE_FLG");
    da.InsertCommand.Parameters.Add(":DTTM_CREATED", OleDbType.Date, 0, "DTTM_CREATED");
    da.InsertCommand.Parameters.Add(":DTTM_MODIFIED", OleDbType.Date, 0, "DTTM_MODIFIED");
    da.InsertCommand.Parameters.Add(":IMAGE_DATA", OleDbType.Binary, System.Convert.ToInt32(filedata.Length), "IMAGE_DATA");
    da.InsertCommand.Parameters.Add(":PROCESS_INSTANCE", OleDbType.VarChar, 10, "PROCESS_INSTANCE");
    // Update the table
    da.Update(ds, "documents");

    Here is what Oracle is showing as blocking locks and the SQL that has been identified with each of the SIDS.  Not sure why there is contention.  There are no triggers or joined tables in this piece of code.
    Here is the SQL all of the SIDs below are running:
    INSERT INTO sysadm.PS_RI_INV_PDF_MERG (SEQ_NBR, BUSINESS_UNIT, INVOICE, ASSIGNMENT_ID, END_DT, RI_TIMECARD_ID, IMAGE_ID, FILENAME, BARCODE_LABEL_ID, DIRECT_INVOICING, EXCLUDE_FLG, DTTM_CREATED, DTTM_MODIFIED, IMAGE_DATA, PROCESS_INSTANCE) VALUES (SYSADM.INV_PDF_MERG.nextval,
    :BUSINESS_UNIT, :INVOICE, :ASSIGNMENT_ID, :END_DT, :RI_TIMECARD_ID, :IMAGE_ID, :FILENAME, :BARCODE_LABEL_ID, :DIRECT_INVOICING, :EXCLUDE_FLG, :DTTM_CREATED, :DTTM_MODIFIED, :IMAGE_DATA, :PROCESS_INSTANCE)
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 1150 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 1156 (BTSUSER,biztprdi,BTSNTSvc64.exe) in instance FSLX3
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 6 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX2
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 1726 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX2
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 2016 (BTSUSER,biztprdi,BTSNTSvc64.exe) in instance FSLX2

  • How to configure Oracle 10g Advanced Security to use SSL concurrently with

    How to configure Oracle 10g Advanced Security to use SSL concurrently with database User names and passwords
    In Oracle Advanced Security Documentation it is mentioned that i can use SSL concurrently with DB user names and passwords. But when i configure the client certificate on the client my DB connection is getting authenticated using the certificate, which out passing user id or password.
    We want to connect to Oracle DB over SSL channel so that the data packets are not in clear text. Also we want the user to make a connection using user id and password.
    Basically we want SSL with out authentication.
    Need your expert advice

    Read the documentation (I have given following links assuming you are running a 32 bit architecture)
    Server installations:
    http://www.oracle.com/pls/db102/to_toc?pathname=install.102%2Fb14316%2Ftoc.htm&remark=portal+%28Books%29
    Client installations:
    http://www.oracle.com/pls/db102/to_toc?pathname=install.102%2Fb14312%2Ftoc.htm&remark=portal+%28Books%29
    You can find the required books (if not using 32 bit architecture) from
    http://www.oracle.com/pls/db102/portal.portal_db?selected=3

  • Oracle Data Mining - How to use PREDICTION function with a regression model

    I've been searching this site for Data Mining Q&A specifically related to prediction function and I wasn't able to find something useful on this topic. So I hope that posting it as a new thread will get useful answers for a beginner in oracle data mining.
    So here is my issue with prediction function:
    Given a table with 17 weeks of sales for a given product, I would like to do a forecast to predict the sales for the week 18th.
    For that let's start preparing the necessary objects and data:
    CREATE TABLE T_SALES
    PURCHASE_WEEK DATE,
    WEEK NUMBER,
    SALES NUMBER
    SET DEFINE OFF;
    Insert into T_SALES
    (PURCHASE_WEEK, WEEK, SALES)
    Values
    (TO_DATE('11/27/2010 23:59:59', 'MM/DD/YYYY HH24:MI:SS'), 1, 55488);
    Insert into T_SALES
    (PURCHASE_WEEK, WEEK, SALES)
    Values
    (TO_DATE('12/04/2010 23:59:59', 'MM/DD/YYYY HH24:MI:SS'), 2, 78336);
    Insert into T_SALES
    (PURCHASE_WEEK, WEEK, SALES)
    Values
    (TO_DATE('12/11/2010 23:59:59', 'MM/DD/YYYY HH24:MI:SS'), 3, 77248);
    Insert into T_SALES
    (PURCHASE_WEEK, WEEK, SALES)
    Values
    (TO_DATE('12/18/2010 23:59:59', 'MM/DD/YYYY HH24:MI:SS'), 4, 106624);
    Insert into T_SALES
    (PURCHASE_WEEK, WEEK, SALES)
    Values
    (TO_DATE('12/25/2010 23:59:59', 'MM/DD/YYYY HH24:MI:SS'), 5, 104448);
    Insert into T_SALES
    (PURCHASE_WEEK, WEEK, SALES)
    Values
    (TO_DATE('01/01/2011 23:59:59', 'MM/DD/YYYY HH24:MI:SS'), 6, 90304);
    Insert into T_SALES
    (PURCHASE_WEEK, WEEK, SALES)
    Values
    (TO_DATE('01/08/2011 23:59:59', 'MM/DD/YYYY HH24:MI:SS'), 7, 44608);
    Insert into T_SALES
    (PURCHASE_WEEK, WEEK, SALES)
    Values
    (TO_DATE('01/15/2011 23:59:59', 'MM/DD/YYYY HH24:MI:SS'), 8, 95744);
    Insert into T_SALES
    (PURCHASE_WEEK, WEEK, SALES)
    Values
    (TO_DATE('01/22/2011 23:59:59', 'MM/DD/YYYY HH24:MI:SS'), 9, 129472);
    Insert into T_SALES
    (PURCHASE_WEEK, WEEK, SALES)
    Values
    (TO_DATE('01/29/2011 23:59:59', 'MM/DD/YYYY HH24:MI:SS'), 10, 110976);
    Insert into T_SALES
    (PURCHASE_WEEK, WEEK, SALES)
    Values
    (TO_DATE('02/05/2011 23:59:59', 'MM/DD/YYYY HH24:MI:SS'), 11, 139264);
    Insert into T_SALES
    (PURCHASE_WEEK, WEEK, SALES)
    Values
    (TO_DATE('02/12/2011 23:59:59', 'MM/DD/YYYY HH24:MI:SS'), 12, 87040);
    Insert into T_SALES
    (PURCHASE_WEEK, WEEK, SALES)
    Values
    (TO_DATE('02/19/2011 23:59:59', 'MM/DD/YYYY HH24:MI:SS'), 13, 47872);
    Insert into T_SALES
    (PURCHASE_WEEK, WEEK, SALES)
    Values
    (TO_DATE('02/26/2011 23:59:59', 'MM/DD/YYYY HH24:MI:SS'), 14, 120768);
    Insert into T_SALES
    (PURCHASE_WEEK, WEEK, SALES)
    Values
    (TO_DATE('03/05/2011 23:59:59', 'MM/DD/YYYY HH24:MI:SS'), 15, 98463.65);
    Insert into T_SALES
    (PURCHASE_WEEK, WEEK, SALES)
    Values
    (TO_DATE('03/12/2011 23:59:59', 'MM/DD/YYYY HH24:MI:SS'), 16, 67455.84);
    Insert into T_SALES
    (PURCHASE_WEEK, WEEK, SALES)
    Values
    (TO_DATE('3/19/2011 23:59:59', 'MM/DD/YYYY HH24:MI:SS'), 17, 100095.66);
    COMMIT;
    There are a lot of linear regression models and approaches for sales forecast out on the market, however I will focus on what oracle 11g offers i.e. package SYS.DBMS_DATA_MINING to create a model using regression as mining function and then, once the model is created, to apply prediction function on the model.
    Therefore I'll have to go through few steps:
    i) normalization of data
    CREATE OR REPLACE VIEW t_sales_norm AS
    SELECT week,
    sales,
    (sales - 91423.95)/27238.3693126778 sales_norm
    FROM t_sales;
    whereas the numerical values are the mean and the standard deviation:
    select avg(sales) from t_sales;
    91423.95
    select stddev(sales) from t_sales;
    27238.3693126778
    ii) auto-correlation. For the sake of simplicity, I will safely assume that there is no auto-correlation (no repetitive pattern in sales among the weeks). Therefore to define the lag data I will consider the whole set:
    CREATE OR REPLACE VIEW t_sales_lag AS
    SELECT a.*
    FROM (SELECT week,
    sales,
    LAG(sales_norm, 1) OVER (ORDER BY week) L1,
    LAG(sales_norm, 2) OVER (ORDER BY week) L2,
    LAG(sales_norm, 3) OVER (ORDER BY week) L3,
    LAG(sales_norm, 4) OVER (ORDER BY week) L4,
    LAG(sales_norm, 5) OVER (ORDER BY week) L5,
    LAG(sales_norm, 6) OVER (ORDER BY week) L6,
    LAG(sales_norm, 7) OVER (ORDER BY week) L7,
    LAG(sales_norm, 8) OVER (ORDER BY week) L8,
    LAG(sales_norm, 9) OVER (ORDER BY week) L9,
    LAG(sales_norm, 10) OVER (ORDER BY week) L10,
    LAG(sales_norm, 11) OVER (ORDER BY week) L11,
    LAG(sales_norm, 12) OVER (ORDER BY week) L12,
    LAG(sales_norm, 13) OVER (ORDER BY week) L13,
    LAG(sales_norm, 14) OVER (ORDER BY week) L14,
    LAG(sales_norm, 15) OVER (ORDER BY week) L15,
    LAG(sales_norm, 16) OVER (ORDER BY week) L16,
    LAG(sales_norm, 17) OVER (ORDER BY week) L17
    FROM t_sales_norm) a;
    iii) choosing the training data. Again, I will choose the whole set of 17 weeks, as for this discussion in not relevant how big should be the set of training data.
    CREATE OR REPLACE VIEW t_sales_train AS
    SELECT week, sales,
    L1, L2, L3, L4, L5, L6, L7, L8, L9, L10,
    L11, L12, L13, L14, L15, L16, L17
    FROM t_sales_lag a
    WHERE week >= 1 AND week <= 17;
    iv) build the model
    -- exec SYS.DBMS_DATA_MINING.DROP_MODEL('t_SVM');
    BEGIN
    sys.DBMS_DATA_MINING.CREATE_MODEL( model_name => 't_SVM',
    mining_function => dbms_data_mining.regression,
    data_table_name => 't_sales_train',
    case_id_column_name => 'week',
    target_column_name => 'sales');
    END;
    v) finally, where I am confused is applying the prediction function against this model and making sense of the results.
    On a search on Google I found 2 ways of applying this function to my case.
    One way is the following:
    SELECT week, sales,
    PREDICTION(t_SVM USING
    LAG(sales,1) OVER (ORDER BY week) as l1,
    LAG(sales,2) OVER (ORDER BY week) as l2,
    LAG(sales,3) OVER (ORDER BY week) as l3,
    LAG(sales,4) OVER (ORDER BY week) as l4,
    LAG(sales,5) OVER (ORDER BY week) as l5,
    LAG(sales,6) OVER (ORDER BY week) as l6,
    LAG(sales,7) OVER (ORDER BY week) as l7,
    LAG(sales,8) OVER (ORDER BY week) as l8,
    LAG(sales,9) OVER (ORDER BY week) as l9,
    LAG(sales,10) OVER (ORDER BY week) as l10,
    LAG(sales,11) OVER (ORDER BY week) as l11,
    LAG(sales,12) OVER (ORDER BY week) as l12,
    LAG(sales,13) OVER (ORDER BY week) as l13,
    LAG(sales,14) OVER (ORDER BY week) as l14,
    LAG(sales,15) OVER (ORDER BY week) as l15,
    LAG(sales,16) OVER (ORDER BY week) as l16,
    LAG(sales,17) OVER (ORDER BY week) as l17
    ) pred
    FROM t_sales a;
    WEEK, SALES, PREDICTION
    1, 55488, 68861.084076412
    2, 78336, 104816.995823913
    3, 77248, 104816.995823913
    4, 106624, 104816.995823913
    As you can see for the first row there is a value of 68861.084 and for the rest of 16 values is always one and the same 104816.995.
    Question: where is my week 18 prediction ? or maybe I should say which one is it ?
    Another way of using prediction even more confusing is against the lag table:
    SELECT week, sales,
    PREDICTION(t_svm USING a.*) pred
    FROM t_sales_lag a;
    WEEK, SALES, PREDICTION
    1, 55488, 68861.084076412
    2, 78336, 75512.3642096908
    3, 77248, 85711.5003385927
    4, 106624, 98160.5009687461
    Each row out of 17, its own 'prediction' result.
    Same question: which one is my week 18th prediction ?
    Thank you very much for all help that you can provide on this matter.
    It is as always highly appreciated.
    Serge F.

    Kindly let me know how to give input to predict the values for example script to create model is as follows
    drop table data_4svm
    drop table svm_settings
    begin
    dbms_data_mining.drop_model('MODEL_SVMR1');
    CREATE TABLE data_4svm (
    id NUMBER,
    a NUMBER,
    b NUMBER
    INSERT INTO data_4svm VALUES (1,0,0);
    INSERT INTO data_4svm VALUES (2,1,1);
    INSERT INTO data_4svm VALUES (3,2,4);
    INSERT INTO data_4svm VALUES (4,3,9);
    commit;
    --setting table
    CREATE TABLE svm_settings
    setting_name VARCHAR2(30),
    setting_value VARCHAR2(30)
    --settings
    BEGIN
    INSERT INTO svm_settings (setting_name, setting_value) VALUES
    (dbms_data_mining.algo_name, dbms_data_mining.algo_support_vector_machines);
    INSERT INTO svm_settings (setting_name, setting_value) VALUES
    (dbms_data_mining.svms_kernel_function, dbms_data_mining.svms_linear);
    INSERT INTO svm_settings (setting_name, setting_value) VALUES
    (dbms_data_mining.svms_active_learning, dbms_data_mining.svms_al_enable);
    COMMIT;
    END;
    --create model
    BEGIN
    DBMS_DATA_MINING.CREATE_MODEL(
    model_name => 'Model_SVMR1',
    mining_function => dbms_data_mining.regression,
    data_table_name => 'data_4svm',
    case_id_column_name => 'ID',
    target_column_name => 'B',
    settings_table_name => 'svm_settings');
    END;
    --to show the out put
    select class, attribute_name, attribute_value, coefficient
    from table(dbms_data_mining.get_model_details_svm('MODEL_SVMR1')) a, table(a.attribute_set) b
    order by abs(coefficient) desc
    -- to get predicted values (Q1)
    SELECT PREDICTION(MODEL_SVMR1 USING *
    ) pred
    FROM data_4svm a;
    Here i am not sure how to predict B values . Please suggest the proper usage . Moreover In GUI (.NET windows form ) how user can give input and system can respond using the Q1

  • How to use JAXB generated classes with SOAP

    hello,
    I have a library of JAXB generated classes for my web service. There is a Java class for each web method defined in my schema. For example, my getLocation method is mapped to GetLocation.class.
    However my web service is SOAP based, so I am having to manually strip off the SOAP elements to be able to unmarshall the getLocation xml to a GetLocation class.
    I am noticing a disconnect between JAXB and other Java SOAP and RPC libraries. Does anyone know how to create a JAXB class for SOAP Envelopes and Bodys? Does anyone have any ideas how to incorporate the existing Java web service libraries with JAXB?
    Thanks in advance.

    Have you found a method to integrate SAAJ and JAXB? Or
    is better to use SAAJ only ?If I had to choose I'd go with SAAJ. It seems to me that's theoretically possible to use JAXB classes with SAAJ but I imagine if it is possible it would be a big pain in the ass.

  • Statement closed when using callable statements with oracle xe

    hi all, i've got this problem with oracle express edition 10g. I am using also oc4j v10.1.2.0.2. When working with a normal oracle database it was working fine (i think the code was the same, it's some time since i last tried, but you can see the code is very simple).
    So i just create a callable statement like this:
    CallableStatement cs = con.prepareCall(sentencia.toString(), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE, ResultSet.HOLD_CURSORS_OVER_COMMIT);
    and then when trying to access the statement to register an out parameter like this
    cs.registerOutParameter(1, parámetros[0].getTipo());
    it gives this error:
    java.sql.SQLException: Statement was closed
    It's puzzling me because, as i said before, i think the same code was working ok with a normal oracle database.
    Any idea what can it be?
    cheers

    Ah okay, sorry I've re-read your post.
    I believe you need to create a clob object that encapsulates your xml file.
    I've never done this but I would image it involves creating a class that implements the clob interface and passing an instantiation of this class to the callablestatement.
    Let me know how you get on.

  • Programmatically change the query used to generate Oracle Reports

    I have two queries. Depending on some parameter value, I would like to use one of these queries to generate my report. Is it possible to programmatically change the SQL query used to generate the Oracle Report.
    Thanks

    There are two options:
    - The easy way
    In the report paper layout create two frames, one for each query , and at runtime
    display only one based on your parameters. (using format triggers on the frames)
    - the not so easy way (but more elegant)
    create the query at runtime using xml customizations using the examples from
    the following documentation:
    http://download-
    uk.oracle.com/docs/cd/B14099_17/bi.1012/b14048/pbr_xml.htm#i1006734
    16.3 Creating XML Data Models
    16.4.1.3 Applying an XML Report Definition in PL/SQL
    16.4.1.3.2 Applying an XML Definition Stored in Memory
    Regards and Good Luck
    Ionut S

  • How to use A RowSet with an Oracle sequence

    Hi,
    I created a RowSet with the RowSet wizard and it asked me if I wanted to use database created primary keys. I'm using Oracle so I selected this option and want to use Oracle sequences. But I don't find where should I configure the name of the Oracle sequence. Accordingly I cannot insert through the RowSet.
    Many thanks in advance.
    Nick

    b j t wrote:
    Pancenter wrote:
    That seems kind of strange...
    I have a 10.1" Acer Android tablet that can use a bluetooth and/or USB mouse and keyboard.
    I do realize that Android has "input" ports, the point I am making is that the iPad does not.
    The question the OP asked was:
    Why is there no application to run a mouse on an iPad? I would like to be able to work with Numbers and Pages withouit having to keep touching the screen.
    and I stand by the answer I gave which was:
    There is NO way to use a mouse with the iPad, you will have to either use your finger or a stylus to navigate around the screen.
    You may have to stand down. Youtube is swarmed with instructional video's about how to use Mouse (and keyboard) with an iPad. So there is a way. I don't understand why you insist on something when it clearly and easy Googly discoverably is not true.

  • Create feature for generate new collection having separate content database by using custom coding with C#

    Hi all My self ArunDarly .Iam using share point 2010 ,I want below task solve by  using custom coding with
    C#
    I have one task that create new site collection having separate content database. and that content database site collection limit  should be only one  (it must contain one site collection and note more than one  )
    This total functionality should happen when I am saving one list item (dynamically generate new site collection ) 
    If any body know this Please give me your guidance  
    Thanking  You,
    Arun Darly

    Hey Arun,
    I have done the same job. Hope this code will help you.
    using (SPSite siteCollectionOuter = new SPSite("Any SC url in which u want to create site."))
    SPWebApplication webApp = siteCollectionOuter.WebApplication;
    SPSiteCollection siteCollection = webApp.Sites;
    SPContentDatabase contentDatabase =
    siteCollection.WebApplication.ContentDatabases.Add(ServerName, New Database Name, Admin Name,
    "Admin Password",25,50, 0);
    //Above line will create new content DB
    contentDatabase.Update();
    siteCollection.WebApplication.Update();
    SPSite newSite = contentDatabase.Sites.Add("New SC Url", "SC Title", SC Desctipyion, 1033,
    15, "STS#0", "SC Admin", "Admin", "admin password",
    "User 2", "User NAme", "Password");
    //Ablove line will create new SC in to the Content DB
    //add the upper limit for the site collection
    SPQuota quota;
    quota = new SPQuota {StorageMaximumLevel = 2510220};
    newSite.Quota = quota;
    // And update the site collection and the content database
    newSite.RootWeb.Update();
    contentDatabase.Update();

Maybe you are looking for

  • Java wont open .class file

    ok i just started at this and found this web site http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html#1 i copyed exactly what he says to copy: * The HelloWorldApp class implements an application that * displays "Hello World!" to th

  • Time Machine or third party???

    I have just started backing up and I am using Time Machine to back up 60 gigs to a 500 gig external HD through USB 1 cable. Time Machine is incredibly slow. Is it because the program is slow or is it a hardware issue? In other words, should I be stay

  • Getting the remote layer working with a Tascam DM3200?

    After talking with a very helpful Apple tech, it seems my Tascam DM3200's emulation of a Mackie Control in Logic Pro 9.1.7 was the source of the weird "unresponsive transport" problem on my system (I'm not saying that this is the source of EVERY vers

  • Importing java class in to xml

    is there any way to import a java class into an xml file.suppose if I have a class containing all static constants .Anfd if I want this constant vlaues in xml how to do that

  • Package command line app with AIR app

    Forgive me if I seem completely dense, but I've been googling and forum finding and hair pulling all day on this. I wrote a command line application and I call it from my air application.  It all works just fine, but right now the location of the com