oracle如何設定最大串連數

來源:互聯網
上載者:User

標籤:data   create   服務   sql   檔案的   user   1.5   res   不能   

查看session:

  select * from v$session where username is not null

  select username,count(username) from v$session where username is not null group by username

  當前串連數:

  select count(*) from v$process

  查看串連數參數的設定情況

  select value from v$parameter where name = ‘processes‘

  Select count(*) from v$session where status=‘ACTIVE‘ #並發串連數




Oracle查看、修改串連數 
  1.查詢資料庫當前進程的串連數:
  select count(*) from v$process;
  2.查看資料庫當前會話的串連數:
  elect count(*) from v$session;

  3.查看資料庫的並發串連數:
  select count(*) from v$session where status=‘ACTIVE‘;
  4.查看當前資料庫建立的會話情況:
  select sid,serial#,username,program,machine,status from v$session;
  5.查詢資料庫允許的最大串連數:
  select value from v$parameter where name = ‘processes‘;
  或者命令:show parameter processes;
  6.修改資料庫允許的最大串連數:
  alter system set processes = 300 scope = spfile;
  (需要重啟資料庫才能實現串連數的修改)


  重啟資料庫:

SQL>shutdown immediate;SQL>startup;

  

  查看當前有哪些使用者正在使用資料:

  SQL>select osuser,a.username,cpu_time/executions/1000000||‘s‘,sql_fulltext,machine  SQL>from v$session a,v$sqlarea b  SQL>where a.sql_address = b.address  SQL>order by cpu_time/executions desc;

  備忘:UNIX 1個使用者session對應一個作業系統process,而Windows體現線上程。


  啟動oracle

  su - oracle  SQL>sqlplus system/pwd as sysdba     //進入sql  SQL>startup                                      //啟動資料庫  SQL>lsnrctl start                               //啟動監聽
   sqlplus "/as sysdba"  SQL>shutdown immediate;  //關閉資料庫  SQL>startup mount;  SQL>alter database open;    


Session:
1.通過SQLPlus修改Oracle的sessions和processes的關係是

   sessions=1.1*processes + 5   使用sys,以sysdba許可權登入:   SQL> show parameter processes;   NAME TYPE VALUE--------   aq_tm_processes integer 1db_writer_processes integer 1   job_queue_processes integer 10   log_archive_max_processes integer 1   processes integer 150   SQL> alter system set   processes=400 scope = spfile;系統已更改。   SQL> show parameter processes;NAME TYPE   VALUE--------------------------------   aq_tm_processes   integer 1db_writer_processes integer 1   job_queue_processes integer 10   log_archive_max_processes integer 1   processes integer 150   SQL> create pfile from spfile;    

  

  注:sessions是個派生值

  注:sessions是個派生值,由processes的值決定,公式sessions=1.1*process + 5

  2.通過修改oracle設定檔進行修改修改SPFILEORCL.ORA檔案中的processes的值。8.1.5中是init.ora 檔案,在9i中修改init.ora檔案是無效的,這個檔案由於是一個二進位的檔案,不能直接使用notepad此類的編輯器開啟。否則會報錯誤ORA- 27101 Shared memory realm does not exist。使用UltraEdit或者EditPlus之類的可以編輯二進位檔案的編輯器開啟此檔案(直接編輯二進位檔案),然後在Windows服務 中重新啟動Oracle伺服器即可。

  3.通過Oracle Enterprise Manager Console在圖形化管理器中修改

  a.以系統管理員的身份登入

  b.進入資料庫的常式-配置-一般資訊-所有初始化參數

  c.修改processes的值

oracle如何設定最大串連數

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.