If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > I need to deactive these datbases after restarting instance

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-17-08, 15:38
smith43017 smith43017 is offline
Registered User
 
Join Date: Sep 2006
Posts: 92
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.
Reply With Quote
  #2 (permalink)  
Old 01-17-08, 15:39
smith43017 smith43017 is offline
Registered User
 
Join Date: Sep 2006
Posts: 92
Can some body can let me know what I am doing wrong
Reply With Quote
  #3 (permalink)  
Old 01-17-08, 18:23
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
Reply With Quote
  #4 (permalink)  
Old 01-18-08, 11:53
smith43017 smith43017 is offline
Registered User
 
Join Date: Sep 2006
Posts: 92
Thanks Stolze
Reply With Quote
  #5 (permalink)  
Old 01-18-08, 11:54
smith43017 smith43017 is offline
Registered User
 
Join Date: Sep 2006
Posts: 92
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 12:27.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On