SQL to find out Objects used by
Hi,
How can I find out the list of objects which are using an object? e.g. Table temp_1 is used by procedure p_test11 and function F_test22... Is there any way to find out the list of these to objects with their type?
These dictionary table you can refer to.
SQL> select * from dictionary where table_name like '%DEPENDENCIES%'
2 /
TABLE_NAME COMMENTS
DBA_DEPENDENCIES Dependencies to and from objects
USER_DEPENDENCIES Dependencies to and from a users objects
ALL_DEPENDENCIES Dependencies to and from objects accessible to the user
ALL_REFRESH_DEPENDEN Description of the detail tables that materialized views depend on for
CIES refresh
DBA_APPLY_VALUE_DEPE Synonym for _DBA_APPLY_CONSTRAINT_COLUMNS
NDENCIES
DBA_APPLY_OBJECT_DEP Synonym for _DBA_APPLY_OBJECT_CONSTRAINTS
ENDENCIES
TABLE_NAME COMMENTS
6 rows selected.
Similar Messages
-
How to find out the used space and free space in the DB for attachments
Hi,
In CRM 5.2 web UI, we can save a transaction by saving attachments like work documents or text files.
Could someone help me find out the used space, free space, maximum capacity on the CRM DB for these attachments.
Thanks & Best Regards,
Ramesh.Hi,
check with below table
TNAPR --- Processing programs for output
and NACE Transaction code
NACE -- out types
Regards,
Madhu -
Has your debit/credit card been charged for unauthorized APPLE Itunes purchases? How do you find out who used it?
Max OSX 10.6.8, iTunes 11.1
I had a similar problem: I wanted to synch my playlist to my iphone. I like to have my playlist sorted by genre. But under each genre, albums are not sorted by the track numbers. This is a problem, especially when I am listening to club mixes when the DJ smoothly transitions from 1 track sequentially to the next one. Under the properties of each audio file, the Track Numbers and Disc Numbers are already there.
My perfect solution was to turn On Sorting - Sort Album under View>Show View Options. Then, select all the songs in that album (Shift click, Cmd click, etc) , and Edit multiple item information (Cmd I). You will see Info-Video-Sorting-Options buttons. Click on Sorting. Then, under Sort Album, Enter the name of the album. Then OK.
You should now have the playlist sorted by Genre, then each album individually sorted by track numbers. On your playlist you should see, if you scroll right, the column added called "Sort Album".
Hope this helps. -
SQl to find out the last business day of a given week
Can any one please let me know what will be the SQL to find out the last business day (monday-friday) of a week?
Edited by: 863997 on Oct 6, 2011 10:40 AMAssuming for "this week" that you want "last week Friday," then here is the SQL:
TIMESTAMPADD(SQL_TSI_DAY,-1,TIMESTAMPADD(SQL_TSI_DAY, DAYOFWEEK(CURRENT_DATE)*-1, CURRENT_DATE))
If you want the "nth" business day of the month, click on this link here:
Re: calculation of Business day in OBIEE -
Sql to find out combination of true and false
Hi all,
Could any one provide the sql to find out combination of true and false . For eg: if I have 3 elements a , b c i would like to get below o/p
a b c
t t t
t t f
t f f
f f f
t f t
f f t
your reply is greatly appreated - thank youDo you mean something like this (all permutations) ?
SQL> with t as (
2 select 't' bool from dual union all select 'f' from dual)
3 select a.bool a,b.bool b,c.bool c
4 from t a,t b,t c
5 /
A B C
t t t
t t f
t f t
t f f
f t t
f t f
f f t
f f fIf not, then you already got correct answers regarding boolean type in sql.
Best regards
Maxim -
Hi,
I have a table with 50 columns, lets call it Table_A . There is a identical table called Table_B. The data in Table_B gets flushed every night and data from Table_A is moved to Table_B. A new set of data is inserted into Table_A. Now I need to find out which field value is changed and what is changed . A minus command can give the changed records, but how to get the what was prior value for each changed field . Here is what I am looking for
WITH TABLE_A AS ( SELECT 1 ID, 'JOHN' NAME, 'SALES' DIV FROM DUAL
UNION
SELECT 2 ID, 'MARRY' NAME, 'ACCOUNTS' DIV FROM DUAL
UNION
SELECT 3 ID, 'KIM' NAME, 'SERVICE' DIV FROM DUAL),
TABLE_B AS ( SELECT 1 ID, 'JOHN' NAME, 'SALES' DIV FROM DUAL
UNION
SELECT 2 ID, 'MARRY' NAME, 'ACCOUNTS' DIV FROM DUAL
UNION
SELECT 3 ID, 'KIM' NAME, 'SALES' DIV FROM DUAL)
SELECT * FROM TABLE_A
MINUS
SELECT * FROM TABLE_B
what i want is something that will spit out this (only one record, because there is only one diff record found in the above query.)
ID, OLD_ID, NAME, OLD_NAME , DIV , OLD_DIV
3 3 KIM KIM SERVICE SALESThe above one is for sample purpose, The actual table has 50 fields, and except the ID field, all other field values might change.
All ideas and solutions are appreciated.
Thanks in advance.>
I understand your frustration. Here is the scenario. There are set of 5 tables. 1 master and 4 child tables ( and an identical set of 5 tables called "prior" tables, to store the flushed data from the "current" 5 tables). Every night data comes in XML files, the data from the 5 "prior" tables get flushed out . The data from the 5"current" table set moves to 5 "prior" tables. Then XML data gets loaded into the 5 "current"tables. Now once XML gets loaded into the original table ,I have to find out the diffs in those 5 tables(between current and prior) and generate result sets listing only the columns that have changed value. So what is current value and what was the prior value(from the prior table) side by side .
>
I'm not frustrated. It's just that any suggestions we make are solely based on the information provided. Sometimes posters start focusing on the solution they want to use (which is ok for their viewpoint) and don't explain the actual problem they are trying to solve. That often limits our ability to understand the options.
Now that you posted the above there is another option you could use that might better deal with some of the issues people have mentioned.
That solution is to compare the XML versions of the data. You haven't mentioned HOW you load that XML data into relational tables (what tool and process) but there is one VERY USEFUL feature of data in XML format:
ALL data is already in TEXT format (excluding the obvious LOB possibilities, which you also haven't mentioned).
That means ALL datatypes can use simple string comparison to detect differences: numbers, dates, character data. The actual meaning doesn't matter. If even a single byte is different the value can be considered different.
Oracle uses XML and XSLT functionality as the base for their DBMS_METADATA_DIFF package. That package is used to compare schemas or databases to detect object (e.g. tables, views) differences and to automatically produce DDL for ALTER statements that can modify an object to have the same structure as the objects being compared.
I suggest that you consider doing your comparisons on the XML versions of the data. Each night you would compare the new XML file data against the previous night's XML data. You can use XSLT to do the comparison and also to produce an XML file that contains the differences. Then you can use that 'difference' file as the source of your process to ultimately display the data.
An additional advantage of doing the XML comparisons is that you can do them asynchronously as soon as the new file is available. And the, if you don't really need the 'change' info in the database you never need to load it. Just transform the change XML into an Excel file or flat file format for users to load into Excel for review.
Do you license the partitioning option? If so then another suggestion would be to stop doing your nightly 'flush and move'. Recreate your 'prior' tables as partitioned tables that have just ONE range partition; a MAXVALUE partition that covers ALL data. Then each night you would:
1. TRUNCATE the prior table
2. Do an EXCHANGE partition between the 'current' table and the associated 'prior' table. Very fast, metadata only - no data actually gets moved.
3. Load the 'current' table with new data.
The above process avoid any actual data movement between the 'current' and 'prior' tables.
Not picking on you but you also haven't said how that new daily 'current' data is being used. If the only reason you are loading it into a table is to compare it to yesterday's data you could just do that with XML like I mentioned above.
Or you could load the XML itself into a table (e.g. XMLTYPE) and uses Oracle's built-in XDB fuctionality and do the XML comparison 'inside' the database. Then load a standard heap table from the XML table when you need to.
Maybe the above helps explain why the more info we have about the actual end-to-end problem you have the more options we can suggest for dealing with it. You are the only one that can determine if an option is viable for your particular use case and constraints.
Updated to add links to Oracle's XML functionality
See the XMLDiff function that you can use IN the database if you load the XML files themselves. From the SQL Language doc
http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions241.htm#SQLRF20025
>
Purpose
The XMLDiff function is the SQL interface for the XmlDiff C API. This function compares two XML documents and captures the differences in XML conforming to an Xdiff schema. The diff document is returned as an XMLType document.
For the first two arguments, specify the names of two XMLType documents.
For the integer, specify a number representing the hashLevel for a C function XmlDiff. If you do not want hashing, set this argument to 0 or omit it entirely. If you do not want hashing, but you want to specify flags, then you must set this argument to 0.
For string, specify the flags that control the behavior of the function. These flags are specified by one or more names separated by semicolon. The names are the same as the names of constants for XmlDiff function.
See Also:
Oracle XML Developer's Kit Programmer's Guide for more information on using this function, including examples, and Oracle Database XML C API Reference for information on the XML APIs for C
Examples
The following example compares two XML documents and returns the difference as an XMLType document:
>
See Oracle' own XML Developer's Kit for out-of-the-box functionality for 'diffing' XML documents:
http://docs.oracle.com/cd/E11882_01/appdev.112/e23582/adx_c_diff.htm
>
21 Determining XML Differences Using CThe Oracle XDK includes components that help you to determine the differences between the contents of two XML documents and then to apply the differences (patch) to one of the XML documents.
This chapter contains these topics:
Overview of XMLDiff in C
Using XmlDiff
Using XmlPatch
Using XmlHash
Overview of XMLDiff in C
You can use Oracle XmlDiff to determine the differences between two similar XML documents. XmlDiff generates an Xdiff instance document that indicates the differences. The Xdiff instance document is an XML document that conforms to an XML schema, the Xdiff schema.
You can then use XmlPatch, which takes the Xdiff instance document and applies the changes to other documents. This can be used to apply the same changes to a large number of XML documents.
XmlDiff only supports the DOM API for input and output.
XmlPatch also supports the DOM for the input and patch documents.
XmlDiff and XmlPatch can be used through a C API or a command line tool, and they are exposed by two SQL functions.
An XmlHash C API is provided to compute the hash value of an XML tree or subtree. If hash values of two trees or subtrees are equal, the trees are identical to a very high probability.
>
Did you notice that part about 'XmlDiff generates an Xdiff instance document that indicates the differences'? That is EXACTLY what your initial question was asking about, albeit from a DB perspective.
But XML is XML, DIFF is DIFF, a date/number/text are all strings. So XML 'database data' works the same as XML 'test or complex hierarchy' data.
Here is a pretty good writeup of how to do XML diff. See the XMLDIFF2 section for the best Oracle sample:
http://ellebaek.wordpress.com/2011/02/01/comparing-xml-in-oracle/
>
XMLDIFF2
The algorithm in our extended XMLDIFF function that we’re going to call XMLDIFF2 is:
1.Prepare CLOB variable for constructing the difference XML.
2.Find minimum number of leading elements that form primary key values (unique lookup).
3.Look for primary key values in XML1 not present in XML2: These primary key values have been deleted.
4.Look for primary key values in XML2 not present in XML1: These primary key values have been inserted.
5.Diff all common primary key values, ie in both XML1 and XML2.
6.Return NULL if no differences found. -
Find out query using specific DB link
Hello,
Environment: 11G and Ksh script
Currently our Client is upgrading to new environment, so I need to find out which query in our Database use DB link to pull data from that client will be impacted.
for example,
select * from table_1@DB_link_1All our SQL are embedded in UNIX script, so I use command line to search any scripts contain '@DB_link_1' but not find anything.
is it possible to search any dynamic view or any suggestion to search inside ORACLE database to see if any query using this 'DB_link_1'? I tried 'dba_db_links' but this does not show which query is using which DB link.
Thanks,
Thomasfrank wrote:
Hello,
Environment: 11G and Ksh script
Currently our Client is upgrading to new environment, so I need to find out which query in our Database use DB link to pull data from that client will be impacted.
for example,
select * from table_1@DB_link_1All our SQL are embedded in UNIX script, so I use command line to search any scripts contain '@DB_link_1' but not find anything.
is it possible to search any dynamic view or any suggestion to search inside ORACLE database to see if any query using this 'DB_link_1'? I tried 'dba_db_links' but this does not show which query is using which DB link.
Thanks,
Thomashttp://download.oracle.com/docs/cd/E11882_01/server.112/e17110/statviews_1068.htm#REFRN20053
REFERENCED_LINK_NAME VARCHAR2(128) Name of the link to the parent object (if remote)
" -
Find dictionary object used in ABAP program
Dear All,
Pl help me find out all the dictionary objects used in report program and dialog program.
Input will be program name(report or module pool). output will give name of the database tables used in that program.
thanks.Hi,
Use the FM RS_PROGRAM_TABLES
pass the object type as PROG for report and the program name for object name
Vikranth -
Generic Extractors with Fm / Finding out tables used
Hello Gurus,
for a requirement, i would like to find out the table used in a generic extractor with function module.
I can see the structure with the objects used but not the tables where they are from.
How can i find that out?
Thank you
PatHi Gilo ,
The best way to find out the tables used in the function module will be to analyze the code . Check all your Select Statements in the code and see the tables being used there .
Sometimes in the code , we use standard function modules from the ECC. Check those standard FMs also and see what table they are using .
Hope the above reply was helpful.
Thanks & Regards,
Ashutosh Singh -
How to find out theTables used in the program
hi experts,
can any one tell what are the ways to find out the tables used in the program
thanks in advance.Hello,
Below are some tips:
1. If custom program- SEARCH for "TABLES" or "SELECT" stmt.
2. The full-proof way will be to activate SQL Trace. Goto tcode ST05, check SQL Trace & then activate trace.
Execute the program. After execution is complete, deactivate trace & then display trace. You will get all the tables which are being used.
BR,
Suhas -
Finding which objects use a procedure
I have a procedure inside a package. I want to find out which DB objects are using it.
user637544 wrote:
I have a procedure inside a package. I want to find out which DB objects are using it.What do you mean by that? Do you mean you want to know what are the Objects that are used in that package? If yes you can query
user_dependencies -
How to find out where used list of Table or T-code
Dear ABAP gurus
I know many of you have done this several times.
wish to find out which Transaction code INSERTs the data into the table IHPA.
I did the where used list - SE11 ( for specific key work called INSERT ).
Used the Table called D010TAB which has some information.
Vise versa if I know a T-CODE , how to know which tables it read & Modify...
any better procedure than spending hours in research...
I found similar custom program to find USER EXITS ...here..., looking soething similar...
[http://wiki.sdn.sap.com/wiki/display/Snippets/FindUser-exits%2CBADIs%2CBTEs%2CEtcbyTCodeorProgram]
thank you for your help
Edited by: Raj Anvesh on Aug 3, 2011 9:58 PMHi Anvesh,
Maybe the data INSERTION is happening by BAPI,
So just try to look for the concerned BAPIS.
ECP_SRV_PARTNERS_IHPA
IREP1_IHPA_ADRNR_PRE_FETCH
IREP1_IHPA_ADRNR_READ
MAP2E_DIIHPA_TO_PARTNER
MAP2E_IHPAVB_BAPI2080_NOTPARTE
MAP2E_IHPAVB_TO_BAPI_IHPA
MAP2E_IHPA_BAPI2080_NOTPARTNRI
MAP2E_IHPA_M_BAPI2080_NOTPNRI
MAP2I_BAPI2080_NOTPARTNRI_IHPA
MAP2I_BAPI_IHPA_TO_IHPA
PM_DB_FILL_DIIHPA
PM_PARTNERCOPY_FILL_XIHPA
PM_PARTNER_DELETE_XIHPA
PM_PARTNER_GET_XIHPA
PM_PARTNER_PUT_XIHPA
PM_PARTNER_REFRESH_XIHPA
these are the bapis which are dealing with the IHPA table,
Segregate them as needed and then go to the std program
Revert for further clarification.
Thanks
Sri -
Query to find out tables using view
Hi
I have a views using three tables.Now i wanted a query to find out number of views using three tables
I have written a query
select * from dba_views where text like '%SELECT%;
It is giving me error as ora error EXPECTED NUMBER GOT LONG.
Appreciate your help?SELECT DECODE(referenced_type, 'NON-EXISTENT', '.....',
referenced_type) || ' ' || referenced_owner ||
'.' || referenced_name r_name, ' is referenced by: ' ||
type || ' ' || owner || '.' || name name,
' Referenced Link: ' || DECODE(referenced_link_name,
NULL, 'none', referenced_link_name) r_link
FROM dba_dependencies
-- WHERE owner NOT IN ('SYS', 'SYSTEM')
-- and rownum < 50
ORDER BY 1,2;
add your own where clause to it -
Sql to find out non-standard dba_data_file
version 8i-10g
few dbfile were created in $OH/dbs dir in few databases in tivoli tablespace (can be dropped and re-cretaed without issues) , i am working on this to fix that.
what would be sql script to create report of all databases , having db files created in $OH/dbs location in tablespace like 'TIV%'
may be need help adjust this to show db name ....
SQL> select TABLESPACE_NAME, FILE_NAME
2 from dba_data_files
3 where TABLESPACE_NAME like 'TIV%'
4 ;
TABLESPACE_NAME
FILE_NAME
TIVOLIORTS
/u01/app/oracle/product/8.1.6/dbs/tivoliorts.dbfIt might be actually easier if you approach the problem the other way round - by finding out which database each of the files in the directory belong. This can be done by issuing a fuser command on the file to see which processes have the file open and then a ps command to see the database that has it opened. Something like:
$ fuser swf_th_data01_01.dbf
swf_th_data01_01.dbf: 9900o 6917o 28306o 846o 29413o 29411o 13633o 13615o 13600o 13176o 13146o 13134o 13120o 13100o 13090o
$ ps -ef |grep 9900
oracle 9900 1 0 Mar 01 ? 0:10 oracledoith7 (LOCAL=NO)Edited by: Lakmal Rajapakse on 05-Mar-2010 08:25 -
How to find out object / schema / database level replication is active
Hi,
I am an experienced DBA but new to streams and I am asked to support an existing streams configuration between two Oracle 10g databases. I was told it is bi-directional but one database is standby and it never took traffic. My questions are
1. How will I find out whether it is a database or schema level replication? Any queries that I can run to find it out?
2. How do I find out it is bi-directional and it iis current. What queries I can run to confirm?
3. How will I find out the excluded objects? Any queries please...
Thanks for the help
Regards
Ramahttp://www.morganslibrary.org/reference/dyn_perf_view.html#dyst
SELECT name FROM dba_dependencies
WHERE referenced_name = 'DBMS_STREAMS_ADM' AND name LIKE 'DBA%'
UNION
SELECT referenced_name FROM dba_dependencies
WHERE name = 'DBMS_STREAMS_ADM' AND referenced_name LIKE 'DBA%';
Maybe you are looking for
-
How do I clone Parallels partition for migration to another computer?
I have Parallels on my MBP (Lion OSX). In Parallels (Windows 7 operating system), I have internet banking set up and since this was very difficult to do, I want to migrate the Parallels partition in the same state that it's in to the new computer. Th
-
Hi, I bought my Iphone5 last yr, but now accidentally my iphone was locked and I forgot my apple Id and the password. Please help me how to reset and unlocked my iphone. Thanks
-
How do can I have the form fill in a check box if the user has entered text in a textbox?
I have a form that is submitting an xml data file that is picked up by MS Word and used to populate a document. However, there's a 'Miscellaneous' field where the user can type in addtional information that would not drop easily into the Word documen
-
Hello. We are on SRM 5 and use classic extended. For purchase order approvals, the moment the approver enters their managers inbox and hit the detail icon (magnifying glass), they are getting the error message "Transaction Cont in Unknown" I cannot f
-
RollbackException hiding other exceptions in WL 5.1
Hi, over here we're using Javlin (www.exceloncorp.com) as data resource under Weblogic 5.1.0 (latest SP). One of the characteristics of Javlin is that it can throw a com.odi.jmtl.GlobalTransaction.AbortAndRetryException