Intriguing Data Dictionary Query

Database table column names are limited to 30 characters (as verified by ALL_TAB_COLUMNS Data Dictionary table).
Why, then, is the COLUMN_NAME column of the ALL_CONS_COLUMNS defined as a VARCHAR2(4000)?
This is neither urgent nor business-critical to say the least but I still find it intriguing.

I saw this on Metalink once. A user was having an application problem. Apparently the app tried to get data from all_cons_columns and this caused errors. Oracle's response was that Oracle makes changes to the dictionary from time to time and this is not considered a bug. No reason was given for the column being 4000 (I think the words were that the tech didn't know of a reason for the change). Unbreakable maybe, but not immuned from the occasional typo, huh ? *grin                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Data Dictionary query takes too much time.

    Hello,
    I am using ORACLE DATABASE 11g.
    The below query is taking too much time to execute and give the output. As i have tried a few Oracle sql hints but it dint worked out.
    SELECT
    distinct B.TABLE_NAME, 'Y'
      FROM USER_IND_PARTITIONS A, USER_INDEXES B, USER_IND_SUBPARTITIONS C
    WHERE A.INDEX_NAME = B.INDEX_NAME
       AND A.PARTITION_NAME = C.PARTITION_NAME
       AND C.STATUS = 'UNUSABLE'
        OR A.STATUS = 'UNUSABLE'
        OR B.STATUS = 'INVALID';Please guide me what to do ? to run this query in a fast pace mode ...
    thanks in advance ..

    Your query is incorrect. It will return ALL tables if A.STATUS = 'UNUSABLE' or B.STATUS = 'INVALID'. Most likely you meant:
    SELECT
    distinct B.TABLE_NAME, 'Y'
      FROM USER_IND_PARTITIONS A, USER_INDEXES B, USER_IND_SUBPARTITIONS C
    WHERE A.INDEX_NAME = B.INDEX_NAME
       AND A.PARTITION_NAME = C.PARTITION_NAME
       AND (C.STATUS = 'UNUSABLE'
        OR A.STATUS = 'UNUSABLE'
        OR B.STATUS = 'INVALID');But the above will return subpartitioned tables with invalid/unusable indexes. It will not return non-subpartitioned partitioned tables with invalid/unusable indexes/index partitions same as non-partitioned tables with invalid/unusable indexes. If you want to get any table with invalid/unusable indexes you need to outer join which will hurt performance even more. I suggest you use UNION:
    SELECT  DISTINCT TABLE_NAME,
                     'Y'
      FROM  (
              SELECT INDEX_NAME,'Y' FROM USER_INDEXES WHERE STATUS = 'INVALID'
             UNION ALL
              SELECT INDEX_NAME,'Y' FROM USER_IND_PARTITIONS WHERE STATUS = 'UNUSABLE'
             UNION ALL
              SELECT INDEX_NAME,'Y' FROM USER_IND_SUBPARTITIONS WHERE STATUS = 'UNUSABLE'
            ) A,
            USER_INDEXES B
      WHERE A.INDEX_NAME = B.INDEX_NAME
    /SY.

  • SQL remote query and data-dictionary

    Hi,
    We are considering the implementation of SAP Business One 2005. I've installed a demo version but in order for it to continue to support some business functions I need to perform a number of SQL queries against the data. Unfortunately I'm having difficulties in getting the answer from our reseller.
    Does anyone know the answers to the following question. I'd very much appreciate some help.
    1) Is there a data-dictionary document showing which tables perform which roles and the associated joins/associations.
    2) Is it 'advised' to open the SAP datasource directly to perform a SELECT query to obtain the results or should a third-party tool be used?
    3) Do I need the SDK if I want to perform direct SELECT queries or if I want to automate posting invoices to SAP? We have competent programmers in the company - I believe they use VB6 and VB.net.
    4) Is there an example if I simply wanted to query all suppliers within SAP? (e.g. SELECT NAME FROM Supplier_tbl...etc..etc)
    Any help would be very much appreciated - it's a huge application and I'm struggling a little.
    Many thanks,
    Gavin Russell.

    Gavin,
    The forum that you have posted your questions in is or questions related to the SAP Business One Integration for SAP NetWeaver.  Your questions seem to be along the line of general data access to SAP Business One.  You should typically post those types of questions in the SAP Business One Discussion Forum or the SAP Business One SDK Discussion Forum.
    As to your questions ...
    1.  The definition of the SAP Business One table schema is part of the SAP Business One SDK Help Center documentation.  You simply need to install the SAP Business One SDK Help and you will have it.  There is not a "data dictionary" other than this documentation.
    2.  Typically any direct access to SAP Business One data using SQL is discouraged as if data corruption occurs as a result of it, the environment would not then be supported by SAP.
    3.  If you want to push data into SAP Business One, as stated, direct access to the Business One database is forbidden.  You would use the SAP Business One SDK for this.
    4.  You can use the SAP Business One Query Manager/Wizard in the SAP Business One product which in essence is performing SQL type SELECTS for data on Business One tables.
    HTH,
    Eddy

  • Slow response when query v$lock or some data dictionary

    Hello,
    We have a severe problem with our database performance problem. Here is the situation:
    1. When query data dictionary such as v$lock from any Windows machine on the network, the performance is slow (about 3 minutes.)
    2. When query v$lock directly on the server where database reside, the query come back fast (normal).
    3. When query user table such as employees from any windows machine on the network, the performance is normal.
    4. When query user table directly from server where the database reside, the query come back normal.
    Looking at v$session_wait on the slow query, it is waiting on "SQL*Net message to client".
    We have people from our network group, security group and did not find anything problem.
    Thank for you help!!!

    user8175606 wrote:
    Hello,
    We have a severe problem with our database performance problem. Here is the situation:
    1. When query data dictionary such as v$lock from any Windows machine on the network, the performance is slow (about 3 minutes.)
    2. When query v$lock directly on the server where database reside, the query come back fast (normal).
    3. When query user table such as employees from any windows machine on the network, the performance is normal.
    4. When query user table directly from server where the database reside, the query come back normal.
    Looking at v$session_wait on the slow query, it is waiting on "SQL*Net message to client".
    We have people from our network group, security group and did not find anything problem.
    Thank for you help!!!I saw the same problem several times. All of them were related with wrong execution plan in the v$lock (and dba_locks, and others based on v$lock). For instance due to "crazy" optimizer mode FIRST_ROWS.
    Also look at note 431770.1.
    I suggest that when you looked at v$session_wait and saw the event "SQL*Net message to client" state of the event was not = WAITING. Please check. It means that Oracle is not waiting but is burning CPU.
    Thus, please let us know - does another optimizer mode improve performance?
    select /*+ all_rows */ * from v$lock;
    select /*+ rule */ * from v$lock;

  • Query Data Dictionary

    I want to know the queries to found out the following:
    What query would you use to determine the most popular column name in the tables of your database?
    What query would you use to determine the attributes that are found in the dba_synonyms data dictionary that are not found in the user_synonyms data dictionary?

    Column names and how many times each used:
    select COLUMN_NAME , count(COLUMN_NAME)
    from dba_tab_columns
    where owner not like '%SYS%'
    group by COLUMN_NAME
    having count(COLUMN_NAME) > 1
    order by count(COLUMN_NAME)
    The other request, I didn't understand it.

  • UCM Data Dictionary SQL Query for Determining IP Address

    Forum,
    I am trying to determine the IP address(es) of the UCM cluster servers.  Using the UCM Data Dictionary and tables such as 'processnode' will provide information such as
    procnodename                      description                isactive macaddr procnodeid systemnode typenodename typeprocessnode
    ================================= ========================== ======== ======= ========== ========== ============ ====================
    EnterpriseWideData                                           t                1          t          Subscriber   CUCM Voice/Video
    usa109-s4pub01                    UCM 10.0 Publisher         t                2          f          Publisher    CUCM Voice/Video
    usa109-s4sub01                    UCM 10.0 Subscriber        t                3          f          Subscriber   CUCM Voice/Video
    usa109-s4cup01.lab.shoregroup.com UC Presence 10.0 Publisher t                9          f          Publisher    CUCM IM and Presence
    usa109-s4cup02.lab.shoregroup.com UC Presence 10.0 Publisher t                11         f          Subscriber   CUCM IM and Presence
    'callmanager' table does not provide a field for IP...'processnode' only had 'ipv6name' field...
    If the node using DNS to resolve name-to-IP as shown above...I have not found a way to obtain the IP address of the UCM node itself.  I know I can go to the CLI of a node a issue a command to obtain...but I have not found a Data Dictionary table to obtain the results. 
    I am open for suggestions...thx.

    If, in CCMAdmin, you've got server hostnames rather than IP addresses, CallManager will use DNS to get the IP addresses of the other servers.
    GTG

  • Data Dictionary View for Procedure Text

    Hi,
    Is there a data-dictionary where I can see the body of procedures. In fact, I received a request from a collegue to give him the procedure name which access a table "table_1".
    So, my idea is to write a query as follows:
    SELECT <procedure_name> FROM <data_dictionary> WHERE <text> LIKE '%table_1%'.
    Thanks in advance.

    You can try with DBA_SOURCE or USER_SOURCE.
    i.e.
    SELECT NAME FROM DBA_SOURCE
    WHERE OWNER='<OWNER NAME>'
    AND TYPE='PROCEDURE'
    AND TEXT LIKE '%table_1%';
    Regards,
    Sabdar Syed.

  • Various Data DIctionary VIews

    After posting something here a few days back about the myriad views needing to be digested for the Fund.I Exam, I have just gleaned this lot from the Couchman book. No doubt some of the pros out there may well correct me, but this is simple what I have collected from the book, in the last 3 hours. Cheers.
    Dictionary Views
    Data Dictionary
    Which users are in the database password file:
    V$PWFILE_USERS
    Where values set in the init.ora file can be viewed – all parameters:
    V$PARAMETER
    Script used to create the objects that comprise the data dictionary:
    catalog.sql
    To grant a special role to users so they can look at DBA views:
    SELECT_CATALOG_ROLE
    Information about all database objects in the database:
    DBA_OBJECTS
    Information about all tables in the database:
    DBA_TABLES
    Information about all indexes in the database:
    DBA_INDEXES
    Information about all views (including dictionary views) in the database:
    DBA_VIEWS
    Information about all sequences in the database:
    DBA_SEQUENCES
    Information about all users in the database:
    DBA_USERS
    Information about all constraints in the database:
    DBA_CONSTRAINTS
    Information about all table columns that have constraints on them:
    DBA_CONS_COLUMNS
    Information about all columns that have indexes on them in the database:
    DBA_IND_COLUMNS
    Information about all columns in all the tables in the database:
    DBA_TAB_COLUMNS
    Information about all the roles in the database:
    DBA_ROLES
    Information about all object privileges in the database:
    DBA_TAB_PRIVS
    Information about all system privileges granted to all users in the database:
    DBA_SYS_PRIVS
    Displays all PL/SQL source code in the database:
    DBA_SOURCE
    Information about all triggers in the database:
    DBA_TRIGGERS
    Information about object privileges granted to roles
    ROLE_TAB_PRIVS
    Information about system privileges granted to roles
    ROLE_SYS_PRIVS
    Information about roles granted to roles
    ROLE_ROLE_PRIVS
    Information about all tablespaces in the database:
    DBA_TABLESPACES
    Information about all profiles in the database:
    DBA_PROFILES
    For all parameters?
    V$PARAMETER
    General information about the database mounted to your instance:
    V$DATABASE
    Most information about the performance of the database is kept here:
    V$SYSSTAT
    Most information about the performance for individual user sessions is stored here:
    V$SESSION , V$SESSTAT
    Information about online redo logs (2)
    V$LOG, V$LOGFILE
    Information about datafiles
    V$DATAFILE
    Basic information about control files, and the two columns it has:
    V$CONTROLFILE. STATUS / NAME
    An object you can query to obtain a listing of all data dictionary objects (4)
    CATALOG, CAT, DICTIONARY, DICT.
    When the control file was created, Sequence Number, most recent SCN:
    V$DATABASE
    Information stored in different sections of the control file, Sequence Number:
    V$CONTROLFILE_RECORD_SECTION
    To see the names and locations of all control files in the db? (2)
    V$PARAMETER. V$CONTROLFILE
    Tablespace and Datafiles
    Temporary Segments:
    Name, tablespace location, and owner of temporary segments:
    DBA_SEGMENTS
    Size of temporary tablespaces, current number of extents allocated to sort segments, and sort segment high-water mark information. Space usage allocation for temporary segments:
    V$SORT_SEGMENT
    Types of sorts that are happening currently on the database
    V$SORT_USAGE
    To see the username corresponding with the session:
    V$SESSION
    Information about every datafile in the database associated with a temporary tablespace:
    DBA_TEMP_FILES
    Similar to DBA_TEMP_FILES, this performance view gives Information about every datafile in the database associated with a temporary tablespace:
    V$TEMPFILE
    Storage Structures
    A summary view, contains all types of segments and their storage parameters, space utilization settings:
    DBA_SEGMENTS
    Tablespace quotas assigned to users:
    DBA_TS_QUOTAS
    Segment name, type, owner, total bytes of extent, name of tablespace storing the extent:
    DBA_EXTENTS
    The location and amount of free space by tablespace name:
    DBA_FREE_SPACE
    The location of free space in the tablespace that has been coalesced:
    DBA_FREE_SPACE_COALESCED
    Information about datafiles for every tablespace
    DBA_DATAFILES
    Performance view for information for datafiles for every tablespace
    V$DATAFILE
    To see the total amount of space allocated to a table?
    DBA_EXTENTS
    Table creation timestamp, information about the object ID:
    DBA_OBJECTS
    High water mark, all storage settings for a table, and statistics collected as part of the analyze (for row migration) operation on that table
    DBA_TABLES
    Information about every column in every table:
    DBA_TAB_COLUMNS
    To determine how many columns are marked unused for later removal?
    DBA_UNUSED_COL_TABS
    To find the number of deleted index entries ?
    INDEX_STATS
    To determine the columns on a table that have been indexed:
    DBA_ID_COLUMNS
    The dynamic view to show whether the index is being used in a meaningful way?
    V$OBJECT_USAGE
    To see whether a constraint exists on a particular column?
    DBA_CONS_COLUMNS
    To see the constraints associated with a particular table:
    DBA_CONSTRAINTS
    To find the username, ID number, (encrypted) password, default and temporary tablespace information, user profile of a user, password expiry date:
    DBA_USERS
    To all objects, which objects belong to which users, how many objects a user has created?
    DBA_OBJECTS
    Resource-usage parameters for a particular profile:
    DBA_PROFILES
    Identifies all resources in the database and their corresponding cost:
    RESOURCE_COST
    Identifies system resource limits for individual users:
    USER_RESOURCE_LIMITS
    Shows all system privileges:
    DBA_SYS_PRIVS
    Show all object privileges:
    DBA_TAB_PRIVS
    Shows all privileges in this session available to you as the current user:
    SESSION_PRIVS
    Views for audits currently taking place are created by this script:
    cataudit.sql
    a list of audit entries generated by the exists option of the audit command:
    DBA_AUDIT_EXISTS
    A list of audit entries generated for object audits:
    DBA_AUDIT_OBJECT
    A list of audit entries generated by session connects and disconnects:
    DBA_AUDIT_SESSION
    A list of audit entries generated by statement options of the audit command:
    DBA_AUDIT_STATEMENT
    A list of all entries in the AUD$ table collected by the audit command:
    DBA_AUDIT_TRAIL
    To determine the roles available in the database, the names of all the roles on the database and if a password is required to use each role:
    DBA_ROLES
    Names of all users and the roles granted to them:
    DBA_ROLE_PRIVS
    All the roles and the roles that are granted to them:
    ROLE_ROLE_PRIVS
    Which system privileges have been granted to a role:
    DBA_SYS_PRIVS
    All the system privileges granted only to roles:
    ROLE_SYS_PRIVS
    All the object privileges granted only to roles:
    ROLE_TAB_PRIVS
    All the roles available in the current session:
    SESSION_ROLES
    Which object privilege has been granted to a role:
    DBA_TAB_PRIVS
    To display the value of the NLS_CHARACTERSET parameter:
    NLS_DATABASE_PARAMETERS
    DA

    You can also find a lot of stuff by doing:
    SELECT *
    FROM dictionary;

  • How to preserve mixed case in Data Dictionary

    Hi,
    I am very new to Oracle, please excuse in advance for silly questions.
    Using Oracle 9i R2, SQL Developer 1.51.5440.
    I don't know if it's Oracle DB or The SQL Developer tool, but the names of the object I create are all transformed in uppercase. Table name, column names, procedure names all are displayed in uppercase. And yet I make sure when I created them to use carefully mixed case to improve readability. Example: ProductID, MyTable, etc.
    I've gone over the options of SQL Developer, but I didn't see any option to turn off the automatic uppercase. Some objects still remains in mixed case, for example the content of a procedure still looks like when I typed it.
    Is there a way to get the object names to be displayed exactly as I created them?
    Thanks in advance.

    Ok, now I see, make senses that everybody keeps using uppercase. I have tried this:
    CREATE TABLE "MyTable" ("Col1" number not null, "Col2" varchar2(20) not null)
    And indeed, even SELECT * FROM MyTable would not work, I have to reference the table by SELECT * FROM "MyTable"
    FYI, in SQL Server, object names are case-insensitive. The name saved in the data dictionary is exactly how you type them. In the queries, constraints, indexes, etc., you can reference to the object name by any case. I find this way more convenient.
    One more question, in the current schema I am working on, where all object names are uppercase. How come I can still make a query with any case?
    For example if I type in SQL Developer: SELECT ProdUCTID, PrOduCTNaMe FROM T_proDuCT ;
    The query executes OK although I'd expect Oracle would complain about table not found. So are the following rules correct?
    1. If the object name was saved with double quote, Oracle will preserve the case and the object should always be referenced WITH double quote and the exact case.
    2. If the object name was save without double quote, Oracle will uppercase the name and the object can be reference by any case.

  • Indexes in data dictionary

    Hi all,
                can anyone tell me what is the process of creating a secondary index.?
                can we create a secondary index if a field is assigned with primary key?
                 can we create secondary index for a mara table field?
                when we click on INDEXES in data dictionary ---> database table by selecting a field then we get unique index and non-unquie index, what does that mean?
    regards,
    satish

    What is Secondary Index:
    first i will tell u little about primary index.
    The primary index contains the key fields of the table and a pointer to the non-key fields of the table. The primary index is created automatically when the table is created in the database.
    You can create further indexes on a table in the ABAP Dictionary. These are called secondary indexes.
    PURPOSE:
    This is necessary if the table is frequently accessed in a way that does not take advantage of the sorting of the primary index for the access. Different indexes on the same table are distinguished with a three-place index identifier.
    Generally it is used when field which u want is not a primary field .
    Advatange:
    1. faster access to data when field is not a primary key field.
    Disadvatnage:
    1. Slower down database table inset, update delete commands.
    You go for secondary index when you have any SELECT statement which has a WHERE clause which is not effectively using the existing index(s). But this decision of additional index has to be made in sync with the Basis and Functional team. Every additional index will be a burden on the database and the system resources.
    The secondary index is a type of index in database table. Indexes are used to improve the performances of data retrieval from the table. This happens by passing the values to these indices during SELECT query in the WHERE clause.
    There are different types of indices. Primary key is default present for all the tables in database. Only ONE Primary key can exist in a database table. It results in unique records in the database table.
    The other type of index is secondary index. Multiple fields can be grouped to make a secondary index of table. If all the field values is passed during SELECT query, the performance increases drastically.
    Not many fields should be included in secondary index. Large number of fields reduces the performance of INSERT query of database.
    Indexes are used to speed up data selection from the database. System chosse and use the index based on the fields given in WHERE and HAVING clause.
    The primary index is always created automatically in the R/3 System. It consists of the primary key fields of the database table. This means that for each combination of fields in the index, there is a maximum of one line in the table.
    If you are searching on non-key fields, you can create your own secondary index, which can restrict the number of table entries searched to form the result set.
    Improper use of Secondary index can slow down the performance. Discuss with Basis team before creating a secondary index.
    Check the threds -
    secondary index
    Secondary Index
    Primary index: the primary index contains key fiels of a table and a pointer to non-key fields of the table. The primary index is created automatically when a table is created in database and moreover you can further define reference to the primary index which are known as Secondary index.
    How many indexes can be created for a table? -> 9
    When you are selecting the data on non primary key,obviously system will give output with bad performance ,if you create secondary index then it gives better performance
    GOTO SE11 -> give ur table name -> click on display button -> click on index button ->click on create button -> give id ( z98 like ) -> give field names MANDT ,then ur field names
    save and activate
    Regards
    Vasu

  • Discrepancy in OUTPUTLEN in ALV_FIELDCATALOG_MERGE and Data Dictionary

    Hi Gurus,
    I have a program that uses ALV_FIELDCATALOG_MERGE to create a dynamic table. When running it using table VICDCONDCALC or VICDCONDDIST the output length produced for field CALCNUMBER (data element RECDCALCNUMBER) is 6 however when trying to view it in the data dictionary table like DD04L the output length is 5. When I debugged the program there is a statement IMPORT NAMETAB X030L_WA X031L_TAB ID TABNAME. in FM DD_GET_NAMETAB after it passes through this statement the internal table X031L_TAB has the field above with 6 as the External length. Where does the FM retrieved the value 6? Is there any database/transparent table in SAP that I could use to query the table that will produce value of 6?

    There is always a problem with output length in the FM - REUSE_ALV_FIELDCATALOG_MERGE. Go to utilities> settings>ABAP Editor --> Editor --> select the check box Downwards-comp line (72).  Try to run the program I think the output length will be same for both.
    Hope it will work.
    Regards,
    Preetham

  • Slow response  on data dictionary queries with optimizer_mode=rule in  10g

    I have two dataabse: DB1 (9i) and DB2 (10g) on windows 2000
    They are two development databases with the same schemas and same tables. The application executes the same commands but with different results and execution plans.
    In DB2 the queries with the most slow response tima are the queries on the data dictionary (for example: all_synonyms).
    These query are very fast with the optimizer_mode=cost and very slow with the optimizer_mode=rule.
    And the the problem is this:
    in DB1 and DB2 the application executes after the connection this command:
    ALTER SESSION SET OPTIMIZER_MODE = 'RULE';
    These are the traces of the session in db1 and db2:
    The queries are created dynamically by the application.
    Is there a solution for this?
    thanks
    Message was edited by:
    user596611

    Here is a simple example of what can happen,
    @>alter session set optimizer_mode=all_rows;
    @>SELECT PLAN_TABLE_OUTPUT FROM TABLE(DBMS_XPLAN.DISPLAY());
    PLAN_TABLE_OUTPUT
    | Id  | Operation        | Name | Rows  | Cost (%CPU)|
    |   0 | SELECT STATEMENT |      |     1 |     2   (0)|
    |   1 |  FAST DUAL       |      |     1 |     2   (0)|
    @>alter session set optimizer_mode=rule;
    @>SELECT PLAN_TABLE_OUTPUT FROM TABLE(DBMS_XPLAN.DISPLAY());
    PLAN_TABLE_OUTPUT
    | Id  | Operation        | Name |
    |   0 | SELECT STATEMENT |      |
    |   1 |  FAST DUAL       |      |
    Note
          - rule based optimizer used (consider using cbo)As you can see incomplete explain plans. Therefore it is not advised.
    Adith

  • Data Dictionary.. Help Please

    I have to create this query for my college course. I need help. I have half of the query, I think. Need another join clause in the from statement for the views, not sure what to do. Any help will be appreciated! Thank you!
    Create and execute a single query of the Oracle data dictionary to display all foreign key constraints in the HR schema. Note that foreign key constraints are constraint type 'R'. For each constraint list the constraint type, constraint name, the referencing table name, the referencing column position(s), the referencing column name(s), the referenced constraint name (i.e. the other table's primary key constraint name), the referenced table, and the referenced column(s). Sort your results by constraint name, table_name, and position.
    HINTS: You will need two different data dictionary views for this query. One of the views will need to be mentioned twice in the FROM clause, and therefore you will need two different aliases. With this arrangement you will also need two join conditions.
    This is what i have so far...
    SELECT uc.constraint_type, uc.constraint_name, uc.table_name, r_constraint_name,
    ucc.table_name, ucc.position, ucc.column_name, ucc.constraint_name
    FROM user_constraints uc JOIN user_cons_columns ucc
    ON uc.table_name= ucc.table_name
    AND uc.constraint_name= ucc.constraint_name
    WHERE constraint_type= 'R'
    AND r_constraint_name IN
    (SELECT constraint_name
    FROM all_constraints
    WHERE constraint_type
    IN ('P','U')
    AND table_name= 'hr')
    ORDER BY uc.constraint_name, ucc.table_name,ucc.position;

    Ok, you have the correct two dictionary views (assuming you are logged in as HR), now you need to figure out which one is needed twice. As a hint, you have the required join columns for the doubled dictionary view in the single use dictionary view.
    A couple of comments on the code you have posted so far.
    The predicate:
    r_constraint_name IN (SELECT constraint_name
                          FROM all_constraints
                          WHERE constraint_type IN ('P','U') AND
                                table_name= 'hr')is unnecessary since by definition, if the constraint type is R, then the r_constraint_column will point to a P (primary key) or U (unique key) constraint.
    By default, all objects in Oracle are stored in the dictionary views in upper case, so when you query a value you need to use upper case for the literal.
    Again, assuming that you are logged in as HR, then the user_xxx views will only show objects that belong to the HR schema, so there is no need to qualify anything with an owner.
    When you are posting code on this site type {noformat}{noformat} before and after your code sample, this will preserve the formatting of your code so it will be more readable.  If you want to see an example of this, click reply to this post and then click the quote button in the reply pane and you will see how I kept the formatting in the snippet above.
    John                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Oracle indexes that are missing in the SAP Data Dictionary

    We have an old SAP SAP system we just shut down, but Oracle is still up.
    I am trying to put together a query using DBA_INDEXES and a SAP Data dictionary table, that will show me what tables are in Oracle and not in the SAP data dictionary.
    I cannot bring up SAP, but database is still up.

    Hi Bill,
    Table DD12L contains the definition of the SECONDARY indexes.
    Watch it, indexes may be concatenated to table with ^ or ~ or severel
    _ chars so an index 3 for a table might be named
    table~3
    table^3
    table_____3
    depending on what upgrade History the system has.
    For primary indexes, you should ensure, that every table has an index
    with suffix 0 as in
    table~0
    table^0
    table_____0
    Hope this helps
    Volker

  • How to search data dictionary for interval partitions?

    Oracle 11.2.0.3
    When I query DBA_PART_TABLES.PARTITIONING_TYPE it says 'range'. I want to be able to differential an interval from other range based partitions in the data dictionary?
    used this example. shows 'range'
    http://www.rittmanmead.com/2008/09/investigating-oracle-11g-interval-partitioning/
    Oracle Docs list 'SYSTEM' as a partitioning_type which I thought would be intervals.
    ALL_PART_TABLES
    [code]
      1   CREATE TABLE interval_sales
      2          ( prod_id        NUMBER(6)
      3          , cust_id        NUMBER
      4          , time_id        DATE
      5          , channel_id     CHAR(1)
      6          , promo_id       NUMBER(6)
      7          , quantity_sold  NUMBER(3)
      8          , amount_sold    NUMBER(10,2)
      9          )
    10       PARTITION BY RANGE (time_id)
    11       INTERVAL(NUMTOYMINTERVAL(1, 'MONTH'))
    12         ( PARTITION p0 VALUES LESS THAN (TO_DATE('1-1-2005', 'DD-MM-YYYY')),
    13           PARTITION p1 VALUES LESS THAN (TO_DATE('1-1-2006', 'DD-MM-YYYY')),
    14           PARTITION p2 VALUES LESS THAN (TO_DATE('1-7-2006', 'DD-MM-YYYY')),
    15*          PARTITION p3 VALUES LESS THAN (TO_DATE('1-1-2007', 'DD-MM-YYYY')) )
    SQL>/
    Table created.
    Elapsed: 00:00:00.01
    SQL> select partitioning_type from user_part_tables where table_name = 'INTERVAL_SALES';
    PARTITION
    RANGE
    [/code]

    CREATE TABLE junk1
       ( id         NUMBER )
       PARTITION BY RANGE (id)
       INTERVAL(5)
         ( PARTITION p0 VALUES LESS THAN (5),
           PARTITION p1 VALUES LESS THAN (10),
           PARTITION p2 VALUES LESS THAN (15),
           PARTITION p3 VALUES LESS THAN (20) )
    CREATE TABLE junk2
       ( id         NUMBER )
       PARTITION BY RANGE (id)
         ( PARTITION p0 VALUES LESS THAN (5),
           PARTITION p1 VALUES LESS THAN (10),
           PARTITION p2 VALUES LESS THAN (15),
           PARTITION p3 VALUES LESS THAN (20) )
    select owner, table_name, partitioning_type, interval
      from dba_part_tables
    where table_name in ('JUNK1', 'JUNK2')
    OWNER                          TABLE_NAME                     PARTITIONING_TYPE INTERVAL           
    GREGS                          JUNK1                          RANGE             5                  
    GREGS                          JUNK2                          RANGE                 
    2 rows selected.

Maybe you are looking for

  • Custom scan(MpCmdRun) throws error 0x80508023

    Hi, On our server(Windows Server 2012) SCEP 2012 R2 is our protection against virusses. For a POC we have to scan each uploaded file explicitely using MpCmdRum.exe. 1) Within SCEP.. the automatic update is sheduled for every day; 2) The upload-direct

  • Allow user defined values during run time

    Hi , I have created a VI wherein I have 3 inputs as enums, I also want to give the user the capability to enter runtime values which are not present in the drop down for the enum , is it possible ? I see an option in the propeties of the enums as "al

  • Motion Tracking always 'wonders off'

    I don't use after affects much as i do mostly website stuff. Sorry if this question may be simple/dumb, but i cant for the life of me figure it out ... I have a video that I do tracking on.... simple x/y tracking... My workflow is: I usually like to

  • Logging server start/stop to syslog?

    Hi All! I have spent all day on this and I am ripping my hair out! Using Solaris 10 (update 5) and SMF I am trying to get the same start/stop information that is logged to /var/svc/log/... to output via syslog. According to the man page for svc.start

  • Error while filling up CRMRFCPAR

    Hi Guys, I'm getting the error message 'Function module "SMOF0_SEND_CRM_RELEASE" not found' while feeling up the Table CRMPFCPAR. I'm trying to implement note 720819. I'm in ECC 6.0 and SRM 5.5 Server. Can anybody has any idea if I've to do some pre-