Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • tblwopk.sql /* Find Tables Without PK */ Oracle
  • Library cahe Latches and internal explaination Oracle
  • standard Monitoring – 1 Oracle
  • Validating ORACLE_SID againt oratab file. Linux/Unix
  • When error comes for temporary tablespace with version <= 9i Oracle
  • Renaming Global Name GLOBAL_NAME Oracle
  • move_arch_files.ksh Linux/Unix
  • how to find VIP from ifconfig Linux/Unix
  • Find long Running Transaction Linux/Unix
  • Restoring a user’s original password 1051962.101 Oracle
  • 284785.1 How to check RAC Option is currently linked into the Oracle Binary Oracle
  • good linux notes Linux/Unix
  • Convert multiple rows to single column Oracle
  • to see when crontab is changed. Linux/Unix
  • Generate SSH without password authentication. 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

  • create trigger syntax Oracle
  • Temporary tablespace explaination Oracle
  • Oracle Support Metalink ID 161818.1 Oracle
  • How to find pinned objects from shared pool. (pinned via dbms_shared_pool.keep) Oracle
  • Goldengate Tutorial Oracle
  • Oracle Connections expire_time and firewall 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 (387)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (336)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • 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
  • Reading config file from other folder inside class24-Sep-2024
  • Python class import from different folders22-Sep-2024
  • Transfer SQL Profiles from One database to other database.05-Sep-2024
  • Load testing on Oracle 19C RAC with HammerDB18-Jan-2024
  • Add new columns in dataframe30-Sep-2023

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Query to Generate aggregate on every 30 mins. Oracle
  • Some OS level threshold for performance. Linux/Unix
  • rm_backup_arch_file.ksh Linux/Unix
  • How to analyze statspack or AWR report. Oracle
  • Wait.sql Oracle
  • Updated LCK.SQL file. Oracle
  • note id 373303.1 Linux/Unix
  • runsql_once.ksh Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme