Sysfiles name shows wrong database
Posted on 2008-06-19
I've inherited a database that had relatively large log files. Datafiles: 23GB, 11GB, 9GB. Log files: 25GB, 13GB, 10GB. I wanted to get this fixed. I backed up the databases and then tried to run DBCC Shrinkfile. On database1 and 3 I had no problems. But on database2, it fails with "could not locate file 'database2' in sysfiles. I looked at sysfiles for database2 and the filename column points to database2.mdf and database2_log.ldf. However, the name column shows database1_dat and database1_log.
Will ALTER DATABASE resolve this?