首先查看数据库现有模式可使用以下语句:
select name,log_mode from v$database;
也可以用下面的语句:
archive log list;(该方法需要as sysdba)
10G RAC更改归档方式:
1、登录两个实例后,在每个实例上执行:
shutdown immediate
2、打开归档(在一个实例上执行):
startup mount
alter database archivelog;
alter database open;
3、关闭归档(在一个实例上执行):
startup mount
alter database noarchivelog;
alter database open;
4、在另一个实例上执行:
startup
[@more@]
最好重启crs,使用sqlplus startup是使用pfile启动的(没有spfile)。
10G单库更改归档位置:
alter system set log_archive_dest_1="location=/archive" scope=spfile;
注意:是双引号,log_archive_dest_1不是log_archive_dest!!
10G RAC更改归档位置:
alter system set log_archive_dest_1="location=/archive" scope=spfile sid='*';
归档模式:
alter system set log_archive_format="%t_%s_%r.arch" scope=spfile sid='*';
10G中不需要设置LOG_ARCHIVE_START=true,10G中这个参数已废弃!
注意:
如果归档使用nfs方式共享,在一个节点上访问两个两个节点的归档日志,配置如下:
alter system set log_archive_dest_1="location=/archive" scope=spfile sid='ysdb1';
alter system set log_archive_dest_1="location=/archive1" scope=spfile sid='ysdb2';
ysdb1的归档目录/archive-->使用nfs挂载到ysdb2的/archive上
如果想在两个节点上都能访问另一个节点的归档,再将ysdb2的归档目录/archive1-->使用nfs挂载到ysdb1的/archive1上
两个节点的归档目录必须配置成不一样,然后按如上方式使用nfs挂载,否则recover的时候,会找不到某个节点的归档日志!这样设置无论在哪个节点上恢复都可以访问另一个节点上的归档日志。也可以只在某个节点ysdb2上使用nfs挂载ysdb1的归档目录,这样只能在ysdb2上访问ysdb1的归档,在ysdb2上恢复。
oracle归档进程写日志到NFS文件系统,与一般的在NFS文件系统上通过命令添加删除文件是不同的,要在mount NFS文件系统的时候指定一定的参数才能让归档进程正常归档。
原来是这样指定mount的:
mount -t nfs 192.168.0.21:/archive /archive
备份归档时报错:
ORA-19625: error identifying file /archive/1_42_682943725.arch
ORA-27054: NFS file system where the file is created or resides is not mounted with correct options
需要增加mount参数:
Mount -t nfs -o rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,vers=3,timeo=600,actimeo=0 192.168.0.21:/archive /archive
指定参数后,归档进程就可以正常的在NFS文件系统上归档了。
在oracle环境中使用NFS,在mount的时候需要修改一些选项,否则可能导致各种问题,比如ORA-27086和ORA-27054错误。不管你是将Oracle安装在NFS设备也好,是将datafile放置在NFS设备也好,是备份到NFS设备也好,如果出现相关的错误,则需要检查下是否mount的选项有问题。一般只要用hard方式来mount的,都不会有太多问题。
以下内容引自Metalink(Doc ID:359515.1),适用于10.1.0.2以上版本,供参考:
RAC
In the table below
_ Binaries is the shared mount points where the Oracle Home and CRS_HOME is installed.
_ Datafiles includes Online Logs, Controlfile and Datafiles
Operating System | Mount options for Binaries | Mount options for Oracle Datafiles | Mount options for CRS Voting Disk and OCR |
Sun Solaris * | rw,bg,hard,nointr,rsize=32768, | rw,bg,hard,nointr,rsize=32768, | rw,bg,hard,nointr,rsize=32768, |
AIX (5L) ** | rw,bg,hard,nointr,rsize=32768, | cio,rw,bg,hard,nointr,rsize=32768, | cio,rw,bg,hard,intr,rsize=32768, |
HPUX 11.23 **** – | rw,bg,vers=3,proto=tcp,noac, | rw,bg,vers=3,proto=tcp,noac, | rw,bg,vers=3,proto=tcp,noac, |
Linux x86 | rw,bg,hard,nointr,rsize=32768, | rw,bg,hard,nointr,rsize=32768, | rw,bg,hard,nointr,rsize=32768, |
Linux x86-64 # | rw,bg,hard,nointr,rsize=32768, | rw,bg,hard,nointr,rsize=32768, | rw,bg,hard,nointr,rsize=32768, |
Linux - Itanium | rw,bg,hard,nointr,rsize=32768, | rw,bg,hard,nointr,rsize=32768, | rw,bg,hard,nointr,rsize=32768, |
* NFS mount option “forcedirectio” is required on Solaris platforms when mounting the OCR/CRS files when using Oracle 10.1.0.4 or 10.2.0.2 or later (Oracle unpublished bug 4466428)
** AIX is only supported with NAS on AIX 5.3 TL04 and higher with Oracle 10.2.0.1 and later (NetApp)
*** NAS devices are only supported with HPUX 11.23 or higher ONLY
# These mount options are forLinux kernels 2.6 and above for older kernels please check Note 279393.1
Due to Unpublished bug 5856342, it is necessary to use the following init.ora parameter when using NAS
with all versions of RAC on Linux (x86 & X86-64 platforms) until 10.2.0.4. This bug is fixed and included in 10.2.0.4 patchset.
filesystemio_options = DIRECTIO
Single Instance
Operating System | Mount options for Binaries | Mount options for Oracle Datafiles |
Sun Solaris * | rw,bg,hard,rsize=32768, | rw,bg,hard,rsize=32768, |
AIX (5L) ** | rw,bg,hard,rsize=32768, | rw,bg,hard,rsize=32768, |
HPUX 11.23 **** | rw,bg,hard,rsize=32768, | rw,bg,hard,rsize=32768, |
Linux x86 | rw,bg,hard,rsize=32768, | rw,bg,hard,rsize=32768, |
Linux x86-64 # | rw,bg,hard,rsize=32768, | rw,bg,hard,rsize=32768, |
Linux - Itanium | rw,bg,hard,rsize=32768, | rw,bg,hard,rsize=32768, |
* actime=0 or noac can be used
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/670493/viewspace-1024890/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/670493/viewspace-1024890/