List of unused tables and procedures

Hi,
I am in the task of clean up of tables.
I need to find the list unused tables and procedures.
Is there any way where i can find when was the last time the table queried?
Also, Can you please give sql query to find the list of unused tables and procedures.
Appreciate your response.
Thanks...

There is not a definitive way to complete this task. This becomes especially complicated if you have SQL / PL/SQL embedded in your applications external to the database. You could start looking at DBA_DEPENDENCIES, and that will at least give you a start to identifying objects that might not be used in the database.
Another possibility is implementing auditing on suspected objects to see if there is any activity. You'll need to determine though if you have any business processes that have a long cycle (quarter, annually, etc) to ensure you aren't dropping an object that is actually used.

Similar Messages

  • List of SQL tables and attributes used in SSRS reports

    Hi,
    I have around 450-500 reports deployed in SSRS reporting server.
    All these reports are built on SQL from multiple databases, and these databases are having unnecessary tables and attributes.
    My requirement is to clean the unused tables and attributes from the databases. For this, I need the list of SQL tables and attributes used in these 450-500 SSRS reports.
    Is there any way to get this data?
    Regards,
    RK

    Hi RK,
    According to your description, you want to get a list of the tables and attributes used in all reports.
    In your scenario, you can query the ReportServer.dbo.Catalog table to get Report name, data source name, dataset name, and query used in the dataset with query below:
    WITH XMLNAMESPACES ( DEFAULT 'http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition', 'http://schemas.microsoft.com/SQLServer/reporting/reportdesigner' AS rd )
    SELECT ReportName = name
    ,DataSetName = x.value('(@Name)[1]', 'VARCHAR(250)')
    ,DataSourceName = x.value('(Query/DataSourceName)[1]','VARCHAR(250)')
    ,CommandText = x.value('(Query/CommandText)[1]','VARCHAR(250)')
    ,Fields = df.value('(@Name)[1]','VARCHAR(250)')
    ,DataField = df.value('(DataField)[1]','VARCHAR(250)')
    ,DataType = df.value('(rd:TypeName)[1]','VARCHAR(250)')
    --,ConnectionString = x.value('(ConnectionProperties/ConnectString)[1]','VARCHAR(250)')
    FROM ( SELECT C.Name,CONVERT(XML,CONVERT(VARBINARY(MAX),C.Content)) AS reportXML
    FROM ReportServer.dbo.Catalog C
    WHERE C.Content is not null
    AND C.Type = 2
    ) a
    CROSS APPLY reportXML.nodes('/Report/DataSets/DataSet') r ( x )
    CROSS APPLY x.nodes('Fields/Field') f(df)
    ORDER BY name
    For more information, please refer to this similar thread:
    Extract metadata from report server database
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • Need to get a list of PSA tables and change log tables existing in a PC

    Is there a standars table to look up all active DSOs and the change log tables associated to those DSOs?
    and also Data sources and the PSA tables associated to that DS.
    I need to get a list of PSA tables and change log tables existing in a processchain(whioch deletes the data in them time to time)how do I do this in a quicker way?
    Thanks in advance

    Hi Ramya
    Check  RSTSODS table with filter of  User App   CHANGELOG ---> For change log tables

  • EXPORT SCHEMA 'S ALL TABLES AND PROCEDURES BY EXPDP

    how i can export schema's all tables and procedures using expdp.
    when i am giving expdp usr/pass schemas=scott directory=export_dir dumpfile=280606.DMP logfile=280606.log tables=*
    but it is giving error.
    pls help
    regards
    Prabhaker

    You only need to specify parameter USER or TABLES , no need of both
    specify USER=SCOTT then it will export all objects in SCOTT

  • Object tables and procedures.

    Hi! I apologize in advance if my question is too trivial. I'm building simple object-relational database, and i would like to move a lot of my programming logic into database. I plan to build object tables based on object types that contain not only attributes but also functions and procedures. Now for example, i have object type "product" that contains some atributes like id ,name, price..., and let say procedure LowerThePrice(Percentage NUMBER) that should change the actual data.
    Now i create table Products of type product and fill it with some data. The question is how can i call/apply this procedure LowerThePrice on rows of products object table? If this scenario is even possible, how can i call that procedure using sql plus, and VB.net 2005 (i have installed and configured ODP.NET and oracle 11g).
    Thanks!

    1. Has been mentioned before - we do have a bug on it. To search across all your pl/sql, there is a report you can use.
    2. We are working on improving errors but I can't make any promises.
    3. We have heard this before but it won't be there for v1.0. You can use the Connections navigator to access the details of the objects that are accessible to you while you have a Worksheet open. You can even drag your Worksheet tab down to place it under the Connections details tab so you can see them both at the same time.
    4. In a post-v1.0 release, we will be looking at additional, alternate navigation.
    5. We have an open bug to not prompt you for the same bind more than once.
    6. I will talk to the Worksheet developer about this one. Not sure we can remember the binds from execution to execution but it would be a great enhancement.
    7. Not sure why this is failing - I will check into it.
    -- Sharon

  • Getting a list of all table and index names

    Hi,
    I have just create a set of tables and indexs, but I have misspelt on of the table names and am now trying to find out what it is. I am using sql*plus as a command line interface but can only find desc as a way of finding any data on a table. What is the command to list all the tables within a table space?
    Cheers
    Simon

    Hi,
    there are almost always three ways to find things in Oracle's dictionary :
    USER_xxx = thing that you own
    ALL_xxx = thing that you own and have access to
    DBA_xxx = all things in hole database
    If you want to find tables/indexes that you own :
    SELECT table_name FROM user_tables
    WHERE tablespace_name = 'APP_TBS';
    SELECT index_name FROM user_indexes
    WHERE tablespace_name = 'APP_TBS';
    /Uffe

  • How to list all user tables and views?

    like "select" command.
    Thanks.

    Hi,
    1)
    select table_name from user_tables union all select view_name from user_views;
    2)
    select distinct table_name from user_tab_columns;
    3)
    select object_name from user_objects where object_type in ('VIEW','TABLE');You should get very similar results with those queries.
    Query 2 will contains clusters.
    If you run query 3 against sys, you will get some very special objects, like the KOTAD$ table, which contains no user-visible column! You will also get the overflow segments of IOTs and nested table column's storage table.
    Kind regards
    Laurent

  • User_catalog - object listed as both 'TABLE' and 'MATERIALIZED VIEW'

    SELECT * FROM USER_CATALOG ORDER BY OBJECT_NAME
    returns ...
    OBJECT_NAME              OBJECT_TYPE       
    BLOBBY                   SYNONYM           
    BONUS                    TABLE             
    DEPT                     TABLE             
    EMP                      TABLE             
    EMPLOYEES                SYNONYM           
    EMPWITHDEPT              MATERIALIZED VIEW 
    EMPWITHDEPT              TABLE             
                             ^^^^^^^^^^^^Any ideas to show only the 'MATERIALIZED VIEW' row for the above query?
    Thanks in advance,
    Mike Norman

    So, I would need some sort of logic to
    check if the OBJECT_NAME from user_objects
    is present in user_snapshots print 'MATERIALIZED VIEW'
    otherwise take the OBJECT_TYPE from user_objects -
    some sort of DECODE?

  • Trying to find unused tables by views,function, and proc?

    I come up with lists of unused table through given script
    SELECT
    SCHEMA_NAME(t.schema_id)
    as SchemaName,
    t.name as
    TableName
    FROM   sys.tables
    t
    WHERE  is_ms_shipped
    = 0
    AND NOT
    EXISTS (SELECT
    FROM   sys.sql_expression_dependencies
    d
    WHERE  d.referenced_entity_name
    = t.name
    AND ((
    is_ambiguous = 1
    or is_caller_dependent=1)
    OR
    d.referenced_id
    = t.object_id) 
    result:
    dbo temp_bandfix
    dbo ClientParty_AXClient_back
    dbo EmployeeParty_AXEmployee_back
    dbo CUSTTABLE
    dbo sysdiagrams
    dbo ConcurClientList
    I have list of procs, Vws, and FN in DB
    I am thinking to add sub query on the above script and see dependency on procs, views and FN to make sure those tables are not used at all  in database before dropping them.
    Looking for help on this issue???

    Use SQL Server Profiler to run a trace on your database. You can let it run for a week or longer if you'd like to. Then once it is done you can upload the results to an SQL table. Then you can use a join to the query you have above to see if there are any
    tables not being accessed. This is probably the best method for determining if a table is unused, as the Profiler will log events anytime someone runs a transaction against a table.
    Jordan Johnson

  • About the Names of std Tables  and their list of contents

    Hi  every body ,
    can u pls give me Source of  finding the  list of standard tables and their contents
    such  that  i can refer to  those tables to determine  what should be the Mandatory  data elements .
    i need just 2 determine   what  is  required  and  what not ?
    Awaiting for a  brighter and good response .....
    reply to  [email protected]

    Hi,
    Search for SAP Tables in www.sap-img.com. You will find a Zip file, this has most of the tables used in most of the modules. Check those tables and find which are all the primary fields.
    Regards
    Subramanian

  • HELP! FOR LOOP TO SCROLL THROUGH TABLE AND CREATE DATABASE LINK

    Hi,
    Here's the scenario, not much of a PL programmer, just basic SQL so really need some help people!
    I have 2 tables. 1 contains list of DB's and the other contains rules to follow.
    I need to create a loop that goes through the table containing the DB's and on each row a DB link is created (Only 1 link allowed!)
    Once created, the schema currently logged in with also has an account on the linked DB in order to run scripts- The scripts are stored centrally hence the requirement for the link to the target DB.
    There are numerous scripts that need to be executed and can all be called from 1 script, once executed the loop exists and the database link needs to be dropped.
    Once dropped, the first loop continues, creating a DB link for the next DB listed in the table (and all the scripts are fired again)
    This continues against all the DB's listed in the table.

    Hi BlueShadow,
    Thanks again for the response, you've hit the nail on the head. SQL scripts on a unix server, a loop goes through a table 1 at a time. Each row gets a link created and then all the scripts stored on the server are executed against the db linked to. So I'm assuming this is a loop within a loop.
    1 loop to go through the table to create the link and then another loop within once connected to execute all the scripts against the connected DB. Once the scripts are run, the loop exits and moves onto the next server and so on until all the servers have the scripts are run.
    It's PL/SQL scripts we're after and not shell scripts as this would free us from the OS constraints.
    We have to drop the links due to security. Any idea on o

  • Where do i see all the default tables and views in oracle 10g

    hi,
    I have installed oracle 10g in the linux os.
    I just wanna see the list of deffault tables and views created by oracle.
    can anyoone hlep me on this
    thanx in advance....

    Check DBA_OBJECTS for all seeded objects in an Oracle database. For tables, check DBA_TABLES. For views, check DBA_VIEWS. All of this is documented in the fine documentation - take some time out to read thru it.
    http://docs.oracle.com/cd/E11882_01/server.112/e25513/statviews_4156.htm#REFRN23146
    http://docs.oracle.com/cd/E11882_01/server.112/e25513/statviews_5056.htm#sthref2482
    http://docs.oracle.com/cd/E11882_01/server.112/e25513/statviews_5085.htm#sthref2521
    HTH
    Srini

  • List of Obsolete Tables in ECC 6.0 - Very Urgent

    We are planning to upgrade from 4.6c to ECC 6.0. Heard that there are many standard objects obsolete in ECC 6.0. Can anyone give me the List of Obsolete Tables and also the standard objects in ECC 6.0 with their updated tables and obejcts. This is required very urgently.

    Dear,
    You may have an overview wirth Solution Browser  tool (at the solution point of view) in order to compare functionality between your current system and the ERP 2005.
    at:
    http://solutionbrowser.erp.sap.fmpmedia.com/
    You can get the detailed release information from the following link.  
    http://service.sap.com/releasenotes.             
    A release note is a brief explanation of new features or changes to the system since the last software release. A release note typically describes a new function or an existing function that has been enhanced or changed.
    I hope this helps.
    Lucio Rodrigues
    SAP Active Global Support

  • Get description of tables and columns

    Good afternoon.
    Is there any option in SAP B1 to get a description of table and column dynamically? That is, without the "Tools -> Queries -> Query Generator"?
    I am developing an add-on, which lists all the tables and columns of the sap, and I have to bring the descriptions automatically. If you do not have to get the SDK route descriptions, as you suggest doing this?
    Edited by: Harley Rodrigues on Feb 1, 2012 9:38 PM

    Hi Harley,
    Welcome to the Forum!
    please refer to your SDK Help. you can find it from this path C:\Program Files\SAP\SAP Business One SDK\Help
    also alternatively you can view it from your MS SQL Server Management under Databases
    regards,
    Fidel

  • Field sales related tables and Transaction code

    Dear SAPGurus,
    I have been working with field sales activities in mySAP CRM..
    Can I have the list of the tables and transaction code related to Field sales sales activies..
    I am grateful for ur help....
    I would like to appreciate u by rewarding the points
    Thanks a lot

    Hi Pratik Patel,
    Thank u very much for sending the table names.They are all very useful unto me
    Can I have the more table in this area
    If u have the CRM Data model and its relationship...Pls share with me..
    I  appreciate ur help by rewarding the points
    Regards,
    CRM Consultant

Maybe you are looking for

  • AS2 Adapter issues

    Hi, I have a scenario (Proxy to AS2). Receiver channel is configured to HTTPS. It passes successfully through MONI, but gives error in Receiver adapter. Exact error is : "Message processing failed. Cause: javax.resource.ResourceException: Fatal excep

  • Can't copy, cut & paste.

    I just bought an HP TouchSmart520 PC & am trying to figure out how to copy, cut & paste. Clicking on the R mouse doesn't even have it as an option. Please help!

  • PictureMate Deluxe will not print/Messes up my CX4200, too!

    You all have been amazingly helpful with all of the questions I've had, so I'm hoping you won't mind taking this one on as well! My PictureMate Deluxe is brand new. I did the installation, and it worked well the first time I used it. When I tried to

  • Mountain Lion Spotlight no longer indexes "codecs" for Apple Lossless files?

    Hi, I was recently trying to find some Apple Lossless files stored on my hard drive, and I tried searching using Spotlight's "codec" option (by typing "lossless" into the search field in the Finder). However, nothing came up. Upon further investigati

  • In getting error in field symbols

    your attempted to assign a field to a type filed symbols but the field dose not have the required type. iam getting runtimes error like this what should i do for this. regards, sivakumar