我的文檔變成了亂碼?(文檔突然變成亂碼)
852
2022-05-28
1??操作系統錯誤記錄
errpt
/var/log/messages
2????????網卡狀態
ifconfig
3????????操作系統總體狀態
top
topas
cpu user%
disk busy%
network Kbps
memory %comp
max cpu pro
4????????操作系統性能
top
topas
1.運行時間及1、5、15分鐘CPU的負載情況
2.進程統計
3.CPU統計
4.內存
5.交換分區
6.具體進程,按%CPU排序
檢測CPU情況,1,5,15分鐘的負載
uptime
檢測內存狀況
free -m
檢測硬盤狀況
df -h
通過vmstat命令檢測系統
vmstat 5 5
-- r: The number of processes waiting for run time展示了正在執行和等待CPU資源的任務個數。當這個值超過了CPU數目,就會出現CPU瓶頸了
-- wa的值高時,說明IO等待比較嚴重,這可能是由于磁盤大量作隨機訪問造成,也有可能是磁盤的帶寬出現瓶頸(塊操作)。
iostat
5????????文件系統磁盤空間
df -g
6????????集群運行狀態
su - oracle
olsndoes
crsctl query css votedisk
ocrcheck
crsctl check crs
crs_stat -t
lsnrctl status
7????????檢測Oracle死鎖
cat alert_orcl.log | grep ORA-00600
select count(*) from v$session where lockwait is not null;
8????????Oracle實例狀態
select instance_name, version, status, database_status fromv$instance;
9????????Oracle數據庫狀態
select name, log_mode, open_mode, flashback_on fromv$database;
10???檢查數據庫進程
ps -ef | grep ora_ | grep -v grep | wc -l
show parameter processes
11???檢查數據庫的會話數
一個穩定運行的數據庫里,會話數量應保持平穩,如果出現會話數量大幅增加或大幅減少,就意味著可能出現了問題,需要進一步查找原因。(需要與日常穩定數值對比)
select count(*) from v$session;
show parameter sessions;
select sid,serial#,username,program,machine,status fromv$session;
#alter system kill session 'SID,SERIAL#';
12???檢查控制文件
select * from v$controlfile;
13???檢查日志文件
select * from v$logfile;
14???檢查表空間
select tablespace_name,contents,status from dba_tablespaces;
檢查Oracle表空間使用情況
SELECT d.status "Status",
d.tablespace_name "Name",
d.contents"Type",
d.extent_management "Extent Management",
TO_CHAR(NVL(a.bytes / 1024 / 1024, 0), '99,999,990.900') "Size(M)",
TO_CHAR(NVL(a.bytes - NVL(f.bytes, 0), 0) / 1024 / 1024, '99999999.999')|| '/' ||
TO_CHAR(NVL(a.bytes / 1024 / 1024, 0), '99999999.999') "Used (M)",
TO_CHAR(NVL((a.bytes - NVL(f.bytes, 0)) / a.bytes * 100, 0), '990.00')"Used %"
FROMsys.dba_tablespaces d,
(selecttablespace_name, sum(bytes) bytes
fromdba_data_files
group bytablespace_name) a,
(select tablespace_name,sum(bytes) bytes
fromdba_free_space
group bytablespace_name) f
WHEREd.tablespace_name = a.tablespace_name(+)
ANDd.tablespace_name = f.tablespace_name(+)
AND NOT(d.extent_management like 'LOCAL' AND d.contents like 'TEMPORARY')
UNION ALL
SELECT d.status "Status",
d.tablespace_name "Name",
d.contents"Type",
d.extent_management "Extent Management",
TO_CHAR(NVL(a.bytes / 1024 / 1024, 0), '99,999,990.900') "Size(M)",
TO_CHAR(NVL(t.bytes,0) / 1024 / 1024, '99999999.999') || '/' ||
TO_CHAR(NVL(a.bytes / 1024 / 1024, 0), '99999999.999') "Used(M)",
TO_CHAR(NVL(t.bytes / a.bytes * 100, 0), '990.00') "Used %"
FROMsys.dba_tablespaces d,
(selecttablespace_name, sum(bytes) bytes
fromdba_temp_files
group bytablespace_name) a,
(selecttablespace_name, sum(bytes_cached) bytes
fromv$temp_extent_pool
group bytablespace_name) t
WHEREd.tablespace_name = a.tablespace_name(+)
ANDd.tablespace_name = t.tablespace_name(+)
ANDd.extent_management like 'LOCAL'
AND d.contents like'TEMPORARY'
/
確保表空間剩余空間維持在20%以上
15???檢查數據文件
select name, status from v$datafile;
檢查數據文件的autoextensible
select tablespace_name, file_id, ONLINE_STATUS,autoextensible from dba_data_files union all select tablespace_name, file_id,status, autoextensible from dba_temp_files;
SQL> select tablespace_name, file_id, ONLINE_STATUS,autoextensible from dba_data_files union all select tablespace_name, file_id,status, autoextensible from dba_temp_files;
16???檢查回滾段
select segment_name, status from dba_rollback_segs;
查看回滾段是否自動管理
show parameter uodo_management
17???檢查數據庫的無效對象
col object_name for a20
col owner for a15
select owner, object_name, object_type, status fromdba_objects where status != 'VALID' and owner != 'SYS' and owner != 'SYSTEM';
SQL> col object_name for a20
SQL> col owner for a15
SQL> select owner, object_name, object_type, status fromdba_objects where status != 'VALID' and owner != 'SYS' and owner != 'SYSTEM';
18???檢查系統資源限制
select * from v$resource_limit;
19???檢查Oracle擴展異常對象
select segment_name, segment_type, tablespace_name,(extents/max_extents)*100 percent from dba_segments where max_extents !=0 and(extents/max_extents)*100 >=90 order by percent;
SQL> select segment_name, segment_type, tablespace_name,(extents/max_extents)*100 percent from dba_segments where max_extents !=0 and(extents/max_extents)*100 >=90 order by percent;
20???檢查Oracle系統表空間
select distinct(owner) from dba_tables where tablespace_name= 'SYSTEM' and owner != 'SYS' and owner != 'SYSTEM'
union all
select distinct(owner) from dba_indexes wheretablespace_name = 'SYSTEM' and owner != 'SYS' and owner != 'SYSTEM';
oracle系統表空間一般是用于存放sys和system用戶數據的,通常其它用戶的數據是不能存放在系統表空間中,通過檢查這項內容,可以發現有哪些非sys和system用戶的數據被存放在系統表空間里,以防止其存儲空間被過度占用而引起數據庫問題。(此類用戶屬于內部用戶,狀態正常)
21???無效索引
select index_name,index_type,tablespace_name,status fromuser_indexes;
select index_name,index_type,tablespace_name,status fromdba_indexes where status!='VALID';
select index_name,index_type,tablespace_name,status fromdba_indexes where status='INVALID' or status='UNUSEABLE';
22???RMAN備份情況(全備或者增量備份)
list backup;
list backup of controlfile;
list backup of database;
list backup of archivelog all;
23???邏輯備份情況(EXPDP或EXP)
24???生成statspack與AWR報告,對數據庫進行具體性能分析
ARW報告存放目錄
警告日志存放目錄
tree老師推薦
Oracle 數據庫
版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。