zoukankan      html  css  js  c++  java
  • Oracle EBS 表空间

    -- DATA 
    这里仅提供查询锁和解锁。有时,锁是正常的,所以杀掉正锁着的进程有一定的风险性。
    具体步骤如下:
    -- 1.0 查看 holder的进程
    SELECT DECODE(request, 0, 'Holder: ', 'Waiter: ') || sid sess,
           id1,
           id2,
           lmode,
           request,
           type
      FROM V$LOCK
     WHERE (id1, id2, type) IN
           (SELECT id1, id2, type FROM V$LOCK WHERE request > 0)
     ORDER BY id1, request;
    -- 2.0 看 lock的表
    SELECT DOB.OBJECT_NAME,
           VSS.CLIENT_IDENTIFIER,
           LO.SESSION_ID || ',' || VSS.SERIAL#,
           LO.LOCKED_MODE,
           VSS.SERIAL#,
           VSS.ACTION,
           VSS.OSUSER,
           VSS.LOGON_TIME,
           VSS.PROCESS,
           VPS.SPID,
           VSS.*
      FROM V$LOCKED_OBJECT LO, DBA_OBJECTS DOB, V$SESSION VSS, V$PROCESS VPS
     WHERE LO.OBJECT_ID = DOB.OBJECT_ID
       AND LO.SESSION_ID = VSS.SID
       AND VSS.PADDR = VPS.ADDR
       and VSS.SID = ; -- 值去 1.0 sess 字段 holder: 后的数字
       
     -- 3.0 查看状态 SID SERIAL
     select * from v$session where sid = ;-- 值去 1.0 sess 字段 holder: 后的数字
     -- 4.0 如果状态是 INACTIVE 等,酌情kill
     ALTER SYSTEM KILL SESSION ' , ';-- 分别取 3.0 SID SERIAL
    -- undo
    SELECT a.tablespace_name as tablespace_name,
           to_char(b.total / 1024 / 1024, 999999.99) as Total,
           to_char((b.total - a.free) / 1024 / 1024, 999999.99) as Used,
           to_char(a.free / 1024 / 1024, 999999.99) as Free,
           to_char(round((total - free) / total, 4) * 100, 999.99) as Used_Rate
      FROM (SELECT tablespace_name, sum(bytes) free
              FROM DBA_FREE_SPACE
             GROUP BY tablespace_name) a,
           (SELECT tablespace_name, sum(bytes) total
              FROM DBA_DATA_FILES
             GROUP BY tablespace_name) b
     WHERE a.tablespace_name = b.tablespace_name
    -- temp
    SELECT A.tablespace_name tablespace,
           D.mb_total,
           SUM(A.used_blocks * D.block_size) / 1024 / 1024 mb_used,
           D.mb_total - SUM(A.used_blocks * D.block_size) / 1024 / 1024 mb_free
      FROM v$sort_segment A,
           (SELECT B.name, C.block_size, SUM(C.bytes) / 1024 / 1024 mb_total
              FROM v$tablespace B, v$tempfile C
             WHERE B.ts# = C.ts#
             GROUP BY B.name, C.block_size) D
     WHERE A.tablespace_name = D.name
    GROUP by A.tablespace_name, D.mb_total;

    增大表空间

    这里仅是改成数据文件自动扩展格式,每个数据文件最大存储32G.

    select * from dba_data_files  where tablespace_name = 'XXX’; -- 表空间名称
    alter database DATAFILE XX autoextend on next 100M maxsize unlimited; -- 扩展为自动扩展,扩展到最大 32G
    土豆君
  • 相关阅读:
    如何安装vue-cli脚手架环境
    使用vw,vh对页面进行布局
    ParseChat聊天室应用项目源码
    不错的找茬游戏源码项目
    山寨山寨版手机安全卫士项目
    高仿精仿金山手机卫士源码项目完整版
    java斗地主游戏项目源码
    ios版塔防类游戏源码
    ios媒体视频播放器应用项目
    仿iphone动态萤火虫锁屏应用源码
  • 原文地址:https://www.cnblogs.com/jenrry/p/10007044.html
Copyright © 2011-2022 走看看