1. RAC修改spfile位置
2.
3. [root@rac1 ~]# su - oracle
4. [oracle@rac1 ~]$ sqlplus / as sysdba
5. SQL*Plus: Release 11.2.0.3.0 Production on Wed Jan 8 22:36:39 2014
6. Copyright (c) 1982, 2011, Oracle. All rights reserved.
7. Connected to:
8. Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
9. With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
10. Data Mining and Real Application Testing options
11.
12. SQL> select status from gv$instance;
13.
14. STATUS
15. ------------------------
16. OPEN
17. OPEN
18.
19. SQL> show parameter db_name
20.
21. NAME TYPE VALUE
22. ------------------------------------ ---------------------- ------------------------------
23. db_name string orcl
24.
25.
26. 1.查看当前的DATABASE spfile 位置
27.
28. SQL> show parameter spfile
29.
30. NAME TYPE VALUE
31. ------------------------------------ ----------- ------------------------------
32. spfile string +ORCLDG/orcl/spfileorcl.ora
33.
34.
35. 2.备份 pfile
36. [oracle@rac1 ~]$ cd $ORACLE_HOME/dbs
37. [oracle@rac1 ~]$ more initorcl1.ora
38.
39. spfile='+ORCLDG/orcl/spfileorcl.ora'
40.
41. [oracle@rac1 ~]$ cp initorcl1.ora initorcl1.orabak
42.
43. 3.重新在指定路径创建 spfile
44.
45. [oracle@rac1 ~]$ sqlplus / as sysdba
46.
47. SQL> create pfile from spfile;
48.
49. SQL> create spfile='+ORCL_FRA' from pfile;
50.
51.
52.
53. 4.查看新创建spfile位置
54. [oracle@rac1 ~]$ su - grid
55. [grid@yyzfrac1 ~]$ asmcmd
56. ASMCMD> lsdg
57. State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
58. MOUNTED NORMAL N 512 4096 1048576 6144 5218 2048 1585 0 Y OCRDG/
59. MOUNTED EXTERN N 512 4096 1048576 204800 204704 0 204704 0 N ORCLDG/
60. MOUNTED EXTERN N 512 4096 1048576 204800 204704 0 204704 0 N ORCL_FRA/
61.
62. ASMCMD> cd ORCL_FRA
63. ASMCMD> ls
64. ORCL/
65. ASMCMD> cd orcl
66. ASMCMD> ls
67. CONTROLFILE/
68. PARAMETERFILE/
69. control01.ctl
70. control02.ctl
71. ASMCMD> cd PARAMETERFILE/
72. ASMCMD> ls
73. spfile.258.836345535
74.
75.
76. 5.指定新的spfile别名
77. ASMCMD>mkalias +ORCL_FRA/ORCL/PARAMETERFILE/spfile.258.836345535 +ORCL_FRA/ORCL/spfileorcl.ora
78.
79. 6.用srvctl修改新的rac数据库spfile 位置
80.
81. [oracle@yyzfrac2 dbs]$ srvctl modify database -d orcl -p +orcl_fra/orcl/spfileorcl.ora
82.
83.
84. 7.删除原来的spfile
85.
86. [oracle@rac1 ~]$ sqlplus / as sysdba
87.
88. SQL>alter diskgroup orcldg drop file '+orcldg/orcl/spfileorcl.ora';
89.
90. 8.分别在两个节点中更新initorcl1.ora initorcl2.ora
91.
92. 内容为spfile='+orcl_fra/orcl/spfileorcl.ora'
93.
94.
95. 9.重新启动数据库
96.
97. [oracle@rac1 ~]$srvctl stop database -d orcl
98. [oracle@rac1 ~]$srvctl start database -d orcl
99.
100. 10.在两节点查看spfile位置
101. SQL> set line 3000
102. SQL> show parameter spfile
103.
104. NAME TYPE VALUE
105. ------------------------------------ ----------- ------------------------------
106. spfile string +ORCL_FRA/orcl/spfileorcl.ora
107.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31448824/viewspace-2139496/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/31448824/viewspace-2139496/