Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Vivek’s egrep commands to trace problem. (on linux x86-64) Linux/Unix
  • The most important Tuning Notes Oracle
  • Histogram information Oracle
  • check_copy_progress.sh Linux/Unix
  • find_du.ksh to find # of files, their sizes in current folder and its subdolder Linux/Unix
  • For Search and replace unix command. Linux/Unix
  • find_log_switch.sql Find log switches in graphical manner Oracle
  • Goog notes on X$ tables Oracle
  • to see when crontab is changed. Linux/Unix
  • dbinv.sql Oracle
  • Wait.sql Oracle
  • Is It Recommended To Apply Patch Bundles When PSU Is Available? -ID 743554.1 Oracle
  • get_vmstat.ksh for Solaris Oracle
  • Search and replace pattern Linux/Unix
  • Renaming the column name 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

  • How to Use DBMS_STATS to Move Statistics to a Different Database Oracle
  • This is from Temi Oracle
  • perf_today.sql Oracle
  • How to specify 2 arch location to avoid any kind of DB hanging. Oracle
  • Oracle Standby Database Library Index from Metalink Oracle
  • get_ratio.sql get the ratio of users from v$session and this uses CASE-WHEN-THEN clause 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 (149)
  • MYSQL (5)
  • Oracle (395)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (150)
  • SQL scripts (343)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • prepfiles.sh for step by step generating pending statistics files10-Mar-2026
  • tracksqltime.sql05-Mar-2026
  • Complete Git Tutorial for Beginners25-Dec-2025
  • Postgres DB user and OS user.25-Dec-2025
  • Trace a SQL session from another session using ORADEBUG30-Sep-2025
  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • cache buffer chain latch Oracle
  • Privileges Required to Create Procedures and Functions that uses objects from other schema. Oracle
  • Optimizer_Index init.ora parameter explaination. Oracle
  • Adding Datafile on Primary Server and Impact on Standby Server Oracle
  • runsql_once.ksh Linux/Unix
  • Jai Shree Ram Oracle
  • find_log_switch.sql Find log switches in graphical manner Oracle
  • online_ts_bkup.sql Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme