문제

우리의 SharePoint2007 설치 particularily 엄청난 첫 번째 단계는 휴지통이 있습니다.내가 쓴 PowerShell 스크립트는 삭제합니다.그냥 재미,그의 아래에 게시됩니다.

2: 우리는 42,500,000+기록에는 휴지통이 테이블에서 데이터베이스 내용!!
제가 생각한 것은 우리의 BDLC 했던 일정에 오기 전에 저는 팀에 되었습 펌핑에서 많은 데이터 RecycleBin 테이블도 SharePoint 관리 할 수 없습니다 그것 없이 제대로 작동합니다.심지어 우리는 예약 스크립트를 제거할 수 있습니다 1000 기록 매 30 분마다 출발합니다.수학에서는 다음을 느끼 미니다.이렇게 많은 기록하는 지금도 없습니다 당신이 적용량을 할당없이 SharePoint 합니다.그것처럼 보이는 우리가 동결하는 삭제하면 레코드에서 BDLC

갱신 1: 내가 실행되 내 PowerShell 스크립트의 각 항목을 삭제하고 실행 SQL 프로파일을 찾기 proc_DeleteRecycleBinItem 실행과 관련된 여러 테이블도록 우리가 빠르고 쉽고 효과적으로 공부할 수 있는 예약 PowerShell 스크립트를 실행/모든 보고서는 N 분입니다.

우리는 38,500,000+기록에는 휴지통이 테이블에서 데이터베이스 내용!!

나를 믿는 이유를 이렇게 엄청난은 우리가 가지고 있기 때문에 BDLC 에 의해 계층 2 기에서 데이터를 다른 시스템과 그것은 재활용 삭제된 레코드입니다.또한,그것은 그렇게 큰 것에도 원래의 SharePoint 타이머 작업 통제할 수 없는 그 시간들...

나는 것에 의해 촬영 SharePoint 마이 요청에 의해 하지만...누구도 삭제된 행을 실제 RecycleBin 테이블에서 SharePoint 콘텐츠를 데이터베이스?우리는 15430792KB(14.7GB).

내가 알고 있는 Microsoft 지원을 수정하는 경우 컨텐츠는 데이터베이스.게시하지 마십시오로 대답합니다.물론되지 않은 가장 좋습니다.이 질문은 분명히:는 사람이 이제까지 시도 그것은?...

나는 단순히 빠른 방법을 찾을 청소하는 휴지통이 있습니다.당신이 볼 수있는 내 스크립트는 아래에 분명히 노력했을 설정하는 일부 정비합니다.Bin 얻도록 큰 영 스크립트를 실행하기 때문에 많은 데이터입니다.

우리의 사용자 데이터가 실제로 203790168KB(194.3GB)고 썼 PS 스크립트를 얻는 큰 파일을 관리할 수 있는 크기뿐만 아니라.는,또한 아래 contibute 다시 에테르.

또한,우리는 BDLC(w/3rd 파티에서 도구를 계층 2)하는 동기화의 데이터를 이리저리 SQL.내가 믿 이 작업을 삭제합니 많은 양의 데이터는 정기적으로는 RecycleBin 테이블은 거대합니다.

나는 대답을 추측하여 내 자신의 질문이있을 수 있습니다...다.일정 작업을 실행하 maintaince 스크립트가 이미 작성한...hmmm...

function RemoveOldItems-SPFirstStageRecycleBin([string]$url, [int]$rowlimit, [int]$days) 
{
    $siteCollection = New-Object Microsoft.SharePoint.SPSite($url);  
    $recycleQuery = New-Object Microsoft.SharePoint.SPRecycleBinQuery;
    $recycleQuery.ItemState = [Microsoft.SharePoint.SPRecycleBinItemState]::FirstStageRecycleBin
    $recycleQuery.OrderBy = [Microsoft.SharePoint.SPRecycleBinOrderBy]::DeletedDate
    $recycleQuery.RowLimit = $rowlimit

    $recycledItems = $siteCollection.GetRecycleBinItems($recycleQuery);

    $count = $recycledItems.Count;

    for($i = 0; $i -lt $count; $i++){
        $age = ((Get-Date) - $recycledItems[$i].DeletedDate).Days;
        if($age -gt $days){
            $g = New-Object System.Guid($recycledItems[$i].ID);
            $recycledItems.Delete($g);
        }
    }

    $siteCollection.Dispose()
}



function Get-DocInventory() {
    [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
    $farm = [Microsoft.SharePoint.Administration.SPFarm]::Local
    foreach ($spService in $farm.Services) {
        if (!($spService -is [Microsoft.SharePoint.Administration.SPWebService])) {
            continue;
        }

        foreach ($webApp in $spService.WebApplications) {
            if ($webApp -is [Microsoft.SharePoint.Administration.SPAdministrationWebApplication]) { continue }

            foreach ($site in $webApp.Sites) {
                foreach ($web in $site.AllWebs) {
                    foreach ($list in $web.Lists) {
                        if ($list.BaseType -ne "DocumentLibrary") {
                            continue
                        }
                        foreach ($item in $list.Items) {
                            $data = @{
                                "Web Application" = $webApp.ToString()
                                "Site" = $site.Url
                                "Web" = $web.Url
                                "list" = $list.Title
                                "Item ID" = $item.ID
                                "Item URL" = $item.Url
                                "Item Title" = $item.Title
                                "Item Created" = $item["Created"]
                                "Item Modified" = $item["Modified"]
                                "Size (kb)" = $item.File.Length/1KB
                                "Size (gb)" = $item.File.Length/1GB

                            }

                            Write-Host $item.Url -ForegroundColor DarkGray

                            # Only add files larger than 100 MB
                            if($item.File.Length -gt 100MB){
                                Write-Host $site.Url + $item.Url -ForegroundColor Red
                                New-Object PSObject -Property $data
                            }
                        }
                    }
                    $web.Dispose();
                }
                $site.Dispose()
            }
        }
    }
}
#Get-DocInventory | Out-GridView
Get-DocInventory | Export-Csv -NoTypeInformation -Path D:\Logs\inventory.csv


$jobName = "Get Large Lists"

function Get-LargeLists() {
    [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

    #create stop watch
    [System.Diagnostics.Stopwatch] $sw;
    $sw = New-Object System.Diagnostics.Stopwatch
    $sw.Start()

    $lists = @()
    $reportSiteUrl = "http://my-site.gov/sites/applications/reporting/"
    $reportListUrl = $reportSiteUrl + "Lists/Large%20Lists/"
    $farm = [Microsoft.SharePoint.Administration.SPFarm]::Local
    foreach ($spService in $farm.Services) {
        if (!($spService -is [Microsoft.SharePoint.Administration.SPWebService])) {continue}

        foreach ($webApp in $spService.WebApplications) {
            if ($webApp -is [Microsoft.SharePoint.Administration.SPAdministrationWebApplication]) {continue}

            foreach ($site in $webApp.Sites) {
                foreach ($web in $site.AllWebs) {
                    foreach ($list in $web.Lists) {
                        # only add items that have 1000 items or more
                        if($list.ItemCount -le 99){continue}

                        # create new object
                        $o = New-Object Object
                        Add-Member -InputObject $o -MemberType NoteProperty -Name SiteCollectionUrl -Value $list.ParentWeb.Site.RootWeb.Url
                        Add-Member -InputObject $o -MemberType NoteProperty -Name ListURL -Value ($list.ParentWeb.Url + "/" + $list.RootFolder.Url)
                        Add-Member -InputObject $o -MemberType NoteProperty -Name Title -Value $list.Title
                        Add-Member -InputObject $o -MemberType NoteProperty -Name Description -Value $list.Description
                        Add-Member -InputObject $o -MemberType NoteProperty -Name ItemCount -Value $list.ItemCount

                        # add object to $list global array
                        $lists += $o
                    }
                    $web.Dispose()
                }
                $site.Dispose()
            }
        }
    }

    #export array to csv
    $lists | Export-Csv D:\Logs\large_lists.csv -NoTypeInformation -Force

    #connect to SharePoint Site and List
    $s = New-Object Microsoft.SharePoint.SPSite($reportSiteUrl)
    $w = $s.openweb()
    $l = $w.GetList($reportListUrl)

    #clear SharePoint List
    $query = New-Object Microsoft.SharePoint.SPQuery
    $query.ViewAttributes = "Scope='Recursive'"
    $query.Query = ""

    $items = $l.GetItems($query)
    $items | % { $l.GetItemById($_.Id).Delete() }

    #export to SharePoint List
    $lists | ForEach{
        $item = $l.Items.Add()
        $item["Title"] = $_.Title
        $item["SiteCollectionUrl"] = $_.SiteCollectionUrl

        $u = New-Object Microsoft.SharePoint.SPFieldUrlValue
        $u.Description = "Link"
        $u.Url = $_.ListURL
        $item["URL"] = $u

        $item["Description"] = $_.Description
        $item["Count"] = $_.ItemCount
        $item.Update()
    }

    $w.Dispose()
    $s.Dispose()

    #stop timer and log event
    $sw.Stop()

    C:\_scripts\sp_log.ps1 -jobName $jobName -message "Reported large lists on SharePoint Farm." -type "Success" -duration $sw.Elapsed.Seconds -linkTitle "Link" -linkUrl "http://my-site.gov/sites/applications/reporting/Lists/Large%20Lists/"
}

#catch exceptions
trap [Exception]{
    C:\_scripts\sp_log.ps1 -jobName $jobName -message  $_.Exception.Message -type "Error" -duration $sw.Elapsed.Seconds -linkTitle "Link" -linkUrl "http://my-site.gov/sites/applications/reporting/Lists/Large%20Lists/"
}

Get-LargeLists
도움이 되었습니까?

해결책

i가 각 항목을 삭제하여 각 항목을 삭제하고 RAN SQL> 프로덕션을 찾아 proc_deleterecyclebinitem 을 찾아 프로덕션>을 찾을 수 있도록 proc_deleterecyclebinitem 을 찾으려면 예약 된 powershell 스크립트를 실행하여 실행 /보고합니다n 분마다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top