碎片檢查
select tablespace_name
(
from dba_free_space
group by tablespace_name order by
fsfi值越小
檢查reverse_key index
select o
from dba_objects o
where wner=
AND O
(SELECT I
WHERE BITAND(I
查具體後台進程號
select spid from v$session a
查看死鎖表
SELECT SID
DECODE(REQUEST
FROM V$LOCK
WHERE REQUEST >
ORDER BY block DESC;
查看剩余表空間
select a
(select sum(bytes) free
(select sum(bytes) total
where a
order by pct_free;
查看創建索引的進度
select sid
查看繳費到帳
SELECT AREA_ID
WHERE PAY_DATE>=sysdate
查看最消耗資源的sql
SELECT * FROM (SELECT PARSING_USER_ID EXECUTIONS
DISK_READS
查看占用系統資源的進程號spid
SELECT a
FROM v$session a
ORDER BY c
查看占用系統io較大的session
SELECT se
se
FROM v$session se
AND se
對檢索出的結果的幾點說明
Select sql_address from v$session where sid=;
Select * from v$sqltext where address=;
執行以上兩個語句便可以得到這個session的語句
你也以用alter system kill session
a
a
示例
db_writer_processes=
db_block_lru_latches=
a
b
c
d
e
外部聯接
若不帶
則前者的行與後者中的一個空行相匹配並被返回
則二者中無法匹配的均被返回
可以替代效率十分低下的 not in 運算
select a
(select empno from emp
select a
where a
and b
and b
如何更改UNDO tablespace
create undo tablespace undotbs
alter system set undo_tablespace=undotbs
create pfile from spfile;
alter tablespace undotbs
drop tablespace undotbs
ALTER TABLE t_monitor_real_minute NOLOGGING;
Oracle RAC的參數文件和單實例參數文件不同
首先設置歸檔路徑
SQL> alter system set log_archive_dest=
System altered
SQL> select sid
SID NAME VALUE
* log_archive_dest /opt/oracle/archive
然後關閉兩個實例
SQL> shutdown immediate;
Database closed
Database dismounted
ORACLE instance shut down
SQL> startup mount;
ORACLE instance started
Total System Global Area
Fixed Size
Variable Size
Database Buffers
Redo Buffers
Database mounted
SQL> alter database archivelog;
Database altered
SQL> alter database open;
Database altered
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /opt/oracle/archive
Oldest online log sequence
Next log sequence to archive
Current log sequence
接下來啟動另外一個節點
From:http://tw.wingwit.com/Article/program/Oracle/201311/17504.html