Syntax for building all indexes on a table

I know the syntax for re-building of index on a table like :
ALTER INDEX index_name REBUILD;
But, what is the syntax to re-build all the indexes on a table with one statement.
I hope, my question is clear. Please help in solving the doubt.
regards.

This is a Syntax for building all indexes on a table

Similar Messages

  • Maximum length allowed for column name, index name and table name?

    Hi,
    I want to know what is the maximum length allowed for coulmn name, table name and index name in MaxDB ?
    Regards
    Raj

    Hi Raja,
    simply check the catalog:
    sqlcli bwt=> \dc domain.columns
    Table "DOMAIN.COLUMNS"
    | Column Name      | Type         | Length | Nullable | KEYPOS |
    | ---------------- | ------------ | ------ | -------- | ------ |
    | SCHEMANAME       | CHAR UNICODE | 32     | YES      |        |
    | OWNER            | CHAR UNICODE | 32     | YES      |        |
    | TABLENAME        | CHAR UNICODE | 32     | YES      |        |
    | COLUMNNAME       | CHAR UNICODE | 32     | YES      |        |
    and
    sqlcli bwt=> \dc domain.indexes
    Table "DOMAIN.INDEXES"
    | Column Name        | Type         | Length | Nullable | KEYPOS |
    | ------------------ | ------------ | ------ | -------- | ------ |
    | SCHEMANAME         | CHAR UNICODE | 32     | YES      |        |
    | OWNER              | CHAR UNICODE | 32     | YES      |        |
    | TABLENAME          | CHAR UNICODE | 32     | YES      |        |
    | INDEXNAME          | CHAR UNICODE | 32     | YES      |        |
    regards,
    Lars

  • Insert query for insert all data into table in vb6 but it insert 1 row in table

    This is My insert query in vb6 but it insert 1 row in table
    But i want insert all data in the table which contain the id =1.
    Note that billtabsuport is blank
    i want solution for this
    strSQL = " select * from billtabsuport1 where StockID=" & lblid.Caption
    Set DBrecordset = DBConnection.Execute(strSQL)
    strSQL = " Insert into billtabsuport values('" & DBrecordset("StockID") & "','" & DBrecordset("C_Name") & "','" & DBrecordset("C_Add") & "','" & DBrecordset("C_Mobile") & "','" & DBrecordset("Invoice_No") & "','" & DBrecordset("Date") & "','" & DBrecordset("Order_No") & "','" & DBrecordset("T_Name") & "','" & DBrecordset("Dest") & "','" & DBrecordset("D_Date") & "','" & DBrecordset("Tyres_Serial_No") & "','" & DBrecordset("P_Desc") & "','" & DBrecordset("PR") & "','" & DBrecordset("Branded_NonBranded") & "','" & DBrecordset("Claim_No") & "','" & DBrecordset("Qty") & "','" & DBrecordset("U_Price") & "','" & DBrecordset("I_Value") & "','" & DBrecordset("V_Rate") & "','" & DBrecordset("V_Amt") & "','" & DBrecordset("Size") & "','" & DBrecordset("Pattern") & "','" & DBrecordset("TypesOfStock") & "','" & DBrecordset("TypesOfTube_Flap") & "','" & DBrecordset("VatAmount") & "')"
    DBConnection.Execute (strSQL)

    The syntax for inserting from one set of tables to a new table is:
    insert into newtable
    (field1, field2, etc)
    select somefield1, somefield2, etc
    from some other tables
    where whatever

  • Building index from multiple tables for text search

    Hallo,
    I had a look at how to build a index table to optimize search with Oracle text.
    At the moment we are using a JOIN of tables to search for a text in several fields located in different tables.
    My question is:
    Is it possible to create that index table from several tables?
    If yes, can you point me out to any links or give me an example.
    So far, all the examples I read were about 1 table only.
    Thanks
    Elisabeth

    The following is an extension of the original example. It uses ctx_ddl.sync_index to synchronize the index and shows the changes in one of the index tables and shows that the query finds the newly synchronized data. It also shows how this only happens when the column that the index is on is updated. In this example, the index is on the dummy column. The first update does not update the dummy column, so the ctx_ddl.sync_index command does not synchronize the new data. The second update does update the related dummy column, so ctx_ddl.sync_index does synchronize the new data. Lastly, I showed what happens to one of the index tables when you rebuild the index. Notice the reduction in rows in the index table after the rebuild process. You could also rebuild online or drop and recreate the index.
    SCOTT@10gXE> DROP TABLE addresses
      2  /
    Table dropped.
    SCOTT@10gXE> DROP TABLE customers
      2  /
    Table dropped.
    SCOTT@10gXE> CREATE TABLE customers
      2    (customer_id NUMBER,
      3       first_name  VARCHAR2(15),
      4       last_name   VARCHAR2(15),
      5       dummy         VARCHAR2(1),
      6    CONSTRAINT   customers_pk PRIMARY KEY (customer_id))
      7  /
    Table created.
    SCOTT@10gXE> CREATE TABLE addresses
      2    (customer_id NUMBER,
      3       street         VARCHAR2(15),
      4       city         VARCHAR2(15),
      5       state         VARCHAR2(2),
      6    CONSTRAINT   addresses_fk FOREIGN KEY (customer_id)
      7                REFERENCES customers (customer_id))
      8  /
    Table created.
    SCOTT@10gXE> GRANT SELECT ON customers TO ctxsys
      2  /
    Grant succeeded.
    SCOTT@10gXE> GRANT SELECT ON addresses TO ctxsys
      2  /
    Grant succeeded.
    SCOTT@10gXE> CONNECT CTXSYS/ctxsys_password
    Connected.
    CTXSYS@10gXE>
    CTXSYS@10gXE> CREATE OR REPLACE PROCEDURE concat_cols
      2    (p_rowid IN     ROWID,
      3       p_clob     IN OUT CLOB)
      4  AS
      5    v_clob            CLOB;
      6  BEGIN
      7    FOR c1 IN
      8        (SELECT customer_id, first_name || ' ' || last_name AS data
      9         FROM      scott.customers
    10         WHERE  ROWID = p_rowid)
    11    LOOP
    12        v_clob := v_clob || c1.data;
    13        FOR c2 IN
    14          (SELECT ' ' || street || ' ' || city || ' ' || state AS data
    15           FROM   scott.addresses a
    16           WHERE  a.customer_id = c1.customer_id)
    17        LOOP
    18          v_clob := v_clob || c2.data;
    19        END LOOP;
    20    END LOOP;
    21    p_clob := v_clob;
    22  END concat_cols;
    23  /
    Procedure created.
    CTXSYS@10gXE> SHOW ERRORS
    No errors.
    CTXSYS@10gXE> GRANT EXECUTE ON concat_cols TO scott
      2  /
    Grant succeeded.
    CTXSYS@10gXE> CONNECT scott/tiger
    Connected.
    SCOTT@10gXE>
    SCOTT@10gXE> EXEC CTX_DDL.DROP_PREFERENCE ('concat_cols_datastore')
    PL/SQL procedure successfully completed.
    SCOTT@10gXE> BEGIN
      2    CTX_DDL.CREATE_PREFERENCE ('concat_cols_datastore', 'USER_DATASTORE');
      3    CTX_DDL.SET_ATTRIBUTE ('concat_cols_datastore', 'PROCEDURE', 'ctxsys.concat_cols');
      4  END;
      5  /
    PL/SQL procedure successfully completed.
    SCOTT@10gXE> CREATE INDEX customer_text_idx ON customers (dummy)
      2  INDEXTYPE IS CTXSYS.CONTEXT
      3  PARAMETERS ('datastore concat_cols_datastore')
      4  /
    Index created.
    SCOTT@10gXE> INSERT INTO customers VALUES (1, 'Bob', 'Smith', NULL)
      2  /
    1 row created.
    SCOTT@10gXE> INSERT INTO addresses VALUES (1, 'Noplace', 'Nowhere', 'CA')
      2  /
    1 row created.
    SCOTT@10gXE> INSERT INTO customers VALUES (2, 'Bob', 'Jones', NULL)
      2  /
    1 row created.
    SCOTT@10gXE> INSERT INTO addresses VALUES (2, 'Smith St.', 'Somewhere', 'CA')
      2  /
    1 row created.
    SCOTT@10gXE> EXEC CTX_DDL.SYNC_INDEX ('customer_text_idx')
    PL/SQL procedure successfully completed.
    SCOTT@10gXE> COLUMN   token_text FORMAT A30
    SCOTT@10gXE> SELECT   token_text, token_type, token_first, token_last, token_count
      2  FROM     dr$customer_text_idx$i
      3  /
    TOKEN_TEXT                     TOKEN_TYPE TOKEN_FIRST TOKEN_LAST TOKEN_COUNT
    BOB                                     0           1          2           2
    CA                                      0           1          2           2
    JONES                                   0           2          2           1
    NOPLACE                                 0           1          1           1
    NOWHERE                                 0           1          1           1
    SMITH                                   0           1          2           2
    SOMEWHERE                               0           2          2           1
    ST                                      0           2          2           1
    8 rows selected.
    SCOTT@10gXE> SELECT   c.first_name, c.last_name, a.street, a.city
      2  FROM     customers c, addresses a
      3  WHERE    c.customer_id = a.customer_id
      4  AND      CONTAINS (C.dummy, 'Smith') > 0
      5  /
    FIRST_NAME      LAST_NAME       STREET          CITY
    Bob             Smith           Noplace         Nowhere
    Bob             Jones           Smith St.       Somewhere
    SCOTT@10gXE> -- dummy is not updated, so the index is not synchronized:
    SCOTT@10gXE> UPDATE   addresses
      2  SET      city = 'Anywhere'
      3  WHERE    city = 'Somewhere'
      4  /
    1 row updated.
    SCOTT@10gXE> EXEC CTX_DDL.SYNC_INDEX ('customer_text_idx')
    PL/SQL procedure successfully completed.
    SCOTT@10gXE> SELECT   token_text, token_type, token_first, token_last, token_count
      2  FROM     dr$customer_text_idx$i
      3  /
    TOKEN_TEXT                     TOKEN_TYPE TOKEN_FIRST TOKEN_LAST TOKEN_COUNT
    BOB                                     0           1          2           2
    CA                                      0           1          2           2
    JONES                                   0           2          2           1
    NOPLACE                                 0           1          1           1
    NOWHERE                                 0           1          1           1
    SMITH                                   0           1          2           2
    SOMEWHERE                               0           2          2           1
    ST                                      0           2          2           1
    8 rows selected.
    SCOTT@10gXE> SELECT   c.first_name, c.last_name, a.street, a.city
      2  FROM     customers c, addresses a
      3  WHERE    c.customer_id = a.customer_id
      4  AND      CONTAINS (C.dummy, 'Anywhere') > 0
      5  /
    no rows selected
    SCOTT@10gXE> -- once dummy is updated, the index is synchronized:
    SCOTT@10gXE> UPDATE   customers
      2  SET      dummy = NULL
      3  WHERE    customer_id = 2
      4  /
    1 row updated.
    SCOTT@10gXE> EXEC CTX_DDL.SYNC_INDEX ('customer_text_idx')
    PL/SQL procedure successfully completed.
    SCOTT@10gXE> SELECT   token_text, token_type, token_first, token_last, token_count
      2  FROM     dr$customer_text_idx$i
      3  /
    TOKEN_TEXT                     TOKEN_TYPE TOKEN_FIRST TOKEN_LAST TOKEN_COUNT
    BOB                                     0           1          2           2
    CA                                      0           1          2           2
    JONES                                   0           2          2           1
    NOPLACE                                 0           1          1           1
    NOWHERE                                 0           1          1           1
    SMITH                                   0           1          2           2
    SOMEWHERE                               0           2          2           1
    ST                                      0           2          2           1
    ANYWHERE                                0           3          3           1
    BOB                                     0           3          3           1
    CA                                      0           3          3           1
    JONES                                   0           3          3           1
    SMITH                                   0           3          3           1
    ST                                      0           3          3           1
    14 rows selected.
    SCOTT@10gXE> SELECT   c.first_name, c.last_name, a.street, a.city
      2  FROM     customers c, addresses a
      3  WHERE    c.customer_id = a.customer_id
      4  AND      CONTAINS (C.dummy, 'Anywhere') > 0
      5  /
    FIRST_NAME      LAST_NAME       STREET          CITY
    Bob             Jones           Smith St.       Anywhere
    SCOTT@10gXE> -- notice the changes if the index is rebuilt or dropped and recreated,
    SCOTT@10gXE> ALTER INDEX customer_text_idx REBUILD
      2  /
    Index altered.
    SCOTT@10gXE> SELECT   token_text, token_type, token_first, token_last, token_count
      2  FROM     dr$customer_text_idx$i
      3  /
    TOKEN_TEXT                     TOKEN_TYPE TOKEN_FIRST TOKEN_LAST TOKEN_COUNT
    ANYWHERE                                0           2          2           1
    BOB                                     0           1          2           2
    CA                                      0           1          2           2
    JONES                                   0           2          2           1
    NOPLACE                                 0           1          1           1
    NOWHERE                                 0           1          1           1
    SMITH                                   0           1          2           2
    ST                                      0           2          2           1
    8 rows selected.
    SCOTT@10gXE> SELECT   c.first_name, c.last_name, a.street, a.city
      2  FROM     customers c, addresses a
      3  WHERE    c.customer_id = a.customer_id
      4  AND      CONTAINS (C.dummy, 'Anywhere') > 0
      5  /
    FIRST_NAME      LAST_NAME       STREET          CITY
    Bob             Jones           Smith St.       Anywhere
    SCOTT@10gXE> 

  • Gather_table_stats with a method opt of "for all indexed columns size 0"

    I have 9 databases I support that contain the same structure, and very similar data concentrations. We are seeing inconsistent performance in the different databases due to bind variable peeking.. I have tracked it down to the Min and Max values that are gathered during the analyze. I analyze from one cluster, and export/import those statistics into the other clusters.. I then go about locking down the stats gathered. Some of the statistics are on tables that contain transient data (the older data is purged, and new data gets a new PK sequence number).
    Since I am gathering statistics with a 'FOR ALL INDEXED COLUMNS SIZE 1', a min and max value are grabbed. This value is only appropriate for a short period of time, and only for a specific database. I do want oracle to know the density to help calculate, but I don't want cardinality based on whether the current bind values fall in this range..
    Example
    COLUMN PK
    When I analyze the min is 1 and max is 5. I then let the database run, and the new min is 100 and max is 105.. same number of rows, but different min/max. At first a select * from table where pk>=1 and pk <=5 would return a cardinality of 5.. Later, a seelct * from tables where pk>=100 and pk<=105 would return a cardinaility 1.
    Any ideas how to avoid this other than trying set min and max to something myself (like min =1 max = 99999999). ??

    MarkDPowell wrote:
    The Oracle documentation on bind variable peeking said it did not peek without histograms and I cannot remember ever seeing on 9.2 where the trace showed otherwise. Mark,
    see this simple test case run on 9.2.0.8. No histograms, but bind variable peeking, as you can see that the EXPLAIN PLAN output generated by AUTOTRACE differs from the estimated cardinality of the actual plan used at runtime.
    Which documentation do you refer to?
    SQL>
    SQL> alter session set nls_language = 'AMERICAN';
    Session altered.
    SQL>
    SQL> drop table bind_peek_test;
    Table dropped.
    SQL>
    SQL> create table bind_peek_test
      2  as
      3  select
      4             100 as n1
      5           , cast(dbms_random.string('a', 20) as varchar2(20)) as filler
      6  from
      7             dual
      8  connect by
      9             level <= 1000;
    Table created.
    SQL>
    SQL> exec dbms_stats.gather_table_stats(null, 'bind_peek_test', method_opt=>'FOR ALL COLUMNS SIZE 1')
    PL/SQL procedure successfully completed.
    SQL>
    SQL> variable n number
    SQL>
    SQL> variable n2 number
    SQL>
    SQL> alter system flush shared_pool;
    System altered.
    SQL>
    SQL> exec :n := 1; :n2 := 50;
    PL/SQL procedure successfully completed.
    SQL>
    SQL> set autotrace traceonly
    SQL>
    SQL> select * from bind_peek_test where n1 >= :n and n1 <= :n2;
    no rows selected
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=1000 Bytes=24
              000)
       1    0   FILTER
       2    1     TABLE ACCESS (FULL) OF 'BIND_PEEK_TEST' (Cost=2 Card=100
              0 Bytes=24000)
    Statistics
            236  recursive calls
              0  db block gets
             35  consistent gets
              0  physical reads
              0  redo size
            299  bytes sent via SQL*Net to client
            372  bytes received via SQL*Net from client
              1  SQL*Net roundtrips to/from client
              4  sorts (memory)
              0  sorts (disk)
              0  rows processed
    SQL>
    SQL> set autotrace off
    SQL>
    SQL> select
      2             cardinality
      3  from
      4             v$sql_plan
      5  where
      6             cardinality is not null
      7  and      hash_value in (
      8    select
      9            hash_value
    10    from
    11            v$sql
    12    where
    13            sql_text like 'select * from bind_peek_test%'
    14    );
    CARDINALITY
              1
    SQL>
    SQL> alter system flush shared_pool;
    System altered.
    SQL>
    SQL> exec :n := 100; :n2 := 100;
    PL/SQL procedure successfully completed.
    SQL>
    SQL> set autotrace traceonly
    SQL>
    SQL> select * from bind_peek_test where n1 >= :n and n1 <= :n2;
    1000 rows selected.
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=1000 Bytes=24
              000)
       1    0   FILTER
       2    1     TABLE ACCESS (FULL) OF 'BIND_PEEK_TEST' (Cost=2 Card=100
              0 Bytes=24000)
    Statistics
            236  recursive calls
              0  db block gets
            102  consistent gets
              0  physical reads
              0  redo size
          34435  bytes sent via SQL*Net to client
           1109  bytes received via SQL*Net from client
             68  SQL*Net roundtrips to/from client
              4  sorts (memory)
              0  sorts (disk)
           1000  rows processed
    SQL>
    SQL> set autotrace off
    SQL>
    SQL> select
      2             cardinality
      3  from
      4             v$sql_plan
      5  where
      6             cardinality is not null
      7  and      hash_value = (
      8    select
      9            hash_value
    10    from
    11            v$sql
    12    where
    13            sql_text like 'select * from bind_peek_test%'
    14    );
    CARDINALITY
           1000
    SQL>
    SQL> spool offRegards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • For All Entries with two tables

    Hi All,
             Can we use FOR ALL ENTRIES with two tables. for example
    SELECT * FROM MKPF INTO TABLE T_MKPF
             WHERE BUDAT IN S_BUDAT.
    SELECT * FROM MARA INTO TABLE T_MARA
             WHERE MTART IN S_MTART AND
                            MAKTL IN S_MAKTL.
    SELECT * FROM MSEG INTO TABLE T_MSEG
           FOR ALL ENTRIES IN  "T_MKPF AND T_MARA"
                  WHERE MBLNR EQ T_MKPF-MBLNR AND
                                 MATNR EQ T_MARA-MATNR.
    can we do it like this or any other way to do this plz tell. I waitting for your responce.
    Thanks
    Jitendra

    Hi,
    u cannot do like this....chek some documentation on it..
    1. duplicate rows are automatically removed
    2. if the itab used in the clause is empty , all the rows in the source table will be selected .
    3. performance degradation when using the clause on big tables.
    Say for example you have the following abap code:
    Select * from mara
    For all entries in itab
    Where matnr = itab-matnr.
    If the actual source of the material list (represented here by itab) is actually another database table, like:
    select matnr from mseg
    into corresponding fields of table itab
    where ….
    Then you could have used one sql statement that joins both tables.
    Select t1.*
    From mara t1, mseg t2
    Where t1.matnr = t2.matnr
    And T2…..
    So what are the drawbacks of using the "for all entires" instead of a join ?
    At run time , in order to fulfill the "for all entries " request, the abap engine will generate several sql statements (for detailed information on this refer to note 48230). Regardless of which method the engine uses (union all, "or" or "in" predicates) If the itab is bigger then a few records, the abap engine will break the itab into parts, and rerun an sql statement several times in a loop. This rerun of the same sql statement , each time with different host values, is a source of resource waste because it may lead to re-reading of data pages.
    returing to the above example , lets say that our itab contains 500 records and that the abap engine will be forced to run the following sql statement 50 times with a list of 10 values each time.
    Select * from mara
    Where matnr in ( ...)
    Db2 will be able to perform this sql statement cheaply all 50 times, using one of sap standard indexes that contain the matnr column. But in actuality, if you consider the wider picture (all 50 executions of the statement), you will see that some of the data pages, especially the root and middle-tire index pages have been re-read each execution.
    Even though db2 has mechanisms like buffer pools and sequential detection to try to minimize the i/o cost of such cases, those mechanisms can only minimize the actual i/o operations , not the cpu cost of re-reading them once they are in memory. Had you coded the join, db2 would have known that you actually need 500 rows from mara, it would have been able to use other access methods, and potentially consume less getpages i/o and cpu.
    In other words , when you use the "for all entries " clause instead of coding a join , you are depriving the database of important information needed to select the best access path for your application. Moreover, you are depriving your DBA of the same vital information. When the DBA monitors & tunes the system, he (or she) is less likely to recognize this kind of resource waste. The DBA will see a simple statement that uses an index , he is less likely to realize that this statement is executed in a loop unnecessarily.
    Beore using the "for all entries" clause and to evaluate the use of database views as a means to:
    a. simplify sql
    b. simplify abap code
    c. get around open sql limitations.
    check the links
    http://www.thespot4sap.com/articles/SAPABAPPerformanceTuning_ForAllEntries.asp
    The specified item was not found.
    Regards,
    Nagaraj

  • Physical attributes for index on temp tables (using physical model)

    I need create index on temp tables.
    When I generate DDL, it includes physical attributes like ‘LOGGING NOCOMPRESS NOPARALLEL’.
    I get error "ORA – 14451 (unsupported feature w/temporary tables)"
    I’ve to use physical model in OSDM. How do I get rid of physical attributes in DDL for index?

    Hi,
    Thanks for reporting this problem.
    You can remove the LOGGING clause by opening the Properties dialog for the Index in the Physical model and setting its Logging property to the blank option.
    However it's not possible to suppress the NOCOMPRESS and NOPARALLEL at the moment.
    I've logged a bug on this.
    As a workaround, you could do a global edit on the DDL file to remove all instances of NOCOMPRESS and NOPARALLEL.
    David

  • Syntax for existing function-based index

    Hi:
    I am on 10.2.0.3.
    Listed below is the list of indexes and index columns on one of the tables. Aparantly one of the columns (SYS_NC00220$ ) is in reality a function-based index.
    Anybody knows how to get SQL syntax for this index? TIA.
    INDEX_NAME UNIQUENES COLUMN_NAME COLUMN_POSITION
    PS0BI_HDR NONUNIQUE BILL_TO_CUST_ID 1
    PS0BI_HDR NONUNIQUE BUSINESS_UNIT 2
    PS0BI_HDR NONUNIQUE SYS_NC00220$ 3
    PS1BI_HDR NONUNIQUE BILL_STATUS 1
    PS1BI_HDR NONUNIQUE BUSINESS_UNIT 2
    PS1BI_HDR NONUNIQUE SYS_NC00220$ 3
    PS2BI_HDR NONUNIQUE CONTRACT_NUM 1
    PS2BI_HDR NONUNIQUE BUSINESS_UNIT 2
    PS2BI_HDR NONUNIQUE SYS_NC00220$ 3
    PSABI_HDR NONUNIQUE INVOICE 1
    PSABI_HDR NONUNIQUE BILL_TO_CUST_ID 2
    PSABI_HDR NONUNIQUE BUSINESS_UNIT 3
    PSABI_HDR NONUNIQUE BILL_STATUS 4
    PSBBI_HDR UNIQUE PROCESS_INSTANCE 1
    PSBBI_HDR UNIQUE BUSINESS_UNIT 2
    PSBBI_HDR UNIQUE INVOICE 3
    PS_BI_HDR UNIQUE BUSINESS_UNIT 1
    PS_BI_HDR UNIQUE SYS_NC00220$ 2

    query user_ind_expressions and look for COLUMN_EXPRESSION.
    this will give you expression.

  • Set logging to NO for all index in primary DB

    Hi,
    can i set the logging option to NO for all index in primary DB (versus standby DB).
    Because the execute plan of queries changes with this option and the time it's very long for geats tables if the option logging it's YES.
    Regards.

    Hi,
    personally I have never seen that execution plan changes if objects in nologging mode. Could you show sql statements that have changed execution plans due to nologging clause.
    Thanks,
    Andrey

  • What value for DBMS_STATS method_opt= 'for all indexed columns ???'

    What value, one should use for method_opt , while collecting stats for database/schema/table.
    It is obseverd AUTO never give good result, in some case "for all indexed columns 1" work fine and some case "for all indexed columns 254".
    Please advise , what is right way to collect stats.
    OS : Linux AS 4
    DB : 9.2.0.8 , 10.2.0.3
    Thanks

    Gather AUTO. Gathers all necessary statistics automatically. Oracle implicitly determines which objects need new statistics, and determines how to gather those statistics. When GATHER AUTO is specified, the only additional valid parameters are stattab, statid, objlist and statown; all other parameter settings are ignored. Returns a list of processed objects.
    If you specify the for all indexed columns, or specify the column, it will gather histograms. Those are useful if you have an uneven data distribution, and are specially useful for DSS databases, where Oracle will determine if a column is suitable, on a given data rage, to perform full table scan or index scan. If uncertain about it I suggest you not to gather column statistics, as they are costly.
    ~ Madrid.

  • Nano syntax highlighting: catch-all syntax for configuration files

    After years of using nano, I only recently learned that it supports syntax coloring... (Why would they turn that off by default? ) Well, I thought I'll make up for it by making extra good use of it from now on...
    Unfortunately it didn't ship a highlighting syntax for the the kind of files that I use nano the most for: system configuration files.
    So I wrote my own, and after tweaking a bit here and there whenever I encountered a config file for which the highlighting wasn't satisfactory at first, I think the result is now good enough (screenshots below) that it's worth sharing with my fellow Arch users:
    Code & Instructions:
    Here is the syntax definition:
    # config file highlighting
    syntax "conf" "(\.(conf|config|cfg|cnf|rc|lst|list|defs|ini|desktop|mime|types|preset|cache|seat|service|htaccess)$|(^|/)(\w*crontab|mirrorlist|group|hosts|passwd|rpc|netconfig|shadow|fstab|inittab|inputrc|protocols|sudoers)$|conf.d/|.config/)"
    # default text
    color magenta "^.*$"
    # special values
    icolor brightblue "(^|\s|=)(default|true|false|on|off|yes|no)(\s|$)"
    # keys
    icolor cyan "^\s*(set\s+)?[A-Z0-9_\/\.\%\@+-]+\s*([:]|\>)"
    # commands
    color blue "^\s*set\s+\<"
    # punctuation
    color blue "[.]"
    # numbers
    color red "(^|\s|[[/:|<>(){}=,]|\])[-+]?[0-9](\.?[0-9])*%?($|\>)"
    # keys
    icolor cyan "^\s*(\$if )?([A-Z0-9_\/\.\%\@+-]|\s)+="
    # punctuation
    color blue "/"
    color brightwhite "(\]|[()<>[{},;:=])"
    color brightwhite "(^|\[|\{|\:)\s*-(\s|$)"
    # section headings
    icolor brightyellow "^\s*(\[([A-Z0-9_\.-]|\s)+\])+\s*$"
    color brightcyan "^\s*((Sub)?Section\s*(=|\>)|End(Sub)?Section\s*$)"
    color brightcyan "^\s*\$(end)?if(\s|$)"
    # URLs
    icolor green "\b(([A-Z]+://|www[.])[A-Z0-9/:#?&$=_\.\-]+)(\b|$| )"
    # XML-like tags
    icolor brightcyan "</?\w+((\s*\w+\s*=)?\s*("[^"]*"|'[^']*'|!?[A-Z0-9_:/]))*(\s*/)?>"
    # strings
    color yellow "\"(\\.|[^"])*\"" "'(\\.|[^'])*'"
    # comments
    color white "#.*$"
    color blue "^\s*##.*$"
    color white "^;.*$"
    color white start="<!--" end="-->"
    To install, save the above above code snippet as a file called conf.nanorc in the folder /usr/share/nano/ (or /usr/local/share/nano/ or similar if you feel strongly about the /usr <--> /usr/local separation), and then add the following to the end of the file /etc/nanorc:
    ## Configuration files (catch-all syntax)
    include "/usr/share/nano/conf.nanorc"
    Hints:
    The colors I chose look good (imo) with the terminal background and color settings that I use, but might not look good, or even readable, with yours, so simply change the color names in the code snippet to whatever you prefer - valid color names are:
    If you use a console with white background, you'll have to change at least the white color I chose for comments and punctuation.
    The first code line in the snippet includes a regular expression that defines for which file names this syntax highlighting should be used. Whenever you encounter a config file that is not matched by this, but you would still like to open it with syntax highlighting, you can manually select this syntax with nano's -Y switch, like so:
    nano -Y conf myConfigFile
    Technical Note:
    It's implemented as a single catch-all syntax, since nano chooses which syntax to apply based on the filename, and in the case of config files usually not much can be learned about the content format from the file name extension (.conf can by anything from flat key/value tuples to XML, .ini can be the official INI format or something else, etc...).
    This means that some compromises have been made, so with this highlighting syntax probably no config file looks 100% as good as a highlighting syntax that would be specifically optimized for one kind of config format, but all in all the vast majority of config files should look pretty good.
    Screenshots:
    /etc/rc.conf,  /etc/hosts:
    /etc/pacman.conf,  /etc/group:
    xorg.conf,  some .desktop file:
    httpd.conf (Apache config),  php.ini:
    More screenshots:
    /etc/fonts/fonts.conf (uses XML)
    /etc/inittab
    /etc/fstab
    /etc/inputrc
    /etc/mime.types
    /etc/protocols
    /etc/xinetd.conf
    See Also:
    nano syntax highlighting: GNU makefiles
    Update [2012-01-28]: Made some more improvements to the syntax definition (see post)
    Last edited by sas (2012-02-01 15:26:43)

    doug piston wrote:I deal with alot of .mk files and would love to see it there.
    You mean GNU makefiles?
    I'm afraid they might be out of scope for this generic config-file syntax.
    Logically they're not system config files, and technically they're a pretty specialized and complex format (different "types" of rules, rules spanning multiple lines, rules containing arbitrary Bash code, etc.).
    This is how an .mk file currently looks with this highlighting syntax:
    $ nano -Y conf /usr/lib/httpd/build/rules.mk
    And apart from highlighting variables of the form $$abc or $(abc), I'm not sure how much can be improved here without breaking the highlighting for more conventional config files.
    It would probably be better to create a specialized highlighting syntax just for .mk files.
    EDIT: I sat down and did just that, here's the result: nano syntax highlighting: GNU makefiles, and here is how the above makefile snipped looks with it:
    Last edited by sas (2012-02-01 15:18:52)

  • Analyzing tables and all index

    hi
    What is the command to analyze the tables and all indexes and columns for a particular table
    rgds
    rajesh

    9i and 10g:
    exec dbms_stats.gather_table_stats('<schema>' , '<table_name>', cascade=>true);

  • Write the syntax for declaring table control in dialog programming?

    1) Write the syntax for declaring table control in dialog programming?
    2) Write the syntax to call a selection screen in a modal dialog box?

    hi,
    check this code for table control.
    DIALOG PROGRAMMING
    TABLE CONTROL
    IN SE51
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    LOOP AT ITVBAK WITH CONTROL TABCTRL. ##  TABLE CONTROL NAME
    ENDLOOP.
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_0100.
    LOOP AT ITVBAK.
    ENDLOOP.
    IN PAI FLOW LOGIC
    PROGRAM YMODULE_PR4 .
    TABLES : KNA1, VBAK.
    DATA : BEGIN OF ITVBAK OCCURS 0,
           VBELN LIKE VBAK-VBELN,
           ERDAT LIKE VBAK-ERDAT,
           ERNAM LIKE VBAK-ERNAM,
           NETWR LIKE VBAK-NETWR,
           END OF ITVBAK.
    CONTROLS : TABCTRL TYPE TABLEVIEW USING SCREEN '0100'.
    TO ACTIVATE SCROLL BAR
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
        WHEN SPACE.
          SELECT VBELN ERDAT ERNAM NETWR
            FROM VBAK
            INTO TABLE ITVBAK
           WHERE KUNNR = KNA1-KUNNR.
          TABCTRL-LINES = SY-DBCNT.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0100  OUTPUT

  • Make a script for build table

    Hi everyone
    How to make a script for build table:
    col width 25mm
    align decimal
    align on close paren
    Thanks
    Teetan

    Hi Teetan VK,
    Merry Chrismas.
    I'm not really an InDesign scripter.
    But you can try the following code:
    // TableCreate_simple.jsx
    // regards pixxxelschubser
    var aDoc = app.activeDocument;
    // your width of every column
    var w = Number(prompt("width of columns", 25));
    var NrOfColumns = 3;
    var aTextFrame = aDoc.textFrames.add({visibleBounds:[0, 0, 30, NrOfColumns*w + 1]});
    var aTable = aTextFrame.insertionPoints[0].tables.add({columnCount:NrOfColumns,bodyRowCount:1});
    for (i=0; i<aTable.columns.length; i++) {
    aTable.columns[i].width = w;
    // Paragraph sytyle with decimal aligning should already exists in your document
    for (j = 0; j < aTable.cells.length; j++) {
        aTable.cells[j].texts[0].appliedParagraphStyle = aDoc.paragraphStyles.item("AlignDecimal");
    Be sure, that a paragraph style (named with "AlignDecimal") exists in your Document.
    But what is:
    Teetan VK schrieb:
    … align on close paren …

  • I can't get the syntax for a table defined function to work.

    Specifically I'm trying to use a table type definition in my function.
    CREATE TYPE "MYSCHEMA"."TT_MYTABLE" AS TABLE (
         "Field" varchar(12)
    CREATE FUNCTION "MYSCHEMA"."MYFUNCTION"()
    RETURNS TABLE ("MYSCHEMA"."TT_MYTABLE")
    LANGUAGE SQLSCRIPT
    All the function examples use an actual field definitions and not an predefined table type.  I've tried the above and a bunch of other variations but I get a syntax error on all of them.
    This is the documentation page;
    http://help.sap.com/saphelp_hanaplatform/helpdata/en/20/d42e77751910149f0ff6b879b1290f/content.htm
    They don't show any examples using the table types and I can't seem to make sense of " <datatype> ::= <sql_type> | <table_type>".

    If you read the grammar correctly then I think it is not possible. Table UDF does not allow return table type that refers to another structure type definition but only elementary sql_type
    I think what grammar you refering is from input parameters
    Table Functions must return a table whose type is defined by <return_table_type>. And Scalar Funcitons must return scalar values specified in <return_parameter_list>.
    Defines the output parameters
    <return_table_type> ::= TABLE ( <ret_column_list> )
    Defines the structure of the returned table data.
    <ret_column_list> ::= <ret_column_elem>[{, <ret_column_elem>}...]
    Defines the list of columns returned from the function.
    <ret_column_elem> ::= <column_name> <sql_type>
    <column_name> ::= <identifier>

Maybe you are looking for

  • Itunes won't recognise ipod touch

    When I try to connect ipod touch get error message that cannot be used as requires itunes version 10.5 or later. Tried to download latest as suggested but no change.  I have itunes on windows xp machine and no problem connecting to nano, classic or s

  • Can not use "merge to HDR" or "open as smart object" etc.

    For some reason everything below the "Edit in Photoshop CS3" is grayed out. It makes no difference if I am trying to convert a jpg or nef file. Any ideas?

  • I NEED FIELDS FROM VBFA TABLE

    HI ALL, I NEED FIELDS FROM VBFA TABLE THE FIELDS I WANT IS : CUSTOMER-ID CUSTOMER NAME CONTACT NAME PROJECTID ORDER NO SALES MAN ID ORDER PROCESS DATE INVOICE DATE GROSS AMOUNT NET AMOUNT POSTAL CODE. THANKS & REGARDS, R.VINOD.

  • PDDocColorConvertPage doesn't convert the Spot Color "All"

    Hello, I use the PDDocColorConvertPage() method to convert a page to DeviceGray (with the AC_Color gray 1.8). Unfortunately the spot color "All" is still a spot color after the conversion (but the alternate color space is DeviceGray). Is it a normal

  • Final Cut X not working properly

    Hi! In my office i am editing with a new IMAC OS X Lion. we bought final cut X three months ago and suddely, since one week, has been imposible to work on it because every time i move something in the timeline or import a pic or a video, whatever i d