February 20, 2012 at 2:57 am
if you shrink by query or by job the syntax is the same, you just put a t-sql job step in and give it the t-sql.
DBCC SHRINKFILE(1,100) in a query window and DBCC SHRINKFILE(1,100) as a job step still do the same thing.
February 20, 2012 at 3:17 am
kranthi.india123 (2/20/2012)
my apologizes about the confusion.please see the below sites.http://www.sql-server-performance.com/forum/threads/srinking-database-for-logshipping.30829/
http://www.bigresource.com/Tracker/Track-ms_sql-rI2McykB/
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=140751
and so can in test it.please provide any script for shrinking databases.through job
Same code that has been earlier provided can be scheduled in a agent job. However, I am writing it here again:
DBCC SHRINKFILE (YourLogFileLogicalName,30720)
Notice, that I am using SHRINKFILE in the above command instead of SHRINKDATABASE. You should not use SHRINKDATABASE if you want to shrink just the log file of your database as SHRINKDATABASE shrinks both, the data file as well as the log file.
Coming to the links provided by you:
1. Exerpts from 1st link:
Hi satya,
One more update in this process.To confirm the above query i have configured Log Shipping Process in testing server.after successfull run of process we Shrink the Dabase which has been configured for LS Process.After Shinking the Database again i ran LS Jobs it's ran perfectly without any distrabance.Finslly the actual size has been updated in the LS Server.
Thanks for your kind update.
2. 2nd Link does not work (blocked under some category)
3. Exerpts from 3rd Link:
DBCC shrinkfile with default options should be ok to shrink the transaction log.
4. Exerpts from 4th Link:
You can shrink the log on the primary server as long as you don't truncate it.
So, nobody is talking about NOTRUNCATE here & every forum says that you can shrink!!! then what's your point with NOTRUNCATE?
February 20, 2012 at 11:10 pm
Thank you for helping To me.
Yes, We can schedule a job to shrink log file. It is helpful when ur Tlog not in use, but occupied drive size.Right
Yes, there is no LSN mismatch, We can shrinked. Also no impct to logshipping We can use truncate_only option. Because it applies to data file not log file.
because Logshipping completely depends on log file.Right,
so My drive is 1TB,so drive is full,when log shipping Will be running(logshipped databases)dis scenario can i shrink the databases(.mdf and ldf ) or move the other location???
SQL server DBA
February 21, 2012 at 2:14 am
kranthi.india123 (2/20/2012)
so My drive is 1TB,so drive is full,when log shipping Will be running(logshipped databases)dis scenario can i shrink the databases(.mdf and ldf ) or move the other location???
Shrinking data file is a bad idea, because your database has to grow by the time. if your log file is taking much space than required then you can shrink it or you can move the log file to other disk with more space.
Note: Shrinking the data file is very bad idea because your indexes get fragmented a lot after shrinking.
February 25, 2012 at 11:39 am
Thank You so Much To Helping To Me....
I have one More doubt,I have configured database mail and sent a successful test email.Transaction Log Shipping Status Report Through Send Mail is it possible???? and i want last backup file the day and last restored file in the day Through Send Mail also is it possible???
I know this is
Transaction Log Shipping Report in the Tables:
msdb..log_shipping_monitor_primary (for the primary server) and in
msdb..log_shipping_monitor_secondary (for the secondary server)
Please Help To me
..
Transaction Log Shipping Status Report Through Send Mail is it possible????
and failure alert also Through Mail?? pls
SQL server DBA
February 26, 2012 at 7:03 am
Please Help To me
..
Transaction Log Shipping Status Report Through Send Mail is it possible????
and failure alert also Through Mail?? pls
SQL server DBA
February 27, 2012 at 1:03 am
you should have some alert jobs for log shipping, these will tell you in your in sync or out of sync as they will either succeed of fail, you could just create an operator and get SQL to mail out when they complete
or look through this URL and build yourself a query which gets the specifics you need
February 27, 2012 at 2:13 am
Thank you...
But i know that one,iam asking Transaction Logshipping status report via send mail???
i want last Backup file of the and last restoration File in the day Through Mail??
any script???
please Help me
SQL server DBA
February 27, 2012 at 2:15 am
take a look through the url above and also backupset table and build a sp_send_dbmail query to send you the mail
February 27, 2012 at 3:11 am
kranthi.india123 (2/27/2012)
Thank you...But i know that one,iam asking Transaction Logshipping status report via send mail???
i want last Backup file of the and last restoration File in the day Through Mail??
any script???
please Help me
Query log shipping tables in msdb for the information related to last restored file, last copied file & last backed up file. Send the query results through mail using msdb.dbo.sp_send_dbmail. Try to write the script, if you face any problem please post it here.
February 28, 2012 at 3:10 am
i'm writing below this code..
exec msdb..sp_send_dbmail
@profile_name = 'local',@recipients='chintu@www.com'
, @subject ='Log Shipping Job succeeded'
, @QUERY = 'exec sp_executesql @stmt=N'exec sp_help_log_shipping_monitor',@params=N'
I want Log shipping Status Through Mail.please Suggest Me.....because last back up transaction in the day and last restoration trn file in the day...
so may be above script right..please help me...
SQL server DBA
February 29, 2012 at 1:50 am
kranthi.india123 (2/28/2012)
i'm writing below this code..exec msdb..sp_send_dbmail
@profile_name = 'local',@recipients='chintu@www.com'
, @subject ='Log Shipping Job succeeded'
, @QUERY = 'exec sp_executesql @stmt=N'exec sp_help_log_shipping_monitor',@params=N'
I want Log shipping Status Through Mail.please Suggest Me.....because last back up transaction in the day and last restoration trn file in the day...
so may be above script right..please help me...
Please create a new thread for this. As this is a different requirement. Would update you with the query over there.
Viewing 12 posts - 31 through 42 (of 42 total)
You must be logged in to reply to this topic. Login to reply