Trabalhe com ficheiros de registo de refazer da base de dados Oracle
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
O serviço de migração de base de dados tira partido da API Oracle LogMiner, que faz parte da base de dados Oracle, para consultar ficheiros de registo de refazer arquivados. Estes ficheiros contêm informações sobre o histórico de atividade numa base de dados. Cada base de dados do Oracle tem um conjunto de ficheiros de registo de refazimento online.
Todos os registos de transações na base de dados são registados nos ficheiros.
Quando o ficheiro de registo de refazer atual é rodado (ou comutado), o processo de arquivo
copia este ficheiro para um armazenamento de arquivo. Entretanto, a base de dados promove outro ficheiro para servir como o ficheiro atual.
Quando o serviço de migração de bases de dados usa a API Oracle LogMiner, não acede aos ficheiros de registo de refazer online, mas funciona apenas com os ficheiros de registo arquivados.
O acesso a ficheiros de registo de refazer arquivados adiciona inerentemente alguma latência ao processo de migração. Esta página descreve a configuração sugerida para as bases de dados de origem da Oracle para controlar o impacto da latência.
Defina parâmetros de configuração para ficheiros de registo de repetição do Oracle
Este design tem implicações profundas na potencial latência do serviço de migração de bases de dados. Se os ficheiros de registo de refazer do Oracle forem comutados com frequência ou mantidos com um tamanho inferior (por exemplo, < 256 MB), o Database Migration Service pode replicar as alterações mais rapidamente.
Existem parâmetros de configuração que pode definir para controlar a frequência de rotação do ficheiro de registo:
Tamanho: os ficheiros de registo de refazer online têm um tamanho mínimo de 4 MB e o tamanho predefinido depende do seu sistema operativo. Pode modificar o tamanho dos ficheiros de registo criando novos ficheiros de registo online e eliminando os ficheiros de registo mais antigos.
Para encontrar o tamanho dos ficheiros de registo de refazer online, execute a seguinte consulta:
SELECT GROUP#, STATUS, BYTES/1024/1024 MB FROM V$LOG
Hora: o parâmetro ARCHIVE_LAG_TARGET fornece um limite superior de quanto tempo (em segundos) o registo atual da base de dados principal pode abranger.
Este não é o momento exato da mudança de registo, porque tem em conta o tempo necessário para arquivar o registo. O valor predefinido é 0 (sem limite superior) e sugere-se um valor razoável de 1800 (ou 30 minutos) ou menos.
Pode usar os seguintes comandos para definir o parâmetro ARCHIVE_LAG_TARGET
durante a inicialização ou enquanto a base de dados está ativa:
SHOW PARAMETER ARCHIVE_LAG_TARGET; Este comando apresenta
quantos segundos o registo atual vai abranger.
ALTER SYSTEM SET ARCHIVE_LAG_TARGET = number-of-seconds;
Use este comando para alterar o limite superior.
Por exemplo, para definir o limite superior para 10 minutos (ou 600 segundos),
introduza ALTER SYSTEM SET ARCHIVE_LAG_TARGET = 600;
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-21 UTC."],[[["\u003cp\u003eDatabase Migration Service utilizes the Oracle LogMiner API to access archived redo log files, which contain a history of database activity, instead of the online redo log files, introducing some latency.\u003c/p\u003e\n"],["\u003cp\u003eThe frequency of Oracle redo log file switching and their size significantly impact the latency of Database Migration Service, with more frequent switching and smaller file sizes leading to faster replication.\u003c/p\u003e\n"],["\u003cp\u003eYou can modify the size of online redo log files, with a minimum of 4 MB, using guides provided for self-hosted Oracle and Amazon RDS Oracle environments.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eARCHIVE_LAG_TARGET\u003c/code\u003e parameter controls the maximum duration (in seconds) that a current log can span, with a suggested value of 1800 seconds (30 minutes) or less to enhance performance.\u003c/p\u003e\n"],["\u003cp\u003eAlthough it's possible to manually switch redo log files using the \u003ccode\u003eALTER SYSTEM SWITCH LOGFILE;\u003c/code\u003e command, it's not advised for production due to its privilege requirements and potential performance impact.\u003c/p\u003e\n"]]],[],null,["# Work with Oracle database redo log files\n\nDatabase Migration Service leverages the Oracle LogMiner API, which is part of Oracle Database, to\nquery archived redo log files. These files contain information about the history\nof activity on a database. Each Oracle database has a set of online redo log files.\nAll transaction records on the database are recorded in the files.\n\nWhen the current redo log file is rotated (or switched), the archive process\n[copies this file into an archive storage](https://docs.oracle.com/en/database/oracle/oracle-database/19/admin/managing-archived-redo-log-files.html#GUID-9BD00F2E-DC98-4871-8D26-FDB40623909C). Meanwhile, the database promotes\nanother file to serve as the current file.\n\nWhen Database Migration Service uses the Oracle LogMiner API, it doesn't access\nthe online redo log files but only works with the archived log files.\nAccessing archived redo log files inherently adds some latency to the migration\nprocess. This page describes suggested configuration for your Oracle\nsource databases to control the latency impact.\n\nSet configuration parameters for Oracle redo log files\n------------------------------------------------------\n\nThis design has profound implications on Database Migration Service's potential latency. If\nOracle redo log files are switched frequently or kept to a smaller size (for\nexample, \\\u003c 256MB), Database Migration Service can replicate changes faster.\n\nThere are configuration parameters that you can set to control the log file\nrotation frequency:\n\n- **Size:** Online redo log files have a minimum size of 4 MB, and\n the default size is dependent on your operating system. You can modify the size\n of the log files by creating new online log files and dropping the older log files.\n\n To find the size of the online redo log files, run the following query: \n\n ```\n SELECT GROUP#, STATUS, BYTES/1024/1024 MB FROM V$LOG\n ```\n | For self-hosted Oracle, use [this guide](https://logic.edchen.org/how-to-resize-redo-logs-in-oracle/). For Amazon RDS Oracle, use [Performing common log-related tasks for Oracle DB instances](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.CommonDBATasks.Log.html#Appendix.Oracle.CommonDBATasks.ResizingRedoLogs) in the Amazon RDS documentation.\n- **Time:** The `ARCHIVE_LAG_TARGET` parameter provides an upper limit of how long (in seconds) the current log of the primary database can span.\n\n This isn't the exact log switch time, because it takes into account how long\n it will take to archive the log. The default value is `0` (no upper bound),\n and a reasonable value of `1800` (or 30 minutes) or less is suggested.\n\n You can use the following commands to set the `ARCHIVE_LAG_TARGET`\n parameter, either during initialization or while the database is up:\n - `SHOW PARAMETER ARCHIVE_LAG_TARGET;` This command displays how many seconds it will take for the current log to span.\n - `ALTER SYSTEM SET ARCHIVE_LAG_TARGET = `\u003cvar translate=\"no\"\u003enumber-of-seconds\u003c/var\u003e`;` Use this command to change the upper limit.\n\n For example, to set the upper limit to 10 minutes (or 600 seconds),\n enter `ALTER SYSTEM SET ARCHIVE_LAG_TARGET = `\u003cvar translate=\"no\"\u003e600\u003c/var\u003e`;`\n\n| You can switch the redo log files manually by running the following command:\n|\n| `ALTER SYSTEM SWITCH LOGFILE;`\n|\n| Although using this command is effective for testing purposes, we don't\n| recommend it for production use-cases because of the privileges it requires\n| and the significant performance impact on the database."]]