Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 949
  • Last Modified:

MSSQL 7 Administration - Compact Database

Hello Gurus,

Have a customer who has an application that makes use of a MSSQL7 instance.  I see no tools whatsoever installed on this machine to admin the database.  Customer is concerned because he was told his database was approaching the limit.  I checked, and sure enough, the c:\mssql7\data\table.mdf file is approaching 2 gigs.

Question: how can I fix this?  I know the name of the server instance, but do not know a username/password combo to connect to it.  Thanks!
0
drtester
Asked:
drtester
  • 7
  • 6
  • 2
  • +1
1 Solution
 
mkobrinCommented:
Using OSQL you can connect using the switch -E for a it to use your windows account for windows authenticated login, as long as your account has permissions
0
 
Ephraim WangoyaCommented:
You can download SQL Express version from
http://www.microsoft.com/express/Database/
and chose to install management tools only

A better choice would be to install the SQL Server version 2008 R2 express and port the databse to that version the reason beith that Express 2008 R2 supports upto 10G of data, that space will not be filled ina while
0
 
drtesterAuthor Commented:
Mkobrin: What is OSQL, and where can I get it?

Ewangoya: Will the SQL Express management tools work with a MSSQL 7 server?  Will I need a username/password to connect, or can I just use the admin login for the machine?

Thanks!
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
Ephraim WangoyaCommented:
They will work with mssql7

Use Windows Authentication if you don't have the sa password
0
 
Scott PletcherSenior DBACommented:
If you can login as a Windows account that has admin on the box, by default you will have admin authority on SQL (unless s/o removed the related login from SQL, which is typically rare, esp. for 7.0).

You should look at the backup history in msdb.  Also look at packages.  You can delete obsolete backup history and you can move packages from msdb to files.

You can definitely get msdb wayyyyyyyyy below 2G.
0
 
drtesterAuthor Commented:
ScottPletcher: I will give that a shot.  Where is the backup history and packages you mentioned?  I'm looking on a MSSQL 2005 server, and don't see those things.

0
 
Scott PletcherSenior DBACommented:
First, see how much backup history you have.

SELECT MIN(backup_finish_date)
FROM msdb.dbo.backuset WITH (NOLOCK)

If it's too much, a "hack" cleanup of *everything* works far better than attempting to use the standard system proc -- it is just horrifically slow on 7.0 and 2000.


As to packages, to totally move a package from SQL to a file, you have to open each package and save them as a file.

Or, if you don't need older versions of packages, and I can't see why you would here, you can just delete all the obsolete versions and just keep the latest versions of each package.

To get an idea of how many obsolete package versions you have, run this command:

SELECT name, COUNT(DISTINCT versionid) AS TotalVersions
FROM msdb.dbo.sysdtspackages WITH (NOLOCK)
GROUP BY name
ORDER BY name
COMPUTE SUM(COUNT(DISTINCT versionid))

Of course the min # of versions for a pkg should be 1; anything over that are older versions of the pkg.

[I really think COMPUTE is valid in 7.0, but I haven't done 7.0 in a *long* time, so if it doesnt work, just remove it.]
0
 
Scott PletcherSenior DBACommented:
If you have a lot of obsolete package versions and you want to get rid of them, do the following:

1) Take a full backup of msdb
2) Run the code below to delete all older versions of pkgs

If you want to save the older version for specific pkg(s), fill in the names where indicated by comments.

Naturally you will have to set on 'show advanced options', then 'allow updates' to run the code.
DELETE FROM pkg
FROM msdb.dbo.sysdtspackages pkg
INNER JOIN (
    SELECT name, MAX(createdate) AS createdate
    FROM msdb.dbo.sysdtspackages
    --WHERE name NOT IN ('') --list of pkgs to KEEP ALL VERSIONS OF
    GROUP BY name
) AS mostRecentPkg ON 
    mostRecentPkg.name = pkg.name AND
    mostRecentPkg.createdate > pkg.createdate

Open in new window

0
 
Scott PletcherSenior DBACommented:
Be aware that technically a job / whatever could be running a pkg just by its unique versionid.

That's extremely rare, but technically it is possible.  If you run into that after deleting the older versions, just restore msdb to a different db name, and copy the pkg version(s) you need from there to the live msdb.dbo.sysdtspackages.
0
 
drtesterAuthor Commented:
Hey guys,

I just tried the SQL Management Express, and it says it can't find any database servers.  But it also says it only works with SQL2000 and above.  I can verify this is version 7, and it is indeed running.

I also found the osql.exe... tried running that, but it asks for a password.  Everything I tried doesn't work!

Found another DB utility the application had, but it asks for host, database, username, and password.  I know the host and database, but everything I try for username/password fails.  Help!
0
 
Scott PletcherSenior DBACommented:
SQL 2000 interface will work with 7.0, if you still have Enterprise Manager around.

Sorry, I haven't used Express edition enough for that to be helpful there.
0
 
drtesterAuthor Commented:
Hmm, I posted another message here, but I don't see it now.  Strange.

Anyways, I did find a command line switch that got me in.  I tried the command: SELECT MIN(backup_finish_date) FROM msdb.dbo.backuset WITH (NOLOCK), but it says that there is no database table named msdb.dbo.backuset.  What now?

0
 
drtesterAuthor Commented:
Anyone?
0
 
Scott PletcherSenior DBACommented:
Sorry, typo on table name, should be:

FROM msdb.dbo.backuPset WITH (NOLOCK)
0
 
drtesterAuthor Commented:
Ended up not doing the job for the customer, as a practical solution was not found. :-(  Thanks anyways.
0
 
drtesterAuthor Commented:
Did not find a solution.
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

  • 7
  • 6
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now