oracle服务器基本检查

 

检查范围:
(主机配置,内存参数,系统配置,硬盘利用率和可用空间,CPU 利用率,当前操作系统补丁情况,oracle 配置,配置文件的内容和位置,目录结构,数据文件和位置,表空间,Invalid 数据库对象,数据库运行日志文件,网络信息和NET 8 TCP/IP 配置,network 吞吐量,NET8 信息,数据库备份和恢复概况,备份策略,恢复策略)

 

利用SQL 命令检查数据库配置,开启SQL*PLUS 来检查。
ORACLE 工具STATSPACK 进行数据库性能资料的收集。(这里非分析)

 

查看SERVER NAME:
[root@oracle 11g ~]# hostname
oracle 11g
查看OS version
[root@oracle 11g ~]# lsb_release -a
LSB Version::core-3.0-ia32:core-3.0-noarch:graphics-3.0-ia32:graphics-3.0-noarch
Distributor ID: CentOS
Description:CentOS release 4.8 (Final)
Release:4.8
Codename:Final
查看CPU
[root@oracle 11g ~]# more /proc/cpuinfo
processor: 0
vendor_id: GenuineIntel
cpu family: 6
model: 23
model name: Pentium(R) Dual-Core CPUT450
0@ 2.30GHz
stepping: 8
cpu MHz: 2296.821
cache size: 1024 KB
fdiv_bug: no
hlt_bug: no
f 00f_bug: no
coma_bug: no
fpu: yes
fpu_exception: yes
cpuid level: 13
wp: yes
flags: fpu vme de pse tsc msr pae mce cx8
apic sep mtrr pge mca cmov pat pse36 clflush dts acpi
mmx fxsr sse sse2 ss nx constant_tsc pni ds_cpl
bogomips: 4593.99

 

 

查看内存:
[root@oracle 11g ~]# top | grep Mem
Mem:1018280k total,203460k used,81
Mem:1018280k total,203460k used,81
Mem:1018280k total,203460k used,81
查看Product name
[root@oracle 11g ~]# dmidecode | grep Product
Product Name: VMware Virtual Platform
Product Name: 440BX Desktop Reference Platform
查看内存参数:
[root@oracle 11g ~]# more /etc/sysctl.conf
查看ORACLE 用户限制:
[oracle@oracle 11g ~]$ ulimit -a
core file size(blocks, -c) 0
data seg size(kbytes, -d) unlimited
file size(blocks, -f) unlimited
pending signals(-i) 1024
max locked memory(kbytes, -l) 32
max memory size(kbytes, -m) unlimited
open files(-n) 65536
pipe size(512 bytes, -p) 8
POSIX message queues(bytes, -q) 819200
stack size(kbytes, -s) 10240
cpu time(seconds, -t) unlimited
max user processes(-u) 16384
virtual memory(kbytes, -v) unlimited
file locks(-x) unlimited
查看硬盘的情况:
[root@oracle 11g ~]# df
Filesystem1K-blocksUsed Available Use% Mounted on
/dev/hda1144449921345200025922899% /
none50914005091400% /dev/shm
查看数据库的版本:
[oracle@oracle 11g ~]$ sqlplus / as sysdba

 

SQL*Plus: Release 11.1.0.6.0 - Production on Sat Oct 1 06:48:47 2011

 

Copyright (c) 1982, 2007, Oracle.All rights reserved.

 

Connected to an idle instance.

 

 

 

 

查看当前版本:
SQL> select * fromv$option;

 

PARAMETERVALUE
---------------------------------------------------------------- ----------------------------------------------------------------
PartitioningTRUE
ObjectsTRUE
Real Application ClustersFALSE
Advanced replicationTRUE
Bit-mapped indexesTRUE
Connection multiplexingTRUE
Connection poolingTRUE
Database queuingTRUE
Incremental backup and recoveryTRUE
Instead-of triggersTRUE
Parallel backup and recoveryTRUE
Parallel executionTRUE
Parallel loadTRUE
Point-in-time tablespace recoveryTRUE
Fine-grained access controlTRUE
Proxy authentication/authorizationTRUE
Change Data CaptureTRUE
Plan StabilityTRUE
Online Index BuildTRUE
Coalesce IndexTRUE
Managed StandbyTRUE
Materialized view rewriteTRUE
Materialized view warehouse refresh TRUE
Database resource managerTRUE
SpatialTRUE
Export transportable tablespacesTRUE
Transparent Application FailoverTRUE
Fast-Start Fault RecoveryTRUE
Sample ScanTRUE
Duplexed backupsTRUE
JavaTRUE
OLAP Window FunctionsTRUE
Block Media RecoveryTRUE
Fine-grained AuditingTRUE
Application RoleTRUE
Enterprise User SecurityTRUE
Oracle Data GuardTRUE
Oracle Label SecurityFALSE
OLAPTRUE
Table compressionTRUE
Join indexTRUE
Trial RecoveryTRUE
Data MiningTRUE
Online RedefinitionTRUE
Streams CaptureTRUE
File MappingTRUE
Block Change TrackingTRUE
Flashback TableTRUE
Flashback DatabaseTRUE
Transparent Data EncryptionTRUE
Backup EncryptionTRUE
Unused Block CompressionTRUE
Oracle Database VaultFALSE
Result CacheTRUE
SQL Plan ManagementTRUE
SecureFiles DeduplicationTRUE
SecureFiles EncryptionTRUE
SecureFiles CompressionTRUE
Real Application TestingTRUE
Flashback Data ArchiveTRUE
DICOMTRUE

 

61 rows selected.
查看被使用的产品选项:
SQL> select COMP_ID,COMP_NAME,VERSION,STATUS FROM dba_registry;

 

COMP_IDCOMP_NAMEVERSIONSTATUS
---------- ------------------------------ ------------------------------ --------------------------------------------
OWBOWB 11.1.0.6.0VALID
APEXOracle Application Express 3.0.1.00.08VALID
EMOracle Enterprise Manager 11.1.0.6.0VALID
WKOracle Ultra Search 11.1.0.6.0VALID
AMDOLAP Catalog 11.1.0.6.0VALID
SDOSpatial 11.1.0.6.0VALID
ORDIMOracle Multimedia 11.1.0.6.0VALID
XDBOracle XML Database 11.1.0.6.0VALID
CONTEXTOracle Text 11.1.0.6.0VALID
EXFOracle Expression Filter 11.1.0.6.0VALID
RULOracle Rules Manager 11.1.0.6.0VALID
OWMOracle Workspace Manager 11.1.0.6.0VALID
CATALOGOracle Database Catalog Views 11.1.0.6.0VALID
CATPROCOracle Database Packages and T 11.1.0.6.0VALID
ypes

 

JAVAVMJServer JAVA Virtual Machine 11.1.0.6.0VALID
XMLOracle XDK 11.1.0.6.0VALID
CATJAVAOracle Database Java Packages 11.1.0.6.0VALID
APSOLAP Analytic Workspace 11.1.0.6.0VALID
XOQOracle OLAP API 11.1.0.6.0VALID

 

19 rows selected.
查看数据库参数文件:
SQL> show parameter spfile;

 

NAMETYPEVALUE
------------------------------------ ----------- ------------------------------
spfilestring/u01/oracle/dbs/spfilewilson.ora

 

查看数据库的非默认参数:
SQL> select name,value from v$parameter where isdefault='false';
no rows selected

 

运行日志和跟踪文件:
Oracle 数据库进程生成跟踪文件来记录错误或者冲突,这些跟踪文件可以用来进一步分析问题。定期检查alert.log 文件,以便及早发现问题。

 

 

查看数据库的归档模式:
SQL> archive log list
Database log modeArchive Mode
Automatic archivalEnabled
Archive destinationUSE_DB_RECOVERY_FILE_DEST
Oldest online log sequence30
Next log sequence to archive32
Current log sequence32

 

 

 

查看数据文件的个数以及总的大小:
SQL> select count(*),sum(bytes)/1024/1024/1024 from v$datafile;

 

COUNT(*) SUM(BYTES)/1024/1024/1024
---------- -------------------------
82.78387451

 

dba_segments 这个中可以查看哪些对象放在哪个表空间里。
建议使用LOCAL 方式管理表空间,表空间不存在碎片问题。
建议删除不使用对象,避免在系统压力较大时,手工或自动编译无效对象,否则可能造成数据库锁死。

 

查看BLEVEL>4 的索引,如果有,则要重建索引:
SQL> select * from dba_indexes where blevel>4;

 

no rows selected

 

查看系统哪些角色被授予了DBA 的超级权限:
SQL> select grantee,granted_role from dba_role_privs where granted_role='DBA';

 

GRANTEE
------------------------------
GRANTED_ROLE
------------------------------
SYS
DBA

 

SYSMAN
DBA

 

SYSTEM
DBA
被授予DBA 权限可以随时的开启和关闭数据库等一些DBA 的系统重要操作。

 

查看监听器listener.ora 的配置:
[oracle@oracle 11g admin]$ pwd
/u01/oracle/network/admin
[oracle@oracle 11g admin]$ more listener.ora
# listener.ora Network Configuration File: /u01/oracle/network/admin/listener.ora
# Generated by Oracle configuration tools.

 

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oracle 11g)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)

 

查看tnsnames.ora 的配置:
[oracle@oracle 11g admin]$ more tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/oracle/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

 

WILSON =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oracle 11g)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = wilson)
)
)

 


 

然后对于数据库性能:10g 需查看AWR 报告。AWR 报告需要加深学习。9i 查看statpack 报告。

 

数据库的备份和恢复:
建议:
根据不同的数据库失败情况制定相应的恢复策略。
数据库全库恢复。
表空间恢复。
数据文件恢复。
数据表恢复。
根据制定的恢复策略进行恢复测试。

 

Redo log 文件:
对于恢复操作,最为关键的是online redo log 。一般由2 个或以上预先分配的存储数据库变化文件组成。每个数据库的例程都有相关的online redo log
每个数据库至少有两个redo log 组,每组至少有一个日志文件。Oracle 有多重online redo log 文件,LGWR 同时将相同的redo log 信息写入不同的REDO LOG 文件中,从而减少单个文件丢失的损失。

你可能感兴趣的:(oracle,体验)