<tfoot id='f5ebt'></tfoot>
      <bdo id='f5ebt'></bdo><ul id='f5ebt'></ul>
      1. <small id='f5ebt'></small><noframes id='f5ebt'>

        <i id='f5ebt'><tr id='f5ebt'><dt id='f5ebt'><q id='f5ebt'><span id='f5ebt'><b id='f5ebt'><form id='f5ebt'><ins id='f5ebt'></ins><ul id='f5ebt'></ul><sub id='f5ebt'></sub></form><legend id='f5ebt'></legend><bdo id='f5ebt'><pre id='f5ebt'><center id='f5ebt'></center></pre></bdo></b><th id='f5ebt'></th></span></q></dt></tr></i><div id='f5ebt'><tfoot id='f5ebt'></tfoot><dl id='f5ebt'><fieldset id='f5ebt'></fieldset></dl></div>

        <legend id='f5ebt'><style id='f5ebt'><dir id='f5ebt'><q id='f5ebt'></q></dir></style></legend>

        如何在 Oracle 中使用 Timestamp_to_scn 和 Scn_to_timestamp?

        How to use Timestamp_to_scn and Scn_to_timestamp in Oracle?(如何在 Oracle 中使用 Timestamp_to_scn 和 Scn_to_timestamp?)

        <i id='0ZsdY'><tr id='0ZsdY'><dt id='0ZsdY'><q id='0ZsdY'><span id='0ZsdY'><b id='0ZsdY'><form id='0ZsdY'><ins id='0ZsdY'></ins><ul id='0ZsdY'></ul><sub id='0ZsdY'></sub></form><legend id='0ZsdY'></legend><bdo id='0ZsdY'><pre id='0ZsdY'><center id='0ZsdY'></center></pre></bdo></b><th id='0ZsdY'></th></span></q></dt></tr></i><div id='0ZsdY'><tfoot id='0ZsdY'></tfoot><dl id='0ZsdY'><fieldset id='0ZsdY'></fieldset></dl></div>
        • <bdo id='0ZsdY'></bdo><ul id='0ZsdY'></ul>

            <legend id='0ZsdY'><style id='0ZsdY'><dir id='0ZsdY'><q id='0ZsdY'></q></dir></style></legend><tfoot id='0ZsdY'></tfoot>
              • <small id='0ZsdY'></small><noframes id='0ZsdY'>

                  <tbody id='0ZsdY'></tbody>
                • 本文介绍了如何在 Oracle 中使用 Timestamp_to_scn 和 Scn_to_timestamp?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有这个作为查询的结果:

                  I have this as a result of the query:

                  select cast(to_date(a.start_time,'mm/dd/yyyy hh:mi:ss pm') as timestamp) date_of_call,
                  ora_rowscn from calling_table a where rownum <= 10;
                  
                         DATE_OF_CALLING          ORA_ROWSCN
                  
                  26-JUL-13 12.29.28.000000000 PM 8347567733892
                  26-JUL-13 12.29.35.000000000 PM 8347567733892
                  26-JUL-13 12.29.35.000000000 PM 8347567733892
                  26-JUL-13 12.29.38.000000000 PM 8347567733892
                  26-JUL-13 12.29.44.000000000 PM 8347567733892
                  26-JUL-13 12.29.47.000000000 PM 8347567733892
                  26-JUL-13 12.29.48.000000000 PM 8347567733892
                  26-JUL-13 12.29.48.000000000 PM 8347567733892
                  26-JUL-13 12.29.48.000000000 PM 8347567733892
                  26-JUL-13 12.29.56.000000000 PM 8347567733892
                  

                  但是当我尝试使用函数 timestamp_to_scn 将此时间戳转换为 scn 时,我收到以下错误:

                  But when I try to convert this timestamp into scn using the function timestamp_to_scn, I am getting the following error:

                  ORA-08180: 没有找到基于指定时间的快照ORA-06512:在SYS.TIMESTAMP_TO_SCN",第 1 行08180. 00000 - 未找到基于指定时间的快照"*原因:无法将时间与映射表中的 SCN 匹配.*行动:尝试使用更长的时间.

                  ORA-08180: no snapshot found based on specified time ORA-06512: at "SYS.TIMESTAMP_TO_SCN", line 1 08180. 00000 - "no snapshot found based on specified time" *Cause: Could not match the time to an SCN from the mapping table. *Action: try using a larger time.

                  当我在 ora_rowscn 上使用 scn_to_timestamp 将该列转换为时间戳时,我收到以下错误:

                  And when I am using scn_to_timestamp on ora_rowscn to convert that column into a timestamp, I am getting the following error:

                  ORA-08181: 指定的编号不是有效的系统更改编号ORA-06512:在SYS.SCN_TO_TIMESTAMP",第 1 行08181. 00000 - 指定的号码不是有效的系统变更号码"*原因:提供的 scn 超出了有效 scn 的范围.*操作:使用有效的 scn.

                  ORA-08181: specified number is not a valid system change number ORA-06512: at "SYS.SCN_TO_TIMESTAMP", line 1 08181. 00000 - "specified number is not a valid system change number" *Cause: supplied scn was beyond the bounds of a valid scn. *Action: use a valid scn.

                  我做错了什么?

                  推荐答案

                  你想回头看太远了.您只能与系统维护的重做/闪回窗口中的 SCN 相互转换.一旦更改过期,映射就会丢失.

                  You're trying to look too far back. You can only convert to and from SCNs that are in the redo/flashback window maintained by your system. Once changes age out then the mapping is lost.

                  在文档中对此进行了说明:

                  This is explained in the documentation:

                  生成 SCN 时 SCN 和时间戳之间的关联会在有限的时间内被数据库记住.该时间为自动调优的undo保留时间的最大值,如果数据库运行在Automatic Undo Management模式下,数据库中所有闪回存档的保留时间不小于120小时.仅当数据库打开时,关联过时的时间才会过去.如果为 SCN_TO_TIMESTAMP 的参数指定的 SCN 太旧,则会返回错误.

                  The association between an SCN and a timestamp when the SCN is generated is remembered by the database for a limited period of time. This period is the maximum of the auto-tuned undo retention period, if the database runs in the Automatic Undo Management mode, and the retention times of all flashback archives in the database, but no less than 120 hours. The time for the association to become obsolete elapses only when the database is open. An error is returned if the SCN specified for the argument to SCN_TO_TIMESTAMP is too old.

                  请记住,这些是 Oracle 内部机制的一部分,因此对我们的用处有限;尽管它们当然对闪回查询很有用 - 再次在同一窗口内.

                  Bear in mind these are part of Oracle's internal mechanism, and so are of limited use to us; though they are useful for flashback queries of course - again within the same window.

                  这篇关于如何在 Oracle 中使用 Timestamp_to_scn 和 Scn_to_timestamp?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Oracle PL/SQL - Raise User-Defined Exception With Custom SQLERRM(Oracle PL/SQL - 使用自定义 SQLERRM 引发用户定义的异常)
                  Oracle: is there a tool to trace queries, like Profiler for sql server?(Oracle:是否有跟踪查询的工具,例如用于 sql server 的 Profiler?)
                  SELECT INTO using Oracle(使用 Oracle SELECT INTO)
                  How to handle Day Light Saving in Oracle database(如何在 Oracle 数据库中处理夏令时)
                  PL/SQL - Use quot;Listquot; Variable in Where In Clause(PL/SQL - 使用“列表Where In 子句中的变量)
                  Oracle: Import CSV file(Oracle:导入 CSV 文件)
                    <legend id='iWnkK'><style id='iWnkK'><dir id='iWnkK'><q id='iWnkK'></q></dir></style></legend>

                    <small id='iWnkK'></small><noframes id='iWnkK'>

                    <tfoot id='iWnkK'></tfoot>
                      • <bdo id='iWnkK'></bdo><ul id='iWnkK'></ul>

                      • <i id='iWnkK'><tr id='iWnkK'><dt id='iWnkK'><q id='iWnkK'><span id='iWnkK'><b id='iWnkK'><form id='iWnkK'><ins id='iWnkK'></ins><ul id='iWnkK'></ul><sub id='iWnkK'></sub></form><legend id='iWnkK'></legend><bdo id='iWnkK'><pre id='iWnkK'><center id='iWnkK'></center></pre></bdo></b><th id='iWnkK'></th></span></q></dt></tr></i><div id='iWnkK'><tfoot id='iWnkK'></tfoot><dl id='iWnkK'><fieldset id='iWnkK'></fieldset></dl></div>

                            <tbody id='iWnkK'></tbody>