set ORACLE_BASE=D:\oracle
set ORACLE_SID=orcl
set ORACLE_HOME=D:\oracle
emctl start/stop/status dbconsole
shutdown -abort
- immediate
- transactional
- normal
sqlplus scott/tiger as sysdba
shutdown immediate
startup
dynamic performance view:
select sql_text, executions from v$sql
where cpu_time >200000;
select * from v$session where machine = 'd52' and logon_time>sysdate-1;
select sid, ctime from v$lock where block>0;
今天发现开了dbconsole就连不上数据库,查了一下发现是连接数设的太小了:
selectcount(*)fromv$process--当前的连接数selectvaluefromv$parameterwherename='processes'--数据库允许的最大连接数修改最大连接数:altersystemsetprocesses=300scope=spfile;
重启数据库:shutdownimmediate;
startup;--查看当前有哪些用户正在使用数据SELECTosuser, a.username,cpu_time/executions/1000000||'s', sql_fulltext,machinefromv$session a, v$sqlarea bwherea.sql_address=b.addressorderbycpu_time/executionsdesc;