Oracle11g RAC开启关闭、设置归档小结
程序员文章站
2023-01-23 10:51:46
关闭
1.先关数据库:
复制代码 代码如下:
[oracle@oeltan1 ~]$ srvctl stop database -d tantest
2.再关闭cr...
关闭
1.先关数据库:
复制代码 代码如下:
[oracle@oeltan1 ~]$ srvctl stop database -d tantest
[
复制代码 代码如下:
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
sql> alter diskgroup fri add directory '+fri/tantest'; sql> alter diskgroup fri add directory '+fri/tantest/arch1';
还可以通过asmcmd创建目录:
asmcmd> pwd +fri/tantest asmcmd> 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
4.分别检查:
sql> 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>