Consulting about c2 Audit

  • Hi, i have a question: is no way to move the default path of the c2 Audit?

    thanks for yours answers.

    Brownsea.

  • I looked at this a little while ago, i don't think you can and when its filled the disk sql stops working.

    Someone may have a solution though.

    Gethyn Elliswww.gethynellis.com

  • http://www.microsoft.com/technet/security/prodtech/sqlserver/sql2kaud.mspx

    This link supports my thoery

    Gethyn Elliswww.gethynellis.com

  • Well, you can do a ServerSide trace using the same patterns.

  • Quit simple:

    Just add a default data file location and off you go !

    You will need to restart your sqlinstance after you activate C2 !

    USE [master]

    GO

    Declare @DataPath NVarchar(2000)

    Declare @LogPath NVarchar(2000)

    Declare @DataPathOLD NVarchar(2000)

    Declare @LogPathOLD NVarchar(2000)

    EXEC xp_instance_regread N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'DefaultData', @DataPathOLD OUTPUT

    EXEC xp_instance_regread N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'DefaultLog', @LogPathOLD OUTPUT

    print @DataPathOLD

    print @LogPathOLD

    -- install (only if condition is activated)

    If 0 = 1

    begin

    -- Adjust !!!

    Select @DataPath = N'D:\MSSQL.1\MSSQL\DATA'-- Adjust !

    , @LogPath = N'D:\MSSQL.1\MSSQL\DATA'-- Adjust !

    if @DataPath = isnull(@DataPathOLD,'UNKNOWN')

    and @LogPath = isnull(@LogPathOLD,'UNKNOWN')

    begin

    Print 'DBA: No adjustment needed!'

    end

    else

    begin

    declare @tmp_xp_fileexist_Result table (File_Exists tinyint, File_is_a_Directory tinyint, Parent_Directory_Exists tinyint )

    set nocount on

    insert into @tmp_xp_fileexist_Result

    exec master..xp_fileexist @DataPath

    if exists (Select * from @tmp_xp_fileexist_Result where File_is_a_Directory = 1 )

    begin

    delete from @tmp_xp_fileexist_Result;

    insert into @tmp_xp_fileexist_Result

    exec master..xp_fileexist @LogPath;

    if exists (Select * from @tmp_xp_fileexist_Result where File_is_a_Directory = 1 )

    begin

    /* SQL2005 always use xp_instance_regwrite */

    EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'DefaultData', REG_SZ, @DataPath

    EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'DefaultLog', REG_SZ, @LogPath

    Print 'Default Data and Log file location keys installed'

    end

    else

    begin

    RAISERROR (N'DBA message: directory [%s] does not exist. Regkeys not installed!!!', 20, 1, @LogPath) with log;

    end

    end

    else

    begin

    RAISERROR (N'DBA message: directory [%s] does not exist. Regkeys not installed!!!', 20, 1, @DataPath) with log;

    end

    end

    end

    else

    begin

    print '';

    print '********* DBA: Install part not activated !!!! *********';

    end

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • Thanks for you comments, i try

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply