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

Wednesday, March 28, 2012

is it possible to just restore particular tables from a back up of a database

Hi,

I backed my sql server database on Fri at 3:15pm and then tried importing some tables individually from a different database and but that didnt work out too good, so is there a way i can just restore particular tables from the backup.

any help will be appreciated.

regards,

Karen

AFAIK, you need to restore the db first to retrieve any information from the files.|||I don't think it is possible to just restore one table. What I have done in the past is to restore the backed up database with a new name and then copy the table from the backup to the operational.|||

Restore database with different name and next copy data from tables you need to your destination

Thanks

|||

thanks a lot for your answers i just restored the database to it previous state

Regards,

Karen

sql

Monday, March 26, 2012

Is it possible to import users logins when u restore a DB?

Im abit puzzled here and im looking to see if there is any easy solution

Case:

Have Backed up an DP, then Restored it on another computer.

Then all users will be in the system (Not visible to users, but in sys info)

OK!

Then I set up all LOGINS...

After all this procedure is completed I use the sp_change_users_login Update_One function...

Question:

Cant I just import or other way use old logins/users

(I know this msg might sound weird, but hehe I hope someone knows what I mean..)

Thx!As far as I know there isn't since the logins are stored in the master database. Unless in your scenario you can backup the master database and restore it on the other computer after doing the same for your database.

This worked for me when upgrading from SQL 7 to SQL 2K.|||oh! :eek:

Many thanks, I will try that one :p|||You can use command line utility bcp to copy the master..syslogins table
out of server1 and then bcp it back in to server2. Make sure you use
-c option as this will allow you to edit the output since you will need to
remove any entries which already exist in server2 (eg. "sa") in order
to prevent it falling over with duplicate key errors.

Type bcp on command line to get full list of options.|||2Scre@.m
Sorry, but I think that guys were wrong.
Read this
http://support.microsoft.com/directory/article.asp?ID=KB;EN-US;Q298897
and other links from it.

Monday, March 12, 2012

Is it possiable to restore a DB ...

Hi,

I've written a M.plan in my client place which is scheduled to occur
weekly once.But 4 days gone from the last backup taken , there is a
problem in the server which does not start loading windows .The only
way is entering via SAFE-MODE.In the safe mode the E.Manage does not
connected(is it due to safe-mode).

They told they going to format the system . Since the E.M is not
connected, I just copied only my DB(.mdf) and the log file(.ldf).After
that i come accross that all the system databases should be backed up
along with the User DB then only possible for Restoration.

My request is

Is it not possiable to restore my copied DB(.MDF) (not backed up)
After reinstallation of Sql server.

With Heartfull thanks
Raghu"Raghuraman" <raghuraman_ace@.rediffmail.com> wrote in message
news:66c7bef8.0311260443.3adb69db@.posting.google.c om...
> Hi,
>
> I've written a M.plan in my client place which is scheduled to occur
> weekly once.But 4 days gone from the last backup taken , there is a
> problem in the server which does not start loading windows .The only
> way is entering via SAFE-MODE.In the safe mode the E.Manage does not
> connected(is it due to safe-mode).
>
> They told they going to format the system . Since the E.M is not
> connected, I just copied only my DB(.mdf) and the log file(.ldf).After
> that i come accross that all the system databases should be backed up
> along with the User DB then only possible for Restoration.
> My request is
> Is it not possiable to restore my copied DB(.MDF) (not backed up)
> After reinstallation of Sql server.
> With Heartfull thanks
> Raghu

I saw something already written in this newgroup today that may help.

Subject: attach db file copied previously

Comand: sp_attach_single_file_db|||"Raghuraman" <raghuraman_ace@.rediffmail.com> wrote in message
news:66c7bef8.0311260443.3adb69db@.posting.google.c om...
> Hi,
>
> I've written a M.plan in my client place which is scheduled to occur
> weekly once.But 4 days gone from the last backup taken , there is a
> problem in the server which does not start loading windows .The only
> way is entering via SAFE-MODE.In the safe mode the E.Manage does not
> connected(is it due to safe-mode).
>
> They told they going to format the system . Since the E.M is not
> connected, I just copied only my DB(.mdf) and the log file(.ldf).After
> that i come accross that all the system databases should be backed up
> along with the User DB then only possible for Restoration.

If possible you want to backup all the system DBs, especially the MSDB or
you risk losing jobs, etc.

So, if you can grab copies of the MDF and LDF of that to, that will help.

> My request is
> Is it not possiable to restore my copied DB(.MDF) (not backed up)

If you have the MDF and LDF then sp_attach_db is your best bet. If you have
only the .MDF, you MAY be able to use sp_attach_single_file_db, but
generally that will NOT work unless you used sp_detach_db in the first
place.

However, if you have just the MDF and can't attach it, contact Microsoft
Server Support. They may be able to help you, but your DB is likely to be
in an inconsistent state.

Note: If you're doing full backups only weekly, I highly recommend
differential or transactional backups on a daily basis (or even more often.)

> After reinstallation of Sql server.
> With Heartfull thanks
> Raghu

Friday, February 24, 2012

Is IDENTITY_INSERT OFF safe?

Say I have a sproc that is occasionally used to restore deleted records to a
table.
--If I use
SET IDENTITY_INSERT myTable ON
--Then insert the records...
INSERT INTO myTable(ID, AnyField)
VALUES (2,'hello);
--Then I return table to original state
SET IDENTITY_INSERT myTable OFF
During that process, what would happen if another user was attempting to
insert records into the same table?
Even if my transaction only takes .2 milliseconds, is it possible another
user will get an error, or is SQL Server smart enough to delay their
transaction(s) [lock the table] until mine is complete?
Thanks,
ChrisOther updaters are not blocked by SET IDENTITY_INSERT ON. But this is not a
problem since the IDENTITY_INSERT ON applies only to the connection that
runs it. The identity column is handled normally in all other connections
(unless, of course, that connection has also set IDENTITY_INSERT ON.
So, yes, it is safe to use.
Tom
"Chris" <rooster575@.hotmail.com> wrote in message
news:OsTb2VdiGHA.4512@.TK2MSFTNGP02.phx.gbl...
> Say I have a sproc that is occasionally used to restore deleted records to
> a table.
> --If I use
> SET IDENTITY_INSERT myTable ON
> --Then insert the records...
> INSERT INTO myTable(ID, AnyField)
> VALUES (2,'hello);
> --Then I return table to original state
> SET IDENTITY_INSERT myTable OFF
> During that process, what would happen if another user was attempting to
> insert records into the same table?
> Even if my transaction only takes .2 milliseconds, is it possible another
> user will get an error, or is SQL Server smart enough to delay their
> transaction(s) [lock the table] until mine is complete?
> Thanks,
> Chris
>|||Thanks Tom!
"Tom Cooper" <tom.no.spam.please.cooper@.comcast.net> wrote in message
news:WsmdnSkiXZ4uqBvZnZ2dnUVZ_vqdnZ2d@.co
mcast.com...
> Other updaters are not blocked by SET IDENTITY_INSERT ON. But this is not
> a problem since the IDENTITY_INSERT ON applies only to the connection that
> runs it. The identity column is handled normally in all other connections
> (unless, of course, that connection has also set IDENTITY_INSERT ON.
> So, yes, it is safe to use.
> Tom
> "Chris" <rooster575@.hotmail.com> wrote in message
> news:OsTb2VdiGHA.4512@.TK2MSFTNGP02.phx.gbl...
>|||ACID
Isolation