Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2006
    Posts
    97

    Unanswered: I need to deactive these datbases after restarting instance

    if [ ${dbfile}='DBPTLFEP'||${dbfile}='DBPTLLMP']; then
    db2 deactivate db ${dbfile}
    fi


    I want to deactivate dbs if name are DBPTLLMP,DBPTLFEP the vales I am reading from flat file.

  2. #2
    Join Date
    Sep 2006
    Posts
    97
    Can some body can let me know what I am doing wrong

  3. #3
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Please see my response in the Unix Shell Scripts group. You should read the man page for "test"
    Code:
    $ man test
    It describes exactly how conditions have to be written in shell script.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  4. #4
    Join Date
    Sep 2006
    Posts
    97
    Thanks Stolze

  5. #5
    Join Date
    Sep 2006
    Posts
    97
    Code:
    db2 list db directory|grep -p Indirect|grep -E "alias"|cut -c41-49>dbs
    while read dbfile
    do
    if [ "${dbfile}" = 'DBPTLFEU' -o "${dbfile}" = 'DBPTLLMU' ]; then
        db2 deactivate db ${dbfile};
    else
     db2 connect to ${dbfile};
     echo ${dbfile} 
     db2 -tvf ptldeadevnt.sql 
     db2 connect reset>/dev/null
    fi
    done < dbs
    Last edited by smith43017; 01-18-08 at 13:27.

Posting Permissions

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