Sunday, March 25, 2012
Can't shrink a database
I am running SQL2005 SP1 Standard.
I have a database that was originally a SQL2K db that was rolled up to 2K5.
Everything was fine with it until I truncated a few tables and dropped a
large column & index on a few tables. Since then the following symptoms are
present:
1) The size of the datafile and log file are about 2.5x the size of the
actual data
2) The DB properties ALWAYS shows "Space Available" as "0.00 MB"
3) The shrink dialog with the file type set to "Log" shows avaialble free
space to be 98% but shrinking it does not release any of the free space.
I have tried backing up the database, deleting it and restoring it but the
inflated log file still exists. I've also tried creating a new blank DB
(versus letting the restore create it) and restoring into that but the
problem persists.
Does anyone have any ideas on how to shrink this database down?
Thanks,
--
-Steven1) Is it the data or the log file which is "too big"?
2) Read about DBCC UPDATEUSAGE
3) See http://www.karaszi.com/SQLServer/info_dont_shrink.asp
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Steven Berkovitz" <mbcdev@.community.nospam> wrote in message
news:F4B6BA40-9143-4D52-BC8F-3FB9CFBEB133@.microsoft.com...
> Hi there,
> I am running SQL2005 SP1 Standard.
> I have a database that was originally a SQL2K db that was rolled up to 2K5.
> Everything was fine with it until I truncated a few tables and dropped a
> large column & index on a few tables. Since then the following symptoms are
> present:
> 1) The size of the datafile and log file are about 2.5x the size of the
> actual data
> 2) The DB properties ALWAYS shows "Space Available" as "0.00 MB"
> 3) The shrink dialog with the file type set to "Log" shows avaialble free
> space to be 98% but shrinking it does not release any of the free space.
> I have tried backing up the database, deleting it and restoring it but the
> inflated log file still exists. I've also tried creating a new blank DB
> (versus letting the restore create it) and restoring into that but the
> problem persists.
> Does anyone have any ideas on how to shrink this database down?
> Thanks,
> --
> -Steven|||Hi Steven,
I would like to know the issue status and whether or not you need further
research.
You can try setting the recovery mode to simple, backing up your database
completely, truncating the log with BACKUP LOG ... WITH TRUNCATE ONLY, and
then use DBCC SHRINKFILE to shrink the log file.
Have a great day!
Charles Wang
Microsoft Online Community Support
Can't shrink a database
I am running SQL2005 SP1 Standard.
I have a database that was originally a SQL2K db that was rolled up to 2K5.
Everything was fine with it until I truncated a few tables and dropped a
large column & index on a few tables. Since then the following symptoms are
present:
1) The size of the datafile and log file are about 2.5x the size of the
actual data
2) The DB properties ALWAYS shows "Space Available" as "0.00 MB"
3) The shrink dialog with the file type set to "Log" shows avaialble free
space to be 98% but shrinking it does not release any of the free space.
I have tried backing up the database, deleting it and restoring it but the
inflated log file still exists. I've also tried creating a new blank DB
(versus letting the restore create it) and restoring into that but the
problem persists.
Does anyone have any ideas on how to shrink this database down?
Thanks,
--
-Steven1) Is it the data or the log file which is "too big"?
2) Read about DBCC UPDATEUSAGE
3) See http://www.karaszi.com/SQLServer/info_dont_shrink.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Steven Berkovitz" <mbcdev@.community.nospam> wrote in message
news:F4B6BA40-9143-4D52-BC8F-3FB9CFBEB133@.microsoft.com...
> Hi there,
> I am running SQL2005 SP1 Standard.
> I have a database that was originally a SQL2K db that was rolled up to 2K5
.
> Everything was fine with it until I truncated a few tables and dropped a
> large column & index on a few tables. Since then the following symptoms a
re
> present:
> 1) The size of the datafile and log file are about 2.5x the size of the
> actual data
> 2) The DB properties ALWAYS shows "Space Available" as "0.00 MB"
> 3) The shrink dialog with the file type set to "Log" shows avaialble free
> space to be 98% but shrinking it does not release any of the free space.
> I have tried backing up the database, deleting it and restoring it but the
> inflated log file still exists. I've also tried creating a new blank DB
> (versus letting the restore create it) and restoring into that but the
> problem persists.
> Does anyone have any ideas on how to shrink this database down?
> Thanks,
> --
> -Steven|||Hi Steven,
I would like to know the issue status and whether or not you need further
research.
You can try setting the recovery mode to simple, backing up your database
completely, truncating the log with BACKUP LOG ... WITH TRUNCATE ONLY, and
then use DBCC SHRINKFILE to shrink the log file.
Have a great day!
Charles Wang
Microsoft Online Community Supportsql
Can't setup replication: Encryption error using CryptProtectData?
I am trying to setup replication but am having the following issues
Publisher:
SQL 2005 SP1 Enterprise Cluster (Active, Passive)
Subscriber:
SQL 2005 SP1 Enterprise
When trying to create a publication or subsubscription running under a Windows Domain account the following error message appears:
Replication-Replication Distribution Subsystem: agent ECHO\ECHO-InsDB-INS_CMS_PUB-HARPO-58 failed. Unable to start execution of step 2 (reason: Error authenticating proxy DETINI\srvRep_user, system error: Logon failure: unknown user name or bad password.). The step failed.
Further in the SQL logs we find that the above message is due to:
[298] SQLServer Error: 22046, Encryption error using CryptProtectData. [SQLSTATE 42000]
It appears that when Credentials for the agent proxy are being created that this message occurs. So when the SP that tries to run the agent (snapshot or distrobution) is called it always returns incorrect password details.
The Credentials do appear to be created, they are visible via SQL Studio, but you can't see the password. Changing the password via SQL Studio does not work as the Credentials are recreated every time.
I have checked the following:
MSDTC is running correctly
The Domain Account has the correct privileges to run these services
Regenerated the Service Master Key
Created Master Keys in each database effected by replication
Ensure SQL Service accounts have access to decrypt the Service Master Key
I can create a Publication and Subscription using the local system account on the cluster
Does anyone have any idea ?
Chris
Chirs,
My testing environment is the same as yours - the publisher/distributer is clustered SQL2005 enterprise with SP1 on windows 2003, and the subscriber is SQL2005 enterprise on 2003 server, and I have got the same error when I was trying to run the creating snapshot job. The only workaround I found was to put the distributor on the same server as the publisher, and use a local directory for shapshot folder, which was not ideal, but at least I could continue with my test. Then I had the same error again when I ran the push distribution job using a domain ammount. I had to change the security to use SQL agent account, which is a domain admin account.
I would like to know how to avoid the error too, since I want the distributor to be on a different machine than the publisher, and limit the rights of the credentials on the production environments.
Ying
sqlCan't setup replication: Encryption error using CryptProtectData?
I am trying to setup replication but am having the following issues
Publisher:
SQL 2005 SP1 Enterprise Cluster (Active, Passive)
Subscriber:
SQL 2005 SP1 Enterprise
When trying to create a publication or subsubscription running under a Windows Domain account the following error message appears:
Replication-Replication Distribution Subsystem: agent ECHO\ECHO-InsDB-INS_CMS_PUB-HARPO-58 failed. Unable to start execution of step 2 (reason: Error authenticating proxy DETINI\srvRep_user, system error: Logon failure: unknown user name or bad password.). The step failed.
Further in the SQL logs we find that the above message is due to:
[298] SQLServer Error: 22046, Encryption error using CryptProtectData. [SQLSTATE 42000]
It appears that when Credentials for the agent proxy are being created that this message occurs. So when the SP that tries to run the agent (snapshot or distrobution) is called it always returns incorrect password details.
The Credentials do appear to be created, they are visible via SQL Studio, but you can't see the password. Changing the password via SQL Studio does not work as the Credentials are recreated every time.
I have checked the following:
MSDTC is running correctly
The Domain Account has the correct privileges to run these services
Regenerated the Service Master Key
Created Master Keys in each database effected by replication
Ensure SQL Service accounts have access to decrypt the Service Master Key
I can create a Publication and Subscription using the local system account on the cluster
Does anyone have any idea ?
Chris
Chirs,
My testing environment is the same as yours - the publisher/distributer is clustered SQL2005 enterprise with SP1 on windows 2003, and the subscriber is SQL2005 enterprise on 2003 server, and I have got the same error when I was trying to run the creating snapshot job. The only workaround I found was to put the distributor on the same server as the publisher, and use a local directory for shapshot folder, which was not ideal, but at least I could continue with my test. Then I had the same error again when I ran the push distribution job using a domain ammount. I had to change the security to use SQL agent account, which is a domain admin account.
I would like to know how to avoid the error too, since I want the distributor to be on a different machine than the publisher, and limit the rights of the credentials on the production environments.
Ying
Thursday, March 8, 2012
Can't remotely access SQL 2005 named instance
I just installed SQL 2005 Developer Edition on a brand new W2K3 w/ SP1
server. I installed a default instance, and then a named instance called
"DEV".
Initially, I could not access either instance from a remote machine. I went
into SQL Server Surface Area Configuration and enabled TCP/IP and Named Pipes
under the Remote Access portion of the dialog for BOTH instances.
I can access the default instance from a remote machine. I still cannot
access the named instance from a remote machine. I have triple checked all
my settings. They are exactly the same for both instances.
The error message I receive is:
26 - Error locating server/instance specified
I can't see the DEV instance in the SQL Server browse list either.
Can anyone help?Is the SQL Server Browser service started on the server?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Ant-nee" <Antnee@.discussions.microsoft.com> wrote in message
news:2B8ED4DB-E631-4C73-9C06-072557EC7FAA@.microsoft.com...
> SuHi,
> I just installed SQL 2005 Developer Edition on a brand new W2K3 w/ SP1
> server. I installed a default instance, and then a named instance called
> "DEV".
> Initially, I could not access either instance from a remote machine. I went
> into SQL Server Surface Area Configuration and enabled TCP/IP and Named Pipes
> under the Remote Access portion of the dialog for BOTH instances.
> I can access the default instance from a remote machine. I still cannot
> access the named instance from a remote machine. I have triple checked all
> my settings. They are exactly the same for both instances.
> The error message I receive is:
> 26 - Error locating server/instance specified
> I can't see the DEV instance in the SQL Server browse list either.
> Can anyone help?|||Thanks! That fixed the issue. You have helped me before, Tibor, and I thank
you again for your expertise. I may be a MCDBA, but I'm still a 2005 novice
:)
I read a blurb somewhere that enabling the Browser service opens security
holes in SQL Server. Is this true, and if it is how does it indeed open
security holes?
- Anthony
"Tibor Karaszi" wrote:
> Is the SQL Server Browser service started on the server?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Ant-nee" <Antnee@.discussions.microsoft.com> wrote in message
> news:2B8ED4DB-E631-4C73-9C06-072557EC7FAA@.microsoft.com...
> > SuHi,
> >
> > I just installed SQL 2005 Developer Edition on a brand new W2K3 w/ SP1
> > server. I installed a default instance, and then a named instance called
> > "DEV".
> >
> > Initially, I could not access either instance from a remote machine. I went
> > into SQL Server Surface Area Configuration and enabled TCP/IP and Named Pipes
> > under the Remote Access portion of the dialog for BOTH instances.
> >
> > I can access the default instance from a remote machine. I still cannot
> > access the named instance from a remote machine. I have triple checked all
> > my settings. They are exactly the same for both instances.
> >
> > The error message I receive is:
> >
> > 26 - Error locating server/instance specified
> >
> > I can't see the DEV instance in the SQL Server browse list either.
> >
> > Can anyone help?
>|||You're welcome Anthony. :-)
> I read a blurb somewhere that enabling the Browser service opens security
> holes in SQL Server. Is this true, and if it is how does it indeed open
> security holes?
Every surface you open opens increases the threat area. I don't know of any particular issues with
the SQL Browser. The same functionality existed in 2000, but it was built-in to the database engine.
To be more specific I guess we would have to see that comment.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Ant-nee" <Antnee@.discussions.microsoft.com> wrote in message
news:B18F79B4-C704-4903-A98C-FC3D5F25323D@.microsoft.com...
> Thanks! That fixed the issue. You have helped me before, Tibor, and I thank
> you again for your expertise. I may be a MCDBA, but I'm still a 2005 novice
> :)
> I read a blurb somewhere that enabling the Browser service opens security
> holes in SQL Server. Is this true, and if it is how does it indeed open
> security holes?
> - Anthony
> "Tibor Karaszi" wrote:
>> Is the SQL Server Browser service started on the server?
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>> Blog: http://solidqualitylearning.com/blogs/tibor/
>>
>> "Ant-nee" <Antnee@.discussions.microsoft.com> wrote in message
>> news:2B8ED4DB-E631-4C73-9C06-072557EC7FAA@.microsoft.com...
>> > SuHi,
>> >
>> > I just installed SQL 2005 Developer Edition on a brand new W2K3 w/ SP1
>> > server. I installed a default instance, and then a named instance called
>> > "DEV".
>> >
>> > Initially, I could not access either instance from a remote machine. I went
>> > into SQL Server Surface Area Configuration and enabled TCP/IP and Named Pipes
>> > under the Remote Access portion of the dialog for BOTH instances.
>> >
>> > I can access the default instance from a remote machine. I still cannot
>> > access the named instance from a remote machine. I have triple checked all
>> > my settings. They are exactly the same for both instances.
>> >
>> > The error message I receive is:
>> >
>> > 26 - Error locating server/instance specified
>> >
>> > I can't see the DEV instance in the SQL Server browse list either.
>> >
>> > Can anyone help?
>>|||"Ant-nee" <Antnee@.discussions.microsoft.com> wrote in message
news:2B8ED4DB-E631-4C73-9C06-072557EC7FAA@.microsoft.com...
> SuHi,
> I just installed SQL 2005 Developer Edition on a brand new W2K3 w/ SP1
> server. I installed a default instance, and then a named instance called
> "DEV".
> Initially, I could not access either instance from a remote machine. I
> went
> into SQL Server Surface Area Configuration and enabled TCP/IP and Named
> Pipes
> under the Remote Access portion of the dialog for BOTH instances.
> I can access the default instance from a remote machine. I still cannot
> access the named instance from a remote machine. I have triple checked
> all
> my settings. They are exactly the same for both instances.
Have you tried the SQL Server Configuration Manager on the W2K machine.
This iw wher you open up the IP/Named pipes.
Wednesday, March 7, 2012
can't register server
have no domain. I have two clients, one w2k Pro, sp4, and the other
XP, sp1. I'm using Windows authentication. Neither can register my
server. The error msg is the same for both:
<mysvr> - SQL Server does not exist or access denied.
ConnectionOpen (Connect())
Mind you, the server did show up in the client window, so the client
does seem to know that the server does exist.
Might anyone have an iea as to what I've done wrong? Or haven't done?
Thanks in advance,
Tom
Do you have a firewall running on the box that is hosting SQL Server?
Perhaps it is blocking the connection attempts.
Keith
"Tcs" <tsmith@.eastpointcityNoSpam.org> wrote in message
news:s5ev619fasn9sskr0pdvevu9mfarrldo3l@.4ax.com...
>I have SQL Server 2k, sp3a, on a w2k, sp4 box. I'm at home, where I
> have no domain. I have two clients, one w2k Pro, sp4, and the other
> XP, sp1. I'm using Windows authentication. Neither can register my
> server. The error msg is the same for both:
> <mysvr> - SQL Server does not exist or access denied.
> ConnectionOpen (Connect())
> Mind you, the server did show up in the client window, so the client
> does seem to know that the server does exist.
> Might anyone have an iea as to what I've done wrong? Or haven't done?
> Thanks in advance,
> Tom
>
|||Tom hi,
Did you check your client network utility in your clients. Is any record in
there?
You use DHCP or static IP?
Is your name resolution correct?
Are your windows logins in the SQL Server logins?
Check these first
HTH
Andreas
"Tcs" wrote:
> I have SQL Server 2k, sp3a, on a w2k, sp4 box. I'm at home, where I
> have no domain. I have two clients, one w2k Pro, sp4, and the other
> XP, sp1. I'm using Windows authentication. Neither can register my
> server. The error msg is the same for both:
> <mysvr> - SQL Server does not exist or access denied.
> ConnectionOpen (Connect())
> Mind you, the server did show up in the client window, so the client
> does seem to know that the server does exist.
> Might anyone have an iea as to what I've done wrong? Or haven't done?
> Thanks in advance,
> Tom
>
Friday, February 24, 2012
can't modify stored proc which is in a publication
Hi
SQL 2005 sp1 - merge replication - HTTPS.
We have 2 publications for the database - one which has subscription.SyncType = SubscriptionSyncType.Automatic
and another with SyncType = SubscriptionSyncType.None.
The first publication is there so we can add new stored procs etc, the second contains the initial schema and the data.
When we try to modify a proc which is in the publication with SyncType = Automatic, the query never returns.
This is most urgent - thanks for your help.
Bruce
Do we have one or two subscriptions to publication one that contains the stored proc as a merge article in the publication?
|||There are 2 subscriptions - one for each publication - but the proc is only in one publication
regards
Bruce
1. Back to your original question - could the query (modifying the SP) be locked by another process so that it won't return?
2. Let us try to isolate this problem. If you can - colon the publication database, this publication (no second one), and subscribing database; does the same problem still occur?
Thanks.
|||1. I doubt it..
2. 'colon the publication database' - what do you mean ?
thanks
|||Create another publication database and create the same set of user tables/views/SPs. Just create one publication which includes the SP and other merge articles. See if you still can repro this issue with a single publication.
Thanks.
|||We will try this tomorrow - but it's worth pointing out the following
a) the publication with SyncType = none -- has a few hundred stored procs - I can change any of these no worries
b) the publication with SyncType = automatic - initially just has 1 stored proc - so we can create the publication! - it's the procs we've added to this which we can't subsequently change.
Regards
Bruce
Ok
I stripped it right back.
a. created a new database
b. added one proc
c. created the merge publication , snapshot etc
d. initalized ok
e. The query never returns....
Thanks
Bruce
Can you share the proc prototype/definition (also I assume you use "ALTER PROCEDURE" to modify it)? I want to repro this case in house.
Thanks.
|||Absolutely - it's a mindnumbing place-holder - it's just there so we can create the publication..
Don't laugh.
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
--
-- This is the proc for the 'extras' subscription
--
--
ALTER PROCEDURE [dbo].[aaaaPlaceHolder]
AS
BEGIN
SET NOCOUNT ON;
SELECT 'fish', 'cow', 'dog', 'elephant', 'pig', 'moo', 's', 't', 'dog', 'sheep'
END
|||
Bruce,
Thanks for your help. I have repro-ed this scenario on my machine. I need to work with my peers to diagnoise the real cause of it. Should get back to you once I have the answer.
Regards,
Leo
This posting is provided "AS IS" with no warranties, and confers no rights.
|||As a temp solution - a dummy table can be created to join the SP in the same publication so that SP can be modified and replicated to the subscriber.
Leo
This posting is provided "AS IS" with no warranties, and confers no rights.
|||Hi
I'll try it - has this been logged as a bug ? If so, how do I keep track of it ?
Thanks
|||The bug was definitely filed and once I heard the decision/status I post it immediately.
Thanks
|||This issue/bug should be addressed in Yukon Service Pack 2.
Leo
This posting is provided AS IS with no warranties, and confers no rights
can't modify stored proc which is in a publication
Hi
SQL 2005 sp1 - merge replication - HTTPS.
We have 2 publications for the database - one which has subscription.SyncType = SubscriptionSyncType.Automatic
and another with SyncType = SubscriptionSyncType.None.
The first publication is there so we can add new stored procs etc, the second contains the initial schema and the data.
When we try to modify a proc which is in the publication with SyncType = Automatic, the query never returns.
This is most urgent - thanks for your help.
Bruce
Do we have one or two subscriptions to publication one that contains the stored proc as a merge article in the publication?
|||There are 2 subscriptions - one for each publication - but the proc is only in one publication
regards
Bruce
1. Back to your original question - could the query (modifying the SP) be locked by another process so that it won't return?
2. Let us try to isolate this problem. If you can - colon the publication database, this publication (no second one), and subscribing database; does the same problem still occur?
Thanks.
|||1. I doubt it..
2. 'colon the publication database' - what do you mean ?
thanks
|||Create another publication database and create the same set of user tables/views/SPs. Just create one publication which includes the SP and other merge articles. See if you still can repro this issue with a single publication.
Thanks.
|||We will try this tomorrow - but it's worth pointing out the following
a) the publication with SyncType = none -- has a few hundred stored procs - I can change any of these no worries
b) the publication with SyncType = automatic - initially just has 1 stored proc - so we can create the publication! - it's the procs we've added to this which we can't subsequently change.
Regards
Bruce
Ok
I stripped it right back.
a. created a new database
b. added one proc
c. created the merge publication , snapshot etc
d. initalized ok
e. The query never returns....
Thanks
Bruce
Can you share the proc prototype/definition (also I assume you use "ALTER PROCEDURE" to modify it)? I want to repro this case in house.
Thanks.
|||Absolutely - it's a mindnumbing place-holder - it's just there so we can create the publication..
Don't laugh.
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
--
-- This is the proc for the 'extras' subscription
--
--
ALTER PROCEDURE [dbo].[aaaaPlaceHolder]
AS
BEGIN
SET NOCOUNT ON;
SELECT 'fish', 'cow', 'dog', 'elephant', 'pig', 'moo', 's', 't', 'dog', 'sheep'
END
|||Bruce,
Thanks for your help. I have repro-ed this scenario on my machine. I need to work with my peers to diagnoise the real cause of it. Should get back to you once I have the answer.
Regards,
Leo
This posting is provided "AS IS" with no warranties, and confers no rights.
|||As a temp solution - a dummy table can be created to join the SP in the same publication so that SP can be modified and replicated to the subscriber.
Leo
This posting is provided "AS IS" with no warranties, and confers no rights.
|||Hi
I'll try it - has this been logged as a bug ? If so, how do I keep track of it ?
Thanks
|||The bug was definitely filed and once I heard the decision/status I post it immediately.
Thanks
|||This issue/bug should be addressed in Yukon Service Pack 2.
Leo
This posting is provided AS IS with no warranties, and confers no rights
Tuesday, February 14, 2012
Can't install Express June CTP?!
I've had an old version of the .NET 2.0 Framework installed, so I downloaded the one mentioned next to the SQL Express download (this one: http://go.microsoft.com/fwlink/?linkid=48448).
Each and every time I run the setup I encounter this error:
The SQL Server service failed to start. For more information, see the SQL Server Books Online topics, "How to: View SQL Server 2005 Setup Log Files" and "Starting SQL Server Manually."
There is not even any sort of SQL Server service in the list of services, what should I do?
Regards,
Hendrik BehrensI've also tried the same on Windows XP Professional SP2. I had to uninstall a previous version of .NET 2.0 and VWD Express/VB Express Beta 2 are installed.
I get the same error message?! - The service is not there and the setup just fails with that message.
I've had SQL Express April CTP installed on a windows 2003 Enterprise *trial*, which worked, the update to Junce CTP... right, fails with the same message.
Any proposals?|||Did you look for the log files?
-Euan|||Yes I did, and I found the problem: My windows XP Professional and Windows Server 2003 Web Edition are both german - the setup fails on non-english langauge versions with default settings, this german article describes the problem and how to solve it (for everyone else who encounters this):
http://www.microsoft.com/germany/msdn/vs2005/installvs2005beta.mspx
(basically, remove the tick "Hide advanced configuration Options" and select "Local System" as the service account, instead of "Network Service", which is the default.)