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

相关文章推荐

Linux 平台下Oracle 9i/10g/11gR1 IO-Fencing 的hangcheck-timer 模块说明

一.官网的说明参考MOS:Linux: Hangcheck-Timer Module Requirements for Oracle 9i, 10g, and11gR1 RAC [ID 726833....

Oracle10gR2 on SLES9 x86_64安装技术文档(原版英文)

Requirements for Installing Oracle 10gR2 RDBMS on SLES 9 on AMD/EM64T [ID 365607.1]  ...

Oracle 10gR2 32bit on SuSE9安装技术文档(原版英文)

Requirements for Installing Oracle 10gR2 32-bit on SLES 9 [ID 400429.1]   修改时间 08-JU...

Oracle 9i/10g/11g编程艺术(2e)学习笔记【第2章】

第二章  体系结构概述 1、数据库(database)、实例(instance)及关系       数据库(database):物理操作系统文件或磁盘(disk)的集合,是磁盘上存储的数据集合。 ...

Oracle 9i/10g/11g编程艺术(2e)学习笔记【第3章】

第三章  文件 1、概述:构成数据库和实例的文件类型主要有以下8种。     与实例相关的文件包括:参数文件(parameter file)、跟踪文件(trace file)、警告文件(alert...

Oracle 9i/10g/11g编程艺术(2e)学习笔记【第6章】

第六章 锁和闩 1、锁定问题 (1)丢失更新:使用Oracle某种锁定策略(悲观锁定/乐观锁定)可以避免丢失更新。 (2)Oracle提供两种锁定策略:悲观锁定、乐观锁定。 (3)悲观锁定...

Oracle 9i/10g/11g编程艺术(2e)学习笔记【第1章】

第一章  开发成功的Oracle应用 1、关于位图索引        位图索引适用于低基数(low-cardinality)列。低基数列就是指这个列只有很少的可取值。采用位图索引,一个键指向多...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

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