首页 > 代码库 > RAC修改数据库的spfile位置
RAC修改数据库的spfile位置
RAC修改spfile位置 [root@rac1 ~]# su - oracle [oracle@rac1 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.3.0 Production on Wed Jan 8 22:36:39 2014 Copyright (c) 1982, 2011, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options SQL> select status from gv$instance; STATUS ------------------------ OPEN OPEN SQL> show parameter db_name NAME TYPE VALUE ------------------------------------ ---------------------- ------------------------------ db_name string orcl 1.查看当前的DATABASE spfile 位置 SQL> show parameter spfile NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ spfile string +ORCLDG/orcl/spfileorcl.ora 2.备份 pfile [oracle@rac1 ~]$ cd $ORACLE_HOME/dbs [oracle@rac1 ~]$ more initorcl1.ora spfile=‘+ORCLDG/orcl/spfileorcl.ora‘ [oracle@rac1 ~]$ cp initorcl1.ora initorcl1.orabak 3.重新在指定路径创建 spfile [oracle@rac1 ~]$ sqlplus / as sysdba SQL> create pfile from spfile; SQL> create spfile=‘+ORCL_FRA‘ from pfile; 4.查看新创建spfile位置 [oracle@rac1 ~]$ su - grid [grid@yyzfrac1 ~]$ asmcmd ASMCMD> lsdg State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name MOUNTED NORMAL N 512 4096 1048576 6144 5218 2048 1585 0 Y OCRDG/ MOUNTED EXTERN N 512 4096 1048576 204800 204704 0 204704 0 N ORCLDG/ MOUNTED EXTERN N 512 4096 1048576 204800 204704 0 204704 0 N ORCL_FRA/ ASMCMD> cd ORCL_FRA ASMCMD> ls ORCL/ ASMCMD> cd orcl ASMCMD> ls CONTROLFILE/ PARAMETERFILE/ control01.ctl control02.ctl ASMCMD> cd PARAMETERFILE/ ASMCMD> ls spfile.258.836345535 5.指定新的spfile别名 ASMCMD>mkalias +ORCL_FRA/ORCL/PARAMETERFILE/spfile.258.836345535 +ORCL_FRA/ORCL/spfileorcl.ora 6.用srvctl修改新的rac数据库spfile 位置 [oracle@yyzfrac2 dbs]$ srvctl modify database -d orcl -p +orcl_fra/orcl/spfileorcl.ora 7.删除原来的spfile [oracle@rac1 ~]$ sqlplus / as sysdba SQL>alter diskgroup orcldg drop file ‘+orcldg/orcl/spfileorcl.ora‘; 8.分别在两个节点中更新initorcl1.ora initorcl2.ora 内容为spfile=‘+orcl_fra/orcl/spfileorcl.ora‘ 9.重新启动数据库 [oracle@rac1 ~]$srvctl stop database -d orcl [oracle@rac1 ~]$srvctl start database -d orcl 10.在两节点查看spfile位置 SQL> set line 3000 SQL> show parameter spfile NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ spfile string +ORCL_FRA/orcl/spfileorcl.ora
本文出自 “O Record” 博客,请务必保留此出处http://evils798.blog.51cto.com/8983296/1420930
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。