zoukankan      html  css  js  c++  java
  • 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;
  • 相关阅读:
    ecs云服务器 mysql经常自动停止挂掉重启问题分析
    mysql报错mmap(137428992 bytes) failed; errno 12,Cannot allocate memory for the buffer pool
    nodeJs的nodemailer发邮件报错hostname/IP doesn't match certificate's altnames怎么解决?
    js数组去重常用方法
    rsync远程数据同步工具的使用
    nginx报错 [error] open() “/usr/local/var/run/openresty.pid” failed (2: No such file or directory)
    webstorm使用问题总结
    正则表达式
    docker
    【转】90%的人会遇到性能问题,如何用1行代码快速定位
  • 原文地址:https://www.cnblogs.com/smthts/p/2918593.html
Copyright © 2011-2022 走看看