2014. 8. 21. 10:43

SQL 2012 Intergration Service 구성 항목 설정

1. SQL 2012  Intergration Service 의 경우 원격 인스턴스 접근.. 명명된 인스턴스 등을 사용할 때 구성 파일을 설정해야 한다


도움말 : http://msdn.microsoft.com/ko-kr/library/ms137789.aspx


Integration Services 서비스는 구성 파일을 사용하여 해당 설정을 구성합니다. 기본적으로 이 구성 파일의 이름은 MsDtsSrvr.ini.xml이고 저장 위치는 %ProgramFiles%\Microsoft SQL Server\110\DTS\Binn 폴더입니다.

일반적으로 이 구성 파일이나 이 구성 파일의 위치는 변경하지 않아도 되지만 패키지가 명명된 인스턴스, 데이터베이스 엔진의 원격 인스턴스 또는 여러 데이터베이스 엔진 인스턴스에 저장되는 경우에는 이 구성 파일을 수정해야 합니다. 또한 이 구성 파일을 기본 위치 이외의 다른 위치로 이동할 경우 파일 위치를 지정하는 레지스트리 키도 수정해야 합니다.


파일 구성 내역 

Integration Services를 설치할 때 설치 프로세스는 Integration Services 서비스에 대한 구성 파일을 만들고 설치합니다. 이 구성 파일에는 다음과 같은 설정이 들어 있습니다.

  • 서비스가 중지되면 패키지에 중지 명령이 전송됩니다.

  • SQL Server Management Studio의 개체 탐색기에서 Integration Services에 대해 표시할 루트 폴더는 MSDB와 파일 시스템 폴더입니다.

  • Integration Services 서비스에서 관리하는 파일 시스템의 패키지는 %ProgramFiles%\Microsoft SQL Server\110\DTS\Packages에 있습니다.

이 구성 파일은 Integration Services 서비스에서 관리할 패키지가 들어 있는 msdb 데이터베이스도 지정합니다. 기본적으로 Integration Services 서비스는 Integration Services와 동시에 설치되는 데이터베이스 엔진 인스턴스의 msdb 데이터베이스에 있는 패키지를 관리하도록 구성됩니다. 데이터베이스 엔진 인스턴스가 동시에 설치되지 않는 경우 Integration Services 서비스는 데이터베이스 엔진의 로컬 기본 인스턴스에 있는 msdb 데이터베이스에 저장된 패키지를 관리하도록 구성됩니다


데이터베이스 엔진의 명명된 인스턴스나 원격 인스턴스에 저장된 패키지를 관리하려면 구성 파일을 수정해야 합니다. 구성 파일을 업데이트하지 않는 경우 명명된 인스턴스나 원격 인스턴스의 msdb 데이터베이스에 저장된 패키지를 보기 위해 SQL Server Management Studio에서 개체 탐색기를 사용할 수 없습니다. 개체 탐색기를 사용하여 이러한 패키지를 보려고 하면 다음과 같은 오류 메시지가 나타납니다.



수정 파일 예

<?xml version="1.0" encoding="utf-8"?>

<DtsServiceConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <StopExecutingPackagesOnShutdown>true</StopExecutingPackagesOnShutdown>

  <TopLevelFolders>

    <Folder xsi:type="SqlServerFolder">

      <Name>MSDB</Name>

      <ServerName>ServerName\InstanceName</ServerName>

    </Folder>

    <Folder xsi:type="FileSystemFolder">

      <Name>File System</Name>

      <StorePath>..\Packages</StorePath>

    </Folder>

  </TopLevelFolders>  

</DtsServiceConfiguration>            



2. 원격 Intergration Service 서버에 연결 

 

SQL Server Management Studio나 다른 관리 응용 프로그램에서 원격 서버의 Integration Services 인스턴스에 연결하려면 응용 프로그램 사용자에게 서버에 대한 특정 권한 집합이 필요합니다.


원격 서비스에 접속시 엑세스가 거부되었다고 하면 권한을 부여 해야 합니다. 


충분한 권한이 없는 사용자가 원격 서버의 Integration Services 인스턴스에 연결하려고 하면 "액세스가 거부되었습니다."라는 오류 메시지가 나타납니다. 사용자에게 필요한 DCOM 권한을 부여하면 이 오류 메시지를 방지할 수 있습니다.

Windows Server 2003 또는 Windows XP에서 원격 사용자의 권한을 구성하려면

  1. 사용자가 로컬 Administrators 그룹의 멤버가 아니면 분산 COM 사용자 그룹에 해당 사용자를 추가합니다. 이 작업은 관리 도구 메뉴에서 액세스할 수 있는 컴퓨터 관리 MMC 스냅인에서 수행할 수 있습니다.

  2. 제어판을 열고 관리 도구를 두 번 클릭한 다음 구성 요소 서비스를 두 번 클릭하여 구성 요소 서비스 MMC 스냅인을 시작합니다.

  3. 콘솔의 왼쪽 창에서 구성 요소 서비스 노드를 확장합니다. 컴퓨터 노드를 확장하고 내 컴퓨터를 확장한 다음 DCOM 구성 노드를 클릭합니다.

  4. DCOM 구성 노드를 선택하고 구성할 수 있는 응용 프로그램 목록에서 SQL Server Integration Services 11.0을 선택합니다.

  5. SQL Server Integration Services 11.0을 마우스 오른쪽 단추로 클릭하고 속성을 선택합니다.

  6. SQL Server Integration Services 11.0 속성 대화 상자에서 보안 탭을 선택합니다.

  7. 시작 및 활성화 권한에서 사용자 지정을 선택하고 편집을 클릭하여 시작 권한 대화 상자를 엽니다.

  8. 시작 권한 대화 상자에서 사용자를 추가하거나 삭제하고 적절한 사용자 및 그룹에 적절한 권한을 할당합니다. 로컬 시작, 원격 시작, 로컬 활성화 및 원격 활성화 권한을 할당할 수 있습니다. 시작 권한은 서비스를 시작 및 중지할 수 있는 권한을 부여하거나 거부하고, 활성화 권한은 서비스에 연결할 수 있는 권한을 부여하거나 거부합니다.

  9. 확인을 클릭하여 대화 상자를 닫습니다.

  10. 액세스 권한에서 7-8단계를 반복하여 적절한 사용자 및 그룹에 적절한 권한을 할당합니다.

  11. MMC 스냅인을 닫습니다.

  12. Integration Services 서비스를 다시 시작합니다.


'Install /Setup' 카테고리의 다른 글

SQL 2008:: 삭제 레지스터리  (0) 2010.08.17
Install Tip  (0) 2010.06.04
SQL Server 수동 시작  (1) 2010.01.22
2014. 8. 19. 10:42

SQL Server Replication Error - The specified LSN for repldone log scan occurs before the current start of replication in the log


원본 : 

http://www.mssqltips.com/sqlservertip/3288/sql-server-replication-error--the-specified-lsn-for-repldone-log-scan-occurs-before-the-current-start-of-replication-in-the-log/?utm_source=dailynewsletter&utm_medium=email&utm_content=headline&utm_campaign=20140815



Problem

When working with SQL Server Replication there are times when you may get critical errors related to the Log Reader Agent. One of these errors is "The specified LSN [xxx] for repldone log scan occurs before the current start of replication in the log [xxx]". In this tip I will show how to deal with this type of error.

Solution

I'll give recommendations on how to fix the replication error and here is an actual error message as an example to help us analyze the issue:

The specified LSN {00000023:000000f8:0003} for repldone log scan occurs before the current 
start of replication in the log {00000023:000000f9:0005}. 

Below we can see what this error looks like using the Replication Monitor within SQL Server Management Studio.

Sessions in the SQL Server Replication Monitor

Note: these errors can be found in the Log Reader Agent history and also using SQL Server's Replication Monitor.

The Log Reader Agent is an executable that continuously reads the Transaction Log of the database configured for transactional replication and copies the transactions marked for replication from the Transaction Log into the msrepl_transactions table in the Distribution database.  It is important to know that when the Log Reader Agent starts it first verifies that the last transaction in the msrepl_transactions table in the Distribution database matches the Last Replicated Transaction in the Transaction Log for the published database (that is, the current start of replication). When this does not occur, an error will appear like shown above. Note that the msrepl_transactions table is a critical table and it must not be modified manually, because the Log Reader agent works based on the data in this table. If some entries are deleted or modified incorrectly then we will get many replication errors and one of them is what we are talking about in this tip.

Analyzing the SQL Server Replication Issue

As per our error message for this example, we can execute DBCC OPENTRAN on the published database to find more details about the opened and active replication transaction:

Replicated Transaction Information:
        Oldest distributed LSN     : (35:249:5)
        Oldest non-distributed LSN : (35:251:1)
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

Note that DBCC OPENTRAN gives us the LSN value in Decimal format and we need to convert the LSN from Decimal to Hexadecimal for further analysis.  Below I have converted the values from decimal to hexadecimal.

Oldest distributed LSN : (35:249:5) --> 00000023:000000f9:0005 (must match last row in msrepl_transactions table) 
Oldest non-distributed LSN : (35:251:1) --> 00000023:000000fb:0001 (oldest LSN in the transaction log)

If we analyze the output again,

The specified LSN {00000023:000000f8:0003} for repldone log scan occurs before the current 
start of replication in the log {00000023:000000f9:0005}. 

we can confirm that the LogReader agent is expecting to find LSN 000000f8 of VLF 00000023 which is currently the last entry in the msrepl_transactions table, but this is not the correct Last Replicated Transaction LSN. For SQL Server the correct Last Replicated Transaction LSN is 000000f9.

Note also that the oldest LSN in the Transaction Log is 000000fb of the same VLF 00000023. This means that the Log Reader is trying to start reading on LSN 000000f8 which is before the current start of replication in the log with LSN 000000f9.

You might be thinking about just moving the Log Reader to start at 000000f9 to fix this error?  The problem is that we do not know exactly how many transactions there are from 000000f8 to 000000f9, so if we move the Log Reader Agent pointer forward then we could miss some transactions and create data inconsistency issues.

Fixing the SQL Server Replication Issue

If you decide to move the Log Reader you can do it by using sp_repldone to mark 00000023:000000f9:0005 as the last replicated transaction, so you can skip and move forward. This can be done as shown below.  Here we are using the values from the error message: {00000023:000000f9:0005} or 00000023000000f90005.  We then flush and restart.

exec sp_repldone @xactid = x00000023000000f90005 , @xact_segno = x00000023000000f90005 
GO
-- releasing article cache...       
exec sp_replflush
GO
--Resetting LogReader to retrieve next transaction... 
--LogReader Agent will start up and begin replicating transactions....
exec sp_replrestart

With the above code, the error will disappear and the LogReader agent should continue running without error. If you want to know more about the LogReader Agent, you can review the links at the end of this tip.

Note: You should use sp_repldone only to troubleshoot specific internal replication errors and not use this as a regular way to fix issues.  In the case where you have more continuous errors like above it is better to recreate the replication publication again by dropping and then recreating.

Use sp_repldone with extreme caution because if you use the incorrect LSN you may skip valid transactions from the replication queue and you can create data inconsistency issues at the subscribers.

Fixing Error After a SQL Server Database Restore

Sometimes this type of error can appear after you restore a database that has publications. In this case an error similar to this will appear:

The specified LSN {00000000:00000000:0000} for repldone log scan occurs before the current 
start of replication in the log {00000023:000000f9:0005}.

You can see that Log Reader wants to start reading at LSN {00000000:00000000:0000} and it is because the msrepl_transactions table is empty. In this specific case you also can run sp_repldone to skip all false pending transactions in the msrepl_transactions table and move forward, so the LogReader ignores the incorrect starting point and can continue working.

exec sp_repldone @xactid=NULL, @xact_segno=NULL, @numtrans=0, @time=0, @reset=1

Note that we use @reset=1 to mark all replicated transactions in the Transaction Log as distributed.

'Replication' 카테고리의 다른 글

복제::스키마 옵션  (0) 2012.01.30
복제::숨겨진 저장프로시저 확인  (0) 2011.01.16
복제::LOB DataType 제한  (0) 2010.06.04
복제::#5 구현&삭제 스크립트  (0) 2010.06.04