Distinct values on the ov Type NVARCHAR2 column

Hello

I have a Table with an Nvarchar2 column (255) on a 10.2.0.4 database.

I've gathered statistics on the table in different ways, with or without the histograms. I know that the table has about 65,000 distinct values, but dba_tab_col_statistics shows always 10 lines.

For a test, I created a new column of type VARCHAR2 (255) and copied the nvarchar2 data in varchar2 column. Once I've collected statistics, and for the varchar2 column, it displays the correct value.

any ideas?

Concerning

PK

Here are some other data:
Select count (distinct (REPOSID_XMETA)) of tmp;
COUNT (DISTINCT (REPOSID_XMETA))
------------------------------
63933

alter table tmp add tmp_col VARCHAR2 (255);
Modified table.

> tmp desc

Name Null? Type
----------------------------------------------------------------------------------------------------- -------- --------------------------------------------------------------------
REPOSID_XMETA NVARCHAR2 (255)
TMP_COL VARCHAR2 (255)

setting a day of tmp_col set tmp = REPOSID_XMETA;
63933 lines to date.
Commit;
Validation complete.
create index tmp_index1 on tmp (REPOSID_XMETA);
The index is created.

create index tmp_index2 on tmp (tmp_col);
The index is created.

Start
(dbms_stats.gather_table_stats)

ownname = > 'SYS ',.
tabname = > 'TMP ',.
estimate_percent = > null,
Cascade = > TRUE,
level = > 4,
no_invalidate = > FALSE,
granularity = > 'AUTO',
method_opt = > 'for all COLUMNS INDEXED");
end; /
Select COLUMN_NAME, DENSITY, NUM_NULLS, NUM_DISTINCT, NUM_BUCKETS in dba_tab_col_statistics where table_name = 'TMP2';
Separate column
Name of the density of values NUM_NULLS NUM_BUCKETS
-------------------------------------------------- ---------- ------- ---------- -----------
10 0 0 10 REPOSID_XMETA
63 933 0 0 75 TMP_COL

Published by: user1131374 on July 1, 2011 05:27

Just read below link where joze Scheid noted that Oracle's first 32octets even after DBMS_STATS statistics in the columns of multibyte characters.

Conclusion - converting varchar2 nvarchar2.

http://Joze-senegacnik.blogspot.com/2009/12/CBO-oddities-in-determing-selectivity.html

Concerning
Girish Sharma

Tags: Database

Similar Questions

  • What is the minimum value for the data type double?

    ... a more academic question: what is the minimum value of the data type double? I thought 'double', it is the 8-byte IEEE standard and what I remember, it's + - 1.7E + - 308.  The more different number of 0 should be 1.797E - 308.

    This is why I was a little surprised when I looked at the data output of my calculation of CVI, where I found the numbers with exponents of E-319 or E-324 as the smallest value...

    But I'm sure there's an explanation :-)

    Thank you for sharing with me,

    Wolfgang

    The largest number is indeed the order of + 1.7E + 308; There are a smaller number of - 1.7E + 308. Note that this is in fact the most negative number, which is the smallest by some reckoning. For the small beach of the Exhibitor, things get a little more complicated. 1E-308 can be represented with complete accuracy and resolution, but if you're willing to lose a few bits of precision, you can go down even further. For example:

    Double x, y, z:

    x = 1E-300;

    y = 1E7;

    z = x / y;               Give 1.000000000000000E - 307

    y = 1E8;

    z = x / y;               Give 9.999999999999999E - 309

    y = 1E18;

    z = x / y;               Give 9.999987484955998E - 319

    y = 1E23;

    z = x / y;               Give 9.881312916824931E - 324

    So, as you can see, values less than 1E-308 are possible, but they become increasingly more inaccurate and should not be relied upon.

    JR

  • How to get the values of the rows in a column only?

    How to get all the values in the rows of a column.
    for example, a query gives result as:
    123
    234
    233
    12121
    all in different lines. But I want the result like this:
    123,234,233, 12121.All in a single row and a single column.
    How is that possible?

    SELECT rtrim (xmlagg (xmlelement (e, column_name |))) (') .extract('//text () '), ',') from table_name

  • Change the Data Type of column on large partitioned Table Tablet

    Hello

    I was tasked to change a certain NUMBER of collar to a colonel VARCHAR2

    It is usually an easy task, but I ran into several challenges due to the size of the table, the second major problem is the compression of the table.

    To begin with, the Table and index are 4.4 to and hold around 11 lines billion. That the Table is compressed, not the index.

    The first option was to add a new collar of VCHAR, update from the Col de NUM, file and then drop the colonel NUM


    We ran this test in the Test environment and because discovered Compression Table that you can only mark the column is not used, and it can only be moved permanently from the Table if you unzip the whole Table and run «...» REMOVE the UNUSED COLUMNS'.

    The second way is to create a separate Table copy with the values of the source of neck, then write to null to the source of neck, change data Type when its empty and then update the source again with the copy Table values.

    The second option, that's what I'm testing, but I work with nearly 30 million lines by daily score, inserts take very long to fill.

    How can I make faster inserts between the Source and the copy Table?

    What other channels follow to accomplish the task above?

    Concerning

    Stephan

    Nowhere in your proposed solution was necessary for you to understand why the data source changes, its as simple that to take what is ons the table (all the facts in the original post) and offering the best way on the basis of previous experience or oracle skills acquired over time.

    If you spent so much time and thought to help with a solution that you did on WHY complain, you could have provided some feasible solutions already.

    No thanks to your information irrelevant and unnecessary, I've implemented a solution already.

    1 export the Source Table

    2. create a 'replica Table' using the DDL source using a temporary table name

    3. import all Partitions in the Table new

    4. before the Cut-Over, synchronize the changes from the Source to the replica Table

    5 rename the Source

    5 rename the Table of replica for the Original Source Table name

    6. slide the original Source Table

  • OPV with distinct values for the guests

    Hi all

    Could you get it someone please let me know where/what I'm wrong. I created the couple of OPV to get distinct values, as I can't use the view that has millions of data to load guests.

    These OPV is not directly attached to my main table but joined someother tables; After you add the guests in the responses, is to show the below error

    [nQSError: 14070] can't find coverage source logical table to the columns of the logic: [bp Manager]. Please check more detailed level keys are correctly mapped. (HY000)

    I wan to the OPV use only for guests and pass the values to help requested on the main table filters

    I have no warnings/errors in my model. What could be the problem? Thank you for your time

    REDA

    Just go with PSV.

    Check it cool - bi.com for "what happens when we select all the column values.

    Table x got to join the only 1OPV then how can you expect comes from BI to the other 2 open-pollinated varieties? Likewise, we cannot write query!

    If you can create a domain for each OPV then proceed with a command prompt with the UNION of 3 open-pollinated varieties clause

  • How do I default sysdate value in the input message text column

    Hello

    In the area of research start date and end date, two columns are there. These two columns are columns of text message entry. Each property of the column, I gave sysdate in the initial value and the type of data selected as Date. When I run the OAF page I can't see the value of default todays. Could you please help me on this?

    Thank you
    Sri

    Hi Sri

    You can use pageContext.getCurrentUserDate in the PR method and then set the attribute corresponding to this value VO.

                  java.util.Date sysdate = pageContext.getCurrentUserDate();
                  String convSysDate = pageContext.getOANLSServices().dateToString(sysdate);
                  OAMessageDateFieldBean  bean = (OAMessageDateFieldBean)webBean.findChildRecursive("StartDate");
    
                  if(bean != null)
                  {
                 bean.setValue(pageContext, convSysDate);
                  }
    

    AJ

  • How to associate a string value to the enumeration type in the binding of data under the direction of BPM Oracle 11 g

    I have the status value that is a string I have to map to the enum type STATUS in the linking of data, either through simple expr Editor, xpath


    Association of source data must be Xpath mode and destination in singles

    being supported your value in the source similar to the value of your Enum

  • script to change the data type of column

    Hi gurus of the oracle.

    I have 190 tables in my database.

    I have the column type CHAR of all these tables data.

    I need to change the data type of CHAR in VARCHAR2 for all these tables...

    There the script to change the data type of all tables at once?

    Please help me in this regard.

    Thanks in advance

    Concerning

    REDA

    Hello

    There is nothing built-in to Oracle SQL to do.  Maybe your front-end has certain characteristics.

    You can write dynamic SQL statements to do.  In other words, you can write a query that the output is a SQL script like this:

    ALTER TABLE TABLE_A CHANGE (A_TXT1 VARCHAR2 (5))

    A_TXT2 VARCHAR2 (10));

    ALTER TABLE TABLE_B CHANGE (B_TXT1 VARCHAR2 (5));

    with one row for each column of type CHAR.  Notice how the first line of output for each table begins with ALTER TABLE... but the later lines at the same table.  Similarly, the last line of a table (which will be the same as the first row, if the table has only one column of type CHAR) to end with a semicolon, but other lines are not.

    Here's a way to generate and execute such a dynamic script in SQL * more:

    -Disable the features that make the output easy to read, but hinder the execution
    SET FEEDBACK OFF
    SET LINESIZE 500
    SET PAGESIZE 0

    -Create fix_char.sql
    COIL c:\some_pathename\fix_char.sql

    SELECT THE CHECK BOX
    WHEN ROW_NUMBER () OVER (PARTITION BY table_name
    ORDER BY column_name
    )  = 1
    THEN 'ALTER TABLE ' | table-name
    || "CHANGE (").
    ELSE «»
    END
    ||        column_name
    ||        "VARCHAR2 (').
    ||        DATA_LENGTH
    ||        ')'
    ||        CASE
    WHEN ROW_NUMBER () OVER (PARTITION BY table_name
    ORDER BY column_name DESC
    )  = 1
    THEN '); "
    Output END AS
    Of user_tab_columns
    WHERE data_type = "CHAR".
    ORDER BY table_name
    column_name
    ;

    SPOOL OFF

    -Turn on the features that make the output easy to read, but hinder the execution
    SET FEEDBACK ON
    SET LINESIZE 80
    SET PAGESIZE 50

    -Fix_char.sql performance
    @c:\some_pathname\fix_char

    It's good to change all the CHARIOT of VARCHAR2 columns.  The CHAR data type is nothing trouble.

  • change the data type of column in a view

    Hi gurus,

    Please suggest.


    I have been created as below in the region of production.

    CREATE OR REPLACE TYPE PROD. (OBJECT) ACE FEATURE_CUSTOM_LIST_OBJ
    TERMINAL_FEATURE_ID NUMBER (8).
    DATA_VALUE NUMBER (8)
    );
    /


    And the view is created below the base have the PROD. FEATURE_CUSTOM_LIST_OBJ

    CREATE OR REPLACE FORCE VIEW PROD. TERMINAL_FEATURE_TYPE
    (
    TERMINAL_FEATURE_ID,
    DATA_VALUE
    )
    AS
    SELECT
    TERMINAL_FEATURE_ID,
    DATA_VALUE
    TABLE)
    CAST)
    PROD. TERM_RELATED_REF_DATA. GET_TERMINAL_FEATURE_TYPE AS PROD. FEATURE_CUSTOM_LIST_TAB));

    Examples of data must be inserted into the display

    TERMINAL_FEATURE_IDDATA_VALUE
    120
    121
    123
    11THERE
    11N

    If iam thinking is possible that we can change the data type of number of varchar2 data type column in a view?

    Or should I follow create or replace type as whenevr the nonnumeric data tries to bring into view
    sound by giving the number plsql for digital character conversion error since it is a number of data type here.

    I have been created as below in the region of production.

    CREATE OR REPLACE TYPE PROD. (OBJECT) ACE FEATURE_CUSTOM_LIST_OBJ

    OK - but it is a SCALAR - not a collection object

    And the view is created below the base have the PROD. FEATURE_CUSTOM_LIST_OBJ

    CREATE OR REPLACE FORCE VIEW PROD. TERMINAL_FEATURE_TYPE

    No - it isn't. Your type of object is a SCALAR - not a collection. You need create a view on a table or a collection that is treated as a table.

    DDL perspective you posted doesn't even mention your FEATURE_CUSTOM_LIST_OBJ.

    If iam thinking is possible that we can change the data type of number of varchar2 data type column in a view?

    Have you tried using TO_CHAR to format the number as a string?

  • Distinct values in the Group of

    Hello

    How to get the number of values distinct from an RTF which is a group of loop foreach.

    Kind regards

    Try this

    or

  • Reset the value of the SQL Server identity column according to what is being inserted

    I have a SQL Server 2008 database with a table that has a field ID that has an increment and seeds of 1.

    This great work that each new record created automatically gets a number of new and distinct.

    Now when I insert some new records that I need to be able to make this value from 10001 and then next would be 10002 etc.

    But it's only for certain insertions.

    Is there a way to control the identity seed and increment, perhaps on the fly via a query?

    If some inserts would follow 1,2,3,4,5,6,7 according to what is being inserted

    and others would follow 10001,10002,10003 according to what is being inserted.

    is this possible?

    Make a different field.  Don't mess with your PK.

    Make sure you have a plan for when you get 10000 records in this table.

  • Ai2: Boolean Returns the value for the data type structured is mapped to char (1)

    Hello

    When I try to set a function member with a return type of boolean, export options maps to a char (1) data type, you want creating a ddl like this:


    CREATE or REPLACE TYPE prifsaud.t_tasks
    AS AN OBJECT
    (
    current_status NUMBER,
    last_update TIMESTAMP,
    UID_Task NUMBER,
    priority NUMBER,
    UID_User NUMBER,
    Schema VARCHAR2 (30),
    Store PROCEDURE MEMBER,
    Start_task MEMBER PROCEDURE,
    MEMBER trunc PROCEDURE,
    FUNCTION MEMBER get_dblink
    RETURN VARCHAR2,
    GET_UIDDataBase MEMBER FUNCTION
    RETURN NUMBER,
    MinVerRequired MEMBER FUNCTION
    *(*
    Version in VARCHAR2
    *)*
    RETURN of CHAR (1),
    End_task MEMBER PROCEDURE,
    Waiting for the MEMBER PROCEDURE,
    Check_connectivity MEMBER PROCEDURE,
    Recalibrate MEMBER PROCEDURE
    ) FINAL NO NOT INSTANTIABLE
    ;
    /

    Is there a workaround/fix for this problem solution? I have Version 3.0.0 (653)

    Greetings!

    Hello

    There is no support for PL/SQL types, only the database column types are supported.
    If you don't like the mapping of logical type 'Boolean' native 'char' type, then you can change it to ' tools > Types Administration. "

    Philippe

  • Check the file types flat column list and column

    Hi guys!

    Is there an "easy way" to check if the source file names flat column and column types correspond to the types and the column name for the data store target?

    Kind regards

    PsmakR

    Hello

    Is there a way that I've used some time to validate if the data are under the target.

    Conditions:

    (1) the source file should have all the columns as "String".

    (2) all the column analyzed mapping has to go to the "staging area".

    How to: (average oracle)

    (1) create a database (by the ODI procedure) function as:

    create or replace function $ F _DATATYPE (pData in varchar2, pDatatype in varchar2, pFormat in varchar2)
    return varchar2 as

    date of $vdate;
    number of vNumber;

    BEGIN

    If pDatatype = ' then / * Date * /.

    $vdate: = to_date (pData, pFormat);

    elsif pDatatype = ' only then / * number * /.

    If pFormat is null then
    vNumber: = to_number (pData);
    on the other
    vNumber: = to_number (pData, pFormat);
    end if;

    end if;

    Returns "OK";

    EXCEPTION
    While OTHERS then
    return "KO."

    end of F$ _DATATYPE;

    (3) now, you can create a constraint to each column in the source you want to validate data as:

    = 'OK' F$ _DATATYPE(my_source_column, 'D', 'ddmmyyyy hh24:mi:ss') / * for a date as an example column * /.

    (4) drag / move the source (table model) data source in the package and a table of $ E with all errors will be created.

    This help you?

  • Sequence Analyzer rules: Expressions must evaluate to a value of the expected type

    Sequence Analyzer reports all sorts of errors because I'm indexing of the results list.

    1. For example: error in argument 2, 'Locals.ResultList [Locals.idx] .status is 'Error',' in the call to the function of the expression "AnyOf. Name of variable or unknown property 'Locals.ResultList [Locals.idx].status'.

      This is perfectly valid at run time but the parser recognizes that, probably because the list starts with the vacuum.

      Is it possible that I have clean code to reduce these error reports?

      I tried to create a "Result" element in a Foreach loop, but could not find a type of 'Result' anywhere.

    2. In addition, under the same article, array off limits. index is given as a problem when I define a table instead of 0.1 1.2 terminals so that I can use buttons hit on the index in the array.

      It's also quite correct but marked as an error.

    3. Another rule that makes me crazy is all sequences of escapement used in expressions must be valid, for example:the expression "StationGlobals.RootPath & ' Configuration\VP Automated Test parts and limit Config.txt" ' is meant to be a path. "Use '-' instead of"."

      I don't know what, if anything, I should fix in the string because this file get opened correctly.

    Can someone suggest ways to "fix" or "clean" these errors? I would prefer not to have to justify why I do nothing on errors reported by the parser to my QA group.

    You can avoid the error of the Analyzer by something similar to the following:

    Locals.AnyErrors = PropertyExists ("Locals.ResultList [" + Str (Locals.idx) + "] .status")? (Locals.ResultList [Locals.idx]. GetValString("status", 0) == "Error"): false

    To create a copy of the item as a local variable, you can do the following:

    Locals.SetPropertyObject ("myelementVar", PropOption_InsertIfMissing, Locals.ResultList [Locals.idx]. Clone ("", PropOption_CopyAllFlags |) PropOption_DoNotShareProperties))

    Note that this property will exist only at run time, if you create a placeholder variable in it to change time and it will get replaced by this expression during execution.

    Hope this helps,

    -Doug

  • create a default value for the file types

    I created a new site and is a kind of ColdFusion document.

    Dreamweaver creates ever new htm file when I right click on the folder of the site to create a new file for the site.

    I wonder what's possible to leave Dreamweaver to set the default file type.

    For example, Dreamweaver can create cfm for ColdFusion site files and php for PHP site.

    Your information and help is much appreciated,

    Kind regards

    Iccsi,

    I don't know what version of DW, you have, but in CS6 preferences panel allows you to specify the default document type and file extension for all new files that you create in DW.   This does not affect your existing website files.  Only for new.

    To edit existing documents, go to modify > Page Properties > title/encoding.

    Now, if you are working on several sites with the requirements of the other script, you can specify the type of page to create by clicking file > New > blank page > choose a page type.

    This help you?

    Nancy O.

Maybe you are looking for

  • Latest version of Flash Player for 10.6.8?

    Hello. Currently, I have Flash Player installed 22.0.0.209. I see v23 (the last) requires OS 10.9 or higher. Is the version that I installed the update that works w / OS 10.6.8?

  • can I permanently delete my childs ipad app

    trying to delete an app from the iPhone and iPad to my child.  Step-by-step instructions stop would be great!

  • Firefox (windows XPsp3 39.0.3) does not load a product comparison, IE will!

    I tried one compare products on the website batterychargers.com and load Web site pages, I've tried except when I selected items and you click on compare, I got the title of the page, but with an empty window to compare. I copied the URL in IE8 and l

  • 9550 java programs Simulator does not

    I have eclipse Build id: 20100218-1602 with BlackBerry_JDE_PluginFull_1.1.2.201003212304 - 12.exe installed. using the 9550 Simulator. I brought samples of BB in my workspace and then tried some on my 9550 Simulator, but all I get is the spinning hou

  • Smartphones blackBerry email reconciliation

    Hello My Organization recently upgraded my phone to a Blackberry Bold 9650, OS v5.0, BIS. I have had some problems with my e-mail address and have been unable to find solutions by searching the forums. (1) my new messages not immediately reconcile my