Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2004
    Posts
    17

    Unanswered: reorg rebuild tables ?

    hi all,


    i 've to write down a script to reorg some tables but not all tables (ASE 12.5)
    this will be done via a script (in korn shell) in crontab. and i just need a bit help.

    i would like to do something like that


    -------------
    #!/bin/ksh

    #Variables
    #---------

    SERVER=toto
    BASE=yyyy
    tables_name= table1, table2, table3, ...etc



    isql -Usa -Pxxx -S${SERVER}
    use $BASE
    go
    reorg rebuild ${tables_name}
    go
    exit


    something like that.

    is it possible ?
    because i d'ont want ti declare one varible for each table name and have to do a reorg rebuild command for eache table :d

    Thnx a lot

    labigre

  2. #2
    Join Date
    Jun 2003
    Posts
    140
    I would suggest u to do something like this

    tables_list= table1, table2, table3, ...etc

    for table in $tables_list
    do
    isql -Usa -Pxxx -S${SERVER}
    use $BASE
    go
    reorg rebuild ${table}
    go
    done
    exit

    for more info check 'for' syntax in unix man

  3. #3
    Join Date
    Jun 2004
    Posts
    17
    thnx a lot Perl ;-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •