修改Oracle参数后导致数据启动失败,如:设置lock_sga=true后重启数据库失败
C:\Users\user>sqlplus sys/********@samp001_solgle as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Mon Nov 3 15:56:05 2014
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management,
OLAP,
Data Mining and Real Application Testing options
SQL> alter system set lock_sga=true scope=spfile sid='*';
System altered.
SQL>
[grid@rac1 bin]$ ./srvctl stop database -d solgle
[grid@rac1 bin]$ ./srvctl start database -d solgle
PRCR-1079 : Failed to start resource ora.solgle.db
CRS-5017: The resource action "ora.solgle.db start" encountered the following error:
ORA-00847: MEMORY_TARGET/MEMORY_MAX_TARGET and LOCK_SGA cannot be set together
. For details refer to "(:CLSN00107:)" in "/u01/app/grid/11.2.0/log/rac1/agent/crsd/oraagent_oracle/oraagent_oracle.log".
CRS-5017: The resource action "ora.solgle.db start" encountered the following error:
ORA-00847: MEMORY_TARGET/MEMORY_MAX_TARGET and LOCK_SGA cannot be set together
. For details refer to "(:CLSN00107:)" in "/u01/app/grid/11.2.0/log/rac2/agent/crsd/oraagent_oracle/oraagent_oracle.log".
CRS-2674: Start of 'ora.solgle.db' on 'rac1' failed
CRS-2674: Start of 'ora.solgle.db' on 'rac2' failed
CRS-2632: There are no more servers to try to place resource 'ora.solgle.db' on that would satisfy its placement policy
[grid@rac1 bin]$
---11g采用内存自动管理,明显与sga_lock冲突,其它参数修改错误类同
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
C:\Users\user>sqlplus sys/********@samp001_solgle as sysdba;
SQL*Plus: Release 11.2.0.1.0 Production on Tue Nov 4 09:07:13 2014
Copyright (c) 1982, 2010, Oracle. All rights reserved.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Enter user-name:
---连接服务器看服务状态
[grid@rac1 bin]$ ./crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA1.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.DATA2.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.LISTENER.lsnr
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.asm
ONLINE ONLINE rac1 Started
ONLINE ONLINE rac2 Started
ora.gsd
OFFLINE OFFLINE rac1
OFFLINE OFFLINE rac2
ora.net1.network
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.ons
ONLINE ONLINE rac1
ONLINE ONLINE rac2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac1
ora.cvu
1 ONLINE ONLINE rac1
ora.solgle.db
1 ONLINE OFFLINE Instance Shutdown
2 ONLINE OFFLINE Instance Shutdown
ora.oc4j
1 ONLINE ONLINE rac1
ora.rac1.vip
1 ONLINE ONLINE rac1
ora.rac2.vip
1 ONLINE ONLINE rac2
ora.scan1.vip
1 ONLINE ONLINE rac1
[grid@rac1 bin]$
---数据库没有启动,监听不能识别该服务了
[grid@rac1 bin]$ su - oracle
Password:
[oracle@rac1 ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Tue Nov 4 07:37:17 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
Enter user-name:
[oracle@rac1 ~]$
[oracle@rac1 ~]$ export ORACLE_SID=solgle
[oracle@rac1 ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Tue Nov 4 07:39:18 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL>
---创建pfile
SQL> create pfile="hao123.ora" from spfile;
create pfile="hao123.ora" from spfile
*
ERROR at line 1:
ORA-02236: invalid file name
[oracle@rac1 ~]$ cd /u02/app/product/11.2.0/dbname_1/dbs
[oracle@rac1 dbs]$ ls
hc_solgle1.dat init.ora initsolgle1.ora orapwsolgle1 snapcf_solgle1.f
[oracle@rac1 dbs]$ cat initsolgle1.ora
SPFILE='+DATA1/solgle/spfilesolgle.ora'
SQL> create pfile='/u02/app/product/11.2.0/dbname_1/dbs/hao123.ora' from spfile='+DATA1/solgle/spfilesolgle.ora';
File created.
SQL>
---回到主机
[oracle@rac1 ~]$ cd /u02/app/product/11.2.0/dbname_1/dbs/
[oracle@rac1 dbs]$ ls
hao123.ora hc_solgle1.dat init.ora initsolgle1.ora orapwsolgle1 snapcf_solgle1.f
[oracle@rac1 dbs]$ vi hao123.ora
... ...
solgle1.instance_number=1
solgle2.instance_number=2
######*.lock_sga=TRUE ---注释掉这行(或者同理修改)
*.memory_target=1050673152
... ...
:wq!
---回到sqlplus
SQL> create spfile='+DATA1/solgle/spfilesolgle.ora' from pfile='/u02/app/product/11.2.0/dbname_1/dbs/hao123.ora';
File created.
SQL>
----回到服务器黑屏下
[oracle@rac1 dbs]$ su - grid
Password:
[grid@rac1 ~]$ cd /u01/app/grid/11.2.0/bin/
[grid@rac1 bin]$ ./srvctl start database -d solgle
[grid@rac1 bin]$
---数据库已经启动成功
[grid@rac1 bin]$ ./crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA1.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.DATA2.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.LISTENER.lsnr
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.asm
ONLINE ONLINE rac1 Started
ONLINE ONLINE rac2 Started
ora.gsd
OFFLINE OFFLINE rac1
OFFLINE OFFLINE rac2
ora.net1.network
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.ons
ONLINE ONLINE rac1
ONLINE ONLINE rac2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac1
ora.cvu
1 ONLINE ONLINE rac1
ora.solgle.db
1 ONLINE ONLINE rac1 Open
2 ONLINE ONLINE rac2 Open
ora.oc4j
1 ONLINE ONLINE rac1
ora.rac1.vip
1 ONLINE ONLINE rac1
ora.rac2.vip
1 ONLINE ONLINE rac2
ora.scan1.vip
1 ONLINE ONLINE rac1
[grid@rac1 bin]$