oracle无法启动,恢复spfile

2023-12-12 22:32

本文主要是介绍oracle无法启动,恢复spfile,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

oralce无法启动,分很多种情况,请看alertsid.log

一般情况下的启动顺序为

1. spfilesid.ora 。

2.如果没有找到,就直接从spfile.ora 启动。

3.如果还是没有找到,就从initsid.ora启动。


注意这里的sid要换成你自己的sid。 如果是RAC环境,initsid.ora中,一般是放有磁盘共享的spfile的路径。

本文是自己工作操作的一部分,有点乱,空了来整理


Connecting to 192.168.9.252:10094...

Connection established.
Escape character is '^@]'.


Last login: Sat Dec  3 18:49:21 2011 from edsm01
Oracle Corporation      SunOS 5.10      Generic Patch   January 2005
Sourcing //.profile-EIS.....
root@edsm02 # su - grid
Oracle Corporation      SunOS 5.10      Generic Patch   January 2005
$ asmcmd
ASMCMD> 
ASMCMD> ls
DG01DATA/
DG01REDO/
DG02REDO/
DGCRS/
ASMCMD> cd DG01DATA
ASMCMD> ls
UNICOM/
ASMCMD> cd UNICOM/PARAMETERFILE
ASMCMD> ls
spfile.262.768832711
ASMCMD> spcopy spfile.262.^[[2~48318382080/1024/1024/1024=^C
ASMCMD> 
ASMCMD> spcopy spfile.262.768832711 /tmp/
ORA-15056: additional error message
ORA-15300: File +DG01DATA/UNICOM/PARAMETERFILE/spfile.262.768832711 is incompatible with this operation
ORA-06512: at line 7 (DBD ERROR: OCIStmtExecute)
ASMCMD> cp spfile.262.768832711 /tmp/
copying +DG01DATA/UNICOM/PARAMETERFILE/spfile.262.768832711 -> /tmp//spfile.262.768832711
ASMCMD> exit
$ exit
root@edsm02 # cd /tmp
root@edsm02 # cd ^C
root@edsm02 # 
root@edsm02 # su - oracle
Oracle Corporation      SunOS 5.10      Generic Patch   January 2005
export LOGNAME
export ORACLE_BASE
export ORACLE_HOME
export ORACLE_SID
export ORA_CRS_HOME
export PATH
$ cd $ORACLE_HOME/dbs
$ cp /tmp/spfile.262.768832711 .
$ ls
core                  hc_unicom2.dat        init.ora              initunicom2.ora       orapwunicom2          spfile.262.768832711
$ more initunicom2.ora
SPFILE='+DG01DATA/unicom/spfileunicom.ora'
$ exit
root@edsm02 # ls
hsperfdata_grid       hsperfdata_noaccess   hsperfdata_root       spfile.262.768832711
root@edsm02 # su - grid
Oracle Corporation      SunOS 5.10      Generic Patch   January 2005
$ asmcmd




ASMCMD> ASMCMD> ASMCMD> 
ASMCMD> cd DG01DATA
ASMCMD> cd unicom
ASMCMD> ls
DATAFILE/
PARAMETERFILE/
TEMPFILE/
spfileunicom.ora
ASMCMD> spcopy spfileunicom.ora /tmp
ORA-15056: additional error message
ORA-15300: File +DG01DATA/unicom/spfileunicom.ora is incompatible with this operation
ORA-06512: at line 7 (DBD ERROR: OCIStmtExecute)
ASMCMD> cp spfileunicom.ora /tmp/
copying +DG01DATA/unicom/spfileunicom.ora -> /tmp//spfileunicom.ora
ASMCMD> exit
$ exit
root@edsm02 # su - oracle
Oracle Corporation      SunOS 5.10      Generic Patch   January 2005
export LOGNAME
export ORACLE_BASE
export ORACLE_HOME
export ORACLE_SID
export ORA_CRS_HOME
export PATH
$ cd $ORACLE_HOME/dbs
$ ls
core                  hc_unicom2.dat        init.ora              initunicom2.ora       orapwunicom2          spfile.262.768832711
$ rm spfile*^C

$ cp /tmp/spfileunicom.ora .
$ ls
core                  hc_unicom2.dat        init.ora              initunicom2.ora       orapwunicom2          spfile.262.768832711  spfileunicom.ora
$ strings ^[[24~spfileunicom.ora |^C

$ strings  spfileunicom.ora |more
unicom1.__db_cache_size=19327352832
unicom2.__db_cache_size=19327352832
unicom1.__java_pool_size=134217728
unicom2.__java_pool_size=134217728
unicom1.__large_pool_size=402653184
unicom2.__large_pool_size=268435456
unicom1.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
unicom1.__pga_aggregate_target=21340618752
unicom2.__pga_aggregate_target=22682796032
unicom1.__sga_target=25904021504
unicom2.__sga_target=24561844224
unicom1.__shared_io_pool_size=0
unicom2.__shared_
io_pool_size=0
unicom1.__shared_pool_size=3489660928
unicom2.__shared_pool_size=4160749568
unicom1.__streams_pool_size=0
unicom2.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/unicom/adump'
*.audit_trail='db'
*.cluster_database=true
*.compatible='11.2.0.0.0'
*.control_files='+DG01REDO/unicom/controlfile/current.256.768792603','+DG02REDO/unicom/controlfile/current.256.768792605'
*.db_block_size=32768
*.db_cache_size=19327352832
*.db_create_file_dest='+DG01DATA'
*.db_cr
eate_online_log_dest_1='+DG01REDO'
*.db_create_online_log_dest_2='+DG02REDO'
*.db_domain=''
*.db_files=4096
*.db_keep_cache_size=2147483648
*.db_name='unicom'
*.db_recovery_file_dest='+DG01REDO'
*.db_recovery_file_dest_size=5218762752
*.db_writer_processes=8
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=unicomXDB)'
*.hash_area_size=134217728
unicom2.instance_number=2
unicom1.instance_number=1
*.job_queue_processes=20
*.memory_max_target=47244640256
*.memo
ry_target=47244640256
*.open_cursors=1000
*.parallel_force_local=TRUE
*.parallel_max_servers=94
*.parallel_min_servers=16
*.pga_aggregate_target=21474836480
*.processes=1000
*.remote_listener='rac-scan:1521'
*.remote_login_passwordfile='exclusive'
*.result_cache_max_size=1073741824
*.sessions=1005
*.sga_target=20401094656
*.sort_area_retained_size=0
*.sort_area_size=67108864
unicom2.thread=2
unicom1.thread=1
unicom2.undo_tablespace='UNDOTBS2'
unicom1.undo_tablespace='UNDOTBS1'
$ string^C
$ strings spfileunicom.ora > pfileunicom.ora
$ vi pfileunicom.ora
"pfileunicom.ora" 62 lines, 1949 characters 
:q!
unicom2.__large_pool_size=268435456
unicom1.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
unicom1.__pga_aggregate_target=21340618752
unicom2.__pga_aggregate_target=22682796032
unicom1.__sga_target=25904021504
unicom2.__sga_target=24561844224
unicom1.__shared_io_pool_size=0
unicom2.__shared_
io_pool_size=0
unicom1.__shared_pool_size=3489660928
unicom2.__shared_pool_size=4160749568
unicom1.__streams_pool_size=0
unicom2.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/unicom/adump'
*.audit_trail='db'
*.cluster_database=true
*.compatible='11.2.0.0.0'
*.control_files='+DG01REDO/unicom/controlfile/current.256.768792603','+DG02REDO/unicom/controlfile/current.256.768792605'
*.db_block_size=32768
*.db_cache_size=19327352832
*.db_create_file_dest='+DG01DATA'
*.db_cr
eate_online_log_dest_1='+DG01REDO'
*.db_create_online_log_dest_2='+DG02REDO'
*.db_domain=''
*.db_files=4096
*.db_keep_cache_size=2147483648
*.db_name='unicom'
*.db_recovery_file_dest='+DG01REDO'
*.db_recovery_file_dest_size=5218762752
*.db_writer_processes=8
*.diagnostic_dest='/u01/app/oracle'
:q!
$ ls
core                  hc_unicom2.dat        init.ora              initunicom2.ora       orapwunicom2          pfileunicom.ora       spfile.262.768832711  spfileunicom.ora
$ ll
ll: not found
$ ls =l
=l: No such file or directory
$ ls -l
total 1862152
-rw-------   1 root     root     47740177543 Dec  3 19:21 core
-rw-rw----   1 oracle   asmadmin    1544 Dec  3 19:27 hc_unicom2.dat
-rw-r--r--   1 oracle   oinstall    2851 Dec  2 00:55 init.ora
-rw-r-----   1 oracle   oinstall      43 Dec  2 12:39 initunicom2.ora
-rw-r-----   1 oracle   oinstall    1536 Dec  2 01:27 orapwunicom2
-rw-r--r--   1 oracle   oinstall    1949 Dec  3 19:29 pfileunicom.ora
-rw-r-----   1 oracle   oinstall    4608 Dec  3 19:27 spfile.262.768832711
-rw-r-----   1 oracle   oinstall    4608 Dec  3 19:28 spfileunicom.ora
$ vi spfileunicom.ora
"spfileunicom.ora" [Incomplete last line] 60 lines, 4608 characters (2572 null) 
unicom1.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
*.audit_file_dest='/u01/app/oracle/admin/unicom/adump'
*.audit_trail='db'
*.cluster_database=true
*.compatible='11.2.0.0.0'
*.control_files='+DG01REDO/unicom/controlfile/current.256.768792603','+DG02REDO/unicom/controlfile/current.256.768792605'
*.db_block_size=32768
*.db_cache_size=10737418240
*.db_create_file_dest='+DG01DATA'
*.db_crC^AC"^D^A^D{Oeate_online_log_dest_1='+DG01REDO'
*.db_create_online_log_dest_2='+DG02REDO'
*.db_domain=''
*.db_files=4096
*.db_keep_cache_size=2147483648
*.db_name='unicom'
*.db_recovery_file_dest='+DG01REDO'
*.db_recovery_file_dest_size=5218762752
*.db_writer_processes=8
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=unicomXDB)'
*.hash_area_size=134217728
unicom2.instance_number=2
unicom1.instance_number=1
*.job_queue_processes=20
*.memory_max_target=47244640256
*.memoC^AC"^E^A^D^A8ry_target=47244640256
*.open_cursors=1000
*.parallel_force_local=TRUE
*.parallel_max_servers=94
*.parallel_min_servers=16
*.pga_aggregate_target=21474836480
*.processes=1000
*.remote_listener='rac-scan:1521'
:q!
$ ls
core                  hc_unicom2.dat        init.ora              initunicom2.ora       orapwunicom2          pfileunicom.ora       spfile.262.768832711  spfileunicom.ora
$ strings spfileunicom.ora > pfileunicom.ora
$ vi pfileunicom.ora
"pfileunicom.ora" 62 lines, 1949 characters 
unicom1.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
*.audit_file_dest='/u01/app/oracle/admin/unicom/adump'
*.audit_trail='db'
*.cluster_database=true
*.compatible='11.2.0.0.0'
*.control_files='+DG01REDO/unicom/controlfile/current.256.768792603','+DG02REDO/unicom/controlfile/current.256.768792605'
*.db_block_size=32768
*.db_cache_size=10737418240
*.db_create_file_dest='+DG01DATA'
*.db_create_online_log_dest_1='+DG01REDO'
*.db_create_online_log_dest_2='+DG02REDO'
*.db_domain=''
*.db_files=4096
*.db_keep_cache_size=1024000000
*.db_name='unicom'
*.db_recovery_file_dest='+DG01REDO'
*.db_recovery_file_dest_size=5218762752
*.db_writer_processes=8
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=unicomXDB)'
*.hash_area_size=134217728
unicom2.instance_number=2
unicom1.instance_number=1
*.job_queue_processes=20
*.memory_max_target=26843545600
*.memory_target=26843545600
*.open_cursors=1000
*.parallel_force_local=TRUE
*.parallel_max_servers=94
*.parallel_min_servers=16
*.processes=1000
*.remote_listener='rac-scan:1521'
*.remote_login_passwordfile='exclusive'
"pfileunicom.ora" 42 lines, 1345 characters 
$ pwd
/u01/app/oracle/product/11.2.0/db_1/dbs
$ sqlplus / a^C

$ ipcs
IPC status from <running system> as of Sat Dec  3 19:38:30 CST 2011
T         ID      KEY        MODE        OWNER    GROUP
Message Queues:
Shared Memory:
m          5   0x375dba58 --rw-rw----     grid oinstall
Semaphores:
s         15   0xe438b514 --ra-ra----   oracle asmadmin
s         11   0xedb374bc --ra-ra----     grid oinstall
$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.2.0 Production on Sat Dec 3 19:38:37 2011


Copyright (c) 1982, 2010, Oracle.  All rights reserved.


Connected to an idle instance.


SQL> startup mount pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/pfileunicom.ora';
ORACLE instance started.


Total System Global Area 2.6732E+10 bytes
Fixed Size                  2170944 bytes
Variable Size            9529466816 bytes
Database Buffers         1.7046E+10 bytes
Redo Buffers              154394624 bytes
Database mounted.
SQL>








--以上操作已经好了




### BEGIN LOG - DATE: 111203, TIME: 194542 ###




SQL> 
SQL> select name from v$asm_diskgroup;


NAME
------------------------------
DG01DATA
DG01REDO
DG02REDO
DGCRS


SQL> select na^C


SQL> 
SQL> 
SQL> 
SQL> create spfile='+DG01DATA' from pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/pfileunicom.ora';


File created.


SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
$ srvctl config database -d unicom
Database unique name: unicom
Database name: unicom
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DG01DATA/unicom/spfileunicom.ora
Domain: 
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: unicom
Database instances: unicom1,unicom2
Disk Groups: DG01DATA,DG01REDO,DG02REDO
Mount point paths: 
Services: dataclient,dataldr
Type: RAC
Database is administrator managed
$ id
uid=1101(oracle) gid=1000(oinstall)
$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.2.0 Production on Sat Dec 3 19:53:09 2011


Copyright (c) 1982, 2010, Oracle.  All rights reserved.




Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options


SQL> create spfile='+DG01DATA/unicom/spfileunicom.ora' pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/pfileunicom.ora';
create spfile='+DG01DATA/unicom/spfileunicom.ora' pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/pfileunicom.ora'
                                                  *
ERROR at line 1:
ORA-00923: FROM keyword not found where expected




SQL> create spfile='+DG01DATA/unicom/spfileunicom.ora' from pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/pfileunicom.ora';


File created.


SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
$ srvctl modify ^C

$ srvctl config database -d unicm
^C$ 


$ srvctl config database -d unicom
Database unique name: unicom
Database name: unicom
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DG01DATA/unicom/spfileunicom.ora
Domain: 
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: unicom
Database instances: unicom1,unicom2
Disk Groups: DG01DATA,DG01REDO,DG02REDO
Mount point paths: 
Services: dataclient,dataldr
Type: RAC
Database is administrator managed



$ exit
root@edsm02 # ^C
root@edsm02 # 
root@edsm02 # id
uid=0(root) gid=0(root)
root@edsm02 # su - oracle
Oracle Corporation      SunOS 5.10      Generic Patch   January 2005
export LOGNAME
export ORACLE_BASE
export ORACLE_HOME
export ORACLE_SID
export ORA_CRS_HOME
export PATH
$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.2.0 Production on Sat Dec 3 19:54:47 2011


Copyright (c) 1982, 2010, Oracle.  All rights reserved.




Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options


SQL> shutdown immediate
ORA-01109: database not open




Database dismounted.
ORACLE instance shut down.
SQL> startup




ORACLE instance started.


Total System Global Area 2.6732E+10 bytes
Fixed Size                  2170944 bytes
Variable Size            9730793408 bytes
Database Buffers         1.6844E+10 bytes
Redo Buffers              154394624 bytes
Database mounted.
Database opened.
SQL> SQL> SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
$ pwd
/export/home/oracle
$ ls
oradiag_oracle           phoenix_ln_20110609.log  script                   uphoenix_bk              uphoenixwy1103.dmp
phoenix_exp              phoenix_ln_20110609.sql  uphoenix0915z.dmp        uphoenixjc.dmp           ~
$ cd $ORACLE_HOME/dbs
$ ls
core                  hc_unicom2.dat        init.ora              initunicom2.ora       orapwunicom2          pfileunicom.ora       spfile.262.768832711  spfileunicom.ora
$ rm -^C

$ mv pfileunicom.ora pfileunicom.ora.bak
$ ls
core                  hc_unicom2.dat        init.ora              initunicom2.ora       orapwunicom2          pfileunicom.ora.bak   spfile.262.768832711  spfileunicom.ora
$ mv spfileunicom.ora spfileunicom.ora.bak
$ ls
core                  hc_unicom2.dat        init.ora              initunicom2.ora       orapwunicom2          pfileunicom.ora.bak   spfile.262.768832711  spfileunicom.ora.bak
$ rm spfile.262*
$ ls
core                  hc_unicom2.dat        init.ora              initunicom2.ora       orapwunicom2          pfileunicom.ora.bak   spfileunicom.ora.bak
$ ore^C

$ more initunicom2.ora
SPFILE='+DG01DATA/unicom/spfileunicom.ora'



这篇关于oracle无法启动,恢复spfile的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/486178

相关文章

oracle数据库索引失效的问题及解决

《oracle数据库索引失效的问题及解决》本文总结了在Oracle数据库中索引失效的一些常见场景,包括使用isnull、isnotnull、!=、、、函数处理、like前置%查询以及范围索引和等值索引... 目录oracle数据库索引失效问题场景环境索引失效情况及验证结论一结论二结论三结论四结论五总结ora

element-ui下拉输入框+resetFields无法回显的问题解决

《element-ui下拉输入框+resetFields无法回显的问题解决》本文主要介绍了在使用ElementUI的下拉输入框时,点击重置按钮后输入框无法回显数据的问题,具有一定的参考价值,感兴趣的... 目录描述原因问题重现解决方案方法一方法二总结描述第一次进入页面,不做任何操作,点击重置按钮,再进行下

Oracle Expdp按条件导出指定表数据的方法实例

《OracleExpdp按条件导出指定表数据的方法实例》:本文主要介绍Oracle的expdp数据泵方式导出特定机构和时间范围的数据,并通过parfile文件进行条件限制和配置,文中通过代码介绍... 目录1.场景描述 2.方案分析3.实验验证 3.1 parfile文件3.2 expdp命令导出4.总结

Java子线程无法获取Attributes的解决方法(最新推荐)

《Java子线程无法获取Attributes的解决方法(最新推荐)》在Java多线程编程中,子线程无法直接获取主线程设置的Attributes是一个常见问题,本文探讨了这一问题的原因,并提供了两种解决... 目录一、问题原因二、解决方案1. 直接传递数据2. 使用ThreadLocal(适用于线程独立数据)

bat脚本启动git bash窗口,并执行命令方式

《bat脚本启动gitbash窗口,并执行命令方式》本文介绍了如何在Windows服务器上使用cmd启动jar包时出现乱码的问题,并提供了解决方法——使用GitBash窗口启动并设置编码,通过编写s... 目录一、简介二、使用说明2.1 start.BAT脚本2.2 参数说明2.3 效果总结一、简介某些情

Oracle数据库执行计划的查看与分析技巧

《Oracle数据库执行计划的查看与分析技巧》在Oracle数据库中,执行计划能够帮助我们深入了解SQL语句在数据库内部的执行细节,进而优化查询性能、提升系统效率,执行计划是Oracle数据库优化器为... 目录一、什么是执行计划二、查看执行计划的方法(一)使用 EXPLAIN PLAN 命令(二)通过 S

使用@Slf4j注解,log.info()无法使用问题

《使用@Slf4j注解,log.info()无法使用问题》在使用Lombok的@Slf4j注解打印日志时遇到问题,通过降低Lombok版本(从1.18.x降至1.16.10)解决了问题... 目录@Slf4androidj注解,log.info()无法使用问题最后解决总结@Slf4j注解,log.info(

使用SecondaryNameNode恢复NameNode的数据

1)需求: NameNode进程挂了并且存储的数据也丢失了,如何恢复NameNode 此种方式恢复的数据可能存在小部分数据的丢失。 2)故障模拟 (1)kill -9 NameNode进程 [lytfly@hadoop102 current]$ kill -9 19886 (2)删除NameNode存储的数据(/opt/module/hadoop-3.1.4/data/tmp/dfs/na

MySQL数据库宕机,启动不起来,教你一招搞定!

作者介绍:老苏,10余年DBA工作运维经验,擅长Oracle、MySQL、PG、Mongodb数据库运维(如安装迁移,性能优化、故障应急处理等)公众号:老苏畅谈运维欢迎关注本人公众号,更多精彩与您分享。 MySQL数据库宕机,数据页损坏问题,启动不起来,该如何排查和解决,本文将为你说明具体的排查过程。 查看MySQL error日志 查看 MySQL error日志,排查哪个表(表空间

电脑桌面文件删除了怎么找回来?别急,快速恢复攻略在此

在日常使用电脑的过程中,我们经常会遇到这样的情况:一不小心,桌面上的某个重要文件被删除了。这时,大多数人可能会感到惊慌失措,不知所措。 其实,不必过于担心,因为有很多方法可以帮助我们找回被删除的桌面文件。下面,就让我们一起来了解一下这些恢复桌面文件的方法吧。 一、使用撤销操作 如果我们刚刚删除了桌面上的文件,并且还没有进行其他操作,那么可以尝试使用撤销操作来恢复文件。在键盘上同时按下“C