Recreate Index On Replica

Jan 30, 2006

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?

View 1 Replies


ADVERTISEMENT

SQL 2012 :: Backup On Primary Replica In Case Of Secondary Replica Is Down

Jun 9, 2014

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.

View 2 Replies View Related

SQL 2012 :: Existing Replica MDF File Size Increased In Size Than New Replica Install

Apr 14, 2015

Here are my scenarios:

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.

View 0 Replies View Related

Difference Between Index Seek && Index Scan && Index Lookup Operations?

Oct 20, 2006

please explain the differences btween this logical & phisicall operations that we can see therir graphical icons in execution plan tab in Management Studio

thank you in advance

View 3 Replies View Related

Recreate Any Tables

Jan 13, 2003

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.

Thank you and please help.

View 10 Replies View Related

Table Recreate

Dec 3, 1998

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)

View 1 Replies View Related

Recreate From Log Files

Feb 13, 2004

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?

View 3 Replies View Related

Msdb Recreate

Dec 19, 2007

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.

View 6 Replies View Related

How To Recreate A Blank Copy Of Dbs

Apr 16, 2007

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?

View 1 Replies View Related

Recreate The Repl_publisher Login?

Apr 26, 2000

Hi!

I have lost the repl_publisher login.
Is it possible to recreate it in any way?
What about the password?

Thanks
Håkan

View 1 Replies View Related

Drop And Recreate Subscription

Feb 16, 2004

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.

View 1 Replies View Related

Missing Loginaccount: Can Not Recreate

May 15, 2008

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?

Any help would be greatly appreciated!!!

P.

View 7 Replies View Related

Recreate A MySql Database

Nov 17, 2005

Hello

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!!

View 1 Replies View Related

Recreate A Pull Subscription Job

Feb 22, 2008

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

View 1 Replies View Related

Recreate System Tables

Jul 28, 2005

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

View 9 Replies View Related

Use A SQL Script File To Recreate A Database

Mar 6, 2008

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 
 

View 4 Replies View Related

How Do I Shrink/recreate/truncate Tempdb

Apr 17, 2002

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!)

View 2 Replies View Related

Easiest Way To Recreate Jobs Between Servers

Aug 27, 1999

Hi!

What is the easiest way to recreate jobs running on one server on another server?

Thank you

Praveena

View 2 Replies View Related

Delete/recreate Or Move Log Device

Apr 9, 1999

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.

Thanks for your help,
Ana.

View 1 Replies View Related

How Do I Drop And Recreate System Indexes

Jul 15, 1998

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.

Many Thanks

View 6 Replies View Related

Script To Recreate Scheduled Jobs

Feb 17, 2004

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.

View 4 Replies View Related

How To Recreate A Table And Copy Its Data Too?

Sep 13, 2007

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.

Robert Werner
Vancouver, BC

View 3 Replies View Related

Drop And Recreate Excel Table

May 30, 2006

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.

View 13 Replies View Related

Drop And Recreate Views In Mssql Server

Feb 21, 2005

hi,
how can i drop views and recreate again?
thinks ...

View 2 Replies View Related

Tool That Create Sql Script To Recreate A Database

Jul 20, 2005

I need a tool that creates a script to recreate a db, including tables' data.Does it exists freeware ?thanks!

View 2 Replies View Related

Need Emergency Help For Replica

May 9, 2006

Dear All,

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..

View 1 Replies View Related

How To Retrieve All Information Abt All Constraints Inorder To Drop And Recreate Them

May 25, 2004

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!

View 8 Replies View Related

Creating A Replica Of A SQL Database.

Jan 18, 2008

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.

View 2 Replies View Related

SQL 2012 :: Secondary Replica In AG

May 27, 2015

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" ,

View 3 Replies View Related

How Many Databases Can Add In AlwaysOn Replica

May 14, 2015

is there any limition in AlwayOn to add database in secondary replica?

View 2 Replies View Related

How To Do The Database Transcation Replica ?

Feb 5, 2008

Hi,

I am new to SQL server.

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.

Thanks

nick

View 1 Replies View Related

Recovery :: Replica Server Not Available

Aug 11, 2015

I'm new to Sql Server and want to install SQL server alwayson clustering on my test environment. I followed the steps by this site: [URL] ....

On each node I can connect to SQL Server but why my 2nd node is not available so that I can add it as my 2ndary Replica?

According to this site, till "Always-On Availability Group Configuration" everything was successful.

View 6 Replies View Related

Weird Problem: SP Executes Slowly, But Drop And Recreate Speeds It Up!

Feb 22, 2006

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...

anyone heard of a problem like this before?

cheers
H

View 11 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved