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
No comments:
Post a Comment