Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • find_string_in_database.sql Oracle
  • Reading parameter file and printing Linux/Unix
  • Convert multiple rows to single column Oracle
  • sess1.sql Oracle
  • usnsql.sql Displays information about UNDO segments with sql statements Oracle
  • Check_recovery.sh program to run sqlplus and return its values remotely. Linux/Unix
  • How does one overcome the Unix 2 Gig file limit? Linux/Unix
  • find_idle_cpu.sql Oracle
  • Oracle GoldenGate lag monitoring shell script Linux/Unix
  • find checksum of a file. Linux/Unix
  • changing kernel parameter in Oracle Enterpise Linux Linux/Unix
  • temp_use.sql diplays usage of temp ts Oracle
  • find_longsql.sql Oracle
  • catall.sh Linux/Unix
  • Database link password in user_db_links Oracle

Caching sequence in Memory

Posted on 14-Sep-2009 By Admin No Comments on Caching sequence in Memory

ALTER SEQUENCE CS.SESSION_ACTIVE_SEQ_ID CACHE 2000;

exec sys.DBMS_SHARED_POOL.KEEP(‘CS.SESSION_ACTIVE_SEQ_ID ‘, ‘Q’) =>> To pin the sequence using the DMBS_SHARED_POOL.KEEP procedure (IF NEEDED)

Potential drawbacks

Setting a cache size larger then 0 can result in the loss of sequence values if the system is shutdown abruptly. When the system fails, the values that were preserved in memory are lost to the sequence.

For example, assume a sequence has been created with a cache size of 100. The first time the sequence is used, Oracle caches values 1 – 100 in memory. Subsequently, Oracle sessions use the cached information and use values 1 – 45. At this point the Oracle shuts down abruptly. When the sequence is used after start up, Oracle caches values 101 – 200 in memory, resulting in values 46 – 100 being lost.

Additionally, sequence values that have been cached in the Shared Pool can be aged out of memory depending on the activity of the database. To avoid aging out a sequence, pin the sequence using the DMBS_SHARED_POOL.KEEP procedure

Oracle, SQL scripts

Post navigation

Previous Post: Remove DOS CR/LFs (^M)
Next Post: cp_filesystem.sql

Related Posts

  • Create type and Grant on it. Oracle
  • Import and export statements Oracle
  • SCRIPT TO LIST RECURSIVE DEPENDENCY BETWEEN OBJECTS UTLDTREE.sql Oracle
  • Oracle Metalink useful notes Oracle
  • usnsql.sql Displays information about UNDO segments with sql statements Oracle
  • This is im telling Kishore Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • Oracle (392)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (341)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • load SPM baseline from cursor cache05-Jun-2025
  • Drop all SPM baselines for SQL handle05-Jun-2025
  • Load SPM baseline from AWR05-Jun-2025
  • Drop specific SQL plan baseline – spm05-Jun-2025
  • findinfo.sql (SQL for getting CPU and Active session info)27-May-2025
  • SQL Tracker by SID sqltrackerbysid.sql22-Apr-2025
  • How to connect to Oracle Database with Wallet with Python.21-Mar-2025
  • JSON/XML Types in Oracle18-Mar-2025
  • CPU Core related projections12-Mar-2025
  • Exadata Basics10-Dec-2024

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Database logon trigger issue Oracle
  • find_string_in_database.sql Oracle
  • Passing from Unix to PLSQL using bind variables Linux/Unix
  • Export Oracle data and Compress at same time Oracle
  • tblwopk.sql tablewopk.sql Oracle
  • FRA Information. Oracle
  • Process Map for CPU and Memory for OS processes Linux/Unix
  • How to Use DBMS_STATS to Move Statistics to a Different Database Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme