Showing posts with label restore. Show all posts
Showing posts with label restore. Show all posts

Thursday, March 8, 2012

Abt DTS mass migration

Two servers with different name and IP
We have to transfer around 500 DTS packages to the new server. But can not restore the MSDB to new server, and also can not DTS all the packages to new server in one step. Any tips for DTS mass migration? Or we have to save as one by one manually? Thanks in advanced.Hi there,

I don't know if this helps you further, but I use the "DTSBackup 2000" tool for transferring DTS packages from one server to another. You can find out more about this tool at http://www.sqldts.com/?242

Greetings,
Carsten|||Thank u very much. Let me try...

Originally posted by CarstenK
Hi there,

I don't know if this helps you further, but I use the "DTSBackup 2000" tool for transferring DTS packages from one server to another. You can find out more about this tool at http://www.sqldts.com/?242

Greetings,
Carsten

Absolutely Bizarre - Backup reference database that doesn't exist

Ok folks try this one on. Each night during our Tape
backup the following error occurs in SQL logs
I/O error on backup or restore restart-checkpoint
file 'd:\MSSQL\backup\model4IDR.ckp'. Operating system
error 3(The system cannot find the path specified.). The
statement is proceeding but is non-restartable.
The kicker? We do not have a database called model4IDR.
In sysdatabases there is no such thing and we do not
understand where the backup is getting this info (veritas)
Any ideas to point me in the right direction?
thanks
JTS
It is probably a Veritas specific issue, I haven't seen it before. Worth
speaking to Veritas support.
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Jeffrey Sheldon" <jsheldon@.projecthope.org> wrote in message
news:356301c4293f$602b5eb0$a101280a@.phx.gbl...
Ok folks try this one on. Each night during our Tape
backup the following error occurs in SQL logs
I/O error on backup or restore restart-checkpoint
file 'd:\MSSQL\backup\model4IDR.ckp'. Operating system
error 3(The system cannot find the path specified.). The
statement is proceeding but is non-restartable.
The kicker? We do not have a database called model4IDR.
In sysdatabases there is no such thing and we do not
understand where the backup is getting this info (veritas)
Any ideas to point me in the right direction?
thanks
JTS
|||In Enterprise Manager, expand to Management > SQL Server Agent > Jobs, and look for your job that is backing up to your tape drive (you may also try under Management > Database Maintenance Plans).
Have a look in the Steps tab of this jobs Properties, and there should be a Step referring to model4IDR.ckp.
Alternatively, if your maintenance plan gets its instructions from a text file, find that text file and search it for references to your erroneous database.
I have the same error right now, but it's for databases that do exist. It turns out that when we had a crash the other week, the CD ROM was removed from my server, resulting in my secondary HDD moving from F:\ to E:\. Obviously the files for some of my existing databases cannot be found. It just shows that this error message usually means exactly what it says.
If you cannot find the file it is looking for, I suggest creating a text file of the same name and location (it couldn't hurt!!), and let it find that.
Lastly, that DB name looks TOO MUCH like the model db that all SQL Servers have, so exercise CAUTION. Cheers.|||This has to do with the Intelligent Disaster Recovery feature of Backup Exec. The fix, detailed here, is creating a directory named 'backup' under the MSSQL$BKUPEXEC directory.

Absolutely Bizarre - Backup reference database that doesn't exist

Ok folks try this one on. Each night during our Tape
backup the following error occurs in SQL logs
I/O error on backup or restore restart-checkpoint
file 'd:\MSSQL\backup\model4IDR.ckp'. Operating system
error 3(The system cannot find the path specified.). The
statement is proceeding but is non-restartable.
The kicker? We do not have a database called model4IDR.
In sysdatabases there is no such thing and we do not
understand where the backup is getting this info (veritas)
Any ideas to point me in the right direction?
thanks
JTSIt is probably a Veritas specific issue, I haven't seen it before. Worth
speaking to Veritas support.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Jeffrey Sheldon" <jsheldon@.projecthope.org> wrote in message
news:356301c4293f$602b5eb0$a101280a@.phx.gbl...
Ok folks try this one on. Each night during our Tape
backup the following error occurs in SQL logs
I/O error on backup or restore restart-checkpoint
file 'd:\MSSQL\backup\model4IDR.ckp'. Operating system
error 3(The system cannot find the path specified.). The
statement is proceeding but is non-restartable.
The kicker? We do not have a database called model4IDR.
In sysdatabases there is no such thing and we do not
understand where the backup is getting this info (veritas)
Any ideas to point me in the right direction?
thanks
JTS|||In Enterprise Manager, expand to Management > SQL Server Agent > Jobs,
and look for your job that is backing up to your tape drive (you may
also try under Management > Database Maintenance Plans).
Have a look in the Steps tab of this jobs Properties, and there should
be a Step referring to model4IDR.ckp.
Alternatively, if your maintenance plan gets its instructions from a
text file, find that text file and search it for references to your
erroneous database.
I have the same error right now, but it's for databases that do exist.
It turns out that when we had a crash the other week, the CD ROM was
removed from my server, resulting in my secondary HDD moving from F:\
to E:\. Obviously the files for some of my existing databases cannot be
found. It just shows that this error message usually means exactly what
it says.
If you cannot find the file it is looking for, I suggest creating a
text file of the same name and location (it couldn't hurt!!), and let
it find that.
Lastly, that DB name looks TOO MUCH like the model db that all SQL
Servers have, so exercise CAUTION. Cheers.
smithy
---
Posted via http://www.mcse.ms
---
View this thread: http://www.mcse.ms/message599918.html

Absolutely Bizarre - Backup reference database that doesn't exist

Ok folks try this one on. Each night during our Tape
backup the following error occurs in SQL logs
I/O error on backup or restore restart-checkpoint
file 'd:\MSSQL\backup\model4IDR.ckp'. Operating system
error 3(The system cannot find the path specified.). The
statement is proceeding but is non-restartable.
The kicker? We do not have a database called model4IDR.
In sysdatabases there is no such thing and we do not
understand where the backup is getting this info (veritas)
Any ideas to point me in the right direction?
thanks
JTSIt is probably a Veritas specific issue, I haven't seen it before. Worth
speaking to Veritas support.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Jeffrey Sheldon" <jsheldon@.projecthope.org> wrote in message
news:356301c4293f$602b5eb0$a101280a@.phx.gbl...
Ok folks try this one on. Each night during our Tape
backup the following error occurs in SQL logs
I/O error on backup or restore restart-checkpoint
file 'd:\MSSQL\backup\model4IDR.ckp'. Operating system
error 3(The system cannot find the path specified.). The
statement is proceeding but is non-restartable.
The kicker? We do not have a database called model4IDR.
In sysdatabases there is no such thing and we do not
understand where the backup is getting this info (veritas)
Any ideas to point me in the right direction?
thanks
JTS|||In Enterprise Manager, expand to Management > SQL Server Agent > Jobs
and look for your job that is backing up to your tape drive (you ma
also try under Management > Database Maintenance Plans).
Have a look in the Steps tab of this jobs Properties, and there shoul
be a Step referring to model4IDR.ckp.
Alternatively, if your maintenance plan gets its instructions from
text file, find that text file and search it for references to you
erroneous database.
I have the same error right now, but it's for databases that do exist
It turns out that when we had a crash the other week, the CD ROM wa
removed from my server, resulting in my secondary HDD moving from F:
to E:\. Obviously the files for some of my existing databases cannot b
found. It just shows that this error message usually means exactly wha
it says.
If you cannot find the file it is looking for, I suggest creating
text file of the same name and location (it couldn't hurt!!), and le
it find that.
Lastly, that DB name looks TOO MUCH like the model db that all SQ
Servers have, so exercise CAUTION. Cheers
-
smith
----
Posted via http://www.mcse.m
----
View this thread: http://www.mcse.ms/message599918.htm

Tuesday, March 6, 2012

about using osql BACKUP/RESTORE commands

Hi!
I'm using MSDE 2000 SP4 on local computer.
I backed up database into local hard drive using osql command like...
OSQL -E -Q "BACKUP DATABASE MYDB TO DISK = 'C:\MYDB.bak'" >
LogBackupDatabase.log
...and it's working fine. But when I try to save backup file directly
into network drive, it's not working. "LogBackupDatabase.log"-file
contains error message...
"Msg 3201, Level 16, State 1, Server MYLOCALCOMPUTER, Line 1
Cannot open backup device 'Z:\MyFolder\MYDB.bak'. Device error or device
off-line. See the SQL Server error log for more details.
Msg 3013, Level 16, State 1, Server MYLOCALCOMPUTER, Line 1
BACKUP DATABASE is terminating abnormally."
Z: is mapped network drive.
Is it possible to save backup file into network drive somehow? Maybe my
osql is not correctly formed to save into backup file into network
drive, or am I missing something?
Also restore command using osql is not working if I try to restore
backup file from network drive.
Thanks in advance!
Mika
Hi,
Use UNC (REMOTESERVER\SHARE\PATH\) path along with Backup or Restore
commands.
There are Few Pre requisites to do backup remotely;
1. You Should start SQL server using Domain user who got access to remote
machine Share
2. Should have share in the remote machine
3. If you need to schedule this as a job then SQL Agent should use the same
Domain user in which SQL server was started
4. Restart the services
Now you can execute the Backup script with UNC path
BACKUP Database <dbname> to disk='\\computername\sharenameX\dbname.bak' with
init
Perform the same for Restore Database
Note:
Backup to remote machine will not work if you start SQL server using Local
system account
Thanks
Hari
SQL Server MVP
"Mika M" <mahmik_removethis@.luukku.com> wrote in message
news:OASY$mStFHA.3452@.TK2MSFTNGP14.phx.gbl...
> Hi!
> I'm using MSDE 2000 SP4 on local computer.
> I backed up database into local hard drive using osql command like...
> OSQL -E -Q "BACKUP DATABASE MYDB TO DISK = 'C:\MYDB.bak'" >
> LogBackupDatabase.log
> ...and it's working fine. But when I try to save backup file directly into
> network drive, it's not working. "LogBackupDatabase.log"-file contains
> error message...
> "Msg 3201, Level 16, State 1, Server MYLOCALCOMPUTER, Line 1
> Cannot open backup device 'Z:\MyFolder\MYDB.bak'. Device error or device
> off-line. See the SQL Server error log for more details.
> Msg 3013, Level 16, State 1, Server MYLOCALCOMPUTER, Line 1
> BACKUP DATABASE is terminating abnormally."
> Z: is mapped network drive.
> Is it possible to save backup file into network drive somehow? Maybe my
> osql is not correctly formed to save into backup file into network drive,
> or am I missing something?
> Also restore command using osql is not working if I try to restore backup
> file from network drive.
> --
> Thanks in advance!
> Mika
|||hi,
Mika M wrote:
in addition to Hari valuable hint, please have a look at
http://support.microsoft.com/?id=283811 in order to modify the account SQL
Server and SQL Server Agent are running on...
unfortunately this article is no longer alligned with modifications applied
with sp4.. and you will no longer be able to start and run SQL Server and
the Agent only using the reported info..
I'm still trying troubleshooting it..
try "propagating" file permissions to all sub folders as described, as long
as assigning registry permissions as
HKLM\Software\Microsoft\MSSQLServer\Setup (READ)
HKLM\Software\Microsoft\MSSQLServer\MSSQLServer (FULL CONTROL)
for the account running SQL Server and
HKLM\Software\Microsoft\MSSQLServer\SQLSERVERAGENT (FULL CONTROL)
HKLM\SOFTWARE\Microsoft\MSSQLServer\Client\SuperSo cketNetLib\LastConnect
(FULL CONTROL)
HKLM\Software\Description\Microsoft\Rpc\UuidTempor aryData (FULL CONTROL)
HKLM\Software\Microsoft\MSSQLServer\Setup (READ)
HKLM\Software\ODBC\ODBC.INI (FULL CONTROL)
for the account running the Agent...
make those accounts member of the local sysadmins WinNT role
but i definitevely hope kb article 283811 get updated..
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply

Sunday, February 19, 2012

About restoring

I′m using SQL server 2005.

I′ve tried to restore a database based on other database,
but the source database appears with "restoring...".

Is there a log for this?
How can I cancel this operation?

thanks!!!!
this operation "restoring" is running for more than 10 hours, but the database is small.|||This is probably because the database you are restoring is being used. Do not select the database from the Object Explorer when restoring either using the UI or RESTORE DATABASE command|||hi,

but is there a way to cancel?

How can users access this database?

thanks!!!!|||In the log file viewer, there is a line with the following:

The database 'dbnamedevelop' is marked RESTORING and is in a state that does not allow recovery to be run.

How can I to do to use or to enable this database?

thanks!!!! :-)|||What is the sequence of events you performed on the 'dbnamedevelop' database?|||while restoring you have to mention WITH RECOVERY for the last file which you are restoring. See the eg from BOLfor first Data file we mention as WITH NORECOVERY but for log file WITH RECOVERY RESTORE DATABASE MyAdvWorks FROM MyAdvWorks_1 WITH NORECOVERY, MOVE 'MyAdvWorks' TO 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\NewAdvWorks.mdf', MOVE 'MyAdvWorksLog1' TO 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\NewAdvWorks.ldf' RESTORE LOG MyAdvWorks FROM MyAdvWorksLog1 WITH RECOVERY Madhu|||

OK. That helps to clarify the issue.

The advice to use WITH NO RECOVERY for the initial files and WITH RECOVERY only for the final file applies to backup files, not database files.

So, for example if you had a full database backup and a series of log backups, you would restore the database backup WITH NO RECOVERY and then restore each log file using RESTORE LOG WITH NO RECOVERY.

On the last log backup, you would use RESTORE LOG WITH RECOVERY.

Each of these is a separate restore statement.

The WITH [NO] RECOVERY determines the state in which the RESTORE command leaves the database:

Recovered (all non-committed transactions rolled back and the database ready for use)

or Restoring (No roll-back performed, ready to apply the next log backup)

In your example, you specify that one RESTORE command should do both, which is not possible.

|||

Madhu K Nair wrote:

while restoring you have to mention WITH RECOVERY for the last file which you are restoring. See the eg from BOLfor first Data file we mention as WITH NORECOVERY but for log file WITH RECOVERY RESTORE DATABASE MyAdvWorks FROM MyAdvWorks_1 WITH NORECOVERY, MOVE 'MyAdvWorks' TO 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\NewAdvWorks.mdf', MOVE 'MyAdvWorksLog1' TO 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\NewAdvWorks.ldf' RESTORE LOG MyAdvWorks FROM MyAdvWorksLog1 WITH RECOVERY Madhu

ya... there was some confusion... ofcouse it applies to Backup files... i should have mentioed full backup instead data file... The example which i mentioned was copy pasted from BOL and there was nothing wrong in it. There were Two restore not One...

Madhu

|||

So, did the second RESTORE command succeed? If it did, the database would be online.

If it did not, what messages are in the SQL log and Event log?

|||

Can you see any activity on the files under operating system, check under the pathwhere the data files are located. I have had this problem once and due to the Anti-virus & Anti-spyware on this server (development) the whole process was hung. You can kill it but before that ensure there is no activity or other wise get another fresh backup from the source database server.

Tadeu wrote:

I′m using SQL server 2005.

I′ve tried to restore a database based on other database,
but the source database appears with "restoring...".

Is there a log for this?
How can I cancel this operation?

thanks!!!!

|||

i'm having this problem, two databases are hung in the middle of a restore.

how do i cancel this?

appreciated,

m

About restoring

I′m using SQL server 2005.

I′ve tried to restore a database based on other database,
but the source database appears with "restoring...".

Is there a log for this?
How can I cancel this operation?

thanks!!!!
this operation "restoring" is running for more than 10 hours, but the database is small.|||This is probably because the database you are restoring is being used. Do not select the database from the Object Explorer when restoring either using the UI or RESTORE DATABASE command|||hi,

but is there a way to cancel?

How can users access this database?

thanks!!!!|||In the log file viewer, there is a line with the following:

The database 'dbnamedevelop' is marked RESTORING and is in a state that does not allow recovery to be run.

How can I to do to use or to enable this database?

thanks!!!! :-)|||What is the sequence of events you performed on the 'dbnamedevelop' database?|||while restoring you have to mention WITH RECOVERY for the last file which you are restoring. See the eg from BOLfor first Data file we mention as WITH NORECOVERY but for log file WITH RECOVERY RESTORE DATABASE MyAdvWorks FROM MyAdvWorks_1 WITH NORECOVERY, MOVE 'MyAdvWorks' TO 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\NewAdvWorks.mdf', MOVE 'MyAdvWorksLog1' TO 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\NewAdvWorks.ldf' RESTORE LOG MyAdvWorks FROM MyAdvWorksLog1 WITH RECOVERY Madhu|||

OK. That helps to clarify the issue.

The advice to use WITH NO RECOVERY for the initial files and WITH RECOVERY only for the final file applies to backup files, not database files.

So, for example if you had a full database backup and a series of log backups, you would restore the database backup WITH NO RECOVERY and then restore each log file using RESTORE LOG WITH NO RECOVERY.

On the last log backup, you would use RESTORE LOG WITH RECOVERY.

Each of these is a separate restore statement.

The WITH [NO] RECOVERY determines the state in which the RESTORE command leaves the database:

Recovered (all non-committed transactions rolled back and the database ready for use)

or Restoring (No roll-back performed, ready to apply the next log backup)

In your example, you specify that one RESTORE command should do both, which is not possible.

|||

Madhu K Nair wrote:

while restoring you have to mention WITH RECOVERY for the last file which you are restoring. See the eg from BOLfor first Data file we mention as WITH NORECOVERY but for log file WITH RECOVERY RESTORE DATABASE MyAdvWorks FROM MyAdvWorks_1 WITH NORECOVERY, MOVE 'MyAdvWorks' TO 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\NewAdvWorks.mdf', MOVE 'MyAdvWorksLog1' TO 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\NewAdvWorks.ldf' RESTORE LOG MyAdvWorks FROM MyAdvWorksLog1 WITH RECOVERY Madhu

ya... there was some confusion... ofcouse it applies to Backup files... i should have mentioed full backup instead data file... The example which i mentioned was copy pasted from BOL and there was nothing wrong in it. There were Two restore not One...

Madhu

|||

So, did the second RESTORE command succeed? If it did, the database would be online.

If it did not, what messages are in the SQL log and Event log?

|||

Can you see any activity on the files under operating system, check under the pathwhere the data files are located. I have had this problem once and due to the Anti-virus & Anti-spyware on this server (development) the whole process was hung. You can kill it but before that ensure there is no activity or other wise get another fresh backup from the source database server.

Tadeu wrote:

I′m using SQL server 2005.

I′ve tried to restore a database based on other database,
but the source database appears with "restoring...".

Is there a log for this?
How can I cancel this operation?

thanks!!!!

|||

i'm having this problem, two databases are hung in the middle of a restore.

how do i cancel this?

appreciated,

m

About restoring

I′m using SQL server 2005.

I′ve tried to restore a database based on other database,
but the source database appears with "restoring...".

Is there a log for this?
How can I cancel this operation?

thanks!!!!
this operation "restoring" is running for more than 10 hours, but the database is small.|||This is probably because the database you are restoring is being used. Do not select the database from the Object Explorer when restoring either using the UI or RESTORE DATABASE command|||hi,

but is there a way to cancel?

How can users access this database?

thanks!!!!|||In the log file viewer, there is a line with the following:

The database 'dbnamedevelop' is marked RESTORING and is in a state that does not allow recovery to be run.

How can I to do to use or to enable this database?

thanks!!!! :-)|||What is the sequence of events you performed on the 'dbnamedevelop' database?|||while restoring you have to mention WITH RECOVERY for the last file which you are restoring. See the eg from BOLfor first Data file we mention as WITH NORECOVERY but for log file WITH RECOVERY RESTORE DATABASE MyAdvWorks FROM MyAdvWorks_1 WITH NORECOVERY, MOVE 'MyAdvWorks' TO 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\NewAdvWorks.mdf', MOVE 'MyAdvWorksLog1' TO 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\NewAdvWorks.ldf' RESTORE LOG MyAdvWorks FROM MyAdvWorksLog1 WITH RECOVERY Madhu|||

OK. That helps to clarify the issue.

The advice to use WITH NO RECOVERY for the initial files and WITH RECOVERY only for the final file applies to backup files, not database files.

So, for example if you had a full database backup and a series of log backups, you would restore the database backup WITH NO RECOVERY and then restore each log file using RESTORE LOG WITH NO RECOVERY.

On the last log backup, you would use RESTORE LOG WITH RECOVERY.

Each of these is a separate restore statement.

The WITH [NO] RECOVERY determines the state in which the RESTORE command leaves the database:

Recovered (all non-committed transactions rolled back and the database ready for use)

or Restoring (No roll-back performed, ready to apply the next log backup)

In your example, you specify that one RESTORE command should do both, which is not possible.

|||

Madhu K Nair wrote:

while restoring you have to mention WITH RECOVERY for the last file which you are restoring. See the eg from BOLfor first Data file we mention as WITH NORECOVERY but for log file WITH RECOVERY RESTORE DATABASE MyAdvWorks FROM MyAdvWorks_1 WITH NORECOVERY, MOVE 'MyAdvWorks' TO 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\NewAdvWorks.mdf', MOVE 'MyAdvWorksLog1' TO 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\NewAdvWorks.ldf' RESTORE LOG MyAdvWorks FROM MyAdvWorksLog1 WITH RECOVERY Madhu

ya... there was some confusion... ofcouse it applies to Backup files... i should have mentioed full backup instead data file... The example which i mentioned was copy pasted from BOL and there was nothing wrong in it. There were Two restore not One...

Madhu

|||

So, did the second RESTORE command succeed? If it did, the database would be online.

If it did not, what messages are in the SQL log and Event log?

|||

Can you see any activity on the files under operating system, check under the pathwhere the data files are located. I have had this problem once and due to the Anti-virus & Anti-spyware on this server (development) the whole process was hung. You can kill it but before that ensure there is no activity or other wise get another fresh backup from the source database server.

Tadeu wrote:

I′m using SQL server 2005.

I′ve tried to restore a database based on other database,
but the source database appears with "restoring...".

Is there a log for this?
How can I cancel this operation?

thanks!!!!

|||

i'm having this problem, two databases are hung in the middle of a restore.

how do i cancel this?

appreciated,

m

about restore

Now, I take over a application, one of the functionality is to restore database, but I find the original code, the original code puzzles me. To all user databases, for example, the restoring procedure of pubs database, is as follows:

1.

RESTORE DATABASE [pubs] FROM DISK = N'C:\backup\model.bak'

WITH FILE = 1, RECOVERY, REPLACE, KEEP_REPLICATION,

MOVE N'modeldev' TO N'C:\Program Files\Microsoft SQL Server\MSSQL\data\pubs_Playback.mdf',

MOVE N'modellog' TO N'C:\Program Files\Microsoft SQL Server\MSSQL\data\pubs_Playback.ldf'

2.

RESTORE DATABASE [pubs] FROM DISK = N'C:\backup\pubs.bak'

WITH STATS=10, FILE = 1, RECOVERY, REPLACE, KEEP_REPLICATION,

MOVE N'pubs' TO N'C:\Program Files\Microsoft SQL Server\MSSQL\data\pubs.mdf',

MOVE N'pubs_log' TO N'C:\Program Files\Microsoft SQL Server\MSSQL\data\pubs_log.ldf'

I dont understand what role the first SQL statement plays.

Or the original code has problem?If you are running these two statements right after one another with nothing in between, then I would say the first statement is useless. I'm not sure why you would recover a backup of the model database into the pubs database and then restore a backup of the pubs database into pubs. I notice it has the KEEP_REPLICATION setting on, but I don't see how that would alter things. Anyone else?

about re-install replication after I restore database

Hi guys,
I am want to re-create publication after I restore database. because I
didn't setup replcaiton using sp_replicationdboption command, all replication
info lost after I did restoring database. When re-create publication with
same publication name, gave me error like Could not drop publication. A
subscription exists to it. but when I run sp_addpublication_snapshot, gave me
error Object 'Web Policy Publication' does not exist or is not a valid object
for this operation.then I coudn't run add article, because the publication is
not existed. How can I fix it. Thanks.
Its hard to restore a publication database on another server. On the same
server you might be able to restore it using the keep_replication switch and
have everything work fine.
After you restore the database and the publications show up you should try
to script them and then recreate the publication to have everything
consistent.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Iter" <Iter@.discussions.microsoft.com> wrote in message
news:BA3600A1-F340-4CE5-B24B-0F34E9B0A60A@.microsoft.com...
> Hi guys,
> I am want to re-create publication after I restore database. because I
> didn't setup replcaiton using sp_replicationdboption command, all
> replication
> info lost after I did restoring database. When re-create publication with
> same publication name, gave me error like Could not drop publication. A
> subscription exists to it. but when I run sp_addpublication_snapshot, gave
> me
> error Object 'Web Policy Publication' does not exist or is not a valid
> object
> for this operation.then I coudn't run add article, because the publication
> is
> not existed. How can I fix it. Thanks.
>

Monday, February 13, 2012

About loginid anf userid

Hi guys,
I backup a database and restore it to different server. In the diffrent
server, after I restore database, the userid has been reserved, but loginid
has been lost. I want to creat loginid which should be same as oraginal
server and map it to the userid that is existed. I don't want to re-create
the userid because It has too much trouble. I don't know how to do that.
Could anybody help me? Thanks.
Jerry MuThis one may help.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sp_ca-cz_8qzy.asp
--
Regards,
Dave Patrick ...Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
"Iter" wrote:
| Hi guys,
| I backup a database and restore it to different server. In the diffrent
| server, after I restore database, the userid has been reserved, but
loginid
| has been lost. I want to creat loginid which should be same as oraginal
| server and map it to the userid that is existed. I don't want to re-create
| the userid because It has too much trouble. I don't know how to do that.
| Could anybody help me? Thanks.
|
| Jerry Mu
||||For a Windows login, all you need to do is create the login and it will
automatically be mapped to the user:
SQL 2000:
EXEC sp_grantlogin 'MyDomain\MyUser'
SQL 2005:
CREATE LOGIN 'MyDomain\MyUser' FROM WINDOWS;
For a SQL login, you can remap the user to a login using the
sp_change_users_login stored procedure. For example:
USE MyDatabase
EXEC sp_change_users_login 'Update_One', 'MyUser', 'MyLogin'
See the Books Online for more information.
Hope this helps.
Dan Guzman
SQL Server MVP
"Iter" <Iter@.discussions.microsoft.com> wrote in message
news:3B2995EC-7F84-4983-A28D-F27D6A0CB66F@.microsoft.com...
> Hi guys,
> I backup a database and restore it to different server. In the diffrent
> server, after I restore database, the userid has been reserved, but
> loginid
> has been lost. I want to creat loginid which should be same as oraginal
> server and map it to the userid that is existed. I don't want to re-create
> the userid because It has too much trouble. I don't know how to do that.
> Could anybody help me? Thanks.
> Jerry Mu
>|||Google for sp_help_revlogin.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Iter" <Iter@.discussions.microsoft.com> wrote in message
news:3B2995EC-7F84-4983-A28D-F27D6A0CB66F@.microsoft.com...
> Hi guys,
> I backup a database and restore it to different server. In the diffrent
> server, after I restore database, the userid has been reserved, but loginid
> has been lost. I want to creat loginid which should be same as oraginal
> server and map it to the userid that is existed. I don't want to re-create
> the userid because It has too much trouble. I don't know how to do that.
> Could anybody help me? Thanks.
> Jerry Mu
>

About loginid anf userid

Hi guys,
I backup a database and restore it to different server. In the diffrent
server, after I restore database, the userid has been reserved, but loginid
has been lost. I want to creat loginid which should be same as oraginal
server and map it to the userid that is existed. I don't want to re-create
the userid because It has too much trouble. I don't know how to do that.
Could anybody help me? Thanks.
Jerry MuThis one may help.
http://msdn.microsoft.com/library/d.../>
cz_8qzy.asp
Regards,
Dave Patrick ...Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
"Iter" wrote:
| Hi guys,
| I backup a database and restore it to different server. In the diffrent
| server, after I restore database, the userid has been reserved, but
loginid
| has been lost. I want to creat loginid which should be same as oraginal
| server and map it to the userid that is existed. I don't want to re-create
| the userid because It has too much trouble. I don't know how to do that.
| Could anybody help me? Thanks.
|
| Jerry Mu
||||For a Windows login, all you need to do is create the login and it will
automatically be mapped to the user:
SQL 2000:
EXEC sp_grantlogin 'MyDomain\MyUser'
SQL 2005:
CREATE LOGIN 'MyDomain\MyUser' FROM WINDOWS;
For a SQL login, you can remap the user to a login using the
sp_change_users_login stored procedure. For example:
USE MyDatabase
EXEC sp_change_users_login 'Update_One', 'MyUser', 'MyLogin'
See the Books Online for more information.
Hope this helps.
Dan Guzman
SQL Server MVP
"Iter" <Iter@.discussions.microsoft.com> wrote in message
news:3B2995EC-7F84-4983-A28D-F27D6A0CB66F@.microsoft.com...
> Hi guys,
> I backup a database and restore it to different server. In the diffrent
> server, after I restore database, the userid has been reserved, but
> loginid
> has been lost. I want to creat loginid which should be same as oraginal
> server and map it to the userid that is existed. I don't want to re-create
> the userid because It has too much trouble. I don't know how to do that.
> Could anybody help me? Thanks.
> Jerry Mu
>|||Google for sp_help_revlogin.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Iter" <Iter@.discussions.microsoft.com> wrote in message
news:3B2995EC-7F84-4983-A28D-F27D6A0CB66F@.microsoft.com...
> Hi guys,
> I backup a database and restore it to different server. In the diffrent
> server, after I restore database, the userid has been reserved, but logini
d
> has been lost. I want to creat loginid which should be same as oraginal
> server and map it to the userid that is existed. I don't want to re-create
> the userid because It has too much trouble. I don't know how to do that.
> Could anybody help me? Thanks.
> Jerry Mu
>