I have a slow query. It is indexed and I was wondering if there were any issues with using 'dbcc dbreindex' on each of the 12 replicas, to maybe make it run more efficiently? And is this something I could/should do nightly?
I have 2 SQL Server replicas configured on SQL Server 2012 AlwaysOn. e.g. SQL1 & SQL2.
I have configured backup job on both SQL Server with the following statement. and the job occurs every 10 minutes.
•declare @DBNAME sysname,@sqlstr varchar(500) set @DBNAME = 'dba' IF (sys.fn_hadr_backup_is_preferred_replica(@DBNAME)=0) BEGIN --Select 'This is not the preferred replica, exiting with success';
[Code] ...
I turned off SQL2 for Windows maintenance. So there is only SQL1 is online. Afterwards. I checked the backup folder and didn't see any new backup files was created after SQL2 was offline. I rerun the job. It still doesn't backup database on the Primary Replica. Then I searched on SQL Server Book online. It says
Prefer Secondary
Specifies that backups should occur on a secondary replica except when the primary replica is the only replica online. In that case, the backup should occur on the primary replica. This is the default option.
According to what it says, it should backup on the Primary Replica.
We have an application with replicated environment setup on sql server 2012 . Users will have a replica on their machines and they will replicate to the master database. It has 3 subscriptions subscribed to the publications on the master db.
1) We set up a replica(which uses sql server 2012) on a machine with no sql server on it. After the initial synchronization(used replmerge tool) the mdf file has grown to 33gigs and ldf has grown to 41 gigs. I went to sql server management studion . Right click and checked the properties of the local database. over all size is around 84 gb with little empty free space available.
2) We set up a replica(which uses sql server 2012) on a machine with sql server 2008 on it. After the initial synchronization(used replmerge tool) the mdf file has grown to 49 gigs and ldf has grown to 41 gigs. I went to sql server management studio , Right click and checked the properties of the local database. over all size is around 90 gb with 16 gb free space available.
3) We set up a replica(which uses sql server 2012) on a machine with sql server 2012 on it. We have dropped the local database and recreated the local db and did the initial synchronization using replmerge tool. The mdf file has grown to 49 gigs and ldf has grown to 41 gigs. I went to sql server management studio , Right click and checked the properties of the local database. over all size is around 90 gb with 16 gb free space available.
Why it is allocating the space differently? This is effecting our initial replica set up times.
please explain the differences btween this logical & phisicall operations that we can see therir graphical icons in execution plan tab in Management Studio
I need a stored procedure that can drop and recreate any table in a DB.
How could I find out all information pertinent to a table and able to generate the create statement dynamically in the preocedure then drop it and recreate the table.
I want to drop table and then recreate. It's referenced by many table and I dont want to drop all constraints referencing to it. Is there any feature like "switch off/on constraints" in MSSQL?(6.5)
Does anyone know how to recreate a database from a log file? Here is the situation:
I had a server go bad. The drive configuration was as follows
Server OS on separate RAID controller - RAID Level 1 SQL Data on separate RAID controller - RAID Level 5 Transaction Logs on Separate Raid Controller - RAID Level 1
I lost the RAID 5 array and can't get it back and don't have a backup. I need to know if/how I can recreate the database from the log file. The log file has been set to grow and has never been purged so I am hoping that I can recreate the database from scratch. Is this possible?
Dear All, after searching continuously for removing the suspect mode of MSDB database, i've found a great article in net.but i dont understand how to proceed. please explain me the steps....
1.Detach the damaged msdb. You can't just detach msdb because you're not allowed to detach system databases. However, you can if you start the server with trace flag 3608. I did this by shutting down the server, navigating to the directory 'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLBinn' and doing the following: start sqlservr.exe -c -T3608 2.Move or rename the damaged msdb files (msdbdata.mdf and msdblog.ldf in the 'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLData' directory) 3.Run the instmsdb.sql script in the 'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLInstall' directory 4.Shutdown and restart the server without the 3608 trace flag
Vinod Even you learn 1%, Learn it with 100% confidence.
I want to create a clean copy of my DB now that it is done. So it can be moved to another Server. It has some sample data in some tables that I would like to keep and some in other table that I don't. How can I do this?
I need to drop and recreate few subscriptions in transactional publication Do I need to worry about log marker issues ? Do I need to set the primary and replicate databases in 'DBO use only'
The Primary and Replicate databases are being accessed all the time.
Due to a server move of our SQL databases something 'strange' happend: one of the login accounts disappeared.
When I try to recreate it, SQL gives me back an error stating the account already exists. Read something about loginaccounts becoming orphaned but don't know how to solve it. The login account is a Windows (AD) account and not a SQL account (both requiring different methods of fixing?). How can I recreate just this single account?
I am trying to recreate a MySQL database on a new domain. The original database was exported into about 40 .SQL text files. I am importing these .SQL text files into a new database using phpmyadmin. When I attempt to import the first of these files, I get a "fatal error". It says the upload time has exceeded the 300 second limit. How do I set up the server so there is no upload time limit? Or how would you approach a solution to this problem? There are about 40 of these text files and each file varies in size between 5 and 15mb. Is it possible to split individual files in half or 3 parts and import that way? Any help would be greatly appreciated. Thanks!!
Can anyone help with how to recreate a pull subscription replication job after I had to recreate the msdb database when it was marked as suspect. I still have the subscription but cannot seem to recreate a pull replication job
Hi!I need to recreate the system tables (sysobjects, syscolumns,sysindexes, sysforeignkeys, sysconstraints, sysreferences, sysindexkeysat least) in another SQL server.You may say "Thats easy! Backup and restore the database!" and I wouldanswer "I can't, the database size is above 50GB and I just can't do itevery time I need to recreate the info".So, ¿Do you know any simple way to do these?I don't need the data on the user tables and I'll log-in always as dbo(using trusted connection), perhaps that helps.Perhaps the simplest way is to do a bcp to backup and restore the databut.... you never know what would happen. This is why I write ask youguy, probably you know much more than me.Thanks in advance
i have a used database publishing wizard to create a sql fiel of a databse i wish to transfer to server running sql server management studio express on a server 2005 , what do i need to do to recreate my databse from the sql file. many thanks
A customer on SQL7 has a 40GB tempdb (which is usually 2-5GB) which has filled the drive. ShrinkDb/ShrinkFile do nothing as the db has only 2GB of free space. How can I truncate the data or blitz tempdb and create a new (2-5GB) one (Stopping the server, deleteing the .mdf, starting the server creates a new tempdb with the same size as the old one!)
I need to remove log segment of one database from current position to another drive. The current log segment is used by two databases. This was created by mistake. Now we need to fix the problem and create another log segment for the other database. If we keep the log setment as is, we will have problems deleting one of the databases in the future.
I have come across a user that has error 2525 errors on sysobjects tables throughout their SQL 6.5 system. The ids match and I can identify the index. But as they are system tables I cannot drop or rebuild the indexes.
Any ideas please?
The errors have been occuring for some time, so it is not an option to restore. I would like to avoid having to transfer data to and from another SQL Server.
I am looking for a script to recreate scheduled jobs on new SQL Servers that I build. I am hoping to find one that will pull information from the system tables for the name of the server and the names of the databases so that it does not have to be extensively modified for each new server.
I have different versions of essentially the same database on two different computers. From Computer B I need to copy one table AND its data to Computer A.
I've read several articles and have tried several things but can't figure out how to do it. Incidentally, I'm running SQL Server Express 2005 on both machines.
I'm having a heck of a time trying to upload data to an excel spreadsheet. This works perfectly in sql 2000 but I've been having problems with 2005
SSIS package "Package1.dtsx" starting. Error: 0xC002F210 at Drop table(s) SQL Task, Execute SQL Task: Executing the query "drop table `GRE` " failed with the following error: "Table 'xxx' does not exist.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. Task failed: Drop table(s) SQL Task Error: 0xC002F210 at Preparation SQL Task, Execute SQL Task: Executing the query "CREATE TABLE `xxx` ( `TEST_REC_NBR` Decimal(29,0), `PROCESS_DT_GRE` LongText ) " failed with the following error: "Invalid precision for decimal data type.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. Task failed: Preparation SQL Task SSIS package "Package1.dtsx" finished: Failure.
We have a big concern in our Database system. We have 2000 transactions daily in our database. We need to replicate some how the database for our fail over setup. I tried transactional replication at midnight but our all systems locked and we had a lot of complaints from the customers and It was taking a lot of time to snapshot part and I had to abort it because of these reasons. I need an advice how I can create a replication or is there any other way to replicate or is there any way to do this process without bothering the system? Please give me some advice and help..
Hello, I need to retrieve all the information about all the foreign key constraints,inorder to store them temporarily (to be deleted later)and then recreated after making the necessary modifications to the concerned tables. The stored proc sp_helpconstraint shows all the constraint types, their user-defined or system-supplied name, the columns on which they have been defined, and the expression that defines them.But I don't know whether it can be manipulated to get what I want.I need to get it done programmatically..so that I can integrate it in my program which I'm building up progressively. Any help or scripts would be appreciated!
Hi i want to create a test environment for a system, therefore i need an exact replica of the database that is currently standing, how can i go about doing this, i am using SQL enterprise manager 2000, thank you.
in my secondary server the database which is in restoring state , when i checked in always on dash board "This secondary database is not joined to the availability group" ,
I have two databases lets call them A & B, they reside in two PCs, each pC has its own C/C++ program working with A or B, Two PCs are linked by PPP (for example), but the link is not permonent available, the link is only available at certain time period, for example, at midnight.and the link is only last certain period, during this period, A & B will do the transcation replica( just heard about that!) to make them identical, A=B.
Now are my questions.
(1) Can database use dial up modem itself ? For PC program it is not the problem, but I am not sure whether MS SQL server database can be configured to do such job automatically ?
(2) Can database have awareness of whether the link is available or not ? For example A is dialing modem, and B realize that there is a incoming call.
(3) Once link is established, how two databases start to do the transcation replica ? Does SQL server has such ability to do this automatically ?
(4) Can database notice PC program that changes has occured ? so PC program can process it, see display new data.
I have found an (encrypted) SP which takes ~20 seconds to run on one of our client DBs.
If I drop and recreate (or alter) the SP giving it the same contents it will run in ~1 second.
I need to know 1. why the sp started running so slowly 2. how to stop it happening again 3. how to fix it without resorting to drop/recreate (I can't exactly write a batch script to recreate all our sps every so often)
I have tried sp_updatestats and sp_recompile before running the sp to no avail...