Showing posts with label process. Show all posts
Showing posts with label process. Show all posts

Monday, March 26, 2012

Restoring the master database

As part of testing a cluster-to-cluster migration process, I am
attempting to restore the master database from an old test cluster
into a new one. I've read quite a bit about this online, and it looks
like a relatively easy procedure. These are the steps I'm following:
1. Stop the SQL Server.
2. At the command line, use sqlservr.exe -c -m to start SQL up in
single-user mode.
3. Use Query Analyzer or osql.exe to restore the database.
The problem I'm seeing is, with the MSSQLSERVER service stopped, I
can't get QA or osql.exe to work. I get the following error, no
matter which one I use:
Unable to connect to server:
Server: Msg 17, Level 16, State 1
[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist
or access denied.
With the SQL resources in Cluster Administrator offline, but the
MSSQLSERVER service not stopped, however, I can't start SQL from the
command line due to various files already being in use.
Does anyone have any suggestions on how to get around this problem.
It seems a lot of people have done something similar, but I can't
figure out what I'm missing.
Thanks!
Eric
Logon to one of the nodes and bring up 2 command line windows.
In the first command window type 'sqlservr -m'
Once SQL has started in will be running in this command window not allowing
you to do further work so switch over to the other window and run the
following 'osql -E'
You should now have a SQL prompt.
John Vandervliet.
<ecore1@.gmail.com> wrote in message
news:1176232183.047000.210960@.o5g2000hsb.googlegro ups.com...
> As part of testing a cluster-to-cluster migration process, I am
> attempting to restore the master database from an old test cluster
> into a new one. I've read quite a bit about this online, and it looks
> like a relatively easy procedure. These are the steps I'm following:
> 1. Stop the SQL Server.
> 2. At the command line, use sqlservr.exe -c -m to start SQL up in
> single-user mode.
> 3. Use Query Analyzer or osql.exe to restore the database.
> The problem I'm seeing is, with the MSSQLSERVER service stopped, I
> can't get QA or osql.exe to work. I get the following error, no
> matter which one I use:
> Unable to connect to server:
> Server: Msg 17, Level 16, State 1
> [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist
> or access denied.
> With the SQL resources in Cluster Administrator offline, but the
> MSSQLSERVER service not stopped, however, I can't start SQL from the
> command line due to various files already being in use.
> Does anyone have any suggestions on how to get around this problem.
> It seems a lot of people have done something similar, but I can't
> figure out what I'm missing.
> Thanks!
> Eric
>

Friday, March 23, 2012

Restoring SQL Server Database in to new installation

Hi all,

just now I joined in this forum.its nice to see this.

I have a problem here with SQL Server in the restore process.

my database got crashed here.i installed a new copy of the SQL Server.

i wnt to restore the backup of the database in this new installation.

can u please help me how to do it.

Thanks in advance.

Rajendar Reddy.AThis page might help, it also has some links within in to help you.

http://support.microsoft.com/default.aspx?kbid=314546#9

HTH

Tuesday, March 20, 2012

Restoring multiple TRN files to another computer

I have a backup process that does full backups
periodically with transaction logs backed up every 5
minutes. In the event that I need to restore the backup
and apply a large number of TRN files on another computer
(for example if the server dies), is there an easy way?
If I do the restore on the original server, the interface
is easy because it knows about all the recent backups,
but when I do the restore to another server, the backups
are not listed in the interface so it seems I have to
choose "restore from device" and then select the backup
file and each TRN file individually which is very tedious.
Rick Harrison.In EM 2000, you can generate backup history from the contents of the backup
device. I've never used it (I prefer to do RESTORE though TSQL command), but
my guess that the feature was put there for this type of situations.
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"rick@.knowware.com" <anonymous@.discussions.microsoft.com> wrote in message
news:0bd901c3bb52$2cbc0da0$a501280a@.phx.gbl...
> I have a backup process that does full backups
> periodically with transaction logs backed up every 5
> minutes. In the event that I need to restore the backup
> and apply a large number of TRN files on another computer
> (for example if the server dies), is there an easy way?
> If I do the restore on the original server, the interface
> is easy because it knows about all the recent backups,
> but when I do the restore to another server, the backups
> are not listed in the interface so it seems I have to
> choose "restore from device" and then select the backup
> file and each TRN file individually which is very tedious.
> Rick Harrison.|||We recently recovered from a total disk array failure to
another SQL server. We were fortunate enough to have all
the .BAK & .TRN files on tape. But without a little
program I wrote to automate the restore, it would have
taken an unreasonable amount of time to apply each TLog
using the GUI.
If you're interested, I can send you some VB code. It
uses the SQL DMO objects to restore DB's & files. I still
need to finalize some things, because I had to step
through the code & make minor adjustments to restore
everything. But I'm supposed to finalize the tool soon.
If you have VB knowledge, or someone at your company does,
you could take what I have now & make alterations to suit
your needs. Just let me know,
Gene Daigle
>--Original Message--
>I have a backup process that does full backups
>periodically with transaction logs backed up every 5
>minutes. In the event that I need to restore the backup
>and apply a large number of TRN files on another computer
>(for example if the server dies), is there an easy way?
>If I do the restore on the original server, the interface
>is easy because it knows about all the recent backups,
>but when I do the restore to another server, the backups
>are not listed in the interface so it seems I have to
>choose "restore from device" and then select the backup
>file and each TRN file individually which is very tedious.
> Rick Harrison.
>.
>

Wednesday, March 7, 2012

Restoring FileGroups...

We are currently in the process of designing a Consolidated System (data for multiple organizations stored in one database server) using SQL Server 2005. One of the design goal is to refresh individual company data from Production to "User Acceptance Server" without affecting other companies.

So, we thought of implementing this via Partitioning by Org. We need the "Proof of concept" that this can be done with a simple example. Since our DBA's are also new to SQL 2005, we are working together in achieving the goal. Ok, here is what we are trying to achieve:

1. Create a Database (Test1) with two file Groups (FileGroup1, FileGroup2) with two files in each file group.

2. Create two tables on this database, one on each FileGroup

Table 1 on FileGroup1, Table 2 on FileGroup2.

3. Populate data on these tables.

4. Create an exact copy of this database with the above architecture and call it Test2.

5. Populate Test2, with a different set of data.

6. Backup FileGroup2 on Test2 and restore it to Test1 database.

What we did:

1. I did the Full Database Backup of Test2 via SQL Management Studio. Also the log file with:I did the Full Database Backup of Test2 via SQL Management Studio. Also the log file using :

BACKUP LOG PGM TO DISK='D:\Test2_Log.bak' WITH NORECOVERY

2. Restore the database filegroup using:

RESTORE DATABASE Test1

FILEGROUP = 'FileGroup2'

FROM DISK ='D:\Test2.bak' WITH

MOVE 'FileName2_A' TO 'G:\Data\File2_A.ndf',

MOVE 'FileName2_B' TO 'G:\Data\File2_B.ndf'

3. . RESTORE LOG PGM

FROM DISK = 'D:\Test2_Log.bak'

WITH RECOVERY

After restoring the backup filegroup to Test1 database, I'm not able to query the table that resides in the filegroup that was restored. Error returned is:

Msg 8653, Level 16, State 1, Line 2

The query processor is unable to produce a plan for the table or view 'Junk2' because the table resides in a filegroup which is not online.

We know, we are missing some pieces while creating the backup or restoring that is causing this problem. If somebody can point it out, or provide us a "Working Example"...

Thanks for your help.

Take a full backup
BACKUP DATABASE _BIMAL_FG_TEST
TO DISK = 'O:\Test_Backups\_BIMAL_FG_TEST_FULL.bak'
GO

Or take File group backups
BACKUP DATABASE _BIMAL_FG_TEST
FILEGROUP = 'PRIMARY'
TO DISK = 'O:\Test_Backups\_BIMAL_FG_TEST_FG_PRIMARY.bak'

BACKUP DATABASE _BIMAL_FG_TEST
FILEGROUP = 'FileGroup_A'
TO DISK = 'O:\Test_Backups\_BIMAL_FG_TEST_FG_A.bak'

BACKUP DATABASE _BIMAL_FG_TEST
FILEGROUP = 'FileGroup_B'
TO DISK = 'O:\Test_Backups\_BIMAL_FG_TEST_FG_B.bak'

You must take a log backup
BACKUP LOG _BIMAL_FG_TEST
TO DISK = 'O:\Test_Backups\_BIMAL_FG_TEST_LOG.TRN'

On the target database you have to first restore the Primary FG

RESTORE DATABASE _BIMAL_FG_TEST_COPY
FILEGROUP = 'PRIMARY'
FROM DISK = 'O:\Test_Backups\_BIMAL_FG_TEST_FULL.bak'
WITH MOVE '_BIMAL_FG_TEST' to 'O:\SQLData\_BIMAL_FG_TEST_COPY.mdf'
, MOVE '_BIMAL_FG_TEST_log' to 'P:\SQLLog\_BIMAL_FG_TEST_COPY_log.LDF'
,STATS=20
,NORECOVERY, REPLACE, PARTIAL

Then Restore the FileGroup you want
RESTORE DATABASE _BIMAL_FG_TEST_COPY
FILEGROUP = 'FileGroup_A'
FROM DISK = 'O:\Test_Backups\_BIMAL_FG_TEST_FULL.bak'
WITH MOVE 'BIMAL_FILEGROUP_TEST_1' to 'O:\SQLData\BIMAL_FILEGROUP_TEST_COPY_1.ndf'
,MOVE 'BIMAL_FILEGROUP_TEST_2' to 'O:\SQLData\BIMAL_FILEGROUP_TEST_COPY_2.ndf'
,STATS=20
,REPLACE
,NORECOVERY

And then restore the Log backup to complete the recovery
RESTORE LOG _BIMAL_FG_TEST_COPY
FROM DISK = 'O:\Test_Backups\_BIMAL_FG_TEST_LOG.TRN'
WITH RECOVERY

And if you want to restore another file group just followt the last two steps.
RESTORE DATABASE _BIMAL_FG_TEST_COPY
FILEGROUP = 'FileGroup_B'
FROM DISK = 'O:\Test_Backups\_BIMAL_FG_TEST_FULL.bak'
WITH MOVE 'BIMAL_FILEGROUP_TEST_3' to 'O:\SQLData\BIMAL_FILEGROUP_TEST_COPY_3.ndf'
,MOVE 'BIMAL_FILEGROUP_TEST_4' to 'O:\SQLData\BIMAL_FILEGROUP_TEST_COPY_4.ndf'
,STATS=20
,NORECOVERY

RESTORE LOG _BIMAL_FG_TEST_COPY
FROM DISK = 'OTest_Backups\_BIMAL_FG_TEST_LOG.TRN'
WITH RECOVERY

This may not solve your problem but this will give you a working example you can play to see whether what you need is possible or not.

Restoring FileGroups...

We are currently in the process of designing a Consolidated System (data for multiple organizations stored in one database server) using SQL Server 2005. One of the design goal is to refresh individual company data from Production to "User Acceptance Server" without affecting other companies.

So, we thought of implementing this via Partitioning by Org. We need the "Proof of concept" that this can be done with a simple example. Since our DBA's are also new to SQL 2005, we are working together in achieving the goal. Ok, here is what we are trying to achieve:

1. Create a Database (Test1) with two file Groups (FileGroup1, FileGroup2) with two files in each file group.

2. Create two tables on this database, one on each FileGroup

Table 1 on FileGroup1, Table 2 on FileGroup2.

3. Populate data on these tables.

4. Create an exact copy of this database with the above architecture and call it Test2.

5. Populate Test2, with a different set of data.

6. Backup FileGroup2 on Test2 and restore it to Test1 database.

What we did:

1. I did the Full Database Backup of Test2 via SQL Management Studio. Also the log file with:I did the Full Database Backup of Test2 via SQL Management Studio. Also the log file using :

BACKUP LOG PGM TO DISK='D:\Test2_Log.bak' WITH NORECOVERY

2. Restore the database filegroup using:

RESTORE DATABASE Test1

FILEGROUP = 'FileGroup2'

FROM DISK ='D:\Test2.bak' WITH

MOVE 'FileName2_A' TO 'G:\Data\File2_A.ndf',

MOVE 'FileName2_B' TO 'G:\Data\File2_B.ndf'

3. . RESTORE LOG PGM

FROM DISK = 'D:\Test2_Log.bak'

WITH RECOVERY

After restoring the backup filegroup to Test1 database, I'm not able to query the table that resides in the filegroup that was restored. Error returned is:

Msg 8653, Level 16, State 1, Line 2

The query processor is unable to produce a plan for the table or view 'Junk2' because the table resides in a filegroup which is not online.

We know, we are missing some pieces while creating the backup or restoring that is causing this problem. If somebody can point it out, or provide us a "Working Example"...

Thanks for your help.

Take a full backup
BACKUP DATABASE _BIMAL_FG_TEST
TO DISK = 'O:\Test_Backups\_BIMAL_FG_TEST_FULL.bak'
GO

Or take File group backups
BACKUP DATABASE _BIMAL_FG_TEST
FILEGROUP = 'PRIMARY'
TO DISK = 'O:\Test_Backups\_BIMAL_FG_TEST_FG_PRIMARY.bak'

BACKUP DATABASE _BIMAL_FG_TEST
FILEGROUP = 'FileGroup_A'
TO DISK = 'O:\Test_Backups\_BIMAL_FG_TEST_FG_A.bak'

BACKUP DATABASE _BIMAL_FG_TEST
FILEGROUP = 'FileGroup_B'
TO DISK = 'O:\Test_Backups\_BIMAL_FG_TEST_FG_B.bak'

You must take a log backup
BACKUP LOG _BIMAL_FG_TEST
TO DISK = 'O:\Test_Backups\_BIMAL_FG_TEST_LOG.TRN'

On the target database you have to first restore the Primary FG

RESTORE DATABASE _BIMAL_FG_TEST_COPY
FILEGROUP = 'PRIMARY'
FROM DISK = 'O:\Test_Backups\_BIMAL_FG_TEST_FULL.bak'
WITH MOVE '_BIMAL_FG_TEST' to 'O:\SQLData\_BIMAL_FG_TEST_COPY.mdf'
, MOVE '_BIMAL_FG_TEST_log' to 'P:\SQLLog\_BIMAL_FG_TEST_COPY_log.LDF'
,STATS=20
,NORECOVERY, REPLACE, PARTIAL

Then Restore the FileGroup you want
RESTORE DATABASE _BIMAL_FG_TEST_COPY
FILEGROUP = 'FileGroup_A'
FROM DISK = 'O:\Test_Backups\_BIMAL_FG_TEST_FULL.bak'
WITH MOVE 'BIMAL_FILEGROUP_TEST_1' to 'O:\SQLData\BIMAL_FILEGROUP_TEST_COPY_1.ndf'
,MOVE 'BIMAL_FILEGROUP_TEST_2' to 'O:\SQLData\BIMAL_FILEGROUP_TEST_COPY_2.ndf'
,STATS=20
,REPLACE
,NORECOVERY

And then restore the Log backup to complete the recovery
RESTORE LOG _BIMAL_FG_TEST_COPY
FROM DISK = 'O:\Test_Backups\_BIMAL_FG_TEST_LOG.TRN'
WITH RECOVERY

And if you want to restore another file group just followt the last two steps.
RESTORE DATABASE _BIMAL_FG_TEST_COPY
FILEGROUP = 'FileGroup_B'
FROM DISK = 'O:\Test_Backups\_BIMAL_FG_TEST_FULL.bak'
WITH MOVE 'BIMAL_FILEGROUP_TEST_3' to 'O:\SQLData\BIMAL_FILEGROUP_TEST_COPY_3.ndf'
,MOVE 'BIMAL_FILEGROUP_TEST_4' to 'O:\SQLData\BIMAL_FILEGROUP_TEST_COPY_4.ndf'
,STATS=20
,NORECOVERY

RESTORE LOG _BIMAL_FG_TEST_COPY
FROM DISK = 'OTest_Backups\_BIMAL_FG_TEST_LOG.TRN'
WITH RECOVERY

This may not solve your problem but this will give you a working example you can play to see whether what you need is possible or not.

Saturday, February 25, 2012

Restoring Deleted Columns

I just deleted a few columns from a database that I am in the process of
moving. I totally screwed up and didn't dts the data in the columns over to
the new one. Is there any way to restore the data?
Thanks,
Drew"Drew" <dlaing@.NOswvtc.state.va.SPAMus> wrote in message
news:uGxwwqYdEHA.3796@.TK2MSFTNGP10.phx.gbl...
> I just deleted a few columns from a database that I am in the process of
> moving. I totally screwed up and didn't dts the data in the columns over
to
> the new one. Is there any way to restore the data?
Restore from your last good backup. You have one, right?
Steve|||Got it... I just wasn't sure how to do it... I figured it out...
Thanks,
Drew
"Steve Thompson" <stevethompson@.nomail.please> wrote in message
news:%23NqhtMZdEHA.3632@.TK2MSFTNGP11.phx.gbl...
> "Drew" <dlaing@.NOswvtc.state.va.SPAMus> wrote in message
> news:uGxwwqYdEHA.3796@.TK2MSFTNGP10.phx.gbl...
over[vbcol=seagreen]
> to
> Restore from your last good backup. You have one, right?
> Steve
>

Restoring Deleted Columns

I just deleted a few columns from a database that I am in the process of
moving. I totally screwed up and didn't dts the data in the columns over to
the new one. Is there any way to restore the data?
Thanks,
Drew
"Drew" <dlaing@.NOswvtc.state.va.SPAMus> wrote in message
news:uGxwwqYdEHA.3796@.TK2MSFTNGP10.phx.gbl...
> I just deleted a few columns from a database that I am in the process of
> moving. I totally screwed up and didn't dts the data in the columns over
to
> the new one. Is there any way to restore the data?
Restore from your last good backup. You have one, right?
Steve
|||Got it... I just wasn't sure how to do it... I figured it out...
Thanks,
Drew
"Steve Thompson" <stevethompson@.nomail.please> wrote in message
news:%23NqhtMZdEHA.3632@.TK2MSFTNGP11.phx.gbl...[vbcol=seagreen]
> "Drew" <dlaing@.NOswvtc.state.va.SPAMus> wrote in message
> news:uGxwwqYdEHA.3796@.TK2MSFTNGP10.phx.gbl...
over
> to
> Restore from your last good backup. You have one, right?
> Steve
>

Restoring Deleted Columns

I just deleted a few columns from a database that I am in the process of
moving. I totally screwed up and didn't dts the data in the columns over to
the new one. Is there any way to restore the data?
Thanks,
Drew"Drew" <dlaing@.NOswvtc.state.va.SPAMus> wrote in message
news:uGxwwqYdEHA.3796@.TK2MSFTNGP10.phx.gbl...
> I just deleted a few columns from a database that I am in the process of
> moving. I totally screwed up and didn't dts the data in the columns over
to
> the new one. Is there any way to restore the data?
Restore from your last good backup. You have one, right?
Steve|||Got it... I just wasn't sure how to do it... I figured it out...
Thanks,
Drew
"Steve Thompson" <stevethompson@.nomail.please> wrote in message
news:%23NqhtMZdEHA.3632@.TK2MSFTNGP11.phx.gbl...
> "Drew" <dlaing@.NOswvtc.state.va.SPAMus> wrote in message
> news:uGxwwqYdEHA.3796@.TK2MSFTNGP10.phx.gbl...
> > I just deleted a few columns from a database that I am in the process of
> > moving. I totally screwed up and didn't dts the data in the columns
over
> to
> > the new one. Is there any way to restore the data?
> Restore from your last good backup. You have one, right?
> Steve
>