在11g的cluster中,我们往往用dbs下的初始化文件(pfile),来指定asm中实际存在的spfile
1 2 3 4 5 6 |
[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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
[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目录下的配置。
1 2 3 |
[oracle@ol6-121-rac1 dbs]$ srvctl config database -d cdbrac |grep spfile Spfile: +DATA/cdbrac/spfilecdbrac.ora [oracle@ol6-121-rac1 dbs]$ |
如果要修改spfile的路径,就必须修改ocr中的信息了:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
[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