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

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

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

Oracle 归档模式和非归档模式

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

【Oracle】使用BBED跳过丢失的归档

在recover datafile的过程当中如果丢失了需要的归档将使得recover无法进行,使用bbed工具可以跳过丢失的归档进行recover datafile。 实验过程如下: SYS@OR...
  • badly9
  • badly9
  • 2014年06月20日 10:36
  • 912

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

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

oracle rac启用归档模式

环境: 2个节点的RAC 数据库版本:12.1.0.2.0 目的: 启动归档日志,同时将归档日志存放到共享目录(我这里的是ASM磁盘组) 操作: 1、创建共享ASM磁盘组 C:\User...
  • wo198711203217
  • wo198711203217
  • 2016年08月17日 15:56
  • 336

Oracle-->数据库备份与恢复-->数据库库归档模式

数据库可运行在两种模式下:ARCHIVELOG和NOARCHIVELOG模式。归档模式指明何时Redo Log文件可以被重用。 1.1.1   NOARCHIVELOG 1.     ...
  • snowfoxmonitor
  • snowfoxmonitor
  • 2014年07月04日 21:49
  • 860

查看oracle数据库是否为归档模式启动

[1]   1.select name,log_mode from v$database;    NAME LOG_MODE    ------------------ ------------...
  • peibolinux
  • peibolinux
  • 2014年03月14日 10:43
  • 6570

检测数据库日志的切换频率及归档文件大小的sql

DBA的日常功能SQL之一,绝对原创。 查看数据库的日志切换频率及生成速度是DBA的日常工作之一,通过观察相关信息可以调整online redo 的大小及切换频率。 非归档模式主要...
  • ctypyb2002
  • ctypyb2002
  • 2016年03月23日 09:15
  • 1008

oracle归档模式Archivelog和非归档模式NOArchivelog

oracle的归档模式 一。查看oracle数据库是否为归档模式: 1.select name,log_mode from v$database; NAME LOG_MODE ---------...
  • zhanzhib
  • zhanzhib
  • 2015年01月31日 13:46
  • 403

归档日志+oracle日志模式+设置数据库模式+查看当前数据库运行模式

归档日志:完整记录对数据库的全部操作. 1重做日志文件记录对数据操作,而且重做日文件是循环使用的, 当所有的日志文件被塞满时候,系统自动切换到第一组日志文件。 接下来 2在循环使用日志文件时...
  • zhou920786312
  • zhou920786312
  • 2017年05月16日 11:28
  • 720
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:oracle 9i\10gr1\10gr2归档模式切换
举报原因:
原因补充:

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