SQL 2012 :: Cannot Create Extra Tempdb Files Because They Already Exits

Feb 23, 2015

I was in the process of creating additional TempDB.ndf files, and received an error saying they already exist. I checked the location and it was empty, nothing to see here. So I looked in sys.master_files and there are several tempdb files listed in various locations, all of which come up empty.

So the files are listed as online in sys.master_files, but they do not exist on the server. I restarted SQL services but it did not change anything.

View 3 Replies


ADVERTISEMENT

Deleting Extra Tempdb Log And Data Files

Jul 20, 2005

We had someone create an extra data file and log file for tempdb. Sowe currently have two data files and two log files. Is it possible todelete the newly created data and log files? If I just delete thephysical files, I assume they'll get created as soon as SQL Servergets started back up. Any help would be great, since a single dataand log file for tempdb is my goal.Thanks much.sean

View 3 Replies View Related

SQL 2012 :: TempDB Data And Log Files On One SSD?

Mar 3, 2015

I'm having an argument with our infrastructure architect who has just gone and bought lots of SSD drives to use for our tempdb data and log files, sounds great doesn't it? There is a catch though, his plan is to add the disks to the two available slots in each blade in a RAID0+1 configuration, effectively giving you one usable drive, and adding both data and log files on to one disk.

I then pointed out that SQL Server best practice is to host tempdb data and log files on two separate drive to reduce contention. The architect then basically said that because this isn't spinning disk the issue of drive, r/w contention isn't an issue I don't agree with this and wanted to get some opinions from the community, I'm still advising that two separate disks should be used but someone just went and spent £80k ($150k) on SSDs and doesn't want to back down...

View 4 Replies View Related

SQL 2012 :: Splitting TempDB With Multiple Files?

May 21, 2015

So we have new servers that are going to be installed with SQL 2012 and I'm debating the wisdom of splitting tempdb with multiple files.

I know it's a myth that performance automatically improves if you split it into a number of files based on processors, but I'm debating the wisdom of putting a file on each of my data / log file drives.

For instance, I have a server with a C: drive (OS), D: drive (Data for system DBs and install of programs - 458 GB), an F: drive for user DB data files (767 GB), and a J: drive for log files (255 GB).

Obviously no files are going on C:. I'm debating on whether or not we should even leave system DBs on the D: drive given in our current 2k8 servers, we end up with Memory.dmp files over flowing the D: drives as well as .cabs and other install / update files that tend to collect on that drive over the years.

But if we leave the system DBs on D:, I'm wondering if adding a second tempdb file to F: and a third to J: will improve query performance or not.

View 9 Replies View Related

SQL 2012 :: Alerting When Tempdb Files Have X% Free Space?

Aug 13, 2014

I have a tempdb split into 4 files (5 if you include the log).

Autogrowth is disabled on the mdf/ndf files so that they can be used round robin (1 file per logical CPU).

Is there a way to be alerted when there is x% of free space left?

I know hwo to check the free space via t-sql but want to be able to be alerted. I could run a sql job that reports the free space and send a database mail message if under x% but wondered if there was a built in (or better) method?

I also have SQL Sentry.

SQL 2012 Standard

View 9 Replies View Related

SQL 2012 :: Create Database For TempDB On Startup

Aug 10, 2015

While trying to move the tempdb log file to a different disk, I mistakenly executed the following and then stopped and restarted SQL Server.

USE master
GO
ALTER DATABASE tempdb MODIFY FILE
(NAME = tempdev, FILENAME = 'L:MSSQL11.MSSQLSERVERMSSQLData emplog.ldf')
GO

Now I can't start SQL Server and see this error in the log files:

[code]

2015-08-10 15:28:42.55 spid7s Error: 5171, Severity: 16, State: 1.
2015-08-10 15:28:42.55 spid7s L:MSSQL11.MSSQLSERVERMSSQLData emplog.ldf is not a primary database file.
2015-08-10 15:28:42.55 spid7s Error: 1802, Severity: 16, State: 4.
2015-08-10 15:28:42.55 spid7s CREATE DATABASE failed.

Some file names listed could not be created. Check related errors.

[code]

I did not have remote connections enabled yet, so the resolutions I have found that include sqlcmd or starting in single user configuration are not working. Any way that might allow me to restore the usual tempdb settings, which I think would allow SQL to start again?

View 3 Replies View Related

SQL 2012 :: TEMPDB High Avg Write Wait Time On Data Files

Apr 15, 2014

I am currently investigating aa high avg write time ms issue (145ms) which seems to be only occuring on the tempdb data files.I have followed the recommended setup of TEMPDB in that

1. Data files = number of physical cores
2. Data files and logfiles are on separate partitions away from the other databases.
3. Tempdb is presized and no incremental file increases look like they are happening with frequency.

We have sharepoint 2012 setup on other sql servers and with TEMPDB setup following the same guidelines, with far more Sharepoint activity on a similary specified hardware which is why its confusing.FileIO auditing on the partitions themselves shows that the FileIO is very fast on the partitions that the tempdb data file which leads me to beleive that Sharepoint may be the culprit perhaps due to excess use of tempdb with operations taking a long time to resolve.

View 3 Replies View Related

SQL 2012 :: Create Script That Will Import Large XML Files?

Jul 28, 2014

I need to create script that will import large XML files (500 - 7GB) on a daily basis and store the data in a relational db structure.

What is the best and fastest way of importing such files. I have played around with smaller files and found the following.

1. SSIS XML Data Source: It doesn't seem to like the complex elements types and throws out the file.
2. Using Bulk File Import, sorting the file in XML variable and using XQuery to parse the file: This works but it can't take a file more than 2GB in size, so I can't use this method.
3. C# + XML Serialization: This also works, but seems to be terribly slow. I open the DB connection once, so it doesn't open and close for each db call, but still seems like it takes a long time.

how to import large XML quickly in a relational table structure?

View 9 Replies View Related

SQL Server Admin 2014 :: Separate Data Files / Log Files / TempDB / Backups

Jan 9, 2015

I proposed on a new server that we separate Data Files, Log Files, tempDB, Backups, etc. onto separate LUNS on a SAN with High Speed Solid State Drives.I was told that with the new technology with solid state SAN's that it would decrease performance and that it did not work the same way as it did when you had RAID 5's etc.I thought that if things were cared out correctly by a SAN Administrator they would know how to configure for optimal performance.

View 2 Replies View Related

Does RDA Create Extra Fields?

Nov 20, 2007

Hi!
I need to sync an application on windows mobile 5 that uses sql server mobile with sql server 2005. I've tried Merge and it populated the tables on the server with new fields and triggers. Does RDA do the same thing?

Jesus saves. But Gretzky slaps in the rebound.

View 4 Replies View Related

Create An Extra Table (for Audit Purpose)

Mar 28, 2008

Hi all, please help. I m trying to create an "empty" table from existing table for the audit trigger purpose.
For now, i am trying to create an empty audit table for every table in a database named "pubs", and it's seem won't work.
Please advise.. Thanks in advance.

Here is my code:


USE pubs

DECLARE @TABLE_NAME sysname
DECLARE @AUDIT_TABLE VARCHAR(50)

SELECT @TABLE_NAME= MIN(TABLE_NAME) FROM INFORMATION_SCHEMA.TABLES
WHERE
TABLE_TYPE= 'BASE TABLE'
AND TABLE_NAME NOT LIKE 'audit%'
AND TABLE_NAME!= 'sysdiagrams'
AND TABLE_NAME!= 'Audit'
AND TABLE_NAME = 'sales'

WHILE @TABLE_NAME IS NOT NULL
BEGIN

SELECT @TABLE_NAME= MIN(TABLE_NAME) FROM INFORMATION_SCHEMA.Tables
WHERE TABLE_NAME> @TABLE_NAME
AND TABLE_NAME = 'sales'

SELECT @AUDIT_TABLE = 'Audit'+''@TABLE_NAME''


SELECT * INTO @AUDIT_TABLE
FROM @TABLE_NAME

TRUNCATE TABLE @AUDIT_TABLE
ALTER TABLE @AUDIT_TABLE ADD UserAction Char(10),AuditStartTime Char(50),AuditUser Char(50)


SELECT @TABLE_NAME= MIN(TABLE_NAME) FROM INFORMATION_SCHEMA.Tables
WHERE TABLE_NAME> @TABLE_NAME
AND TABLE_TYPE= 'BASE TABLE'
AND TABLE_NAME!= 'sysdiagrams'
AND TABLE_NAME!= 'Audit'
AND TABLE_NAME NOT LIKE 'audit%'

END


Thanks. ..

View 3 Replies View Related

Adding Extra Steps To A Create User Wizard Asp.net (c#)

Feb 25, 2008

 Hi, Apologies in advance if you get confused by reading this.... I am trying to create an additional step in the Create Wizard User Control that is provided by ASP.net. The additional step that I want to add will come after a user will create their username, password, email etc. The information which I want to save in the extra step are details such as firstname, lastname, address, height, weight etc. (I am creating an online weight management system for dieticians).When I  run through the application, the username, password etc save perfectly to the database, but nothing happens with the other "personal information". There are no errors thrown so I don't know where the problem is coming from.I have included the code below as I have it:The code behind the Register.aspx file is as follows: <asp:SqlDataSource ID="InsertExtraInfo" runat="server" ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString1 %>" InsertCommand="INSERT INTO [aspnet_UserInformation] ([first_name], [surname], [address1], [address2], [city], [country], [number], [height], [weight]) VALUES (@txtFirstName, @txtSurname, @txtAddress1, @txtAddress2, @txtCity, @txtCountry, @txtNumber, @txtHeight, @txtWeight)" ProviderName="<%$ ConnectionStrings:ASPNETDBConnectionString1.ProviderName %>"> <InsertParameters> <asp:ControlParameter Name="txtFirstName" Type="String" ControlID="txtFirstName" PropertyName="Text" /> <asp:ControlParameter Name="txtSurname" Type="String" ControlID="txtSurname" PropertyName="Text" /> <asp:ControlParameter Name="txtAddress1" Type="String" ControlID="txtAddress1" PropertyName="Text" /> <asp:ControlParameter Name="txtAddress2" Type="String" ControlID="txtAddress2" PropertyName="Text" /> <asp:ControlParameter Name="txtCity" Type="String" ControlID="txtCity" PropertyName="Text" /> <asp:ControlParameter Name="txtCountry" Type="String" ControlID="txtCountry" PropertyName="Text" /> <asp:ControlParameter Name="txtNumber" Type="String" ControlID="txtNumber" PropertyName="Text" /> <asp:ControlParameter Name="txtHeight" Type="String" ControlID="txtHeight" PropertyName="Text" /> <asp:ControlParameter Name="txtWeight" Type="String" ControlID="txtWeight" PropertyName="Text" /> </InsertParameters> </asp:SqlDataSource>
 Then the code I have behind the Register.aspx.cs page is: protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)    {        TextBox UserName = (TextBox)CreateUserWizard1.FindControl("UserName");        SqlDataSource DataSource = (SqlDataSource)CreateUserWizard1.FindControl("InsertExtraInfo");                MembershipUser User = Membership.GetUser(UserName.Text);        //object UserGUID = User.ProviderUserKey;        DataSource.InsertParameters.Add("UserId", UserGUID.ToString());        DataSource.Insert();    } I know there is a problem with the code on the aspx.cs page but I cant figure it out. I need the username / password information to relate to the personal details information. I know I have to create a foreign key in the asp_UserInformation table that will link to the username in the asp_Membership (where all the username / password info is stored) Any help will do, I'm almost in tears here!!!The Spud 

View 1 Replies View Related

Create Output File In A Specific Layout - Extra Spaces Between Fields

Mar 17, 2014

I'm trying to create an output file in a specific layout. For some reason my output file is adding an extra 10 spaces between the Account Number and the Check Number in the statement below. The rest of the output file looks fine. Where the extra 10 spaces are coming from? I need 1 Filler Space between these fields.

SELECT DISTINCT
CASE p.PaymentMethodID WHEN 10 THEN 'I' WHEN 60 THEN 'V' WHEN 50 THEN 'S' ELSE 'I' END
+ CONVERT(CHAR(1), '')
+ (REPLICATE('0', 20 - LEN(ba.AccountNumber))+ CONVERT(CHAR(20), ba.AccountNumber))
+ CONVERT(CHAR(1), '')
+ (REPLICATE('0', 18 - LEN(p.CheckNumber)) + CONVERT(VARCHAR(18), p.CheckNumber))

[Code] .....

View 2 Replies View Related

TempDB Log Files Are Filling Up.

Dec 28, 2006

What is the best way to fix issues with your log files in TempDB when you start to see them causing error msgs?

Thansk for your time.

View 2 Replies View Related

TempDB Files Gone Missing

Nov 25, 2013

I was in the process of migrating a server from one physical box to another. They are identical drive setups, same OS (2003), same SQL install (2005). Our server team did a 'PlateSpin', which copies the drives from one server to another, as long as the files are not in use. I did not reinstall SQL on the new box, i let the 'PlateSpin' tool copy everything over for me. I then stopped the SQL services on the old server and new server and copied over all of the system database (.mdf & .ldf) files. As soon as i started up the services on the new server, it looked great with one exception. The TempDB was only showing one datafile. When i queried sys.master_files, it was showing me 8 TempDB files. I tried restarting the services, but i still saw the same, only 1 file. I then tried to re-add TempDB files with the same name, but it would error saying they already existed. In turn, i could add new files with different names and they showed up fine. However, on a restart, they would not show up in the properties of the TempDB.

When i queried, sys.master_files again, i now had 16 Temp db files listed in the results. I deleted all but the original single file that was recognized out of the sys.master_files table and re-added the additional 7 files with he original names, restarted the service and then they all appeared.

View 2 Replies View Related

How To Drop One Of The Tempdb Files

Nov 23, 2005

Hi all, I have a tempdb that consists of 8 datafiles, tempdb_data_1 totempdb_data_8, each is 8GB. Now how can I drop 7 of them and leaveonly tempdb_data_1? Can this be done? Thanks a lot.

View 3 Replies View Related

TempDB Files On Root Of Drive

Sep 15, 2015

Documentation that supports the placement of Tempdb files on the root of a drive, i.e T: instead of T: empdb. I am positive this is not a best practice, but when challenged could not find any documentation that would support that view.

View 7 Replies View Related

Sqlcmd Exits With Error

Apr 20, 2006

As a complete beginner regarding SQL Server, I installed SQLExpress and lots of other things Microsoft told me to (without understanding why) accepting all the defaults offered.

I can make a connection to the server with "SQL Server Management Studio Express", create a database and add one two tables and views.

But all other things I've tried seem to go wrong without me having the slightest idea why, e.g.:

% SQLCMD.EXE -S swansqlexpress
HResult 0xFFFFFFFF, Level 16, State 1
SQL Network Interfaces: Error getting enabled protocols list from registry [xFFFFFFFF].

The above for instance when the protocol "Shared memory is enabled". If any combination of the other protocols are enabled, then I get a different error message.

I also cannot use the ODBC Management Tools to define a DSN connecting to SQLExpress ("Server does not exist or connection refused).

What I really want to do is to import data, using ODBC, from a different RDBMS into SQLExpress. Before writing my own scripts to do this, I had hoped that there would have been some GUI interface to SQLExpress with a nice little button saying "import external data". Is their such a beast?

Malcolm Agnew



View 1 Replies View Related

How To Start SQL Server When Tempdb Files Were Relocated?

Nov 22, 2005

It's been a long time since I've tried this, but I have a SQL Server that needs to be restored (including master) to a server whose drives and corresponding folders match the source server, with the exception of tempdb. When SQL Server initially starts I believe it will fail since it cannot find tempdb. I just don't recall if it fails to startup or if it starts up reporting errors and recreates tempdb in the same location as master. Does anyone recall the steps needed to point SQL Server to the new location of tempdb?

Dave

View 1 Replies View Related

TempDb - Moving / Adding Files And Resizing

Oct 23, 2015

Have a SQL2008R2 instance on a VM where the single .mdf for the tempDb database is located on a high contention disk.  I've managed to get another 60GB disk and thought it would be a good time to move the .mdf and also increase it's size and number of files. 

The server has 12 cores and after a bit of reading I've decided that it would be best just to have four files for this database as the 1 file per core (-1) seems to be disputed.  

-- Move the existing file to the new disk and rename it.
ALTER DATABASE tempdb MODIFY FILE (NAME='tempdev', FILENAME='E:SQLData empdb0.mdf');

-- Change the size to 1GB
ALTER DATABASE tempdb MODIFY FILE (NAME='tempdev', SIZE= 1048576KB, FILEGROWTH=5%);

-- Add three new files, all with the same size & growth
ALTER DATABASE [tempdb] ADD FILE ( NAME = N'tempdev1', FILENAME = N'E:SQLData empdb1.mdf' , SIZE = 1048576KB , FILEGROWTH = 5%)
ALTER DATABASE [tempdb] ADD FILE ( NAME = N'tempdev2', FILENAME = N'E:SQLData empdb2.mdf' , SIZE = 1048576KB , FILEGROWTH = 5%)
ALTER DATABASE [tempdb] ADD FILE ( NAME = N'tempdev3', FILENAME = N'E:SQLData empdb3.mdf' , SIZE = 1048576KB , FILEGROWTH = 5%)

-- Now restart the instance.
 
Also, what are peoples thoughts on percentage growth for tempDb?  I've read that it's not recommend and yet it seems to be the norm.

View 4 Replies View Related

Setup And Upgrade :: Number Of TempDB Files

Aug 24, 2015

My server has two 8 core processor. Should I use 8 or 16 data files for Tempdb?

View 4 Replies View Related

Query To Know If A Field Exits In A Table

Jan 12, 2006

In MsSQLServer what is the query to kown if a field exists in a table

if exist (select * from dbo.sysobjects where id =...............

????

View 2 Replies View Related

Waht Is Tempdb Database Used For? And How Can We Determine What Files Can Be Deleted From It?

Jun 25, 2007

Hi, all experts here,



Thank you very much for your kind attention.



Just found that my tempdb is always full whenever I run a query against a large database. Could please any experts here give me any advices on what is tempdb database used for and how to determine what files can be deleted from it?



I am looking forward to hearing from you and thanks a lot in advance.



With best regards,



Yours sincerely,



View 3 Replies View Related

SQL 2012 :: FOR FILES Command To Delete Old Backup Files On Remote Server?

Feb 24, 2015

I have the need to delete old backup files via TSQL job. Found this solution online:

PushD "
emoteservershareDIFF" &&(
forfiles -m *DIFF*.sqb -d -1 -c "cmd /c del /q @path"
) & PopD

It works remotely if I run it via command prompt. But when I add this to a TSQL job on my remote SQL instance, it runs without deleting anything. What I'm missing?

View 6 Replies View Related

Create An Extra Table (for Audit Purpose) For Every Existing Table In A Database

Mar 28, 2008

Hi all, please help. I m trying to create an "empty" table from existing table for the audit trigger purpose.
For now, i am trying to create an empty audit table for every table in a database named "pubs", and it's seem won't work.
Please advise.. Thanks in advance.

Here is my code:





Code Snippet

USE pubs

DECLARE @TABLE_NAME sysname
DECLARE @AUDIT_TABLE VARCHAR(50)

SELECT @TABLE_NAME= MIN(TABLE_NAME) FROM INFORMATION_SCHEMA.TABLES
WHERE
TABLE_TYPE= 'BASE TABLE'
AND TABLE_NAME NOT LIKE 'audit%'
AND TABLE_NAME!= 'sysdiagrams'
AND TABLE_NAME!= 'Audit'
AND TABLE_NAME = 'sales'

WHILE @TABLE_NAME IS NOT NULL
BEGIN

SELECT @TABLE_NAME= MIN(TABLE_NAME) FROM INFORMATION_SCHEMA.Tables
WHERE TABLE_NAME> @TABLE_NAME
AND TABLE_NAME = 'sales'

SELECT @AUDIT_TABLE = 'Audit'+''@TABLE_NAME''


SELECT * INTO @AUDIT_TABLE
FROM @TABLE_NAME

TRUNCATE TABLE @AUDIT_TABLE
ALTER TABLE @AUDIT_TABLE ADD UserAction Char(10),AuditStartTime Char(50),AuditUser Char(50)


SELECT @TABLE_NAME= MIN(TABLE_NAME) FROM INFORMATION_SCHEMA.Tables
WHERE TABLE_NAME> @TABLE_NAME
AND TABLE_TYPE= 'BASE TABLE'
AND TABLE_NAME!= 'sysdiagrams'
AND TABLE_NAME!= 'Audit'
AND TABLE_NAME NOT LIKE 'audit%'

END
Thanks. ..

View 6 Replies View Related

Create Another Tempdb Without Stoping SQL

Oct 22, 2007

Hi to all

In sql server there is a query that is making tempdb full.
What I want is resoling this problem but without stoping sql server?

Thanks in advance,

kristinaRR

View 6 Replies View Related

How Do I Prevent An Insert Into Statement To Increase Tempdb Data Files So Much

May 6, 2008

I'm running this procedure which insert into table_name(id, name.....) select id, name.... from table_name. For some reason the tempdb data file grow up to 200GB. The tempdb is set to expand unrestricted by 10%. How can I prevent that from hapening? Thanks.

View 5 Replies View Related

How To Drop Database Table If It Exits In Sql Mobile Version?

Jul 3, 2006

Hi,

I am using VB.net and Visual Studio 2005 to compile a program for a Pocket PC with Microsoft® Windows Mobile„¢ 2003 Second Edition. I am using sql mobile also.

What I want to complete is like one of the following two queries. But when I tried them in the sql mobile, errors happened. So how can I complete the same function in sql Mobile? Thanks.

USE DBa

if exists (select * from dbo.sysobjects

where id = object_id(N'[dbo].[Table_a]')

and OBJECTPROPERTY(id, N'IsUserTable') = 1)

drop Table Table_a

or

USE DBa

IF OBJECT_ID('dbo.Table_a) IS NOT NULL

DROP TABLE dbo.Table_a

View 3 Replies View Related

SQL 2012 :: Data Collection (MDW) - TempDB

Mar 30, 2014

It is possible that Data Collection can cause massive increasing MB/sec to tempdb ? I cannot find connection with tempdb and I set cash file, but on same disk.

Or it can be something different? Last two weeks what I checked was Read/Write MB/s to tempdb increasing progressively.

One time it was about 20MB/sec

After it was reseting and again 1MB/sec..

What I checked , External company which install SQL Server made one file for tempdb, next week or during breaktime(it will be possible), I would like make 8files next weekend work.

Now I saw that TempDB mdf was still increased, but using was just 8-10%

View 2 Replies View Related

SQL 2012 :: Remove TempDB NDF File

Jul 8, 2014

I have added ndf to tempdb for checking performance improvement.... Now I want to remove the ndf file... I am using below command...

USE tempdb
GO
DBCC SHRINKFILE (3, TRUNCATEONLY);
GO
use master
go
ALTER DATABASE TEMPDB Remove FILE tempdev1

Results:
DbIdFileIdCurrentSizeMinimumSizeUsedPagesEstimatedPages
23766476643232

Error:-
(1 row(s) affected)
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Msg 5042, Level 16, State 1, Line 1

The file 'tempdev1' cannot be removed because it is not empty.

Note:
=>I restarted SQLServer from SSMS and then ran same commands mentioned above ,......and getting same error...
=> I executed above commands and restarted services...no change...

How to remove / drop ndf file...

View 7 Replies View Related

SQL 2012 :: How To Track SPs To TempDB Usage

Apr 10, 2015

I can get a snapshot of tables in tempDB, but I would like to track which procs are causing the load in the tempDB.

I think I can sample and record objects in the tempdb, but I would like to record the proc creating the most tempDB usage, and disk read/writes associated with those procs.

The DMV's give usage in the individual DB's, but what's a good way to correlate procs in the DB's to tempdb usage?

View 9 Replies View Related

SQL 2012 :: Missing Column Statistics In TempDB

Dec 18, 2012

I have a server which is not running optimally and I checked the default trace. I have around 600 entries in the default trace which are all Missing Column Statistics and the database is tempdb.is_auto_create_stats_on and is_auto_update_stats_on are both 1 for tempdb.

View 2 Replies View Related

SQL 2012 :: Encrypting Master Database And TempDB

Sep 30, 2014

Is it possible to encrypt Master database and tempdb? On executing below query result is showing temdb is encrypted.

SELECT db_name(database_id), encryption_state, percent_complete, key_algorithm, key_length
FROM sys.dm_database_encryption_keys

View 1 Replies View Related







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