oracle 9i\10gr1\10gr2归档模式切换

转载 2016年11月10日 15:29:24

Single Instance

Oracle 9i

On a single node 9i instance the archive log mode is reset as follows.

ALTER SYSTEM SET log_archive_start=TRUE SCOPE=spfile;
ALTER SYSTEM SET log_archive_dest_1='location=/u01/oradata/MYSID/archive/' SCOPE=spfile;
ALTER SYSTEM SET log_archive_format='arch_%t_%s.arc' SCOPE=spfile;

SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ARCHIVE LOG START;
ALTER DATABASE ARCHIVELOG;
ALTER DATABASE OPEN;

Oracle 10g Upward

In Oracle 10g the LOG_ARCHIVE_START parameter and ARCHIVE LOG START command have been deprecated, so you will use the following code.

ALTER SYSTEM SET log_archive_dest_1='location=/u01/oradata/MYSID/archive/' SCOPE=spfile;
ALTER SYSTEM SET log_archive_format='arch_%t_%s_%r.arc' SCOPE=spfile;

SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER DATABASE ARCHIVELOG;
ALTER DATABASE OPEN;

Real Application Clusters (RAC)

The ALTER DATABASE ARCHIVELOG command can only be performed if the database in mounted in exclusive mode. This means the whole clustered database must be stopped before the operation can be performed.

Oracle 9i

First we set the relevant archive parameters.

ALTER SYSTEM SET log_archive_start=TRUE SCOPE=spfile;
ALTER SYSTEM SET log_archive_dest_1='location=/u01/oradata/MYDB/archive/' SCOPE=spfile;
ALTER SYSTEM SET log_archive_format='arch_%t_%s.arc' SCOPE=spfile;

Since we need to mount the database in exclusive mode we must also alter the following parameter.

ALTER SYSTEM SET cluster_database=FALSE SCOPE=spfile;

From the command line we can stop the entire clustered database using the following.

$ srvctl stop database -d MYDB

With the cluster down we can connect to a single node and issue the following commands.

STARTUP MOUNT;
ARCHIVE LOG START;
ALTER DATABASE ARCHIVELOG;
ALTER SYSTEM SET cluster_database=TRUE SCOPE=spfile;
SHUTDOWN IMMEDIATE;

Notice that the CLUSTER_DATABASE parameter has been reset to it's original value. Since the datafiles and spfile are shared between all instances this operation only has to be done from a single node.

From the command line we can now start the clustered database again using the following.

$ srvctl start database -d MYDB

The current settings place all archive logs in the same directory. This is acceptable since the thread (%t) is part of the archive format preventing any name conflicts between instances. If node-specific locations are required the LOG_ARCHIVE_DEST_1 parameter can be repeated for each instance with the relevant SID prefix.

Oracle 10gR1

If the LOG_ARCHIVE_DEST_n parameters are not set, the archived redo logs will be placed in the FRA. If you want to specify their location and the file name format manually, you can do it as follows.

ALTER SYSTEM SET log_archive_dest_1='location=/u01/oradata/MYDB/archive/' SCOPE=spfile;
ALTER SYSTEM SET log_archive_format='arch_%t_%s_%r.arc' SCOPE=spfile;

Since we need to mount the database in exclusive mode we must also alter the following parameter.

ALTER SYSTEM SET cluster_database=FALSE SCOPE=spfile;

From the command line we can stop the entire clustered database using the following.

$ srvctl stop database -d MYDB

With the cluster down we can connect to a single node and issue the following commands.

STARTUP MOUNT;
ALTER DATABASE ARCHIVELOG;
ALTER SYSTEM SET cluster_database=TRUE SCOPE=spfile;
SHUTDOWN IMMEDIATE;

Notice that the CLUSTER_DATABASE parameter has been reset to it's original value. Since the datafiles and spfile are shared between all instances this operation only has to be done from a single node.

From the command line we can now start the clustered database again using the following.

$ srvctl start database -d MYDB

Oracle 10gR2

From 10gR2, you no longer need to reset the CLUSTER_DATABASE parameter during the process.

If the LOG_ARCHIVE_DEST_n parameters are not set, the archived redo logs will be placed in the FRA. If you want to specify their location and the file name format manually, you can do it as follows.

ALTER SYSTEM SET log_archive_dest_1='location=/u01/oradata/MYDB/archive/' SCOPE=spfile;
ALTER SYSTEM SET log_archive_format='arch_%t_%s_%r.arc' SCOPE=spfile;

From the command line we can stop the entire clustered database and start it in mount mode using the following.

$ srvctl stop database -d MYDB
$ srvctl start database -d MYDB -o mount

With the database mounted issue the following commands.

sqlplus / as sysdba

ALTER DATABASE ARCHIVELOG;
EXIT;

Since the datafiles and spfile are shared between all instances this operation only has to be done from a single node.

From the command line we stop and start the clustered database again using the following commands.

$ srvctl stop database -d MYDB
$ srvctl start database -d MYDB

oracle9i rac环境下如何更改归档模式

在oracle9i rac下,更改归档模式不像单机或主/备模式下那么容易更改,主要是因为cluster_database参数的缘故。通过将cluster_database参数从true改为false,...
  • cn_chenfeng
  • cn_chenfeng
  • 2005-12-14 09:57:00
  • 1774

Oracle 归档模式和非归档模式

归档模式和非归档模式在DBA部署数据库之初,必须要做出的最重要决定之一就是选择归档模式(ARCHIVELOG)或者非 归档模式(NOARCHIVELOG )下运行数据库。我们知道,Oracle 数据库...
  • sunansheng
  • sunansheng
  • 2016-04-29 12:03:29
  • 12128

Oracle将数据库从非归档模式修改为自动归档模式

查看数据库的现行日志和自动归档模式的设置sys@ORCL> archive log list; 数据库日志模式 非存档模式 自动存档 禁用 存档终点 ...
  • u013611461
  • u013611461
  • 2016-12-10 14:11:03
  • 1532

ORACLE数据库ARCHIVELOG,NOARCHIVELOG模式转换简单总结,Redo Log(重做日志)Archive Log(归档日志)

ORACLE数据库ARCHIVELOG,NOARCHIVELOG模式转换简单总结  Oracle9i中有2种日志,一种称为 Redo Log(重做日志),另一种叫做Archive Log(归档...
  • lenovouser
  • lenovouser
  • 2016-10-27 11:38:27
  • 1031

oracle11g设置归档模式和非归档模式

1、首先查看当前数据库是否处于归档模式            可使用如下两种方式查看 1.1  select name, log_mode from v$database; ...
  • weixin_36707770
  • weixin_36707770
  • 2016-12-26 13:31:16
  • 3695

归档模式与非归档模式切换

一下内容都是从网上寻找到的资料,只是个人学习,多个资料合并成的。和其他文档有相同的地方不要见怪。 Oracle数据库可以运行在两种模式下:    归档模式(archivelog)和非归档模式(noar...
  • wjc1000
  • wjc1000
  • 2011-01-10 11:27:00
  • 2350

oracle归档模式设置

自己机子一直装着ORACLE但一直对其如何,初始化,如何运作莫名其妙。今天突然想看看,首先就看到了归档模式这一个东西。下面是我在自己机子上实验步骤。首先用SYS以DBA的身份登陆改变非归档模式到归档模...
  • xiaoduan9678
  • xiaoduan9678
  • 2006-09-19 20:38:00
  • 929

oracle 归档模式

  • 2010年11月09日 21:33
  • 6KB
  • 下载

查看Oracle是否归档和修改归档模式

查看oracle日志模式:archive log list 修改oracle日志模式: 1,关闭数据库:shutdown immediate; 2,启动数据库实例到mount...
  • u012414590
  • u012414590
  • 2017-03-15 17:41:45
  • 3548

把Oracle由归档模式改为非归档模式

把Oracle由归档模式改为非归档模式   开始–>运行命令cmd进入命令行模式  1. 使用命令sqlplus以无日志形式打开如下: sqlplus /nolog;  2. 连接数...
  • yong5241200
  • yong5241200
  • 2014-09-21 13:53:32
  • 2372
收藏助手
不良信息举报
您举报文章:oracle 9i\10gr1\10gr2归档模式切换
举报原因:
原因补充:

(最多只允许输入30个字)