How to gather table stats for tables in a different schema

Hi All,
I have a table present in one schema and I want to gather stats for the table in a different schema.
I gave GRANT ALL ON SCHEMA1.T1 TO SCHEMA2;
And when I tried to execute the command to gather stats using
DBMS_STATS.GATHER_TABLE_STATS (OWNNAME=>'SCHMEA1',TABNAME=>'T1');
The function is failing.
Is there any way we can gather table stats for tables in one schema in an another schema.
Thanks,
MK.

You need to grant analyze any to schema2.
SY.

Similar Messages

  • Error when executing statement for table/stored proc.  : ORA-00911

    Hi All,
    I am posting IDOC->XI->JDBC, approx 5000 Idocs.
    But few messages are giving following error in XI-_SXMB_MONI
    Can any one guide me what is the cause of error? I check whole Idoc data I am not able to see bad character? can any once guide me what are the bad character in XML to post data in oracle? so that i can search in XML and how to avoide this error.
    "com.sap.aii.af.ra.ms.api.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'HRP1001' (structure 'INSERT_PAD34'): java.sql.SQLException: ORA-00911: invalid character"

    > I am talking about following IDOC.<ZRMD_A06> ->
    > <E1PLOGI SEGMENT="1">-> <E1PITYP SEGMENT="1"> ->
    > <E1PAD34 SEGMENT="1"> -><PROZT>0.00 #</PROZT>.
    > Can we remove this # during message mapping in XI??
    sure you can remove it using Replace function or by writing UDF.
    as I am seing # is last character..<b>so remove # with " " (single space) and then use the TRIM fucntion.</b>
    Thanks
    Farooq.
    *<b>Rewards points if you find it useful*</b>

  • How to do hibernate mapping for table or view without a primary key

    Hi,
    Anyone knows how to do hibernate mapping for table or view without a primary key?
    thanks.
    cc

    or you can make all column primary key .Anybody seriously considering that as a good idea should understand the implications:
    1. this requires that each row be unique - that's a minor issue normally, but can be a significant problem in some cases
    2. in practically all databases, a primary key constraint creates a unique index - this has many implications:
    a) in most databases, the index stores a copy of the column data that is indexed - this suggestion therefore more than doubles the data storage required for the data
    b) whenever an indexed column is changed, the index has to be maintained - this suggestion then more than doubles the work that each UPDATE statement has to do, since both the table and the index have to be maintained for any UPDATE at all
    This might work OK for toy projects, but it doesn't scale well at all...

  • Error when executing statement for table/stored proc

    Hi All,
          I am getting this error when executing IDOC to JDBC (Stored Procedure) Scenario.
         In my stored procedure I have three insert statements to insert rows in to 3 tables.
        This stored procedure is working fine for two insert statements i.e, 
             For this I have created data type for stored procedure with 10 elements and executed the scenario and was successfully running.
        when I added 3rd insert statement to stored procedure ie., when i added 5 more elements to the datatype (totally 15 elements) it starts giving the bellow error in Message Monitoring.
    <i><b>Exception caught by adapter framework: Error processing request in sax parser: Error when executing statement for table/stored proc. 'COGRP_TMP_PROC_1' (structure 'Statements'): java.sql.SQLException: General error</b></i>
    <i><b>Delivery of the message to the application using connection JDBC_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'COGRP_TMP_PROC_1' (structure 'Statements'): java.sql.SQLException: General error</b></i>
       Note:- I have run the stored procedure  with three insert statements in Sql Server, and also by calling an external program also, and was working fine.
    <i><b> Note : Is there any structure needs to be follow when working with IDOC to Stored procedure.</b></i>
    I am struck up with the error, can any body resolve this issue.
    Thanks in Advance,
    Murthy

    Hi narasimha,
                      This seems to be any error due to incorrect query formation.In your receiver jdbc channel set the parameter logSQLstatement = true.you can find this parameter in the advanced mode. Using this parameter you will be able to see the sql query which is generated at runtime in the audit log in RWB.
    Regards,
    Pragati

  • File to JDBC :Error when executing statement for table/stored proc.

    Hi,
    I am getting following error when i am trying to insert data into z-table using JDBC recr adapter.
    Error while parsing or executing XML-SQL document: Error processing request in sax parser: Error when executing statement for table/stored proc. 'ZTEST' (structure 'STATEMENT'): java.sql.SQLException: <u>[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name '<b>ZTEST</b>'.</u>
    But the database table name 'ZTEST' exists in the system.
    XML structure:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_RECR xmlns:ns0="http://urn:srini/FileToJDBC">
       <STATEMENT>
          <TEST action="INSERT">
             <table>ZTEST</table>
             <access>
                <ROLLNO>123</ROLLNO>
                <FIRSTNAME>ABC</FIRSTNAME>
                <LASTNAME>XYZ</LASTNAME>
             </access>
          </TEST>
       </STATEMENT>
    </ns0:MT_RECR>
    Regards,
    Srinivas

    Hi,
    I have changed my MT str but still getting the same error.Is it possible to insert/ update a z-table using JDBC adapter.
    XML str:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_RECR xmlns:ns0="http://urn:srini/FileToJDBC">
       <STATEMENT>
          <ZTEST action="INSERT">
             <access>
                <ROLLNO>123</ROLLNO>
                <FIRSTNAME>abc</FIRSTNAME>
                <LASTNAME>XYZ</LASTNAME>
             </access>
          </ZTEST>
       </STATEMENT>
    </ns0:MT_RECR>
    Regards,
    Srinivas

  • How to create a record for table PLAF with order type 'NB'.

    How to create a record for table PLAF with order type 'NB'(standard purchase order).
    who can tell me the T-code or some usefull information?
    Thanks.

    Hi
    This will be updated automatically when generate planned orders thru MRP. (MD02)
    regards
    Srinivas

  • SQL*Loader-929: Error parsing insert statement for table

    Hi,
    I get the following error with SQL*Loader:
    Table MYTABLE loaded from every logical record.
    Insert option in effect for this table: INSERT
    Column Name Position Len Term Encl Datatype
    IDE FIRST * ; CHARACTER
    SQL string for column : "mysequence.NEXTVAL"
    CSI_NBR 1:10 10 ; CHARACTER
    POLICY_NBR 11:22 12 ; CHARACTER
    CURRENCY_COD 23:25 3 ; CHARACTER
    POLICY_STAT 26:27 2 ; CHARACTER
    PRODUCT_COD 28:35 8 ; CHARACTER
    END_DAT 44:53 10 ; CHARACTER
    FISCAL_COD 83:83 1 ; CHARACTER
    TOT_VAL 92:112 21 ; CHARACTER
    SQL*Loader-929: Error parsing insert statement for table MYTABLE.
    ORA-01031: insufficient privileges
    I am positive that I can SELECT the sequence and INSERT into the table with the user invoking sql*loader.
    Where does that "ORA-01031" come from?
    Regards
    ...

    Options:
    1) you are wrong about privileges OR
    2) you have the privilege only when you connect via SQL*Plus (or whichever other tool you used to test the insert).
    Is it possible that during your test you enabled the role which granted you the INSERT privilege - and that SQL*Loader doesn't do this?
    Can you see the table in this list?
    select *
    from user_tab_privs_recd
    where table_name='MY_TABLE'
    and owner='table owner whoever';
    select *
    from user_role_privs;Any roles where DEFAULT_ROLE is not YES?
    HTH
    Regards Nigel

  • How to write SELECT statement using tables ekko,ekpo and eket?

    Hi,
    I got a problem in  performance tuning using below tables?
    how to write SELECT statement using tables EKKO,EKPO and EKET and in conditon ( WHERE clause)  use only fields 
                        ekko~ebeln       IN ebeln
                       ekko~loekz       EQ ' '
                       ekko~lifnr       IN lifnr
                       ekko~ekorg       IN ekorg
                      ekko~ekgrp       IN ekgrp          
                       ekpo~werks       IN werks
                       ekpo~pstyp       EQ  '3'
                       ekpo~loekz       EQ  space
                       ekpo~elikz       EQ  space
                       ekpo~menge       NE  0
                     eket~rsnum       NE space.
    Thanks in Advance.
    bye.

    Hi,
    ekko~ebeln IN ebeln
    ekko~loekz EQ ' '
    ekko~lifnr IN lifnr
    ekko~ekorg IN ekorg
    ekko~ekgrp IN ekgrp
    ekpo~werks IN werks
    ekpo~pstyp EQ '3'
    ekpo~loekz EQ space
    ekpo~elikz EQ space
    ekpo~menge NE 0          " Remove this from where clause
    eket~rsnum NE space.    " Remove this from where clause
    ' instead delete the entries after fetching into the table
    DELETE it_itab WHERE menge EQ '0' AND rsnum EQ ' '.
    Regards
    Bala Krishna

  • Error when executing statement for table/stored proc  DB2 - Data Truncation

    Hi,
      I have one call sp in XI with n parameters int and two parameters out.
       well, to implement the interface gives the following error
    com.sap.aii.af.ra.ms.api.DeliveryException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'SPSAPAR9' (structure 'Statement'): java.sql.SQLException: The number of parameter values set or registered does not match the number of parameters
    Thanks for your help
    Ximena
    Edited by: Ximena Gonzalez on Feb 19, 2008 11:50 AM
    Edited by: Ximena Gonzalez on Feb 20, 2008 12:17 PM

    My Error is change
    Error while parsing or executing XML-SQL document: Error processing request in sax parser: Error when executing statement for table/stored proc. 'SAPPRG.SPSAPAR9' (structure 'Statement'): java.sql.DataTruncation: Data truncation
    but de change DT SP
    <?xml version="1.0" encoding="UTF-8" ?>
    <ns1:AlistReqDet2_MT xmlns:ns1="urn:proxl:tmuc:proxl01:AlistReqItems">
    <Statement>
    <SPSAPAR9 action="EXECUTE">
      <table>SAPPRG.SPSAPAR9</table>
      <ISAPNU1 isInput="TRUE" type="STRING">0080000353</ISAPNU1>
      <ISAPEM1 isInput="TRUE" type="STRING">'LU'</ISAPEM1>
      <ISAPC05 isInput="TRUE" type="STRING">15353</ISAPC05>
      <ISAPSEC isInput="TRUE" type="STRING">10</ISAPSEC>
      <ISAPLOT isInput="TRUE" type="STRING">'lats'</ISAPLOT>
      <ISAPCA1 isInput="TRUE" type="STRING">10</ISAPCA1>
      <ISAPCA2 isInput="TRUE" type="STRING">10</ISAPCA2>
      <ISAPKIL isInput="TRUE" type="STRING">10</ISAPKIL>
      <ISAPES1 isInput="TRUE" type="STRING">'T'</ISAPES1>
      <ISAPSW isOutput="TRUE" type="STRING" />
      </SPSAPAR9>
      </Statement>
      </ns1:AlistReqDet2_MT>

  • How to write Select statement for this codition

    I need to check whether SGTXT contains BELNR value.
    SGTXT is a text field and It should be matched with BELNR
    How to write select statement for this.
    Select AUGBL AUGDT into t_BSAD
    from BSAD
    where SGTXT should have the given BELNR Value.
    Plz note : Here I cannot give as SGTXT = BELNR as coz BELNR have only 10 digits.

    Hi,
    data temp(12).
    concatenate '%' belnr '%' into temp.
    Select AUGBL AUGDT into t_BSAD
    from BSAD
    where SGTXT like temp.
    If belnr is having multiple values,just create a internal table as follows.
    types : begin of ty,
            belnr....
            temp(12),
            end of ty.
    data itab_ type standard table of ty.
    data wa type ty.
    loop at itab into wa.
    concatenate '%' wa-belnr '%' into wa-temp.
    modify itab from wa index sy-tabix transporting temp.
    endloop.
    Change your select statement accordingly.
    Kindly reward poits if it helps.

  • Transaction code for Table Maitainence for table

    Hi all,
    i have created Table Maintainece for Table and also i need to create transaction code
    for table maintainence.
    there when i create transaction code with TRANSACTION with PARAMETERS and SKIP FIRST  SCREEN.
    I can see all the records in the table into table Maintainence.
    Is ther is any possibility like i can restrict records on the key fields (like selection screen).
    Will anybody let me know how to goahead with this requirement.
    Regards,
    Madhavi

    You can build a small report that call the maintenance view. In the report, convert the SELECT-OPTIONS input to the [DBA_SELLIST|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=dba_sellist&adv=false&sortby=cm_rnd_rankvalue] parameter of function module [VIEW_MAINTENANCE_CALL|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=view_maintenance_call&adv=false&sortby=cm_rnd_rankvalue].
    If you have "pertinent" key to filter the data, you may define these as sub-key in a mainetance view, those fields will be asked for when entering the maintanance dialog. Or you can build a [view cluster|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=se55&adv=false&sortby=cm_rnd_rankvalue] using these sub-set keys.
    Regards

  • Error in creating Table Maintenance for TABLES: J_2IRG1BAL ,Dump error show

    Dear Gurus
    I have Created one Table Maintenance for TABLES: J_2IRG1BAL ,
    1) I have take function group as same as table name like J_2IRG1BAL
    3) Authorization Group  &NC&
    4) Authorization object S_TABU_DIS
    5) Function group  J_2IRG1BAL
    6) Package J1I5
    7) Maintenance type one step.
    8) Maint. Screen No.    Overview screen 2009.
    9) Recording routine STD recording routines .
    I have assign screen single screen 1 but it will not take the screen so ill put screen 2009 ,the system will not not accept the screen but I proposed to Save and activate the table maintenance generator  and created and save the function group ,the table is ready to save the entries
    We have to go to SM30 then put 4-5 entries ,after that a dump error shows
    Which i have attachéd in this mail kindly help me out
    Its effect in production server.
    I have found that the error is given below I have mentioned all the details
    Kindly read this 
    I have created function group J_2IRG1BAL and  assign Package J1I5 and function group,J1I5 is already a Function group so problem occurs a dump error message displays
    Kindly give me the right solution all the Clients are effected
    110,100 150,250 these all are effected development clients
    300 is prod client this is also affected  because I have created a table maintenance generator and send the req to production .
    *Dump Error Shows in Production*
    Runtime Errors         SYNTAX_ERROR
    Date and Time          11.12.2008 09:26:30
    What happened?                                                                               
    |    Error in ABAP application program.                                                                               
    Error analysis
    In program "SAPLJ1I5 ", the following syntax error occurred:
    "The program "SAPLJ1I5" is not Unicode-compatible, according to its pro"
    "gram attributes."
    The current ABAP program "SAPLSVIM" had to be terminated because one of the
    statements could not be executed.
    This is probably due to an error in the ABAP program.
    In program "SAPLJ1I5 ", the following syntax error occurred
    in the Include "SAPLJ1I5 " in line 0:
    "The program "SAPLJ1I5" is not Unicode-compatible, according to its pro"
    "gram attributes."
    rigger Location of Runtime Error                                                                 |
    Program                                 SAPLSVIM
    Include                                 LSVIMU01
    Row                                     107
    Module type                             (FUNCTION)
    |    Module Name                             VIEW_MAINTENANCE 
    Author and last person to change the Include are:
    Author "TTLABAP2 "
    Last changed by "TTLABAP2 "                 
    105
    Initialisierung des Abgleichsmandanten zum View                     *
    106
    >>>>>
    vim_default_upgr_clnt-viewname = x_header-viewname.
    108
    vim_default_upgr_clnt-client   = client_for_upgrade.
    109
    PERFORM vim_set_global_field_value IN PROGRAM (fpool)
    |  110|            USING 'VIM_DEFAULT_UPGR_CLNT' 'C' vim_default_upgr_clnt rc.

    I have send you all the details regarding the table maintenance generator
    error is shown below
                                           I have Created one Table Maintenance for TABLES: J_2IRG1BAL ,
    1) I have take function group as same as table name like J_2IRG1BAL
    3) Authorization Group  &NC&
    4) Authorization object S_TABU_DIS
    5) Function group  J_2IRG1BAL
    6) Package J1I5
    7) Maintenance type one step.
    8) Maint. Screen No.    Overview screen 2009.
    9) Recording routine STD recording routines .
    I have assign screen single screen 1 but it will not take the screen so ill put screen 2009 ,the system will not not accept the screen but I proposed to Save and activate the table maintenance generator  and created and save the function group ,the table is ready to save the entries
    We have to go to SM30 then put 4-5 entries ,after that a dump error shows
    Which i have attachéd in this mail kindly help me out
    Its effect in production server.
    I have found that the error is given below I have mentioned all the details
    Kindly read this 
    I have created function group J_2IRG1BAL and  assign Package J1I5 and function group,J1I5 is already a Function group so problem occurs a dump error message displays
    Kindly give me the right solution all the Clients are effected
    110,100 150,250 these all are effected development clients
    300 is prod client this is also affected  because I have created a table maintenance generator and send the req to production .
                                                                                    Runtime Errors         SYNTAX_ERROR
    Date and Time          11.12.2008 09:26:30
    ShrtText
    Syntax error in program "SAPLJ1I5 ".
    What happened?
    Error in ABAP application program.
    The current ABAP program "SAPLSVIM" had to be terminated because one of the
    statements could not be executed.
    This is probably due to an error in the ABAP program.
    In program "SAPLJ1I5 ", the following syntax error occurred
    in the Include "SAPLJ1I5 " in line 0:
    "The program "SAPLJ1I5" is not Unicode-compatible, according to its pro"
    "gram attributes."
    Author and last person to change the Include are:
    Author "TTLABAP2 "
    Last changed by "TTLABAP2 "
    Error analysis
    In program "SAPLJ1I5 ", the following syntax error occurred:
    "The program "SAPLJ1I5" is not Unicode-compatible, according to its pro"
    "gram attributes."
    Trigger Location of Runtime Error
    Program                                 SAPLSVIM
    Include                                 LSVIMU01
    Row                                     107
    Module type                             (FUNCTION)
    Module Name                             VIEW_MAINTENANCE
    Source Code Extract
    Line
    SourceCde
    77
    TRANSPORTING NO FIELDS.
    78
    IF sy-subrc NE 0.
    79
    SELECT SINGLE * FROM tfdir WHERE funcname EQ <function_name>.
    80
    IF sy-subrc NE 0.
    81
    RAISE no_editor_function.
    82
    ELSE.
    83
    length = strlen( function_name1 ).
    84
    ASSIGN function_name1(length) TO <function_name>.
    85
    SELECT SINGLE * FROM tfdir WHERE funcname EQ <function_name>.
    86
    IF sy-subrc NE 0.
    87
    RAISE no_database_function.
    88
    ENDIF.
    89
    ENDIF.
    90
    INSERT x_header-viewname INTO alr_checked_views INDEX sy-tabix.
    91
    ELSE.
    92
    length = strlen( function_name1 ).
    93
    ASSIGN function_name1(length) TO <function_name>.
    94
    ENDIF.
    95
    96
    Initialisierung der RFC-Destination zum View                        *
    97
    98
    FPOOL+4 = X_HEADER-AREA.
    99
    fpool   = x_header-fpoolname.
    100
    vim_default_rfc_dest-viewname = x_header-viewname.
    101
    vim_default_rfc_dest-rfcdest  = rfc_destination_for_upgrade.
    102
    PERFORM vim_set_global_field_value IN PROGRAM (fpool)
    103
    USING 'VIM_DEFAULT_RFC_DEST' 'C' vim_default_rfc_dest rc.
    104
    105
    Initialisierung des Abgleichsmandanten zum View                     *
    106
    >>>>>
    vim_default_upgr_clnt-viewname = x_header-viewname.
    108
    vim_default_upgr_clnt-client   = client_for_upgrade.
    109
    PERFORM vim_set_global_field_value IN PROGRAM (fpool)
    110
    USING 'VIM_DEFAULT_UPGR_CLNT' 'C' vim_default_upgr_clnt rc.
    111
    112
    set flag if complex selection conditions in sellist                  *
    113
    114
    IF complex_selconds_used NE space.
    115
    READ TABLE dba_sellist INDEX 1.
    116
    IF sy-subrc EQ 0 AND dba_sellist-cond_kind EQ space.
    117
    dba_sellist-cond_kind = 'C'. MODIFY dba_sellist INDEX 1.
    118
    ENDIF.
    119
    ENDIF.
    120
    121
    direkter Vergleich: Flagge setzen usw.                              *
    122
    123
    IF view_action EQ vim_direct_upgrade.
    124
    view_action = aendern.
    125
    PERFORM vim_set_global_field_value IN PROGRAM (fpool)
    126
    USING 'VIM_SPECIAL_MODE' 'C' vim_direct_upgrade rc.

  • No database table exists for table

    HI All,
    We created a Ztable  and used in two of reports these reports woking fine in PRD,few days back we assigned authorization group and functional group to these table now this table throwing eeror in QAS as well as PRD like No database table exists for table ZXXX,client dont want the data in this table so we deleted this table and created with same name to QAS still same error we are unbale to findout the problem.pls any on help me out..

    Hi Srinivas,
    I am also facing similar kind of issue, can you please let me know your approach towards resolving the issue without deleting the existing data from the table.
    Thanks in advance.
    Best Regards,
    Anil Neegineni

  • How do I import a dump file into a different schema

    I think this is an easy question.
    I just exported a schema for userA to a file using expdp. I now want to import this data for userA to a different schema for userB.
    What parameters do I need in the impdp command?
    thanks,
    jj

    Oh OK thanks.
    Let me extend my question. I see that I can change the schema and I did that but then I realized that I also need to change my tablespace.
    Can this be done in a single command? I got an error when I tried to remap both the schema and tablespace.
    thanks.

  • How to update key fields for table

    Hi,
    how to update key fields for a table.The update statement is not working for the same.
    Regards,

    Hi,
    See the below example.
    TABLES SPFLI.
    DATA WA TYPE SPFLI.
    MOVE 'AA' TO WA-CARRID.
    MOVE '0064' TO WA-CONNID.
    MOVE 'WASHINGTON' TO WA-CITYFROM.
    UPDATE SPFLI FROM WA.
    MOVE 'LH' TO SPFLI-CARRID.
    MOVE '0017' TO SPFLI-CONNID.
    MOVE 'BERLIN' TO SPFLI-CITYFROM.
    UPDATE SPFLI.
    CARRID and CONNID are the primary key fields of table SPFLI. All fields of those lines where the primary key fields are "AA" and "0064", or "LH" and "0017", are replaced by the values in the corresponding fields of the work area WA or the table work area SPFLI.
    Regards,
    raj.

Maybe you are looking for

  • Sent items in mail box are sorted from sender name

    Hi friends,  I just purchased P780 two days back & trying to configure my corporate mails ( & also my Yahoo mails ) on it using Active Sync. Everything works fine apart from the fact that when I am going to the sent items, it is sorting all my mails

  • From iMovie I select share iDVD, and then mouse spins forever in iDVD

    from iMovie I select share iDVD, and then mouse spins forever...... Note: this only occurs for one of my movies, because the other iMovie projects open iDVD ok. I have also tried an archived copy of this movie and the same problem occurs. I notice in

  • Business Rules Framework (BRF) Implementation

    Hi Gurus, We are in SRM 7.0 (EHP2) ,Extended Classic and planning to migrate from Application Controlled workflow to Business Rules Framework( BRF) workflow. As of now we have BBP_WFL_APPROV_BADI to determine approvers dynamically based on Approval l

  • Itunes error during install

    I can't install itunes in windows 7. It always gives me the same error ' Apple Mobile Device not found ' I've tried to uninstall all Apple programs and reinstall Itunes but it still doesn't work . Please help me, I can't sync my iPad with the PC with

  • MAC address blocking

    Hi, need help on blocking a specific MAC address on an interface. On that interface it is cascaded to a hub. Config# mac-address-table permanent aaab.000f.ffef e0/2 - is this the right command and can i list all the MAC address that is allowed to run