restore interview questions
Top restore frequently asked interview questions
I need to migrate from one Mac to another, and want Sublime Text 2 on a new computer to have all the same configuration/plugins I have installed on the old one.
Is there some folder(s) I could just copy and restore on another one to replicate everything?
Source: (StackOverflow)
Is it possible to restore a MySQL database from the physical database files. I have a directory that has the following file types:
client.frm
client.MYD
client.MYI
but for about 20 more tables.
I usually use mysqldump or a similar tool to get everything in 1 SQL file so what is the way to deal with these types of files?
Source: (StackOverflow)
I created a database on my local machine and then did a backup called tables.bak
of table DataLabTables
.
I moved that backup to a remote machine without that table and tried to do a restore but get the following error:
System.Data.SqlClient.SqlError: The operating system returned the
error '5(Access is denied.)' while attempting
'RestoreContainer::ValidateTargetForCreation' on 'c:\Program
Files\Microsoft SQL Server\MSSQL.1\MSSQL\DataLabTables.mdf'.
How do I fix my rights, if that is the problem?
Source: (StackOverflow)
I am trying to build a backup and restore solution for the docker containers that we work with.
I have docker base image that I have created ubuntu:base
and do not want have to rebuild it each time with a dockerfile to add files to it.
I want to create a script that runs from the host machine and creates a new container using the ubuntu:base
docker image and then copies files into that container. But I am stuck copy files on the container
How can I copy files from the host to the container?
Source: (StackOverflow)
I was looking into the steps of how to Restore Database Backup using SQL Script (T-SQL). Here are the steps:
Database YourDB
has full backup YourBackUpFile.bak
. It can be restored using following two steps:
Step 1: Retrieve the logical file name of the database from the backup.
RESTORE FILELISTONLY
FROM DISK = 'D:BackUpYourBackUpFile.bak'
GO
Step 2: Use the values in the LogicalName
column in the following step.
----Make Database to single user Mode
ALTER DATABASE YourDB
SET SINGLE_USER WITH
ROLLBACK IMMEDIATE
----Restore Database
RESTORE DATABASE YourDB
FROM DISK = 'D:BackUpYourBackUpFile.bak'
WITH MOVE 'YourMDFLogicalName' TO 'D:DataYourMDFFile.mdf',
MOVE 'YourLDFLogicalName' TO 'D:DataYourLDFFile.ldf'
I am just having problem on how to get the YourMDFLogicalName
and YourLDFLogicalName
.
Can any one help me with that?
Source: (StackOverflow)
Is there any way, given a SQL Server 2008 .bak file, to restore a database from the .bak file without the transaction log?
The reason I'm asking is that the transaction log file size of this database is huge - exceeding the disc space I have readily available. I have no interest in the transaction log, and no interest in any uncompleted transactions, so normally I would simply shrink the log to zero once I've restored the database. But that doesn't help when I have insufficient disc space to create the log in the first place. What I need is a way to tell SQL Server to restore only the data from the .bak file, not the transaction log. Is there any way to do that?
Note that I have no control over the generation of the .bak file - it's from an external source. So shrinking the transaction log before generating the .bak file is not an option.
Source: (StackOverflow)
I have one database which contains the most recent data, and I want to replicate the database content into some other servers. Due to non-technical reasons, I can not directly use replicate function or sync function to sync to other SQL Server instances.
Now, I have two solutions, and I want to learn the pros and cons for each solution. Thanks!
Solution 1: detach the source database which contains the most recent data, then copy to the destination servers which need the most recent data, and attach database at the destination servers;
Solution 2: make a full backup of source server for the whole database, then copy data to destination servers and take a full recovery at the destination server side.
thanks in advance,
George
Source: (StackOverflow)
I was just working on my Netbeans project and accidentally deleted it and don't know how to recover it.
Is there a tmp folder that the deleted project is stored in.
Or am I forever doomed?
Thanks,
Lucas
Source: (StackOverflow)
The following figure (from the official doc) describes the well-known lifecycle of an Android activity:
On the other hand, when the activity is destroyed by the system (for example because memory needs to be reclaimed), the state of the activity is sometimes automatically saved and restored by means of the methods onSaveInstanceState()
and onRestoreInstanceState()
, as illustrated by the following figure (also from the official doc):
I'm aware that onSaveInstanceState()
is not always called when an activity is about to be destroyed. For example, if it is destroyed because the user has pressed the "back" button, the activity state is not preserved. But in the cases when the state is saved and restored, and onSaveInstanceState()
/ onRestoreInstanceState()
get called, when exactly are they called?
For example, according to the above figures, onRestoreInstanceState()
might be called before onStart()
, or after onStart()
but before onResume()
, or after onResume()
. Similarly, several possibilities exist for onSaveInstanceState()
. So when are they called exactly?
Ideally, what I would like is to see a combined diagram showing the activity lifecycle states and the save/restore methods, if that exists.
Source: (StackOverflow)
I have taken backup of SQL Server 2008 DB on server, and download them to local environment.
I am trying to restore that database and it is keep on giving me following error.
An exception occurred while executing
a Transact-SQL statement or batch.
(Microsoft.SqlServer.ConnectionInfo)
------------------------------ ADDITIONAL INFORMATION:
The media family on device
'C:\go4sharepoint_1384_8481.bak' is
incorrectly formed. SQL Server cannot
process this media family. RESTORE
HEADERONLY is terminating abnormally.
(Microsoft SQL Server, Error: 3241)
For help, click:
http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.4053&EvtSrc=MSSQLServer&EvtID=3241&LinkId=20476
I have tried to create a temp DB on server and tried to restore the same backup file and that works. I have also tried no. of times downloading file from server to local pc using different options on Filezila (Auto, Binary)
But its not working. After that I tried to execute following command on server.
BACKUP DATABASE go4sharepoint_1384_8481
TO DISK=' C:\HostingSpaces\dbname_jun14_2010_new.bak' with FORMAT
It is giving me following error:
Msg 3201, Level 16, State 1, Line 1 Cannot open backup device
'c:\Program Files\Microsoft SQL
Server\MSSQL10.SQLEXPRESS\MSSQL\Backup\
C:\HostingSpaces\dbname_jun14_2010_new.bak'. Operating system error
123(The filename, directory name, or volume label syntax is
incorrect.). Msg 3013, Level 16, State 1, Line 1 BACKUP DATABASE is
terminating abnormally.
After researching I found the following 2 useful links:
- http://support.microsoft.com/kb/290787
- http://social.msdn.microsoft.com/Forums/en-US/sqlsetupandupgrade/thread/4d5836f6-be65-47a1-ad5d-c81caaf1044f
But I am still not able to restore Database correctly.
Any help would be much appreciated. Thanks.
Source: (StackOverflow)
I'm trying to restore a PostgreSQL database by executing the SQL that pg_dump created, on an empty database.
I'm getting this error:
ERROR: syntax error at or near "\"
LINE 5211: \.
lines 5210 and 5211 read:
COPY auth_group (id, name) FROM stdin;
\.
It works fine on my Linux server, where I use this command:
psql -U dbname < dumpfile.sql
but on Windows, I'm not sure how to do the same, so I've been trying to run the dumpfile's sql from pgAdminIII query utility.
What the recommended way of importing a db from a dump on Windows? Or: how can that syntax issue be resolve?
Any help is much appreciated!
Martin
Source: (StackOverflow)
I have been reading a LOT of google posts and StackOverflow questions about how to restore a database in SQL Server from a .bak file.
But none of them states how to just READ the tables in the database-backup.
(None that I could find anyway?)
I just want to check out some old information which now has been deleted, without actually restoring the full database.
Is this possible?
.
EDIT:
I just wanted to post my T-SQL solution to the problem, so others may use it and I can go back and look it up ;)
First I created a new database called backup_lookup
and took it offline.
After this I could restore my old database mydb
to the new one, without ever touching my original.
USE master
GO
RESTORE DATABASE backup_lookup
FROM DISK = 'D:\backup\mydb.bak'
WITH REPLACE,
MOVE 'mydb' TO 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\backup_lookup.mdf',
MOVE 'mydb_log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\backup_lookup_log.ldf'
GO
I hope this helps :)
Source: (StackOverflow)
I've accidentally pulled some changes from the main repo with --rebase parameter.
How do I restore the original repository state from the backup which was created during the rebase?
Source: (StackOverflow)
I have two projects ones a class library and ones an mvc3 project. They both have nuget packages associated with them. On the class library when I right click the solution I get the "Enable NuGet Packges Restore" option
In the MVC one I do not.
needless to say I would like the feature for both projects. what am I doing wrong?
Source: (StackOverflow)
This is somewhat of a mundane question but it seems to me there is no in-built method for it in WPF. There only seems to be the WindowState
property which being an enum does not help since i cannot tell whether the Window was in the Normal
or Maximized
state before being minimized.
When clicking the taskbar icon the window is being restored just as expected, assuming its prior state, but i cannot seem to find any defined method which does that.
So i have been wondering if i am just missing something or if i need to use some custom interaction logic.
(I'll post my current solution as answer)
Source: (StackOverflow)