Árvore de páginas

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.
HTML

<div id="main-content" class="wiki-content group">
	<h1 id="MigraçãoeConversãodeCollation(SQLServer)-Índice">Contents</h1>
	<p>
		<style type='text/css'>/*<![CDATA[*/
div.rbtoc1412695589165 {
	padding: 0px;
}
div.rbtoc1412695589165 ul {
	list-style: none;
	margin-left: 0px;
}
div.rbtoc1412695589165 li {
	margin-left: 0px;
	padding-left: 0px;
}
/*]]>*/
</style>
	<div class='toc-macro rbtoc1412695589165'>
		<ul class='toc-indentation'>
			<li><span class='TOCOutline'>1</span> <a
				href='#MigraçãoeConversãodeCollation(SQLServer)-Objetivo'>Objective</a></li>
			<li><span class='TOCOutline'>2</span> <a
				href='#MigraçãoeConversãodeCollation(SQLServer)-ProcedimentodeMigraçãoeConversãodeDados'>Data
					Migration and Conversion Procedure</a></li>
		</ul>
	</div>
	</p>
	<h1 id="MigraçãoeConversãodeCollation(SQLServer)-Objetivo">Objective</h1>
	<p>The objective of this guide is to indicate a method of migrating
		data from a base with collation different than the standard
		

Índice

Índice
outlinetrue
stylenone
exclude.*ndice

Objetivo

...

"Latin1_General_CI_AS"

...

Procedimiento de Migración y Conversión de Datos

Nota
title¡Atenção!

Esta operación debe ocurrir antes de la conversión de una base TOTVS | ECM para Fluig. Inclusive con la alteración de la agrupación estándar, los campos existentes permanecen incorrectos, pudiendo así, causar comportamientos inesperados en la utilización de la plataforma.

 

Siga a continuación el check-list para la conversión del Fluig.

...

Inmediatamente después de la creación, sin ninguna conexión en esta base de datos, ejecute el comando:

 

...

themeEclipse
languagesql

...

 required for the proper use of the Fluig base.</p>
	<h1
		id="MigraçãoeConversãodeCollation(SQLServer)-ProcedimentodeMigraçãoeConversãodeDados">Data
		Migration and Conversion Procedure</h1>
	<p>
		<strong><br /></strong>
	</p>
	<div class="aui-message warning shadowed information-macro">
		<p class="title">Attention!</p>
		<span class="aui-icon icon-warning">Icon</span>
		<div class="message-content">
			<p>This operation must take place before the conversion of a
				TOTVS | ECM base to Fluig. Even with modification of the default
				collation, the existing fields remain incorrect, and can therefore
				result in unexpected behavior by the platform.</p>
		</div>
	</div>
	<p>&#160;</p>
	<p>The following is a checklist for Fluig conversion.&#160;</p>
	<p>&#160;</p>
	<ol>
		<li>Check procedures for the service/instance of the SGBD
			Microsoft SQL&#160;<span
			style="font-size: 10.0pt; line-height: 13.0pt;">Server,
				describe in the following page:&#160;<a href="73078837.html">Configuration
					of the SQL Server data bank</a>.
		</span><br /> <br />
		</li>
		<li>Create a new data base with <strong>grouping </strong>(Collate/Collation)
			Latin1_General_CI_AS.<br /> <span
			style="font-size: 10.0pt; line-height: 13.0pt;"><br /></span></li>
		<li><p>
				Immediately after creation, <strong>with no connection</strong> in
				this data base, execute the command:
			</p>
			<p>
				<br /> <br />
			</p>
			<div class="code panel pdl" style="border-width: 1px;">
				<div class="codeContent panelContent pdl">
					<pre class="theme: Eclipse; brush: sql; gutter: false"
						style="font-size: 12px;">ALTER DATABASE [fluig] SET READ_COMMITTED_SNAPSHOT ON;

...

themeEclipse
languagesql

...

</pre>
				</div>
			</div>
			<p>
				<br />The configurations for grouping of characters (<em>Collate/Collation</em>)
				of the data bases may still be queried through the following
				instruction:
			</p>
			<p>
				<span style="font-size: 10.0pt; line-height: 13.0pt;"><br /></span>
			</p>
			<div class="code panel pdl" style="border-width: 1px;">
				<div class="codeContent panelContent pdl">
					<pre class="theme: Eclipse; brush: sql; gutter: false"
						style="font-size: 12px;">SELECT [name] , [is_read_committed_snapshot_on] , [collation_name]

...

&#160;
FROM [sys].[databases] 
WHERE [name] LIKE 'fluig%';

...

  1. Haga clic con el botón derecho del mouse sobre la base de datos.
  2. En el menú suspendido elija la opción Tareas > Gerar Scripts...
  3. Haga clic en el botón Próximo > para pasar la presentación de la Introducción del asistente para Generar y Publicar Scripts.
  4. Deje seleccionada la opción para Generar script de todo el banco de datos y todos los objetos del banco de datos y haga clic en el botón Próximo >.
  5. En la pantalla siguiente, en el grupo Tipo de Salida y en el grupo a continuación seleccione la opción Salvar en la nueva ventana de consulta.
  6. Haga clic en el botón Avanzado.
  7. En la pantalla de Opciones de Script Avanzadas altere la opción Agrupación de Scripts para True y haga clic en el botón OK.
  8. Al regresar a la pantalla Generar y Publicar Scripts haga clic en el botón Próximo >.
  9. En la etapa a seguir revise las configuraciones para la generación del script de la base. Haga clic en el botón Próximo >.

  10. Vuelva a la ventana del Microsoft SQL Server Management Studio.

  11. En la nueva ventana abierta con el script comente/remueva las primeras líneas, hasta la instrucción USE [fluig].

...

Seleccione y excluya todas las tablas de esta nueva base de datos.

...

Ejecute el script DUMP generado en esta nueva base de datos, para crear toda la estructura sin ningún registro.

Proceda con la desactivación de las claves (constraints) en las tablas de la base de datos. Para el SGBD Microsoft SQL Server utilice la instrucción a seguir:

...

Abra una ventana de Nueva Consulta (menú Archivo > Nuevo > Consulta del Mecanismo de Banco de Datos);

Ingrese la consulta a continuación y ejecútela en la nueva base de datos.

...

themeEclipse
languagesql

...

</pre>
				</div>
			</div>
			<p>
				<br /> <br />
			</p></li>
		<li>Install the latest version of Fluig and configure it to point
			to this data base (fluig).<br /> <br />
		</li>
		<li>Start the Fluig service, and observe the LOG to make sure
			that <span style="font-size: 10.0pt; line-height: 13.0pt;">the
				service started correctly, without any serious errors, such as
				failure to&#160;</span><span
			style="font-size: 10.0pt; line-height: 13.0pt;">connect with
				SGBD.</span><br /> <span style="font-size: 10.0pt; line-height: 13.0pt;"><br /></span>
		</li>
		<li>After the service has finished starting up (with the message
			"== FLUIG STARTED AND RUNNING RIGHT NOW ==" reported in the LOG),
			interrupt the Fluig service.<br /> <br />
		</li>
		<li>Generate a DUMP of this data base, with the entire structure
			of tables and&#160;<span>fields.&#160;</span><br /> <span>For
				the SGBD Microsoft SQL Server, use the following&#160;</span><span>procedure:</span><br />
			<ol>
				<li style="list-style-type: none;"><ol>
						<li>Move the mouse over the database and click on the right
							button.</li>
						<li>In the drop-down menu, choose <strong>Tasks >
								Generate Scripts...</strong></li>
						<li>Click on <strong>Next ></strong> to see the
							presentation&#160;<span>Introducing <strong>Generate
									and Post Scripts</strong> wizard.
						</span></li>
						<li><span>Check <strong>Generate script for
									entire data&#160;</strong></span><span><strong>base</strong> and <strong>all
									data base objects</strong> and click&#160;</span><span><strong>Next
									></strong>.</span></li>
						<li><span>In the following screen, in the <strong>Output
									Type</strong> group, and in the group below,&#160;
						</span><span>select <strong>Save</strong> in the new query window.
						</span></li>
						<li><span>Click on <strong>Advanced</strong>.
						</span></li>
						<li><span>In the <strong>Advanced Script
									Options</strong> screen, change the option&#160;
						</span><span><strong>Grouping Scripts</strong> to <strong>True</strong>
								and click on <strong>OK</strong>.</span></li>
						<li><span>When returning to the <strong>Generate
									and Post Scripts&#160;</strong>screen, click&#160;
						</span><span>on <strong>Next ></strong>.
						</span></li>
						<li><p>
								In the next step, adjust the configurations to generate a script
								of the base. Click on <strong>Next ></strong>.
							</p></li>
						<li><p>Go back to the Microsoft SQL Server Management
								Studio window.</p></li>
						<li><p>
								<span>In the new window open with the script,
									comment/remove the first few&#160;</span><span>lines, up to the
									<strong>USE [fluig]</strong> instruction.
								</span>
							</p>
							<p>
								<span><br /></span>
							</p></li>
					</ol></li>
			</ol>
		</li>
		<li><p>Select and delete all tables in this new database.</p>
			<p>&#160;</p></li>
		<li><p>
				Execute the script DUMP generate in this new database in order to
				create the entire structure with <strong>no</strong> records.
			</p>
			<p>&#160;</p></li>
		<li><p>Proceed with constraints in the database tables. For
				the SGBD Microsoft SQL Server, use the following&#160;instruction:</p> <br />
			<ol>
				<li style="list-style-type: none;"><ol>
						<li><p>
								Open a New Query window (menu <strong>File > New >
									Database Mechanism Query</strong>);.
							</p></li>
						<li><p>Insert the query below and execute it in the new
								database.</p>
							<div class="code panel pdl" style="border-width: 1px;">
								<div class="codeContent panelContent pdl">
									<pre class="theme: Eclipse; brush: sql; gutter: false"
										style="font-size: 12px;">DECLARE @TABLENAME VARCHAR(8000) 
DECLARE @TABLENAME_HEADER VARCHAR(8000) 
DECLARE TNAMES_CURSOR CURSOR FOR 
 
SELECT [name] from [sys].[tables] 
 
OPEN TNAMES_CURSOR 
 	FETCH NEXT FROM TNAMES_CURSOR INTO @TABLENAME 
 		WHILE (@@FETCH_STATUS 

...

&lt;> -1) 
 		BEGIN 
 			IF (@@FETCH_STATUS 

...

&lt;> -2) 
 			BEGIN 
 			SELECT @TABLENAME_HEADER = 'ALTER TABLE ' + RTRIM(UPPER(@TABLENAME)) + ' NOCHECK CONSTRAINT ALL;' 
			--

...

Change NOCHECK 

...

to CHECK 

...

and 

...

then 

...

enable constraints 
			PRINT @TABLENAME_HEADER 
		END 
	FETCH NEXT FROM TNAMES_CURSOR INTO @TABLENAME 
END
 
SELECT @TABLENAME_HEADER = '--************* 

...

End 

...

of 

...

Tables *************--' 
PRINT @TABLENAME_HEADER PRINT ' ' 
DEALLOCATE TNAMES_CURSOR 

...

Copie el resultado y pegue en una ventana de Nueva Consulta y ejecute (en la nueva base de datos).

 

Con los servicios Fluig parados realice la importación de los datos a partir de la base de datos antigua, con un asistente de importación y exportación de datos, por ejemplo. Para el SGBD Microsoft SQL Server utilice el procedimiento:

  1. Haga clic con el botón derecho del mouse sobre la nueva base de datos.

  2. En el menú suspendido seleccione la opción Tareas > Importar Datos...

  3. En la pantalla de presentación del Asistente de Importación y Exportación del SQL Server haga clic en el botón Avanzar >.

  4. En el campo Fuente de datos seleccione la opción SQL Server Native Client (al final se exhibe el número de la versión, utilice la misma equivalente a la versión del servicio de banco de datos).

  5. En el campo Nombre del servidor indique (digite o seleccione en la caja suspendida) el servidor e instancia que posee la base de datos anterior (que deberá ser compatibilizada / normalizada).

  6. En el grupo Autenticación utilice el método que permite acceso a todos los datos de esta base de datos anterior. Se recomienda el uso de un usuario con permiso de db_owner.

  7. Seleccione o digite, en el campo Banco de datos, la base antigua y haga clic en el botón Avanzar >.

  8. En la pantalla con título (para) Elegir un Destino deben estar rellenados los campos con informaciones de acceso a esta nueva base de datos. Si las informaciones están incorrectas o incompletas, corríjalas, y haga clic en el botón Avanzar >.

  9. A continuación en la pantalla con título Especificar Copia o Consulta de Tabla seleccione la opción Copiar datos de una o más tablas o exhibiciones y haga clic en el botón Avanzar >.

  10. En la pantalla de título Seleccionar Tablas y Exhibiciones de Origen, haga clic en la primera caja de selección que está en los títulos de la lista de Tablas y exhibiciones.

  11. Con todos los seleccionados haga clic en el botón Editar Mapeos...

  12. En la caja Configuraciones de Transferencia marque la caja de selección Habilitar inserción de identidad y, entonces, en el botón OK.

    Nota
    title¡Atención!

    No deje de marcar esta opción para que no ocurran fallas en la copia de los datos.

  13. Volviendo a la ventana anterior, Seleccionar Tablas y Exhibiciones de Origen, haga clic en el botón Avanzar >.

  14. En la pantalla con título Revisar Mapeo de Tipo de Datos haga clic en el botón Avanzar.

  15. En la pantalla con título Ejecutar Paquete marque la caja de selección Ejecutar inmediatamente y haga clic en el botón Avanzar >.

  16. En la pantalla con título Concluir Asistente, después de revisar las acciones haga clic en el botón Avanzar.

  17. En la pantalla a seguir de ejecución de las acciones al final se debe exhibir la información de que la importación se realizó con éxito.

 

...

Realizar el procedimiento de transferencia de los permisos de acceso a los debidos usuarios en la nueva base de datos. Estas se pueden haber perdido.

...

Borrar los directorios temporarios (tmp, log y fecha), localizados en el camino <INSTALL_FLUIG>/jboss/standalone.

...

Modificar en el archivo de configuración, localizado en el camino <INSTALL_FLUIG>/jboss/standalone/standalone.xml, la configuración para el acceso a la base de datos para uso de la nueva base.

...

Reiniciar el servicio.

...

Realizar las validaciones deseadas y uso de la nueva instalación.

 

...

</pre>
								</div>
							</div></li>
						<li><p>Copy the result, paste it in a New Query window
								and execute it (in the new database).</p>
							<p>&#160;</p></li>
					</ol></li>
			</ol></li>
		<li><p>With the Fluig services interrupted, import the data
				from the old database, using, for example, an import and export data
				wizard. For the SGBD Microsoft SQL Server, use the
				following&#160;procedure:</p> <br />
			<ol>
				<li style="list-style-type: none;"><ol>
						<li><p>Move the mouse over the new database and click on
								the right button.</p></li>
						<li><p>
								In the drop-down menu, select <strong>Tasks > Import
									Data...</strong>
							</p></li>
						<li><p>
								In the introductory screen for the SQL Server Import and Export
								Wizard, click on <strong>Next ></strong>.
							</p></li>
						<li><p>
								In the field <strong>Data</strong> source, select <strong>SQL
									Server Native Client</strong> (the version number is displayed at the
								end, use the same number as the data bank service version).
							</p></li>
						<li><p>
								In the field <strong>Server</strong> name, enter the server
								(enter or select from drop-down box) and the instance that has
								the previous database (which must be reconciled /
								normalized).&#160;
							</p></li>
						<li><p>
								In the <strong>Authentication</strong> group, use the method
								that allows access to all data from this previous database. A
								user with <strong>db_owner</strong> permission is recommended.
							</p></li>
						<li><p>
								In the field <strong>Database</strong>, select or enter the
								previous base and click on <strong>Advance ></strong>.
							</p></li>
						<li><p>
								In the screen with the header&#160;<strong>Choose a
									Target</strong>, the fields with access information to this new database
								should be automatically filled out. Correct any incorrect or
								incomplete information and click <strong>Next ></strong>.
							</p></li>
						<li><p>
								In the screen with the header <strong>Specify Copy</strong> or <strong>Table
									Query</strong>, select <strong>Copy</strong> data from one or more
								tables or views and click <strong>Next ></strong>.
							</p></li>
						<li><p>
								In the screen with the header <strong>Select Tables</strong> and
								<strong>Source Views</strong>, click on the first selection box
								in the headers of the <strong>Tables and views</strong> list.
							</p></li>
						<li><p>
								With all options checked, click <strong>Edit
									Mappings...</strong>
							</p></li>
						<li><p>
								In the box <strong>Transfer Settings, </strong>check the box <strong>Enable
									insertion of identity</strong> and OK.
							</p>
							<div class="aui-message warning shadowed information-macro">
								<p class="title">Attention!</p>
								<span class="aui-icon icon-warning">Icon</span>
								<div class="message-content">
									<p>Make sure to check this option to avoid failure in data
										copying.</p>
								</div>
							</div></li>
						<li><p>
								Back to the previous window, <strong>Select Tables</strong> e <strong>Source
									Views</strong>, click on <strong>Next ></strong>.
							</p></li>
						<li><p>
								In the screen with the header <strong>Review Data</strong> <strong>Type
									Mapping</strong>, click <strong>Next</strong>.
							</p></li>
						<li><p>
								In the screen with the header <strong>Execute Package,
								</strong>check <strong>Execute immediately</strong> and click <strong>Next
									></strong>.
							</p></li>
						<li><p>
								In the screen with the header <strong>Conclude Wizard</strong>,
								review the actions taken and click <strong>Next</strong>.
							</p></li>
						<li><p>The following screen, displaying execution of the
								actions, should also display a message that import was
								successful.</p></li>
					</ol></li>
			</ol>
			<p>&#160;</p></li>
		<li><p>Perform access permissions transfer procedure to the
				appropriate users in the new database. These permissions may have
				been lost.&#160;</p>
			<p>&#160;</p></li>
		<li><p>
				Delete the temporary directories (tmp, log and data), located in the
				path <em>&lt;INSTALL_FLUIG>/jboss/standalone</em>.
			</p>
			<p>&#160;</p></li>
		<li><p>
				In the setting file, located in the path <em>&lt;INSTALL_FLUIG>/jboss/standalone/standalone.xml</em>,
				change the setting for access to the database to use of the new
				database.
			</p>
			<p>&#160;</p></li>
		<li><p>Restart the service.</p>
			<p>&#160;</p></li>
		<li><p>Perform the desired validation and use the new
				installation.</p></li>
	</ol>
	<p>&#160;</p>
	<p>&#160;</p>
</div>
<div class="pageSection group">
	<div class="pageSectionHeader">
		<h2 id="attachments" class="pageSectionTitle">Attachments:</h2>
	</div>
	<div class="greybox" align="left">
		<img src="images/icons/bullet_blue.gif" height="8" width="8" alt="" />
		<a href="attachments/118882384/119144523.pdf">Checklist_de_Conversao_Fluig.pdf</a>
		(application/pdf) <br />
	</div>
</div>