Showing posts with label rebuild. Show all posts
Showing posts with label rebuild. Show all posts

Monday, March 12, 2012

How to rebuild/rescover the master database in sql 2005

Hi, I'm testing my recovery on a sql server 2005 database. The server has been restored, which includes the OS and sql server 2005 installation (binaries, full tape restore). The tape restore didn't put back the master.mdf and other .mdf files (can't be backed up when open), so I need to rebuild the master and do a database recovery on it and the other supporting databases (yes, I have database backups). I have installed the sql 2005 setup CDs in a folder and run the following command to rebuild the master, but nothing happens, it pauses for a couple of minutes before it returns to the prompt, but it does not put and new master.mdf files in the folder and I can't start the service in single user mode. "start /wait setup.exe /qn INSTANCENAME=MSSQLSERVER REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=mypassword" Anybody have any procedures for a full sql server 2005 recovery or suggestions on this, please post.

Thanks, Mike

I've tried using the below query and it has rebuilded the master database...........

start /wait <CD or DVD Drive>\setup.exe /qn INSTANCENAME="InstanceName" REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD="NewStrongPassword"

if you have master db backup you can restore it in single user mode as follows,
go to command prompt and type the below command

NET START MSSQLSERVER /c /m then perform the restoration it will work.............

|||

Deepak, did you have a master.mdf to start with? In my test, I have none of the master.mdf and other supporting db files to start with. Then you use the "start /wait setup.exe......" and next the "NET START......." and recover?

Thanks, Mike

|||

Well, almost got it to work. Now if fails and says my password does not meet the password policy, password is to short..... I'm using a 15 character password. Shouldn't this work? Thanks, Mike

|||

Mike,

Pls refer the link, http://deepakinsql.blogspot.com/2007/08/how-to-rebuild-system-database-in-sql.html

I've tried it and its working for me. I've posted it in my blog.....pls check and let me know if it works Smile

Thanxx

Deepak

|||Deepak, I'm out of the office this week, I will take a look at this later. Thanks for the update. Mike

How to rebuild/rescover the master database in sql 2005

Hi, I'm testing my recovery on a sql server 2005 database. The server has been restored, which includes the OS and sql server 2005 installation (binaries, full tape restore). The tape restore didn't put back the master.mdf and other .mdf files (can't be backed up when open), so I need to rebuild the master and do a database recovery on it and the other supporting databases (yes, I have database backups). I have installed the sql 2005 setup CDs in a folder and run the following command to rebuild the master, but nothing happens, it pauses for a couple of minutes before it returns to the prompt, but it does not put and new master.mdf files in the folder and I can't start the service in single user mode. "start /wait setup.exe /qn INSTANCENAME=MSSQLSERVER REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=mypassword" Anybody have any procedures for a full sql server 2005 recovery or suggestions on this, please post.

Thanks, Mike

I've tried using the below query and it has rebuilded the master database...........

start /wait <CD or DVD Drive>\setup.exe /qn INSTANCENAME="InstanceName" REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD="NewStrongPassword"

if you have master db backup you can restore it in single user mode as follows,
go to command prompt and type the below command

NET START MSSQLSERVER /c /m then perform the restoration it will work.............

|||

Deepak, did you have a master.mdf to start with? In my test, I have none of the master.mdf and other supporting db files to start with. Then you use the "start /wait setup.exe......" and next the "NET START......." and recover?

Thanks, Mike

|||

Well, almost got it to work. Now if fails and says my password does not meet the password policy, password is to short..... I'm using a 15 character password. Shouldn't this work? Thanks, Mike

|||

Mike,

Pls refer the link, http://deepakinsql.blogspot.com/2007/08/how-to-rebuild-system-database-in-sql.html

I've tried it and its working for me. I've posted it in my blog.....pls check and let me know if it works Smile

Thanxx

Deepak

|||Deepak, I'm out of the office this week, I will take a look at this later. Thanks for the update. Mike

How to rebuild/rescover the master database in sql 2005

Hi, I'm testing my recovery on a sql server 2005 database. The server has been restored, which includes the OS and sql server 2005 installation (binaries, full tape restore). The tape restore didn't put back the master.mdf and other .mdf files (can't be backed up when open), so I need to rebuild the master and do a database recovery on it and the other supporting databases (yes, I have database backups). I have installed the sql 2005 setup CDs in a folder and run the following command to rebuild the master, but nothing happens, it pauses for a couple of minutes before it returns to the prompt, but it does not put and new master.mdf files in the folder and I can't start the service in single user mode. "start /wait setup.exe /qn INSTANCENAME=MSSQLSERVER REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=mypassword" Anybody have any procedures for a full sql server 2005 recovery or suggestions on this, please post.

Thanks, Mike

I've tried using the below query and it has rebuilded the master database...........

start /wait <CD or DVD Drive>\setup.exe /qn INSTANCENAME="InstanceName" REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD="NewStrongPassword"

if you have master db backup you can restore it in single user mode as follows,
go to command prompt and type the below command

NET START MSSQLSERVER /c /m then perform the restoration it will work.............

|||

Deepak, did you have a master.mdf to start with? In my test, I have none of the master.mdf and other supporting db files to start with. Then you use the "start /wait setup.exe......" and next the "NET START......." and recover?

Thanks, Mike

|||

Well, almost got it to work. Now if fails and says my password does not meet the password policy, password is to short..... I'm using a 15 character password. Shouldn't this work? Thanks, Mike

|||

Mike,

Pls refer the link, http://deepakinsql.blogspot.com/2007/08/how-to-rebuild-system-database-in-sql.html

I've tried it and its working for me. I've posted it in my blog.....pls check and let me know if it works Smile

Thanxx

Deepak

|||Deepak, I'm out of the office this week, I will take a look at this later. Thanks for the update. Mike

How to rebuild the master database.?

Installed SQLSERVER 2005 EVAL copy in my server and trying to rebuild the master database and it is not working.

I tried the following command.

start /wait setup.exe /qn INSTANCENAME=MSSQLSERVER REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=RAJESH

Any thoughts?

Thanks

First off, can you help me understand why you need to rebuild master instead of restoring from backup? Rebuilding master is typically done when it is too corrupt to allow the instance to start.

If the instance is running, that would probably prevent the procedure above from working. It isn't intended for running instances.

If your instance is down and it still doesn't work, please post the exact error message and we'll see what we can find out.

How to rebuild logshipping after role change

Hi ,
I am working on logshipping DRS trail and have done role successfully.
Now after doing the role change I want to rebuild the logshipping for database which is already existing in secondary server.
I tried adding destination server with existing database. It gives me message as " The database is not in standbymode to do logshipping". Can anyone help me on this.
How should I bring the existing database in warm standby mode.

Thanks
Md.S.HassanYou will have to restore the database on the secondary ensuring that you specify NORECOVERY. Then add the logs (again with NORECOVERY) until you are current.

How to rebuild index ?

Hi,
We are using SQL Server 2000.
A developer asks us to rebuild the index of the database. However, from the
BOL, I find that the command DBCC DBREINDEX can be used to rebuild index for
a particular table.
Is there any command to do so ? So far as I know, rebuild index of the
database is part of the Database Maintenance Plan.
Thanks
DanielOne method is to generate and execute DBCC DBREINDEX commands using a script
like the example below.
DECLARE @.DBCC_Command nvarchar(4000)
DECLARE DBCC_Commands
CURSOR LOCAL FAST_FORWARD READ_ONLY FOR
SELECT
N'DBCC DBREINDEX(''' +
QUOTENAME(TABLE_SCHEMA) +
N'.' +
QUOTENAME(TABLE_NAME) +
''')'
FROM INFORMATION_SCHEMA.TABLES
WHERE
TABLE_TYPE = N'BASE TABLE' AND
OBJECTPROPERTY(
OBJECT_ID(QUOTENAME(TABLE_SCHEMA) +
N'.' +
QUOTENAME(TABLE_NAME)),
'IsMSShipped') = 0
OPEN DBCC_Commands
WHILE 1 = 1
BEGIN
FETCH NEXT FROM DBCC_Commands INTO @.DBCC_Command
IF @.@.FETCH_STATUS = -1 BREAK
RAISERROR(@.DBCC_Command, 0, 1) WITH NOWAIT
EXEC(@.DBCC_Command)
END
CLOSE DBCC_Commands
DEALLOCATE DBCC_Commands
Hope this helps.
Dan Guzman
SQL Server MVP
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:%23OsDDCj3GHA.1608@.TK2MSFTNGP04.phx.gbl...
> Hi,
> We are using SQL Server 2000.
> A developer asks us to rebuild the index of the database. However, from
> the BOL, I find that the command DBCC DBREINDEX can be used to rebuild
> index for a particular table.
> Is there any command to do so ? So far as I know, rebuild index of the
> database is part of the Database Maintenance Plan.
> Thanks
> Daniel
>|||Peter wrote:
> Hi,
> We are using SQL Server 2000.
> A developer asks us to rebuild the index of the database. However, from t
he
> BOL, I find that the command DBCC DBREINDEX can be used to rebuild index f
or
> a particular table.
> Is there any command to do so ? So far as I know, rebuild index of the
> database is part of the Database Maintenance Plan.
> Thanks
> Daniel
>
There is no index "of the database", indexes are on tables. I suspect
you were asked to rebuild all of the indexes IN the database, possibly
to remove fragmentation to address a performance problem.
Have a look here:
http://realsqlguy.com/serendipity/a...realsqlguy.com|||Peter,
to reindex all tables in a database you could use:
EXEC sp_msForEachTable 'DBCC DBREINDEX ("?")'
The maintenance plan will also give this functionality. I'd recommend
reading up on the difference between DBCC DBREINDEX and DBCC INDEXDEFRAG as
the former command is essentially an offline operation and if you have a
24/7 operation you'll need to consider the latter.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .

How to rebuild index ?

Hi,
We are using SQL Server 2000.
A developer asks us to rebuild the index of the database. However, from the
BOL, I find that the command DBCC DBREINDEX can be used to rebuild index for
a particular table.
Is there any command to do so ? So far as I know, rebuild index of the
database is part of the Database Maintenance Plan.
Thanks
Daniel
One method is to generate and execute DBCC DBREINDEX commands using a script
like the example below.
DECLARE @.DBCC_Command nvarchar(4000)
DECLARE DBCC_Commands
CURSOR LOCAL FAST_FORWARD READ_ONLY FOR
SELECT
N'DBCC DBREINDEX(''' +
QUOTENAME(TABLE_SCHEMA) +
N'.' +
QUOTENAME(TABLE_NAME) +
''')'
FROM INFORMATION_SCHEMA.TABLES
WHERE
TABLE_TYPE = N'BASE TABLE' AND
OBJECTPROPERTY(
OBJECT_ID(QUOTENAME(TABLE_SCHEMA) +
N'.' +
QUOTENAME(TABLE_NAME)),
'IsMSShipped') = 0
OPEN DBCC_Commands
WHILE 1 = 1
BEGIN
FETCH NEXT FROM DBCC_Commands INTO @.DBCC_Command
IF @.@.FETCH_STATUS = -1 BREAK
RAISERROR(@.DBCC_Command, 0, 1) WITH NOWAIT
EXEC(@.DBCC_Command)
END
CLOSE DBCC_Commands
DEALLOCATE DBCC_Commands
Hope this helps.
Dan Guzman
SQL Server MVP
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:%23OsDDCj3GHA.1608@.TK2MSFTNGP04.phx.gbl...
> Hi,
> We are using SQL Server 2000.
> A developer asks us to rebuild the index of the database. However, from
> the BOL, I find that the command DBCC DBREINDEX can be used to rebuild
> index for a particular table.
> Is there any command to do so ? So far as I know, rebuild index of the
> database is part of the Database Maintenance Plan.
> Thanks
> Daniel
>
|||Peter wrote:
> Hi,
> We are using SQL Server 2000.
> A developer asks us to rebuild the index of the database. However, from the
> BOL, I find that the command DBCC DBREINDEX can be used to rebuild index for
> a particular table.
> Is there any command to do so ? So far as I know, rebuild index of the
> database is part of the Database Maintenance Plan.
> Thanks
> Daniel
>
There is no index "of the database", indexes are on tables. I suspect
you were asked to rebuild all of the indexes IN the database, possibly
to remove fragmentation to address a performance problem.
Have a look here:
http://realsqlguy.com/serendipity/ar...A-Wall...html
Tracy McKibben
MCDBA
http://www.realsqlguy.com
|||Peter,
to reindex all tables in a database you could use:
EXEC sp_msForEachTable 'DBCC DBREINDEX ("?")'
The maintenance plan will also give this functionality. I'd recommend
reading up on the difference between DBCC DBREINDEX and DBCC INDEXDEFRAG as
the former command is essentially an offline operation and if you have a
24/7 operation you'll need to consider the latter.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .

How to rebuild index ?

Hi,
We are using SQL Server 2000.
A developer asks us to rebuild the index of the database. However, from the
BOL, I find that the command DBCC DBREINDEX can be used to rebuild index for
a particular table.
Is there any command to do so ? So far as I know, rebuild index of the
database is part of the Database Maintenance Plan.
Thanks
DanielOne method is to generate and execute DBCC DBREINDEX commands using a script
like the example below.
DECLARE @.DBCC_Command nvarchar(4000)
DECLARE DBCC_Commands
CURSOR LOCAL FAST_FORWARD READ_ONLY FOR
SELECT
N'DBCC DBREINDEX(''' +
QUOTENAME(TABLE_SCHEMA) +
N'.' +
QUOTENAME(TABLE_NAME) +
''')'
FROM INFORMATION_SCHEMA.TABLES
WHERE
TABLE_TYPE = N'BASE TABLE' AND
OBJECTPROPERTY(
OBJECT_ID(QUOTENAME(TABLE_SCHEMA) +
N'.' +
QUOTENAME(TABLE_NAME)),
'IsMSShipped') = 0
OPEN DBCC_Commands
WHILE 1 = 1
BEGIN
FETCH NEXT FROM DBCC_Commands INTO @.DBCC_Command
IF @.@.FETCH_STATUS = -1 BREAK
RAISERROR(@.DBCC_Command, 0, 1) WITH NOWAIT
EXEC(@.DBCC_Command)
END
CLOSE DBCC_Commands
DEALLOCATE DBCC_Commands
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:%23OsDDCj3GHA.1608@.TK2MSFTNGP04.phx.gbl...
> Hi,
> We are using SQL Server 2000.
> A developer asks us to rebuild the index of the database. However, from
> the BOL, I find that the command DBCC DBREINDEX can be used to rebuild
> index for a particular table.
> Is there any command to do so ? So far as I know, rebuild index of the
> database is part of the Database Maintenance Plan.
> Thanks
> Daniel
>|||Peter wrote:
> Hi,
> We are using SQL Server 2000.
> A developer asks us to rebuild the index of the database. However, from the
> BOL, I find that the command DBCC DBREINDEX can be used to rebuild index for
> a particular table.
> Is there any command to do so ? So far as I know, rebuild index of the
> database is part of the Database Maintenance Plan.
> Thanks
> Daniel
>
There is no index "of the database", indexes are on tables. I suspect
you were asked to rebuild all of the indexes IN the database, possibly
to remove fragmentation to address a performance problem.
Have a look here:
http://realsqlguy.com/serendipity/archives/12-Humpty-Dumpty-Sat-On-A-Wall...html
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Peter,
to reindex all tables in a database you could use:
EXEC sp_msForEachTable 'DBCC DBREINDEX ("?")'
The maintenance plan will also give this functionality. I'd recommend
reading up on the difference between DBCC DBREINDEX and DBCC INDEXDEFRAG as
the former command is essentially an offline operation and if you have a
24/7 operation you'll need to consider the latter.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .

How to rebuild database to ve case sensitivity?

How to rebuild SQL Server 2000 to be case sensitivity?
Thank you for your help.
--
Regards,
Anthony LamHi
Check out this previous thread
http://tinyurl.com/m2k4
John
"AA" <anthony@.jadeflex.com> wrote in message
news:eVwwAGccDHA.384@.TK2MSFTNGP12.phx.gbl...
> How to rebuild SQL Server 2000 to be case sensitivity?
> Thank you for your help.
> --
> Regards,
> Anthony Lam
>