Trigger for every 1000 record insert

Hi
I am working in oracle 9i / Aix 5.3
I need a trigger which should fire whenever my temp_table growing 1000,2000...etc.,
The records should reach me in the body of email.
Like
Hi
The temp_table count has been reached to 1000.
Thanks
second time execution...
Hi
The temp_table count has been reached to 2000.
Thanks
etc.,
How can i achieve this? I'm ok to shell script also for the above functionality
Thanks
Raj

Why do you want to do this?
SQL> create table temp_table (x number);
Table created.
SQL> ed
Wrote file afiedt.buf
  1  create or replace function temp_table_cnt return number is
  2    pragma autonomous_transaction;
  3    v_cnt number;
  4  begin
  5    select count(*) into v_cnt from temp_table;
  6    return v_cnt;
  7* end;
SQL> /
Function created.
SQL> ed
Wrote file afiedt.buf
  1  create or replace trigger trg_a_temp_table
  2  after insert on temp_table
  3  for each row
  4  declare
  5    v_cnt number;
  6  begin
  7    v_cnt := temp_table_cnt();
  8    if mod(v_cnt,1000) = 0 then
  9      dbms_output.put_line('Email Sent for '||v_cnt||' records.');
10    end if;
11* end;
SQL> /
Trigger created.
SQL> set serverout on
SQL> ed
Wrote file afiedt.buf
  1  begin
  2    for i in 1..3456
  3    loop
  4      insert into temp_table values (i);
  5      commit;
  6    end loop;
  7* end;
SQL> /
Email Sent for 0 records.
Email Sent for 1000 records.
Email Sent for 2000 records.
Email Sent for 3000 records.
PL/SQL procedure successfully completed.
SQL>... however I wouldn't consider this good design, as it requires each of the rows to be committed so that the autonomous transaction procedure can count the number of rows on the table. Of course, if the rows are being inserted through, let's say, user input and are committed on a 1 by 1 basis anyway, then it's perfectly acceptable, but I wouldn't use it for bulk insertions.

Similar Messages

  • Commit for every 1000 records in  Insert into select statment

    Hi I've the following INSERT into SELECT statement .
    The SELECT statement (which has joins ) has around 6 crores fo data . I need to insert that data into another table.
    Please suggest me the best way to do that .
    I'm using the INSERT into SELECT statement , but i want to use commit statement for every 1000 records .
    How can i achieve this ..
    insert into emp_dept_master
    select e.ename ,d.dname ,e.empno ,e.empno ,e.sal
       from emp e , dept d
      where e.deptno = d.deptno       ------ how to use commit for every 1000 records .Thanks

    Smile wrote:
    Hi I've the following INSERT into SELECT statement .
    The SELECT statement (which has joins ) has around 6 crores fo data . I need to insert that data into another table.Does the another table already have records or its empty?
    If its empty then you can drop it and create it as
    create your_another_table
    as
    <your select statement that return 60000000 records>
    Please suggest me the best way to do that .
    I'm using the INSERT into SELECT statement , but i want to use commit statement for every 1000 records .That is not the best way. Frequent commit may lead to ORA-1555 error
    [url http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:275215756923]A nice artical from ASKTOM on this one
    How can i achieve this ..
    insert into emp_dept_master
    select e.ename ,d.dname ,e.empno ,e.empno ,e.sal
    from emp e , dept d
    where e.deptno = d.deptno       ------ how to use commit for every 1000 records .
    It depends on the reason behind you wanting to split your transaction into small chunks. Most of the time there is no good reason for that.
    If you are tying to imporve performance by doing so then you are wrong it will only degrade the performance.
    To improve the performance you can use APPEND hint in insert, you can try PARALLEL DML and If you are in 11g and above you can use [url http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/d_parallel_ex.htm#CHDIJACH]DBMS_PARALLEL_EXECUTE to break your insert into chunks and run it in parallel.
    So if you can tell the actual objective we could offer some help.

  • Message split for every 1000 records

    Hi All,
    My scenario is Proxy to File.We have to process thousands of records from r/3 to.I need to create separate XML file for every 1000 records in receiver directory.Is there any solution to achieve this?
    Thanks in advance
    Kartikeya

    here;s the blog krish was referring to..
    Night Mare-Processing huge files in SAP XI

  • Select query for every 1000 records

    Hi all ,
             Please help me in the issue . I am using select query Select * from table up to 1000 rows for acheving the records but i want this process to retrigger once the process of 1000 records is compleded again it needs to fetch the next 1000 records and process the same . I am changing the status of the processed records once it is processed . Can can one tell me how to retrigger the select query once the 1000 records are processes.
    Thanks in advance,

    Hi Eric,
                  After selecting the 1000 records, find the key value of the last record. Build up the range as GT. Again use the select query.
    For example,
    Select * into table lt_data from ztab
    where key in r_key
    up to 1000 rows.
    regards,
    Niyaz

  • Creating 1 spool for every 1000 sapscripts

    Hi Friends ,
    I have a program where i am printing W-2 forms (sapscripts) . There are a total of 3000 forms . I need to be able to split them into 3 spools of 1000 each instead of creating 3000 spools . Please advise as to wat parameters need to be set in the beginning and when starting a new set of spool with 1000 forms .
    Thanks,
    Teresa

    You need to count the records and then for every 1000 you have to make a new SPOOL..
    LIke:
    LOOP AT ITAB.
    CNT = CNT + 1.
    ITCPO-TDNEWID = ' '.
    IF CNT =  1.
      ITCPO-TDNEWID = 'X'.
    ENDIF.
    OPEN_FORM
    wtih OPTIONS = ITCPO.
    WRITE_FORM
    CLOSE_FORM
    IF CNT = 1000.
      CLEAR CNT.
    ENDIF.
    ENDLOOP.
    Regards,
    Naimesh Patel

  • How to add a row for every 5 records using logic:iterate

    Hi,
    In my application, using logic:iterate iam displaying 20 records per page.
    I want to insert a row for every 5 records.
    Please tell how to insert that row.
    Thanks in advance.
    Mohan

    I think this could work for you
    for (int x=1 ; x<=20 ; x++) {
    addRowWithRecord
    if (x%5==0)
    addEmptyRow
    }

  • How to get wage type for every time record

    Hi Pros,
          I am using DS 0CA_TS_IS_1, it includes report time type (0REPTT), but not have wage type. in CATSDB, I fied fields for attendance/absence type and wage type. but not every time record has wage type. can you please tell me how to get wage type for every time record? what is relation between reporting time type, attendance/absence type and wage typs?

    Hello,
    Can you talk to your HR/T&E functional consultant if they populate these values in CATSDB table using standard way or if there are custom fields that are in CATSDB OR any other table which can be used to meed the requirements
    Thanks
    Abhishek Shanbhigue

  • Create new log file for every 1000 points

    Is it possible to have a new file/folder for every 1000 data points ? 
    How do you check number of points written to a file?

    Need A LOT more context here.  How are you logging the data?  Where is the data coming from?  What format are you saving the data?
    Any code you can supply that would give us context would help us help you.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Commit after every 1000 records

    Hi dears ,
    i have to update or insert arround 1 lakhs records every day incremental basis,
    while doing it , after completing all the records commit happens, In case some problem in between all my processed records are getting rollbacked,
    I need to commit it after every frequency of records say 1000 records.
    Any one know how to do it??
    Thanks in advance
    Regards
    Raja

    Raja,
    There is an option in the configuration of a mapping in which you can set the Commit Frequency. The Commit Frequency only applies to non-bulk mode mappings. Bulk mode mappings commit according the bulk size (which is also an configuration setting of the mapping).
    When you set the Default Operating Mode to row based and Bulk Processing Code to false, Warehouse Builder uses the Commit Frequency parameter when executing the package. Warehouse Builder commits data to the database after processing the number of rows specified in this parameter.
    If you set Bulk Processing Code to true, set the Commit Frequency equal to the Bulk Size. If the two values are different, Bulk Size overrides the commit frequency and Warehouse Builder implicitly performs a commit for every bulk size.
    Regards,
    Ilona

  • Need Help On Oracle form side for serial no genretion for every last record

    Hi Experts,
    currently i'm facing one problem like :
    i'm populating one receipt detail in Multi block , like when user key in one receipt number that time record should go in first record ,and if they key in second receipt number then record should go in second record . mean to say every time record go in last record ..but the problem is i want to generate Serial no correspondence to every last record ..
    here is my approch :
    cursor c1 is
    select * from table
    where cname =:blk_name.clm_name.
    Last record;
    next_record;
    for v1 in c1 loop
    processed record;
    next_record;
    end loop;
    last_record;
    go_block(___);
    first_record;
    :sno := system.cursor_record ;
    next_reocrd;
    end loop;
    first_record;
    And in block level i'm writing code for Serial number generation when user key in manual entry for receipt detail:
    :blk_name.coulumn_name := :system. cursor_record;
    so in this approach their is no problem it is working properly but the problem is that
    when user fetch one receipt automatically and then after he want to enter next record manually and he decided to go in detail block ,
    and once he reached in detail block that time block level trigger i firing .ans serial number 2 generated and then suddenly he came to know no i want to fetch next record automatically mean to say now user going again master block and fetching next receipt detail ,
    but the problem is when user leaving seccond sr no and going in master block and population next receipt detail that time cursor going on 3 record
    but logically have to replace the second Serial no and generate the again serial number 2 record population .
    so i'm appreciating is anyone if came accoross this type of issue please corrrect my code and send updated code ..plsssssssssssssssssssssssssssssss
    Thanks
    Abhishek
    [email protected]

    Friend, If you forward this question in forms forums , It will be better for you.
    Abishek Go this link and post there friend.
    Link:Forms

  • Creating a Trigger for Deleting the records from a parent Table

    I am new to creating Trigger
    We will need several small tables that will be used to store any records that are deleted by the owner of the table. These will likely need a trigger where we would Delete from the parent table and on that Delete populate the child table with the previous record's data.
    Please give me a pseudo code for this
    Thanks
    John
    Edited by: user10750995 on Dec 30, 2008 9:06 AM

    Something like this:
    CREATE OR REPLACE TRIGGER trg_my_table_hist
    AFTER DELETE
    ON my_table
    FOR EACH ROW
    BEGIN
    INSERT INTO Hist_MyTable
    ( column1, column2, ..., DELETION_DATE)
    VALUES
    (:OLD.column1, :OLD.column2, ...., SYSDATE);
    END;
    /My_Table is your main table. When a row is deleted, the trigger will be fired and copy the deleted row to another table called Hist_My_Table. I'm supposing that the history table has all columns as they are defined in main tables plus a column named DELETION_DATE.
    My experience indicates that, probably, it's a good idea maintain update history and the user. But it depends on your requests.
    Regards,
    Miguel

  • How do you make the date change for every entry when inserting.

    Hello, I am making a daily vehicle inspection report for my truck and I would like to make a 7 day calendar but I would like to insert the date ie Monday Feb 22, 2010, Tuesday Feb 23, 2010 etc...and have it change for each day of the week. is there a way to do this? Also can you put an outline or a box around the 6 lines of text that you input.
    Thank you
    Ottoman

    Jerrold Green1 wrote:
    Ottoman,
    As Peter says, you can use a Table for this. You do not, however, need to enter two dates to fill with a series of dates. Dates are an exception to the general Fill rule. Just enter one, and fill down to get successive dates.
    Other exception available:
    a single cell is sufficient for every entries ending with a number :
    president1
    thief2
    king3
    behave this way.
    Durations behave like numbers : two cells are required.
    Yvan KOENIG (VALLAURIS, France) samedi 27 février 2010 18:20:29

  • BDC for every 80 records

    Dear All,
    I have one typical BDC problem.
    If the number of records in file are crossing 80,my bdc is giving problem. So I need to split total records into sets of 80 and submit them.
    So I need to create the session name dynamically, pass the data dynamically.
    IF you can send some example code for the above it will be great help for me.
    Many Thanks,
    Ranjan

    Please find my code..
    This info may be useful..
    I'm doing BDC for KB31N tcode,where i have two items in header(doc date, posting date).Multiple line items(each line item should consists of 4 fields namely cost center,statistical key figure,total qty,text).
    When i'm sending more than 80 rec records i'm being populated an error message "BDC_Close_group, session not opened"
    Kindly advice me how to handle this
    *& Report  ZCO_I025_WSKAZNIKI_STAT_DEV                                 *
    *& Interfejs wczytywania wskaŸników statystycznych                     *
    REPORT  zco_i025_wskazniki_stat_dev                                 .
    TYPES: BEGIN OF l_tab_dane,
        indic LIKE rk23f-stagr,
        quant LIKE rk23f-mbgbtr,
        mpk LIKE rk23f-ekostl,
        order LIKE rk23f-eaufnr,
        text LIKE rk23f-sgtxt,
      END OF l_tab_dane.
    DATA: it_excel TYPE TABLE OF alsmex_tabline,
      wa_excel TYPE alsmex_tabline,
      it_data TYPE TABLE OF l_tab_dane,
      wa_data TYPE l_tab_dane,
      error  TYPE C,
      msg TYPE string.
    DATA:iv_pole TYPE string,
      ddatum(10),
      kdatum(10),
    *Inserted By  Developer
       filelist    TYPE filetable,
            rc          TYPE i.
    DATA: BEGIN OF bdctab OCCURS 5.
            INCLUDE STRUCTURE bdcdata.
    DATA: END OF bdctab.
    SELECTION-SCREEN BEGIN OF BLOCK p1 WITH FRAME TITLE text-001.
    PARAMETERS:
      p_zakla LIKE tka01-kokrs DEFAULT '1000',
      p_ddate LIKE sy-datum DEFAULT sy-datum,
      p_kdate LIKE sy-datum DEFAULT sy-datum.
    SELECTION-SCREEN ULINE.
    PARAMETERS:
      p_fname LIKE rlgrap-filename.  " DEFAULT 'd:dane.xls'.
    SELECTION-SCREEN END OF BLOCK p1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          file_filter       = cl_gui_frontend_services=>filetype_excel
         multiselection    = 'X'
        CHANGING
          file_table        = filelist
          rc                = rc.
      IF LINES( filelist ) IS INITIAL.
        EXIT.
      ENDIF.
      READ TABLE filelist INDEX 1 INTO p_fname.
    START-OF-SELECTION.
    AUTHORITY-CHECK OBJECT 'TKA01'
      ID 'KOKRS' FIELD p_zakla.
    CONCATENATE p_ddate6(2) '.' p_ddate4(2) '.' p_ddate(4) INTO ddatum.
    CONCATENATE p_kdate6(2) '.' p_kdate4(2) '.' p_kdate(4) INTO kdatum.
    error = '0'.
    PERFORM wczytaj_dane.
    IF error = '0'.
      PERFORM utworz_sesje.
      PERFORM wprowadz_dane.
        PERFORM zamknij_sesje.   "comment by prav
    ENDIF.
    PERFORM zamknij_sesje.        "add by prav
    IF error = '1'.
      WRITE: msg, /.
    ENDIF.
    WRITE: 'Wykonano', /.
    *&      Form  wczytaj_dane
          text
    FORM wczytaj_dane.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = p_fname
          i_begin_col             = 1
          i_begin_row             = 1
          i_end_col               = 8
          i_end_row               = 65000
        TABLES
          intern                  = it_excel
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc <> 0.
        WRITE: / 'B³ad importu pliku wejsciowego: ', p_fname, ' - ',
        sy-subrc.
      ELSE.
        SORT it_excel BY row col.
        LOOP AT it_excel INTO wa_excel.
          IF wa_excel-row = 1.
            CONTINUE.
          ENDIF.
          iv_pole = wa_excel-value.
          CASE wa_excel-col.
            WHEN 1. wa_data-indic = iv_pole.
            WHEN 2.
              REPLACE ',' WITH '.' INTO iv_pole.
              wa_data-quant = iv_pole.
            WHEN 3. wa_data-mpk = iv_pole.
            WHEN 4. wa_data-order = iv_pole.
            WHEN 5. wa_data-text = iv_pole.
          ENDCASE.
          AT END OF row.
            IF wa_data-mpk IS INITIAL AND wa_data-order IS INITIAL.
              error = '1'.
              WRITE:
    'Musi byæ podane Stanowisko kosztów lub Zlecenie wewnêtrzne. Rekord: ',
              wa_excel-row, /.
              EXIT.
            ENDIF.
            IF wa_data-mpk IS NOT INITIAL AND wa_data-order IS NOT INITIAL.
              error = '1'.
              WRITE:
    'Musi byæ podane Stanowisko kosztów lub Zlecenie wewnêtrzne. Rekord: ',
              wa_excel-row, /.
              EXIT.
            ENDIF.
            IF wa_data-indic IS INITIAL.
              error = '1'.
              WRITE: 'Brak identyfikatora wskaŸnika. Rekord: ', wa_excel-row
              EXIT.
            ENDIF.
            IF wa_data-quant IS INITIAL.
              error = '1'.
              WRITE: 'Brak informacji o iloœci. Rekord: ', wa_excel-row, /.
              EXIT.
            ENDIF.
            APPEND wa_data TO it_data.
            CLEAR wa_data.
          ENDAT.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    "wczytaj_dane
    *&      Form  wprowadz_dane
          text
    FORM wprowadz_dane.
      DATA:licznik TYPE i,
        l_txt TYPE string,
        pole(30) TYPE c,
        liczba(15) TYPE c.
      PERFORM bdc_dynpro      USING 'SAPLSPO4' '0300'.
      PERFORM bdc_field       USING 'BDC_CURSOR' 'SVALD-VALUE(01)'.
      PERFORM bdc_field       USING 'BDC_OKCODE' '=FURT'.
      PERFORM bdc_field       USING 'SVALD-VALUE(01)' p_zakla.
      PERFORM bdc_dynpro      USING 'SAPLK23F1' '1200'.
      PERFORM bdc_field       USING 'BDC_OKCODE' '/00'.
      PERFORM bdc_field       USING 'COHEADER-SEND_REC_REL' '03SAP'.
      PERFORM bdc_field       USING 'RK23F-STATUS' 'L'.
      PERFORM bdc_field       USING 'COHEADER-BLDAT' ddatum.
      PERFORM bdc_field       USING 'COHEADER-BUDAT' kdatum.
      PERFORM bdc_field       USING 'BDC_CURSOR' 'EKOSTL(1)'.
      licznik = 0.
      LOOP AT it_data into wa_data.
        ADD 1 TO licznik.
        l_txt = licznik.
        CONCATENATE 'EL4(' l_txt ')' INTO pole.
        condense pole no-gaps.
        PERFORM bdc_field USING pole wa_data-indic.
        CONCATENATE 'ELR1(' l_txt ')' INTO pole.
           condense pole no-gaps.
          liczba = wa_data-quant.
          if liczba <  0.
              shift liczba circular  left up to '-'.
          endif.
            condense liczba no-gaps.
        PERFORM bdc_field USING pole liczba.
        IF NOT wa_data-mpk IS INITIAL.
          CONCATENATE 'EL2(' l_txt ')' INTO pole.
             condense pole no-gaps.
          PERFORM bdc_field USING pole wa_data-mpk.
        ENDIF.
        IF NOT wa_data-order IS INITIAL.
          CONCATENATE 'EL3(' l_txt ')' INTO pole.
             condense pole no-gaps.
          PERFORM bdc_field USING pole wa_data-order.
        ENDIF.
        CONCATENATE 'EL8(' l_txt ')' INTO pole.
           condense pole no-gaps.
        PERFORM bdc_field USING pole wa_data-text.
      ENDLOOP.
      CALL FUNCTION 'BDC_INSERT'
        EXPORTING
          tcode            = 'KB31N'
        TABLES
          dynprotab        = bdctab
        EXCEPTIONS
          internal_error   = 1
          not_open         = 2
          queue_error      = 3
          tcode_invalid    = 4
          printing_invalid = 5
          posting_invalid  = 6
          OTHERS           = 7.
      IF sy-subrc <> 0.
        WRITE: / text-010 .
      ENDIF.
      REFRESH bdctab.
    clear:bdctab.        "by praveen
    ENDFORM.                    "wprowadz_dane
    *&      Form  bdc_dynpro
          text
         -->PROGRAM    text
         -->DYNPRO     text
    FORM bdc_dynpro USING program dynpro.
      CLEAR bdctab.
      MOVE:
        program   TO bdctab-program,
        dynpro    TO bdctab-dynpro,
        'X'       TO bdctab-dynbegin.
      APPEND bdctab.
    ENDFORM.                    "bdc_dynpro
    *&      Form  bdc_field
          text
         -->POLE       text
         -->WARTOSC    text
    FORM bdc_field USING pole wartosc.
      CLEAR bdctab.
      MOVE:
        pole     TO bdctab-fnam,
        wartosc  TO bdctab-fval.
      APPEND bdctab.
    ENDFORM.                    "bdc_field
    *&      Form  utworz_sesje
          text
    FORM utworz_sesje.
      CALL FUNCTION 'BDC_OPEN_GROUP'
        EXPORTING
          client = sy-mandt
          group  = 'WSKASTAT'
          user   = sy-uname
          keep   = 'X'.
    ENDFORM.                    "utworz_sesje
    *&      Form  zamknij_sesje
          text
    FORM zamknij_sesje.
      CALL FUNCTION 'BDC_CLOSE_GROUP'.
      IF sy-subrc NE 0.
        WRITE: /, 'B³ad podczas zamykania sesji'.
        EXIT.
      ENDIF.
    ENDFORM.                    "zamknij_sesje

  • How can i use page break for every 5 records in sap scripts

    on every 5 lines of records i have go for a new page so what is procedure to do this .if possible send me with coding .

    Hi John..
    this is the way..
    IN THE PRINT PROGRAM...
    DATA : V_MOD TYPE I.
    loop at Itab.
       V_MOD  = SY-TABIX / 5.
       IF V_MOD  = 0.
           CALL FUNCTION 'CONTROL_FORM'
           EXPORTING'
              COMMAND = 'NEW-PAGE' .
      ENDIF.
             CALL FUNCTION 'WRITE_FORM'
    ENDLOOP.
    <b>reward if Helpful.</b>

  • Update a column for every 2000 records in the table

    The table has 50,000 records. I want to update the process_id every 2000 rows. For example, 1 for the 1st 2000 rows, 2 for the next 2000 rows, 3 for the next 2000 rows, and etc. Is there a quick way to do it?
    Thanks much

    hey <[email protected]>
    Two ways of doing this...
    First: PL/SQL
    By declaring a cursor on the table and using the cursor%rowcount method to update your field..something like this...
    Declare
    Begin
    For rno in MyCursor
    Loop
    update <tablename> set process_id = lv_pid where rowid = rno.rowid
    If mod(MyCur%rowcount,2000) = 0 then
    lv_pid = lv_pid + 1;
    End If;
    End Loop;
    End
    I am sorry if u already knew this :-) !!
    Second: SQL
    let u know once (if)i crack it :-( !!
    Goodluck...
    Vasudev

Maybe you are looking for

  • ResultSet merge

    Does anyone know if there is a way of creating one result set from two? I need to write a query to return results from two databases that can not talk to each other (!). The results are only seen after some java fantasticness has turned them into an

  • Why can I not install yahoo toolbar on lastest Firefox 4.0.1???

    I had to reinstall an upgraded firefox (4.0.1), now I cannot install a yahoo toolbar like I had on my previous Firfox.

  • Virtual-directory-mapping + MS-Word MS-Excel

    Hi, I have created the following virtual-directory-mapping in my weblogic.xml <virtual-directory-mapping> <local-path>c:/zooi/temp</local-path> <url-pattern>/excel/*</url-pattern> <url-pattern>*.xls</url-pattern> </virtual-directory-mapping> Secondly

  • Hebrew problem when saving reports

    Hi, There are two users in the same department who have the ability to save reports. The reports are saved in Plus and are in Hebrew. One of them has no problem while the other has the problem whereby the Hebrew in the parameters and titles are all u

  • [SOLVED] MYSQL error about socketfiles!

    Hello, I installed mysql with pacman but cannot figure out how to run it! Running mysql_secure_installation give me this error: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) /etc/rc.d/mysqld