find tables that have no data

Hi guys,.

I have the schema name but who want to find the names of all tables which do not have all the data, perhaps no records = 0.

I also want to find then of these tables that have names of data columns and then I want a search on that columns with column name

Need help. Your help would be really appreciated.

Thank you

If the statistics are correctly collected in the schema, then:

select * from user_tables where num_rows=0 ----->  (you may user all_tables/dba_tables);

And I do not understand your second question.

I also want to find then of these tables that have names of data columns and then I want a search on that columns with column name

Not sure if this is what you need...

SELECT *
  FROM user_tab_cols
 WHERE table_name IN (SELECT table_name
                        FROM user_tables
                       WHERE num_rows <> 0);

See you soon,.

Manik.

Tags: Database

Similar Questions

  • How to list all the tables that have no data

    Hi all


    I want to list all the tables that have no data. (registration number is 0)

    Someone help me.

    Thank you
    Thiensu2810

    Select owner, table_name from dba_tables where num_rows = 0;

    This assumes that the table statistics are COMMON.

  • Find all tables that have not at least a DATE column

    DB version: 10 gr 2

    View user_tab_cols using, how can I find the tables that have not at least a column of DATE(user_tab_cols.data_Type='DATE')?
    SELECT table_name
      FROM user_tables
    WHERE table_name NOT IN  ( SELECT DISTINCT
                                      table_name
                                 FROM user_tab_cols
                                WHERE DATA_TYPE  = 'DATE'
                             );
    

    Concerning
    Arun

  • How to find the names of tables that have more than 100 columns

    Hi gurus,

    Please help me find the names of the tables that have more than 100 columns in the database.

    Below will be useful for you.

    SELECT atc.OWNER,atc.TABLE_NAME,count(*)
    FROM all_tab_columns atc
    GROUP BY  atc.OWNER,atc.TABLE_NAME
    HAVING count(atc.COLUMN_NAME) > 100
    

    Adding another point, you can use user_tab_columns, all_tab_columns, dba_tab_columns, based on your needs/access.

    Thank you
    Suri

    Published by: Suri on February 23, 2012 11:30

  • What is the solution to add is not null to an existing table that has the data

    I have an employee table that contains the data that I want to change the column NOT NULL .i get error saying e-mail
    table cannot be changed when the data is there... any other solution for this?

    I have an employee table that contains the data that I want to change the column not NULL.
    I get error message saying table cannot be changed when the data is there... any other solution for this?

    Create a new column that can contain NULL.
    New column UPDATED with the old data
    remove the old column
    Rename new old column_name column

  • I create a form based on two tables that have sequences also. When I create insert only row is inserted in the fields in table first and second fields of the table are empty. Why?

    Mr President.

    I create a form based on two tables that have sequences also. When I create insert only row is inserted in the fields in table first and second fields of the table are empty. Why?

    formdoubletables.png

    the page source is

    <?xml version='1.0' encoding='UTF-8'?>
    <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
                    xmlns:f="http://java.sun.com/jsf/core">
      <af:panelFormLayout id="pfl1">
        <af:group id="Group">
          <af:inputText value="#{bindings.VoucherId.inputValue}" label="#{bindings.VoucherId.hints.label}"
                        required="#{bindings.VoucherId.hints.mandatory}" columns="#{bindings.VoucherId.hints.displayWidth}"
                        maximumLength="#{bindings.VoucherId.hints.precision}"
                        shortDesc="#{bindings.VoucherId.hints.tooltip}" id="it1">
            <f:validator binding="#{bindings.VoucherId.validator}"/>
            <af:convertNumber groupingUsed="false" pattern="#{bindings.VoucherId.format}"/>
          </af:inputText>
          <af:inputDate value="#{bindings.VoucherDate.inputValue}" label="#{bindings.VoucherDate.hints.label}"
                        required="#{bindings.VoucherDate.hints.mandatory}"
                        columns="#{bindings.VoucherDate.hints.displayWidth}"
                        shortDesc="#{bindings.VoucherDate.hints.tooltip}" id="id1">
            <f:validator binding="#{bindings.VoucherDate.validator}"/>
            <af:convertDateTime pattern="#{bindings.VoucherDate.format}"/>
          </af:inputDate>
          <af:inputText value="#{bindings.Credit.inputValue}" label="#{bindings.Credit.hints.label}"
                        required="#{bindings.Credit.hints.mandatory}" columns="#{bindings.Credit.hints.displayWidth}"
                        maximumLength="#{bindings.Credit.hints.precision}" shortDesc="#{bindings.Credit.hints.tooltip}"
                        id="it2">
            <f:validator binding="#{bindings.Credit.validator}"/>
          </af:inputText>
        </af:group>
        <af:group id="g1">
          <af:inputText value="#{bindings.Lineitem.inputValue}" label="#{bindings.Lineitem.hints.label}"
                        required="#{bindings.Lineitem.hints.mandatory}" columns="#{bindings.Lineitem.hints.displayWidth}"
                        maximumLength="#{bindings.Lineitem.hints.precision}" shortDesc="#{bindings.Lineitem.hints.tooltip}"
                        id="it3">
            <f:validator binding="#{bindings.Lineitem.validator}"/>
            <af:convertNumber groupingUsed="false" pattern="#{bindings.Lineitem.format}"/>
          </af:inputText>
          <af:inputText value="#{bindings.VoucherId1.inputValue}" label="#{bindings.VoucherId1.hints.label}"
                        required="#{bindings.VoucherId1.hints.mandatory}"
                        columns="#{bindings.VoucherId1.hints.displayWidth}"
                        maximumLength="#{bindings.VoucherId1.hints.precision}"
                        shortDesc="#{bindings.VoucherId1.hints.tooltip}" id="it4">
            <f:validator binding="#{bindings.VoucherId1.validator}"/>
            <af:convertNumber groupingUsed="false" pattern="#{bindings.VoucherId1.format}"/>
          </af:inputText>
          <af:inputText value="#{bindings.Debit.inputValue}" label="#{bindings.Debit.hints.label}"
                        required="#{bindings.Debit.hints.mandatory}" columns="#{bindings.Debit.hints.displayWidth}"
                        maximumLength="#{bindings.Debit.hints.precision}" shortDesc="#{bindings.Debit.hints.tooltip}"
                        id="it5">
            <f:validator binding="#{bindings.Debit.validator}"/>
          </af:inputText>
          <af:inputText value="#{bindings.Credit1.inputValue}" label="#{bindings.Credit1.hints.label}"
                        required="#{bindings.Credit1.hints.mandatory}" columns="#{bindings.Credit1.hints.displayWidth}"
                        maximumLength="#{bindings.Credit1.hints.precision}" shortDesc="#{bindings.Credit1.hints.tooltip}"
                        id="it6">
            <f:validator binding="#{bindings.Credit1.validator}"/>
          </af:inputText>
          <af:inputText value="#{bindings.Particulars.inputValue}" label="#{bindings.Particulars.hints.label}"
                        required="#{bindings.Particulars.hints.mandatory}"
                        columns="#{bindings.Particulars.hints.displayWidth}"
                        maximumLength="#{bindings.Particulars.hints.precision}"
                        shortDesc="#{bindings.Particulars.hints.tooltip}" id="it7">
            <f:validator binding="#{bindings.Particulars.validator}"/>
          </af:inputText>
          <af:inputText value="#{bindings.Amount.inputValue}" label="#{bindings.Amount.hints.label}"
                        required="#{bindings.Amount.hints.mandatory}" columns="#{bindings.Amount.hints.displayWidth}"
                        maximumLength="#{bindings.Amount.hints.precision}" shortDesc="#{bindings.Amount.hints.tooltip}"
                        id="it8">
            <f:validator binding="#{bindings.Amount.validator}"/>
            <af:convertNumber groupingUsed="false" pattern="#{bindings.Amount.format}"/>
          </af:inputText>
        </af:group>
        <f:facet name="footer">
          <af:button text="Submit" id="b1"/>
          <af:button actionListener="#{bindings.CreateInsert.execute}" text="CreateInsert"
                     disabled="#{!bindings.CreateInsert.enabled}" id="b2"/>     
          <af:button actionListener="#{bindings.Commit.execute}" text="Commit" disabled="#{!bindings.Commit.enabled}"
                     id="b3"/>
          <af:button actionListener="#{bindings.Rollback.execute}" text="Rollback" disabled="#{!bindings.Rollback.enabled}"
                     immediate="true" id="b4">
            <af:resetActionListener/>
          </af:button>
        </f:facet>
      </af:panelFormLayout>
    </ui:composition>
    
    
    
    

    Concerning

    Go to your VO Wizard, select the tab of the entity and to check if both the EO is editable or not.

    See you soon

    AJ

  • You can add not null column to a table that already contains data?

    Hello
    You can add not null column to a table that already contains data?
    Database 9i / 10g on RHEL
    Concerning

    Who worked in 9i?

    Looks like that it:

    SQL> select * from v$version where rownum = 1
    /
    BANNER
    ----------------------------------------------------------------
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    1 row selected.
    
    SQL> create table emp2 as select * from emp
    /
    Table created.
    
    SQL> alter table emp2 add new_col integer default 0 not null
    /
    Table altered.
    
  • Compare two tables that have columns of nulls and undesirable in where clause

    Table A:

    col1col2COL3COL4col5col6

    ANY

    NULL VALUE

    NULL VALUE

    YES

    YES

    YES

    NULL VALUE

    NULL VALUE

    YES

    NULL VALUE

    YES

    YES

    NULL VALUE

    ANY

    YES

    ANY

    NULL VALUE

    YES

    NULL VALUE

    NULL VALUE

    ANY

    YES

    YES

    YES

    Table B:

    col1col2COL3COL4col5col6

    ANY

    NULL VALUE

    NULL VALUE

    YES

    ANY

    YES

    ANY

    NULL VALUE

    YES

    NULL VALUE

    YES

    YES

    NULL VALUE

    ANY

    YES

    NULL VALUE

    NULL VALUE

    YES

    ANY

    NULL VALUE

    ANY

    YES

    YES

    NULL VALUE

    column values

    Yes: Current value

    No: Null

    All: Junk

    Must match all columns in TableA to TableB.

    TableA.col1 to TableB.col1

    .

    .

    .

    TableA.col6 to TableB.col6

    Any help is very appreciated

    Thank you

    Based on your last post that only good data must match exactly and your definition of junk:

    WHERE (decode (substr (A.col5, 1, 1), ' ~ ', 'junk mail', null, 'null', 12/31/9999 ', "junk," A.col5 ") = decode (substr (B.col5, 1, 1), ' ~ ', 'junk mail', null, 'null', 12/31/9999 ',"junk", B.col5"))

    AND (decode (substr (A.col6, 1, 1), ' ~ ', 'junk mail', null, 'null', 12/31/9999 ', "junk," A.col6 ") = decode (substr (B.col6, 1, 1), ' ~ ', 'junk mail', null, 'null', 12/31/9999 ',"junk", B.col6"))

    And so on for the six columns.  This assumes that this junk * still * starts with a ~.  In addition, it assumes that the unnecessary and null words are not in the form of good data.

  • Find tables that added or remove column

    I use Oracle 11.2.0.2

    I want to write a query that lists of paintings who added or dropped columns in a special day say today?

    Your help is appreciated.

    I need this list of tables because the materialized view build base on these tables becomes invalid when the source tables is changed. In my environment where there are several tables in the source that is constantly changing, it is a hassle to recreate materialized view. Is there an easier way to keep materializing views which source schema changes?

    Published by: spur230 on May 10, 2012 16:08

    >
    Is there an easier way to keep materializing views which source schema changes?
    >
    It depends on the type of schema change AND the type of materialized view.

    There is no other choice but to invalidate the application of MV if a column is deleted which is used in a MV.

    You should always have access to the data in the MV - do you? You just won't be able to refresh the MV because the underlying query uses a column that no longer exists.

    If a column is added, or a deleted column is not used in the MV, then most MVs should not affect. New columns not could possibly have served in the underlying query of the MV and drop columns that were not in the query of MV will not affect the query either.

    As Justin says the AUDITING feature may be your best option to detect these changes.

    Which still prevent the improved varieties to be invalidated and if you have a fast ON COMMIT refresh MV it will fail as soon as the DDL change is made if the table is checked or not.

  • Two tables that have a relationship as "many-to-many" and "one-to-many.

    I have the next two represents tables users and the other represents the items where each item can have an author (user) and of course, users can create a lot of articles, so the one-to-many relationship: -.

    1. users: -.
    User_id (primary_key)
    User_name
    User_sex
    user_address

    2.ARTICILES: -.
    Article_id
    Text
    Author_id (foreign key to the users.user_id)

    but the problem I have been facing is that, on another requirement each items can have several (users) approval before being published, so in this way have become the many-to-many relationship, so I created a third table called "trusts": -.

    3.approval: -.
    approval_id (foreign key to the users.user_id)
    article_id (foreign key to the articles.article_id)
    level.

    so is this a good approach to flow, or there is another way I can better build these tables.

    Hello
    Relationship seems to be ok for your current condition. but make sure you have sequence approval on your table to the approval, in case you should find the flow of approvals.

    See you soon
    Kanchana

  • table that stores the data of reconciliation

    Hello

    I'm running on IOM 11gr2PS1.  How can I query data reconciliation for a given grateful event?

    Thank you

    Khanh

    Recon data in tables RA_XXXX.

    -Kevin

  • Find processes that have boosted the cpu of the virtual machine

    any way to do this in vfog 6.7?

    Thank you.

    If you turn on the Investigation of feedback process or Infrastructure Cartridge (preferred) you can see which runs inside the BONE.

  • Create table with overlapping parallel dates in individual columns

    I try to combine data from two different tables into a single table.

    The data in table 1 contains locations of patients in a hospital where each record represents a single location. Patients can be transferred several times between the different beds resulting from multiple records for a single visit.

    The data in table 2 contains the operative activity of the patient to the Hospital where each record represents either the GOLD of the suspension of the recovery room. A patient may have multiple operations in a single visit.

    I would like to join/merge/mashup data in a single table that contains the data parallel to each other. In other words, dates of the appliance on one side of the table and the activity of GOLD on the other. The difficulty is that the two sets of overlapping of dates of arrival and departure. I wish that the final table to divide the originals in new records when the overlaps do not coincide.

    Example:

    Original in both events (one per table)

    > Unit event has - from 14:00 to 18:00

    > OR event B - from 16:00 to 17:00

    Results in 3 documents (in the final)

    > Event 1 - unit from 14:00 to 16:00, null dates GOLD

    > Event 2 - unit from 16:00 to 17:00 OR 16:00 to 17:00

    > Event 3 - unit from 17:00 to 18:00, null dates GOLD

    Of course overlap can be more complex than the example above and adding code to indicate the 'ghosts' transfers to as well.

    In the code below, the first visit of the GOLD occurs during the first mention of the unit.

    Jason

    Oracle 10g

    [code]

    create the table delme_Unit_dates

    (id varchar2 (20))

    , unit_rcd_id varchar2 (20)

    , Unit_desc varchar2 (20)

    Unit_in_code char (1)

    Date of Unit_in_dttm

    Date of Unit_out_dttm

    Unit_out_code char(1));

    create the table delme_or_dates

    (id varchar2 (20))

    , OR_rcd_id varchar2 (20)

    , OR_desc varchar2 (20)

    OR_in_code char (1)

    Date of OR_in_dttm

    Date of OR_out_dttm

    OR_out_code char(1));

    create the table delme_all_dates

    (id varchar2 (20))

    , Unit_OR_id varchar2 (40)

    , Unit_rcd_id varchar2 (20)

    , Unit_desc varchar2 (20)

    Unit_in_code char (1)

    Date of Unit_in_dttm

    Date of Unit_out_dttm

    Unit_out_code char (1)

    , OR_rcd_id varchar2 (20)

    , OR_Desc varchar2 (20)

    OR_in_code char (1)

    Date of OR_in_dttm

    Date of OR_out_dttm

    OR_out_code char (1));

    insert into delme_unit_dates values ('123456', 'U1111', 'Unit A', 'A', to_date('2013-04-29 5:02:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-09 1:06:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 'B');

    insert into delme_unit_dates values ('123456', 'U1112', 'Unit A', 'B', to_date('2013-05-09 1:06:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-09 4:53:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 'B');

    insert into delme_unit_dates values ('123456', 'U1113', 'Unit A', 'B', to_date('2013-05-09 4:53:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-10 10:52:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 't');

    insert into delme_unit_dates values ('123456', 'U1114', ' unity, 't', to_date('2013-05-10 10:52:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-11 11:30:00 AM', 'yyyy-mm-dd hh:mi:ss am'), 'B' ");

    insert into delme_unit_dates values ('123456', 'U1115', ' unity, ' B', to_date('2013-05-11 11:30:00 AM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-12 4:00:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 'B');

    insert into delme_unit_dates values ('123456', 'U1116', ' unity, ' B ', to_date('2013-05-12 4:00:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-16 2:14:00 PM', 'yyyy-mm-dd hh:mi:ss am'),' t ');

    insert into delme_unit_dates values ('123456', 'U1117', 'Unit Z', ', to_date('2013-05-16 2:14:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-17 2:26:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 'B');

    insert into delme_unit_dates values ('123456 ', 'U1118', 'Unit Z', 'B', to_date('2013-05-17 2:26:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-20 11:30:00 AM', 'yyyy-mm-dd hh:mi:ss am'),');

    insert into delme_or_dates values ('123456', 'OR2221', 'or 1', 'O', to_date('2013-05-09 7:35:00 AM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-09 10:56:00 AM', 'yyyy-mm-dd hh:mi:ss am'), 'R');

    insert into delme_or_dates values ('123456', 'OR2222', ' 5', 'R', to_date('2013-05-09 10:56:00 AM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-09 3:20:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 'U');

    insert into delme_or_dates values ('123456', 'OR3331', 'or 2', 'O', to_date('2013-05-16 7:59:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-16 10:43:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 'R');

    insert into delme_or_dates values ('123456', 'OR3332', ' 8', 'R', to_date('2013-05-16 10:43:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-17 11:20:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 'U');

    commit;

    -Is far from what we

    Select

    U.*

    , o.*

    Of

    delme_Unit_dates U

    delme_OR_dates O

    where

    U.ID = o.id

    and U.UNIT_IN_DTTM < = O.OR_IN_DTTM

    and U.UNIT_OUT_DTTM > = O.OR_IN_DTTM

    order of U.UNIT_IN_DTTM, O.OR_IN_DTTM

    ;

    [/ code]

    Post edited by: Jason_S (changed a single date ' 2013 - 05 - 16 15:20 ' to ' 2013 - 05 - 09 15:20 ')

    Hi, Jason.

    Jason_S wrote:

    I edited one of the dates in the original post.

    Also although the inpatient unit and OR events are contiguous for a given patient (no overlap and without gaps - after that data are cleaned).

    ...

    The sample data you posted a of gaps in the data of the GOLD.  It is correct that the solution below works or not there are gaps in the two tables.

    WITH got_dttm AS

    (

    SELECT unit_in_dttm AS DTMC

    OF delme_unit_dates

    UNION

    SELECT unit_out_dttm AS DTMC

    OF delme_unit_dates

    UNION

    SELECT or_in_dttm AS DTMC

    OF delme_or_dates

    UNION

    SELECT or_out_dttm AS DTMC

    OF delme_or_dates

    )

    all_periods AS

    (

    SELECT DTMC AS in_dttm

    , (DTMC) ahead OF (ORDER BY DTMC) AS out_dttm

    OF got_dttm

    )

    SELECT NVL (u.id, o.id) as id

    u.unit_rcd_id

    u.unit_desc

    u.unit_in_code

    p.in_dttm

    p.out_dttm

    o.or_rcd_id

    o.or_desc

    Of all_periods p

    LEFT OUTER JOIN delme_unit_dates u WE u.unit_in_dttm<=>

    AND u.unit_out_dttm > = p.out_dttm

    LEFT OUTER JOIN delme_or_dates o WE o.or_in_dttm<=>

    AND o.or_out_dttm > = p.out_dttm

    WHERE p.out_dttm IS NOT NULL

    ORDER BY p.in_dttm

    ;

    You can use the query above to CREATE or a CREATE TABLE... AS command.

    If you have as much data as you say, a table or materialized view would be maybe faster to use.

    You will notice that I do understand not all columns; I would like to know if you have a problem, including them.

    I don't know what id role plays in this problem.  It is difficult to say when all rows have the same value.

  • How to keep the style of setting shaped tables that you paste IN when copying old pictures?

    Hi all

    I know that CMD-SHIFT-V works perfectly to keep the text styles you paste IN when you copy another block of text that contains different styles, but how do I do the same thing with a TABLE?

    I have paintings from an InDesign document with a set of styles/table cell styles, etc and am copying into another InDesign document where I have tables that have table styles different styles/cell, etc. The only way I can successfully get the information in one table to another is to copy the information from the old table with the old styles and then paste it into an excel worksheet, and then copy the excel worksheet and paste into new tables in the new InDesign document.

    Now, wouldn't that be so bad if I didn't have SO MANY hundreds and hundreds of paintings I was working with! I am currently working on a big catalogue and this workflow is slowing down a lot:)

    Please note that I have deleted all styles (by removing all styles) tables I am pasting FROM, but chose to keep the formatting.

    Once more, I bet that I I will kick myself when I see how the answer is easy!

    Any help would be so appreciated!

    Thank you kindly,

    Christine

    Try converting your old text table (column separator: tab; line separator: paragraph). Copy, select the style of lines and columns you want to paste the text in and paste without formatting in your new table. It may not work if your table is very complicated, but it worked for me on a test very simple.

  • I want to find tables of 10 top of the page that contains the largest amount of data

    Hi guys,.

    How to find tables top 10 which contains the largest amount of data. Can someone help me on this please?

    Thanks in advance!

    Rgds,

    KLR

    Maybe this?  Check

    WITH t

    AS (SELECT ROW_NUMBER () ON num (ORDER OF SUM (bytes) DESC),

    nom_segment

    FROM dba_segments

    GROUP BY nom_segment)

    SELECT *.

    T

    WHERE the num<=>

    See you soon,.

    Manik.

Maybe you are looking for