Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • switchover for primary database Oracle
  • Oracle vs MYSQL Architecture differences (For DBAs) MYSQL
  • Checking SQL Server Version SQL Server
  • Implementation of key based authentications Linux/Unix
  • fkwoind.sql fkwoindex.sql Oracle
  • Btee and Bitmap Plans in Oracle 9i and higher Oracle
  • Check SQL Server edition SQL Server
  • get_vmstat.ksh for Solaris Oracle
  • Some OS level threshold for performance. Linux/Unix
  • plan10g.sql good Oracle
  • Rman Notes -1 Oracle
  • To find all disk io ( EMC as well as local) Linux/Unix
  • longtx.sql with the flag whether session is blocking any DML locks or not. Oracle
  • Sample WW22 listener.ora Oracle
  • Process Map for CPU and Memory for OS processes 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

  • Rman Notes -1 Oracle
  • SQL_PROFILE – I explaination Oracle
  • Standby Database File Management in 10g with STANDBY_FILE_MANAGEMENT Oracle
  • My Test Case On 21-OCT-2005 Oracle
  • Metalink Note: Note:250655.1 : ADDM Basics USING THE AUTOMATIC DATABASE DIAGNOSTIC MONITOR Oracle
  • Display the top 5 salaries for each department using single SQL 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 (400)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (18)
  • rman-dataguard (26)
  • shell (150)
  • SQL scripts (348)
  • SQL Server (6)
  • Uncategorized (3)
  • Videos (0)

Recent Posts

  • 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
  • Creating a Container Database using dbaascli08-Apr-2026
  • track_autoupgrade_copy_progress.sql01-Apr-2026
  • refre.sql for multitenant01-Apr-2026
  • prepfiles.sh for step by step generating pending statistics files10-Mar-2026
  • tracksqltime.sql05-Mar-2026

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • fuser to check who is using diretory Linux/Unix
  • SQL Server: How to see historical transactions SQL Server
  • How to start CRS manually Oracle
  • Default User Profile Oracle
  • Good links for x$ tables in oracle. Oracle
  • SYSOPER Mystery Oracle
  • Histogram information Oracle
  • SQL Server: How to see current transactions or requests SQL Server

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme