Solved

Change Name is Sysfiles

Posted on 2007-12-06
2
618 Views
Last Modified: 2012-05-05
Our ERP system (JDE) has three enviroments each in it's own SQL Database. The easiest way to refresh the production data to the prototype enviroment is to backup the production database (PS_Prod) and restore it to the prototype enviroment (PS_CRP). This works fine with one exceeption. After the restore we run the following SQLs:
sp_msforeachtable @command1='grant all on ? to public'
and
update sysobjects
set UID = User_ID('CRPDTA')
where UID= USER_ID('PRODDTA')

These work fine
However the name is sysfiles table is wrong. The file path is correct though. Below are the results of query select name, filename from sysfile
PS_PROD_Data   E:\mssql\data\PS_CRP.mdf                                                              
PS_PROD_Log     F:\mssql\log\\PS_CRP_log.LDF                                                        
This causes a problem whenn trying to run the DBBC shrinkfile command

is there a way to change the name back to PS_CRP_Data and PS_CRP_Log in the field name in sysfiles without causing any residual problems?

0
Comment
Question by:EVANFAGER
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Accepted Solution

by:
ShogunWade earned 500 total points
ID: 20422228
0
 

Expert Comment

by:Hurric8ne
ID: 21313784
I tired using the Alter database Modify file option to amend a file name contained in SYSFILES but I got an error message telling me that the file did not exist. Now I know that the file doesn't exist and that is why I want to amend the reference to it in the [name] field in SYSFILES so that I can shrink the log files.

Please can someone tell me how I update that [name] field in SYSFILES, as it's driving me insane.
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question