[SharePoint] backs up and cleans up audit logs

Source: Internet
Author: User
Tags management studio microsoft sql server management studio sql server management sql server management studio
  • What is SharePoint audit log?
    Is a function that records user access to SharePoint logs.
    It is to give the Administrator an idea of the current website access status and which accounts frequently visit which sites.
    The setting method is to go to the site setting page, and there is a "site collection audit Settings" Link under site collection administration. Click to enter
    There are some options for you to check which actions need to be logged.

  • What can SharePoint audit log do?
    You can analyze which sites are frequently used, which sites are rarely used, and which sites are no longer used. Based on this, you can
    1. Unnecessary disk space can be recycled
    2. Reasonable Allocation of database space that can be compressed
    3. You can perform full-text search on the necessary site.
    .........

  • What is the implementation mechanism of SharePoint audit log?
    In fact, there is a table "auditdata" in the corresponding dB to record the relevant information.
    The main fields are: siteid, Itemid, itemtype, userid, machinename, machineip, occurred, event, eventname ....
    Occurred records the occurrence time. The itemtype and event are described as follows:

    Itemtype  
    1 Document
    3 Listitem
    4 List
    5 Folder
    6 Web
    7 Site
    Event  
    1 Checkout
    2 Checkin
    3 View
    4 Delete
    5 Update
    6 Profilechange
    7 Childdelete
    8 Schemachange
    10 Undelete
    11 Workflow
    12 Copy
    13 Move
    14 Auditmaskchange
    15 Search
    16 Childmove
    30 Secgroupcreate
    31 Secgroupdelete
    32 Secgroupmemberadd
    33 Secgroupmemberdel
    34 Secroledefcreate
    35 Secroledefdelete
    36 Secroledefmodify
    37 Secroledefbreakinherit
    38 Secrolebindupdate
    39 Secrolebindinherit
    40 Secrolebindbreakinherit
    50 Eventsdeleted
    100 Custom

  • What problems does SharePoint audit log have?
    As you can imagine, if the site is not frequently accessed, the database information will be very large. It is normal to reach the g level and T level.
    Before accessing a website, logs are first written to the table of auditdata. If the table is large, the write speed slows down and the speed of the entire page slows down.
    Log is basically a double-edged sword. It may also hurt us while providing help.
    So the method to avoid log impact on performance is to regularly clean up logs. If you still need to keep those logs, you can back up them to other databases.

  • Back up and clear SharePoint audit log.
    Use Microsoft SQL Server Management studio to back up auditdata table
    Use the stsadm command tool provided by Sharepoint to clear logs (you can also delete logs directly through SQL)
    For example, to back up and clear the logs before January 30, 12/30 (excluding the logs generated on January 30,), follow these steps:
    1. Go to Microsoft SQL Server Management Studio
    , Right-click the corresponding dB and choose --> tasks --> export data
    2. Select the backup data source ---> go to the next step
    3. Select the target database-> select the database you want to back up in the database (if not, create a new database)
    4. Backup conditions. Select the write a query to specify the data to transfer option and click "Next"
    5. Enter the SQL statement and click Next.
    select * from AuditData where Occurred<'2012-12-30'

    6. Confirm the name of the table to be backed up. You can change the name of the table if necessary.
    7. Continue the next step.
    After the backup is complete, you can clear it.
    8. Go to the machine where Sharepoint is installed.
    Locate stsadm. Ext.
    The general location is:
    C: \ Program Files \ commonfiles \ microsoft shared \ Web Server Extensions \ 12 \ bin \ stsadm

    Run:

    stsadm -o trimauditlog -date 20121230 -databasename you_databasename

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.