how to stop or start arch proces

2015-05-02  本文已影响0人  乐之

在有些特殊场景下,需要手动重启oracle arch processes,而不是重启db。举例来说,DB的状态正常,但是归档进程由于某些原因 挂起,此时我们就需要重启oracle 归档进程。

在9i中,我们可以使用如下命令来启动和停止归档进程

alter system archive log stop;

alter system archive log start;

在9i中,关于启动和停止oracle 归档进程的说明

http://docs.oracle.com/cd/B10501_01/server.920/a96521/archredo.htm#4812

在10g中,关于启动和停止oracle 归档进程的说明

http://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12007.htm

在11g中,并没有启动和停止oracle归档进程的说明

http://docs.oracle.com/cd/E11882_01/server.112/e16604/ch_twelve007.htm

通过官方文档的对其的描述,在9i和10g版本中是可以手动启动和停止归档进程(没有测试环境,未验证)

在11g中,官方文档中虽然废除了手动启动和停止归档进程的命令,但是经过测试 发现,

该命令仍然可以正常执行,但是实际上该命令并没有奏效。测试过程如下

--当前oracle版本

>select*fromv$versionwhererownum<2;

BANNER

--------------------------------------------------------------------------------

OracleDatabase11g Enterprise EditionRelease11.2.0.4.0-64bit Production

--开启归档模式

>archiveloglist

DatabaselogmodeNo ArchiveMode

Automaticarchival Disabled

Archive destination/s01/oracle/app/oracle/product/11.2.0.4/dbhome_1/dbs/arch

Oldestonlinelogsequence36

Currentlogsequence38

>shutdownimmediate

Databaseclosed.

Databasedismounted.

ORACLE instance shut down.

>startupmount

ORACLE instance started.

Total System Global Area 839282688 bytes

FixedSize2257880 bytes

VariableSize503319592 bytes

DatabaseBuffers 331350016 bytes

Redo Buffers 2355200 bytes

Databasemounted.

>altersystemsetlog_archive_dest_1='LOCATION=/arch';

System altered.

Elapsed:00:00:00.03

>alterdatabasearchivelog;

Databasealtered.

Elapsed:00:00:00.00

>archiveloglist

DatabaselogmodeArchiveMode

Automaticarchival Enabled

Archive destination/arch

Oldestonlinelogsequence36

Nextlogsequencetoarchive 38

Currentlogsequence38

>alterdatabaseopen;

--进行redo日志的切换

>altersystem switch logfile;

--查看当前的归档进程状态

>select*fromv$archive_processes;

PROCESS STATUS LOG_SEQUENCE STAT ROLES

---------- ---------- ------------ ---- ------------------------------------

0 ACTIVE 0 IDLE

1 ACTIVE 0 IDLE NO_FAL NO_SRL

2 ACTIVE 0 IDLE HEART_BEAT

3 ACTIVE 0 IDLE

4 STOPPED 0 IDLE

......

此处输出结果内容较多,省略一部分。

[oracle@uumile arch]$ ps -ef | grep ora_ar

oracle    3054     1  0 22:44 ?        00:00:00 ora_arc0_test

oracle    3058     1  0 22:44 ?        00:00:00 ora_arc1_test

oracle    3062     1  0 22:44 ?        00:00:00 ora_arc2_test

oracle    3066     1  0 22:44 ?        00:00:00 ora_arc3_test

oracle    3262  3228  0 23:11 pts/1    00:00:00 grep ora_ar

--查看当前最大的归档进程数

>sho parametermax

NAMETYPEVALUE

------------------------------------ ----------- ------------------------------

log_archive_max_processesinteger4

--停止arch processes,下面我们来手动停止arch process

>altersystem archivelogstop;

System altered.

Elapsed:00:00:00.00

#此处我们可以看到,命令没有问题

--检查arch processes状态

>select*fromv$archive_processes;

PROCESS STATUS LOG_SEQUENCE STAT ROLES

---------- ---------- ------------ ---- ------------------------------------

0 ACTIVE 0 IDLE

1 ACTIVE 0 IDLE NO_FAL NO_SRL

2 ACTIVE 0 IDLE HEART_BEAT

3 ACTIVE 0 IDLE

4 STOPPED 0 IDLE

[oracle@uumile arch]$ps-ef|grep ora_ar

oracle 3054 1 0 22:44?00:00:00 ora_arc0_test

oracle 3058 1 0 22:44?00:00:00 ora_arc1_test

oracle 3062 1 0 22:44?00:00:00 ora_arc2_test

oracle 3066 1 0 22:44?00:00:00 ora_arc3_test

oracle 3262 3228 0 23:11 pts/1 00:00:00 grep ora_ar

--启动arch process

>altersystem archivelogstart;

System altered.

Elapsed:00:00:00.01

sys@TEST(127.0.0.1)>!ps-ef|grep arc

oracle 3054 1 0 22:44?00:00:00 ora_arc0_test

oracle 3058 1 0 22:44?00:00:00 ora_arc1_test

oracle 3062 1 0 22:44?00:00:00 ora_arc2_test

oracle 3066 1 0 22:44?00:00:00 ora_arc3_test

oracle 3267 2959 0 23:12 pts/1 00:00:00/bin/bash-c ps-ef|grep arc

总结

通过上面的测试,可以得出结论,alter system archive log stop/start在9i 或者10g中是可以执行和生效的。

在11g中,alter system archive log start/stop 语法和命令没有问题,但是命令并没有真正生效。

上一篇下一篇

猜你喜欢

热点阅读