数据库“我的数据库”的事务日志已满。要找出无法重用日志中的空间的原因,请参阅sys.databases中的log_reuse_wait_desc列。 [英] The transaction log for database 'My DB' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases
问题描述
数据库我的数据库的事务日志已满。要找出日志中的空间无法重用的原因,请参阅sys.databases中的log_reuse_wait_desc列
我创建了一个spring批处理应用程序,它将读取一些crore来自文本文件的行并在将所有数据读入登台表之后的某个固定时间间隔内将其更新到登台表(Tblm My table)我的存储过程将执行它将从我的主表中删除旧记录并从登台表插入数据批量处理主表但是它没有成功我的数据库'我的数据库'的事务日志已满。错误
我的管理员没有增加他要求的磁盘空间至于更改我的存储过程以使用简单的插入查询来执行批量插入Iam以将数据从一个表插入到另一个表中
SP
IF @ BenefitYear = 2013 BEGIN
INSERT INTO mainTable
(userid,username,addr,ucost,unitcost90 ,Benefityear,datecreated,createduser)
SELECT userid,username,addr,ucost,unitcost90, @BenefitYear , current_timestamp , @ BatchUser
从 stagingTable
END
使用以下查询进行批量复制 -
BULK INSERT pubs..publishers2 FROM ' c:\ newpubs.dat'
WITH (
DATAFILETYPE = ' char',
FIELDTERMINATOR = ' , ',
ROWTERMINATOR = ' \ n'
)
The transaction log for database 'My DB' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases
I have created an spring batch application ,it will read some crore of rows from a text file and update it in to staging Table(Tblm My table) in some regular interval of time after reading all data to staging table my stored procedure will execute it will delete old record from my main table and insert data from staging table to main table in bulk but its is not success am getting The transaction log for database 'My DB' is full.error
My Admin is not increasing disk space he ask as to change my stored procedure to do bulk insert Iam using simple insert query to insert data from one table to another
SP Below
IF @BenefitYear = 2013 BEGIN
INSERT INTO mainTable
(userid,username,addr,ucost,unitcost90,benefityear,datecreated,createduser)
SELECT userid,username,addr,ucost,unitcost90,@BenefitYear, current_timestamp,@BatchUser
From stagingTable
END
Use the below query for Bulk copying -
BULK INSERT pubs..publishers2 FROM 'c:\newpubs.dat' WITH ( DATAFILETYPE = 'char', FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' )
这篇关于数据库“我的数据库”的事务日志已满。要找出无法重用日志中的空间的原因,请参阅sys.databases中的log_reuse_wait_desc列。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!