作者:容易 2013-04-09 21:45:47
oracle归档模式转换操作流程
一、查看数据库归档模式
通过sys用户登录oracle服务器运行以下命令
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /oracle/oradata/archive
Oldest online log sequence 1328
Current log sequence 1330
二、将非归档改为归档模式
1)先关闭数据库,必须使用normal,immediate,transactional中的其中一种关闭数据库
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
2)将数据库启动到mount状态
SQL> startup mount;
ORACLE instance started.
Total System Global Area 2147483648 bytes
Fixed Size 2085320 bytes
Variable Size 452988472 bytes
Database Buffers 1677721600 bytes
Redo Buffers 14688256 bytes
Database mounted.
3)修改数据库为归档模式
SQL> alter database archivelog;
Database altered.
4)open数据库
SQL> alter database open;
Database altered.
5)查看数据库归档状态
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oracle/oradata/archive
Oldest online log sequence 1328
Next log sequence to archive 1330
Current log sequence 1330
6)查看归档路径
SQL> show parameter log_archive_dest;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest string
log_archive_dest_1 string location=/oracle/oradata/archive
log_archive_dest_10 string
....
7)手段归档测试,查看归档目录是否生成了新的归档文件
SQL> alter system archive log current;
System altered.
8)关于log_archive_start参数,oracle10g中只要设置了归档不论该参数是否为true都会启动归档进程,进行简单的测试
SQL> show parameter log_archive_start;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_start boolean FALSE
将数据库启动到mount状态时,不会启动archive归档进程,startup mount状态时的oracle进程
22429 oracle 18 0 2194m 22m 19m S 0.0 0.3 0:00.01 ora_pmon_pnrdb
22431 oracle 18 0 2193m 17m 14m S 0.0 0.2 0:00.00 ora_psp0_pnrdb
22433 oracle 18 0 2193m 78m 75m S 0.0 1.0 0:00.19 ora_mman_pnrdb
22435 oracle 18 0 2195m 20m 14m S 0.0 0.3 0:00.01 ora_dbw0_pnrdb
22437 oracle 18 0 2193m 18m 14m S 0.0 0.2 0:00.00 ora_lgwr_pnrdb
22439 oracle 18 0 2193m 22m 18m S 0.0 0.3 0:00.01 ora_ckpt_pnrdb
22441 oracle 24 0 2193m 17m 14m S 0.0 0.2 0:00.01 ora_smon_pnrdb
22443 oracle 18 0 2193m 17m 14m S 0.0 0.2 0:00.00 ora_reco_pnrdb
22445 oracle 15 0 2193m 26m 23m S 0.0 0.3 0:00.02 ora_mmon_pnrdb
22447 oracle 18 0 2193m 17m 14m S 0.0 0.2 0:00.00 ora_mmnl_pnrdb
将数据库重新设置为非归档模式,重新open后的服务器进程有
SQL> alter database noarchivelog;
Database altered.
SQL> alter database open;
Database altered.
22429 oracle 15 0 2194m 23m 19m S 0.0 0.3 0:00.01 ora_pmon_pnrdb
22431 oracle 15 0 2193m 17m 14m S 0.0 0.2 0:00.00 ora_psp0_pnrdb
22433 oracle 15 0 2193m 78m 75m S 0.0 1.0 0:00.19 ora_mman_pnrdb
22435 oracle 15 0 2197m 22m 16m S 0.0 0.3 0:00.01 ora_dbw0_pnrdb
22437 oracle 15 0 2208m 47m 43m S 0.0 0.6 0:00.05 ora_lgwr_pnrdb
22439 oracle 16 0 2193m 28m 24m S 0.0 0.4 0:00.02 ora_ckpt_pnrdb
22441 oracle 15 0 2193m 52m 48m S 0.0 0.7 0:00.08 ora_smon_pnrdb
22443 oracle 18 0 2193m 17m 14m S 0.0 0.2 0:00.00 ora_reco_pnrdb
22445 oracle 15 0 2196m 70m 64m S 0.0 0.9 0:00.33 ora_mmon_pnrdb
22447 oracle 18 0 2193m 24m 21m S 0.0 0.3 0:00.01 ora_mmnl_pnrdb
22449 oracle 18 0 2196m 72m 67m S 0.0 0.9 0:00.51 oraclepnrdb (DESCRIPTION=(LO
22455 oracle 17 0 2193m 18m 15m S 0.0 0.2 0:00.00 ora_qmnc_pnrdb
22461 oracle 18 0 2195m 35m 29m S 0.0 0.4 0:00.13 ora_cjq0_pnrdb
22463 oracle 18 0 2193m 24m 20m S 0.0 0.3 0:00.02 ora_q000_pnrdb
再次将数据库关闭,设置为归档模式,并且open数据库
22471 oracle 15 0 2194m 23m 19m S 0.0 0.3 0:00.01 ora_pmon_pnrdb
22473 oracle 15 0 2193m 17m 14m S 0.0 0.2 0:00.01 ora_psp0_pnrdb
22475 oracle 15 0 2193m 78m 75m S 0.0 1.0 0:00.19 ora_mman_pnrdb
22477 oracle 15 0 2197m 22m 16m S 0.0 0.3 0:00.01 ora_dbw0_pnrdb
22479 oracle 15 0 2208m 48m 44m S 0.0 0.6 0:00.02 ora_lgwr_pnrdb
22481 oracle 16 0 2193m 28m 24m S 0.0 0.4 0:00.02 ora_ckpt_pnrdb
22483 oracle 15 0 2193m 52m 48m S 0.0 0.7 0:00.08 ora_smon_pnrdb
22485 oracle 18 0 2193m 28m 25m S 0.0 0.4 0:00.02 ora_reco_pnrdb
22487 oracle 15 0 2196m 70m 64m S 0.0 0.9 0:00.32 ora_mmon_pnrdb
22489 oracle 15 0 2193m 24m 21m S 0.0 0.3 0:00.02 ora_mmnl_pnrdb
22491 oracle 17 0 2196m 71m 65m S 0.0 0.9 0:00.49 oraclepnrdb (DESCRIPTION=(LO
22495 oracle 18 0 2208m 33m 29m S 0.0 0.4 0:00.00 ora_arc0_pnrdb
22497 oracle 19 0 2208m 33m 29m S 0.0 0.4 0:00.00 ora_arc1_pnrdb
22499 oracle 15 0 2193m 18m 15m S 0.0 0.2 0:00.00 ora_qmnc_pnrdb
22505 oracle 15 0 2195m 35m 29m S 0.0 0.4 0:00.14 ora_cjq0_pnrdb
22507 oracle 18 0 2193m 24m 20m S 0.0 0.3 0:00.01 ora_q000_pnrdb
22509 oracle 19 0 2193m 18m 14m S 0.0 0.2 0:00.01 ora_q001_pnrdb
查看log_archive_start 参数。
SQL> show parameter log_archive_start;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_start boolean FALSE
One Response