Showing posts with label deleted. Show all posts
Showing posts with label deleted. Show all posts

Saturday, February 25, 2012

mastlog.ldf

our mastlog.ldf file of Master database got deleted accidently by some user.
Is there anyway that the database could be started and new log file created
. master.mdf file is intact.
Thanks
ATDid you try restarting the server? If it won't start then you can rebuild
Master using the rebuildm utility (see Books Online for details). Then start
the server in single-user mode, restore Master from a backup (you do backup
the Master database don't you...?) or manually reattach your databases,
recreate logins, etc.
Make sure that the location of your database files is only accessible by the
administrator and the SQL Server service account so that this can't happen
again.
David Portas
SQL Server MVP
--|||David,
There is no backup available for master database. all I have is mdf file. Is
n't there any way that I can use this file to rebuild master database.
Thanks
AT|||HI
Maybe help for you:
I tested the following procedure, and successfully completed, but not guaran
tee your success.
And the future: Backup system databases periodically (daily)!
Copy to test server the master.mdf and rename
Use sp_attach_single_file_db wit another name than master (eg: NewMaser)
Use rebuilm.exe. (Copy SQL setup cd to hard disk and remove the read only fl
ag from files!)
Reinstall Service Packs and patches.
Stop the SQL server.
Create file backup from master.mdf and mastlog.ldf (Maybe You need restart
the restore)
Then start the server in single-user mode
--Like another way from here
Allow modifications to be made directly to the system catalogs
Update sysconfigures, syscurconfigs, tables from NewMaster database
Create insert statements and copy data from NewMaster to master database (US
E: WHERE NOT IN NEW MASTER..TABLE)
-sysaltfiles (or attach all production database and distribution if exist)
-sysservers (better: Recreate Linked Servers from documentation.)
-sysmessages (It is easy)
-sysxlogins (better: use the another way procedure for recreate logins)
-sysusers (or recreate users in master)
Disable modifications to be made directly to the system catalogs
Backup the master database
Test the server
Restart server
Backup master database
Another way:
-Recreate logins:
read the folowing: Microsoft Knowledge Base Article - 246133
< http://support.microsoft.com/defaul...133&Product=sql
>
Rewrite the sp_help_revlogin (use the attachaed database as source eg: FROM
master..sysxlogins --> FROM TESTSERVER.NewMaster.dbo.sysxlogins)
Recreate Linked Servers from documentation. (If You used remote server for r
eplication create linked server instead of remote)
Recreate users on master
Attach all production databases and distribution database.
Import custom sysmessages from NewMaster
Disable modifications to be made directly to the system catalogs
Backup the master database
Test the server
Restart server
Backup master database
At end:
Create scheduled backup for system databases.
And repair and repair until errors disappear. (The original values in NewMas
ter help You, do not drop!)
JBandi

Monday, February 20, 2012

Master..sysaltfiles contains incorrect info

Dear all,
I had a database which contained 2 log files, one of the log files was
deleted - however, master..sysaltfiles still shows 2 log files in
existance...
The database is open, and working OK, so second log file is definately not
being used ( it no longer exists on disk)...
So how do I update master..sysaltfiles to be correct ?
I restarted SQL Server, did not resolve issue ( ie sysaltfiles still shows 2
files) . I'm loathe to do a direct delete on master..sysaltfiles until I can
discover if this kind of 'corruption' is not unknown... but do I have any
other choice ?Hi
I don't know why you have got the extra entry, was there any message in the
SQL Server log when you re-started?
What happens when you try to remove the file using:
ALTER DATABASE database REMOVE FILE logical_file_name
John
"SteveH" <SteveH@.discussions.microsoft.com> wrote in message
news:7C75A085-7563-4D94-9E50-353ECAFF820B@.microsoft.com...
> Dear all,
> I had a database which contained 2 log files, one of the log files was
> deleted - however, master..sysaltfiles still shows 2 log files in
> existance...
> The database is open, and working OK, so second log file is definately not
> being used ( it no longer exists on disk)...
> So how do I update master..sysaltfiles to be correct ?
> I restarted SQL Server, did not resolve issue ( ie sysaltfiles still shows
> 2
> files) . I'm loathe to do a direct delete on master..sysaltfiles until I
> can
> discover if this kind of 'corruption' is not unknown... but do I have any
> other choice ?