Viewing 15 posts - 136 through 150 (of 242 total)
why power shell, why not T-sql?
February 14, 2018 at 11:43 am
I use this, works all the time
declare @cmd varchar(max)
declare @cmd_suspend varchar(max)
declare @cmd_resume varchar(max)
declare c1 cursor read_only for
select 'ALTER DATABASE ['+DB_name(database_id)+'] SET HADR...
February 14, 2018 at 7:58 am
Since trace has more information as to who,where,when I have created a job called 'DBA - Notify System Changes' with the code below, Also I am using Alert to detect...
February 9, 2018 at 11:50 am
umm... here are other two methods
-- get it from default trace
DECLARE @trc_path VARCHAR(500)
SELECT @trc_path=CONVERT(VARCHAR(500),value) FROM fn_trace_getinfo(DEFAULT)
WHERE property=2
print @trc_path
SELECT TEXTData,HostName,ApplicationName,DatabaseName,LoginName,SPID,StartTime,EventSequence
FROM fn_trace_gettable(@trc_path,1) fn
February 9, 2018 at 9:02 am
That depends on how you connect extra NIC, I had extra NIC with direct cable connection to backup server and the results were amazing.
I been using striped backups...
February 5, 2018 at 7:38 am
I would never shrink data-files (https://littlekendra.com/2016/11/08/shrinking-sql-server-data-files-best-practices-and-why-it-sucks/ ), log files however a different story.
I use output of following to shrink the databases
(Just make sure you have auto...
February 2, 2018 at 12:18 pm
you can use the following, no matter what you do, it is going to take time to transfer file over wire. you may want to use with compression, in addition...
February 2, 2018 at 10:09 am
umm.... how about that? -- this will not commit transactions but will not failover until all the transactions are committed or rolled back
if not exists (
SELECT...
January 29, 2018 at 10:05 am
you can issue checkpoint command to ensure all the dirty pages are written before performing fail-over.
checkpoint
go
alter availability group [myag] failover
go
January 29, 2018 at 7:52 am
I think you need to restore database from pre-depolyment backup.
January 25, 2018 at 1:44 pm
I usually use the script to generate restore commands and run "restore database <dbname>" command in the end to recover the database, it makes it much easier.
--...
January 24, 2018 at 8:37 am
I never used it, you can try and let us know.
January 23, 2018 at 10:04 am
try this
sp_configure 'xp_cmdshell',1 -- you need this to map network drive
reconfigure
go
exec xp_cmdshell 'net use x:\\server\share /user:DOMAIN\DBRestore_svc password' --map thur sql so drive is not...
January 22, 2018 at 12:36 pm
are you able to map the drive ?
net use x:\\server\share /user:DOMAIN\DBRestore_svc password
January 22, 2018 at 12:35 pm
Viewing 15 posts - 136 through 150 (of 242 total)