Recordcount for all the tables in my user

How I will get recordcount for all the tables in my user
with a single query??
Plz help.
Thanx in advance.

Not possible. As there can be any number of tables with any names, this requires dynamic SQL.
SQL given to the Oracle SQL Engine cannot be dynamic ito scope and references - it must be static. For example, one cannot do this:
SELECT count(*) FROM :table
For the SQL Engine to parse the SQL, determine if it is valid, determine the scope and security, determine an execution plan, it needs to know the actual object names. Objects like tables and columns and functions cannot be variable.
You will therefore need to write a user function (in PL/SQL) that dynamically creates a [SELECT COUNT] SQL for a table, execute that SQL and return the row count - and then use SQL to iterate through USER_TABLES for example and sum the results of this function.
Note that object tables are not listed in USER_TABLES - thus a more comprehensive list of all table objects in your schema can be found in USER_OBJECTS.

Similar Messages

  • How to generate test data for all the tables in oracle

    I am planning to use plsql to generate the test data in all the tables in schema, schema name is given as input parameters, min records in master table, min records in child table. data should be consistent in the columns which are used for constraints i.e. using same column value..
    planning to implement something like
    execute sp_schema_data_gen (schemaname, minrecinmstrtbl, minrecsforchildtable);
    schemaname = owner,
    minrecinmstrtbl= minimum records to insert into each parent table,
    minrecsforchildtable = minimum records to enter into each child table of a each master table;
    all_tables where owner= schemaname;
    all_tab_columns and all_constrains - where owner =schemaname;
    using dbms_random pkg.
    is anyone have better idea to do this.. is this functionality already there in oracle db?

    Ah, damorgan, data, test data, metadata and table-driven processes. Love the stuff!
    There are two approaches you can take with this. I'll mention both and then ask which
    one you think you would find most useful for your requirements.
    One approach I would call the generic bottom-up approach which is the one I think you
    are referring to.
    This system is a generic test data generator. It isn't designed to generate data for any
    particular existing table or application but is the general case solution.
    Building on damorgan's advice define the basic hierarchy: table collection, tables, data; so start at the data level.
    1. Identify/document the data types that you need to support. Start small (NUMBER, VARCHAR2, DATE) and add as you go along
    2. For each data type identify the functionality and attributes that you need. For instance for VARCHAR2
    a. min length - the minimum length to generate
    b. max length - the maximum length
    c. prefix - a prefix for the generated data; e.g. for an address field you might want a 'add1' prefix
    d. suffix - a suffix for the generated data; see prefix
    e. whether to generate NULLs
    3. For NUMBER you will probably want at least precision and scale but might want minimum and maximum values or even min/max precision,
    min/max scale.
    4. store the attribute combinations in Oracle tables
    5. build functionality for each data type that can create the range and type of data that you need. These functions should take parameters that can be used to control the attributes and the amount of data generated.
    6. At the table level you will need business rules that control how the different columns of the table relate to each other. For example, for ADDRESS information your business rule might be that ADDRESS1, CITY, STATE, ZIP are required and ADDRESS2 is optional.
    7. Add table-level processes, driven by the saved metadata, that can generate data at the record level by leveraging the data type functionality you have built previously.
    8. Then add the metadata, business rules and functionality to control the TABLE-TO-TABLE relationships; that is, the data model. You need the same DETPNO values in the SCOTT.EMP table that exist in the SCOTT.DEPT table.
    The second approach I have used more often. I would it call the top-down approach and I use
    it when test data is needed for an existing system. The main use case here is to avoid
    having to copy production data to QA, TEST or DEV environments.
    QA people want to test with data that they are familiar with: names, companies, code values.
    I've found they aren't often fond of random character strings for names of things.
    The second approach I use for mature systems where there is already plenty of data to choose from.
    It involves selecting subsets of data from each of the existing tables and saving that data in a
    set of test tables. This data can then be used for regression testing and for automated unit testing of
    existing functionality and functionality that is being developed.
    QA can use data they are already familiar with and can test the application (GUI?) interface on that
    data to see if they get the expected changes.
    For each table to be tested (e.g. DEPT) I create two test system tables. A BEFORE table and an EXPECTED table.
    1. DEPT_TEST_BEFORE
         This table has all EMP table columns and a TEST_CASE column.
         It holds EMP-image rows for each test case that show the row as it should look BEFORE the
         test for that test case is performed.
         CREATE TABLE DEPT_TEST_BEFORE
         TESTCASE NUMBER,
         DEPTNO NUMBER(2),
         DNAME VARCHAR2(14 BYTE),
         LOC VARCHAR2(13 BYTE)
    2. DEPT_TEST_EXPECTED
         This table also has all EMP table columns and a TEST_CASE column.
         It holds EMP-image rows for each test case that show the row as it should look AFTER the
         test for that test case is performed.
    Each of these tables are a mirror image of the actual application table with one new column
    added that contains a value representing the TESTCASE_NUMBER.
    To create test case #3 identify or create the DEPT records you want to use for test case #3.
    Insert these records into DEPT_TEST_BEFORE:
         INSERT INTO DEPT_TEST_BEFORE
         SELECT 3, D.* FROM DEPT D where DEPNO = 20
    Insert records for test case #3 into DEPT_TEST_EXPECTED that show the rows as they should
    look after test #3 is run. For example, if test #3 creates one new record add all the
    records fro the BEFORE data set and add a new one for the new record.
    When you want to run TESTCASE_ONE the process is basically (ignore for this illustration that
    there is a foreign key betwee DEPT and EMP):
    1. delete the records from SCOTT.DEPT that correspond to test case #3 DEPT records.
              DELETE FROM DEPT
              WHERE DEPTNO IN (SELECT DEPTNO FROM DEPT_TEST_BEFORE WHERE TESTCASE = 3);
    2. insert the test data set records for SCOTT.DEPT for test case #3.
              INSERT INTO DEPT
              SELECT DEPTNO, DNAME, LOC FROM DEPT_TEST_BEFORE WHERE TESTCASE = 3;
    3 perform the test.
    4. compare the actual results with the expected results.
         This is done by a function that compares the records in DEPT with the records
         in DEPT_TEST_EXPECTED for test #3.
         I usually store these results in yet another table or just report them out.
    5. Report out the differences.
    This second approach uses data the users (QA) are already familiar with, is scaleable and
    is easy to add new data that meets business requirements.
    It is also easy to automatically generate the necessary tables and test setup/breakdown
    using a table-driven metadata approach. Adding a new test table is as easy as calling
    a stored procedure; the procedure can generate the DDL or create the actual tables needed
    for the BEFORE and AFTER snapshots.
    The main disadvantage is that existing data will almost never cover the corner cases.
    But you can add data for these. By corner cases I mean data that defines the limits
    for a data type: a VARCHAR2(30) name field should have at least one test record that
    has a name that is 30 characters long.
    Which of these approaches makes the most sense for you?

  • For All The ATI Radeon9600 Pro users only.

    If you are an owner of a built by ATI Radeon 9600pro card then you should take some interest in this post.  
    Some of you may know of the modifications you can do to the Radeon 9500 non-pro and turning it into a 9700 Pro.  By installing the bios of a 9700 into the bios of a 9500 you will fool the computer into making it run as a 9700 pro.  The idea was that the board layout and GPU core of the 9500 and 9700 were identical to each other that the only deference was the bios.  Same micron cores, but only the 9500 was underclocked via the bios.  The quality control team at ATI would test the GPU cores for 9700 performance standards and the ones that fell slightly short were used on some OEM 9500 boards.  So doing the bios mod one would achieve, in most cases, 9700 results.  A voltage mod would remedy any GPU that couldn't handle the load.
    ATI caught wind of this and soon introduced the 9600 and 9800 Radeon series.  How ever, you can still modify the 9600 to a lesser degree.  On the Built By ATI 9600 pro cards, you will notice a template for a FDD power connector.  You can attach an FDD connector to it and will achieve higher overclocking on this card.  The reason is simple, more power to the ram and GPU, the more MHz it can handle.  The default speeds of the 9600 pro are 400GPU/300RAM.  Most boards are reaching 500/345 with out the FDD mod.  With the FDD mod you can expect a minimum of 10%, but most results are higher.  The 9600 Pro uses a smaller micron core then anything out today, so there is a lot of headroom for overclocking with heat being less of an issue.  If you are brave enough to try it, I'm sure you will be impressed with your efforts.  I will post my benchtests after I deal with my MOBO issues.
    P.S.  The FDD mod will only work on the revision 1 Built By ATI Radeon 9600 Pro.  These are better also because they use 2.8ns ram as compared to 3.3ns on rev. 2's.

    I'm going crazy!!!
    I'm not sure if the problem is the graphics card which is the one mentioned.
    Because my computer's performance is slower than ever:
    * When I restart it takes quite a while to open any aplication.
    * Video freezes during playback (playback doesn't stop, but the image does)
    * Rendering with Final Cut, Photoshop and Maya is way slower than my old Pc's.
    Even when all system software is up to date nothing fixes this problems.
    I tried a couple of times reinstalling the hole system but those problems remain intact.
    Does anybody knows if this could be fixed with an specific codec or with a different graphic card????
    Has some of this issues happened to you????

  • Getting control totals for all the objects

    Hi All,
    1. I want to get the control totals for all the tables along with table names in Oracle
    the below I google and found, but I am not aware of xml in Oracle, I tested this on small scott db it works fine
    select
    table_name,
    to_number(
    extractvalue(
    xmltype(
    dbms_xmlgen.getxml('select count(*) c from '||table_name)
    ),'/ROWSET/ROW/C')) count
    from user_tables order by 1is the above query correct?
    2. I want all the view name
    This I can get it from user_views ( but I want for entire database excluding system views and only user created views)
    select view_name from user_objects3. I want all the sporc name( including the ones in the package and stand alone)
    I am not sure how to get this.

    Be aware of the statement "Some columns in these views contain statistics that are generated by the DBMS_STATS package or ANALYZE statement."
    See this page specially "Columns marked with an asterisk (*) are populated only if you collect statistics on the table with the ANALYZE statement or the DBMS_STATS package."
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10820/statviews_2117.htm#REFRN20286
    If your statistic is not updated, it can give you totally wrong impression.

  • How can I make all the Tables in my spreadsheet to work as one?

    I made a spreadsheet for work in Numbers '09 but do to the computers that we have at work, I have to have it exported to Windows Excel, but when I try to export the spreadsheet since I used more than 1 table to create this spreadsheet, each table is converted to an Excel worksheet, and all other objects are placed on separate worksheets since there's more than one table. and I want to know is there anything I can do, to export everything in one spreadsheet, for all the tables to work as one spreadsheet. PLEASE HELP!!

    You may be able to easily consolidate all your tables into one big table to make it equivalent to an Excel worksheet. You can copy/paste from one table to another and you can drag columns or rows from one table and insert them into another. Note that formulas that use column letters or row numbers instead of specific ranges (i.e., B instead of B2:B10) will now refer to the entire column/row in the destination table.
    Without doing this, all the tables, when exported to Excel into separate worksheets, should still work together just like they did in Numbers. Are you saying that they do not?
    Not much you can do about objects.

  • Select data from all the table names in the view

    Hi,
    "I have some tables with names T_SRI_MMYYYY in my database.
    I created a view ,Say "Summary_View" for all the table names
    with "T_SRI_%".
    Now i want to select data from all the tables in the view
    Summary_View.
    How can i do that ? Please throw some light on the same?
    Thanks and Regards
    Srinivas Chebolu

    Srinivas,
    There are a couple of things that I am unsure of here.
    Firstly, does your view definition say something like ...
    Select ...
    From "T_SRI_%"
    If so, it is not valid. Oracle won't allow this.
    The second thing is that your naming convention for the
    tables suggests to me that each table is the same except
    that they store data for different time periods. This would be
    a very bad design methodology. You should have a single
    table with an extra column to state what period is referred to,
    although you can partition it into segments for each period if
    appropriate.
    Apologies if i am misinterpreting your question, but perhaps
    you could post your view definition and table definitions
    here.

  • How to write select query for all the user tables in database

    Can any one tell me how to select the columns from all the user tables in a database
    Here I had 3columns as input...
    1.phone no
    2.memberid
    3.sub no.
    I have to select call time,record,agn from all the tables in a database...all database tables have the same column names but some may have additional columns..
    Eg: select call time, record,agn from ah_t_table where phone no= 6186759765,memberid=j34563298
    Query has to execute not only for this table but for all user tables in the database..all tables will start with ah_t
    I am trying for this query since 30days...
    Help me please....any kind of help is appreciated.....

    Hi,
    user13113704 wrote:
    ... i need to include the symbol (') for the numbers(values) to get selected..
    eg: phone no= '6284056879'To include a single-quote in a string literal, use 2 or them in a row, as shown below.
    Starting in Oracle 10, you can also use Q-notation:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/sql_elements003.htm#i42617
    ...and also can you tell me how to execute the output of this script. What front end are you using? If it's SQL*Plus, then you can SPOOL the query to a file, and then execute that file, like this:
    -- Suppress SQL*Plus features that interfere with raw output
    SET     FEEDBACK     OFF
    SET     PAGESIZE     0
    -- Run preliminary query to generate main query
    SPOOL     c:\my_sql_dir\all_ah_t.sql
    SELECT       'select call time, record, agn from '
    ||       owner
    ||       '.'
    ||       table_name
    ||       ' where phone_no = ''6186759765'' and memberid = j34563298'
    ||       CASE
               WHEN ROW_NUMBER () OVER ( ORDER BY  owner          DESC
                              ,        table_name      DESC
                              ) = 1
               THEN  ';'
               ELSE  ' UNION ALL'
           END     AS txt
    FROM       all_tables
    WHERE       SUBSTR (table_name, 1, 4)     = 'AH_T'
    ORDER BY  owner
    ,       table_name
    SPOOL     OFF
    -- Restore SQL*Plus features that interfere with raw output (if desired)
    SET     FEEDBACK     ON
    SET     PAGESIZE     50
    -- Run main query:
    @c:\my_sql_dir\all_ah_t.sql
    so that i form a temporary view for this script as a table(or store the result in a temp table) and my problem will be solved..Sorry, I don't understand. What is a "temporary view"?

  • How to move all the tables from one tablespace to other for a whole schema

    Hi,
    Is there any way to move all the tables in a schema from one tablespace to other?
    If so please help me out to do that.
    Thanks
    Regards
    Gatha

    hi,
    here is the steps to move SCOTT's objects from their current tablespace to a NEW_TABLESPACE
    would be:
    1) do an export of all of scott's objects. Make sure no one modifies them after you
    begin this process. You will lose these changes if they do.
    $ exp userid=scott/tiger owner=scott
    2) you would drop all of scotts tables. This will get the indexes as well. I don't
    suggest dropping the user SCOTT but rather dropping scott's objects. Dropping scott
    would cause any system priveleges SCOTT has to disappear and the import would not restore
    them. This script can be used to drop someones tables:
    set heading off
    set feedback off
    set verify off
    set echo off
    spool tmp.sql
    select 'drop table &1..' || table_name || ' cascade constraints;'
    from dba_tables
    where owner = upper('&1')
    spool off
    @tmp.sql
    3) You would modify the user to not have unlimited tablespace (else the IMP will just
    put the objects right back into the tablespace they came from) and then give them
    unlimited quota's on the new tablespace you want the objects to go into and on their
    temporary tablespace (for the sorts the index creates will do)
    alter user SCOTT default tablespace NEW_TABLESPACE
    revoke unlimited tablespace from SCOTT
    alter user SCOTT quota unlimited on NEW_TABLESPACE
    alter user SCOTT quota unlimited on SCOTTS_TEMPORARY_TABLESPACE
    4) you will IMP the data back in for that user. IMP will rewrite the create statements
    to use the users default tablespace when it discovers that it cannot create the objects
    in their original tablespace. Please make sure to review the file imp.log after you do
    this for any and all errors after you import.
    imp userid=scott/tiger full=y ignore=y log=imp.log
    5) you can optionally restore 'unlimited tablespace' to this user (or not). If you do
    not, this user can only create objects in this new tablespace and temp (which in itself
    is not a bad thing)...
    Regards,
    Mohd Mehraj Hussain
    http://mehrajdba.wordpress.com

  • What are all the tables used for this report:

    hi
    what are all the tables used for this report:
    report:
    •     <b>Stock Report, which will give opening balance, receipt, issue, and closing balance for any given Duration for any material.</b>
    thanks in advance

    Tables: MSEG, MKPF, MARD.
    FOR REFERENCE SEE TRANSACTION : MB5B.
    Message was edited by: Sharath kumar R

  • How to find all the tables associated for a particular transaction

    Hi-
    May I know how to find all the tables, related(foreign key) tables for a transaction within SAP GUI?
    Up to my technical knowledge, this can be achieved by looking database diagrams from DB level. But that would be for entire database as a whole. What I'm expecting is to see transaction level relative tables that too from SAP GUI. Please share the possibilities if any.
    Regards
    Sekhar

    Dear Micky Oestreich
    May be we possess expertise or high level experience, it should not show up in our way of communication. Every professional starts with the basic stuff to learn. When the question is raised in such minimum polite way, the same level of courtesy is expected in return. If you felt my question was basic, you might have refused it gently. If you are in good mood or bad mood it doesn't matters.
    Hi Vengal Rao
    Thanks for your response. It helped me.
    Regards
    Sekhar

  • How to set up same timezone in BI Publisher for all the USERS?

    Hi Experts,
    My OBIEE version is 11.1.1.6.6  and any user can go into the My Account and then preferences  and set the timezone.
    But as an admin, i see they are too many users and wanted to setup common timezone for all of them.
    How do i setup common timezone in BI Publisher for all the users?
    Thanks
    Ashish

    Check
    Time Zone Specification from http://docs.oracle.com/cd/E12844_01/doc/bip.1013/e12187/T421739T481157.htm#4535403
    just in case https://blogs.oracle.com/xmlpublisher/entry/how_to_keep_your_dates_from_go

  • Rectifications of different sizes for all the three table lines in footer.

    Hi friendz,
                    i am working in ecc6 system(smartforms).
                    i am using 3 table lines in the footer one for total, the second one for tax calculation, and the third one for the grand total.
    But in the output screen display - the total, tax and grand total(in different table lines) are displayed with different heights, which gives unprofessional look for the form.
    i want all the table lines in the footer to display with equal heights.

    Hi,
    first you create LTYPE follow below sequence
    Go table tab--> details tab--->give suitable heights for ltype
    next go to FOOTER in the main window
    create three table lines under footer like
    FOOTER1
    FOOTER2
    FOOTER3
    for three table lines we need to assign line type LTYPE
    Go FOOTER1 ---> output options -
    > give LTYPE.
         FOOTER2 ---> output options -
    > give LTYPE.
         FOOTER3 ---> output options -
    > give LTYPE.
    reward points if helpful.
    Regards,
    Bhupal.
    Edited by: bhupal reddy on Jul 22, 2008 11:55 AM

  • Resolve installed Flash player not excuted for all the Vista users on my PC?

    I have a Windows Vista 32-bits system.
    I have created 2 admin and 2 standard users.
    Internet Explorer 9 (IE9) 32 bit is installed but also Chrome and Firfox are used.
    For 1 admin user Flash works fine when accessing a site in IE9 that requires Flash.
    For the other users, including the admin user, IE9 must be run "as adminstrator" by specifically choosing that option.
    If not run "as administrator" IE9 states that Flash needs to be installed. That either leeds to Flash player not being installed (error is that it is already installed) or that after a succesful installation the problem simply occurs again (and again and again ...)
    I want the standard users on the pc to be able to navigate to trusted sites without running IE9 in "as adminstrator" mode.
    What do I need to do?
    Can I set Adobe Flash player to be available for all the users for Vista and IE9?
    Do I need to alter registry settings manually?
    If yes - how and which?
    Thanks in advance.

    Chris,
    Thanks for the reply but unfortunately it does not resolve the problem.
    Other users (including the other system administrator) still need to run IE as administrator.
    When in my sysadmin account the shortcuts for other users to a URL requiring Flash and using IE9 execute fine GRRRRRRR.
    This is very frustrating.
    On my pc Chrome aand Modzilla have no problems.
    The childrens protective software I have however is based on IE.
    Do you have any more suggestions?
    My alternative is to downgrade IE9 to IE8 or 7 but that is also not an easy exercise ...
    Thanks in advance for any input.

  • How do you change/adjust border width for all the cells in a table created in Pages?

    How do you change/adjust border width for all the cells in a table created in Pages?
    Note- I am trying to figure out how to create and format tables in the latest version of the Pages app on an iPad air (iOS 8.1.1.1) . Creating tables, adding or removing borders for individual/all cells in a table seems straight forward. However the default border style seems to be a heavy black line. How do I change this?
    I found the option add or remove borders for all/ individual cells in a table, however I can't find any option within style/format dialogue screens for changing colour or line thickness for table cells. Likewise I can't find any clear instructions on how to do this in apple help pages or support website
    Btw- I'm assuming  it is possible to customize/adjust the colour & thickness of selected lines in a table created in this app (it's fairly easy to do this word processing apps like MS Word) please let me  know if this is not actually possible in Pages

    They know perfectly well what they took out of Pages '09.
    Well over 90 features.
    Do you think you posting feedback is going to remind them of what they did?
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&sid=3527487677f0c 6fa05b6297cd00f8eb9&mforum=iworktipsntrick
    Pages '09 should still be in your Applications/iWork folder.
    Archive/trash Pages 5 and rate/review it in the App Store, then get back to work.
    Peter

  • Request in steps in deleting all the tables data in an user schema.

    Hi Gurus,
    Could some one please provide me the steps involved in deleting all the tables data in an user(schema)
    thanks in advance

    write a script as below
    sys@11GDEMO> select 'truncate table '||owner||'.'||table_name||';' from dba_tables where owner='SCOTT';
    'TRUNCATETABLE'||OWNER||'.'||TABLE_NAME||';'
    truncate table SCOTT.DEPT;
    truncate table SCOTT.EMP;
    truncate table SCOTT.BONUS;
    truncate table SCOTT.SALGRADE;
    truncate table SCOTT.EMPBACKUP;
    truncate table SCOTT.T_NAME;
    truncate table SCOTT.D_TEMP_STSC;
    Example:
    sys@11GDEMO> truncate table SCOTT.T_NAME;
    Table truncated.
    sys@11GDEMO>

Maybe you are looking for

  • How can I access my itunes account, old computer crashed?

    My computer has crashed and have recently purchased a new one, all my movies, books, music was on the account on this computer, how can I access it again? I have all my downloads, movies, books, music, so how can I acces that itunes account if my com

  • "Find Finder Items" Broken? Help!

    I'm having a problem with Find Finder Items. I set it as follows: Find Finder Items Where: 100EOS7D (this is a folder on my drive) Whose: Extension is equal to CR2 When I run this I see in the window below all my CR2 files listed. However, I also see

  • From a small drop of the Galaxy S4, the LCD has cracked. Details in description

    I have a flexible rubber case that increases the width (from front to back) by half a centimeter. This means that when it falls on a flat surface, face-down, the screen should not be hit. Unfortunately, I have learned that the case is NOT shock absor

  • What Are The Limits To Aperture? (Masters, Versions, Projects...)

    If Apple has a specification for any of these, I couldn't find it. It's obviously not on the Aperture web site under tech specs. I couldn't find it in the user manual, but I have been known to stink at searching the manual. I did some searching on th

  • Printing from CS5 to HP Photosmart c310a printer

    I recently purchased an HP Photosmart C310a printer and am having trouble printing.  When I print from photoshop I get completely horribly different colors represented from what i see on the screen.  I have set up the color management as best as i ca