You must Sign In to post a response.
  • Category: Windows 8

    Daily SQL database restore issue

    Hi Team,
    just one clarification about sql server restore database as daily basis. i have two servers like Primary and secondary server. primary server backup file .bak stored in one shared location.

    i am goint to create one sql job to restore the primary database's backup to secondary server. so i will write one sql job and its run daily after business hours and restore the database into secondary server.

    is this possible to update only updated records on secondary server?.

    can you please tell me the better option. i want to make it active both.
  • #769300
    Here are the parameters supported by sp_restoregene:
    @Database SYSNAME = NULL,
    @TargetDatabase SYSNAME = NULL,
    @WithMoveDataFiles VARCHAR(2000) = NULL,
    @WithMoveLogFile VARCHAR(2000) = NULL,
    @FromFileFullUNC VARCHAR(2000) = NULL,
    @FromFileDiffUNC VARCHAR(2000) = NULL,
    @FromFileLogUNC VARCHAR(2000) = NULL,
    @StopAt DATETIME = NULL,
    @StandbyMode BIT = 0,
    @IncludeSystemDBs BIT = 0,
    @WithRecovery BIT = 0,
    @WithCHECKDB BIT = 0,
    @WithReplace BIT = 0,
    @UseDefaultDatabaseBackupPath BIT = 0,
    @Log_Reference VARCHAR (250) = NULL,
    @LogShippingVariableDeclare BIT = 1,
    @LogShippingStartTime DATETIME = NULL,
    @LogShippingLastLSN VARCHAR(25) = NULL

    And here is a sample script:
    RESTORE DATABASE db_workspace
    FROM DISK = 'X:\Backups\Temp\db_workspace.bak' WITH REPLACE,
    FILE = 1,CHECKSUM,NORECOVERY, STATS=10
    , MOVE 'db_workspace' TO 'x:\data\db_workspace.mdf'
    , MOVE 'db_workspace_log' TO 'x:\data\db_workspace_log.ldf'
    , MOVE 'db_workspace_FG2' TO 'x:\data\db_workspace_FG2.ndf'
    , MOVE 'db_workspace_FG1' TO 'x:\data\db_workspace_FG1.ndf'


  • Sign In to post your comments