OLAHALLENGREN OUTPUT FILE PATH INFO
The below parameter you need to change in the Ola script and Execute his maintenance script.
SET @OutputFileDirectory = 'G:\Backups\Siva'
This path will be automatically generated by Ola script.
G:\Backups\Siva\DatabaseBackup_FULL_$(ESCAPE_SQUOTE(JOBID))_$(ESCAPE_SQUOTE(STEPID))_$(ESCAPE_SQUOTE(DATE))_$(ESCAPE_SQUOTE(TIME)).txt
The below powershell query will change teh output file path of FULL,DIFF,LOG,INDEX and INTEGRITY check backups. Backup jobs are created by Ollahallengren script.
cls $InstanceName = 'RAMESH\PROD' $FullPath='D:\ramesh\mahesh\USER_DATABASES_FULL_$(ESCAPE_SQUOTE(JOBID))_$(ESCAPE_SQUOTE(STEPID))_$(ESCAPE_SQUOTE(DATE))_$(ESCAPE_SQUOTE(TIME)).txt' $DIFFPath='D:\ramesh\mahesh\USER_DATABASES_DIFF_$(ESCAPE_SQUOTE(JOBID))_$(ESCAPE_SQUOTE(STEPID))_$(ESCAPE_SQUOTE(DATE))_$(ESCAPE_SQUOTE(TIME)).txt' $LOGPath='D:\ramesh\mahesh\USER_DATABASES_LOG_$(ESCAPE_SQUOTE(JOBID))_$(ESCAPE_SQUOTE(STEPID))_$(ESCAPE_SQUOTE(DATE))_$(ESCAPE_SQUOTE(TIME)).txt' $IndexPath='D:\ramesh\mahesh\USER_DATABASES_INDEXES_$(ESCAPE_SQUOTE(JOBID))_$(ESCAPE_SQUOTE(STEPID))_$(ESCAPE_SQUOTE(DATE))_$(ESCAPE_SQUOTE(TIME)).txt' $IntegrityPath = 'D:\ramesh\mahesh\USER_DATABASES_INTEGRITY_$(ESCAPE_SQUOTE(JOBID))_$(ESCAPE_SQUOTE(STEPID))_$(ESCAPE_SQUOTE(DATE))_$(ESCAPE_SQUOTE(TIME)).txt' $JobList=Get-DbaAgentJob ` -SqlInstance $InstanceName|Select Name|Where-Object {($_.Name -like '*USER_DATABASES*')-and($_.Name -like '*FULL*')} $JobList| ForEach-Object{ $IndJob = $_ Set-DbaAgentJobOutputFile ` -SqlInstance $InstanceName ` -Job $IndJob.Name ` -OutputFile $FullPath ` -Verbose } $JobList=Get-DbaAgentJob ` -SqlInstance $InstanceName|Select Name|Where-Object {($_.Name -like '*USER_DATABASES*')-and($_.Name -like '*DIFF*')} $JobList| ForEach-Object{ $IndJob = $_ Set-DbaAgentJobOutputFile ` -SqlInstance $InstanceName ` -Job $IndJob.Name ` -OutputFile $DIFFPath ` -Verbose } $JobList=Get-DbaAgentJob ` -SqlInstance $InstanceName|Select Name|Where-Object {($_.Name -like '*USER_DATABASES*')-and($_.Name -like '*LOG*')} $JobList| ForEach-Object{ $IndJob = $_ Set-DbaAgentJobOutputFile ` -SqlInstance $InstanceName ` -Job $IndJob.Name ` -OutputFile $LOGPath ` -Verbose } $JobList=Get-DbaAgentJob ` -SqlInstance $InstanceName|Select Name|Where-Object {($_.Name -like '*USER_DATABASES*')-and($_.Name -like '*Index*')} $JobList| ForEach-Object{ $IndJob = $_ Set-DbaAgentJobOutputFile ` -SqlInstance $InstanceName ` -Job $IndJob.Name ` -OutputFile $IndexPath ` -Verbose } $JobList=Get-DbaAgentJob ` -SqlInstance $InstanceName|Select Name|Where-Object {($_.Name -like '*USER_DATABASES*')-and($_.Name -like '*integrity*')} $JobList| ForEach-Object{ $IndJob = $_ Set-DbaAgentJobOutputFile ` -SqlInstance $InstanceName ` -Job $IndJob.Name ` -OutputFile $IntegrityPath ` -Verbose }
Comments