Oracle11g RAC开启关闭、设置归档小结

前端之家收集整理的这篇文章主要介绍了Oracle11g RAC开启关闭、设置归档小结前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

关闭

1.先关数据库

代码如下:
[oracle@oeltan1 ~]$ srvctl stop database -d tantest
2.再关闭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
--------------------------------------------------------------------------------
CRS
DATA1
FRI

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

还可以通过asmcmd创建目录:

pwd +FRI/TANTEST ASMCMD> mkdir ARCH2

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

sql;"> 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.两个节点上分别都执行:

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

4.分别检查:

archive log list Database log mode Archive Mode Automatic archival Enabled Archive destination +FRI/tantest/arch1 Oldest online log sequence 14 Next log sequence to archive 15 Current log sequence 15

sql> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +FRI/tantest/arch2
Oldest online log sequence 6
Next log sequence to archive 7
Current log sequence 7
sql>

猜你在找的Oracle相关文章