oracle sga修改以及限制某一个用户的连接数的方法【自己整理】

show parameter sga_max_size; --查看sga最大多少
show parameter sga_target; --查看sga_target 

SQL> show sga
show parameter sga_max_size; --查看sga最大多少
show parameter sga_target; --查看sga_target 

SQL> show sga 
  Total System Global Area 2602007792 bytes 
  Fixed Size 740592 bytes 
  Variable Size 335544320 bytes 
  Database Buffers 2264924160 bytes 
  Redo Buffers 798720 bytes 
  SQL> alter system set sga_max_size=500m scope=spfile; 
         System altered.  
         alter system set sga_target=500m scope=spfile; 
  System altered. 
  SQL> shutdown immediate; 
  SQL> startup 
  SQL> show sga 
  Total System Global Area 5252811728 bytes 
  Fixed Size 744400 bytes 
  Variable Size 2986344448 bytes 
  Database Buffers 2264924160 bytes 
  Redo Buffers 798720 bytes


限制用户连接数:

先创建一个PROFILE

create  profile ses_conn limit sessions_per_user n;  n为最大连接数。



然后将该PROFILE付给需要限制的用户。alter user xxx profile ses_conn;



最后别忘了确认RESOURCE_LIMIT参数已设为TRUE。

如果没有,用
alter system set resource_limit=TRUE;


如果要删除限制,删除Profile即可

drop profile ses_conn cascade; 
  Total System Global Area 2602007792 bytes   Fixed Size 740592 bytes   Variable Size 335544320 bytes   Database Buffers 2264924160 bytes   Redo Buffers 798720 bytes   SQL> alter system set sga_max_size=500m scope=spfile; System altered. alter system set sga_target=500m scope=spfile;   System altered.   SQL> shutdown immediate;   SQL> startup   SQL> show sga   Total System Global Area 5252811728 bytes   Fixed Size 744400 bytes   Variable Size 2986344448 bytes   Database Buffers 2264924160 bytes   Redo Buffers 798720 bytes 限制用户连接数: 先创建一个PROFILE create profile ses_conn limit sessions_per_user n; n为最大连接数。 然后将该PROFILE付给需要限制的用户。alter user xxx profile ses_conn; 最后别忘了确认RESOURCE_LIMIT参数已设为TRUE。 如果没有,用 alter system set resource_limit=TRUE; 如果要删除限制,删除Profile即可 drop profile ses_conn cascade;
posted @ 2013-02-20 14:39  倚楼听雨  阅读(487)  评论(0编辑  收藏  举报