li
  当前位置:主页 > 性能优化 > 文章内容
li
oracle "Alter System" 含义
来源: www.ixdba.net  作者: IXDBA.NET官方    时间:2008-09-11   阅读:33  
Oracle System
Version 11.1
 
Alter System
Flush Buffer Cache ALTER SYSTEM FLUSH BUFFER_CACHE;
ALTER SYSTEM FLUSH BUFFER_CACHE;
Flush Shared Pool ALTER SYSTEM FLUSH SHARED_POOL;
ALTER SYSTEM FLUSH SHARED_POOL;

Disconnect Session
ALTER SYSTEM DISCONNECT SESSION '<SID>,<SERIAL#>' POST TRANSACTION;
set linesize 121

SELECT sid, serial#, osuser, username, schemaname
FROM v_$session
WHERE sid = (
  SELECT DISTINCT sid
  FROM v_$mystat);

ALTER SYSTEM DISCONNECT SESSION '8,694' POST TRANSACTION;

Kill Session
ALTER SYSTEM KILL SESSION '<SID>,<SERIAL#>';
set linesize 121

SELECT sid, serial#, osuser, username, schemaname
FROM v_$session
WHERE sid = (
  SELECT DISTINCT sid
  FROM v_$mystat);

ALTER SYSTEM KILL SESSION '8,694';
Determine If Killed Session Is Rolling Back Transactions This shows the user who's transaction is being rolled back If this number, xidusn, is decreasing then the transaction is rolling back. If it is increasing then the transaction is moving forward.
SELECT a.sid, a.username, b.xidusn rollback_seg_no,
IXDBA.NET社区论坛
b.used_urec undo_records, b.used_ublk undo_blocks
FROM gv$session a, gv$transaction b
WHERE a.saddr = b.ses_addr;
 

Is SGA sizing dynamic
SQL> show sga

Total System Global Area 289406976 bytes
Fixed Size 788808 bytes
Variable Size 99612344 bytes
Database Buffers 188743680 bytes
Redo Buffers 262144 bytes

SQL> ALTER SYSTEM SET sga_max_size=250mM SCOPE=spfile;

System altered.

SQL> startup force
ORACLE instance started.

Total System Global Area 264241152 bytes
Fixed Size 788448 bytes
Variable Size 238024736 bytes
Database Buffers 25165824 bytes
Redo Buffers 262144 bytes
Database mounted.
Database opened.

SQL> ALTER SYSTEM SET sga_max_size=180m;
alter system set sga_max_size=180m
*
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified

Which proves two things. First, if you set SGA_MAX_SIZE to 250M then the next time you start your instance, a full 250MB of RAM is used by the SGA (give or take a bit of rounding up to the next actual granule border). Yet I changed nothing to do with my shared pool, my buffer cache or my large pool ... so clearly, the *used* bit of my SGA can only be the same as it was before ... as is evidenced by the before and after values displayed for the "Database Buffers" and "Redo Buffers" components, for example.

Secondly, how "dynamic" is the SGA when the parameter which sizes it, SGA_MAX_SIZE, can't actually be dynamically altered, as I demonstrate at the end with an attempt to dynamically set it back to 180M, but can only be modified with the 'scope=spfile' clause tacked on (or by editing an
init.ora) - thus requiring an instance re-start before the new value is read.

Ergo: SGA_MAX_SIZE is not actually dynamic. And SGA_MAX_SIZE steals all of its memory from the operating system regardless of what your caches and pools are actually set to.

Different operating systems, for example Solaris, may behave differently.



  上一篇: ORACLE SGA_MAX_SIZE与SGA_TARGE...   下一篇: oracle10G突然断电后出現ORA-0021...
li
 §相关评论  
 热点文章

·Resize datafile导致ASM Crash
·在Oracle10g RAC下新增ASM磁盘
·ORACLE SQL性能优化系列 (一)
·oracle性能调优:管理oracle日志
·oracle RAC环境中系统时钟的调
·why:Rac的心跳线不支持交叉线?
·RAC的VIP及实例依赖关系:版本O
·如何启动DataGuard的备用数据库
·系统表空间IO错误 数据损坏处理
·不幸中的万幸:遭遇ORA-00600 [
·用ORACLE的高级复制实现内外网
li
 编辑推荐
·Resize datafile导致ASM Crash
·在Oracle10g RAC下新增ASM磁盘
·ORACLE SQL性能优化系列 (一)
·oracle性能调优:管理oracle日志
·oracle RAC环境中系统时钟的调
·why:Rac的心跳线不支持交叉线?
·RAC的VIP及实例依赖关系:版本O
·如何启动DataGuard的备用数据库
·系统表空间IO错误 数据损坏处理
·不幸中的万幸:遭遇ORA-00600 [
·用ORACLE的高级复制实现内外网
li
 相关篇章
·ORACLE SGA_MAX_SIZE与SGA_TARGE...
·Oracle Server专有模式和共享模式...
·Oracle DBA的UNIX 袖珍参考手册之...
·Oracle DBA的UNIX袖珍参考手册之...
·Oracle DBA的UNIX袖珍参考手册之...
·Oracle DBA 的 UNIX 袖珍参考手册...
·Oracle DBA 的 UNIX 袖珍参考手册...
·Oracle DBA 的 UNIX袖珍参考手册...
·Oracle DBA 的 UNIX 袖珍参考手册...
·oracle保护共享资源的锁定机制En...
·oracle10G突然断电后出現ORA-0021...
 
li
设为首页 | 关于我们 | 技术服务 | 收藏本站 | 网站地图 | 联系方式 | 本站友情连接