linux中oracle的日常维护命令

版权声明:站在巨人的肩膀上,才可以看的更高更远。 https://blog.csdn.net/u011078141/article/details/88090092

原 linux中oracle的日常维护命令https://blog.csdn.net/tianlesoftware/article/details/4792786版权声明: https://blog.csdn.net/tianlesoftware/article/details/4792786
  1.  检查Oracle的进程
$  ps -ef|grep "ora_"|grep -v grep
  oracle  5998     1  0 11:15:59 ?        0:01 ora_j000_PPRD10
  oracle  2968     1  0 21:16:57 ?        0:00 ora_q000_PPRD10
  oracle  2927     1  0 21:16:33 ?        0:00 ora_pmon_PPRD10
  oracle  2933     1  0 21:16:34 ?        0:07 ora_dbw0_PPRD10
  oracle  2945     1  0 21:16:34 ?        0:02 ora_mmon_PPRD10
  oracle  2931     1  0 21:16:33 ?        0:00 ora_mman_PPRD10
  oracle  2949     1  0 21:16:34 ?        0:00 ora_d000_PPRD10
  oracle  2970     1  0 21:16:57 ?        0:00 ora_q001_PPRD10
  oracle  2935     1  0 21:16:34 ?        0:05 ora_lgwr_PPRD10
  oracle  2951     1  0 21:16:34 ?        0:00 ora_s000_PPRD10
  oracle  2939     1  0 21:16:34 ?        0:06 ora_smon_PPRD10
  oracle  2957     1  0 21:16:47 ?        0:00 ora_qmnc_PPRD10
  oracle  2943     1  0 21:16:34 ?        0:05 ora_cjq0_PPRD10
  oracle  2947     1  0 21:16:34 ?        0:00 ora_mmnl_PPRD10
  oracle  2937     1  0 21:16:34 ?        0:18 ora_ckpt_PPRD10
  oracle  2941     1  0 21:16:34 ?        0:00 ora_reco_PPRD10
oracle  2929     1  0 21:16:33 ?        0:00 ora_psp0_PPRD10

在检查Oracle的进程命令输出后,输出显示至少应包括以下一些进程:
? Oracle写数据文件的进程,输出显示为:“ora_dbw0_ORCL”
? Oracle写日志文件的进程,输出显示为:“ora_lgwr_ORCL”
? Oracle监听实例状态的进程,输出显示为:“ora_smon_ORCL”
? Oracle监听客户端连接进程状态的进程,输出显示为:“ora_pmon_ORCL”
? Oracle进行归档的进程,输出显示为:“ora_arc0_ORCL”
? Oracle进行检查点的进程,输出显示为:“ora_ckpt_ORCL”
? Oracle进行[url=javascript:;]恢复[/url]的进程,输出显示为:“ora_reco_ORCL”


2 .  查看数据库的实例:
SQL> select instance_name,status,version,database_status from v$instance;

INSTANCE_NAME  STATUS    VERSION     DATABASE_STATUS
----------------        ------------   -----------------    -----------------
PPRD10           OPEN     10.2.0.4.0       ACTIVE

SQL> select name,log_mode,open_mode from v$database;

NAME      LOG_MODE       OPEN_MODE
---------      ------------          ----------
PPRD10    NOARCHIVELOG  READ WRITE  


$ more /u01/app/oracle/admin/pinnsoft/bdump/alert_pinnsoft.log | grep -i ora-

WARNING: inbound connection timed out (ORA-3136)
WARNING: inbound connection timed out (ORA-3136)
ORA-12012: error on auto execute of job 78677
ORA-20820: ORA-20820:
ORA-06512: at "PS_SYSTEM.ROW_VALIDATOR_T", line 912
ORA-06512: at "PS_SYSTEM.ROW_VALIDATOR_T", line 924
ORA-06512: at "WORKORDER.INVENTORY_UTL", line 1260
ORA-12012: error on auto execute of job 78677

$ more /u01/app/oracle/admin/pinnsoft/bdump/alert_pinnsoft.log | grep -i err

Errors in file /u01/app/oracle/admin/pinnsoft/bdump/pinnsoft_j000_2666.trc:
ORA-12012: error on auto execute of job 78677
: 6000101: Error occurred when rolling Inventory date
Errors in file /u01/app/oracle/admin/pinnsoft/bdump/pinnsoft_j000_11886.trc:
ORA-12012: error on auto execute of job 78677
: 6000101: Error occurred when rolling Inventory date
Errors in file /u01/app/oracle/admin/pinnsoft/bdump/pinnsoft_j000_21375.trc:
ORA-12012: error on auto execute of job 78677
: 6000101: Error occurred when rolling Inventory date

$ more /u01/app/oracle/admin/pinnsoft/bdump/alert_pinnsoft.log | grep -i fail

PMON failed to acquire latch, see PMON dump
PMON failed to acquire latch, see PMON dump
PMON failed to acquire latch, see PMON dump

SQL> select status,name from v$controlfile;
STATUS  NAME
-------    ------------------------------------------------------------------------
        /data/app/oracle/oradata/PPRD10/control01.ctl
        /data/app/oracle/oradata/PPRD10/control02.ctl
        /data/app/oracle/oradata/PPRD10/control03.ctl


SQL> select group#,status,member from v$logfile;

GROUP#  STATUS  MEMBER
----------    -------    -------------------------------------------------------------
           1         /data/app/oracle/oradata/PPRD10/redo01.log
           2         /data/app/oracle/oradata/PPRD10/redo02.log
           3         /data/app/oracle/oradata/PPRD10/redo03.log

  


SQL> select file#,status,name from v$datafile;

FILE#  STATUS   NAME
----------  -------    --------------------------------------------------
         1  SYSTEM  /u01/app/oracle/oradata/orcl/system01.dbf
         2  ONLINE  /u01/app/oracle/oradata/orcl/undotbs01.dbf
         3  ONLINE  /u01/app/oracle/oradata/orcl/sysaux01.dbf
         4  ONLINE  /u01/app/oracle/oradata/orcl/users01.dbf
         5  ONLINE  /u01/app/oracle/oradata/orcl/example01.dbf
         6  ONLINE  /u01/app/oracle/oradata/orcl/perfstat.dbf
         7  ONLINE  /u01/app/oracle/oradata/orcl/risenet.dbf

  “ONLINE"


SQL> select tablespace_name,status from dba_tablespaces;

TABLESPACE_NAME           STATUS
------------------------------     ---------
SYSTEM                           ONLINE
UNDOTBS1                       ONLINE
SYSAUX                           ONLINE
TEMP                              ONLINE
USERS                            ONLINE
EXAMPLE                         ONLINE
PERFSTAT                        ONLINE
RISENET                          ONLINE

“ONLINE”

SQL> select segment_name,status from dba_rollback_segs;

SEGMENT_NAME              STATUS
------------------------------    ----------------
SYSTEM                           ONLINE
_SYSSMU10$                    ONLINE
_SYSSMU9$                      ONLINE
_SYSSMU8$                      ONLINE
_SYSSMU7$                      ONLINE
_SYSSMU6$                      ONLINE
_SYSSMU5$                      ONLINE
_SYSSMU4$                      ONLINE
_SYSSMU3$                      ONLINE
_SYSSMU2$                      ONLINE
_SYSSMU1$                      ONLINE

11 rows selected.

SQL>select resource_name,current_utilization,max_utilization,initial_allocation  ,limit_value from v$resource_limit;

RESOURCE_NAME                  CURRENT_UTILIZATION MAX_UTILIZATION INITIAL_AL LI
------------------------------ ------------------- --------------- ---------- --
processes                                       26              31        150
sessions                                        30              37        170
enqueue_locks                                   23              31       2300
enqueue_resources                               23              49        968  U
ges_procs                                        0               0          0
ges_ress                                         0               0          0  U
ges_locks                                        0               0          0  U
ges_cache_ress                                   0               0          0  U
ges_reg_msgs                                     0               0          0  U
ges_big_msgs                                     0               0          0  U
ges_rsv_msgs                                     0               0          0

RESOURCE_NAME                  CURRENT_UTILIZATION MAX_UTILIZATION INITIAL_AL LI
------------------------------ ------------------- --------------- ---------- --
gcs_resources                                    0               0          0
gcs_shadows                                      0               0          0
dml_locks                                        0              68        748  U
temporary_table_locks                            0               3  UNLIMITED  U
transactions                                     2              11        187  U
branches                                         0               0        187  U
cmtcallbk                                        0               2        187  U
sort_segment_locks                               0               3  UNLIMITED  U
max_rollback_segments                           11              11        187
max_shared_servers                               1               1  UNLIMITED  U
parallel_max_servers                             0               0         40

22 rows selected.


Select  A.tablespace_name,(1-(A.total)/B.total)*100 used_percent
from (select tablespace_name,sum(bytes) total from dba_free_space group by tablespace_name) A, (select tablespace_name,sum(bytes) total from dba_data_files group by tablespace_name) B
where A.tablespace_name=B.tablespace_name;

SQL> Select  A.tablespace_name,(1-(A.total)/B.total)*100 used_percent
  2  from (select tablespace_name,sum(bytes) total from dba_free_space group by tablespace_name) A, (select tablespace_name,sum(bytes) total from dba_data_files group by tablespace_name) B
where A.tablespace_name=B.tablespace_name;
3

TABLESPACE_NAME                USED_PERCENT
------------------------------         ------------
UNDOTBS1                              33.25
SYSAUX                               99.0364583
RISENET                                .0125
USERS                                   62.5
SYSTEM                               98.6067708
EXAMPLE                               68.25
PERFSTAT                             28.7625

7 rows selected.


select segment_name,segment_type,tablespace_name,
(extents/max_extents)*100 Percent from sys.DBA_segments
where max_extents!=0 and (extents/max_extents)*100>=95
order by percent;

SQL> select segment_name,segment_type,tablespace_name,
  2      (extents/max_extents)*100 Percent
  3      from sys.DBA_segments
  4      where max_extents!=0 and (extents/max_extents)*100>=95
  5  order by percent;

no rows selected

.


select distinct(owner) from dba_tables
where tablespace_name='SYSTEM' and owner!='SYS'
and owner!='SYSTEM'
union
select distinct(owner) from dba_indexes
where tablespace_name='SYSTEM'
and owner!='SYS' and owner!='SYSTEM';
SQL> select distinct(owner) from dba_tables
  2  where tablespace_name='SYSTEM' and
  3  owner!='SYS' and owner!='SYSTEM'
  4  union
  5  select distinct(owner) from dba_indexes
  6  where tablespace_name='SYSTEM' and
  7  owner!='SYS' and owner!='SYSTEM';

OWNER
------------------------------
MDSYS
OLAPSYS
OUTLN

  


select a.table_name,a.next_extent,a.tablespace_name
from all_tables a,
(select tablespace_name,max(bytes) as big_chunk
from dba_free_space group by tablespace_name) f
where f.tablespace_name=a.tablespace_name
and a.next_extent>f.big_chunk
union
select a.index_name,a.next_extent,a.tablespace_name
from all_indexes a,
(select tablespace_name,max(bytes) as big_chunk
from dba_free_space
group by tablespace_name) f
where f.tablespace_name=a.tablespace_name
and a.next_extent>f.big_chunk;

SQL> select a.table_name,a.next_extent,a.tablespace_name
  2      from all_tables a,
  3      (select tablespace_name,max(bytes) as big_chunk
  4      from dba_free_space group by tablespace_name) f
  5      where f.tablespace_name=a.tablespace_name
  6      and a.next_extent>f.big_chunk
  7      union
  8      select a.index_name,a.next_extent,a.tablespace_name
  9      from all_indexes a,
10      (select tablespace_name,max(bytes) as big_chunk
11      from dba_free_space
12      group by tablespace_name) f
13      where f.tablespace_name=a.tablespace_name
14      and a.next_extent>f.big_chunk;

no rows selected

  https://img-blog.csdnimg.cn/20190217105710569.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTEwNzgxNDE=,size_16,color_FFFFFF,t_70《算法导论 第三版英文版》_高清中文版.pdf
https://pan.baidu.com/s/17D1kXU6dLdU0YwHM2cvNMw
《深度学习入门:基于Python的理论与实现》_高清中文版.pdf
https://pan.baidu.com/s/1IeVs35f3gX5r6eAdiRQw4A
《深入浅出数据分析》_高清中文版.pdf
https://pan.baidu.com/s/1GV-QNbtmjZqumDkk8s7z5w
《Python编程:从入门到实践》_高清中文版.pdf
https://pan.baidu.com/s/1GUNSg4mdpeOf1LC_MjXunQ
《Python科学计算》_高清中文版.pdf
https://pan.baidu.com/s/1-hDKhK-7rDDFll_UFpKmpw

猜你喜欢

转载自blog.csdn.net/u011078141/article/details/88090092