Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • switchlogfile.sh Linux/Unix
  • New Latest Param.sql for finding all hidden parameters also Oracle
  • Wait Based Tuning Step by step with SQL statement Oracle
  • Running select from V$ views from remote server Linux/Unix
  • changing kernel parameter in Oracle Enterpise Linux Linux/Unix
  • longtx.sql Oracle
  • get_ratio.sql get the ratio of users from v$session and this uses CASE-WHEN-THEN clause Oracle
  • Goldengate Tutorial Oracle
  • copying/removing directory with all its subdirectory Linux/Unix
  • Implementing Listener Security Oracle
  • database trigger failing Oracle
  • pvm_rbs1.sql (to collect rbs info from db) Oracle
  • kill all processes from specific user in solaris. Linux/Unix
  • My FTP Job Scheduling for www.pvmehta.com PHP/MYSQL/Wordpress
  • replacing ^M character when passing files from Windows to Unix Linux/Unix

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

  • find_string_in_database.sql Oracle
  • ENQ: KO – FAST OBJECT CHECKPOINT tips Oracle
  • Kill a session dynanically using execute immediate Oracle
  • Adding Datafile on Primary Server and Impact on Standby Server Oracle
  • SQL Tracker by SID sqltrackerbysid.sql Oracle
  • How to Decide upto what level you can decrement your datafile size. ( Shrink Datafile) Oracle

Leave a Reply Cancel reply

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

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Django (0)
  • GIT (1)
  • Linux/Unix (150)
  • MYSQL (5)
  • Oracle (403)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (18)
  • rman-dataguard (26)
  • shell (151)
  • SQL scripts (349)
  • SQL Server (6)
  • Uncategorized (5)
  • Videos (0)

Recent Posts

  • Key Management in Oracle: The Core Issue: Missing Master Key12-May-2026
  • SAT Mathematics 10 questions and answer at the end.30-Apr-2026
  • top 10 AI news today30-Apr-2026
  • runon_allpdbs_show_conname.sh23-Apr-2026
  • runon_allcdbs_find_pdbs.sh23-Apr-2026
  • Running PDB on single node in RAC09-Apr-2026
  • find_arc.sql09-Apr-2026
  • pvm_pre_change.sql08-Apr-2026
  • find_encr_wallet.sql08-Apr-2026
  • find_pdbs.sql08-Apr-2026

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • DBMS_SQL for alter session. Oracle
  • _B_TREE_BITMAP_PLANS issue during 8.1.7 to 9.2.0.8 upgrade Oracle
  • ORA-00064: object is too large to allocate on this O/S during startup Oracle
  • initUOCIOTTO.ora Oracle
  • create PLAN_TABLE command. Oracle
  • dbinv.sql Oracle
  • Oracle Recommended Patches — Oracle Database ID 756671.1 Oracle
  • SQL Server Vs Oracle Architecture difference SQL Server

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme