Restore A Complete SQL Server Installation Into A New Clean One
Oct 13, 1998
A customer is about to replace their PDC with SQL Server running on it.
MY companies role is to build the new server, and get their SQL Server running again.
I need to have the devices, databases, tables, data and the USERS copied across. I cannot use transfer manager as their will be only 1 instance of SQL Server running on the network.
If all we have is an NT backup is perfomed on the entire disk, i.e. the MSSQL/DATA directory.
How do we recreate the databases and their associated tables and also, how do we recreate the User accounts ?
Any ideas would be appreciated.
Please feel free to e-mail me with a response
NEILA@ANGLIABC.CO.UK
I most likely am being incredibly stupid here, but I have installed SQL 2005 Enterprise and Service Pack 2 on my Acer laptop running Vista Business and cannot for the life of me figure out how to start the thing.
When I hit the start button on the toolbar, and go to Microsoft SQL Server 2005, there is one folder that expands down called Configuration Tools. This has the options Notification Services, Configuration Management, Error and Usage Reports, and Surface Area Configuration. But no where can I find an icon that actually starts the database thing so I can create a database and learn some SQL stuff.
I would be most grateful if anybody could point out where I am going wrong or if there is anything I need to do.
Just curious if there's a reason why everytime I try to apply the Microsoft SQL Server 2005 Express Edition Service Pack 2 from Windows Update that it will sit at "Installing" and appear to do nothing (no hard drive activity, but the MSI and setup processes are chewing a little bit of CPU time). How long should I give this update to complete? I am running a 2-CPU dual-core Xeon 3.0GHz w/ 2GB of RAM setup, so I would have thought it would be completed very quickly. :(
Edit:
Disregard; I had to wait for a full 15 minutes! :O
"Database in use. The system administrator must have exclusive use of the database to run the restore operation." I created a script in the 7.0 database to reconfig the db to 'dbo use only' and identify and then kill all but the 'SA' and 'NT AUTHORITYSYSTEM' processes but that still is not enough. Can anyone please tell me what I'm missing here? Thanx. W.
Is there a way to extract only installation files to install SQL 2012 client tools from complete media set. I'm interested in SQL MGMT Studio/Profiler/Data Quality services/Configuration tools.
Hi,I want to restore my databases from the old SQL Server installationinto a new installation of SQL Server. My new installation of SQLServer has different data path from the old installation. In addition,the data owners of some databases in the old SQL Server installationare not dbo. I have backups for all the databases in the oldinstallation SQL Server.Can anyone tell me how to restore my databases from the old SQL Serverinstallation into a new installation of SQL Server for my case? (Iwant to use new path for data and log files as well as keep the olddata owners in the restored databases.) Do I need to perform restoreoperation against my master database in the new installation of SQLServer? (The data path for a newly created database has been changedin the new installation of SQL Server.)My idea is:1. Create new databases whose names are the same with the databases ofthe old SQL installation. Set the new databases with the new data pathI want.2. Create new login accounts whose user names and passwords are thesame with the old login accounts. Assign appropriate permissions tothe new login accounts (e.g, the data owner for some database).3. Use Enterprise Manager to perform restore operation against thenewly created databases using the backups from the old SQL Serverinstallation.Please advice.Hai-Chu
I am new to Forum. So not sure if i am posting my problem uner the right topic.
We have a sql server 2005 enterprise edition 4 way cluster on windows 2003 advance server.
I am logshipping these database to a different server at a different location. My logshipping went fine until one the cluster server failed and the server instance failed over to another node. The backup that happened around that time got copied over to the secondary by the copy job. The log file that got copied to the secondary server tried restoring and i think it failed int he middle of restoring it. (You would think that the sql would knoe if the backup is in complete and will move on to the next file. Not sure what happened there.) There is no indication of the *.TUF file in the directory where i have the log files.
I tried restoring it manually and i got the following error
Msg 4319, Level 16, State 3, Line 1
A previous restore operation was interrupted and did not complete processing on file 'sessionlog1'. Either restore the backup set that was interrupted or restart the restore sequence.
Msg 3013, Level 16, State 1, Line 1
RESTORE LOG is terminating abnormally.
I looked in the msdb..log_shipping_secondary_databases and looked for the last file that it restored and tried restoring it again with the following restore command by removing and adding some of the keywords that you see after the "WITH" clause. MSFT do not recommand to use continne_after_error unless its absolutley necessary. I stilll get the above error.
restore log sessiondata
from disk = 'I:sql13qasmlogssessiondatasessiondata_20070901124516.trn'
with restart, CONTINUE_AFTER_ERROR, norecovery
When i add the restart int he with clause,
The restart-checkpoint file 'J:Microsoft SQL ServerMSSQL.5MSSQLBackupsessiondata.CKP' was not found. The RESTORE command will continue from the beginning as if RESTART had not been specified.
Msg 4319, Level 16, State 1, Line 1
A previous restore operation was interrupted and did not complete processing on file 'sessionlog1'. Either restore the backup set that was interrupted or restart the restore sequence.
Msg 3013, Level 16, State 1, Line 1
RESTORE LOG is terminating abnormally.
I checked it the backup directory and i can't locate the .CKP file.
Does anyone ever come accross this issue?
Is there anyother way i could recover this DB in a standby or norecovery mode.
Any kind of help to resolve this issue (beside copy the full backup and redo the whole log-shipping process again) would be appreciated. sicne my primary and secondary server are totally ina different location, i need to ship a tape, if i need a full backup. This is the 3rd time its happening on that cluster. its frustrating to ship a tape everytime this happens.
In SQL Studio, I can go to the restore window and the click "verify backup media". This would check the restore plan listed in this window and check if some of the fileĀ are missed.Is there any way to reach this with TQSL? I know there is a "restore verify" command, but this will only verify one backup/file and not the complete restore path. I'm looking for a TSQL solution which is able to control that all necessary backup files are still present on the file System and not moved or deleted (e.g through cleanup task).
I was wondering if someone could help me. I need to re-install the SQL Server (due to a registry corruption). What I plan to do is to:
- Detach all databases (including master, pubs, and tempdb) - Copy databases to a different folder - Uninstall SQL Server - Reinstall SQL Server - Copy the databases back - Reattach all databases
Will that preserver all the security? (e.g. syslogins and sysxlogins) Will using an old "master" database on a new install pose any problems?
Any help will be GREATLY appreciated. Please email me at vchai@artinmotion.com
I am looking for a table where Maintenance Clean Up Task configuration is stored. For example, Delete file older than the following - which is 2 days. Which table can I retrieve the setting in msdb ?
I have a service (Windows service that is) that's set to automatic startup. The service makes use of one or more SQL server databases and is configured with a startup dependency on SQL Server.
Problem is, the service control manager considers that startup dependency to be satisfied once the SQL server service process successfully starts, but connections from within my service to my databases won't actually succeed until recovery on at least those databases is complete.
Of course, I can do something mundane like retry failed connections a few times, or ensure that I don't attempt to connect to a database until some hard-wired amount of system uptime has passed, but those solutions are just band-aids. The Right Answer, it seems to me, would be to detect when SQL Server has finished recovery and not attempt to connect to my databases before that time.
So, is there any way to determine if SQL server has completed recovery programatically? On a server-wide basis or on an individual database basis? I'm assuming that my service would need to connect to SQL Server with some high-powered credentials (sa or equivalent) to get that information, but that's not a problem in my application.
I would like to create a store procedures that will return me a full path by passing a PathID
I started with this code:
DECLARE @path_id int SET @path_id = 5; WITH fullPath (PathID, ParentPathID, Path) AS ( SELECT PathID, ParentPathID, Path FROM tblPath WHERE PathID = @path_id UNION ALL SELECT tblPath.PathID, tblPath.ParentPathID, tblPath.Path AS Path FROM tblPath JOIN fullPath ON tblPath.PathID = fullPath.ParentPathID ) SELECT * FROM fullPath
This code will return this: 1 NULL D: 2 1 Sections 3 2 Bin 4 3 Data 5 4 FinancialReport.doc
What I would like to get is something like this: D:/Sections/Bin/Data/FinancialReport.doc
Any help would be really appreciated. Lost too much time on it already. Thanks, pharvey
Hi all,I'm getting this error when trying to import data from a text file intoSQL Server 2000 (Windows Server 2003) using the DTS import wizard.Any ideas what could be causing this? There aren't any restrictions(that i can find) on the file sizes etc.Thanks in advance.Dave
I have an SSIS package is made up of SQL tasks and dataflows. The dataflows connect to an Oracle database using Native OLE DBOracle Provider for OLE DB (10g). This is the first package dealing with oracle that runs on the server. I can execute the package manually by right clicking and going to 'Run Package' while logged in remotely from the server, but it gets hung up and does nothing if I run it as a job. I always have to quit the job. I can disable everything but the dataflows in the package and the job completes and runs fine.
I have installed SQL server 2005 and after I uninstalled it. and tried to install again but my computer recognize the old version of Sql Server 2005 and only allow to install documentation and client components
How to unintall Sql server 2005 complete from my computer ?
I have uninstalled the CTP version of the SQL Server express so that I can install the released version but CTP version is still listed in the add/remove program list but without the change/remove button. I have been to different sites to find information on cleaning this up and I have ran all the uninstall tool I can find but the problem still prevails. I cannot install the released version without completely getting rid of the CTP version. Please help anyone.
Hello--I do not know if this group can help me with SQL Server Reporting Services ... but here it goes. I have a report built on a query and I want to be able to send a parameter (@theWhere) that is a string which is a where clause "(MEGLOMART_TYP_CODE <> 'XYZ' AND MEGLOMART_STAFF_SHORTAGE > 25)" these strings can vary depending on what columns the user selects and what operators they want to use. Generation of proper SQL for the where clause has been verified, I just need to be able to pass these, is there any way to do this...see example query below and how I was planning on using the @theWhere variable...
There is a lot of documention concerning data(base) backups, but I could not find information about how to backup a complete SQL Server instance (data + configuration) or the SQL server configuration (= everything, that is not user payload). you always re-configure your system after restoring, especially because you will forget some settings?I found following things necessary to backup configuration:
server-wide: security: login, roles, ... server objectsserver properties (e.g. collation, connection or memory settings; see SSMS "Server - Properties") per database database settings (SSMS - database - properties)scheme
1. Is there anything missing?In case of a severe system crash I would like to be able to recover the system using a full system image of the virtual machine. However I just create these images after significant changes (e.g. Windows service pack).The SQL server should be backuped independently from these system images.
2. Even if I used SQL Server maintenance plan, choose "backup all databases" and additionally backup resources DB manually I think, that some configuration is still missing, right? Where are the security configuration and server properties saved? In my system database there are some tables, but there is very little content inside, so that the data from the views INFORMATION_SCHEMA* and sys.* obviously is not saved there.SQL Server system objects, such as sys.objects, are physically persisted in theResource database, but they logically appear in the sys schema of every database. URL....What does that mean: Are all DB/table schemes, logins, ... saved in resource DB?
3. Does a usual SQL Server full database backup also contain all settings concerning this database (database properties, logins, ...)?
4. Is there at least a way to backup ONLY the configuration (server-wide and database) without data? The only tool I could find is DACPAC, that exports a database's scheme and some other configuration, but e.g. the database propertiesĀ are not included: By default, the database created during the deployment will have the default settings from the CREATE DATABASE statement. The exception is that the database collation and compatibility level are set to the values from the source database. URL..
I have created a small COM in C# so that I can programatically create and execute stored procedures with SMO. At this point the COM has nothing in it but just a test prototype. But when I tried to create the object as follows, I get the error indicated below. It is not a memory issue because I have adequate storage and RAM.
Please Help!
DECLARE @object int DECLARE @hr int DECLARE @property varchar(255) DECLARE @return varchar(255) DECLARE @src varchar(255), @desc varchar(255)
-- Create an object. EXEC @hr = sp_OACreate 'SQLInterop.CsharpHelper', @object OUT IF @hr <> 0 BEGIN EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc RETURN END
This is the error I am getting:
Error Code: 0x8007000E Description: Not enough storage is available to complete this operation. Source: ODSOLE Extended Procedure
This is the C# code for the COM:
using System; using System.Runtime.InteropServices; using System.Reflection; using System.Runtime.CompilerServices; using System.EnterpriseServices;
// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("CSServer")] [assembly: AssemblyDescription("Test SQL .NET interop")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("MyKey.snk")]
// Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(true)]
// The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("ff35c6b4-81bf-47dd-9290-fcbbb49008d9")]
// Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.0.1")] [assembly: AssemblyFileVersion("1.0.0.1")]
// the ApplicationName attribute specifies the name of the // COM+ Application which will hold assembly components [assembly: ApplicationName("SQLInterop")]
// the ApplicationActivation.ActivationOption attribute specifies // where assembly components are loaded on activation // Library : components run in the creator's process // Server : components run in a system process, dllhost.exe [assembly: ApplicationActivation(ActivationOption.Server)] namespace SQLInterop { public interface ITest { string SayHello(); string SayIt(String strMessage); }
//[SecurityRole("RBSecurityDemoRole", SetEveryoneAccess = true)] [ComVisible(true)] [CLSCompliant(false)] [ClassInterface(ClassInterfaceType.None)] public class CSharpHelper : ITest { public string SayHello() { return "Hello from CSharp"; }
public string SayIt(String strMessage) { return strMessage + ": from CSharp"; } } }
In Windows Server 2012. How do I do a System Restore to a previous restore point?I need to install the 64 bit and 32 bit Oracle Client Install for connections in SSIS and to create Oracle Linked Servers.
If you make a mistake it is not fun removing it. Sometimes it corrupts the machine and it is difficult to uninstall since there is not an Oracle Universal installer for Oracle 11g.If you install the 32 bit before the 64 you mess up the machine.how to create a restore point.
I have a database full of different types of leads some for company A some for company B and so on, each doing a different service. However the leads from B can be used for A and leads from A can be used for B, so I want to merge the data.
Example:
Phone Number Name Home Owner Credit Insurance 727-555-1234 Dave Thomas Yes B 727-555-1234 Dave Thomas Gieco
I would like the end result to be one record:
Phone Number Name Home Owner Credit Insurance 727-555-1234 Dave Thomas Yes B Gieco
Since these were imported into SQL they all have a unique ID, here are the current labels
We've recently upgraded to SQL Server 2014, and are now using SSIS integrated with Visual Studio. We have a SSIS project which contains about 20 packages which are nested in Sequence Containers and executed concurrently. These packages have been set up as project references.
The problem is that when I press the start button to run the packages, they all light up green reporting completion before the data has finished loading into the SQL database. If I press the stop button without waiting a sufficient length of time, then not all of the data gets loaded. i.e. a certain number of rows will be missing from some of the SQL tables.
If I click through to the individual package items and check the data flow progress while running, some of the data flows appear to hang at a certain number of rows without ever reaching completion. The number of rows indicated in the data flow is incorrect - i.e. it will count up to ~150,000 and stay there indefinitely in the running state, when in actual fact there are ~500,000 rows to load.
To clarify, the main package will show all items green and display the "Finished: Success" message in the log window, however when I drill through to certain packages in the set, they'll be stuck in the yellow running state, with no way of knowing whether they've actually completed or not.
My current workaround is to just wait a certain length of time before pressing the stop button. This bug doesn't seem to inhibit rows being loaded - it just incorrectly identifies the point when the load finishes, causing people to terminate the load prematurely.
This issue only occurs if I run the project from the main package container. If I execute the child packages individually, they correctly report the number of rows being loaded and light up green once complete.
I am getting an error in Replication between SQL Server 2005 and SQL Express when "Connecting to Subscriber". Detailed error message is given below. Do we need to increase the logintimeout for "Connecting to Subscriber". How can we increase it?
Message 2007-10-15 06:37:58.398 Startup Delay: 8503 (msecs) 2007-10-15 06:38:06.898 Connecting to Distributor 'ACR-MANGO' 2007-10-15 06:38:06.976 Initializing 2007-10-15 06:38:06.976 Parameter values obtained from agent profile: -bcpbatchsize 2147473647 -commitbatchsize 100 -commitbatchthreshold 1000 -historyverboselevel 1 -keepalivemessageinterval 300 -logintimeout 15 -maxbcpthreads 1 -maxdeliveredtransactions 0 -pollinginterval 5000 -querytimeout 1800 -skiperrors -transactionsperhistory 100 2007-10-15 06:38:06.991 Connecting to Subscriber 'ACR-ANJILISQLEXPRESS' 2007-10-15 06:38:46.133 Agent message code 20084. The process could not connect to Subscriber 'ACR-ANJILISQLEXPRESS'. 2007-10-15 06:38:46.148 Category:NULL Source: Microsoft SQL Native Client Number: 08001 Message: Unable to complete login process due to delay in opening server connection 2007-10-15 06:38:46.148 The agent failed with a 'Retry' status. Try to run the agent at a later time.
Any list of commands that require exclusive access in order for the command to complete? I had an instance today where a DBA executed sp_changedbowner command which is the alter database command on a production database and it locked it up.
WHERE (dbo.document.docVisible = 'yes') AND (dbo.document.docHide = 'NO') AND (dbo.t_files.fileMoved = '1') AND (dbo.documentCategory.docCategoryName LIKE '%olic%') AND (dbo.minisite.sectionLive = 1) AND (dbo.t_files.fileName <> N'A LINK') AND (dbo.t_files.fileName NOT IN (SELECT exFileID FROM t_exclude)) OR (dbo.document.docVisible = 'yes') AND (dbo.document.docHide = 'NO') AND (dbo.t_files.fileMoved = '1') AND (dbo.minisite.sectionLive = 1) AND (dbo.t_files.fileName <> N'A LINK') AND (dbo.t_files.fileName NOT IN (SELECT exFileID FROM t_exclude)) AND (dbo.document.docDesc LIKE '%olic%') OR(dbo.document.docVisible = 'yes') AND (dbo.document.docHide = 'NO') AND (dbo.t_files.fileMoved = '1') AND (dbo.minisite.sectionLive = 1) AND (dbo.t_files.fileName <> N'A LINK') AND (dbo.t_files.fileName NOT IN (SELECT exFileID FROM t_exclude)) AND (dbo.document.docType BETWEEN 1 AND 4) OR (dbo.document.docVisible = 'yes') AND (dbo.document.docHide = 'NO') AND (dbo.t_files.fileMoved = '1') AND (dbo.minisite.sectionLive = 1) AND (dbo.t_files.fileName <> N'A LINK') AND (dbo.t_files.fileName NOT IN (SELECT exFileID FROM t_exclude)) OR(dbo.t_files.fileName IN ('127-2006-1-27-3321130.pdf', '127-2006-1-30-3726619.pdf', '127-2006-1-27-5700042.pdf', '127-2006-1-27-5678586.pdf', '127-2006-1-27-5693574.pdf', '127-2006-1-27-5873392.pdf')) ORDER BY dbo.document.docDesc
Right - as you can see, some of the line slook pretty similar. When I try and do:
(one AND two AND three) AND (four OR five), I get
(one AND two AND three AND four) OR (one AND two AND three AND five)
when using enterprise manager. Is there anyway to keep the first way of doing it. Otherwise, everytime I add anotehr OR statement in, I'll have to create a new line!
I had received a message that my log file is full and it do not enable to me to do a database backup before free up disk space. How do i clean up de log file (_log.ldf)?
I have the following query which strips out middle initial data from the first_name column and populate the middle_initial column with the relevant data.
What my query does not handle is when a first name has a single character (IE: A). In its current state, the "A" would be moved to the middle_initial field with a period added to the end (IE A.). The first_name column would also include "A". Basically, when a single character first name is found in the first_name column, I do not want to populate the middle_name field.
Hope this does not sound too cryptic; query is below along with some sample data when run.
SELECT first_name, CASE WHEN SUBSTRING(LTRIM(RTRIM(first_name)),LEN(LTRIM(RTRIM(first_name)))-1,1)=' ' THEN SUBSTRING(LTRIM(RTRIM(first_name)),LEN(LTRIM(RTRIM(first_name))),1) +'.' ELSE NULL END AS 'middle_initial', CASE WHEN SUBSTRING(LTRIM(RTRIM(first_name)),LEN(LTRIM(RTRIM(first_name)))-1,1)=' ' THEN LEFT(LTRIM(RTRIM(first_name)),CASE WHEN LEN(LTRIM(RTRIM(first_name)))>=2 THEN LEN(LTRIM(RTRIM(first_name)))-2 ELSE LEN(LTRIM(RTRIM(first_name))) END) ELSE LTRIM(RTRIM(first_name)) END AS 'first_name_removing_initials' FROM contact
Sample Data first_name, middle_initial, first_name_removing_initials, Paul, NULL, Paul A, A., A, A Fred, NULL, A Fred, Aaron, NULL, Aaron
I have a db server that had served both my application data and reporting services. I have since installed a second db server to be the reporting services server; the primary box still stores the application data. I am keeping reporting services installed and set up on the primary box, since I would like it to act as a warm standby for the reporting services function.
However, the ReportServerTempDB on my primary box is still quite large. The ChunkData table is quite close to 10 gig. The CleanupCycleMinutes property is set to the default of 10. Clearly any data that might be in this table is far older than that.
Is there some recommended method of clearing this data? Can I just delete the rows or do a truncate on the table? I would prefer not to uninstall/reinstall reporting services, as this machine is actively serving my application data.
Hi everyone, What is the easy way to clean up all ms sql 2005 tables? For example, a database table named Customers which has triggers and primary key and foreign keys. Now I clean up the Customer table using the folowing statement delete Customers And the ms sql 2005 asks me to remove all triggers and foreign keys before allow me to clean up the Customers table. Is there a way to clean up all tables without remove the tiggers and foreign keys? Thanks May
Hi, I need some advise in the log shipping. The log files in the primary server get cleaned up according to what I have specified in the maintenance plan. But the log files that got shipped to the secondary server stay there for ever wasting my hard disc. Will it make any problem if I remove them or can I set it up to remove all files earlier than past 2 hrs? Please advise. Thanks