Oracle/VB question - newbie

Hi,
I've just learned the magic that is getting VB to call stored procedures in Oracle - but now I have a question.
I have a procedure that runs through a table, this is the loop part :
loop
fetch staff_c into surname_str, first_str, salary_str;
exit when staff_c%notfound;
dbms_output.put_line('data ' || surname_str || ', ' || first_str || ' - ' || salary_str);
end loop;
close staff_c;
so my question is simply this, I'm using the following VB code to access a stored procedure which is passing a param in, and a param out -
Dim cmd As ADODB.Command
Dim conn As ADODB.Connection
Dim param As ADODB.Parameter
Set conn = New ADODB.Connection
conn.Open "dsn=PaulsRescueDB", "x", "y"
Set cmd = New ADODB.Command
cmd.ActiveConnection = conn
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "lang_count"
Set param = cmd.CreateParameter("@p_in", adVarChar, adParamInput, 10, "english")
cmd.Parameters.Append param
cmd.Execute
MsgBox cmd.Parameters(1).Value
conn.Close
what do I need to do in order to be able to treat the result of the stored procedure as a recordset - or am I mis-understanding something?
Thanks in advance,
Ed.

Hmm. Your question looks like it should have been posted to the SQL/PLSQL forum, or the Technology-Windows-ODBC forum, but I'll try to answer your question anyway.
If you use the Oracle ODBC driver, your procedure needs to return a ref cursor. If you use the Microsoft ODBC driver, you need to return mutliple arrays and synthesis a record set with some special syntax . . .
http://msdn.microsoft.com/library/en-us/odbc/htm/odbcoraclereturning_array_parameters_from_stored_procedures.asp
If you use the oracle odbc driver, you can use this sample code from metalink . . .
Doc ID: Note:73756.1
Subject: Example: Calling Stored Procedures from ADO and returning a ResultSet (SCR 910)
Type: SCRIPT
Status: PUBLISHED
Content Type: TEXT/PLAIN
Creation Date: 18-AUG-1999
Last Revision Date: 08-DEC-2000
Overview
This article contains a Visual Basic (VB) Program that demonstrates how to
call Oracle Stored Procedures and retrieve resultsets using Ref Cursors with
the 8.0.5.6 Oracle ODBC Driver. This example code is intended for VB
Developers using ADO who wish to call Stored Procedures either inside or
outside of Packages.
Program Notes
The code in this article was tested using the following software:
o Visual Basic Version 6 Service Pack 3 with Microsoft Activex Data
Objects Library Version 2.1
o Microsoft ODBC Driver Manager Version 3.510.3711.0
o Oracle ODBC Driver for Oracle Version 8.0.5.6 and 8.1.5.4
Note: This program does not work with ODBC Driver Version 8.0.5.0
to 8.0.5.5 (BUG:883528) or when connected to a Version 7
Database (BUG:994719).
To use the program:
o Create a standard exe.
o Ensure using Project -> References that you have loaded the
Microsoft ActiveX Data Objects 2.1 Library.
o Add a button named STProc and associate the code below with it.
References
Append and CreateParameter Methods section of MS ADO Help
[BUG:883528] ORACLE ODBC DRIVERS DO NOT WORK WITH MICROSOFT ADO FUNTIONALITY
[BUG:994719] CALLING STORED PROCEDURES WITH REF CURSOR PARAMETERS DOES NOT WORK VS. V 7 DBASE
Caution
The sample program in this article is provided for educational purposes only
and is NOT supported by Oracle Support Services. It has been tested
internally, however, and works as documented. We do not guarantee that it
will work for you, so be sure to test it in your environment before relying
on it.
Program
Private Sub STProc_Click()
' This example code demonstrates calling packaged procedures
' from ADO and also returning result sets from them
' This code was tested using the following software:
' Visual Basic Version 6 Service Pack 3 with
' Microsoft Activex Data Objects Library Version 2.1
' Microsoft ODBC Driver Manager Version 3.510.3711.0
' Oracle ODBC Driver for Oracle Version 8.0.5.6 and 8.1.5.4
' (NOTE: that this does not work with ODBC Driver Version 8.0.5.0
' to 8.0.5.5 (bug 883528)
' or when connected to a Version 7 Database (Bug 994719)
' Error Message:
' Run-Time Error -2147467259(80004005)':
' ORA-6550 - PLS-00306 wrong number or types of argument in call
' to 'GETEMPS' )
' Oracle Database Version 8.0.5.1
' The Command to create the packaged procedure (under the SCOTT schema) is
'create or replace package adotst as
'type empcur is ref cursor;
'procedure getemps(vdeptno in number,vcount out number,ecur out empcur);
'end adotst;
'create or replace package body adotst as
'procedure getemps(vdeptno in number,vcount out number,ecur out empcur) is
'begin
' select count(*) into vcount from emp where
' deptno = vdeptno;
' open ecur for select ename from emp
' where deptno = vdeptno;
'end getemps;
'end adotst;
Dim cnn1 As ADODB.Connection
Dim cmdExeproc As ADODB.Command
Dim prmDeptno As ADODB.Parameter
Dim prmECount As ADODB.Parameter
Dim rstEmps As ADODB.Recordset
Dim intDeptno As Integer
Dim strEname As String
Dim strCnn As String
' Open connection.
Set cnn1 = New ADODB.Connection
' Modify the following line to reflect a DSN within your environment
strCnn = "DSN=W805; UID=scott; PWD=tiger;"
cnn1.Open strCnn
cnn1.CursorLocation = adUseClient
' Open command object with one parameter.
Set cmdExeproc = New ADODB.Command
' Note that this has been tested using
' cmdExeproc.CommandText = "scott.adotst.GetEmps"
' which also works
cmdExeproc.CommandText = "adotst.GetEmps"
cmdExeproc.CommandType = adCmdStoredProc
' Get parameter value and append parameter.
intDeptno = Trim(InputBox("Enter Department:"))
Set prmDeptno = cmdExeproc.CreateParameter("vdeptno", _
adInteger, adParamInput)
Set prmECount = cmdExeproc.CreateParameter("vcount", _
adInteger, adParamOutput)
cmdExeproc.Parameters.Append prmDeptno
prmDeptno.Value = intDeptno
cmdExeproc.Parameters.Append prmECount
' Create recordset by executing the command.
' NOTE: if no resultset is being returned execute the stroed procedure
' using cmdExeproc.Execute on it's own
Set cmdExeproc.ActiveConnection = cnn1
Set rstEmps = cmdExeproc.Execute
' Build stirng to be displayed with information returned
strEname = "The " & prmECount.Value & _
" Employees in Department " & intDeptno & " are :"
Do While Not rstEmps.EOF
strEname = strEname & " " & rstEmps!ename & ","
rstEmps.MoveNext
Loop
MsgBox (strEname)
' Close resultsets and log off
rstEmps.Close
cnn1.Close
End Sub
Copyright (c) 1995,2000 Oracle Corporation. All Rights Reserved. Legal Notices and Terms of Use.

Similar Messages

  • Need oracle practice question for OCA

    Need oracle practice question for OCA.
    Edited by: 823938 on Dec 27, 2010 10:21 PM

    It's illegal to use dumps.
    Read the following link:
    http://www.certguard.com/braindumps.asp

  • Grouping in rtf template like oracle reports - a newbie question

    Hello all
    I am new to BI Publisher and have probablly a silly question to ask.
    I have a basic query that returns a flat xml file which looks something like this. it will have multiple rows.
    <ROWSET>
    <ROW num="1">
    <DATE>01-DEC-2007</DATE>
    <PACKAGE>XXX </PACKAGE>
    <DROP_OFF>Hotel1</DROP_OFF>
    <ROOM>1</ROOM>
    <NAME>Test Customer</NAME>
    <PROBLEM_RECORDED>N</PROBLEM_RECORDED>
    <EXCEPTION>1</EXCEPTION>
    </ROW>
    </ROWSET>
    Because i am fairly new to xml i am at a loss trying to work out how i can form a template that will effectively allow grouping at say
    1. Date Level
    2. Package Level
    3.Drop Off level
    4. put all other data in here
    In reports i would just do groups and alter the layout accordingly. Obviously if i had an oracle report version of the sql that generates the xml then i could just generate the xml from the report and i would get the xml i am looking for .
    But I am working with basic sql not reports and am wondering What do I have to do with my xml to get it looking live the grouping I mention above, given all i have to play with is the example xml I included. I am really bamboozled and think i am missing something simple.
    I dont want to have to write multiple queries with different groupings using cast , multiset as I thought one of the benefits of BI Publisher was one query multiple layouts.
    Thanks
    Lisa

    If you haev word plugin installed,
    please follow the documentation and try using that,
    load the xml in the word plugin
    and then select insert table/form and then you can do the drag and drop,
    and group by each fields.
    http://blogs.oracle.com/xmlpublisher/2006/10/30
    http://blogs.oracle.com/xmlpublisher/2007/10/30

  • Oracle/VB question - same newbie different question.

    Hi,
    I've just learned the magic that is getting VB to call stored procedures in Oracle - but now I have a question.
    I have a procedure that runs through a table, this is the loop part :
    loop
    fetch staff_c into surname_str, first_str, salary_str;
    exit when staff_c%notfound;
    dbms_output.put_line('data ' || surname_str || ', ' || first_str || ' - ' || salary_str);
    end loop;
    close staff_c;
    so my question is simply this, I'm using the following VB code to access a stored procedure which is passing a param in, and a param out -
    Dim cmd As ADODB.Command
    Dim conn As ADODB.Connection
    Dim param As ADODB.Parameter
    Set conn = New ADODB.Connection
    conn.Open "dsn=PaulsRescueDB", "x", "y"
    Set cmd = New ADODB.Command
    cmd.ActiveConnection = conn
    cmd.CommandType = adCmdStoredProc
    cmd.CommandText = "lang_count"
    Set param = cmd.CreateParameter("@p_in", adVarChar, adParamInput, 10, "english")
    cmd.Parameters.Append param
    cmd.Execute
    MsgBox cmd.Parameters(1).Value
    conn.Close
    what do I need to do in order to be able to treat the result of the stored procedure as a recordset - or am I mis-understanding something?
    Thanks in advance,
    Ed.

    Just in case anyone else out there was interested here's a brief summary of the solution.
    First lets look at the stored procedure as this is where the first and most important point is to be seen:
    create or replace package types
    as
    type cursorType is ref cursor;
    end;
    so we're creating a cursor type variable called cursortype, this is then used in the following code:
    create or replace procedure getemps( p_in in varchar, p_cursor in out ref cursor
    as
    begin
    open p_cursor for select surname, firstname
    from staff
    where initcap(p_in) = surname;
    end;
    It should be noted that a cursor is effectively an area of memory specific to your session that stores a result set, the cursor is treated as a variable/object.
    In the case of the above code the cursor contains the result of the select statement.
    You will also notice that the code opens the cursor with the contents of the select (this is because whenever you create an object it is null - unless you give it an initial value).
    The variable P_In is a varchar (when defining a procedure you do not specify the size of an int or varchar) and p_cursor is the returned data.
    I do not know why p_cursor is both in and out, out alone would have been the obvious choice.
    So we now have a stored procedure that takes a parameter to pass to a select statement, does a search and then returns a resultset (cursor).
    Now to answer the original question, how do you use this in VB?
    The code below illustrates (ADO):
    Dim cmd As ADODB.Command
    Dim conn As ADODB.Connection
    Dim param As ADODB.Parameter
    Dim rs As ADODB.Recordset
    Set conn = New ADODB.Connection
    conn.Open "dsn=PaulsRescueDB", "x", "y"
    Set cmd = New ADODB.Command
    cmd.ActiveConnection = conn
    cmd.CommandType = adCmdStoredProc
    cmd.CommandText = "getemps"
    Set param = cmd.CreateParameter("@p_in", adVarChar, adParamInput, 10, "foghorn")
    cmd.Parameters.Append param
    Set rs = cmd.Execute
    While Not rs.EOF
    Debug.Print (rs.Fields(1).Value & " " & rs.Fields(0).Value)
    rs.MoveNext
    Wend
    conn.Close
    As you can see I am manually creating an ADODB object, specifying that the commandtype is a stored procedure and then appending a parameter to the command text.
    You will also notice that although the cursor is the second parameter in the stored procedure I do not specify it directly but rather assign the ADO recordset object as the result of the ADO command execution.
    Once I've done this I merely use the recordset as a normal recordset object.
    CREDITS:
    The stored procedure is based on the one supplied by Jens Link in the previous post.
    The VB is a hijacked piece of ASP code modfied for VB.
    If this helps anyone else out there besides me then I'm happy to have been able to give something back to the community that has helped me.
    Ed.

  • Oracle 10G Express Newbie questions

    Hello everyone! I am completely new to oracle and I was wondering if you guys could answer some of my questions. I installed Oracle 10g Express rpm (oracle-xe-univ-10.2.0.1-1.0.i386.rpm) and Zend for oracle with the assumption that all the environmental variables would be set and everything would be ready. Unfortunately, this was not the case:
    The instructions say to setup the ORACLE_BASE and ORACLE_HOME but I don't know what those need to be. I'm assuming ORACLE_HOME can be any directory and ORACLE_BASE is the path to libraries or executables or something. This is not very clear to me in the instructions. By the way, X windows is not installed on my server so everything I do must be from the shell.
    My question are:
    1) On a standard rpm install of 10g Express, what should the environmental variables ORACLE_BASE & ORACLE_HOME be (installed in /usr/lib/oracle/ ) ?
    2) Assuming that X windows is not installed, what are the best ways to connect to the DB? sqlplus? http://www.test.com:8080/apex? clients?
    3) Can the windows client be used to connect to 10g Express on a linux server?
    [root@localhost javier]# /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/sqlplus
    Error 6 initializing SQL*Plus
    Message file sp1<lang>.msb not found
    SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
    [root@localhost javier]# env
    HOSTNAME=localhost.localdomain
    TERM=xterm
    SHELL=/bin/bash
    HISTSIZE=1000
    OLDPWD=/
    SSH_TTY=/dev/pts/0
    USER=root
    ORACLE_SID=orc1
    ORACLE_BASE=/usr/lib/oracle/xe/app/oracle
    MAIL=/var/spool/mail/root
    PATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0//bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/binINPUTRC=/etc/inputrc
    PWD=/home/javier
    LANG=en_US.UTF-8
    SHLVL=1
    HOME=/root
    LOGNAME=root
    LESSOPEN=|/usr/bin/lesspipe.sh %s
    ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/sqlplus
    G_BROKEN_FILENAMES=1
    _=/bin/env

    The question is more appropriate in the XE forum at Oracle Database Express Edition (XE)
    Hopefully you already registered your copy of XE so you have access to the forum. Otherwise look for the registration link at http://www.oracle.com/technology/products/database/xe/index.html

  • Newbie Oracle Mobile question

    I hope this is the correct forum - my apologies if it is not...
    I am receiving the error "Service unavailable due to content error: Please contact service provider" when trying to view a newly created application (through studio.oraclemobile.com).
    I am assuming that this means that either the xml file is incorrect, or somehow, it can't see the xml file. I am using the following settings:
    Remote URL: http://www.mat-man.com.au/handheld/helloworld.xml
    Contents of helloworld.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <SimpleContainer>
    <SimpleText>
    <SimpleTextItem>Hello World</SimpleTextItem>
    <Action label="Reload" type="SOFT1" task="CALL" target="helloworld.xml"> </Action>
    </SimpleText>
    </SimpleContainer>
    Device simulator: Microsoft Windows. Platform SDK for Pocket PC
    Desktop Pocket PC Emulation (from version 3.0 of the SDK).
    Any help at all is appreciated!!!
    P.S. I can successfully view the example applications provide by oracle.

    You probably could post it on the Application Server-> Wireless forum. Your XML doc looks fine.

  • Downloadable Oracle Exam Questions in PDF

    Now you can download practice questions answers in PDF from beitcertified

    Ah Jozsef,
    I've noticed your location!
    I've kinda copped on to the fact these people you see don't really do oracle, they business is selling certification stuff, and possilby even illegal copyright stuff. Now a Klingon might say this is without honour, but thats how it is.
    Now my opinion is the best way to deal is:-
    1: to press the abuse - spam button
    2: Add a reply to warn newbies and desperados to be aware this MAY be unauthorised training materials that could de-certify them.
    3: Leave the Forum Moderator to mop up and pass on details to OCP Fraud and Legal Beagles if necessary
    Still, let us lighten up! I'd be off to Dromod if I could!
    But I will arise and go now, and go not to Innisfree,
    nor to [Business Brain Training Seminar|http://forums.oracle.com/forums/thread.jspa?threadID=890271&tstart=0] neither,
    but mayhap to Prospect of Whitby to sip the liffey water for preparation of certification of the sun.

  • Multiple Oracle Configuration Question

    We have a typical environment setup. I will explain it below:
    Our application works in Online and Offline Mode. For Online mode we connect to Oracle 10g enterprise server and a Local instance of Access and In offline application totally works in Access.
    Now we want to move away from Access and have Oracle PE instead just because we want to use stored procedure and same set of code for offline and online processing.
    So a typical user machine will have a PE instance and a Oracle Client. Currently we use LDAP.ora for Configuring connections. Now i have few questions
    1. How do we ensure that Oracle PE will work when we don't have network connection. Can we have like PE setup with Tnsnames.ORA
    2. What can be the smallest possible package for PE.
    3. Can I use one client to access both PE and Server databases.
    Any help will be highly appreciated.
    Thanks in advance.

    Assuming the "Xcopy installation" refers to using the Windows xcopy command, can you clarify what, exactly, you are installing via xcopy? Are you just using xcopy to copy the ODP.Net bits? Or are you trying to install the Oracle client via that approach?
    If you are concerned about support, you would generally want to install everything via the Oracle Universal Installer (barring those very occasional components that don't use the OUI). Oracle generally only supports software installed via the installer because particularly on Windows, there are a number of registry entries that need to get created.
    You can certainly do a custom install of the personal edition on the end user machines. There are a few required components that I believe have to be installed (that the installer will take care of). I assume your customization will take the form of a response file to the OUI in order to do a silent install?
    Justin

  • Oracle RAC Question

    Question about oracle rac. lets say we have a 3 node RAC database and our tnsnames.ora file is configured to point to node 1. If an application is connected to the database using the database connection information that is on the tnsnames.ora file (pointing to node1), and node 1 is down, how does the application know to point to node 2 or node 3 to connect to the database?

    If you didn't configure node2 and node3 as failover nodes, only the currently connected sessions would failover by the other nodes.
    New connections are no longer possible.
    Sybrand Bakker
    Senior Oracle DBA
    Oracle is not about rocket science. It is about being able and willing to read documentation.

  • Solaris 10,oracle 10g question- can't connect with non-dba user

    Hi
    I've installed the Oracle10g suite, enterprise edition ( 10.2.0.1). I've created a database called qa10g, which I can connect to as user 'oracle' once I export the ORACLE_SID and the ORACLE_HOME
    export ORACLE_HOME=/oracle/10g2
    export ORACLE_SID=qa10g
    then I type in the following at it puts me into sqlplus:
    $ORACLE_HOME/bin/sqlplus system/system
    so that works fine..now whan I try to log in as another user that isn't a member of the dba group, and I export the ORACLE_HOME and ORACLE_SID variables, I can't get in to the database using $ORACLE_HOME/bin/sqlplus system/system, I get the following errors:
    ERROR:
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    SVR4 Error: 2: No such file or directory
    Enter user-name:
    BUT, when I put the connector string at the end, I can get in:
    $ORACLE_HOME/bin/sqlplus system/system@qa10g
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
    With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engin
    e options
    SQL>
    so obviously, it is an enviromnet variable that isn't getting set properly, perhaps even ORACLE_SID=qa10g isn't working properly for the non-dba user ( in this case, the user is called ctronsys)
    for the work I need to do on this databse, I need to have the user I select to be able to log into the database with sqlplus commands like the ones listed above, without the connector string added at the end..the SID gets exported first..
    any help would be greatly appreciated, I'm a newbie to Oracle!
    thanks!
    Rob

    There is a possibility that you could be hitting bug 4516865....
    Bug 4516865 "WRONG PERMISSIONS AFTER INSTALLATION IN OH AND SUBSEQUENT DIRECTORIES".
    Described in <Note.4516865.8> Bug 4516865 - Wrong permissions after install of 10gR2 (10.2.0.1)
    -Ramesh

  • Connecting to an oracle database questions

    <p>Our current solution to connecting to our oracle database uses the following code:</p><p>    ReportClientDocument clientDoc = new ReportClientDocument;</p><p>    java.sql.ResultSet rs =  fetchResultSet(driverName, connectStr, userName, password, <u>query</u>);</p><p>    clientDoc.getDatabaseController().setDataSource(rs, <u>tableName</u>,tableName+"_ResultSet"); </p><p>The code for subreports is very similar, but isn&#39;t necessary for my question. The problem w/ this approach is we have to define the SQL query and the table name in the JSP, which we shouldn&#39;t have to do considering both of these are stored in the report. Any changes to the reports&#39; sql would then require someone to edit the jsp, which is just bad.  </p><p>I have been reading up on the ConnectionInfo and ConnectionInfos classes (nice naming convention btw) and the CrystalReportViewer.setDataBaseLogonInfos() method, and I believe a solution may lie here. The problem is the tutorials on using the ConnectionInfo class assume the database name is stored in the report, and we do not want to assume this. We are developing our reports to be used by our customers, who may name their database whatever they want so long as the tables inside it are what we specify. Because of this assumption, I have yet to find a good explanation of how to use the setAttributes(PropertyBag) method which is the only I have seen to specify the database name (within a connection string). I have examples of it, but nothing that defines the key/value pairs required in the PropertyBag to create a connection to an oracle database. </p><p>Is there some documentation on the key/value pairs needed by the PropertyBag? Also, if there is another (easier) solution I am overlooking then please let me know, thanks.</p><p>-Sam Morehouse</p><p>HBF Group, Inc </p><p> </p>

    <p>got it working, here&#39;s some sample code.  </p><p> </p><p><%<br />    try{<br />        ReportClientDocument clientDoc = new ReportClientDocument();<br />        clientDoc.open(reportName, 0);<br />    <br />        ConnectionInfos connInfos = new ConnectionInfos();<br />        IConnectionInfo iConnInfo = new ConnectionInfo();<br /><br />        PropertyBag bag = new PropertyBag();<br />        bag.put("Database Class Name",driverName);    // "oracle.jdbc.driver.OracleDriver"<br />        bag.put("Connection URL",connectStr);        // "jdbc:oracle:thin:@dbName:1521:sid"<br />                            <br />        PropertyBag pb = new PropertyBag();<br />        pb.put(PropertyBagHelper.CONNINFO_CRQE_LOGONPROPERTIES ,bag);<br />        pb.put(PropertyBagHelper.CONNINFO_DATABASE_DLL ,"crdb_jdbc.dll");<br />        iConnInfo.setAttributes(bag);<br />        <br />        iConnInfo.setUserName(userName);<br />        iConnInfo.setPassword(password); <br />                <br />        iConnInfo.setAttributes(pb);<br />            <br />        connInfos.add(iConnInfo);<br />        session.setAttribute(reportName, clientDoc);<br />        session.setAttribute("reportSource", clientDoc.getReportSource());<br /><br />        //Setup viewer. Only going to include the relevant line, the rest can be found</p><p>        //elsewhere.<br /></p><p>        CrystalReportViewer oCrystalReportViewer = new CrystalReportViewer();                   oCrystalReportViewer.setDatabaseLogonInfos(connInfos);                                      }    </p><p>catch(ReportSDKExceptionBase exc)%></p>

  • Oracle Multitenant Questions

    Hi,
    I'm studying about Oracle Multitenant and I'm hoping anyone can help me.
    We have a 86 TB database, with no compression and we're struggling to backup this database.
    So, here is what we thought.
    Compress the whole database (since it's only inserted data on the database, no updates at all) on the current version - 11.2.0.3. We're hoping to compress at a ratio of 60%, so, it would be at 36 TB, but still a huge database to backup and recover.
    The next step would be migrate to 12c and setup Oracle Multitenant and divide this database into 5 instances (we can do it, because the database is divided in several mobile technologies). Let's suppose this division is equal, so, it would be around 6 TB each database, so, it would be manageable.
    Questions:
    - Do you think we could benefit using Oracle Multitenant?
    - This would be transparent to the application? No major changes?
    - How the backup would work? Can we backup each plugable database and restore it individually?
    Thanks in advance

    We have a 86 TB database, with no compression and we're struggling to backup this database.
    Ok - so give us information about the DB:
    1. How is it used
    2. Is it partitioned?
    3. How is it being backed up now? Are you doing complete backups or incremental ones?
    We need details - not just a statement that you are 'struggling'.
    Compress the whole database (since it's only inserted data on the database, no updates at all) on the current version - 11.2.0.3. We're hoping to compress at a ratio of 60%, so, it would be at 36 TB, but still a huge database to backup and recover.
    We need details:
    1. How is data being inserted?
    2. One row at a time by multiple users?
    3. Bulk inserts once a day?
    Less data means there is less to backup. But incremental backups don't backup the entire database anyway so we still need to know HOW the DB is being backed up now: how often and what kind of backups.
    You do NOT need to keep backing up old data that has NOT changed. Are you doing that? If so, why?
    The simplest solution to solve a 'database too big to backup' problem is to change the architecture so you don't have to keep backing up data that has NOT changed. Oracle's incremental backups already do that so maybe you are NOT using them.
    The next step would be migrate to 12c and setup Oracle Multitenant and divide this database into 5 instances (we can do it, because the database is divided in several mobile technologies). Let's suppose this division is equal, so, it would be around 6 TB each database, so, it would be manageable.
    I disagree - the NEXT STEP should be to find the cause of your performance issue.
    Based ONLY on what you posted the most likely problem is the types and frequency of the backups you are taking.
    Have you licensed the partitioning option? If so you can just put each of those 'mobile technologies' into its own partition.
    Again - how is data being inserted? If the new data is based on a value (e.g. a date) that distinguishes it from old data you can EASILY just put the newly inserted data into its own new partijtion by using a DAILY partitioned table.
    Then you don't need to backup the old data at all. And each day you would only back up ONE partition for the previous days data.
    That would be be EASIEST and MOST PERFORMANT solution to your problem.
    Questions:
    - Do you think we could benefit using Oracle Multitenant?
    - This would be transparent to the application? No major changes?
    - How the backup would work? Can we backup each plugable database and restore it individually?
    #1 - impossible to say until you provide the DETAILS ask for above about
    1. HOW you are performing the backups now,
    2. HOW often the data changes
    3. HOW the data changes (e.g. new data for today that distiguishes today's data from yesterday's data)
    4. Why you are performing the backups the way you are
    Multitenant isn't going to help if your data loads and architecture are such that you now have FIVE DBs to backup and they all need to be backed-up/restored together
    #2 - No - multitenant is NOT 'transparent'. You will now have FIVE DBs with data in FIVE places. Your current app is written to use ONE DB. The changes could be minor or could be MAJOR.. Querying data across database links is NOT as efficient as querying data that resides on the same server.
    On the other hand if a typical query only queries data from ONE of those five areas then you might get some significant performance improvements.
    But you might get those same improvements simply by properly partitioning the data or using better indexes.
    #3 - yes - you can backup and restore the PDBs individually. They are separate databases. However there is only ONE set of REDO log files. Those redo logs will contain changes from ALL of the PDBs,
    Also there is only ONE SET of memory management to be done. In multitenant memory is managed for the entire multitenant DB.
    There can be a steep learning curve to learn how to do that properly.
    Multitenant is NOT a magic solution for partitioning data - that is what partitioning is for.
    I suggest you find, and fix, you backup/performance/architecture issues with your current DB. If you need help doing that repost your question (and provide the DETAIL needed) in the General DB forum, the SQL and PL./SQL forum or the Backup/Recovery forums as appropriate..
    General Database Discussions
    PL/SQL
    Recovery Manager (RMAN)

  • Oracle 11i questions

    I had a few questions and would appreciate any help
    A.Is there a Document Warehousing feature/module available within the Oracle CRM suite that can link to various documents ( eg word, ppt etc ) for viewing and changing the data?
    B. Is there a link available to data stored in Lotus Notes database and accessible with the CRM application? Also can we relate data in a specific field to Lotus Notes information eg. Employee name to an Org Chart
    C.Is the interest classification with primary and secondary groups that was available in earlier versions still available in 11i to track clients contact preferences, sectors etc?
    D.Capability to integrate with Data from a SQL Server system that would track
    transactions and have a view from the CRM Sales application?
    Thanks you
    null

    A. In CRM Foundation their is a module called MES (Marketing Encyclopedia System) is a storehouse for Marketing collateral. Not all aplications expose this functionality in the UI but it comes with any CRM app anyway. In addition there are various functions for attachmnets scattered through the apps.
    B. No direct link to Notes per se. However, CRM Foundation has various public API's that might be used to load the information into CRM 11i tables.
    C. I think so but not 100% sure.

  • Oracle + Unix question , Error validation for SQL statements in co process

    Hi,
    If I use co process in a shell script , what is the best way to do the error validation of the execution of any sql statements . I was trying to change the following code to make use of co process concept. When I tried echo $? after the execution of a "wrong statements"
    it is still giving Zero output ( meaning success)
    <<<<<<<<<<<<<<<<<<<<<<<<<<<
    cat ${CFG_DIR}/srs_indx.lst | egrep -v '^#' | egrep -v '^[    ]*$' | while read x
    do
    echo " Processing values :: pre $pre tbl $tbl indx $indx tblspc $tblspc cols $cols param $param" >> ${LOGS_DIR}/srs_indx.log
    sqlplus ${BIZSTG} << EOT >> ${LOGS_DIR}/srs_indx.log
    set verify on timing on term on echo on feedback on serveroutput on
    WHENEVER SQLERROR CONTINUE
    drop index $indx;
    WHENEVER SQLERROR EXIT FAILURE
    alter session set query_rewrite_enabled = true;
    create $pre index $indx on $tbl ($cols)
    tablespace $tblspc
    $param;
    exit
    EOT
    RC=$?
    if ( test $RC -ne 0 )
    then
         ERR_MSG="ERROR in creating index $indx for table $tbl from srs_indx.ksh of $ENVIR : $APP by `whoami`@`hostname` on `date` "
         echo $ERR_MSG >> ${LOGS_DIR}/srs_indx.log
         process_warning ${LOGS_DIR}/srs_indx.log
         exitstat=1
    else
         echo "$indx created at `date`" >> ${LOGS_DIR}/srs_indx.log
    fi
    done
    >>>>>>>>>>>>>>>>>>>>
    Any help will be appreciated .
    with thanks and regards
    Ranjeesh K R

    Hi,
    Thanks for the response, I guess people misunderstood my question .
    My question was about "error handling in case of CO PROCESS". For those who don't know about this, in case CO PROCESS you just need to login once to Oracle. In my above code It is logging in & out for each entry in the list. CO process statements may look Similar to SQL statements in pro*C. In PRO*C we use EXEC, but here print -p statements..
    a sample is given for those who are new to co process.
    sqlplus -s /nolog |& # Open a pipe to SQL*Plus
    print -p -- 'connect user/password@instance'
    print -p -- 'set feed off pause off pages 0 head off veri off line 500'
    print -p -- 'set term off time off'
    print -p -- "set sqlprompt ''"
    print -p -- "select sysdate from dual;"
    read -p SYSDATE
    print -p -- "select user from dual;"
    read -p USER
    print -p -- "select global_name from global_name;"
    read -p GLOBAL_NAME
    print -p -- exit
    echo SYSDATE: $SYSDATE
    echo USER: $USER
    echo GLOBAL_NAME: $GLOBAL_NAME
    But I got stuck during error handling of these SQL statements, especially the $? / $* returns 0 even after an erroneus execution.
    Regards

  • Oracle CPU question with 11.5.10 CU2

    Just a general question. First time trying to apply an Oracle CPU and in this case applying the July 2010 CPU to our Test E-biz 11.5.10 CU2 RUP7 install.
    My configuration is RH Linux ES 4.8 with a 10.2.0.4 database server running admin, db and CCM services and then an app server running forms and web services.
    I'm referring to "Oracle E-Business Suite Releases 11i and 12 Critical Patch Update Knowledge Document (July 2010) [ID 986534.1]" and then the subsequent articles that follow that.
    My questions are:
    Q1. My database level is currently 10.2.0.4. It would appear my steps are first update Opatch (no problem there).
    Then apply 9032412.
    Then it looks like I apply either CPU Patch 9655017, or PSU Patch 9654991.
    But PSU 9654991 REQUIRES PRE-REQUISITE 10.2.0.4.4 so I can't apply that right?
    I will apply 9655017 instead and will that get me to 10.2.0.4.5?
    Q2. My configuration is DB Tier with CCM and an app Tier running forms, reports as mentioned.
    Do I have to worry about the Fusion Middle-ware stuff?
    Q3. Patches to apply to E-Business Suite.
    Looks like 9578142 applies to my environment.
    Check the pre-reqs to ensure I have anything that needs to be applied first.
    Then depending on what modules we use or have installed (does it make a difference) I'll apply subsequent patches say for 'Financials'.
    Q3. Anything else I need to consider? We are patching Test first and when done if it's all good we'll schedule Prod.
    I realize this is a pretty generic question. My main uncertainty is on the db 10.2.0.4 patch and if the 965517 will get me to 102045 or not.
    Update - My first patch is giving me the OUI-67620 superset error which I believe is telling me the new patch contains all the fixes from the existing patch so ok to proceed. Right?
    ApplySession adding interim patch '9032412' to inventory
    Verifying the update...
    Inventory check OK: Patch ID 9032412 is registered in Oracle Home inventory with proper meta-data.
    Files check OK: Files from Patch ID 9032412 are present in Oracle Home.
    The local system has been patched and can be restarted.
    The following warnings have occurred during OPatch execution:
    1) OUI-67620:Interim patch 9032412 is a superset of the patch(es) [  6600051 ] in the Oracle Home
    OPatch Session completed with warnings.
    OPatch completed with warnings.
    Edited by: user6445925 on Sep 23, 2010 3:31 PM

    Hi,
    Q1. My database level is currently 10.2.0.4. It would appear my steps are first update Opatch (no problem there).
    Then apply 9032412.
    Then it looks like I apply either CPU Patch 9655017, or PSU Patch 9654991.
    But PSU 9654991 REQUIRES PRE-REQUISITE 10.2.0.4.4 so I can't apply that right?You can apply this patch -- In the download page, select the patch for 10.2.0.4 database.
    I will apply 9655017 instead and will that get me to 10.2.0.4.5?This is a CPU patch and it will not move you to 10.2.0.4.5 -- Apply either PSU or CPU
    Can E-Business Users Apply Database Patch Set Updates?
    http://blogs.oracle.com/stevenChan/2009/08/can_ebs_users_apply_database_patch_set_updates.html
    Q2. My configuration is DB Tier with CCM and an app Tier running forms, reports as mentioned.
    Do I have to worry about the Fusion Middle-ware stuff?If you do not have Fusion installed, skip the part about its patches.
    Q3. Patches to apply to E-Business Suite.
    Looks like 9578142 applies to my environment.
    Check the pre-reqs to ensure I have anything that needs to be applied first.
    Then depending on what modules we use or have installed (does it make a difference) I'll apply subsequent patches say for 'Financials'.
    Q3. Anything else I need to consider? We are patching Test first and when done if it's all good we'll schedule Prod.Make sure you apply the patches in these docs.
    About Oracle Applications Technology 11i.ATG_PF.H.delta.7 (RUP 7) [ID 783600.1]
    Known Issues On Top of 11i.ATG_PF.H.delta.7 (RUP7) - 6241631 [ID 858801.1]
    I realize this is a pretty generic question. My main uncertainty is on the db 10.2.0.4 patch and if the 965517 will get me to 102045 or not.No (already answered above) -- See these docs.
    Oracle Database Patch Set Update 10.2.0.4.5 Known Issues [ID 1089052.1]
    Changes in the PSU 10.2.0.4.5 release for July 2010 [Video] [ID 1162085.1]
    Critical Patch Update July 2010 Patch Availability Document for Oracle Products [ID 1089044.1]
    Update - My first patch is giving me the OUI-67620 superset error which I believe is telling me the new patch contains all the fixes from the existing patch so ok to proceed. Right?
    ApplySession adding interim patch '9032412' to inventory
    Verifying the update...
    Inventory check OK: Patch ID 9032412 is registered in Oracle Home inventory with proper meta-data.
    Files check OK: Files from Patch ID 9032412 are present in Oracle Home.
    The local system has been patched and can be restarted.
    The following warnings have occurred during OPatch execution:
    1) OUI-67620:Interim patch 9032412 is a superset of the patch(es) [  6600051 ] in the Oracle Home
    OPatch Session completed with warnings.
    OPatch completed with warnings.See (WARNING MESSAGE "OUI-67078" and "OUI-67620" FROM OPATCH WHEN APPLYING 10.2.X PATCHES [ID 553244.1]). If opatch complete with code = 0 then you can ignore this warning.
    Thanks,
    Hussein

Maybe you are looking for