SQL 2012 :: Oversized Log File
Sep 25, 2015
I have a database:
mdf: 135 GB
ldf: 768 GB
We do daily full backups but the log file is continuing to grow.
I would like to do the following:
Checkpoint;
full backup;
set recovery model to simple;
set log size to 25 GB (approx 20%)
set recovery model to full
View 8 Replies
ADVERTISEMENT
Aug 15, 2002
Hello,
Recently my TEMPDB on SQL7 got to 16GB instead of 2GB. I tried to shrink it but that did not work. Please advice if there is some other option to get my TEMPDB to its original size 2GB.
Thank you.
View 4 Replies
View Related
Nov 4, 1998
Hey all,
I'm still getting the hang of BCP. In trying to upload a text file to a SQL table, I get about 10 of the following error message:
DB-LIBRARY ERROR:
Attemp to bulk-copy an oversized row to the SQL server.
Here is the BCP command I'm using to upload the file with:
bcp database.dbo.table in c:MSSQLBINNSQLEXPORTSupload.txt /c /t "," /r /b500 /SSERVER /Usa /Pxxxx
It looks like the copy went off without a hitch, but the errors are all over my screen. Any ideas?
Magnus Gratitudussness,
Fenderson
View 2 Replies
View Related
Jul 31, 2014
I need to write a process to get file size in kb and record count in a file. I was planning on writing a c# console app that takes the file path and name as a param however should i use a CLR?
I cant put a script in the ssis when it's bringing the file down because it has been deemed that we only use ssis for file consumption.
View 1 Replies
View Related
Apr 14, 2014
I need find out the number of columns in flat file before i process that particular file.I have file name in @filename variable and file path is @filepath variable.But do not not that how i will check the column name in before i will process that file.
@filePath = C:DatabaseSourceFilesCAHCVSSourceFiles
And i am using for each loop container to read the file one by one and put the file name in @filename variable.and my file name like
Product_20120607060930.txt
Product_20130708060930.txt
[code]....
Now what i have to do is i need to make sure that ID,Name,City,County,Phone is there in flat file.if it is not there then i have to send mail to client saying that file is not valid.I need to also calculate the size of flat file.
View 4 Replies
View Related
Jun 16, 2014
The TEMPDB transaction log file keeps growing.The database server is new and the transaction log was presized to 1 GB on installation. After installing a number of databases, the log file grew over a day to 38GB. Issuing a manual checkpoint was the only way to free some space to allow it to be shrunk back to a usable size. The usage of the file is still going up.
I am struggling to find what process is causing the log to be used so heavily. Looking at the log reuse wait desc for tempdb returns "Nothing" and tempdb itself isn't being used very much or growing in size.
View 9 Replies
View Related
Jul 2, 2015
I have a filetable that contains a binary file. I need to do a selective read of the file stored in the file table. I can write a C# CLR function that will open the file, read n bytes the from a starting byte. Or I can write a SQL statement that reads the stream in the filetable into a VARBINARY variable using SUBSTRING beginning at the starting byte (offset from 1) for the same n bytes.
Both give me the same result. However, the SQL statement takes considerably longer to read. I know there is overhead in reading through SQL (interpreted language), but the difference in performance is substantial, and I can only attribute this performance degradation if SQL first tries to "load" the entire stream before it identifies the portion of the stream that it needs to read beginning at the starting byte offset.
I wonder if this is the case or if there is another option to read a stream from a filetable directly through SQL queries that is more efficient.
View 3 Replies
View Related
Apr 29, 2014
Why shrinkfile empty file does not redistribute data evenly in the primary file group with multiple files:
Please run the script attached to see what the end result is.
This is what I set up last night on my test machine.
1) Create database [FGTest] size 200MB
2) Create table called TEST on primary
3) Insert 40MB of data into test
4) Create another file group called temp in primary size 200MB
5) Shrinkfile('FGTest',emptyfile) so that all data is transfered from FGTest into temp file group.
6) Add another 2 files called DATA2 and DATA3. Both are 200MB.
7) We now have 3 empty files that I want data distributed evenly on. FGTest, DATA2 & DATA3
8) Shrinkfile('temp',emptyfile) to move all the data from temp over the 3 file groups evenly
I would expect at this stage to have the following:
FGTest = 13MB,
DATA2 = 13MB,
DATA3 = 13MB
(40MB of data over 3 files should be about 13 MBish in each file)
What I actually end up with is this:
FGTest = 20MB
DATA1 = 10MB
DATA2 = 10MB
It looks as though SQL Server is allocating 50% of all data to the original file and then 50% evenly over
the remaining files in PRIMARY.
View 3 Replies
View Related
Apr 22, 2014
We have a large 'History' database that is currently about 4.5TB, with most of that in a datafile that is 4.2TB. We wanted to stop growth on the one large data file and have SQL Server allocate new data to the other data files, but this throws an error when we attempt to change the MAXSIZE settings:
ALTER failed for Database 'History'
MODIFY FILE failed. Specified size is less than or equal to current size.
The SQL Server is saying we can have a max size of 2TB, and anything over that is blocked. Since this is being blocked, the file continues to grow.
Is there any way to cap the growth of the 4.2TB file and not allow any more data to be written to it?
View 1 Replies
View Related
Dec 5, 2014
is there limitation for size of file to store in db by filestream in sql server 2008?or it accept all sizes?
View 1 Replies
View Related
Mar 2, 2014
I am trying to create an ssis package with dynamic csv file as output. and out format contains query output.
sample file name:
Unique identifier + query output + systemdate();
The expression is looking like this.
@[User::FilePath] + @[User::FileName] + ".CSV"
-- user filepath is a variable from ssis package. File name is the output from SQL query. using script task i have assigned the values to @[User::FileName] .
When I debugged the script task the value getting properly but same variable am using for Flafile destination. but its not working.
View 3 Replies
View Related
Sep 23, 2014
Getting below error while ran EMPTYFILE.
DBCC SHRINKFILE: Page 10:6521 could not be moved because it is a work table page.
Msg 2555, Level 16, State 1, Line 1
Cannot move all contents of file "tempdata" to other places to complete the emptyfile operation.
View 3 Replies
View Related
Dec 9, 2014
How can I open .str file format in sql server. Is there any manual method to do so?
View 4 Replies
View Related
Feb 27, 2015
I found this from a web site
SELECT * FROM Salesorders;
OUTPUT TO 'C: etssales.csv'
FORMAT TEXT
QUOTE '"'
WITH COLUMN NAMES;
However I do not want the delimiter to be a comma. Instead I plan to use something like ****%****
View 9 Replies
View Related
Feb 27, 2014
I have created the file group for my database.First i took backup of individual file group(mdf and ndf) then I tried to restore only secondary(ndf) file group.I got error like
Restore failed for Server 'pcnameSQLEXPRESS'. (Microsoft.SqlServer.SmoExtended)
File 'regSQL_dat' was not backed up in file 1 on device 'D:vtndf.bak'. The file cannot be restored from this backup set.
RESTORE DATABASE is terminating abnormally. (Microsoft SQL Server, Error: 3144)
When i tried to restore only primary file group i got the same error.
Can i restore individual file group? I
For the purpose of data archiveng,i have taken back up of ndf file (it contains very old data) & i have removed this file from database.Now my customer asking these file data.Now i have to again attach/restore this ndf file.how to attach/restore.
View 1 Replies
View Related
Apr 7, 2014
We have a database called "ih".
On Saturday the mdf file was 41.8 GIG. Today it is currently 79.1 GIG.
I've restore the DB to a new db from Saturday to compare to see where the growth is happening. That db is called "ih_restore".
I've found the following script which reports the size of each table of the database -
SET NOCOUNT ON
DBCC UPDATEUSAGE(0)
-- DB size.
EXEC sp_spaceused
-- Table row counts and sizes.
CREATE TABLE #t
(
[name] NVARCHAR(128),
[rows] CHAR(11),
[Code] ....
I've run it for ih and ih_restore and can see that the "reserved" and "data" fields are growing but no extra rows - so no inserts are happening in the database?? What or why will this be happening.
Example of csv file of a table that I've exported -
From ih -
name,rows,reserved,data,index_size,unused
em_comm_costing,384191,1011704 KB,512424 KB,498648 KB,632 KB
From ih_restore
name,rows,reserved,data,index_size,unused
em_comm_costing,384191,119808 KB,62960 KB,56088 KB,760 KB
So the em_comm_costing rows are 384191 in both but the data field has increased to 512424 from 62960.
The database is being mirrored as well, but not sure if that would be effecting the size?
View 6 Replies
View Related
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
Jul 10, 2014
I am receiving the below message however when going into my database properties and going into 'File' it's set as either unrestricted growth for the log files or 2097152MB limit and the log files are only taking up about 3gigs.
Could not allocate new page for database. There are no more pages available in the file group.
Database log file is full. Back up the transaction log for the database to free up some log space.
Could not allocate space for ojbect in database because the filegroup is full.
how I can resolve this and give it more space?
View 3 Replies
View Related
Jul 30, 2014
I am in the middle of capturing a workload to try and tune a SQL instance and was wondering what kinds of sizes people capture in terms of traces. I am only 1 day into a capture and I believe a typical workload would be a week long capture and I am already at 10GB of files. I am only capturing rpc_completed and sql_batch_completed.
What sizes of workloads do other people capture and then where do you analyse them, do you have particular dedicated server for this kind of thing as at present I am looking to use my local PC. Also what rollover file sizes do people tend to use, I am currently using 1GB.
View 7 Replies
View Related
Aug 5, 2014
I upgraded my 2008 R2 instance to 2012 and the Linked Server I use for aconnect to a csv file stopped working.
Create script:
EXEC sp_addlinkedserver @server ='Stats_CA',
@srvproduct='',
@provider ='Microsoft.ACE.OLEDB.12.0',
@datasrc='D:RLAPPSStatsStats_CA',
@provstr='Text'
Error message:
OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "Stats_CA" returned message "Unspecified error".
Msg 7303, Level 16, State 1, Line 2
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "Stats_CA".
I uninstalled and reinstalled the AccessDatabaseEngine - no change.
The provider is displayed, so it's not that.
I verified temp and csv location folder permissions
I tried the -g512 startup option
The csv has a schema.ini as required
It was an 'in place' upgrade, so nothing else has change.
View 6 Replies
View Related
Sep 2, 2014
Where would i find my particular database Error log file, Event log file and Trace file etc?
View 5 Replies
View Related
Sep 16, 2014
I was having interesting discussion on estimation of log file with a fellow collegue who happens to be quite knowledgable as well.
He told me if we identify the most frequently hit tables for a database and then (sum their sizes * 1.5) for OLAP we get rough estimate for disk space to be allocated for log file.
View 1 Replies
View Related
Sep 23, 2014
Been asked to restore an orphaned MDF file leftover after a botched uninstall - no .bak file. Tried to reattach, but got an error, I don't think it had been detached. My initial answer was, "No, very likely can't be done".
Am I right? Or is there a way of attaching it that doesn't require it to have been detached?
View 4 Replies
View Related
Nov 18, 2014
why i am seeing this on one of my production server.
log file is 12GB
DBCC SQLPERF(LOGSPACE) 0.017 % used
t-log backup runs every hour successfully
sys.databases ->log_reuse_wait_desc LOG_BACKUP
is_published 0
is_subscribed 0
is_merge_published 0
is_distributor 0
no open transactions, shrink doesn't work
DBCC LOGINFO returns 539 rows with status 0
what is the root cause. how to fix it.
View 8 Replies
View Related
Dec 11, 2014
I am not able to to drop few file groups that has been created to add partition range.
Steps taken so far:
--Empty files started
DBCC ShrinkFile(YEAR2015_FG,EmptyFile);
GO
--Removing files
Alter DATABASE ETL_MART REMOVE FILEGROUP YEAR2015_FG;
GO
-- Remove parition scheme depednecy
[code]...
View 2 Replies
View Related
Jan 23, 2015
I want to import an XML file in an Table. The XML file is on an Other Network location than the Database server I’m connected to and I have access to this location with my windows Credential.
I connect from my local PC to the Database server “RS1” with my Windows Credentials.
There I run this script
CREATE TABLE XMLwithOpenXML
(
Id INT IDENTITY PRIMARY KEY,
XMLData XML,
LoadedDateTime DATETIME
)
INSERT INTO XMLwithOpenXML(XMLData, LoadedDateTime)
SELECT CONVERT(XML, BulkColumn) AS BulkColumn, GETDATE()
FROM OPENROWSET(BULK '<Networkname><MAP>Name_.xml', SINGLE_BLOB) AS x;
I Get the error:
Msg 4861, Level 16, State 1, Line 10
Cannot bulk load because the file "<Networkname><MAP>Name_.xml'" could not be opened. Operating system error code 5(Access is denied.).
(<Networkname><MAP>Name_.xml' is not the real name )
So it looks like the openrowset connects to the network location with other credentials.
Where I can find (and change) the credentials which is used to connect to the network location?
I found this article on MSDN (Security Considerations) but cannot find solution [URL] .....
View 1 Replies
View Related
Feb 11, 2015
My log file size is of 5 GB, I just wanna reduce this to some extent without adopting shrinking method. So is there any way to do the same ?
View 1 Replies
View Related
Mar 11, 2015
I am after T-SQL code which will simply load the next T-log backup file from a network share folder to a warm standby db on a secondary server.What is needed is a Third server (server x), to participate in log shipping (MULTIPLE TARGETS).
Primary SERVER (SERVER A)
Secondary SERVER (SERVER B) Log shipped to via GUI.
THIRD SERVER (SERVER X) which will contain the same log shipped db from server A.
This will simply restore the logs from a network share to keep the db up to date.
View 3 Replies
View Related
Mar 18, 2015
I want to write a stored procedure or a simple T-SQL snippet that takes a parameter "Directory Path" and gives me the name and datetimestamp associated with each of the files within that directory. I can not use xp_cmdshell since it is not allowed. CLR integration is not enabled on the server either.
Is there any other way at all to achieve this directly from SQL Server using T-SQL?
View 3 Replies
View Related
May 15, 2015
I am trying to restore a database called BCC_DB (I'm actually just needing one table opened to find some data in one column) so I created a blank database called BCCrestore.
I have a .bak file called BCC_DB_backup_201505020017.bak.
I placed it in my local drive C:BCC_DB_backup_201505020017.bak and tried the SQL:
RESTORE DATABASE BCCrestore FROM DISK = 'C:BCC_DB_backup_201505020017.bak'
GO
I get an error:
Msg 3201, Level 16, State 2, Line 1
Cannot open backup device 'C:BCC_DB_backup_201505020017.bak'. Operating system error 2(The system cannot find the file specified.).
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
View 9 Replies
View Related
May 21, 2015
I see this all over for creating a Format file:
bcp Northwind.dbo.Products format nul -c -f "c:Products.fmt" -T
Or this for XML
bcp AdventureWorks.HumanResources.Department format nul -c -x -f department.xml -T -S servername
I get an error saying "cannot open a connection to SQL SERVER"
The SQL Server is local on my laptop.
Here is the exact code I am using:
bcp OrderDb.CompanyDepartment foramt nul -c -x -f c:CompanyDepartment.fmt -t, -T
And I have tried :
bcp OrderDb.CompanyDepartment foramt nul -c -x -f c:CompanyDepartment.xml -t, -T
Also, some say to put the server name at the end, but then I get an unknown argument on command line error
View 1 Replies
View Related
May 31, 2015
Am just on the lookout to find out whether there is a way to put a prefix at the beginning of the transaction log backup file that is created by SQL Server logshipping.
So, instead of having <DatabaseName>_<DateTime>.BAK (which is what SQL does), I would like to have TL_<DatabaseName>_<DateTime>.BAK.
I have looked into a parameter for the sqllogship.exe command, but cannot find any & have looked at fields in the logshipping tables, & can't see anything there either.
View 0 Replies
View Related
Jul 10, 2015
Recently i got task from Senior DBA, as : Recover a database without LOG file Currently Data File is available.
Log file is also available, but shows size as 0 KB. Means Log file is corrupted.
Currently existing DB is shown as Offline Mode in SSMS.
So i got below link:
[URL]
When i tried 1st/2nd solution from above link, i got below message: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.
To try that 3rd solution, I had to DELETE/Remove existing DB from SSMS, so i can create New DB with same name.
When i tried to delete Log file from Command Prompt, using below command, Windows replied that File is corrupted, so it cannot be deleted.
DEL /F /Q /A C:Program FilesMicrosoft SQL ServerMSSQL11.SQLEXPRESS2012MSSQLDATAMyDB.ldf
Meanwhile my Senior DBA brought DB in Recovery Pending mode.
So if i want to go for 3rd solution,then i need to DELETE file, But Windows is not allowing me.
[URL]
View 3 Replies
View Related