This is what I have learned about deleting a site collection. You can use stsadm command to delete a site collection (stsadm -o deletesite). If the site collection resides in the same content database as other site collections, access to other site collections will be affected (the site collection deletion seems use a lot of I/O).
If the site collection being deleted is in a separate content database, this does not affect the other site collections. One way to minimze deleting the site collection contents when it is sharing the same content database with other site collections is to use the "stsadm -o deleteweb" operation. This command deletes a site. But this site should not have any sub sites.
You can generate a script to delete all the sites, starting from the innermost, all the way to the top. To minimize the IO impact, you can put a "sleep" command in between the site deletion.
I used 2 bat files for the deletion 1) delete_web_sub.bat and 2)delete_web_main.bat
---------------------------------------
-- delete_web_sub.bat
---------------------------------------
@echo off
c:
cd %COMMONPROGRAMFILES%\Microsoft Shared\web server extensions\12\bin
echo %DATE% %TIME%
echo Deleting %1 now
stsadm.exe -o deleteweb -url %1
echo %1 deleted - sleep 10 count
sleep 10
---------------------------------------
-- delete_web_main.bat
---------------------------------------
@echo off
d:
cd D:\
call D:\delete_web_sub.bat "http://servername/sites/AVI/site1/subsite1"
call D:\delete_web_sub.bat "http://servername/sites/AVI/site1/subsite2"
call D:\delete_web_sub.bat "http://servername/sites/AVI/site1"
...
The following query can be run to generate content for delete_web_main.bat:
select 'call D:\delete_web_sub.bat "http://servername/'+ FullUrl +'"'
from webs
where fullurl like 'sites/AVI/%'
order by FullUrl desc
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment