ITPub博客

首页 > 数据库 > Oracle > oracle 开归档

oracle 开归档

原创 Oracle 作者:netwant 时间:2013-04-26 10:12:24 0 删除 编辑
oracle 归档 rac 参数[@more@]

单实例情况

首先建立archivelog目录。注意,该目录需要oracle用户有读写权限。

mkdir -p /arch

chown -R oracle:oinstall /arch

chmod -R 775 /arch

执行以下命令:

SQL> alter system set log_archive_dest_1=' location=/arch ' scope=spfile;

SQL> alter system set log_archive_format='pindb%s%t.arc' scope=spfile;

Alter system set log_archive_start=true scope=spfile; (8i 9i 需要 )

SQL> shutdown immediate

SQL> startup mount

SQL> alter database archivelog;

SQL> alter database open;

至此,模式转化工作已经大功告成。但需要注意的是,由于更改了数据库结构,如有数据库安全方面的需要,必须关闭数据库并完全备份。

alter system switch logfile; 强制切换日志

alter system checkpoint; 强制切换检查点

alter system archive log current

RAC情况下

1.建立所需的目录arch1,arch2,并修改相应的权限,通过nfs,在两个节点上分别mount上去

2.修改spfile相关的参数文件

alter system set log_archive_dest_1='LOCATION=/arch1' scope=spfile sid='*'

alter system set log_archive_dest_2='LOCATION=/arch2' scope=spfile sid='*'

alter system set cluster_database=false scope=spfile sid='node1'

3.关闭两个节点

shutdown immediate

4.启动节点到mount状态

startup mount

5.修改为archivelog状态

alter database archivelog;

6.修改cluster_database为true

alter system set cluster_database=true scope=spfile sid='*'

shutdown immediate

7.重新启动2个实例

其他参数:

log_archive_dest_1='location=/archive/ mandatory reopen'

log_archive_dest_2='service=standby_db1 mandatory reopen=600'

log_archive_dest_3='location=/archive2/ optional'

mandatory:归档真正成功了,online redo才能被覆盖。

optional :就算归档没有成功,online redo 也能被覆盖。(默认)

reopen : 如果归档失败了,是否从新试。reopen=600 就是每隔600秒再重新试,没有次数限制,直到成功。默认是300秒。

log_archive_max_processes:最大的进程。

log_archive_min_succeed_dest = 1: 除了强制(MANDATORY)的至少有1个归档目的成功。

aler system set log_archive_dest_state_2 = defer; (2号停止归档)

aler system set log_archive_dest_state_2 = enable;(2号继续归档)不指定就是enable状态

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/309902/viewspace-1060437/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: drop database
请登录后发表评论 登录
全部评论

注册时间:2010-11-17

  • 博文量
    61
  • 访问量
    180996