How to compare index names and columns from different user?

I am using below query to compare two indexes from 2 different users but even though index name and columns are same... result shows me they are different.. what I am doing wrong? Thanks
WITH t AS
        (SELECT COUNT (DISTINCT index_owner || index_name || indexed_cols)
                   cnt
           FROM (  SELECT index_owner,
                          index_name,
                          listagg (column_name, ',')
                             WITHIN GROUP (ORDER BY column_position)
                             indexed_cols
                     FROM dba_ind_columns
                    WHERE index_name='XPKTBL_A'
                 GROUP BY index_owner, index_name))
SELECT CASE
          WHEN cnt > 1 THEN 'Indexes are different'
          WHEN cnt = 0 THEN 'Indexes dont exist'
          WHEN cnt > 1 THEN 'Indexes are identical'
       END
          commnt
  FROM t
Result:
Indexes are different
but Actually if you check below they are same After when I run this query:
SELECT index_owner,
         index_name,
         listagg (column_name, ',') WITHIN GROUP (ORDER BY column_position)
            indexed_cols
    FROM dba_ind_columns
   WHERE index_name='XPKTBL_A'
GROUP BY index_owner, index_name;
Result:
Index_owner
Index_name
Index_cols
USER1
XPKTBL_A
FIELD_A1
USER2
XPKTBL_A
FIELD_A1

Hi,
Erhan_toronto wrote:
I am using below query to compare two indexes from 2 different users but even though index name and columns are same... result shows me they are different.. what I am doing wrong? Thanks
WITH t AS
        (SELECT COUNT (DISTINCT index_owner || index_name || indexed_cols)
So index_owner is 'USER1' in one case, and 'USER2' in the other; right?
A string that starts with 'USER1' will be distinct from a string that starts with 'USER2', no matter what the rest of the string contains.  Maybe you don't want to compare the owners, or maybe you meant to use some other column (such as table_name) instead of index_owner).
I hope this answers your question.
If not, post a little sample data (CREATE TABLE, CREATE INDEX and CONNECT statements), and also post the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002

Similar Messages

  • Can Verity/Solr index files AND columns from db into one resultset?

    Hi,
    I have a form where users upload a document and also add some meta data that goes with the document.  I currently store the meta data in the db and the actual document on the file system.
    How can I use Verity/Solr to index files and columns from a database table so it will return one recordset?
    -ws

    <cfindex type="file"> should do the trick, shouldn't it?
    http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7d 04.html
    Adam

  • How do I transfer files and documents from one user account to another?

    How do I transfer documents and files from one user account to another?

    You haven't understood me. Follow these steps:
    1. Log in the user where are the files you want to transfer, and open a Finder window.
    2. In Finder, select Go menu (on the menu bar) > Go to Folder, and type /Users/Shared. Now you're on Shared folder, so leave that window.
    3. Open a new Finder window without closing the old one, go to the folder with the files you want to transfer, and copy them to Shared folder.
    4. After copying the files to Shared folder, go to  > Log Out, and log in the other user.
    5. Repeat the step 2, and you will get access to the transferred files. Now, you can open them directly from this folder, or you can copy them to a folder on your user folder

  • How do I share photos and music between different user accounts on the same macbook

    How do I share photos and music between different user accounts on the same Macbook? i.e. I want all to be able to access family photos when logged into their respective accounts. Same goes for the iTunes library. Hope this is possible...
    Thanks!

    To give other users read-only access to your iTunes library, use the Sharing features of iTunes. Sharing works over the local network as well as on the same computer. See the built-in help for details.
    To give others selective access to your iPhoto library, you have the option of using iCloud Photo Sharing, if the privacy implications don't bother you. The images will be stored temporarily on Apple servers.
    If you want to give full read/write access to more than one user, see the support articles linked below.
    iTunes: How to share music between different accounts on a single computer
    iPhoto: Sharing libraries among multiple users
    There is a way to share the library without moving it to a secondary volume. If you really need to do that, ask for instructions.

  • How can I share applications and softwares with different users of the same computer?

    First question: How can I share applications and softwares with different users of the same computer?
    Second : Can I use 2 different I cloud accounts to synt 2 iphones with one computer?

    Applications installed on the admin account are available to all user accounts unless Parental Controls are enabled.
    Yes.   Separate user accounts, help here >   How to use multiple iPods, iPads, or iPhones with one computer

  • How to compare the names and types columns of two tables?

    Assume I have two tables aaa and bbb
    How do I compare the columnnames and types of the two columns?
    It should not matter if one of them has e.g. an additional index.
    Furthermore it does not matter if the rows/row values differ.
    Peter

    SQL> desc emp
    Nome                   Nullo?   Tipo
    EMPNO                  NOT NULL NUMBER(4)
    ENAME                           VARCHAR2(10)
    JOB                             VARCHAR2(9)
    MGR                             NUMBER(4)
    HIREDATE                        DATE
    SAL                             NUMBER(7,2)
    COMM                            NUMBER(7,2)
    DEPTNO                          NUMBER(2)
    SQL> desc emp2
    Nome                   Nullo?   Tipo
    EMPNO                  NOT NULL NUMBER(4)
    ENAME                           VARCHAR2(10)
    MGR                             VARCHAR2(10)
    HIREDATE                        DATE
    SAL                             NUMBER(7,2)
    COMM                            NUMBER(7,2)
    DEPTNO                          NUMBER(2)
    NEWCOL                          NUMBER
    SQL> with t1 as
      2  (select column_name, data_type from user_tab_columns where table_name='EMP'),
      3  t2 as
      4  (select column_name, data_type from user_tab_columns where table_name='EMP2')
      5  Select a.column_name, a.data_type, b.column_name, b.data_type
      6  from t1 a full outer join t2 b on a.column_name=b.column_name;
    COLUMN_NAME                    DATA_TYPE                      COLUMN_NAME                    DATA_TYPE
    EMPNO                          NUMBER                         EMPNO                          NUMBER
    ENAME                          VARCHAR2                       ENAME                          VARCHAR2
                                                                  NEWCOL                         NUMBER
    MGR                            NUMBER                         MGR                            VARCHAR2
    HIREDATE                       DATE                           HIREDATE                       DATE
    SAL                            NUMBER                         SAL                            NUMBER
    COMM                           NUMBER                         COMM                           NUMBER
    DEPTNO                         NUMBER                         DEPTNO                         NUMBER
    JOB                            VARCHAR2
    Selezionate 9 righe.Max
    http://oracleitalia.wordpress.com
    Edited by: Massimo Ruocchio on Feb 21, 2010 1:27 AM
    Changed query.

  • How to prevent middle names and titles from appearing in contacts

    My iPhone is syncrhonised with MS Outlook, and I've used Outlook as my system of record for contacts for many years. I have hundreds of contacts in Outlook, many of which contain middle names and titles.
    The problem is that the iPhone displays every contact as Title FirstName MiddleName Surname Suffix. For many of my contacts, particularly when viewed in the Favourites list, I can't even see the contact's surname because the contact's title, first name and middle name(s) take up so much of the row.
    How can I stop my iPhone from displaying titles and middle names? Is there a setting somewhere in iTunes that will prevent these fields from being transferred to the iPhone?

    @NFH
    I am also experiencing this problem, but I think it started with one of the later iOS 3.x releases or possible iOS4. All of my contacts display their job title (eg. "Senior Vice President of Worldwide Sales & Operations") which given the screen real estate means that NONE of the actual Contact name is visible.
    This is only happening on my iPhone 3GS (iOS 4.0.2) and does NOT happen on my Mac, my me.com, nor on my iPad (iOS 3.2.2). Which, again leads me to believe this problem was introduced in iOS4.

  • How to set file name and destination folder without user interaction

    how can I set the file name and destination folder to generate a pdf file like "c:\myfolder\document.pdf" in this folder automatically.
    Is there a tag in .joboptions ?
    Goal: User click print button. In the background a pdf will be generated in e.g. "C:\myfolder\document.pdf".
    that`s it.
    I know that the query dialog for save as can be turned off. But the file name depends on the application.
    Thanks for your help.
    TK

    Hello,
    Please post this  in  PI forums
    Regards, Anil

  • How to compare SSIS Variable and Column In the table!!.

    Hi Folks,
    My Requirement IS :
    1<sup>st</sup>run: if the record does not exist
    in the table insert the record (file_name, last_modified_file_date) and create a copy in the archive folder with file_name_currentdate.csv
     Daily run:
    retrieve the last_modified_file_date from the input file and check if the retrieved date is greater than the last_modified_file_date in the table:
    If true:
    create a copy of the input file in the archive folder and update the last_modified_file_date in the table with the retrieved date
    If false don’t do nothing because the file has been archived in one of the previous runs.
    I have already retrieving the modified date and File Nae iserting into Filename Table: (That table has 2 columns which are FileName and FileDate) so In script task everytime the variable getting Modified date(retrieve the last_modified_file_date
    from the input file) could yu please give me idea after that how I can Compre the existing table record and variable. I have already
    imported the all Filenames and Modified into table like below.
    Could you please give your ideas friends.

    Try this:
           1) Execute SQL Task (In the Parameter mapping, pass filename and fileLastModified date retrieved from the file - your SSIS Variable)
           2) In the ‘SQL statement’, Write a TSQL like this:
    --declare these variables before the use
    SET @filename=?
    SET @fileLastModifieddate=?
    --declare @MaxLastTblDate and @flag=0
    select @MaxLastTblDate = Max(last_modified_file_date) from Table T1
    If (@fileLastModifieddate>@MaxLastTblDate)
    --Do your insert here
    --Update the variable with @flag (say 1)
    3) Set the value of @flag in the Result set of Execute SQL (another SSIS variable)
    4) In the next control flow component, do the file archiving.
    5) Between these two components, check the value of the @flag variable in the precedence constraints (whether to copy the file for archiving or not)
    Hope this helps.

  • How to take other music and photo from a librery different from the first  ipod was sync?

    how to take othe music and photo from different librey than the first used, without loose the photo and music alredy stock in ipod ?

    See this: Using iPad or iPod with multiple computers, http://support.apple.com/kb/ht1202

  • How to find index name with primarykey and column on a table?

    Hi,
    how to find index name with primarykey and column on a table?
    please help me.
    Thankyou.

      1  select ac.table_name, ac.index_name, aic.column_name
      2  from user_constraints ac, user_ind_columns aic
      3  where ac.constraint_type = 'P'
      4   and  ac.index_name = aic.index_name
      5* order by 1,2,3
    SQL> /
    TABLE_NAME                 INDEX_NAME                COLUMN_NAME
    ACTION_TABLE                 SYS_C0011033                NESTED_TABLE_ID
    ACTION_TABLE                 SYS_C0011033                SYS_NC_ARRAY_INDEX$
    CATEGORIES_TAB                 SYS_C0011038                CATEGORY_ID
    CUSTOMERS                 CUSTOMERS_PK                CUSTOMER_ID
    INVENTORIES                 INVENTORY_IX                PRODUCT_ID
    INVENTORIES                 INVENTORY_IX                WAREHOUSE_ID
    LINEITEM_TABLE                 SYS_C0011034                NESTED_TABLE_ID
    LINEITEM_TABLE                 SYS_C0011034                SYS_NC_ARRAY_INDEX$
    ORDERS                      ORDER_PK                 ORDER_ID
    ORDER_ITEMS                 ORDER_ITEMS_PK                LINE_ITEM_ID
    ORDER_ITEMS                 ORDER_ITEMS_PK                ORDER_ID
    PRODUCT_DESCRIPTIONS            PRD_DESC_PK                LANGUAGE_ID
    PRODUCT_DESCRIPTIONS            PRD_DESC_PK                PRODUCT_ID
    PRODUCT_INFORMATION            PRODUCT_INFORMATION_PK           PRODUCT_ID
    PROMOTIONS                 PROMO_ID_PK                PROMO_ID
    WAREHOUSES                 WAREHOUSES_PK                WAREHOUSE_ID
    16 rows selected.

  • How to get string (specified by line and column) from txt file with labview

    Hi everyone
    How to get string (specified by line and column) from txt file with labview
    thx 
    Solved!
    Go to Solution.

    As far as I know, a text file has no columns.  Please be more specific.  Do you mean something like the 5th word on line 4, where words are separated by a space, and lines are separated by a newline character?  You could the Read from Spreadsheet String function and set the delimiter to a space.  This will produce a 2D array of strings.  Then use index array and give the line number and column number.
    - tbob
    Inventor of the WORM Global

  • How do I get Calendar to suggest name and address from Contacts on my iPhone 5 in iOS 8?

    How do I get Calendar to suggest name and address from Contacts on my iPhone 5 in iOS 8?

    Restore it from your backup.

  • I am trying to edit track names and genres from the library in iTunes, but the Get Info window has everything in grey, so I cannot edit anything. How do I edit?

    I am trying to edit track names and genres from the library in iTunes, but the Get Info window has everything in grey, so I cannot edit anything. How do I edit? Any ideas?

    I have the same problem since I installed iTunes 11.1.0.126.

  • How can i recover my admin name and password from my i mac. i could not get through to it.

    how can i recover my admin name and password from my i mac. i could not get through to it.

    What do you mean "I could not get through to it" Are you trying to login remotely?

Maybe you are looking for