IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    12c的cluster中,dbs下指定spfile不生效

    小荷发表于 2016-06-24 03:41:44
    love 0

    在11g的cluster中,我们往往用dbs下的初始化文件(pfile),来指定asm中实际存在的spfile

    [oracle@ol6-112-rac1 dbs]$ cd /u01/app/oracle/product/11.2.0.4/db_1/dbs
    [oracle@ol6-112-rac1 dbs]$ ls
    hc_acfsdb.dat  hc_cdbrac_1.dat  hc_cdbrac_2.dat  initcdbrac_1.ora  initcdbrac_1.ora.orig  init.ora  orapwacfsdb  spfileacfsdb.ora
    [oracle@ol6-121-rac1 dbs]$ cat initcdbrac_1.ora
    SPFILE='+DATA/cdbrac/spfilecdbrac.ora'
    [oracle@ol6-112-rac1 dbs]$

    但是在12c中,如果我去修改dbs下的pfile指定spfile,这个设置就不会生效了,如我将文件指定到/tmp目录下,你会发现启动之后,它还是用到了asm上的spfile:

    [oracle@ol6-121-rac1 dbs]$ cat initcdbrac_1.ora
    SPFILE='/tmp/pfile.ora'
    [oracle@ol6-121-rac1 dbs]$
    [oracle@ol6-121-rac1 dbs]$ sqlplus "/ as sysdba"
     
    SQL*Plus: Release 12.1.0.1.0 Production on Thu Jun 23 11:24:12 2016
     
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
     
     
    Connected to:
    Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
    With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
    Advanced Analytics and Real Application Testing options
     
    SQL> shutdown abort
    ORACLE instance shut down.
    SQL> startup nomount
    ORACLE instance started.
     
    Total System Global Area 1219260416 bytes
    Fixed Size            2287768 bytes
    Variable Size          838862696 bytes
    Database Buffers      369098752 bytes
    Redo Buffers            9011200 bytes
    SQL> show parameter spfile
     
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    spfile                     string     +DATA/cdbrac/spfilecdbrac.ora
     
    SQL> exit

    这是因为在12c的cluster中,spfile的信息已经固定在ocr中,不会去考虑dbs目录下的配置。

    [oracle@ol6-121-rac1 dbs]$ srvctl config database -d cdbrac |grep spfile
    Spfile: +DATA/cdbrac/spfilecdbrac.ora
    [oracle@ol6-121-rac1 dbs]$

    如果要修改spfile的路径,就必须修改ocr中的信息了:

    [oracle@ol6-121-rac1 dbs]$ srvctl modify database -d cdbrac -spfile '/tmp/pfile.ora'
    [oracle@ol6-121-rac1 dbs]$
    [oracle@ol6-121-rac1 dbs]$
    [oracle@ol6-121-rac1 dbs]$ sqlplus "/ as sysdba"
     
    SQL*Plus: Release 12.1.0.1.0 Production on Thu Jun 23 11:27:48 2016
     
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
     
     
    Connected to:
    Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
    With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
    Advanced Analytics and Real Application Testing options
     
    SQL> shutdown abort
    ORACLE instance shut down.
    SQL> startup nomount
    ORACLE instance started.
     
    Total System Global Area 1219260416 bytes
    Fixed Size            2287768 bytes
    Variable Size          838862696 bytes
    Database Buffers      369098752 bytes
    Redo Buffers            9011200 bytes
    SQL>
    SQL> show parameter spfile
     
    NAME                     TYPE     VALUE
    ------------------------------------ ----------- ------------------------------
    spfile                     string     /tmp/pfile.ora
     
    SQL> shutdown abort
    ORACLE instance shut down.
    SQL> exit

    oracle 12c舍弃dbs下用init.ora中写spfile的路径,我估计是因为12c中有flex cluster。也就是说,instance1 可以跑到节点2主机,那么在节点2主机的dbs目录下,如果按照原来的模式,是有initsid2.ora这个文件,就调不起来instance 1。所以干脆就废弃使用dbs目录下的init文件了。



沪ICP备19023445号-2号
友情链接