Heavy calculations in the database.

Is it wise to place heavy calculations in the database?

Lets say, we need to create in-app to calculate a problem heavy matimathical.
In Apex, each code is run in the oracle database. What are the resources used for this calculation?

Java database programming is only used for the extraction of the code. That's what I see in other departments. so I guess the resources of computers (where the java application is installed) are used for calculations.

For heavy, so apex calculations always a good option?

Raoul

Hi Raoul,.

It depends on what you mean by heavy calculations.

As you say, Apex code is executed in the database, most of this is PL/SQL that runs in the server of database resources. for example, memory, processor, etc. IO. PL/SQL is a mature programming language that can be stored in a compiled state, which gives it a factor of performance approaching compiled languages such as C. While it may be true that you can get better performance of well written code compiled like C, overload caused by the first extraction of data to perform the calculations on in the first place often means THAT PL/SQL has an advantage. In other words, more calculations are the data, the better.

I don't know what you mean by "Java database programming is only used for the extraction of the code". The database is used for the storage and retrieval of data. Java is used as a general programming language which has the advantage of running in a variety of environments. Overhead, he pays for it are that it isn't really a compiled language and therefore performed accordingly. Accordingly, it is a good language for the presentation layer, where there need work on a wide variety of customers, but you would not use it as general processing language.

If you condition is to do some heavy math and you use a database to store the raw data for these calculations so I think that you will find the database and internal languages such as SQL and PLSQL will be run and any other environment in General and certainly much better than the Java language.

Concerning
André

Tags: Database

Similar Questions

  • heavy load on the database

    Hi all

    I have a data base (Oracle 10 g 10.2.0.1.0) on HP - UX 11.23 server. Today, I am facing problems with slow server processes. as transactions are high. the server takes a long time to process transactions. and some tables are often locked up.

    When I check the top on the database server, the load is greater than 10 user is 95%, Idle is 0% and the free memory is less. I restart the application. the load is declining, but after awhile, he went.

    How to improve the performance of the database, reducing the load on the server.

    pls help me in this regard.

    DB: Oracle 10g R2 (10.2.0.1.0)
    Operating system: HP - UX v11.23

    Thank you and best regards.

    Check waiting for system events, check for waiting events in sessions where you can identify the problem and then work on that.

    Don't go global for listening without any substantive work system.

  • Calculation of the size of the database.

    Salvation of DBA. Which is exactly the way to calculate the size of the database? Is it calculate the sum of the sizes of the segments or the calculation of the sum of the sizes of the redo logs, data files, control files?

    You please suggest the correct answer

    Thank you

    As usual: depends: do you need to calculate the size allocated on storage, you simply go to the current size of the file dba_data_files bytes column data. If you need the storage used the sum of dba_segments fits better. If you need the size of all files used for the database, you must add the controlfiles, newspapers and db_recovery_file_dest_size files.

  • Heavy binary files must be stored in the database?

    I was asked an interesting question: If a database contains all the data? Or large binary files must be stored in the file system?

    Example of large binary files: videos or PDFs heavy (+ 200 MB).

    With an old aspx web app (1.1) I tried to open a 200 MB pdf file stored as a BLOB in a base of Oracle 11 g and it has run out of memory.

    However, same asp.net web application had no problem to open the same pdf file stored in the file system on a server. It could be that maybe there is some way to open fields heavy blobs with asp.net.

    For reasons of integrity, I say that all data must be stored in the database, but my cases described showed me that maybe it's not the way.

    SQL Server allows the content of the columns of varbinary (max) to be stored on the file system, maybe there is something similar in Oracle?

    With an old aspx web app (1.1) I tried to open a 200 MB pdf file stored as a BLOB in a base of Oracle 11 g and it has run out of memory.

    It could be that maybe there is some way to open fields heavy blobs with asp.net.

    Depends entirely on how to open BLOB.
    A simple way is enter any value in table (like getArray()). It can be risky when there are great values.
    More sophisticated is to read in chunks.
    In environments such as Java or ASP.net programming should be operable methods BLOB as a stream of data. In Java, it is ResultSet.getBinaryStream)
    You can spend this additional flow, for example the browser connection. It will read the BLOB value into small pieces (or 64K) and pass it to the browser or whatever the customer.

  • Calculation of the size of database

    Hello

    I gave a not sure DB of the size but its more than 50 or 100 GB, so how can I check the size of the entire database by using the query.
    I tried these
    "SELECT SUM (BYTES) / 1024/1024 MB" "FROM DBA_SEGMENTS;"
    give me 1 GB

    and
    Select sum (bytes / (1024 * 1024)) 'DB size in MB' from dba_data_files; gave me 1.6 GB then something is wrong.

    can anyone provide me with the exact query to get the full size of a database.

    Thank you

    >
    I have to run all three queries to get the total size of the database?
    >

    Yes, you must include the temporary tablespace and recovery logs and files.

    And you also need to include the archive generated logs that you can get from V$ ARCHIVED_LOG.

  • Calculation of the licenses for Weblogic and SOA Suite

    Hi gurus,

    Being an oracle DBA, I give myself a task to calculate for a weblogic suite and soa oracle licenses. I went through a few docs, but there are many jargon that I didn't understand.

    If someone could please help me get information below

    (1) how the oracle County allows for WEBLOGIC and SOA suite. Does rely on the counts of base as in the case of Enterprise edition?

    (2) how to find information on licenses. Any support notes?

    Kind regards

    Lancerique.

    Hi there Lancerique,

    (1) how the oracle County allows for WEBLOGIC and SOA suite. Does rely on the counts of base as in the case of Enterprise edition?

    Oracle has the licenses of WebLogic Server (Enterprise Edition and Suite) and SOA Suite in the same way they do for EA DB, i.e. using the basic factor and multiplying by the number of cores. I'm sure you're familiar with the hard and soft political partitioning of Oracle (to run the Oracle products in virtualized environment)

    (2) how to find information on licenses. Any support notes?

    As for the database, Oracle provides "Licensing information" contained in the documentation. You can find details about what is included in each of the FMW SKU licensed by Oracle. For the 12.1.3 version, you can find the license here news - Oracle Fusion Middleware Licensing Information Manual® - materials.

    You should consider the development and test environments, if you plan to build their. They must also be licensed.

    And one more Council - as FMW products consist of several components, if you want to run the individual component on different machines (for example, Oracle BAM and Oracle SOA on a machine running on another) must summarize all hearts (in the example for the two machines) that run the prod.

    And when you're done with the counting I recommend contact you the representative office of Oracle you check the calculations.

    Hope this helps,

    A.

  • Unit test: calculation of the length of the different columns in recordsets provided and received led to false a test failure

    Dear team of SQL Developer,

    It seems that the calculation of the length of the column in the expected and received recordsets behaves differently in some cases (when stored proc variables are used in the generation of the REF CURSOR, despite the explicit definition of the type of record): the length of the header and the length of the value in the set of records received are truncated to arbitrary length based on the returned value which leads to a false failure of a unit test. I.e. registries are the same in both sets of records, but the test run fails to the comparison of the recordsets because of different length. Please see the screenshot below:

    Expected_and_Received_RecordSets.jpg

    Here's the test case if you need to reproduce the problem/bug in your environment:

    1. use the default schema of HR of the Oracle examples package that comes with an 11 g database.

    2. change the HR. Table EMPLOYEES with the addition of a new column VARCHAR2 (4000) LONG_LAST_NAME:

    ALTER TABLE HR. EMPLOYEES

    ADD (LONG_LAST_NAME VARCHAR2 (4000));

    Update hr.employees set long_last_name = last_name;

    commit;

    3. create a PKG_TEST2 package with the source code below in the HR schema:

    ----------------------------------------------------------------------------------------------------------------------

    create or replace PACKAGE PKG_TEST2 AS

    TYPE EmployeeInfoRec IS RECORD

    (

    long_last_name employees.long_last_name%TYPE,

    first name employees.first_name%TYPE,

    E-mail employees.email%TYPE

    );

    TYPE EmployeeInfoRecCur IS REF CURSOR RETURN EmployeeInfoRec;

    FUNCTION getEmployeeInfo (p_Emp_Id employees.employee_id%TYPE)

    RETURN EmployeeInfoRecCur;

    END PKG_TEST2;

    ----------------------------------------------------------------------------------------------------------------------

    CREATE OR REPLACE PACKAGE BODY PKG_TEST2 AS

    FUNCTION getEmployeeInfo (p_Emp_Id employees.employee_id%TYPE)

    RETURN EmployeeInfoRecCur AS

    v_EmployeeInfoRecCur EmployeeInfoRecCur;

    v_LongLastName varchar2 (4000);

    BEGIN

    Select long_last_name from v_LongLastName

    employees

    where employee_id = p_Emp_Id;

    --

    OPEN FOR V_EmployeeInfoRecCur

    V_LongLastName SELECT long_last_name,

    first name,

    E-mail

    This_is_very_long_table_alias employees

    WHERE employee_id = p_Emp_Id

    order by 1 CSA;

    --

    RETURN v_EmployeeInfoRecCur;

    EXCEPTION

    WHILE OTHERS THEN

    LIFT;

    END getEmployeeInfo;

    END PKG_TEST2;


    ----------------------------------------------------------------------------------------------------------------------

    4. create a unit test for the PKG_TEST2.getEmployeeInfo stored procedure: (click the command create Test, select the stored procedure, click Ok for the pop-up message, click Next, click Finish).

    5. update the default value of dynamic query of value with the one below and save/post changes.

    Select the cursor)

    SELECT long_last_name,

    first name,

    E-mail

    Employees

    WHERE employee_id = idqry.employee_id

    order of the 1 CAD

    ) RETURNS $,.

    idqry.employee_id as P_EMP_ID

    from (select employee_id

    employees

    where rownum < = 5) idqry

    6. run the unit test newly created in the debug mode to display the shot.

    Thus, the record type 'EmployeeInfoRec' in the package clearly defines the LONG_LAST_NAME as VARCHAR2 (4000) through reference for the data type of column in the referenced table.

    But for some reason, the SQL Developer does not calculate correctly its length in the recordset "Receipts" If a variable is used (could be one as variable simple varchar2 in this reproducible test or complex variable of type of the object).

    Any ideas on that? Looks like another bug...

    Thank you

    Val

    The bug has been reproduced by the SRB and documented within the system of Support of Oracle SQL Developer team to pick it up:

    Bug 19943948 - TEST UNIT RETURNS EXPECTED ERROR: [LONG_LAST_NAME

    Hope the bug name can later be changed to something more descriptive, but it is not really... my only concern is the speed at which the known bugs would be fixed...

    Thank you

    Val

  • Is there a way to make the search of texts in the database?

    I was wondering if there is a way to push the search of texts in the database.

    Specifically, I'm looking for a way to create a DocumentTermMatrix and work on it in the database.

    Company R Oracle provides any type of text mining functions or is there a way to push the standard package R tm is run in the database?

    Thank you

    Mike

    Mike,

    Oracle Enterprise R does not include the extraction of specific text features, but because it can exploit data in extraction of features Oracle database, it may inherit the ability to analyze textual data using the tm or other related packages of NOTCH. We provide examples of use of packages open source R with ore in the Oracle Enterprise of R User Guide and training materials. Here are some links to help you:

    See the section called "Run R calculation in Oracle Database":

    http://docs.Oracle.com/CD/E11882_01/doc.112/e36761/using.htm#OREUG163

    See slide 25:

    http://www.Oracle.com/technetwork/database/options/advanced-analytics/r-Enterprise/ore-trng3-transprncylayer-1501636.PDF

    Any R package used with ore must be installed with the R on the database server and client of R.

    Sherry

  • AppSpeed sees the database, but does not detect application

    Hello

    We test AppSpeed with an application (Web and database).

    We have no problem with the database server, but the web server is still "not mapped" and the application is not detected.

    We are generating traffic, but nothing for several days.

    No idea why?

    Hello

    If the web application is being not mapped, this means that AppSpeed discovered.

    The traffic that you generated is probably not sufficient. I generate heavier traffic and wait a little longer application be detected.

    Thank you

    Zviad Polak

    AppSpeed Support

  • Amount of calculations in the statements of fix

    Greetings, wise!

    Is there a setting that limits this sum? I am not sure of the reason for the problem, but I had for example 8 calculations in the statements of fix, when I tried to run this script has shown me an error after I divided these 8 calculations in two separate statements BUT absolutely equal fix with four calculations in each (because I need all 8 calculations for the same difficulty) and it has worked!

    Could someone a suggestion, what reason could be responsible for this?

    p.s. this all started when we installed a patch
    The version is 11.1.2.0.83

    You can set through EAS - http://docs.oracle.com/cd/E17236_01/epm.1112/eas_help/setcache.html
    Stop/start the database if you make changes in the cache.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • Calculation of the nth value highest in a group

    Hi all

    I was following the problem to be solved. I have a table with the following structure:
    Table emp
    EmpID number
    NAme varchar2
    DeptID number
    Salary number
    Now, to find the maximum salary in each Department, I can use:
    select DeptId,max(salary) from emp group by DeptId;
    Now to find the second salary max, I can do below:
    select DeptId,max(salary) from emp
    where (DeptId,salary) not in (select DeptId,max(salary) salary from emp group by DeptId) group by DeptId;
    But suppose I need to find the 5th or 6th salary max then this method will be heavy.
    I need a SQL query in which I can dynamically pass the parameter to calculate.

    Kindly help.

    Calculation of the nth value highest in a group

    In recent db versions nth_value seems to be the game.

  • With regard to the size of the database

    Hi all

    Sorry for the interruption of you and your time for the clarification.

    The size of my database is:
    Select sum (bytes) / 1024/1024 of dba_data_files;

    SUM (BYTES) / 1024/1024
    --------------------
    19035.0938

    The size used is:
    Select sum (bytes) / 1024/1024 in dba_segments;

    SUM (BYTES) / 1024/1024
    --------------------
    5488.22656
    Free size is:
    Select sum (bytes) / 1024/1024 dba_free_space;
    SUM (BYTES) / 1024/1024
    --------------------
    13890.1016

    When I take plenty of RMAN backup I found the size almost 2304 MB (but in dba_segments his ~ 5488), my doubt is how to remove the higherwatermark (HWM) so that I can get exactly space used by database (excluding higher watermark).

    Thank you in advance,

    The SMALLEST_SIZE_POSS column will be the exact size used in the database.
    The column CURRENT_SIZE is allocated size.

    SET VERIFY OFF
    COL NOM_TABLESPACE FORMAT A20
    COL FILE_NAME FORMAT A60 WORD_WRAPPED
    COL MORE SMALL FORMAT 999 990 TOPIC "SMALLER | SIZE | POSS."
    COL CURRSIZE FORMAT 999 990 HEADING ' CURRENT | SIZE '.
    COL OF SAVING FORMAT 999 990 TOPIC "POSS | SAVINGS. "
    BREAK THE REPORT
    SUM OF CALCULATION OF THE SAVINGS ON THE REPORT
    CALCULATE THE SUM OF THE SMALLEST REPORT
    CALCULATION AMOUNT REPORT CURRSIZE
    VALUE OF COL NEW_VAL BLKSIZE

    VALUE SELECT FROM V$ PARAMETER WHERE NAME = 'db_block_size.
    /

    SELECT A.TABLESPACE_NAME, A.FILE_ID, FILE_NAME,
    CEIL ((NVL(HWM,1) * & BLKSIZE) / 1024/1024) SMALLER.
    CEIL (BLOCKS * & BLKSIZE/1024/1024) CURRSIZE,.
    CEIL (BLOCKS * & BLKSIZE/1024/1024).
    CEIL ((NVL(HWM,1) * & BLKSIZE) / 1024/1024) SAVINGS
    FROM DBA_DATA_FILES,.
    (SELECT FILE_ID, MAX (BLOCK_ID + BLOCKS - 1) LET HIGH WATER
    FROM DBA_EXTENTS
    FILE_ID GROUP) B
    WHERE A.FILE_ID = B.FILE_ID (+)
    /

  • How do we calculate the growth of the database?

    I have the situation where I have to calculate the growth of the database. I'm new to this business. We have implemented new indexes on the database of production where it took freespace all that remains. So, we have increased tablespace because we still have a few clues more to compile. Unfortunately, we ran out of space on the server. I asked for more space on the server that is to say 50% of the current database size. Of course, there are other databases on the same server and management wants to know why I need that a lot of space. Now my question is

    1. How do we calculate the growth of the database?
    2. How do we know how much table space is necessary for the given index.
    3. while maintaining growth increased from DB in calculating how we predict future growth.

    Any help much appreciated. Thank you.

    Hello

    Please visit the following link.

    http://www.DBA-Oracle.com/t_database_growth_reports.htm

    I hope this will help you.

    Thank you

  • The database password

    I want to know how the calcuation goes in the essbase regarding database passes, to make it clearer when we need both passes on the data when we need one?
    I read some where, when we all calc, essbase do all the calculations in one pass?

    I'm new to this forum, I hope that my question are reasonable.

    Thanks in advance.

    Check for calculation in the below one and if necessary to take more questions:
    http://download.Oracle.com/docs/CD/E17236_01/EPM.1112/esb_dbag/dcacaord.html#dcacaord4127

    See you soon...!

  • best practices for the storage of the price of an item in the database?

    In the United Kingdom, we call the sales tax, VAT, which is currently 17.5%

    I store the price exclusive of VAT in the database

    Keep the current VAT rate for the United Kingdom as an application variable (VAT rate is fixed change here to the United Kingdom in January)

    Whenever the site displays the price of an item (including VAT), it takes the price exclusive of VAT and adds the VAT dynamically.

    I have a section in the website called "Personal Shopper" which fortunately will search the goods in a fixed priced at range, for example. a link is less than £20, another is £20 and £ 50

    This means that my search query to perform the calculation of VAT for each item. Is this normal, or is it better to have a database column that stores the prices including VAT?

    I'm also based in the United Kingdom, and that's what we do:

    In our table of products, we record a product price without VAT and an ID of VAT rates, which is attached to the wide at a rate of VAT table. So to calculate the retail price Yes, this is done at the SQL level when querying historical data. To save the net, VAT and gross would be to effectively reproduce the data is so evil. It also means that come January just to update one row in a table and the whole site is fixed.

    However.

    When a person places an order, store us the product id, amount net, tax code, VAT and VAT percentage. This way there is never any question to the evolution of the tax codes in your VAT codes table, because that will affect only direct price being listed on your website. For still more whenever pulling old order data, you have the net amount, VAT percentage of amount and VAT all coded hard in your command line to avoid confusion.

    I saw a LOT of books get confused after that a change of VAT where it recalculates in certain places on a data in real time and other command displays stored data, and there were differences.

    I saw a lot of people have problems with the tax changes before, and database space is so cheap I he stock always just against an order as a point-in-time snapshot.

    O.

Maybe you are looking for

  • Cannot restart after a repair disk Warrior

    I have an iMac 27 "(2010, je pense) running 10.11.2 and a terabyte of hard drive, which is more than half full."  He has been doing progressively slower for some time, so I bought Disk Warrior to rebuild the directory and, hopefully, speed things up.

  • A760 problem with whatsapp and viber

    A760 user here. I can't install whatsapp or viber on google store game. only the fake versions are here. If I go on the official website of whatsapp it says the device is not compatible with whatsapp. also, I can't create a new APN - it goes through

  • iMac 27 vs MBP 13?

    So I have a 2012 mid pro 13 "with i5 Macbook, and I recently upgraded to 8gigs of Ram. What I have noticed is that my graphics unit: Intel HD Graphics 4000 went up to 1536 MB of 1024 MB. What's possible while making the RAM? Also, I have been editing

  • How to install printers ecosys fs-1000 +.

    How to install a printer ecosys fs-1000 +.

  • How to share a folder, but not its subfolder

    HelloI'm using xp pro sp3.I have a network with computers-all 3 have the same workgroup name and no password setting (everything works fine).Now my question is - how do I turn off sharing for a spesific subfolder (not all subfolders) to a user only?T