DB Engine :: Create Read-only Database From Production And Restore On Different Server
Jun 4, 2015
We have a production 2012 R2 SQL server that is not part of a domain. I have a database called CSSDC. I need to backup this database and make the BAK file available to a user on a different SQL server. Security is a concern. In order for this user to restore the database, they will have to be in the fixed server role sysadmins. I know I am going to have to use the Move with replace for the filegroups for the restore. Once the database is restored it will have to be altered to read-only. I would also like to remove the existing security and only have this new user access the read-only database.
View 4 Replies
ADVERTISEMENT
Jun 19, 2015
I'm trying to grant a read-only permission in sql 2014 after a restore and I wanted to find out what it is in SQL 20114?
View 4 Replies
View Related
Jul 20, 2015
I am using SQL Server Management Studio 12 to try to restore a backup to a new database. I know I have done this before, but cannot seem to make it happen now. Her is what I have.
Backup file is "C:TempInProcessInspection_DataSQL_backup_2015_02_23_000012_4551393.bak" and it is for sure there.
This came from a customer of mine.I launch SQL Server Management Studio 12 and log in as SA. I right click on Databases and chose Restore Database. I choose Device then file then Add and try to browse the the named location.
When I get there, regardless if I choose All files or Bak, I see no files.I tried to upload an image of the "Upload Backup File" dialog, but MSDN would let it happen. When I get to the c:temp folder, no files appear in the window.
View 30 Replies
View Related
Jul 23, 2005
I have a production database with a backup job that creates files with thenaming convention dbname_db_200503291800.bak. I want to schedule a restorejob that will retire yesterdays backup. How can I write my restore statementso that it will specify the backup file with yesterdays date.Thanks
View 1 Replies
View Related
Oct 6, 2015
Is it possible to create a database which design or data is not needed to update and i want to set to it as a READ ONLY. what are the steps to create such type of database?
View 3 Replies
View Related
Nov 30, 2005
Dear friends,
View 3 Replies
View Related
Jan 10, 2008
Hello, everyone:
I have two questions about database restorsation.
1. From Enterprise Manager, I can choose Read-only model (able to install another transaction log). How to execute same model restore by T-SQL? This script is used by Loading model:
RESTORE DATABASE MyNwind
FROM MyNwind_1
WITH NORECOVERY,
MOVE 'MyNwind' TO 'c:Program FilesMicrosoft SQL ServerMSSQLDataNewNwind.mdf',
MOVE 'MyNwindLog1' TO 'c:Program FilesMicrosoft SQL ServerMSSQLDataNewNwind.ldf'
RESTORE LOG MyNwind
FROM MyNwindLog1
WITH NORECOVERY
2. If a database is in Read-only Warm Stand-by because restore trans log files, how to turn of read-only model?
Thanks
ZYT
View 2 Replies
View Related
May 9, 2012
I'm taking a database(read-only) backup from one server and restoring it on other server. As soon as restore is done it is bringing database into single-user read-only mode.
why it is bringing the database into single user mode ?
View 1 Replies
View Related
Jun 25, 2015
One of our database came to Restoring mode. I suddenly stop my SQL service and Copied only MDF files again Started SQL service ,unexpectedly i dropped the Database. Now i cant able to attach the database only with my MDF file.
I tried below Scripts. All scripts shows same error.
EXEC sp_attach_single_file_db @dbname='PhoenixPolice',
@physname=N'C:Program FilesMicrosoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLPhoenixPolice.mdf'
GO
CREATE DATABASE PhoenixPolice ON
(NAME = N'PhoenixPolice',
FILENAME = N'C:Program FilesMicrosoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLPhoenixPolice.mdf')
FOR ATTACH_REBUILD_LOG
GO
CREATE DATABASE phoenixPolice ON (FILENAME = N'C:Program FilesMicrosoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLPhoenixPolice.mdf')
FOR ATTACH
All scripts shows below error
File activation failure. The physical file name "F:Microsoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLDATAPhoenixPolice_1.ldf" may be incorrect.
The log cannot be rebuilt because there were open transactions/users when the database was shutdown, no checkpoint occurred to the database, or the database was read-only. This error could occur if the transaction log file was manually deleted or lost due to a hardware or environment failure.
Msg 1813, Level 16, State 2, Line 1
Could not open new database 'PhoenixPolice'. CREATE DATABASE is aborted.
View 4 Replies
View Related
Oct 5, 2015
Our application team make design changes of the database in their development server and asks me to restore the bak file from the development server into the production server with replace command. The database in the production server is connected to the application server and so when I try to restore the database error message comes that the database is in use.
So first I find out the sessions with the logins who is the user in the database with sys.dm_exec_sessions joined with sys.dm_exec_requests and then kill the sessions. And after that it is possible to restore. But many times when I kill the session and try to restore in between new sessions comes into effect which are generated from the web server and many times I have to resubmit the query in the dmv's and find the sessions and kill it again and again before restore can be done. Is there any correct method to restore an active database which is being accessed by the application from a web server with out stopping the web server?
View 6 Replies
View Related
Apr 29, 2015
What I want to do is :
- restore a backup of a 3rd party database onto one of our servers
- this has no users that I can use
- there is some ETL processing so we're using Control-M to manage the process
- create a database user and grant it db_reader.
I'd like to do this without granting any users elevated privileges if possible.
What I've done so far is grant the Control-M user (this is a domain user) dbcreator rights and made it owner of our copy of the database that is being refreshed.
The refresh is completing, but Control-M is not able to log onto the database to create the user.
What is the best way to accomplish this task without granting the control-m user sysadmin rights?
Would I be able to do it if I used a SQL Agent job for the restore and user creation?
View 1 Replies
View Related
Aug 10, 2007
Howdy;
I've tried this in the 'tools' area, but that didn't work too well. I suspect, I will have to generate a T-SQL code then schedule it as a job. Why I can't just drag and drop with basic desires, is beyond me, but THAT probably does exist.
anyway here is the problem
[this server has many databases, on SQL 2000 sp2]
1. User only wants me to use Monday morning's full backup, which is good in that it doesn't include transaction logs.
2. Restore that data overtop/into Developement db. = good, no data to worry about damaging.
3. User does NOT want me to do this by hand, but schedule it.
ok,
a. must do a RESTORE WITH FILELISTONLY from [?] what ?, master? and if I user the *.bak of the production, it has
a coded date field in the name entry SO, I would, I guess, have to generate all sorts of wonderful code to find the date and build a file name. Why, because using the FROM DISK = 'F:MSSQLBACKUPDBPRODUCTION_yyyyddmm.BAK' is not going to work with a wild card.
Can I do a file lookup using a 'PRODUCTION' prefix into a variable, then use that or should I look for latest file date [remember there are several database backups here], or ????
then. How does one schedule such a T-SQL. Do I save it to some text file, and invoke it using a job scheduler.
any help appreciated.
IS there an easier way.
rik
View 5 Replies
View Related
Oct 18, 2015
way to read data from database already stored as question marks .that because by mistake i insert the data "arabic" from the VS as sqltext but the field in the database is nvarchar now i want to get the data back.
View 4 Replies
View Related
Jan 12, 2012
i attached adventure works in sql server 2008 and it showing as read only ,make it read write or remove read only tag from database.
View 11 Replies
View Related
Aug 6, 2015
i have .bak file downloaded from internet , and i also have istalled sql server 2012.my problem that i can not restore this .bak file and get this error massage :
System.Data.SqlClient.SqlError: The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'C:Program FilesMicrosoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLDATASRO_VT_SHARD.mdf'. (Microsoft.SqlServer.SmoExtended)
- .bak file version = 661 10 50 1600 = sql server 2008R
- my sql version = Microsoft SQL Server 2012 - 11.0.2100.60 (Intel X86)
View 4 Replies
View Related
May 12, 2015
I have 5 TB of data in production and my development team requested to restore only last month data(<=500 MB ) in staging server and last 2 months data in pre production.
View 3 Replies
View Related
Jul 8, 2015
I am working on a project for an SQL job. I am:
1.) Taking a database out of an availability group,
2.) Setting the recovery to simple,
3.) Shrinking the log file,
4.) Setting the recovery mode back to full,
5.) Then backing it up.
I need to restore the file to my secondary server with replace and non recovery mode. I am having trouble performing that call? I have the code to reestablish the database to the availability group if I can get the restore feature working.
View 11 Replies
View Related
Jun 30, 2004
Can somebody please tell me how to go about creating a backup file of a MS SQL database, then import it into another server?
View 2 Replies
View Related
Aug 20, 2004
I have a Database A in production with 12GB as data file and 8 GB as log file. How do I restore this db in Development with a smaller log file, say 1GB?
I can't shrink the log file or anything in production. What is the best way to restore in Dev with a smaller log file?
Thanks.
View 4 Replies
View Related
Feb 25, 2006
Hi,
Is there any tool available to migrate the data from the SQL Server test database to SQL Server production database. Data Migration should be based on a condition which can be given as an input for a table by the user. The dependant tables also should be migrated based on the given condition. i.e data subsetting based on the matching conditions.
Ex : Salary > 2000
The rows of the table which matches the condition alone need to be migrated for the corresponding table. Also its dependant table's rows should be migrated based on the given condition. Please help me with a tool which can automate this.
Thanks,
MiraJ
View 4 Replies
View Related
Sep 18, 2001
There is a database located at remote location we wanted the same on the local server..so we backed it up then restored the same on the local server everything went successfull.
When i tried to create user it says the user is already existing, but nither can i see the user nor drop the one..(ofcourse not existing) it gives me an error 15023.
The other problem is that when i check the storedprocedures i can see and open them when i try to look for permissions or assign it by clicking permissions tab it says the specific stored procedure doesnot exist and gives me a sql-dmo error 21770.
I donno what do..help would be appreciated.
Mark
View 1 Replies
View Related
Aug 6, 2007
Hi all,
I have a site which used a SQL Express database. On my development machine, it works perfectly. As soon as I move it to the production machine, it doesn't work at all. I am pretty confused by what is going on and I really don't want to install Visual Studio on my production machine just to debug it. I am hoping someone might have an idea what could be happening.
Oh, and I have tried setting Everyone to Full Control on the App_Data directory just to test. Still breaks. Below is my web.config connection string:
<connectionStrings> <add name="database_sqlexpress" connectionString="Data Source=.SQLEXPRESS; AttachDbFilename=|DataDirectory|MyDatabase.mdf; integrated security=true; user instance=true"/></connectionStrings>
View 2 Replies
View Related
Feb 25, 2006
Hi,
Is there any tool available to migrate the data from the SQL Server
test database to SQL Server production database. Data Migration should
be based on a condition which can be given as an input for a table by
the user. The dependant tables also should be migrated based on the
condition. i.e data subsetting based on the matching conditions.
Ex : Salary > 2000
The rows of the table which matches the condition alone need to be
migrated for the corresponding table. Also its dependant table's
rows should be migrated based on the given condition. Please help me
with a tool which can automate this.
Thanks,
Smitha
View 5 Replies
View Related
May 29, 2007
I have a 20 GB SS2005 database that I would like to be replicated to a dev server for testing purposes. I might have some issues with the firewall blocking ports. I haven't read up on the specifics of how log shipping works yet, but I assume that is the best approach. A daily transfer would suffice.
A few options I am considering:
1. use the built in stuff, but I'm not sure it will work with our security settings, and if the trans logs are large it might be strained.
2. writing a small custom app to zip up the log file then ftp them down to the dev server. This could run nightly.
3. some third party util, such as FolderShare could transfer the log files
Any comments or suggestions?
View 4 Replies
View Related
Sep 19, 2015
I actually am just looking for some supporting documentation on some facets of SQL Server.As far as I have always known, when anyone does a READ from a SQL Server database (SELCT * from <TABLE>), SQL Server does not create a log record...since there's no data or database structure being modified. A colleague is under the impression READ's are logged operations.
View 5 Replies
View Related
Apr 7, 2015
How can I create a SQL authentication account with read-write access to only 1 table in a SQL database.
View 1 Replies
View Related
Feb 11, 2008
I have a windows forms application that I would like to put in production on several machines. Each machine will contain it's own data and does not need to be networked.
I can use my local connection right now to access the data, but I would like to change my connection so that it will work when installed on a client's machine.
My Current connection string looks like this:
Data Source=.SQLEXPRESS;AttachDbFilename="C:Documents and SettingsMYNAMEMy DocumentsVisual Studio 2005ProjectsInterimApplicationInterimApplicationInterim.mdf";Integrated Security=True;User Instance=True
I believe I could use something like this:
Dim connectionString as string = "Data Source=" & Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) & "/InterimApplication/data/Interim.mdf;Integrated Security=True;User Instance=True"
However, I am not sure. Also, if the client does not install to the default directory, then this may cause the application to not work properly.
Lastly, I am not sure if the client machine needs any additional software on their computer in order for the application to be capable of connecting to the data source.
Any recommendations, ideas, comments, or general help is greatly appreciated.
View 5 Replies
View Related
Jun 30, 2015
I was hoping for some information regarding table triggers. We have databases that are part of an AlwaysOn availability group on SQL Server 2012. Some of the tables have table triggers defined. There are both types of triggers, INSTEAD OF and AFTER INSERT, etc.
From my understanding of how secondary read-only replicas work, I am assuming that these triggers have no impact at all when the database is a read-only secondary replica and they only fire when the database is the primary read-write database.
However, after doing a search on the internet, I have not been able to find a definitive source of information.
View 3 Replies
View Related
Nov 9, 2006
Hi
Can we use BCP AND/OR BULK INSERT to do development server databse refresh from production server . I have to do this by following the rules below:
- no truncation of source table
- update of changed or new records only.
I know we can use replication, dts and other methods for this but I need information about this one.
Thanks
View 1 Replies
View Related
Jun 4, 2015
I have to disable newly implemented database encryption. It's a necessity unfortunately. Can I do this during production hours without much of a hit? I know I have to restart the instance after it's done. Can I expect performance impacts or other issues?
View 1 Replies
View Related
Sep 16, 2005
Can someone at Microsoft comment on this article, specifically, how it relates to SQL Replication? Will SQL Replication fall into the category of what this article describes, or only the mirroring feature?
View 1 Replies
View Related
Jan 18, 2008
I have two database files, one .mdf and one .ndf. The creator of these files has marked them readonly. I want to "attach" these files to a new database, but cannot do so because they are read-only. I get this message:
Server: Msg 3415, Level 16, State 2, Line 1
Database 'TestSprintLD2' is read-only or has read-only files and must be made writable before it can be upgraded.
What command(s) are needed to make these files read_write?
thanks
View 7 Replies
View Related
Sep 13, 2007
Hi,I have transactional replication set up on on of our MS SQL 2000 (SP4)Std Edition database serverBecause of an unfortunate scenario, I had to restore one of thepublication databases. I scripted the replication module and droppedthe publication first. Then did a full restore.When I try to set up the replication thru the script, it created thepublication with the following error messageServer: Msg 2714, Level 16, State 5, Procedure SYNC_FCR ToGPRPTS_GL00100, Line 1There is already an object named 'SYNC_FCR To GPRPTS_GL00100' in thedatabase.It seems the previous replication has set up these system viewsSYNC_FCR To GPRPTS_GL00100. And I have tried dropping the replicationmodule again to see if it drops the views but it didn't.The replication fails with some wired error & complains about thisviews when I try to run the synch..I even tried running the sp_removedbreplication to drop thereplication module, but the views do not seem to disappear.My question is how do I remove these system views or how do I make thereplication work without using these views or create new views.. Whyis this creating those system views in the first place?I would appreciate if anyone can help me fix this issue. Please feelfree to let me know if any additional information or scripts needed.Thanks in advance..Regards,Aravin Rajendra.
View 2 Replies
View Related