Skip to content

Oracle - 2. page

TRUNCATE表后对表大小进行查询,表的空间没有释放完毕?
对此进行实验测试,结果如下:(测试环境LINUX+ORACLE11.2.0.3)
创建表时语句指定了storage (MINEXTENTS 5);时,TRUNCATE后还有5个EXTENT;
创建表时语句不指定storage (MINEXTENTS参数,即使用默认值时;TRUNCATE后只有1个EXTENT;
———— 实验1:指定了storage (MINEXTENTS 5)
SQL> create tablespace test2 datafile ‘/u01/oracle/base/oracle/oradata/bys7/test2.dbf’ size 10m uniform size 40k;
Tablespace created.

SQL> show user
USER is “TEST”
SQL> create table test1(aa number,name varchar2(128)) tablespace test2 storage (MINEXTENTS 5);
Table created.
SQL> select owner,SEGMENT_NAME,TABLESPACE_NAME,EXTENT_ID from dba_extents where SEGMENT_NAME=’TEST1′;
OWNER SEGMENT_NAME TABLESPACE_NAME EXTENT_ID
—————————— ———— ————— ———-
TEST TEST1 TEST2 0
TEST TEST1 TEST2 1
TEST TEST1 TEST2 2
TEST TEST1 TEST2 3
TEST TEST1 TEST2 4

SQL> insert into test1 select object_id,object_name from dba_objects;
13723 rows created.
SQL> commit;
Commit complete.
SQL> select owner,SEGMENT_NAME,TABLESPACE_NAME,EXTENT_ID from dba_extents where SEGMENT_NAME=’TEST1′;
OWNER SEGMENT_NAME TABLESPACE_NAME EXTENT_ID
—————————— ———— ————— ———-
TEST TEST1 TEST2 0
TEST TEST1 TEST2 1
TEST TEST1 TEST2 2
TEST TEST1 TEST2 3
TEST TEST1 TEST2 4
TEST TEST1 TEST2 5
TEST TEST1 TEST2 6
TEST TEST1 TEST2 7
TEST TEST1 TEST2 8
TEST TEST1 TEST2 9
TEST TEST1 TEST2 10
TEST TEST1 TEST2 11
12 rows selected.

SQL>truncate table test1;
Table truncated.

SQL> select owner,SEGMENT_NAME,TABLESPACE_NAME,EXTENT_ID from dba_extents where SEGMENT_NAME=’TEST1′;

OWNER SEGMENT_NAME TABLESPACE_NAME EXTENT_ID
—————————— ———— ————— ———-
TEST TEST1 TEST2 0
TEST TEST1 TEST2 1
TEST TEST1 TEST2 2
TEST TEST1 TEST2 3
TEST TEST1 TEST2 4

SQL> select SEGMENT_NAME,TABLESPACE_NAME,BYTES/1024 kb,EXTENTS,BLOCKS,INITIAL_EXTENT,NEXT_EXTENT,MIN_EXTENTS,MAX_EXTENTS from dba_segments where SEGMENT_NAME=’TEST1′;
SEGMENT_NAME TABLESPACE_NAME KB EXTENTS BLOCKS INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS MAX_EXTENTS
———— ————— ———- ———- ———- ————– ———– ———– ———–
TEST1 TEST2 200 5 25 204800 40960 1 2147483645

实验2:创建表时不指定storage (MINEXTENTS参数 使用默认值
SQL> create table test2 tablespace test2 as select object_id,object_name from dba_objects;
Table created.

SQL> set pagesize 1000
SQL> select owner,SEGMENT_NAME,TABLESPACE_NAME,EXTENT_ID from dba_extents where SEGMENT_NAME=’TEST2′;
OWNER SEGMENT_NAME TABLESPACE_NAME EXTENT_ID
—————————— ———— ————— ———-
TEST TEST2 TEST2 0
TEST TEST2 TEST2 1
TEST TEST2 TEST2 2
TEST TEST2 TEST2 3
TEST TEST2 TEST2 4
TEST TEST2 TEST2 5
TEST TEST2 TEST2 6
TEST TEST2 TEST2 7
TEST TEST2 TEST2 8
TEST TEST2 TEST2 9
TEST TEST2 TEST2 10
TEST TEST2 TEST2 11
12 rows selected.

SQL> truncate table test2;
Table truncated.

SQL> select owner,SEGMENT_NAME,TABLESPACE_NAME,EXTENT_ID from dba_extents where SEGMENT_NAME=’TEST2′;
OWNER SEGMENT_NAME TABLESPACE_NAME EXTENT_ID
—————————— ———— ————— ———-
TEST TEST2 TEST2 0

 

表的storage (MINEXTENTS 属性对truncate后表大小的影响

官方文档中关于NLS_LENGTH_SEMANTICS参数介绍:
可选值是BYTE | CHAR,默认是BYTE,可以在数据库和会话级动态修改。也可以在客户端环境变量中进行设置(不适合JDBC瘦客户端)
NCHAR, NVARCHAR2, CLOB, and NCLOB 始终是基于BYTE。
以SYS用户登陆时不考虑NLS_LENGTH_SEMANTICS参数统一使用BYTE;除非在创建对象等DDL语句中明确定义。
ORACLE强烈建议不能在数据库实例级别设置此参数。
—-
AL32UTF8字符集时一个汉字占三个byte
ZHS16GBK字符集时一个汉字占两个byte

本实验结论:
1.创建表时指定字段类型为 varchar2(10)时–即不指定使用的类型,字段使用的dba_tab_columns视图的char_used字段值等于创建表时会话级的nls_length_semantics=BYTE
2.在AL32UTF8字符集时一个汉字是3个BYTE,ZHS16GBK字符集时一个汉字占两个byte。
3.如果字段类型为 varchar2(10)为BYTE(dba_tab_columns视图char_used字段是B(BYTE)),能存放三个汉字—>一个汉字是3个BYTE
4.如果字段类型为 varchar2(10)为char(dba_tab_columns视图char_used字段是C(CHAR)),能存放十个汉字—>一个汉字是3个BYTE
5.以SYS用户登陆时不考虑NLS_LENGTH_SEMANTICS参数统一使用BYTE;除非在创建对象等DDL语句中明确定义。
6.在系统或会话级修改nls_length_semantics=char参数值,不会对已有表中varchar2字段的char_used进行修改

实验的步骤:
实验1-4使用AL32UTF8的数据库进行测试。
实验1:默认nls_length_semantics=BYTE且指定字段类型为 varchar2(10)
此时从dba_tab_columns视图的char_used字段可以发现使用的是B(BYTE),在AL32UTF8字符集下一个汉字是3个BYTE。
实验2:修改nls_length_semantics=CHAR且指定字段类型为 varchar2(10)
此时从dba_tab_columns视图的char_used字段可以发现使用的是C(CHAR),此时可以插入10个字符。
实验3:alter system set nls_length_semantics=char;参数不会对已有的表中varchar2字段的char_used进行修改
实验4:测试以SYS用户登陆时不考虑NLS_LENGTH_SEMANTICS参数统一使用BYTE;除非在创建对象等DDL语句中明确定义。
实验5:测试ZHS16GBK字符集时一个汉字占的字符数

具体实验过程
#################################################################
实验1:
默认nls_length_semantics=BYTE且指定字段类型为 varchar2(10)
此时从dba_tab_columns视图的char_used字段可以发现使用的是B(BYTE),在AL32UTF8字符集下一个汉字是3个BYTE。
SQL> select userenv(‘language’) from dual;
USERENV(‘LANGUAGE’)
—————————————————-
AMERICAN_AMERICA.AL32UTF8
SQL> select lengthb(‘白’) from dual;
LENGTHB(‘白’)
————-
3
SQL> show user
USER is “BYS”
SQL> show parameter nls_length_semantics;
NAME TYPE VALUE
———————————— ———– ——————————
nls_length_semantics string BYTE
SQL> create table t1(id number,name varchar2(10));
Table created.
SQL> create table t4(id number,name varchar2(10 char));
Table created.

SQL> select table_name,column_name,data_type,char_used from dba_tab_columns where table_name=’T1′ or table_name=’T4′ ;
TABLE_NAME COLUMN_NAME DATA_TYPE C
—————————— —————————— ———- –
T4 NAME VARCHAR2 C
T4 ID NUMBER
T1 NAME VARCHAR2 B
T1 ID NUMBER
SQL> desc t1
Name Null? Type
—————————————– ——– —————————-
ID NUMBER
NAME VARCHAR2(10)

在SQL*PLUS窗口输入时–经过了字符转换(猜测是主机的)显示是5个汉字30个字符
SQL> insert into t1 values(1,’浙江省杭州’);
insert into t1 values(1,’浙江省杭州’)
*
ERROR at line 1:
ORA-12899: value too large for column “BYS”.”T1″.”NAME” (actual: 30, maximum: 10)
SQL> insert into t1 values(1,’浙江杭州’);

在PL/SQL DEVELOPER工具窗口:
SQL> insert into t1 values(1,’浙江省杭州’);

insert into t1 values(1,’浙江省杭州’)
ORA-12899: 列 “BYS”.”T1″.”NAME” 的值太大 (实际值: 15, 最大值: 10)

SQL> insert into t1 values(1,’浙江杭州’);

insert into t1 values(1,’浙江杭州’)
ORA-12899: 列 “BYS”.”T1″.”NAME” 的值太大 (实际值: 12, 最大值: 10)

SQL> insert into t1 values(1,’浙江省’);
1 row inserted
SQL> commit;
Commit complete
SQL> select * from t1;
ID NAME
———- ———-
1 浙江省
SQL> insert into t4 values(1,’浙江省杭州市西湖区西湖’);
insert into t4 values(1,’浙江省杭州市西湖区西湖’)
ORA-12899: 列 “BYS”.”T4″.”NAME” 的值太大 (实际值: 11, 最大值: 10)
SQL> insert into t4 values(1,’浙江省杭州市西湖区西’);
1 row inserted
SQL> commit;
Commit complete
SQL> select * from t4;
ID NAME
———- —————————————-
1 浙江省杭州
1 浙江省杭州市西湖区西

#####################################################################
实验2:
修改nls_length_semantics=CHAR且指定字段类型为 varchar2(10)
此时从dba_tab_columns视图的char_used字段可以发现使用的是C(CHAR),此时可以插入10个字符。
SQL> alter session set nls_length_semantics=CHAR;
Session altered.
SQL> show parameter nls_length_semantics;
NAME TYPE VALUE
———————————— ———– ——————————
nls_length_semantics string CHAR
SQL> create table t2(id number,name varchar2(10));
Table created.
SQL> create table t3(id number,name varchar2(10 char));
Table created.
SQL> create table t6(id number,name varchar2(10 byte));
Table created.
SQL> select table_name,column_name,data_type,char_used from dba_tab_columns where table_name=’T3′ or table_name=’T2′ or table_name=’T6′ ;

TABLE_NAME COLUMN_NAME DATA_TYPE C
—————————— —————————— ———- –
T6 NAME VARCHAR2 B
T6 ID NUMBER
T3 NAME VARCHAR2 C
T3 ID NUMBER
T2 NAME VARCHAR2 C
T2 ID NUMBER

在PL/SQL DEVELOPER工具窗口:
SQL> insert into t2 values(1,’浙江省杭州市江干区下沙’);

insert into t2 values(1,’浙江省杭州市江干区下沙’)
ORA-12899: 列 “BYS”.”T2″.”NAME” 的值太大 (实际值: 11, 最大值: 10)

SQL> insert into t2 values(1,’浙江省杭州市江干区下’);
1 row inserted
SQL> insert into t2 values(1,’浙江省杭州市江干区’);
1 row inserted
SQL> commit;
Commit complete
SQL> select * from t2;
ID NAME
———- —————————————-
1 浙江省杭州市江干区下
1 浙江省杭州市江干区

################################################################
实验3:alter system set nls_length_semantics=char;参数不会对原有的表中varchar2字段的char_used进行修改
SQL> select table_name,column_name,data_type,char_used from dba_tab_columns where table_name=’T1′ or table_name=’T4′ ;
TABLE_NAME COLUMN_NAME DATA_TYPE C
—————————— —————————— ———- –
T4 NAME VARCHAR2 C
T4 ID NUMBER
T1 NAME VARCHAR2 B
T1 ID NUMBER

SQL> alter system set nls_length_semantics=char;
System altered.
SQL> select table_name,column_name,data_type,char_used from dba_tab_columns where table_name=’T1′ or table_name=’T4′ ;
TABLE_NAME COLUMN_NAME DATA_TYPE C
—————————— —————————— ———- –
T1 ID NUMBER
T1 NAME VARCHAR2 B
T4 ID NUMBER
T4 NAME VARCHAR2 C
此时对T1进行插入操作,超过3个汉字会报错
SQL> insert into t1 values(11,’浙江省美’);

insert into t1 values(11,’浙江省美’)

ORA-12899: value too large for column “BYS”.”T1″.”NAME” (actual: 12, maximum: 10)

实验4:测试以SYS用户登陆时不考虑NLS_LENGTH_SEMANTICS参数统一使用BYTE;除非在创建对象等DDL语句中明确定义。
SQL> show user
USER is “SYS”
SQL> show parameter nls_length_semantics;
NAME TYPE VALUE
———————————— ———– ——————————
nls_length_semantics string BYTE
SQL> SQL> alter system set nls_length_semantics=char;
System altered.
SQL> show parameter nls_length_semantics;
NAME TYPE VALUE
———————————— ———– ——————————
nls_length_semantics string CHAR
SQL> create table bys.t8(id number,name varchar2(10));
Table created.
SQL> create table bys.t9(id number,name varchar2(10 char));
Table created.
SQL> col data_type for a10
set linesize 160
SQL> SQL> select table_name,column_name,data_type,char_used from dba_tab_columns where table_name=’T8′ or table_name=’T9′ ;

TABLE_NAME COLUMN_NAME DATA_TYPE C
—————————— —————————— ———- –
T8 ID NUMBER
T8 NAME VARCHAR2 B
T9 ID NUMBER
T9 NAME VARCHAR2 C

##########################################################
实验5:测试ZHS16GBK字符集时一个汉字占的字符数
SQL> select userenv(‘language’) from dual;
USERENV(‘LANGUAGE’)
—————————————————-
AMERICAN_AMERICA.ZHS16GBK
SQL> show user
USER is “BYS”
SQL> show parameter nls_length_semantics;
NAME TYPE VALUE
———————————— ———– ——————————
nls_length_semantics string BYTE
SQL> create table t1(id number,name varchar2(8));
Table created.
SQL> create table t2(id number,name varchar2(8 char));
Table created.

SQL> select table_name,column_name,data_type,char_used from dba_tab_columns where table_name=’T1′ or table_name=’T2′ ;
TABLE_NAME COLUMN_NAME DATA_TYPE C
—————————— —————————— ———- –
T2 NAME VARCHAR2 C
T2 ID NUMBER
T1 NAME VARCHAR2 B
T1 ID NUMBER

SQL> select lengthb(‘白’) from dual;
LENGTHB(‘白’)
————-
2
SQL> insert into t1 values(1,’浙江省杭州’);
insert into t1 values(1,’浙江省杭州’)
ORA-12899: 列 “BYS”.”T1″.”NAME” 的值太大 (实际值: 10, 最大值: 8)
SQL> insert into t1 values(1,’浙江杭州’);
1 row inserted
SQL> insert into t2 values(1,’浙江省杭州市西湖区’);
insert into t2 values(1,’浙江省杭州市西湖区’)
ORA-12899: 列 “BYS”.”T2″.”NAME” 的值太大 (实际值: 9, 最大值: 8)
SQL> insert into t2 values(1,’浙江省杭州市西湖’);
1 row inserted
SQL> commit;
Commit complete

SQL> select * from t1;
ID NAME
———- ——–
1 浙江杭州
SQL> select * from t2;
ID NAME
———- —————-
1 浙江省杭州市西湖

 

验证ORACLE不同字符集中汉字占用的byte及NLS_LENGTH_SEMANTICS参数的影响

近期接连遇到AWR 及STATSPACK的snapshot不能自动生成排查。

STATSPACK的snapshot不能自动生成原因是存放快照的基表:ORA-01631: max # extents (505) reached in table PERFSTAT.STATS$FILESTATXS
AWR不能自动生成快照是因为之前系统进程数达到上限,数据库也HANG住;MMON进程异常;通过os层面kill MMON进程后,数据库实例自动又启动MMON,之后恢复正常。

问题与排查如下:

1.STATSPACK的snapshot不能自动生成排查

ALERT日志中信息:
Mon Apr 4 15:01:00 2016
ORA-1631: max # extents 505 reached in table PERFSTAT.STATS$FILESTATXS
Mon Apr 4 15:01:00 2016
Errors in file /oracle/8.1.7/admin/prod/bdump/snp0_150774_prod.trc:
ORA-12012: error on auto execute of job 403
ORA-01631: max # extents (505) reached in table PERFSTAT.STATS$FILESTATXS
ORA-06512: at “PERFSTAT.STATSPACK”, line 1167
ORA-06512: at “PERFSTAT.STATSPACK”, line 71
ORA-06512: at line 1
Mon Apr 4 17:38:19 2016

查看快照生成情况:

14232 04 Apr 2016 01:00 5
14233 04 Apr 2016 02:00 5
14234 04 Apr 2016 03:00 5

Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap:

查看生成快照的JOB的运行情况:
SQL> conn perfstat/perfstat
Connected.
select job,schema_user,to_char(next_date,’yyyy/mm/dd hh24:mi:ss’) as next_D,interval,what from user_jobs;
SQL> SQL>
JOB SCHEMA_USER NEXT_D INTERVAL WHAT
———- ———— —————— ————— ——————–
423 PERFSTAT <span style=”color:#FF0000;”>4000/01/01 </span>00:00:0 trunc(SYSDATE+1 statspack.snap;
0 /24,’HH’)
—-可以看到下次执行是2000年以后。。
SQL> exec dbms_job.remove(423);

PL/SQL procedure successfully completed.

SQL> @?/rdbms/admin/spauto.sql

PL/SQL procedure successfully completed.

Job number for automated statistics collection for this instance
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Note that this job number is needed when modifying or removing
the job:
JOBNO
———-
443

Job queue process
~~~~~~~~~~~~~~~~
Below is the current setting of the job_queue_processes init.ora
parameter – the value for this parameter must be greater
than 0 to use automatic statistics gathering:
NAME TYPE VALUE
———————————— ——- ——————————
job_queue_processes integer 1
Next scheduled run
~~~~~~~~~~~~~~~~~~
The next scheduled run for this job is:

JOB NEXT_DATE NEXT_SEC
———- ——— —————-
443 29-APR-16 11:00:00

SQL> select job,schema_user,to_char(next_date,’yyyy/mm/dd hh24:mi:ss’) as next_D,interval,what from user_jobs;

JOB SCHEMA_USER NEXT_D INTERVAL WHAT
———- ———— —————— ————— ——————–
443 PERFSTAT 2016/04/29 11:00:0 trunc(SYSDATE+1 statspack.snap;
0 /24,’HH’)

这里没有使用扩展表的EXTENT的方式,而是删除旧有的快照信息,删除方法有如下两种:
方法1:删除快照信息:
Oracle还提供了系统脚本用于Truncate这些统计信息表,这个脚本名字是: sptrunc.sql (8i、9i都相同)
该脚本主要内容如下,里面看到的就是statspack相关的所有系统表:

方法2:手动删除指定范围的快照:
删除stats$snapshot数据表中的相应数据,其他表中的数据会相应的级连删除:
SQL> select max(snap_id) from stats$snapshot;
MAX(SNAP_ID)
————
12345

delete from stats$snapshot where snap_id < = 100; —如果一次删除的多,建议分批删除、提交。–我是一次删除500个快照,可以观察到生成REDO较多。
commit;
你可以更改snap_id的范围以保留你需要的数据。
在以上删除过程中,你可以看到所有相关的表都被锁定。

2.到AWR 的snapshot不能自动生成排查

参考文档:Troubleshooting: Missing Automatic Workload Repository (AWR) Snapshots and Other Collection Issues (文档 ID 1301503.1)按顺序进行排查,主要是查看MMON/MMNL进程的TRACE信息,发现其中MMON进程TRACE不存在;手动执行生成快照命令exec dbms_workload_repository.create_snapshot;也无法正常完成,但是未发现相关表是被锁:结合文档 ID 1301503.1中的排查思路进行排查后,惟一存在异常的是MMON进程,然后在OS层面KILL MMON进程,之后实例自动启动MMON,之后可以正常生成快照。

AWR 及STATSPACK的snapshot不能自动生成排查

看到群里有人问普通用户访问基表的问题,测试下如下:

X$基表可以通过创建视图,再对视图创建同义词方式、授权的方式来实现普通用户可以访问基表。

当然了普通用户访基表也是没道理的,理论上没必要,权限控制上也应该是不允许的。此处不考虑合理性,就此问题进行实验。
1.直接对X$基表创建同义词,其它用户无法实现访问。
SQL> show user
USER is “SYS”
SQL> select count(*) from sys.x$kcbwds;

COUNT(*)
———-
8

SQL> CREATE PUBLIC SYNONYM kcbwds FOR sys.x$kcbwds;

Synonym created.

SQL> grant select on sys.x$kcbwds to bys;
grant select on sys.x$kcbwds to bys
*
ERROR at line 1:
ORA-02030: can only select from fixed tables/views
———-
SQL> show user
USER is “BYS”
SQL> select count(*) from sys.x$kcbwds;
select count(*) from sys.x$kcbwds
*
ERROR at line 1:
ORA-00942: table or view does not exist

SQL> select count(*) from kcbwds;
select count(*) from kcbwds
*
ERROR at line 1:
ORA-00942: table or view does not exist

————–

2.使用对X$基表创建视图的方法可以实现普通用户访问X$:
SQL> show user
USER is “SYS”
SQL> select count(*) from x$kcbwds;

COUNT(*)
———-
8
SQL> create view testa as select * from sys.x$kcbwds;

View created.

SQL> grant select on sys.testa to bys;

Grant succeeded.

SQL> conn bys/bys
Connected.
SQL> show user
USER is “BYS”
SQL> select count(*) from sys.testa;

COUNT(*)
———-
8
SQL> desc sys.testa
Name Null? Type
—————————————– ——– —————————-
ADDR RAW(4)
INDX NUMBER
INST_ID NUMBER
SET_ID NUMBER
POOL_ID NUMBER
DBWR_NUM NUMBER
BLK_SIZE NUMBER
后面省略。。。

3.可以通过对视图再加同义词方式来实现更简单的访问
SQL> CREATE PUBLIC SYNONYM testb FOR sys.testa;

Synonym created.

SQL> show user
USER is “SYS”
SQL> conn / as sysdba
Connected.
SQL> conn bys/bys
Connected.
SQL> select count(*) from testb;

COUNT(*)
———-
8

 

通过创建视图及同义词方式实现普通用户查询X$基表的方法

主要为了验证11gR2 RAC中ASM实例通过gpnp profile获得spfile信息来启动ASM实例,同时验证了gpnp profile的修改等内容;结论与实验如下:
验证结论:
1./u01/app/11.2.0/grid/gpnp/profiles/peer下的cat profile.xml内容是旧的,使用spset/spmove时均未被更新,一些文档说这个 profile.xml是全局的。
gpnp使用的是/u01/app/11.2.0/grid/gpnp/rac1/profiles/peer下的cat profile.xml内容,即$ORACLE_HOME/gpnp/[HOSTNAME]/profiles/peer/

2.修改是通过ASMCMD的spset/spmove命令来实现的修改gpnp profile,
通过gpnptool edit -p=profile.xml -asm_spf=”+DATA1/rac-cluster/asmparameterfile/registry.253.857644239″ 这种命令,显示修改成功,但是未发现profile.xml中信息变化,重新启动OS/HAS等方式均未发现使用新的修改,求告知原因。

3.gpnp profile不能手动修改,手动编辑会导致文件损坏,查看gpnpd.log可以发现校验文件出错的信息,但是可以从缓存中查找gpnp profile并启动。
[ CLWAL][3031893712]clsw_Initialize: OLR initlevel [70000]
[ clsdmt][3022580624]Listening to (ADDRESS=(PROTOCOL=ipc)(KEY=rac1DBG_GPNPD))
2016-05-07 23:39:58.106: [ clsdmt][3022580624]PID for the Process [3252], connkey 10
2016-05-07 23:39:58.106: [ clsdmt][3022580624]Creating PID [3252] file for home /u01/app/11.2.0/grid host rac1 bin gpnp to /u01/app/11.2.0/grid/gpnp/init/
2016-05-07 23:39:58.106: [ clsdmt][3022580624]Writing PID [3252] to the file [/u01/app/11.2.0/grid/gpnp/init/rac1.pid]
2016-05-07 23:39:58.153: [ GPNP][3031893712]clsgpnpd_validateProfile: [at clsgpnpd.c:2888] Result: (86) CLSGPNP_SIG_INVALID. Profile failed to verify. prf=0x99fec78
2016-05-07 23:39:58.153: [ GPNP][3031893712]clsgpnpd_openLocalProfile: [at clsgpnpd.c:3461] Result: (86) CLSGPNP_SIG_INVALID. Local best profile from file cache provider (LCP-FS) is invalid – destroyed.
2016-05-07 23:39:58.155: [ GPNP][3031893712]clsgpnpd_validateProfile: [at clsgpnpd.c:2919] GPnPD taken cluster name ‘rac-cluster’
2016-05-07 23:39:58.155: [ GPNP][3031893712]clsgpnpd_openLocalProfile: [at clsgpnpd.c:3532] Got local profile from OLR cache provider (LCP-OLR).
2016-05-07 23:39:58.168: [ GPNP][3031893712]clsgpnpd_lOpen: [at clsgpnpd.c:1734] Listening on ipc://GPNPD_rac1
2016-05-07 23:39:58.169: [ default][3031893712]GPNPD started on node rac1.

实验1:验证ASM实例启动时依赖gpnp profile中的SPFILE信息
1.修改gpnp profile中关于SPFILE的信息并验证修改成功
ASMCMD> spset +DATA1/rac-cluster/asmparameterfile/spfile.ora
ASMCMD> spget
+DATA1/rac-cluster/asmparameterfile/spfile.ora
查看/u01/app/11.2.0/grid/gpnp/profiles/peer下的cat profile.xml内容,可以发现未修改,仍是ProfileSequence=”4″ 。
查看/u01/app/11.2.0/grid/gpnp/rac1/profiles/peer下的cat profile.xml内容,发现已经修改,ProfileSequence=”8″ ,SPFile=”+DATA1/rac-cluster/asmparameterfile/spfile.ora。
此时/u01/app/11.2.0/grid/gpnp/rac1/profiles/peer下还出现了一个pending.xml文件,里面的内容是最新的信息。
此时使用 kfed read /dev/asm-diskb|grep spfile可以发现SPFILE的信息未变化。
[grid@rac1 peer]$ kfed read /dev/asm-diskb|grep spfile
kfdhdb.spfile: 58 ; 0x0f4: 0x0000003a

此时启动HAS,查看ASM的ALERT LOG中使用的ASM SPFILE信息,可以发现使用了新的GPnP-Profile中的配置,出现如下报错:
ERROR: SPFile in diskgroup DATA1 does not match the specified spfile +DATA1/rac-cluster/asmparameterfile/spfile.ora
此时使用默认的参数启动ASM实例,然后磁盘组做为资源–ora.DATA1.dg也被AGENT发出的MOUNT命令成功挂载,

这里根据实验结果来推测一种可能–>如何找到ASM SPFile:(如下步骤1、2谁先谁后应该都可以,我是根据gpnp profile中DiscoveryString在前觉得应该是先进行步骤1)
1.gpnp profile中DiscoveryString字段找到相应的磁盘,读取磁盘头获取SPFILE信息,如KFED读到的信息:[grid@rac1 peer]$ kfed read /dev/asm-diskb|grep spfile
kfdhdb.spfile: 58 ; 0x0f4: 0x0000003a
2.从磁盘头获取了SPFILE信息并去读取–?后,再与gpnp profile中SPFile=指定的文件信息做对比,如果一致,则使用。如果不一致,则去$ORACLE_HOME/dbs下查找spfile+ASM1.ora这种查找路径,如果仍找不到,再使用默认参数启动。
3.问题点在于DiscoveryString=”/dev/asm*” SPFile=”部分,在实验中可以发现,将SPFile=改为一个不存在的文件;此时通过kfed读取磁盘头可以找到正确的SPFILE信息,但是并未被使用;因此有此推断。

实验2:ASMCMD> spmove REGISTRY.253.857644239 +DATA2/spfileasm.ora
此命令会将ASM SPFILE文件移到到+DATA2/spfileasm.ora –别名;原来ASM SPFILE在+DATA1,只能移到不同的磁盘组;
spmove 移动后,会自动更新gpnp profile中信息;同时使用kfed 读取磁盘头信息,也同步进行了更新。

############################################
如下是实验过程的简要步骤与具体实验信息:
1.查看gpnp profile信息
2.查看ASM的ALERT LOG中使用的ASM SPFILE信息

实验1:
1.修改gpnp profile中关于SPFILE的信息并验证修改成功
2.启动HAS,查看ASM的ALERT LOG中使用的ASM SPFILE信息
实验2:
1.spmove 验证kfed 中读到的信息是否变化及gpnp profile中信息也被修改
实验3:设置为正确的asm spfile信息,经过crsctl stop/start has 和重启OS,查看GPNP PROFILE所在目录中还存在pending.xml
但是在实验2中,spmove后不存在pending.xml了。

############################################
############################################
############################################
1.查看gpnp profile信息
通过gpnptool get查询
查看/u01/app/11.2.0/grid/gpnp/profiles/peer下的cat profile.xml内容
查看/u01/app/11.2.0/grid/gpnp/rac1/profiles/peer下的cat profile.xml内容

[grid@rac1 peer]$ gpnptool get —>>>可以看到这里的 ProfileSequence=”7″
Warning: some command line parameters were defaulted. Resulting command line:
/u01/app/11.2.0/grid/bin/gpnptool.bin get -o-

<?xml version=”1.0″ encoding=”UTF-8″?><gpnp:GPnP-Profile Version=”1.0″ xmlns=”http://www.grid-pnp.org/2005/11/gpnp-profile” xmlns:gpnp=”http://www.grid-pnp.org/2005/11/gpnp-profile” xmlns:orcl=”http://www.oracle.com/gpnp/2005/11/gpnp-profile” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://www.grid-pnp.org/2005/11/gpnp-profile gpnp-profile.xsd” ProfileSequence=”7″ ClusterUId=”5de823e89503dfabbf7868bf50f95c5c” ClusterName=”rac-cluster” PALocation=””><gpnp:Network-Profile><gpnp:HostNetwork id=”gen” HostName=”*”><gpnp:Network id=”net1″ IP=”192.168.57.0″ Adapter=”eth0″ Use=”public”/><gpnp:Network id=”net2″ IP=”192.168.10.0″ Adapter=”eth1″ Use=”cluster_interconnect”/></gpnp:HostNetwork></gpnp:Network-Profile>
<orcl:CSS-Profile id=”css” DiscoveryString=”+asm” LeaseDuration=”400″/>
<orcl:ASM-Profile id=”asm” DiscoveryString=”/dev/asm*” SPFile=”+DATA1/rac-cluster/asmparameterfile/registry.253.857644239″/><ds:Signature xmlns:ds=”http://www.w3.org/2000/09/xmldsig#”><ds:SignedInfo><ds:CanonicalizationMethod Algorithm=”http://www.w3.org/2001/10/xml-exc-c14n#”/><ds:SignatureMethod Algorithm=”http://www.w3.org/2000/09/xmldsig#rsa-sha1″/><ds:Reference URI=””><ds:Transforms><ds:Transform Algorithm=”http://www.w3.org/2000/09/xmldsig#enveloped-signature”/><ds:Transform Algorithm=”http://www.w3.org/2001/10/xml-exc-c14n#”> <InclusiveNamespaces xmlns=”http://www.w3.org/2001/10/xml-exc-c14n#” PrefixList=”gpnp orcl xsi”/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=”http://www.w3.org/2000/09/xmldsig#sha1″/><ds:DigestValue>eL42pYpgXChFOff3YJz7lV/C/+Q=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>NBq10c8aJMSZ2QDZnOvPpyWmM0Wrp0pwLUB1mGFADeLvTRY4J+dfopJWp/hYRvRr6XgcQ4h4Qkrb2Njp0NB863E36JbweMA9vmygajUJsahonx/Ln4/VJwpsL8L3xwXlNwYlGNDDtdtmevDZNpyw7VvDNX92xZPg+mmbW049cuI=</ds:SignatureValue></ds:Signature></gpnp:GPnP-Profile>
Success.

ASM的PROFILE参数信息:
<orcl:ASM-Profile id=”asm” DiscoveryString=”/dev/asm*” SPFile=”+DATA1/rac-cluster/asmparameterfile/registry.253.857644239″/>

[grid@rac1 peer]$ pwd
/u01/app/11.2.0/grid/gpnp/profiles/peer
[grid@rac1 peer]$ ls -lrt
total 12
-rw-r–r– 1 grid oinstall 1828 Sep 7 2014 profile_orig.xml
-rw-r–r– 1 grid oinstall 1891 May 7 22:40 profile.xml
-rw-r–r– 1 grid oinstall 1891 May 8 20:50 profile.xml1
[grid@rac1 peer]$ cat profile.xml —>>>可以看到这里的ProfileSequence=”4″ ,是较老的版本。
<?xml version=”1.0″ encoding=”UTF-8″?><gpnp:GPnP-Profile Version=”1.0″ xmlns=”http://www.grid-pnp.org/2005/11/gpnp-profile” xmlns:gpnp=”http://www.grid-pnp.org/2005/11/gpnp-profile” xmlns:orcl=”http://www.oracle.com/gpnp/2005/11/gpnp-profile” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://www.grid-pnp.org/2005/11/gpnp-profile gpnp-profile.xsd” ProfileSequence=”4″ ClusterUId=”5de823e89503dfabbf7868bf50f95c5c” ClusterName=”rac-cluster” PALocation=””><gpnp:Network-Profile><gpnp:HostNetwork id=”gen” HostName=”*”><gpnp:Network id=”net1″ IP=”192.168.57.0″ Adapter=”eth0″ Use=”public”/><gpnp:Network id=”net2″ IP=”192.168.10.0″ Adapter=”eth1″ Use=”cluster_interconnect”/></gpnp:HostNetwork></gpnp:Network-Profile>
<orcl:CSS-Profile id=”css” DiscoveryString=”+asm” LeaseDuration=”400″/>
<orcl:ASM-Profile id=”asm” DiscoveryString=”/dev/asm*” SPFile=”+DATA1/rac-cluster/asmparameterfile/registry.253.857644239″/><ds:Signature xmlns:ds=”http://www.w3.org/2000/09/xmldsig#”><ds:SignedInfo><ds:CanonicalizationMethod Algorithm=”http://www.w3.org/2001/10/xml-exc-c14n#”/><ds:SignatureMethod Algorithm=”http://www.w3.org/2000/09/xmldsig#rsa-sha1″/><ds:Reference URI=””><ds:Transforms><ds:Transform Algorithm=”http://www.w3.org/2000/09/xmldsig#enveloped-signature”/><ds:Transform Algorithm=”http://www.w3.org/2001/10/xml-exc-c14n#”> <InclusiveNamespaces xmlns=”http://www.w3.org/2001/10/xml-exc-c14n#” PrefixList=”gpnp orcl xsi”/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=”http://www.w3.org/2000/09/xmldsig#sha1″/><ds:DigestValue>9J7PntAuc/TYr/90C5OnUylcuFA=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>Nn1CIKzx5/72LpetbyZT/T60s2Ehhpuw2VN97QNurNWJOS6rzGRc0uZMorJqBH+giyorhHsUP8irlcWZz4YSz+1L/HMr5f/7duVGnB9oys05mF49SvUikwnRLaOL2Hsi1z+SkCFvDfnfPF0YUr8MnNKpklViLZT9SnqGsVg4aeE=</ds:SignatureValue></ds:Signature></gpnp:GPnP-Profile>[grid@rac1 peer]$
[grid@rac1 peer]$
[grid@rac1 peer]$ cd –
/u01/app/11.2.0/grid/gpnp/rac1/profiles/peer
[grid@rac1 peer]$ ls -lrt
total 16
-rw-r–r– 1 grid oinstall 1828 Sep 7 2014 profile_orig.xml
-rw-r–r– 1 grid oinstall 1871 May 7 23:59 profile.old
-rw-r–r– 1 grid oinstall 1891 May 8 10:27 profile.xml
-rw-r–r– 1 grid oinstall 1891 May 8 20:52 profile.xml1
[grid@rac1 peer]$ cat profile.xml—>>>可以看到这里的ProfileSequence=”7″ ,是当前使用的版本。
<?xml version=”1.0″ encoding=”UTF-8″?><gpnp:GPnP-Profile Version=”1.0″ xmlns=”http://www.grid-pnp.org/2005/11/gpnp-profile” xmlns:gpnp=”http://www.grid-pnp.org/2005/11/gpnp-profile” xmlns:orcl=”http://www.oracle.com/gpnp/2005/11/gpnp-profile” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://www.grid-pnp.org/2005/11/gpnp-profile gpnp-profile.xsd” ProfileSequence=”7″ ClusterUId=”5de823e89503dfabbf7868bf50f95c5c” ClusterName=”rac-cluster” PALocation=””><gpnp:Network-Profile><gpnp:HostNetwork id=”gen” HostName=”*”><gpnp:Network id=”net1″ IP=”192.168.57.0″ Adapter=”eth0″ Use=”public”/><gpnp:Network id=”net2″ IP=”192.168.10.0″ Adapter=”eth1″ Use=”cluster_interconnect”/></gpnp:HostNetwork></gpnp:Network-Profile>
<orcl:CSS-Profile id=”css” DiscoveryString=”+asm” LeaseDuration=”400″/>
<orcl:ASM-Profile id=”asm” DiscoveryString=”/dev/asm*” SPFile=”+DATA1/rac-cluster/asmparameterfile/registry.253.857644239″/><ds:Signature xmlns:ds=”http://www.w3.org/2000/09/xmldsig#”><ds:SignedInfo><ds:CanonicalizationMethod Algorithm=”http://www.w3.org/2001/10/xml-exc-c14n#”/><ds:SignatureMethod Algorithm=”http://www.w3.org/2000/09/xmldsig#rsa-sha1″/><ds:Reference URI=””><ds:Transforms><ds:Transform Algorithm=”http://www.w3.org/2000/09/xmldsig#enveloped-signature”/><ds:Transform Algorithm=”http://www.w3.org/2001/10/xml-exc-c14n#”> <InclusiveNamespaces xmlns=”http://www.w3.org/2001/10/xml-exc-c14n#” PrefixList=”gpnp orcl xsi”/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=”http://www.w3.org/2000/09/xmldsig#sha1″/><ds:DigestValue>eL42pYpgXChFOff3YJz7lV/C/+Q=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>NBq10c8aJMSZ2QDZnOvPpyWmM0Wrp0pwLUB1mGFADeLvTRY4J+dfopJWp/hYRvRr6XgcQ4h4Qkrb2Njp0NB863E36JbweMA9vmygajUJsahonx/Ln4/VJwpsL8L3xwXlNwYlGNDDtdtmevDZNpyw7VvDNX92xZPg+mmbW049cuI=</ds:SignatureValue></ds:Signature></gpnp:GPnP-Profile>
ASM的PROFILE参数信息:
<orcl:ASM-Profile id=”asm” DiscoveryString=”/dev/asm*” SPFile=”+DATA1/rac-cluster/asmparameterfile/registry.253.857644239″/>

[grid@rac1 peer]$ date
Sun May 8 21:03:13 CST 2016
[grid@rac1 peer]$ asmcmd —>>>从GPnP profile查询的ASM SPFILE的位置
ASMCMD>
ASMCMD>
ASMCMD> spget
+DATA1/rac-cluster/asmparameterfile/registry.253.857644239
ASMCMD>

2.查看ASM的ALERT LOG中使用的ASM SPFILE信息
Sun May 08 20:53:35 2016
Instance shutdown complete
Sun May 08 20:59:26 2016
NOTE: No asm libraries found in the system
MEMORY_TARGET defaulting to 1128267776.
* instance_number obtained from CSS = 1, checking for the existence of node 0…
* node 0 does not exist. instance_number = 1
Starting ORACLE instance (normal)
WARNING: You are trying to use the MEMORY_TARGET feature. This feature requires the /dev/shm file system to be mounted for at least 1140850688 bytes. /dev/shm is either not mounted or is mounted with available space less than this size. Please fix this so that MEMORY_TARGET can work as expected. Current available is 525660160 and used is 0 bytes. Ensure that the mount point is /dev/shm for this directory.
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Initial number of CPU is 1
Private Interface ‘eth1:1′ configured from GPnP for use as a private interconnect.
[name=’eth1:1’, type=1, ip=169.254.162.219, mac=08-00-27-54-4c-ad, net=169.254.0.0/16, mask=255.255.0.0, use=haip:cluster_interconnect/62]
Public Interface ‘eth0′ configured from GPnP for use as a public interface.
[name=’eth0’, type=1, ip=192.168.57.225, mac=08-00-27-35-fe-56, net=192.168.57.0/24, mask=255.255.255.0, use=public/1]
CELL communication is configured to use 0 interface(s):
CELL IP affinity details:
NUMA status: non-NUMA system
cellaffinity.ora status: N/A
CELL communication will use 1 IP group(s):
Grp 0:
Picked latch-free SCN scheme 2
Using LOG_ARCHIVE_DEST_1 parameter default value as /u01/app/11.2.0/grid/dbs/arch
Autotune of undo retention is turned on.
LICENSE_MAX_USERS = 0
SYS auditing is disabled
Starting up:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – Production
With the Real Application Clusters and Automatic Storage Management options.
ORACLE_HOME = /u01/app/11.2.0/grid
System name: Linux
Node name: rac1.bys.com
Release: 2.6.32-200.13.1.el5uek
Version: #1 SMP Wed Jul 27 20:21:26 EDT 2011
Machine: i686
Using parameter settings in server-side spfile +DATA1/rac-cluster/asmparameterfile/registry.253.857644239 —这里可以看到使用的
System parameters with non-default values:
large_pool_size = 12M
instance_type = “asm”
remote_login_passwordfile= “EXCLUSIVE”
asm_diskstring = “/dev/asm*”
asm_diskgroups = “DATA2”
asm_power_limit = 1
diagnostic_dest = “/u01/app/grid”
Cluster communication is configured to use the following interface(s) for this instance
169.254.162.219
cluster interconnect IPC version:Oracle UDP/IP (generic)

#############################
#############################
#############################
实验1:验证ASM实例启动时依赖gpnp profile中的SPFILE信息
1.修改gpnp profile中关于SPFILE的信息并验证修改成功
使用ASMCMD> spset修改
ASMCMD> spset +DATA1/rac-cluster/asmparameterfile/spfile.ora

验证修改结果:–指定的spfile.ora 事实上是不存在的
ASMCMD> spget
+DATA1/rac-cluster/asmparameterfile/spfile.ora
ASMCMD> exit
查看/u01/app/11.2.0/grid/gpnp/profiles/peer下的cat profile.xml内容,可以发现未修改,仍是ProfileSequence=”4″ 。
查看/u01/app/11.2.0/grid/gpnp/rac1/profiles/peer下的cat profile.xml内容,发现已经修改,ProfileSequence=”8″ ,SPFile=”+DATA1/rac-cluster/asmparameterfile/spfile.ora。
此时/u01/app/11.2.0/grid/gpnp/rac1/profiles/peer下还出现了一个pending.xml文件,里面的内容是最新的信息。
此时使用 kfed read /dev/asm-diskb|grep spfile可以发现SPFILE的信息未变化。
[grid@rac1 peer]$ kfed read /dev/asm-diskb|grep spfile
kfdhdb.spfile: 58 ; 0x0f4: 0x0000003a
————-
[grid@rac1 peer]$ ls -lrt
total 20
-rw-r–r– 1 grid oinstall 1828 Sep 7 2014 profile_orig.xml
-rw-r–r– 1 grid oinstall 1891 May 8 10:27 profile.old
-rw-r–r– 1 grid oinstall 1891 May 8 20:52 profile.xml1
-rw-r–r– 1 grid oinstall 1879 May 8 21:04 profile.xml
-rw-r–r– 1 grid oinstall 1879 May 8 21:04 pending.xml
[grid@rac1 peer]$ date
Sun May 8 21:04:48 CST 2016
[grid@rac1 peer]$ cat pending.xml
<?xml version=”1.0″ encoding=”UTF-8″?><gpnp:GPnP-Profile Version=”1.0″ xmlns=”http://www.grid-pnp.org/2005/11/gpnp-profile” xmlns:gpnp=”http://www.grid-pnp.org/2005/11/gpnp-profile” xmlns:orcl=”http://www.oracle.com/gpnp/2005/11/gpnp-profile” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://www.grid-pnp.org/2005/11/gpnp-profile gpnp-profile.xsd” ProfileSequence=”8″ ClusterUId=”5de823e89503dfabbf7868bf50f95c5c” ClusterName=”rac-cluster” PALocation=””><gpnp:Network-Profile><gpnp:HostNetwork id=”gen” HostName=”*”><gpnp:Network id=”net1″ IP=”192.168.57.0″ Adapter=”eth0″ Use=”public”/><gpnp:Network id=”net2″ IP=”192.168.10.0″ Adapter=”eth1″ Use=”cluster_interconnect”/></gpnp:HostNetwork></gpnp:Network-Profile> <orcl:CSS-Profile id=”css” DiscoveryString=”+asm” LeaseDuration=”400″/><orcl:ASM-Profile id=”asm” DiscoveryString=”/dev/asm*” SPFile=”+DATA1/rac-cluster/asmparameterfile/spfile.ora”/><ds:Signature xmlns:ds=”http://www.w3.org/2000/09/xmldsig#”><ds:SignedInfo><ds:CanonicalizationMethod Algorithm=”http://www.w3.org/2001/10/xml-exc-c14n#”/><ds:SignatureMethod Algorithm=”http://www.w3.org/2000/09/xmldsig#rsa-sha1″/><ds:Reference URI=””><ds:Transforms><ds:Transform Algorithm=”http://www.w3.org/2000/09/xmldsig#enveloped-signature”/><ds:Transform Algorithm=”http://www.w3.org/2001/10/xml-exc-c14n#”> <InclusiveNamespaces xmlns=”http://www.w3.org/2001/10/xml-exc-c14n#” PrefixList=”gpnp orcl xsi”/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=”http://www.w3.org/2000/09/xmldsig#sha1″/><ds:DigestValue>+NyUNJl9FHhZ5pp/z3Tq7VpUQhE=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>SoJCSTWNGkKs7JVEPMGY6C1Sr35qax7qWQUSGNuAtirWp/0a0RXzt99f2nk+rCSf5opEcdD4Kjl8rAuNufyZm8uWSIcSOEnZEkRUgtDAjinF1vn+E0QSEiUZQFmC9e1srLNmZPhDWy2y3TwcPEm6Qit5ilvulxWV+AQjMOUMsC0=</ds:SignatureValue></ds:Signature></gpnp:GPnP-Profile>[grid@rac1 peer]$
[grid@rac1 peer]$
[grid@rac1 peer]$ cat profile.xml
<?xml version=”1.0″ encoding=”UTF-8″?><gpnp:GPnP-Profile Version=”1.0″ xmlns=”http://www.grid-pnp.org/2005/11/gpnp-profile” xmlns:gpnp=”http://www.grid-pnp.org/2005/11/gpnp-profile” xmlns:orcl=”http://www.oracle.com/gpnp/2005/11/gpnp-profile” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://www.grid-pnp.org/2005/11/gpnp-profile gpnp-profile.xsd” ProfileSequence=”8″ ClusterUId=”5de823e89503dfabbf7868bf50f95c5c” ClusterName=”rac-cluster” PALocation=””><gpnp:Network-Profile><gpnp:HostNetwork id=”gen” HostName=”*”><gpnp:Network id=”net1″ IP=”192.168.57.0″ Adapter=”eth0″ Use=”public”/><gpnp:Network id=”net2″ IP=”192.168.10.0″ Adapter=”eth1″ Use=”cluster_interconnect”/></gpnp:HostNetwork></gpnp:Network-Profile ><orcl:CSS-Profile id=”css” DiscoveryString=”+asm” LeaseDuration=”400″/><orcl:ASM-Profile id=”asm” DiscoveryString=”/dev/asm*” SPFile=”+DATA1/rac-cluster/asmparameterfile/spfile.ora”/><ds:Signature xmlns:ds=”http://www.w3.org/2000/09/xmldsig#”><ds:SignedInfo><ds:CanonicalizationMethod Algorithm=”http://www.w3.org/2001/10/xml-exc-c14n#”/><ds:SignatureMethod Algorithm=”http://www.w3.org/2000/09/xmldsig#rsa-sha1″/><ds:Reference URI=””><ds:Transforms><ds:Transform Algorithm=”http://www.w3.org/2000/09/xmldsig#enveloped-signature”/><ds:Transform Algorithm=”http://www.w3.org/2001/10/xml-exc-c14n#”> <InclusiveNamespaces xmlns=”http://www.w3.org/2001/10/xml-exc-c14n#” PrefixList=”gpnp orcl xsi”/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=”http://www.w3.org/2000/09/xmldsig#sha1″/><ds:DigestValue>+NyUNJl9FHhZ5pp/z3Tq7VpUQhE=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>SoJCSTWNGkKs7JVEPMGY6C1Sr35qax7qWQUSGNuAtirWp/0a0RXzt99f2nk+rCSf5opEcdD4Kjl8rAuNufyZm8uWSIcSOEnZEkRUgtDAjinF1vn+E0QSEiUZQFmC9e1srLNmZPhDWy2y3TwcPEm6Qit5ilvulxWV+AQjMOUMsC0=</ds:SignatureValue></ds:Signature></gpnp:GPnP-Profile>[grid@rac1 peer]$

[grid@rac1 peer]$ cd –
/u01/app/11.2.0/grid/gpnp/profiles/peer
[grid@rac1 peer]$ ls -lrt
total 12
-rw-r–r– 1 grid oinstall 1828 Sep 7 2014 profile_orig.xml
-rw-r–r– 1 grid oinstall 1891 May 7 22:40 profile.xml
-rw-r–r– 1 grid oinstall 1891 May 8 20:50 profile.xml1

[grid@rac1 peer]$ ls
profile_orig.xml profile.xml profile.xml1
[grid@rac1 peer]$ cat profile.xml
<?xml version=”1.0″ encoding=”UTF-8″?><gpnp:GPnP-Profile Version=”1.0″ xmlns=”http://www.grid-pnp.org/2005/11/gpnp-profile” xmlns:gpnp=”http://www.grid-pnp.org/2005/11/gpnp-profile” xmlns:orcl=”http://www.oracle.com/gpnp/2005/11/gpnp-profile” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://www.grid-pnp.org/2005/11/gpnp-profile gpnp-profile.xsd” ProfileSequence=”4″ ClusterUId=”5de823e89503dfabbf7868bf50f95c5c” ClusterName=”rac-cluster” PALocation=””><gpnp:Network-Profile><gpnp:HostNetwork id=”gen” HostName=”*”><gpnp:Network id=”net1″ IP=”192.168.57.0″ Adapter=”eth0″ Use=”public”/><gpnp:Network id=”net2″ IP=”192.168.10.0″ Adapter=”eth1″ Use=”cluster_interconnect”/></gpnp:HostNetwork></gpnp:Network-Profile> <orcl:CSS-Profile id=”css” DiscoveryString=”+asm” LeaseDuration=”400″/><orcl:ASM-Profile id=”asm” DiscoveryString=”/dev/asm*” SPFile=”+DATA1/rac-cluster/asmparameterfile/registry.253.857644239″/><ds:Signature xmlns:ds=”http://www.w3.org/2000/09/xmldsig#”><ds:SignedInfo><ds:CanonicalizationMethod Algorithm=”http://www.w3.org/2001/10/xml-exc-c14n#”/><ds:SignatureMethod Algorithm=”http://www.w3.org/2000/09/xmldsig#rsa-sha1″/><ds:Reference URI=””><ds:Transforms><ds:Transform Algorithm=”http://www.w3.org/2000/09/xmldsig#enveloped-signature”/><ds:Transform Algorithm=”http://www.w3.org/2001/10/xml-exc-c14n#”> <InclusiveNamespaces xmlns=”http://www.w3.org/2001/10/xml-exc-c14n#” PrefixList=”gpnp orcl xsi”/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=”http://www.w3.org/2000/09/xmldsig#sha1″/><ds:DigestValue>9J7PntAuc/TYr/90C5OnUylcuFA=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>Nn1CIKzx5/72LpetbyZT/T60s2Ehhpuw2VN97QNurNWJOS6rzGRc0uZMorJqBH+giyorhHsUP8irlcWZz4YSz+1L/HMr5f/7duVGnB9oys05mF49SvUikwnRLaOL2Hsi1z+SkCFvDfnfPF0YUr8MnNKpklViLZT9SnqGsVg4aeE=</ds:SignatureValue></ds:Signature></gpnp:GPnP-Profile>[grid@rac1 peer]$

2.启动HAS,查看ASM的ALERT LOG中使用的ASM SPFILE信息
此时可以发现使用了新的GPnP-Profile中的配置,出现如下报错:
ERROR: SPFile in diskgroup DATA1 does not match the specified spfile +DATA1/rac-cluster/asmparameterfile/spfile.ora
此时使用默认的参数启动ASM实例,然后磁盘组做为资源–ora.DATA1.dg也被AGENT发出的MOUNT命令成功挂载上。

Sun May 08 21:07:48 2016
SQL> ALTER DISKGROUP ALL MOUNT /* asm agent call crs *//* {0:0:2} */
NOTE: Diskgroup used for Voting files is:
DATA1
Diskgroup used for OCR is:DATA1
…………
SUCCESS: diskgroup DATA1 was mounted
SUCCESS: ALTER DISKGROUP ALL MOUNT /* asm agent call crs *//* {0:0:2} */

Sun May 08 21:08:08 2016
SQL> ALTER DISKGROUP DATA2 MOUNT /* asm agent *//* {1:23346:2} */

查看ASM实例:
[grid@rac1 ~]$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.4.0 Production on Sun May 8 22:19:54 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – Production
With the Real Application Clusters and Automatic Storage Management options

SQL> show parameter large_pool_size
NAME TYPE VALUE
———————————— ———– ——————————
large_pool_size big integer 0
SQL> show parameter spfile
NAME TYPE VALUE
———————————— ———– ——————————
spfile string
————————————
Sun May 08 10:29:39 2016
Instance shutdown complete
Sun May 08 21:07:40 2016
NOTE: No asm libraries found in the system
ERROR: SPFile in diskgroup DATA1 does not match the specified spfile +DATA1/rac-cluster/asmparameterfile/spfile.ora
MEMORY_TARGET defaulting to 1128267776.
* instance_number obtained from CSS = 1, checking for the existence of node 0…
* node 0 does not exist. instance_number = 1
Starting ORACLE instance (normal)
WARNING: You are trying to use the MEMORY_TARGET feature. This feature requires the /dev/shm file system to be mounted for at least 1140850688 bytes. /dev/shm is either not mounted or is mounted with available space less than this size. Please fix this so that MEMORY_TARGET can work as expected. Current available is 525660160 and used is 0 bytes. Ensure that the mount point is /dev/shm for this directory.
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Initial number of CPU is 1
Private Interface ‘eth1:1′ configured from GPnP for use as a private interconnect.
[name=’eth1:1’, type=1, ip=169.254.162.219, mac=08-00-27-54-4c-ad, net=169.254.0.0/16, mask=255.255.0.0, use=haip:cluster_interconnect/62]
Public Interface ‘eth0′ configured from GPnP for use as a public interface.
[name=’eth0′, type=1, ip=192.168.57.225, mac=08-00-27-35-fe-56, net=192.168.57.0/24, mask=255.255.255.0, use=public/1]
CELL communication is configured to use 0 interface(s):
CELL IP affinity details:
NUMA status: non-NUMA system
cellaffinity.ora status: N/A
CELL communication will use 1 IP group(s):
Grp 0:
Picked latch-free SCN scheme 2
Using LOG_ARCHIVE_DEST_1 parameter default value as /u01/app/11.2.0/grid/dbs/arch
Autotune of undo retention is turned on.
LICENSE_MAX_USERS = 0
SYS auditing is disabled
Starting up:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – Production
With the Real Application Clusters and Automatic Storage Management options.
ORACLE_HOME = /u01/app/11.2.0/grid
System name: Linux
Node name: rac1.bys.com
Release: 2.6.32-200.13.1.el5uek
Version: #1 SMP Wed Jul 27 20:21:26 EDT 2011
Machine: i686
WARNING: using default parameter settings without any parameter file
Cluster communication is configured to use the following interface(s) for this instance
169.254.162.219
cluster interconnect IPC version:Oracle UDP/IP (generic)
IPC Vendor 1 proto 2
Sun May 08 21:07:43 2016
PMON started with pid=2, OS id=6577
Sun May 08 21:07:43 2016
PSP0 started with pid=3, OS id=6581
Sun May 08 21:07:44 2016
VKTM started with pid=4, OS id=6585 at elevated priority
VKTM running at (1)millisec precision with DBRM quantum (100)ms
Sun May 08 21:07:44 2016
GEN0 started with pid=5, OS id=6591
Sun May 08 21:07:44 2016
DIAG started with pid=6, OS id=6595
Sun May 08 21:07:44 2016
PING started with pid=7, OS id=6599
Sun May 08 21:07:44 2016
DIA0 started with pid=8, OS id=6603
Sun May 08 21:07:44 2016
LMON started with pid=9, OS id=6607
Sun May 08 21:07:45 2016
LMD0 started with pid=10, OS id=6611
* Load Monitor used for high load check
* New Low – High Load Threshold Range = [960 – 1280]
Sun May 08 21:07:45 2016
LMS0 started with pid=11, OS id=6615 at elevated priority
Sun May 08 21:07:45 2016
LMHB started with pid=12, OS id=6621
Sun May 08 21:07:45 2016
MMAN started with pid=13, OS id=6625
Sun May 08 21:07:45 2016
DBW0 started with pid=14, OS id=6629
Sun May 08 21:07:45 2016
LGWR started with pid=15, OS id=6633
Sun May 08 21:07:45 2016
CKPT started with pid=16, OS id=6637
Sun May 08 21:07:45 2016
SMON started with pid=17, OS id=6641
Sun May 08 21:07:45 2016
RBAL started with pid=18, OS id=6645
Sun May 08 21:07:45 2016
GMON started with pid=19, OS id=6649
Sun May 08 21:07:45 2016
MMON started with pid=20, OS id=6653
Sun May 08 21:07:45 2016
MMNL started with pid=21, OS id=6657
lmon registered with NM – instance number 1 (internal mem no 0)
Reconfiguration started (old inc 0, new inc 2)
ASM instance
List of instances:
1 (myinst: 1)
Global Resource Directory frozen
* allocate domain 0, invalid = TRUE
Communication channels reestablished
Master broadcasted resource hash value bitmaps
Non-local Process blocks cleaned out
LMS 0: 0 GCS shadows cancelled, 0 closed, 0 Xw survived
Set master node info
Submitted all remote-enqueue requests
Dwn-cvts replayed, VALBLKs dubious
All grantable enqueues granted
Post SMON to start 1st pass IR
Submitted all GCS remote-cache requests
Post SMON to start 1st pass IR
Fix write in gcs resources
Reconfiguration complete
Sun May 08 21:07:46 2016
LCK0 started with pid=22, OS id=6661
ORACLE_BASE not set in environment. It is recommended
that ORACLE_BASE be set in the environment
Sun May 08 21:07:48 2016
SQL> ALTER DISKGROUP ALL MOUNT /* asm agent call crs *//* {0:0:2} */
NOTE: Diskgroup used for Voting files is:
DATA1
Diskgroup used for OCR is:DATA1
NOTE: cache registered group DATA1 number=1 incarn=0xae0a68c1
NOTE: cache began mount (first) of group DATA1 number=1 incarn=0xae0a68c1
NOTE: Assigning number (1,0) to disk (/dev/asm-diskb)
NOTE: GMON heartbeating for grp 1
GMON querying group 1 at 3 for pid 24, osid 6665
NOTE: cache opening disk 0 of grp 1: DATA1_0000 path:/dev/asm-diskb
NOTE: F1X0 found on disk 0 au 2 fcn 0.0
NOTE: cache mounting (first) external redundancy group 1/0xAE0A68C1 (DATA1)
* allocate domain 1, invalid = TRUE
NOTE: attached to recovery domain 1
NOTE: cache recovered group 1 to fcn 0.1846
NOTE: redo buffer size is 256 blocks (1053184 bytes)
Sun May 08 21:07:55 2016
NOTE: LGWR attempting to mount thread 1 for diskgroup 1 (DATA1)
Process LGWR (pid 6633) is running at high priority QoS for Exadata I/O
NOTE: LGWR found thread 1 closed at ABA 71.485
NOTE: LGWR mounted thread 1 for diskgroup 1 (DATA1)
NOTE: LGWR opening thread 1 at fcn 0.1846 ABA 72.486
NOTE: cache mounting group 1/0xAE0A68C1 (DATA1) succeeded
NOTE: cache ending mount (success) of group DATA1 number=1 incarn=0xae0a68c1
Sun May 08 21:07:55 2016
NOTE: Instance updated compatible.asm to 11.2.0.0.0 for grp 1
SUCCESS: diskgroup DATA1 was mounted
SUCCESS: ALTER DISKGROUP ALL MOUNT /* asm agent call crs *//* {0:0:2} */
SQL> ALTER DISKGROUP ALL ENABLE VOLUME ALL /* asm agent *//* {0:0:2} */
SUCCESS: ALTER DISKGROUP ALL ENABLE VOLUME ALL /* asm agent *//* {0:0:2} */
Sun May 08 21:07:57 2016
WARNING: failed to online diskgroup resource ora.DATA1.dg (unable to communicate with CRSD/OHASD)
NOTE: Attempting voting file refresh on diskgroup DATA1
NOTE: Refresh completed on diskgroup DATA1
. Found 1 voting file(s).
NOTE: Voting file relocation is required in diskgroup DATA1
NOTE: Attempting voting file relocation on diskgroup DATA1
NOTE: Successful voting file relocation on diskgroup DATA1
Sun May 08 21:07:57 2016
NOTE: [crsd.bin@rac1.bys.com (TNS V1-V3) 6684] opening OCR file
Starting background process ASMB
Sun May 08 21:07:57 2016
ASMB started with pid=26, OS id=6705
Sun May 08 21:07:57 2016
NOTE: client +ASM1:+ASM registered, osid 6709, mbr 0x0
Sun May 08 21:08:08 2016
SQL> ALTER DISKGROUP DATA2 MOUNT /* asm agent *//* {1:23346:2} */
NOTE: cache registered group DATA2 number=2 incarn=0x29ba68c3
NOTE: cache began mount (first) of group DATA2 number=2 incarn=0x29ba68c3
NOTE: Assigning number (2,1) to disk (/dev/asm-diskd)
NOTE: Assigning number (2,0) to disk (/dev/asm-diskc)
Sun May 08 21:08:14 2016
NOTE: GMON heartbeating for grp 2
GMON querying group 2 at 7 for pid 30, osid 6876
NOTE: cache opening disk 0 of grp 2: DATA2_0000 path:/dev/asm-diskc
NOTE: F1X0 found on disk 0 au 2 fcn 0.0
NOTE: cache opening disk 1 of grp 2: DATA2_0001 path:/dev/asm-diskd
NOTE: cache mounting (first) external redundancy group 2/0x29BA68C3 (DATA2)
Sun May 08 21:08:15 2016
* allocate domain 2, invalid = TRUE
Sun May 08 21:08:15 2016
NOTE: attached to recovery domain 2
NOTE: cache recovered group 2 to fcn 0.5980
NOTE: redo buffer size is 256 blocks (1053184 bytes)
Sun May 08 21:08:15 2016
NOTE: LGWR attempting to mount thread 1 for diskgroup 2 (DATA2)
NOTE: LGWR found thread 1 closed at ABA 70.929
NOTE: LGWR mounted thread 1 for diskgroup 2 (DATA2)
NOTE: LGWR opening thread 1 at fcn 0.5980 ABA 71.930
NOTE: cache mounting group 2/0x29BA68C3 (DATA2) succeeded
NOTE: cache ending mount (success) of group DATA2 number=2 incarn=0x29ba68c3
Sun May 08 21:08:15 2016
NOTE: Instance updated compatible.asm to 11.2.0.0.0 for grp 2
SUCCESS: diskgroup DATA2 was mounted
SUCCESS: ALTER DISKGROUP DATA2 MOUNT /* asm agent *//* {1:23346:2} */
Sun May 08 21:08:15 2016
NOTE: diskgroup resource ora.DATA2.dg is updated
Sun May 08 21:09:04 2016
ALTER SYSTEM SET local_listener=’ (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.57.227)(PORT=1521))))’ SCOPE=MEMORY SID=’+ASM1′;
[grid@rac1 trace]$
[grid@rac1 trace]$ crsctl stat res -t
——————————————————————————–
NAME TARGET STATE SERVER STATE_DETAILS
——————————————————————————–
Local Resources
——————————————————————————–
ora.DATA1.dg
ONLINE ONLINE rac1
ora.DATA2.dg
ONLINE ONLINE rac1
ora.LISTENER.lsnr
ONLINE ONLINE rac1
ora.asm
ONLINE ONLINE rac1 Started
ora.gsd
OFFLINE OFFLINE rac1
ora.net1.network
ONLINE ONLINE rac1
ora.ons
ONLINE ONLINE rac1
——————————————————————————–
Cluster Resources
——————————————————————————–
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac1
ora.cvu
1 ONLINE ONLINE rac1
ora.oc4j
1 ONLINE ONLINE rac1
ora.rac.db
1 OFFLINE OFFLINE Instance Shutdown
2 OFFLINE OFFLINE
ora.rac.sales.svc
1 OFFLINE OFFLINE
2 OFFLINE OFFLINE
ora.rac1.vip
1 ONLINE ONLINE rac1
ora.rac2.vip
1 ONLINE INTERMEDIATE rac1 FAILED OVER
ora.scan1.vip
1 ONLINE ONLINE rac1

##############################################################################
##############################################################################
##############################################################################
实验3:
1.spmove 验证kfed 中读到的信息是否变化及gpnp profile中信息也被修改
[grid@rac1 peer]$ kfed read /dev/asm-diskb|grep spfile
kfdhdb.spfile: 58 ; 0x0f4: 0x0000003a
开始修改–只能移到其它磁盘组
ASMCMD> pwd
+DATA1/rac-cluster/asmparameterfile
ASMCMD> spmove REGISTRY.253.857644239 +DATA1/rac-cluster/spfileasm.ora
ORA-15056: additional error message
ORA-17502: ksfdcre:4 Failed to create file +DATA1/rac-cluster/spfileasm.ora
ORA-15268: internal Oracle file +DATA1.253.1 already exists.
ORA-06512: at line 7 (DBD ERROR: OCIStmtExecute)

ASMCMD> spmove REGISTRY.253.857644239 +DATA2/spfileasm.ora

验证:
ASMCMD> cd +DATA2
ASMCMD> ls
RAC/
rac-cluster/
spfileasm.ora
ASMCMD> spget
+DATA2/spfileasm.ora
ASMCMD>
ASMCMD> cd +DATA1/rac-cluster/asmparameterfile/
ASMCMD-8002: entry ‘asmparameterfile’ does not exist in directory ‘+DATA1/rac-cluster/’

set linesize 140 pagesize 1400
col “FILE NAME” format a40
set head on
select NAME “FILE NAME”,
AU_KFFXP “AU NUMBER”,
NUMBER_KFFXP “FILE NUMBER”,
DISK_KFFXP “DISK NUMBER”,
GROUP_KFFXP “GROUP NUMBER”
from x$kffxp, v$asm_alias
where GROUP_KFFXP = GROUP_NUMBER
and NUMBER_KFFXP = FILE_NUMBER
and name in (‘REGISTRY.253.857644239’)
order by DISK_KFFXP,AU_KFFXP;

FILE NAME AU NUMBER FILE NUMBER DISK NUMBER GROUP NUMBER
—————————————- ———- ———– ———– ————
spfileasm.ora 1977 253 0 2

SQL> col path for a40
SQL> select disk_number,path,GROUP_NUMBER,NAME from v$asm_disk;

DISK_NUMBER PATH GROUP_NUMBER NAME
———– —————————————- ———— ——————————
1 /dev/asm-diskd 2 DATA2_0001
0 /dev/asm-diskc 2 DATA2_0000
0 /dev/asm-diskb 1 DATA1_0000

[grid@rac1 peer]$ kfed read /dev/asm-diskb|grep spfile
kfdhdb.spfile: 0 ; 0x0f4: 0x00000000
[grid@rac1 peer]$ kfed read /dev/asm-diskc|grep spfile
kfdhdb.spfile: 1977 ; 0x0f4: 0x000007b9
[grid@rac1 peer]$ kfed read /dev/asm-diskd|grep spfile
kfdhdb.spfile: 0 ; 0x0f4: 0x00000000
[grid@rac1 peer]$

[grid@rac1 peer]$ pwd
/u01/app/11.2.0/grid/gpnp/rac1/profiles/peer
[grid@rac1 peer]$ ls -lrt
total 16
-rw-r–r– 1 grid oinstall 1828 Sep 7 2014 profile_orig.xml
-rw-r–r– 1 grid oinstall 1891 May 8 20:52 profile.xml1
-rw-r–r– 1 grid oinstall 1876 May 9 11:38 profile.old
-rw-r–r– 1 grid oinstall 1854 May 9 11:58 profile.xml
[grid@rac1 peer]$ cat profile.xml
<?xml version=”1.0″ encoding=”UTF-8″?><gpnp:GPnP-Profile Version=”1.0″ xmlns=”http://www.grid-pnp.org/2005/11/gpnp-profile” xmlns:gpnp=”http://www.grid-pnp.org/2005/11/gpnp-profile” xmlns:orcl=”http://www.oracle.com/gpnp/2005/11/gpnp-profile” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://www.grid-pnp.org/2005/11/gpnp-profile gpnp-profile.xsd” ProfileSequence=”11″ ClusterUId=”5de823e89503dfabbf7868bf50f95c5c” ClusterName=”rac-cluster” PALocation=””><gpnp:Network-Profile><gpnp:HostNetwork id=”gen” HostName=”*”><gpnp:Network id=”net1″ IP=”192.168.57.0″ Adapter=”eth0″ Use=”public”/><gpnp:Network id=”net2″ IP=”192.168.10.0″ Adapter=”eth1″ Use=”cluster_interconnect”/></gpnp:HostNetwork></gpnp:Network-Profile> <orcl:CSS-Profile id=”css” DiscoveryString=”+asm” LeaseDuration=”400″/><orcl:ASM-Profile id=”asm” DiscoveryString=”/dev/asm*” SPFile=”+DATA2/spfileasm.ora”/><ds:Signature xmlns:ds=”http://www.w3.org/2000/09/xmldsig#”><ds:SignedInfo><ds:CanonicalizationMethod Algorithm=”http://www.w3.org/2001/10/xml-exc-c14n#”/><ds:SignatureMethod Algorithm=”http://www.w3.org/2000/09/xmldsig#rsa-sha1″/><ds:Reference URI=””><ds:Transforms><ds:Transform Algorithm=”http://www.w3.org/2000/09/xmldsig#enveloped-signature”/><ds:Transform Algorithm=”http://www.w3.org/2001/10/xml-exc-c14n#”> <InclusiveNamespaces xmlns=”http://www.w3.org/2001/10/xml-exc-c14n#” PrefixList=”gpnp orcl xsi”/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=”http://www.w3.org/2000/09/xmldsig#sha1″/><ds:DigestValue>2MofRiwOg5XPTit2Qe/PE9e0Zcc=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>W8h6Ou1pqg9xJXMQ3Lvkh6CgSZasftWIQkonb5OkLJtnr/gj2pUzs5WtNx7XPrU5V0uhb9A/Lb2bZj265VV8lrzQ2mt0aaO7m5JflNFKosg2TdsCDBP8cLh1TT81snoPiE65RlRMrVagVgIUs+2MHK7CJ1mNckIFMUYvU+US38s=</ds:SignatureValue></ds:Signature></gpnp:GPnP-Profile>[grid@rac1 peer]$
[grid@rac1 peer]$
[grid@rac1 peer]$
[grid@rac1 peer]$ cat profile.old
<?xml version=”1.0″ encoding=”UTF-8″?><gpnp:GPnP-Profile Version=”1.0″ xmlns=”http://www.grid-pnp.org/2005/11/gpnp-profile” xmlns:gpnp=”http://www.grid-pnp.org/2005/11/gpnp-profile” xmlns:orcl=”http://www.oracle.com/gpnp/2005/11/gpnp-profile” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://www.grid-pnp.org/2005/11/gpnp-profile gpnp-profile.xsd” ProfileSequence=”10″ ClusterUId=”5de823e89503dfabbf7868bf50f95c5c” ClusterName=”rac-cluster” PALocation=””><gpnp:Network-Profile><gpnp:HostNetwork id=”gen” HostName=”*”><gpnp:Network id=”net1″ IP=”192.168.57.0″ Adapter=”eth0″ Use=”public”/><gpnp:Network id=”net2″ IP=”192.168.10.0″ Adapter=”eth1″ Use=”cluster_interconnect”/></gpnp:HostNetwork></gpnp:Network-Profile ><orcl:CSS-Profile id=”css” DiscoveryString=”+asm” LeaseDuration=”400″/><orcl:ASM-Profile id=”asm” DiscoveryString=”/dev/asm*” SPFile=”+DATA1/rac-cluster/asmparameterfile/spfile”/><ds:Signature xmlns:ds=”http://www.w3.org/2000/09/xmldsig#”><ds:SignedInfo><ds:CanonicalizationMethod Algorithm=”http://www.w3.org/2001/10/xml-exc-c14n#”/><ds:SignatureMethod Algorithm=”http://www.w3.org/2000/09/xmldsig#rsa-sha1″/><ds:Reference URI=””><ds:Transforms><ds:Transform Algorithm=”http://www.w3.org/2000/09/xmldsig#enveloped-signature”/><ds:Transform Algorithm=”http://www.w3.org/2001/10/xml-exc-c14n#”> <InclusiveNamespaces xmlns=”http://www.w3.org/2001/10/xml-exc-c14n#” PrefixList=”gpnp orcl xsi”/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=”http://www.w3.org/2000/09/xmldsig#sha1″/><ds:DigestValue>XvMehRofN1WxcEEtl9qyhoewSxE=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>C99Z3HlRuBRxjpNVyoyBE2kYr1oyn4wJBtdmyjbei2UrhCvdYjv7lucvefL0ZViHgtoP5GjnH3R42iTNn6jIVEE3L9ZzXEDzBVyoEaET0DG3rhlEuJ1K8+PwqMoR+sxaIGogJGmomOoRajCa5ip6tYY5TgBZX6ZDCB5ub+khdZw=</ds:SignatureValue></ds:Signature></gpnp:GPnP-Profile>[grid@rac1 peer]$
[grid@rac1 peer]$
[grid@rac1 peer]$ cd –
/home/grid
[grid@rac1 ~]$ cd /u01/app/11.2.0/grid/gpnp/profiles/peer/
[grid@rac1 peer]$ ls
profile_orig.xml profile.xml profile.xml1
[grid@rac1 peer]$ ls -lrt
total 12
-rw-r–r– 1 grid oinstall 1828 Sep 7 2014 profile_orig.xml
-rw-r–r– 1 grid oinstall 1891 May 7 22:40 profile.xml
-rw-r–r– 1 grid oinstall 1891 May 8 20:50 profile.xml1

####################################################
####################################################
实验3:设置为正确的asm spfile信息,经过crsctl stop/start has 和重启OS,查看GPNP PROFILE所在目录中还存在pending.xml
但是在实验2中,spmove后不存在pending.xml了。
[grid@rac1 peer]$ date
Mon May 9 10:18:58 CST 2016
[grid@rac1 peer]$ asmcmd
ASMCMD> spget
+DATA1/rac-cluster/asmparameterfile/spfile.ora
ASMCMD> cd +DATA1/rac-cluster/asmparameterfile/
ASMCMD> ls
REGISTRY.253.857644239
ASMCMD> spset +DATA1/rac-cluster/asmparameterfile/REGISTRY.253.857644239
ASMCMD>
ASMCMD> spget
+DATA1/rac-cluster/asmparameterfile/REGISTRY.253.857644239
ASMCMD>
[grid@rac1 peer]$ ls -lrt
total 20
-rw-r–r– 1 grid oinstall 1828 Sep 7 2014 profile_orig.xml
-rw-r–r– 1 grid oinstall 1891 May 8 20:52 profile.xml1
-rw-r–r– 1 grid oinstall 1879 May 8 21:04 profile.old
-rw-r–r– 1 grid oinstall 1891 May 9 10:19 profile.xml
-rw-r–r– 1 grid oinstall 1891 May 9 10:20 pending.xml
[grid@rac1 peer]$
[grid@rac1 peer]$
[grid@rac1 peer]$ cat pending.xml
<?xml version=”1.0″ encoding=”UTF-8″?><gpnp:GPnP-Profile Version=”1.0″ xmlns=”http://www.grid-pnp.org/2005/11/gpnp-profile” xmlns:gpnp=”http://www.grid-pnp.org/2005/11/gpnp-profile” xmlns:orcl=”http://www.oracle.com/gpnp/2005/11/gpnp-profile” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://www.grid-pnp.org/2005/11/gpnp-profile gpnp-profile.xsd” ProfileSequence=”9″ ClusterUId=”5de823e89503dfabbf7868bf50f95c5c” ClusterName=”rac-cluster” PALocation=””><gpnp:Network-Profile><gpnp:HostNetwork id=”gen” HostName=”*”><gpnp:Network id=”net1″ IP=”192.168.57.0″ Adapter=”eth0″ Use=”public”/><gpnp:Network id=”net2″ IP=”192.168.10.0″ Adapter=”eth1″ Use=”cluster_interconnect”/></gpnp:HostNetwork></gpnp:Network-Profile> <orcl:CSS-Profile id=”css” DiscoveryString=”+asm” LeaseDuration=”400″/><orcl:ASM-Profile id=”asm” DiscoveryString=”/dev/asm*” SPFile=”+DATA1/rac-cluster/asmparameterfile/REGISTRY.253.857644239″/><ds:Signature xmlns:ds=”http://www.w3.org/2000/09/xmldsig#”><ds:SignedInfo><ds:CanonicalizationMethod Algorithm=”http://www.w3.org/2001/10/xml-exc-c14n#”/><ds:SignatureMethod Algorithm=”http://www.w3.org/2000/09/xmldsig#rsa-sha1″/><ds:Reference URI=””><ds:Transforms><ds:Transform Algorithm=”http://www.w3.org/2000/09/xmldsig#enveloped-signature”/><ds:Transform Algorithm=”http://www.w3.org/2001/10/xml-exc-c14n#”> <InclusiveNamespaces xmlns=”http://www.w3.org/2001/10/xml-exc-c14n#” PrefixList=”gpnp orcl xsi”/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=”http://www.w3.org/2000/09/xmldsig#sha1″/><ds:DigestValue>OUnyCqOFao3v51DLgMAXY2GOagA=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>TdyvuciCcAebSgt3/fAW8wxrcfo3tF0rH2pdNmy2bBo3yPIjx3mrZWfWz5aoaeYqd69GfiEPabh9udOxBFf4MxFjJz8DeoZRb7Nr2on/sU2qnaDJ8Vnep9Htph7oYUJMmSgB8ncyWw2+YrM1UmY0OTBlApJR/UiunwcTT/4NA84=</ds:SignatureValue></ds:Signature></gpnp:GPnP-Profile>[grid@rac1 peer]$

验证11gR2 RAC中ASM实例通过gpnp profile获得spfile信息来启动ASM实例