How Does Backup Log No Truncate Option Work

Aug 8, 2000

I have been unsuccessful in getting the Backup Log with
No Truncate option to work.

Any tips, tricks, suggestions, etc., would be appreciated.

Thanks!!!

View 2 Replies


ADVERTISEMENT

Why Truncate / Shrink Log Files Work The Way They Do???

Nov 13, 2007

I've been having some trouble keeping my log file size under control due to some off-hours data loads. Currently, while updating some certain tables, the data base is still in "Full" mode, which of course makes the log file grow accordingly.

Today I figured out that, given the current scenario, in order to shrink the log file back down (after the table update), I have to (1) backup the log file, (2) shrink the log file, (3) backup the log file again, and (4) shrink the log file again. My question is: why do I have to do two iterations of backup / shrink? Why does it not work with one iteration? I just want to better understand the architecture and functionality.

Also, would there be a better way for keeping the log file size under control? If I switched the database to "Simple" mode to load the data, would that work any better?

If so, what might be the best methodology?

Thanks in advance for any responses.

Kent Rothrock
Highland Mapping, Inc.

View 4 Replies View Related

Truncate Transaction Log Script Won't Work On Db Name With '-'

Feb 25, 2008

Hello all, I have a very simple script which I use to truncate and reclaim space on all the transaction logs in a SQL Server 2005 database. However, I have some Sharepoint db names I can't change that have dashes ('-') in the names, e.g., SharePoint_AdminContent_dc27334f-fb2d-4453-9764-5d8b730fb9e1. The script won't back up those databases because it has a problem with the dashes in the names. Does anyone have any thoughts on how I could modify the script to get it to work? Here is the script:

ALTER PROCEDURE [dbo].[SP_GlobalTruncate_transaction_logs]

AS

Set quoted_identifier off

DECLARE @dataname varchar(300)

DECLARE @dataname_header varchar(75)

DECLARE datanames_cursor CURSOR FOR SELECT name FROM sysdatabases

WHERE name not in ('master', 'pubs', 'tempdb', 'model', 'northwind')

OPEN datanames_cursor

FETCH NEXT FROM datanames_cursor INTO @dataname

WHILE (@@fetch_status <> -1)

BEGIN

IF (@@fetch_status = -2)

BEGIN

FETCH NEXT FROM datanames_cursor INTO @dataname

CONTINUE

END

SELECT @dataname_header = 'Database ' + RTRIM(UPPER(@dataname))

PRINT ' '

PRINT @dataname_header

EXEC('BACKUP LOG ' + @dataname + ' WITH TRUNCATE_ONLY')

EXEC('DBCC SHRINKDATABASE (' + @dataname + ',TRUNCATEONLY)')

FETCH NEXT FROM datanames_cursor INTO @dataname

END

DEALLOCATE datanames_cursor

PRINT ''

PRINT ' '

PRINT 'Free space removed and transaction log truncated for each user database'
GO

And here is the error I get:
Database SHAREPOINT_ADMINCONTENT_DC27334F-FB2D-4453-9764-5D8B730FB9E1

Msg 102, Level 15, State 1, Line 1

Incorrect syntax near '-'.

Msg 319, Level 15, State 1, Line 1

Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon.

Msg 102, Level 15, State 1, Line 1

Incorrect syntax near '-'.


Thanks so much for the help.

View 4 Replies View Related

Truncate Temp Table Doesn&#39;t Work In Sp

Aug 2, 2000

hi,

I have a stored procedure to calculate the balance for a group of people. Inside the sp,
I created a temp table at the beginning of the procedure, then use it to calculate the opening
balance first, then I truncated the table in the middle, reuse it to calculate the closing balance.
The sp will take the from date and the through date to do the calculation. Somehow,
when I passed a different from date and the same through date to the sp, it returned a different
closing balance. It took me a while to figure out that the temp table I was using didn't get
truncated in the middle. I did a 'select count(*) ' directly after the truncate statement.
Sometimes it returned a non-zero number, and sometimes it returned 0.

We are using SQL 7.0 Service pack 1. Does anyone know the reason?

Heidi Zhang
hZhangcti@use.net

View 3 Replies View Related

-SkipError Option Does Not Work

Jul 17, 2007

Using the -SkipError option in Sql Server 2005 SP2, 64 bit edition does not work anymore. I am trying to skip error 20598, but the error is not skipped. This was working but it "magically" stopped some time ago. Does anyone have any ideas?

View 3 Replies View Related

Need To Backup Single DB  With Copy-only Backup Option On

May 6, 2015

I need to backup a single DB  with "Copy-only Backup" option on. I Want to place the backup on a different location, we have a media set which is used for daily backups. I want this backup placed on a different

server 192.168.250.xxx
DepartmentsITBackup2015xxx.bak 

I have added this location to "back up to" The old one is still there. I I then hit OK th backup hangs for 2-3 minutes and gives me an error which points to the old media set. SO I want to create a  new  media set and call it  "onlyonce" but what I am not sure about is  what this Means "back up to a new media set and erase all existing backup sets"  Does that mean all old backups will be deleted?

View 3 Replies View Related

Which High Availability Option Will Work For Us?

Apr 15, 2008



The company that I work for has multiple database instances across two data centres in two different cities. All of these databases have front end applications reading/writing data to them.

Now, we have taken an initiative to merge all databases into one consolidated database. Then we want this database to be available in the other data centre. We'll have front application running at both locations reading/writing data to the databases and want it to be written to the other database too. These systems are in production 24/7 and we cannot afford any downtime over 5 minutes.

Replication, Log shipping, Mirroring or combination?

View 4 Replies View Related

FASTFIRSTROW Or OPTION (FAST 1) Doesn´t Work Correctly

May 24, 2004

I want to optimize a query for fast retrieval of the first row
and after the rest of them automatically.

I used the hint OPTION (FAST 1) but I don't get the hoped results, any idea?


Thanks.

View 5 Replies View Related

Truncate Log Before Backup

Jan 14, 2000

how do i modify this so that it will truncate the log before backup?

SQLMAINT.EXE -D mimi-BkUpDB E:SQLBackups -BkUpMedia DISK -DelBkUps 1 -Rpt E:SQLMaintmimi_maint.rpt

thanks

View 1 Replies View Related

Backup Log - Will It Truncate?

Jun 9, 2006

According to BOL<---BACKUP LOGSpecifies a backup of the transaction log only. The log is backed upfrom the last successfully executed LOG backup to the current end ofthe log. Once the log is backed up, the space may be truncated when nolonger required by replication or active transactions.--->Does this mean I could do something else to truncate the log or is itsaying that the backup log command may truncate the log if it feelslike it?I want ot get a log from a client site onto my server for analysis butI want ot make absolute certain that my backing up the log on theirserver won't truncate it there.

View 7 Replies View Related

How To BACKUP LOG WITH Truncate Only In SSIS

Jun 29, 2007

Hello



I wanna use backup database task in SSIS to implement SQL statement

BACKUP LOG WITH truncate only.

But in this task, seems that you must at least to choose a location to store backup. No way to just truncate log in SSIS?



any help will be appreciated.

View 1 Replies View Related

Lock Pages In Memory Option On SQL 2005 STD 64-bit With W2K3 R2 Standard 64-bit - Does It Work?

Nov 9, 2007

Hey Folks -

I'm setting up a new production SQL 2005 64-bit server running on a dedicated Windows 2003 R2 Standard system w/8GB of RAM.

I've enabled the "Lock Pages in Memory" option (http://msdn2.microsoft.com/en-us/library/ms190730.aspx) but when I run dbcc memorystatus all of my AWE counters show 0.

According to http://blogs.msdn.com/sqlprogrammability/:

"On 64 bit machines, execute 'dbcc memorystatus'. If the AWE Allocated memory is 0 then lock pages in memory privilege has not been granted to the service account or it has not taken effect. "

Does the "Lock Pages in Memory" option work on W2K3 R2 Standard? Just searching across the web I find different answers. In some places it clearly says that Lock Pages in Memory only works on W2K3 Enterprise systems. In other places it says that it should work on any Windows 2003 64-bit OS.

Does anyone have any ideas? Assuming we cannot "lock pages in memory" due to the Windows 2003 Standard OS, are there any other memory management recommendations out there?

thanks!

View 2 Replies View Related

Does A TransLog Backup Truncate The Trans Log?

Dec 6, 1999

This is a silly question but I am not sure of the answer.

Each day I do a complete DB backup and houly I backup the Translog file with the append mode.

Question Is the Transaction log truncated each time I do a Transaction Log Backup?

View 3 Replies View Related

SQL Server Backup And Truncate Log File

Jun 13, 2006

Hi all,If I set recovery model SIMPLE then truncation of log files will beautomated , but I will losedatabase changes made since the last backup was taken.Is there any way to automate truncation of log file andbackup of database upto last change has been done????Plz Help.

View 3 Replies View Related

Weird!! &&< Sign Doesn't Work Within DataReader Source Connecting To Mysql Using ADO.NET ODBC Option

Jul 25, 2007

my package contains

Two connections ==> one is using OLEDB connecting to SQL server 2005 and the other using ADO.NET's ODBC option to connect to mysql;



Two "Execute SQL Task" ==> one gets maximum ID(bigint) from a SQL server table and the other gets the maximum ID(unsigned) from a mysql's table and bind them to two variables ID1(string) and ID2 (int 64). http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=1902297&SiteID=17&mode=1 ;



And one DataFlow whose data source is DataReader Source which queries mysql "select * from table where ID > cast(@ID1 as signed) and ID <= cast(@ID2 as signed) ". To debug, I put a DataViewer between Data Flow Source and Data Flow Destination.



Run the package, I found no data coming into DataViewer and no error message as well. However if I remove the "<=" sign and change the DataReader Source query to "select * from table where ID > cast(@ID1 as signed)", It works perfectly. Initially I thought it's variable @ID2's issue. But if I replace "<=" sign with ">=" sign in the query ==> "select * from table where ID >= (cast(@ID2 as signed) -100)", there is no problem. After tried many times, I found that query just doesn't work with "<" sign or "between". Plus the result of running package tells it's successful but just no records got inserted into Data Flow Destination.



Anyone could help? Thanks!

View 3 Replies View Related

No Backup Option Under Management?

Nov 8, 2013

We have an application with SQL Server 2005 as his database. When I open the database in sql server management studio, under management > it does not give the option like "backup", "copy database", nor there is folder called maintenance plans.

how I can bring back the option?

View 6 Replies View Related

Greyed Out Backup Option..

May 13, 2007

Hi Guys,

Why is that some of the databases has their "Transaction Log" & "File and Filegroup" options in Backup greyed out? I was trying to create a backup job using the sql enterprise backup wizard. However, the database that is the backend of our erp application has its "Transaction Log" and "File and Filegroup" option greyed out.

Any idea why?



sk

View 4 Replies View Related

Backup Command RETAINDAYS Option.

Dec 7, 2001

I need to have RETAINDAYS=6hours on a backup command. How can I code that,seems like it should be in integer only,any work-around to have the retain days only few hours(less than a day)?

View 1 Replies View Related

SQL Server Admin 2014 :: What Happens If Shrink Database With Truncate Only And Take A Backup

Apr 30, 2015

I would like to know what happens if i shrink the database with truncate only option and do a full backup or transaction log backup ? are the full backup or transaction log backup valid? I know that the performance of the database is bad if i shrink the database. What happens to full backup or transaction log backups?

View 9 Replies View Related

Proper Way To Truncate Log After Performing Full Backup (SQL Server 2000)

Jan 29, 2007

Hello all - I have a SQL Server 2000 database setup using the Full Recovery Model. Each night, we backup the entire database, and as such would like to truncate the log at this time as well.

Is the best way to do this to also backup the Transaction Log, and then perform a DBCC SHRINKFILE command? It just seems like there should be an easier way...?

Thanks!

View 1 Replies View Related

Encryption Keys Backup Option Is Disabled

Jan 23, 2008



I just installed Reporting Services (2005) in a "distributed installation" mode. That is, I have sql server 2005 on a separate server. I installed the Report Server on its own server where I already had IIS running.

That all seemed to go well and I didn't get any errors or anything. After the install process was done, I ran the RS Configuration Manager tool. Since "Install but do not configure" option was automatically selected for me, I started working through all the pages from top to bottom. Again everything worked, and I have green checkboxes next to all of the nodes in the left except...

When I get to the Encryption Keys page, it has a blue exclamation icon next to its icon in the left pane. On the page itself, the Backup and Change buttons are disabled, greyed out.

And, the next item down, Initialization, is shown with a greyed out "x" icon. It's not red, but greyed out.

So, I'm not sure what this all means, but I'm guess it means that I don't have RS set up yet...! Any help would be greatly appreciated.

-- M Noreen

View 3 Replies View Related

DB Design :: Remove Backup Option For All User For A Database In Server

Aug 4, 2015

I don't want to any body can backup of my database, even i can also not able to take backup.

View 17 Replies View Related

Will This Backup Work?

Apr 26, 2006

Currently we are running a full backup on Fridays and differentials monday through thursday. With the Logs being truncated. we are using Veritas 10d with a 5 tape auto loader.

As far as recovery goes will this be sufficient?

we have about 40 users doing normal work hours.

My main concern is the transaction logs and making sure that I will be able to recover my data.

also we do not have an open file option and cannot do backups during the day, only at night.


Thanks in advance :D

View 6 Replies View Related

Backup Log .... With No_truncate - How To Get It To Work

Aug 15, 2000

Backup Log ..... with no_truncate -- How to get it to work.

Applicable to SQL Server 7.0 Date 8/14/00 andrews_gary_w@solarturbines.com


Introduction to the "Backup Log …….with no_truncate" feature of SQL Server 7.0.

On occasion a database may become corrupt or a database file may be inaccessible. Ideally, in these cases you want to be able to restore and recover the data back to the current point in time.

This requires that the Transaction Log be backed up prior to the restore process beginning.

Microsoft has provided the "Backup Log ……with no_truncate" feature for use in cases such as this. However, this feature works only under very specific conditions and thus is the topic of this document.



Background.

When a database is defined, it always has a primary file group. In some cases this may be the only file group defined for the database. The primary filegroup contains, at a minimum, the system tables for the database being defined. The systems tables hold metadata describing the database. Where no other filegroups have been defined, the primary file group will also contain the user defined tables/indexes.



Essential requirement

"Backup Log …… with no_truncate" must be able to access the "metadata" located in the primary file group, or it will not work. This also means that this part of the database must not be corrupt or that the file containing this part of the database must not be inaccessible.



Specific conditions required for "Backup Log ….. with no_truncate" to work.

a. The database needs to be defined so that the user tables/indexes are contained in one or more file groups other than the primary filegroup.
b. Logging of changes to the database must be in effect.
c. A full backup must exist
d. Changes are made (logged) to the user database.
e. No non-logged operations must have been performed since the last full backup.
f. The primary filegroup file(s) must be available.
g. The primary filegroup data must not be corrupted. Or at least the portion needed by the backup operation must not be corrupted. I am not 100% sure about this issue.
h. The data in the filegroups other than primary may be corrupted or these files may be completely missing.
Process to restore/recover.

a. When problem detected (data file(s) inaccessible or database is corrupted), if primary filegroup is accessible, then perform the Backup Log …. with no_truncate.
b. Then perform the restore process using the "with replace" option for the database. This will get back any missing file(s) and recover you right up to when the last log backup was taken.
c.Post restore/recover process, your database will not be corrupt or missing any data file(s)



Bottom line

To achieve maximum recoverability, the following is recommended.

a. Define databases so that user data is not put in the primary file group.
i.e. Define not only a primary filegroup, but also one or more "other" filegroups.
b. Place user data in the "other" filegroup(s), NOT in the primary filegroup.
c. Place the primary filegroup on a disk drive separate from the "other" filegroup(s).
d. Place the log on a disk drive by itself.

Under the above scenario, at least three different disk drives would be needed to accommodate a single database.

Some sources recommend you put the primary file group and the transaction log on the same disk drive (mirrored). This would of course reduce the maximum number of disks needed to two. This topic, from my perspective, is another issue to be separately addressed and thus is not covered any further in this document.


Remember, even if the database files are isolated as recommended above:

a. Should the primary filegroup file(s) be inaccessible, then the Backup Log …. with no_truncate option will not work.

b. Should the primary filegroup file(s) be corrupt, then depending on where the corruption is determines whether or not the Backup Log ….. with no_truncate option will work.

View 2 Replies View Related

SQL 7 IDE Tape Backup Won&#39;t Work

Nov 4, 1999

We have Dell Optiplex GX1 PCs with Seagate ST22000 IDE tape backup devices, running NT Workstation or NT Server and SQL 7.0 with SP1, NTSP5.
SQL 6.5 will backup successfully to these devices, but SQL 7.0 will not.
The most common error message is 18257, Device or media does not support ...
42000 Syntax error, permission violation, or other nonspecific error...

View 3 Replies View Related

Getting The Backup Exec Sql Agent To Work

Mar 22, 2004

i know this topic has been covered and i've searched but i can't find the answer.

-SQL server is a diffrent server than my backup server
-i've installed the sql agent option on the backup exec server
-i've installed the client network utility on the remote server

the backup server doesn't see the SQL server databases. any thoughts

could it be a security issue?

thanks!

View 11 Replies View Related

Howto Work And Manage Backup Log Files???

Apr 13, 2004

Hello everybody,

I have run into some problems with logfiles and backup logfiles (MS SQL server). I have read much about them but uptil now I dont seem to grasp how it works. Specially the part of working with backup log files.

Can someone please help me with this?

What I want todo is to create backup log files, so I can restore the database to any point in time before a failure occured. But using this method create's a problem with the backup log files. They get very big.

So how can I use backup log files without getting to large backup log files?

How can I shrink on a regular basis the backup log files and still be able to restore the database?

Please help.

Best regards,

Marc Janssen,
:)

View 3 Replies View Related

Howto Work And Manage Backup Logfiles?

Jul 20, 2005

Hello,I have run into some problems with logfiles and backup logfiles (MSSQL server). I have read much about them but uptil now I dont seem tograsp how it works. Specially the part of working with backup logfiles.Can someone please help me with this?What I want todo is to create backup log files, so I can restore thedatabase to any point in time before a failure occured. But using thismethod create's a problem with the backup log files. They get verybig.So how can I use backup log files without getting to large backup logfiles?How can I shrink on a regular basis the backup log files and still beable to restore the database?Please help.Best regards,Marc Janssen,Join Bytes!:)

View 4 Replies View Related

Maintenence Plan Backup Schedule Doesn't Work

Sep 6, 2005

I am running the latest MSDE with the SQL Server 2000 client tools on
Windows 2K Server on my production server. I have a simliar setup on my
development machine except it is running Windows 2K (non-server). I
have the same issue on both machines (I am wondering if it is related
to the structure of the database). When I open Enterprise Manager,
connect to the server, navigate to the Management folder, and add a new
management plan, I experience the following error.

I create a management plan that includes nothing but a complete
database backup (i.e. no reorganization of index pages, logging, etc.).
I set the backup schedule to occur every Sun at 12:00AM and hit OK.
Sometimes I get the following error :"Error 8114: Error converting data
type int to tinyint" sometimes not. Either way, though, the same thing
happens, the schedule for the backup is not saved. If I reopen the
management plan and go to the "Complete Backup" tab, there is no
schedule in the schedule box.

I have found this link:http://www.technologyone.org/new-4581847-3733.html

Which appears to be the same issue that I am having, however, there is
no resolution there. I was wondering if anyone had any ideas.

Jason

View 5 Replies View Related

Restored SQL 2000 Backup, Stored Procedures Don't Work

May 6, 2006

Hello
I have restored a SQL 2000 backup of my database, ever since my web applications are unable to use any of the stored procedures.
I get the following error:
Could not find stored procedure 'xxx'.

If I use enterprise manager and go to the procedures tab the procedure appears there.

Any ideas what is up?

PS: The username has been changed, before the backup it was "user1" now its something else. For some reason it still shows that the procedure object is owned by "user1". Could this be the problem?

Thanks in advance.

View 1 Replies View Related

Logins Dont Work After Restoring On Backup Server

Jul 20, 2005

I am doing a complete backup on a sql 7 db and then doing a completerestore (with overwrite existing db) on a sql 2000 server. This is nowour hot standby server. I have the process automated and it worksgreat. The only problem I have now is the logins dont work.I have tried running EXEC sp_change_users_login 'Report', and thelogins appear.However, when I run EXEC sp_helplogins 'joe', the results are empty.So, I am guessing all I need is a sp that will re-associate my loginswith the correct db and grant the appropriate permissions.If anyone has any ideas that would be great.I have also considered doing a log ship instead of a full backup andrestore. Does anyone have any suggections or good examples of how tomake that happen?Thanx

View 1 Replies View Related

[SQL 2005] Backup Diff On MSDB Doesnt Work

Aug 1, 2007

Hello all,

I need help concerning a differential backup on a MSDB database.
I received this message when I tried to backup it


Log from Windows

Event Type: Error
Event Source: SQLVDI
Event Category: None
Event ID: 1
Date: 8/1/2007
Time: 2:03:37 PM
User: N/A
Computer: XXX
Description:
SQLVDI: Loc=SignalAbort. Desc=Client initiates abort. ErrorCode=(0). Process=9028. Thread=5928. Client. Instance=. VD=GlobalData Protector_(DEFAULT)_msdb_14_00_21.

Log from DataProtector

Normal] From: XXX "(DEFAULT)" Time: XXX
SQL statement:
BACKUP DATABASE [msdb] TO
VIRTUAL_DEVICE = "Data Protector_(DEFAULT)_msdb_06_00_14"
WITH NAME = 'Data Protector: 2007/08/01 0064', DIFFERENTIAL, BLOCKSIZE = 4096, MAXTRANSFERSIZE = 65536;
[Warning] From: XXX "(DEFAULT)" Time: XXX
Error has occurred while executing a SQL statement.
Error message: '<Microsoft SQL-DMO (ODBC SQLState: 42000):bdb>
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot perform a differential backup for database "msdb", because a current database backup does not exist. Perform a full database backup by reissuing BACKUP DATABASE, omitting the WITH DIFFERENTIAL option.
[Microsoft][ODBC SQL Server Driver][SQL Server]BACKUP DATABASE is terminating abnormally.'

Ive tried to do a full followed straight after by a diff but doent help.

Thank you for your help

View 7 Replies View Related

In SqlServer Management Studio Express, Server Type Option Is Greyed Out, Also Publication Option Missing

Apr 27, 2008

Hi everyone In my SqlServer Management Studio Express, on start up it shows the server type option, but greyed.So that value is fixed to database engine. ( I'm trying to work on an SqlServer Compact Edition database through the SSMStudiothat's why I'm trying to get this to change.)Besides, after I connect i go to the Object Explorer, expand the server node, and go to Replication.When i expand replication, i get the "Local Subscription" option, but nothng for Publication.( I want to work on Merge Replication, that's why I desparately need Publication to work)Am i missing something here? I did not install SqlServer separately, I only have what comes bundled with the Visual Studio  2005 Setup.

View 2 Replies View Related







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