Showing posts with label space. Show all posts
Showing posts with label space. Show all posts

Friday, March 30, 2012

Need to cleardown a table due to disk space problems

I need to delete about 3 million rows from a table that is part of a merge
publication. I think that I will have to copy out the rows that I want to
keep into a temp table and truncate the table and then copy the rows back in.
My question is how best to go about this? I think that the best way is to go
into the publication properties and uncheck the table on the articles tab.
Then to carry out the same process of copying out the data to be kept,
truncate the table, then move the rows to be kept back in. Then add the
article back into the publication. In order for the article to replicated
after adding it back in would I have to do a snapshot or would it resume by
itself?
Russell,
this sounds OK. However if the publication already has a subscription, you
won't be able to remove the individual article and you'll have to drop the
entire subscription before proceeding. You could drop the subscription,
remove the rows on publisher and subscriber then do a nosync initialization.
HTH
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Monday, March 19, 2012

need script to monitor os free space & errors

I am looking for a script to check the os free space and email if getting below a threshold.
Additionally, I am looking for another script to read the sql server log for errors and to email if error (or a string) is found.
MikeYou can take help of ALERTS in SQL server for free space threshold, refer to books online for more information.

Also can take help of Notification services or third party tools like BMC Patrol to alert if any error occurs in SQL error log/|||Procedure for extracting error from Errorlog and send email:

1) Open a notepad, cut and paste the following sample of errors
that you would like to find:

Error: 3414
Error: 3437
Error: 3619
Error: 8651
Error: 9002
BACKUP failed to complete
consistency errors
Exception Access Violation
.
.
.

and save it as "search_list.txt"

2) Open another notepad, cut & paste the below sample to
extract the error and output to a file (C:\List_error.txt) if
any error in the Errorlog is matched with the "Search_list.txt"
provided above:

IF EXIST DEL C:\List_errorlog.txt
Findstr /i /g:C:\Search_List.txt D\MSSQL\LOG\errorlog >
C:\List_errorlog.txt

osql -Sservername -E -Q"xp_sendmail @.recipients = 'DBA_on_call@.yahoo.com', @.message = 'See attached file for error',@.attachments = 'H:\MSSQL\LOG\List_errorlog.txt', @.subject = 'SQL Server Errorlog'"

save it as a command file like "Search_error.cmd"

3) start the Enterprise Manager and schedule a job that run the
"Search_error.cmd" for every 10 min or whenever...

Goodluck

SVT

Saturday, February 25, 2012

Need help! Used Space in dB and Tran files

I have a database about 39GB in size and is running out of allocated space. In the Enterprise Manager the properties for this dB, show that there is 0.00MB space available. I need to increase the size of the dB.

What I need to find out is, which file group is full so I can expand the appropriate file group instead of expanding all the filegroups. Also, is there a way to find the space usage of each file in the file group and also the Transaction log?

db Size 39GB
14 File Groups
17 database files (mdf & ndf)
2 Transaction Log files
180 Tables

I am aware of the sp_spaceused, but the information it furnishes is not enough for me to make a decision.

Need help urgently!!!!check this query out and see if this will be of any help:

select [Allocated_Size_MB]=size*8/1024, [Max_Size_MB]=maxsize*8/1024, name from sysfiles|||Thanks for your reply. The results from the query give me the allocated size.
How can I find the "used" space (or free/available space) in this allocated space?