Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 How to insert over 2 million record in sql server

Author  Topic 

dophuong_cs
Starting Member

15 Posts

Posted - 2015-03-02 : 21:37:40
Dear All,
I have 1 problem with insert data from big table of oracle to table in sql server 2012 through database link.
But when run command as:

INSERT INTO WBGJT300 SELECT * FROM [QVNPIS]..[QV_EUC].[WBGJT300]


After that, errors message show as below:

Msg 9002, Level 17, State 4, Line 2
The transaction log for database 'ECN_System_Dev' is full due to 'ACTIVE_TRANSACTION'


Please support me to solve this problem.

Phuong

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2015-03-03 : 00:39:14
Make the log file larger.


Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA
Go to Top of Page

dophuong_cs
Starting Member

15 Posts

Posted - 2015-03-03 : 01:44:45
Dear SwePeso,
Thank you for your answer!
How to make log file larger in sql server 2012 standard.
Please show me.

Phuong
Go to Top of Page

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-03-03 : 03:35:52
other options:

1. change logging mode to bulk insert just while you do the insert operation
2. do the inserts in batches (e.g. of 100,000 rows at a time) using offset/fetch
Go to Top of Page

dophuong_cs
Starting Member

15 Posts

Posted - 2015-03-03 : 04:25:22
Hi gbritton,
Thank you very much!
However with your ideas, only said like this very difficulty to take action.
Please show me 1 example to check detail content.

Phuong
Go to Top of Page

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-03-03 : 12:41:10
[code]
USE master;
ALTER DATABASE database_name SET RECOVERY BULK_LOGGED;
use database_name
Insert ....

USE master;
ALTER DATABASE database_name SET RECOVERY FULL -- or SIMPLE;
[/code]
Go to Top of Page
   

- Advertisement -