RAC修改数据库的spfile位置

来源:互联网 发布:ping ip加端口 编辑:程序博客网 时间:2022/07/04 22:56
RAC修改spfile位置[root@rac1 ~]# su - oracle[oracle@rac1 ~]$ sqlplus  / as sysdbaSQL*Plus: Release 11.2.0.3.0 Production on Wed Jan 8 22:36:39 2014Copyright (c) 1982, 2011, Oracle.  All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionWith the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,Data Mining and Real Application Testing optionsSQL> select status from gv$instance;STATUS------------------------OPENOPEN SQL> show parameter db_nameNAME                                 TYPE                   VALUE------------------------------------ ---------------------- ------------------------------db_name                              string                  orcl1.查看当前的DATABASE spfile 位置SQL> show parameter spfile NAME                                 TYPE        VALUE------------------------------------ ----------- ------------------------------spfile                               string      +ORCLDG/orcl/spfileorcl.ora2.备份 pfile[oracle@rac1 ~]$ cd $ORACLE_HOME/dbs[oracle@rac1 ~]$ more initorcl1.ora    spfile='+ORCLDG/orcl/spfileorcl.ora'[oracle@rac1 ~]$ cp initorcl1.ora  initorcl1.orabak3.重新在指定路径创建 spfile[oracle@rac1 ~]$ sqlplus / as sysdbaSQL> create  pfile from spfile;SQL> create spfile='+ORCL_FRA' from pfile;4.查看新创建spfile位置[oracle@rac1 ~]$ su - grid [grid@yyzfrac1 ~]$ asmcmdASMCMD> lsdgState    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  NameMOUNTED  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_FRAASMCMD> lsORCL/ASMCMD> cd orclASMCMD> lsCONTROLFILE/PARAMETERFILE/control01.ctlcontrol02.ctlASMCMD> cd PARAMETERFILE/ASMCMD> lsspfile.258.8363455355.指定新的spfile别名ASMCMD>mkalias +ORCL_FRA/ORCL/PARAMETERFILE/spfile.258.836345535   +ORCL_FRA/ORCL/spfileorcl.ora6.用srvctl修改新的rac数据库spfile 位置[oracle@yyzfrac2 dbs]$ srvctl  modify database -d orcl -p +orcl_fra/orcl/spfileorcl.ora7.删除原来的spfile [oracle@rac1 ~]$ sqlplus / as sysdbaSQL>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 3000SQL> show parameter spfile NAME                                 TYPE        VALUE------------------------------------ ----------- ------------------------------spfile                               string      +ORCL_FRA/orcl/spfileorcl.ora

0 0