Need query to find out whether exactly 2 columns are used in any index ?

Suppose i have two columns ID and Status (or any number of columns ) belongs to table customer...
Now I want to create below index
Ex. create index test1 on customer (ID , Status )
But before creating this index i want to check that whether there is already index on these 2 columns ? May be by other name ?
Need query for this.
Plz help.

Hi Shubhangi,
Your requirement is very difficult to fulfill , i have made an attempt to replicate your reqrmnt & write a query wherein you need to compromise on few things , let us see if it works for you
Supply table_name/owner & Number of column on which you want to find indexes
e.g.
select distinct INDEX_NAME,column_name
from dba_ind_columns
where index_name in (select distinct index_name
from dba_ind_columns
where table_name='&table_name'
and table_owner='&owner'
having count(column_name)=&column_count group by index_name);
Enter value for table_name: ADDRESS
Enter value for owner: ASAP
Enter value for column_count: 2
INDEX_NAME COLUMN_NAME
FKIDX_AD__SF_ST_FO SF_STRUC_FORMAT_NM
FKIDX_AD__SF_ST_FO SF_TYPE_NM
SQL> /
Enter value for table_name: ADDRESS
Enter value for owner: ASAP
Enter value for column_count: 3
INDEX_NAME COLUMN_NAME
FKIDX_AD__SF_ST_FO_1 POSTAL_CD
FKIDX_AD__SF_ST_FO_1 SF_STRUC_FORMAT_NM
FKIDX_AD__SF_ST_FO_1 SF_TYPE_NM
Thanks,
Ajay More
http://moreajays.blogspot.com

Similar Messages

  • Query to find out whether a table is sub-partitoned , composite type one

    Could you please let me know the query to find out whether a paritioned table
    is
    1). composite paritioned one.
    2). sub-paritioned one.
    I find that there are 2 cols in all_tab_partitions view, which lets me know
    1). COMPOSITE VARCHAR2(3)
    To find composite paritioned one or not.
    2). SUBPARTITION_COUNT NUMBER
    To find whether a table is sub-paritioned one or not.
    Any light on the above topic is highly appreciated.

    So it seems you've found the answer yourself?
    with »user_tab_partitions« and »user_tab_subpartitons« you'll get all the neccessary information you are looking for.

  • How to find out whether a material code in SAP has any transaction history

    Hi Guys,
    I want to find out whether a material code in SAP has any transaction history or not. In other words, I want a list of all those materials, division-wise, which have not been subjected to any sort of transaction in SAP till date , i.e., lying unused.
    Can any of you in help me out regarding this matter ?
    Regards,
    Anirban

    hhi
    go to se16
    table         MBEW  and field LBKUM for total stock
    from here u can conclude for the zero stock material
    or try this
    S_ALR_87012963 - Material Where-Used List
    regards
    kunal

  • Query to find out whether bios password is enabled or disbaled.

    Hi All,
    Can any 1 help me identify the table to find out whether BIOS Password is enabled or disabled. Please provide the SCCM Table name. Thanks.

    To my knowledge, there is no existing standardised way to do this, because it is a hardware-specific feature, which can only be offered by the hardware manufacturer, and then only if the manufacturer develops/provides a suitable WMI Provider to do so.
    Then if so, you would need to enable custom WMI class inventory via ConfigMgr HINV.
    So, you would need to check with the manufacturer of your hardware, to confirm if they offer these features.
    Don
    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
    This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

  • Need query to find out the sum till a period

    Hi,
    I need to write one query to find out the cumulative sum of raw_cost of table pa_budget_lines till the specified period, I tried to do this by analytical function, but that is not working in Report 10g. Can anybody help me in this.
    Thanks

    not familiar with report but could you do something like this
    with t as
      select 1 grp, 10 * level the_cost, add_months (sysdate,  level) effective_dt from dual connect by  level < 11 union all
      select 2 grp, 5 * level the_cost, add_months (sysdate,  level) effective_dt from dual connect by  level < 11
    input as
      ( select null grp, null the_cost, null running_total,  v_eff_dt effective_dt   from dual)
    select * from(
    select t.grp, t.the_cost, sum(t.the_cost) over (partition by t.grp order by t.effective_dt) running_total, t.effective_dt,
           lead(t.effective_dt) over (partition by t.grp order by t.effective_dt) next_effective_dt,
           input.effective_dt  inp_eff_dt
    from t, input
    where inp_eff_dt between effective_dt and next_effective_dtv_eff_dt would be the input date you are interested in

  • How to find out whether the transaction logs are being truncated or not

    Hi,
    We are using Veritas Backup tool for Backups and restores on our MS SQL 2000.
    One of our Veritas Tech has disabled the Truncation of Transaction Log Backup using the Job setup in Veritas. We want to confirm whether the Truncation is happening or not. I don't see any difference in the Transaction Log file size.
    How to find out whether truncation is active or not?
    Thanks
    Vijay

    Hello Vijay,
    On MSSQL truncation of transaction log does not shrink the size of the transaction log. It simply removes the content within the transaction log and writes it to the backup.
    Meaning the free percentage within the transaction log will increase.
    If you want to Resize the transaction log size, you need to do something else.
    The shrinking procedure is given here:
    http://support.microsoft.com/kb/907511
    Regards,
    Siddhesh

  • How to find out FICO user exits that are used by User

    How to find out the FICO user exits that are used by user.

    Go to tcode CMOD. In the project field drop down your list there. Put a Z* there and run the list. These should be all the exits that are activated. Search for the ones that pertain to FI. You can also search by development class. You need a little ABAP knowledge to search easily. You get this by going to the tcode then to status then to the program then to the attributes. There you find the development class. Ie FBAS.
    pls assign points if helpful as a way to say thanks.

  • Need query to find out object Accessibility

    Hi Gurus,
    I am in need of a query that can show object accessibiliy .i.e
    given table can be accessed by which all oracle users.
    it should take into account grants given by roles.
    Please help.
    Regrads

    user5228856 wrote:
    the solution you give me l give me a all out report ,
    what i need is
    select <<>>
    from <<>>
    where object_name = owner.object_name
    result set should return what all db user has select priv on the given object.site below contains desired code
    http://www.petefinnigan.com/tools.htm

  • Need query to find out standby database sync information

    Hi All,
    Please provide me query which give me information about how many standby database configured .I need to generate report hourly sync information of database in our project. I have more than 120 production db and some db having more than one standby database.some of then at local satndby (some of database (prod) in datacenter and some of database in DR datacenter)
    Does it it possible to configure in 12c oem?.If it is possible guide me.How can I create report for all databases sync status within one report?
    Thanks
    Ganesh

    Hello;
    I like this one:
    Monitor Data Guard Transport
    Best Regards
    mseberg

  • How to find out the exact version of web server 7.0

    Dear all,
    I am using currently web server 7.0 and in error logs its shows me following version
    Sun Java System Web Server 7.0 B12/04/2006 10:15
    what i need how to find out what exact version i am using in my webserver 7.0 is it update 6 or update 7 or update 8
    how to find out what exact version i am using in web server 7.0.....
    thanks and regards
    tiger

    Web Server tells you specifically which Update release in the string you quote (in your string you are running the original release of Web Server 7.0).
    My server is currently running Web Server 7.0 Update 7. The startup string looks like:
    [19/Jan/2010:11:18:27] info (15407): CORE1116: Sun Java System Web Server 7.0U7 B12/14/2009 22:58

  • Need query to find rows

    hi
    i need query to find out for one perticular row from parent table ,,which references how many rows in how many child tables , and child to child tables. in herirachy fashion.
    if anybody know please help me

    I guess it would be difficult to come up with a generic script to get answer that can help in all situations...you have to see the table definitions in your schema and try...like in case of emp and dept table,
    select * from dept where deptno in
    (select deptno,count(*) from emp group by deptno having count(*)>1)
    (this gives rows from dept table where , for corresponding deptno there are more than one rows in emp table).
    Thanks
    Nirav

  • HT1316 I just bought a 3G, GSM, AT&T compatible (i-Phone) on Amazon. I need to find out whether it uses regular or micro (sim) card.

    I just bought a 3G, GSM, AT&T compatible (i-Phone) on Amazon. I need to find out whether it uses regular or micro (sim) card. The phone has not been delivered yet.

    iPhone 3G and iPhone 3GS (iPhone 3 series) both use regular SIM Card.
    iPhone 4 GSM and iPhone 4S (iphone 4 series) use micro SIM Card.
    The iPhone 3 series can use micro SIM with special adapter.

  • How to find out whether Oracle database was upgraded ??

    Hi,
    I need to find out whether my Oracle database was upgraded, If yes how to find out by SQL query .I know their is database_properties table, but when I try to query that it didnt gave me the output which I required.
    Like in SAP we have uvers table which keep info about the upgrade history, whether such history is avaliable in oracle ?? . Iam looking out for output which is like old database Release 9.2.0.7 and new database release 10.2.0.2.
    Whether similar such history is maintained in Oracle database.
    Awaiting for your feedback.
    Kind Regards
    Neenad

    Hi all,
    After checking all the material,I dont think prior to 10g, oracle register its earlier version.
    The views of v$version show the current version for various components and also dba_registry displays info about catlog/catproc versions.
    In 10g, you can use the following query to know the version when the database was broughtup.
    select startup_time,version,db_name from dba_hist_database_instance.
    Anways thanks to all of you.
    Kind Regards
    Neenad

  • How to find out whether a particular changed by some user

    Hi gurus,
                I am just trying to figure it out how to find out whether a particular user has changed a particular table or not. In other words table changes history. If any of you know about it please let me know.
    Thankyou
    Jason

    Jason,
      Ajay mentioned changes to Table not for Data. If you are looking for Changes to Table Data... you need to check System Log SM21. check for that perticular period.
    Nagesh Ganisetti.
    Assign points if it helps.

  • Query to find out the list of user who have delete access

    Hi,
    I need a query to find out the list of users who have delete access on perticular folder/universe/ reports  in infoview.
    Please advice.
    Regards,
    Neo.

    orton607 wrote:
    thanks for replying guys. But the thing is i am using dynamic sql execute immediate in my package, so i want those tables also and the schema name.
    thanks,
    ortonThis is not possible. The best you could do is to have a good guess.
    Or how would you parse some dynamic statement as this:
       v_suffix := 'loyees';
       v_sql := 'Select count(*) from (select ''nonsense'' col1 from emp'||v_suffix||') where col1 = ''Y'''';
       execute_immediate(v_sql);
    ...What is the table name? How do you want to parse that?
    Better rewrite all dynamic SQL statements into non dynamic ones. Or do the source control logic for those dynamic parts in an extra module. For example implement your own dependency table and force every developer to add there all dynamic parts.

Maybe you are looking for

  • Adobe Acrobat 8 - file updates not installing on Win 7 Professional

    How do I install MSP file updates to Adobe Acrobat after downloading them? I have just installed Acrobat 8.0 from the original installation CD on a new PC running Windows 7 Professional (64 bit) and have downloaded the update to 8.1.0 to begin with,

  • Print Cartridge Problem: Tricolor - HP Officejet J4680 All In One

    I am seriously going to have an anxiety attack. I run a business from home & I HAVE to have a printer. I just spent $50 on new ink cartridges. My printer was working fine for the last week, and then tonight I have this error message: Print cartridge

  • Test.jsp not able to display the output from the java code.

    when i try to invoke http://localhost/papz/test.jsp I dont see anything. The page is blank. And there are no error messages in any log files. When i click on view source in IE i get to see the entire source code, including the jave code. <html> <head

  • Issue with VC/2 - not fetching the invoice details

    Hi All, We have an issue with TCode VC/2 in ECC 6. This is not fetching( not showing) the Invoice documents under the header "Last SD Documents". It is fetching the sales documents like orders, credit memo/debit memo requests but not the invoice docu

  • Recovery of documents deleted from sharepoint online

    Hi, Is there a way to recover a document that is deleted and purged from the secondary/administrator recycle bin? If not, are there options (third party services, maybe?) or solutions to create some kind of recovery plan beyond that stage? What are y