复制代码

作者:在线彩票投注-数据库

1.先关数据库:复制代码 代码如下:[oracle@oeltan1 ~]$ srvctl stop database -d tantest2.再关闭crs服务[复制代码 代码如下:root@oeltan1 ~]# crsctl stop crs启动:

复制代码 代码如下:[root@oeltan1 ~]# crsctl start crs[oracle@oeltan1 ~]$srvctl start asm -n node_name上述开机一般已经启动复制代码 代码如下:[oracle@oeltan1 ~]$ srvctl start database -d tantest归档设置:

  1. 分别创建两个实例的ASM目录任意一个实例,grid用户下:复制代码 代码如下:# su - grid[grid@oeltan1 ~]$ sqlplus "/as sysasm"SQL> select name from V$asm_diskgroup;NAME--------------------------------------------------------------------------------CRSDATA1FRI

    SQL> alter diskgroup FRI add directory '+FRI/TANTEST';SQL> alter diskgroup FRI add directory '+FRI/TANTEST/ARCH1';

还可以通过asmcmd创建目录:

ASMCMD> pwd+FRI/TANTESTASMCMD> mkdir ARCH2

2.修改归档参数任意一个实例,oracle用户下:

ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=+FRI/TANTEST/ARCH1' SCOPE=both SID='tantest1'; ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=+FRI/TANTEST/ARCH2' SCOPE=both SID='tantest2'; 

3.两个节点上分别都执行:

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

--修改一个实例时,另一个实例不能在open状态,否则报ORA-01126: database must be mounted in this instance and not open in any

SQL> archive log listDatabase log mode Archive ModeAutomatic archival EnabledArchive destination +FRI/tantest/arch1Oldest online log sequence 14Next log sequence to archive 15Current log sequence 15SQL> archive log listDatabase log mode Archive ModeAutomatic archival EnabledArchive destination +FRI/tantest/arch2Oldest online log sequence 6Next log sequence to archive 7Current log sequence 7SQL>

本文由彩票投注软件发布,转载请注明来源

关键词: