1. 程式人生 > >【指令碼】Resumable Space Allocation Example

【指令碼】Resumable Space Allocation Example

1. The user running thetransaction requires the RESUMABLE system privilege:

SQL> conn system/oracle
Connected.

SQL> grant resumable to scott;
Grant succeeded.

resumable許可權也被包含在其role裡面,比如dba,當一個使用者擁有dba role時,就自動擁有了resumable privilege.

2. Set the session sothat the following transactions might be resumed in case of interruption due to

space allocation:

 SQL> alter session enable resumable;
 Session altered.

This can be set automatically through anAFTER LOGON trigger.    --也可以通過觸發器來自動設定

  SQL> create or replace trigger logon_set_resumable
    2  after logon
    3  on scott.schema
    4  begin
    5  	execute immediate 'alter session enable resumable timeout 1200';
    6  end;
    7  /
 
  Trigger created.

 3. While inserting newrows into TEST_RESUMABLE table, the user session hangs,but the transaction doesnot roll back:

The DBA can retrieve(得到;取到) the reason why the session of user SCOTT hangs in DBA_RESUMABLEview:3.1 Displaying the DBA_RESUMABLE view:

   SQL> select user_id,SESSION_ID, STATUS, START_TIME, SUSPEND_TIME,
     2         SQL_TEXT, ERROR_NUMBER, ERROR_MSG
     3  from dba_resumable;
      USER_ID SESSION_ID STATUS    START_TIME           SUSPEND_TIME
   ---------- ---------- --------- -------------------- --------------------
   SQL_TEXT
   -------------------------------------------------------------------------
   ERROR_NUMBER
   ------------
   ERROR_MSG
   -------------------------------------------------------------------------
           54          9 SUSPENDED 03/14/01 10:49:25    03/14/01 11:14:17
   insert into test_resumable select * from test_resumable
           1631
   ORA-01631: max # extents (5) reached in table SCOTT.TEST_RESUMABLE

 3.2 In alert.log file:

     Wed Mar 14 11:14:17 2001
     statement in resumable session 'User SCOTT(54), Session 9, Instance 1'was suspended due to ORA-01631: max # extents (5) reached in table SCOTT.TEST_RESUMABLE

 3.3 The statement mayissue the following error when the timeout set for the session has expired:

      SQL> insert into test_resumable values (1);
      insert into test_resumable values (1)
               *
      ERROR at line 1:
      ORA-30032: the suspended (resumable) statement has timed out
      ORA-01536: space quota exceeded for tablespace 'EXAMPLE'

3.4 The DBA now knows whythe session hangs, and needs to find which action to take to alleviate theora-01536 error:

   SQL>  connect system/manager
   Connected.
   SQL> alter table scott.test_resumable storage (max extents 8);
   Table altered.

  In alert.log file:

      Wed Mar 14 11:24:02 2001
      statement in resumable session 'User SCOTT(54), Session 9, Instance 1' 
      was resumed and no more errors in DBA_RESUMABLE view:
   SQL>select user_id,SESSION_ID, STATUS, START_TIME, RESUME_TIME,
     2         SQL_TEXT, ERROR_NUMBER, ERROR_MSG
     3  from dba_resumable;
      USER_ID SESSION_ID STATUS    START_TIME           RESUME_TIME  
   ---------- ---------- --------- -------------------- --------------------
   SQL_TEXT
   -------------------------------------------------------------------------
   ERROR_NUMBER
   ------------
   ERROR_MSG
   -------------------------------------------------------------------------
           54          9 NORMAL    03/14/01 10:49:25    03/14/01 11:24:02
   insert into test_resumable select * from test_resumable
              0

   While the status is NORMAL or the error_number is 0, the resumable statements keep on working correctly unless the timeout is expired.   This also means that there are sessions set in resumable state.   As soon as an error_number <> 0 appears, then a resumable session has encountered a space allocation issue.Note:   The DBA can cancel the resumable transaction by aborting the session by the procedure DBMS_RESUMABLE.ABORT(sid#). An ORA-1013 "user requested cancel of current operation" is returned to the user.

3.5 If the session doesnot need to be in resumable state, the session can disable the resumable state:

   SQL> alter session disable resumable;
   Session altered.
   SQL> select user_id,SESSION_ID, STATUS, START_TIME, RESUME_TIME,
     2         SQL_TEXT, ERROR_NUMBER, ERROR_MSG
     3  from dba_resumable;
 
   no rows selected

 3.6 Other space errors that suspend transactions-------------------------------------------------------------------***statement in resumable session 'User SCOTT(54), Session 9, Instance 1' was suspended due to ORA-01536: space quota exceeded for tablespace 'EXAMPLE'***statement in resumable session 'User SCOTT(54), Session 8, Instance 1' was suspended due to ORA-01562: failed to extend rollback segment number 11***statement in resumable session 'User SCOTT(54), Session 8, Instance 1' was suspended due to ORA-01628: max # extents (2) reached for rollback segment RS01 FULL status of rollback segment 11 set***statement in resumable session 'User SCOTT(54), Session 9, Instance 1' was suspended due to ORA-01631: max # extents (2) reached in table SCOTT.TEST_RESUMABLE ***statement in resumable session 'User SYSTEM(5), Session 8, Instance 1' was suspended due to ORA-01652: unable to extend temp segment by 32 in tablespace TEMP_TS ***statement in resumable session 'User SCOTT(54), Session 9, Instance 1' was suspended due to ORA-01653: unable to extend table SCOTT.TEST_RESUMABLE by 256 in tablespace USERS ***statement in resumable session 'User SCOTT(34), Session 8, Instance 1' was suspended due to ORA-01654: unable to extend index SCOTT.SYS_IOT_TOP_27956 by 8 in tablespace PERM_DICT_2K***statement in resumable session 'User SYSTEM(5), Session 11, Instance 1' was suspended due to ORA-01658: unable to create INITIAL extent for segment in tablespace LMT_1***statement in resumable session 'User SYSTEM(5), Session 11, Instance 1' was suspended due to ORA-01659: unable to allocate MINEXTENTS beyond 42 in tablespace LMT_13.7 Other messages in alert.log:***Wed Mar 14 10:43:52 2001statement in resumable session 'User SCOTT(54), Session 9, Instance 1' was aborted

相關推薦

指令碼Resumable Space Allocation Example

1. The user running thetransaction requires the RESUMABLE system privilege: SQL> conn system/oracle Connected. SQL> grant resumable to scott; Gra

Linuxno space left on device 磁碟空間不足原因及排查方法

在系統使用中,經常會遇到no space left on device 磁碟空間不足的情況, 下面來詳細的介紹一下產生這種情況的幾種原因及解決辦法: 1. 首先我們要清楚inode 和 block的概念: inode在格式化建立檔案系統的時候誕生,用來存放檔案的屬性資訊,

Unity3D指令碼 按鍵盤Esc彈出退出面板 確定退出遊戲 取消關閉面板

按鍵盤Esc彈出退出面板,確定退出遊戲,取消關閉面板。效果圖: 指令碼: using UnityEngine; using System.Collections; public class Exit : MonoBehaviour { public GameObj

Unity3D指令碼滑鼠對攝像機的控制

第一次發控制攝像機旋轉程式碼是幾個月前。 好幾個月不做Unity了,突然有個小專案用到了這個指令碼,順手就把以前寫的程式碼找來用了,可看到寫的程式碼……好爛!!!重新整理了一遍。 using UnityEngine; using System.Collections;

JMicro微服務部署example.provider應用

JMicro是一個用Java語言實現的開源微服務全家桶, 原始碼地址:https://github.com/mynewworldyyl/jmicro, Demo地址:http://124.70.152.7  。 功能簡介: https://www.cnblogs.com/jmicro/p/

MongoDB數據庫Java MongoDB CRUD Example

tps shell ase 命令 server ocl drive users find 上一篇我們講了MongoDB 的命令入門初探,本篇blog將基於上一篇blog所建立的數據庫和表完畢一個簡單的Java MongoDB CRUD Example,利用Java連

通過ionice和nice降低shell指令碼執行的優先順序

對於一些執行時會造成系統滿載的指令碼, 例如資料庫備份, 會影響當時其他服務的響應速度, 可以通過ionice和nice對其IO優先順序和CPU優先順序進行調整例如降低"/usr/local/bin/backup.sh"的IO優先順序, 讓其他程序順暢執行: /usr/bin/ionice -c2 -

指令碼語言JavaSciptRINGO JS 模組 ringo/buffer

Ringo 是一個 JavaScript 平臺 ECMA JavaScript 規範將該語言描述為面向物件的程式語言,用於在主機環境中執行計算和處理計算物件。每個用 JavaScript 編寫的應用程式都需要一個主機環境,它提供特定於環境的物件和 API 來執行 I / O。 Ringo 為 J

指令碼語言RINGO JS-模組 test

模組 test 符合 CommonJS Unit 單元測試規範的測試執行器。 它管理單元測試的執行並處理測試結果。 跑步者將失敗的總數報告為退出狀態碼。 跑步者將模組視為測試用例。 測試用例定義了燈具執行多個測試。 測試用例可以提供可選的setUp() 和 tearDow

指令碼語言RINGO JS模組 system

模組 system 該模組提供了符合 CommonJS System/1.0 規範的系統模組的實現。除了標準之外,還提供了print() 函式。 Functions exit (status) print () Properti

指令碼語言RINGO JS模組 net

模組 net 該模組為使用 TCP 和 UDP socket的網路提供支援。 socket表示客戶端和伺服器程式之間通過網路的連線。 底層的本地繫結是由 java.net 包提供的。 Example // A simple TCP server var io = require('io'

指令碼語言RINGO JS-模組 io

模組 io 該模組提供讀取和寫入原始位元組流的功能。 它根據 CommonJS IO/A 提議實現 Stream 和 TextStream 類。 流與其他兩個模組密切相關。 低階位元組操作由二進位制模組提供,並使用用 ByteArray 或 ByteString 類。&n

指令碼語言RINGO JS模組 fs

模組 fs 該模組提供了一個檔案系統API,用於處理路徑,目錄,檔案,連結以及輸入和輸出流的構造。 它遵循 CommonJS Filesystem/A 提議。 Example // Writes a simple text file var fs = require(

指令碼語言RINGO JS 模組 console

模組 console 該模組提供了在標準輸出流 stdout 和錯誤流 stderr 上寫入錯誤記錄和快速除錯的功能。它與大多數 Web 瀏覽器中實現的控制檯物件類似。 Functions assert (expression, msg...) dir (

指令碼語言RINGO JS-模組 binary

模組 binary 在處理網路套接字或二進位制檔案時,需要讀取和寫入位元組流。 JavaScript 本身並不提供二進位制資料的本地表示,所以這個模組提供了兩個類來解決這個缺點。 實施遵循 CommonJS Binary/B 提案。 ByteArray 實現了可

指令碼語言RINGO JS-模組 assert

模組 assert 斷言庫用於單元測試。 它實現了 CommonJS Unit 單元測試規範並增加了一些額外的便利方法。 所有方法都允許附加引數:comment。 如果斷言失敗,則該註釋將被附加到錯誤訊息中。 Example const assert = requir

指令碼語言RINGO JS簡介

Ringo 101 為了讓使用者更高效地編寫和執行 Javascript 指令碼,我們在 Total Control 指令碼環境中集成了 RingoJS 框架,使用者可在指令碼中直接引入並使用 RingoJS 提供的大量豐富的庫。 例如:如果您想在指令碼中使用 RingoJS 模組 fs 中的方

iOSiOS馬甲包製作+OC、Swift垃圾程式碼生成指令碼

文章目錄 一、馬甲包介紹 1、什麼是馬甲包 2、為什麼要製作馬甲包 3、怎麼製作馬甲包 二、OC垃圾程式碼生成指令碼 三、Swift垃圾程式碼生成指令碼

linuxshell指令碼除錯技術

在使用gcc編譯keepalived原始碼的時候,需要執行configure生成Makefile,然後用make命令編譯。但是在這個過程中,configure檔案卻一直無法掃描到一個已經安裝的三方庫。無奈,只能檢視configure原始碼。configure其實就是一個shell指令碼,為了

shell 指令碼使用 記錄

1.nginx日誌切割 vi /var/log/nginx/cut_nginx_log.sh #!/bin/bash date=$(date +%F -d -1day) cd /var/log/nginx/ if [ ! -d cut ] ; then mkdir cut fi mv