ASM+RAC spfile 恢复 改名

ASMCMD> cd +DATA/CDB/PARAMETERFILE
ASMCMD> ls
spfile.290.1148481317
ASMCMD> rm -rf *
ASMCMD> ls

 srvctl config database -db 'cdb'   ''不用也可以
[oracle@rac1 dbs]$  srvctl modify database -db cdb  -spfile ''----注释掉
[oracle@rac1 dbs]$  srvctl modify database -db cdb  -spfile '+DATA/CDB/PARAMETERFILE/spfile';


srvctl config database -d cdb |grep Spfile

– srvctl修改使用最新的spfile
srvctl modify database -db cdb -spfile ‘+DATA_DG/xxooQBQA/PARAMETERFILE/spfile.1123.1134548913’ 

-----------

– 环境: ORACLE RAC Version 19.15.0.0.0 ASM
– 背景: 因为修改错了sga参数 导致sga_target的值过小, 数据库启动不了报错信息如下
– 重点: 本过程适用于spfile存放在ASM里面的创建, 如果存放在文件系统中,会简单很多,这里不列举

– srvctl start database -d xxooqbqa 启动报错
PRCR-1079 : Failed to start resource ora.xxooqbqa.db
CRS-5017: The resource action “ora.xxooqbqa.db start” encountered the following error:
ORA-01078: failure in processing system parameters
. For details refer to “(:CLSN00107:)” in “/oracle_grid/app/oracle/diag/crs/xxoo180085/crs/trace/crsd_oraagent_ot12c.trc”.

CRS-2674: Start of ‘ora.xxooqbqa.db’ on ‘xxoo180085’ failed
CRS-2632: There are no more servers to try to place resource ‘ora.xxooqbqa.db’ on that would satisfy its placement policy
CRS-5017: The resource action “ora.xxooqbqa.db start” encountered the following error:
ORA-01078: failure in processing system parameters
. For details refer to “(:CLSN00107:)” in “/oracle_grid/app/oracle/diag/crs/xxoo180086/crs/trace/crsd_oraagent_ot12c.trc”.

CRS-2674: Start of ‘ora.xxooqbqa.db’ on ‘xxoo180086’ failed

– sqlplus / as sysdba
SYS@xxooqbqa1> startup
ORA-00821: Specified value of sga_target 10240M is too small, needs to be at least 13600M
ORA-01078: failure in processing system parameters

– 因为spfile存放在ASM,数据库启动不了的情况下, 不能通过下面这种方式进行创建pfile
SYS@xxooqbqa1> create pfile=’/tmp/initfgzcdb.ora.220101’ from spfile;
create pfile=’/tmp/initfgzcdb.ora.220101’ from spfile
*
ERROR at line 1:
ORA-01565: error in identifying file ‘?=/dbs/spfile@.ora’
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7

– 查看使用的spfile
[oracle@xxoo180085 ~]$ srvctl config database -d xxooqbqa|grep Spfile
Spfile: +DATA_DG/xxooQBQA/PARAMETERFILE/spfile.1035.1134491161

– 

 

– 在oracle里面可以读取ASM磁盘里面的二进制文件spfile,将其转为文本格式的pfile
SYS@xxooqbqa1> create pfile=’/tmp/initxxooqbqa1.ora’ from spfile=’+DATA_DG/xxooQBQA/PARAMETERFILE/spfile.1035.1134491161’;

File created.

SYS@xxooqbqa1> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.15.0.0.0
xxoo180085:xxooqbqa1 >

– 修改文本格式的pfile里面的sga_target为20g,原来是10g
vi /tmp/initxxooqbqa1.ora
*.sga_target=20g

– 这是oracle里面看spfile的值还是空值
SYS@xxooqbqa1> show parameter spfile

NAME TYPE VALUE


spfile string
SYS@xxooqbqa1>
SYS@xxooqbqa1>

– 关闭数据库实例
SYS@xxooqbqa1> shutdown immediate
ORA-01507: database not mounted

ORACLE instance shut down.

– 通过修改后的pfile启动
SYS@xxooqbqa1> startup pfile=’/tmp/initxxooqbqa1.ora’ nomount;

– 因为ASM是自动管理的 不能直接在ASM里面指定spfile的文件名
SYS@xxooqbqa1> create spfile=’+DATA_DG/xxooQBQA/PARAMETERFILE/spfile.1036.1134491161’ from pfile=’/tmp/initxxooqbqa1.ora’;
create spfile=’+DATA_DG/xxooQBQA/PARAMETERFILE/spfile.1036.1134491161’ from pfile=’/tmp/initxxooqbqa1.ora’
*
ERROR at line 1:
ORA-17502: ksfdcre:4 Failed to create file +DATA_DG/xxooQBQA/PARAMETERFILE/spfile.1036.1134491161
ORA-15046: ASM file name ‘+DATA_DG/xxooQBQA/PARAMETERFILE/spfile.1036.1134491161’ is not in single-file creation form

– 直接通过pfile创建spfile
SYS@xxooqbqa1> create spfile from pfile=’/tmp/initxxooqbqa1.ora’;

---啥都不带 自动命名

File created.

– 这时候在oracle里面spfile还是为空
SYS@xxooqbqa1> show parameter pfile

NAME TYPE VALUE


spfile string

– srvctl查看配置信息里的spfile还是旧的spfile文件
[oracle@xxoo180085 ~]$ srvctl config database -d xxooqbqa|grep Spfile
Spfile: +DATA_DG/xxooQBQA/PARAMETERFILE/spfile.1035.1134491161

– 实际在ASM里面已将创建了新的spfile文件
[grid@xxoo180085 ~]$ asmcmd ls -l +DATA_DG/xxooQBQA/PARAMETERFILE/
Type Redund Striped Time Sys Name
PARAMETERFILE UNPROT COARSE APR 19 08:00:00 Y spfile.1035.1134491161
PARAMETERFILE UNPROT COARSE APR 19 08:00:00 Y spfile.1123.1134548913

– srvctl修改使用最新的spfile
srvctl modify database -db xxooqbqa -spfile ‘+DATA_DG/xxooQBQA/PARAMETERFILE/spfile.1123.1134548913’ – 指定最新的参数文件

– 确认最新的spfile文件
[oracle@xxoo180085 ~]$ srvctl config database -d xxooqbqa|grep Spfile
Spfile: +DATA_DG/xxooQBQA/PARAMETERFILE/spfile.1123.1134548913

– 停实例
SYS@xxooqbqa1> shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.

– srvctl 重启两个实例
srvctl start database xxooqbqa
xxoo180085:xxooqbqa1 > srvctl status database -d xxooqbqa
Instance xxooqbqa1 is running on node xxoo180085
Instance xxooqbqa2 is running on node xxoo180086

-----

 在Oracle中,有一个名叫DUMMY的假实例。

可以用作spfile恢复。

1、export ORACLE_SID=DUMMY

2、rman target /

3、RMAN>startup nomount;

4、使用srvctl工具查找spfile文化路径

      su - grid

      $srvctl config database -d orcl -a

5、su - oracle

      RMAN>restore spfile to '+ASMDATA/orcl/spfileorcl.ora'   from  '/rmanbak/spfile.bak';

6、恢复完成后,停止掉DUMMY实例

      RMAN>shutdown immediate;

      RMAN>quit

7、su - grid

       $srvctl start database -d orcl

8、正常启动,恢复完成。
 

[oracle@rac1 ~]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Sun Jun 2 16:04:01 2024
Version 19.20.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database (not started)

RMAN> restore spfile from '+DATA1/CDB/AUTOBACKUP/2024_06_02/s_1170604877.496.1170561677';

Starting restore at 02-JUN-24
using target database control file instead of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/02/2024 16:04:06
RMAN-12010: automatic channel allocation initialization failed
RMAN-06403: could not obtain a fully authorized session
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Additional information: 4476
Additional information: -996112533

RMAN> exit


[oracle@rac1 ~]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Sun Jun 2 16:04:32 2024
Version 19.20.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: CDB (DBID=2265125454)

RMAN> shutdown abort

using target database control file instead of recovery catalog
Oracle instance shut down

RMAN> startup nomount pfile=dummy;

connected to target database (not started)
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 06/02/2024 16:05:00
RMAN-04014: startup failed: ORA-01078: failure in processing system parameters
RMAN-04017: startup error description: LRM-00109: could not open parameter file 'dummy'

RMAN> set dbid 2265125454

executing command: SET DBID

RMAN> restore spfile from autobackup;

Starting restore at 02-JUN-24
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/02/2024 16:05:51
RMAN-12010: automatic channel allocation initialization failed
RMAN-06403: could not obtain a fully authorized session
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Additional information: 4476
Additional information: -996112533

RMAN> set dbid 2265125454

executing command: SET DBID

RMAN> set  CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '+DATA1/CDB/AUTOBACKUP/2024_06_02/s_1170604877.496.1170561677';

executing command: SET CONTROLFILE AUTOBACKUP FORMAT
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of set command at 06/02/2024 16:07:09
RMAN-06403: could not obtain a fully authorized session
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Additional information: 4476
Additional information: -996112533

RMAN> show all;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of show command at 06/02/2024 16:07:35
RMAN-06403: could not obtain a fully authorized session
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Additional information: 4476
Additional information: -996112533


[oracle@rac1 ~]$ export ORACLE_SID=DUMMY
[oracle@rac1 ~]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Sun Jun 2 16:09:33 2024
Version 19.20.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database (not started)

RMAN> startup nomount;

startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/19.0.0/db_1/dbs/initDUMMY.ora'

starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started

Total System Global Area    1073737776 bytes

Fixed Size                     8933424 bytes
Variable Size                276824064 bytes
Database Buffers             780140544 bytes
Redo Buffers                   7839744 bytes

RMAN>  restore spfile from autobackup;

Starting restore at 02-JUN-24
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=185 device type=DISK

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/02/2024 16:10:13
RMAN-06495: must explicitly specify DBID with SET DBID command

RMAN>  set dbid 2265125454

executing command: SET DBID

RMAN> exit


Recovery Manager complete.
[oracle@rac1 ~]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Sun Jun 2 16:10:27 2024
Version 19.20.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: DUMMY (not mounted)

RMAN>  restore spfile from '+DATA1/CDB/AUTOBACKUP/2024_06_02/s_1170604877.496.1170561677';

Starting restore at 02-JUN-24
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=162 device type=DISK

channel ORA_DISK_1: restoring spfile from AUTOBACKUP +DATA1/CDB/AUTOBACKUP/2024_06_02/s_1170604877.496.1170561677
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 02-JUN-24

RMAN> exit


Recovery Manager complete.
[oracle@rac1 ~]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Sun Jun 2 16:10:55 2024
Version 19.20.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: DUMMY (not mounted)

RMAN> set dbid 2265125454

executing command: SET DBID

RMAN> restore spfile from autobackup;

Starting restore at 02-JUN-24
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=185 device type=DISK

channel ORA_DISK_1: looking for AUTOBACKUP on day: 20240602
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20240601
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20240531
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20240530
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20240529
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20240528
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20240527
channel ORA_DISK_1: no AUTOBACKUP in 7 days found
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/02/2024 16:11:49
RMAN-06172: no AUTOBACKUP found or specified handle is not a valid copy or piece

RMAN> restore spfile from '+DATA1/CDB/AUTOBACKUP/2024_06_02/s_1170604877.496.1170561677';

Starting restore at 02-JUN-24
using channel ORA_DISK_1

channel ORA_DISK_1: restoring spfile from AUTOBACKUP +DATA1/CDB/AUTOBACKUP/2024_06_02/s_1170604877.496.1170561677
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 02-JUN-24

 

RMAN> show parameters spfile;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "identifier": expecting one of: "all, archivelog, auxiliary, auxname, backup, channel, compression, controlfile, datafile, db_unique_name, default, device, encryption, exclude, incremental, maxsetsize, retention, snapshot, "
RMAN-01008: the bad identifier was: parameters
RMAN-01007: at line 1 column 6 file: standard input

RMAN> restore spfile to '+DATA/CDB/PARAMETERFILE/spfile.290.1148481317'   from  '+DATA1/CDB/AUTOBACKUP/2024_06_02/s_1170604877.496.1170561677';

Starting restore at 02-JUN-24
using channel ORA_DISK_1

channel ORA_DISK_1: restoring spfile from AUTOBACKUP +DATA1/CDB/AUTOBACKUP/2024_06_02/s_1170604877.496.1170561677
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/02/2024 16:16:43
ORA-19870: error while restoring backup piece +DATA1/CDB/AUTOBACKUP/2024_06_02/s_1170604877.496.1170561677
ORA-32015: unable to restore SPFILE
ORA-17502: ksfdcre:4 Failed to create file +DATA/CDB/PARAMETERFILE/spfile.290.1148481317
ORA-15046: ASM file name '+DATA/CDB/PARAMETERFILE/spfile.290.1148481317' is not in single-file creation form

RMAN> restore spfile to '+DATA/CDB/PARAMETERFILE/'   from  '+DATA1/CDB/AUTOBACKUP/2024_06_02/s_1170604877.496.1170561677';

Starting restore at 02-JUN-24
using channel ORA_DISK_1

channel ORA_DISK_1: restoring spfile from AUTOBACKUP +DATA1/CDB/AUTOBACKUP/2024_06_02/s_1170604877.496.1170561677
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 02-JUN-24

 

 

 

RMAN> restore spfile to '+DATA/CDB/PARAMETERFILE/spfile'   from  '+DATA1/CDB/AUTOBACKUP/2024_06_02/s_1170604877.496.1170561677';

Starting restore at 02-JUN-24
using channel ORA_DISK_1

channel ORA_DISK_1: restoring spfile from AUTOBACKUP +DATA1/CDB/AUTOBACKUP/2024_06_02/s_1170604877.496.1170561677
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/02/2024 16:24:34
ORA-19870: error while restoring backup piece +DATA1/CDB/AUTOBACKUP/2024_06_02/s_1170604877.496.1170561677
ORA-32015: unable to restore SPFILE
ORA-17502: ksfdcre:4 Failed to create file +DATA/CDB/PARAMETERFILE/spfile
ORA-15129: entry 'PARAMETERFILE' does not refer to a valid directory

 ---手动创建folder

RMAN> restore spfile to '+DATA/CDB/PARAMETERFILE/spfile'   from  '+DATA1/CDB/AUTOBACKUP/2024_06_02/s_1170604877.496.1170561677';

Starting restore at 02-JUN-24
using channel ORA_DISK_1

channel ORA_DISK_1: restoring spfile from AUTOBACKUP +DATA1/CDB/AUTOBACKUP/2024_06_02/s_1170604877.496.1170561677
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 02-JUN-24

RMAN> exit


Recovery Manager complete.
[oracle@rac1 ~]$ s

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Jun 2 16:26:30 2024
Version 19.20.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.20.0.0.0

SQL> startup force;
ORA-39511: Start of CRS resource for instance '223' failed with error:[CRS-5702: Resource 'ora.cdb.db' is already running on 'rac1'
CRS-0223: Resource 'ora.cdb.db' has placement error.
clsr_start_resource:260 status:223
clsrapi_start_db:start_asmdbs status:223
]
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.20.0.0.0
[oracle@rac1 ~]$ ps -ef|grep pmon
grid      6394     1  0 15:50 ?        00:00:00 asm_pmon_+ASM1
oracle    8992     1  0 16:09 ?        00:00:00 ora_pmon_cdb1
oracle   11324 11928  0 16:27 pts/0    00:00:00 grep --color=auto pmon
[oracle@rac1 ~]$ kill -9 8992
[oracle@rac1 ~]$ ps -ef|grep cdb1
oracle   11495     1 22 16:27 ?        00:00:00 oraclecdb1 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle   11512 11928  0 16:27 pts/0    00:00:00 grep --color=auto cdb1
[oracle@rac1 ~]$ srvctl stop database -d cdb
PRCC-1016 : cdb was already stopped
[oracle@rac1 ~]$ srvctl start database -d cdb
PRCC-1014 : cdb was already running
PRCR-1004 : Resource ora.cdb.db is already running
PRCR-1079 : Failed to start resource ora.cdb.db
CRS-2528: Unable to place an instance of 'ora.cdb.db' as all possible servers are occupied by the resource
[oracle@rac1 ~]$ exit
logout
[root@rac1 ~]# reboot

-----名字不好,自动命名来

ASMCMD> cd PARAMETERFILE
ASMCMD> ls
spfile
ASMCMD> ls -ltr
WARNING: option 'r' is deprecated for 'ls'
please use 'reverse'

Type           Redund  Striped  Time             Sys  Name
PARAMETERFILE  UNPROT  COARSE   JUN 02 04:00:00  N    spfile => +DATA/DUMMY/PARAMETERFILE/spfile.290.1170563129
ASMCMD> cd  +DATA/DUMMY
ASMCMD> ls
PARAMETERFILE/
ASMCMD> cd ..
ASMCMD> ls
ASM/
CDB/
DUMMY/
orapwasm
orapwasm_backup
rac-cluster/
ASMCMD> 

RMAN> create pfile='/tmp/pfile.ora' from spfile;

Statement processed

 

RMAN> create spfile from pfile='/tmp/pfile.ora';

Statement processed

RMAN> 

DUMMY/
orapwasm
orapwasm_backup
rac-cluster/
ASMCMD> ls -ltr
WARNING: option 'r' is deprecated for 'ls'
please use 'reverse'

Type           Redund  Striped  Time             Sys  Name
                                                 Y    ASM/
                                                 N    CDB/
                                                 Y    DUMMY/
                                                 Y    rac-cluster/
PASSWORD       UNPROT  COARSE   APR 23 2022      N    orapwasm => +DATA/ASM/PASSWORD/pwdasm.256.1102776155
PASSWORD       UNPROT  COARSE   APR 23 2022      N    orapwasm_backup => +DATA/ASM/PASSWORD/pwdasm.257.1102776607
PARAMETERFILE  UNPROT  COARSE   JUN 02 09:00:00  N    spfilecdb1.ora => +DATA/CDB/PARAMETERFILE/spfile.264.1170582229
ASMCMD>

---dummy 没有了

ASMCMD> rm spfile

ASMCMD> cd  +DATA/DUMMY
ASMCMD-8002: entry 'DUMMY' does not exist in directory '+DATA/'
ASMCMD> 


ASMCMD> pwd
+DATA/cdb/PARAMETERFILE
ASMCMD> ls -ltr
WARNING: option 'r' is deprecated for 'ls'
please use 'reverse'

Type           Redund  Striped  Time             Sys  Name
PARAMETERFILE  UNPROT  COARSE   JUN 02 09:00:00  Y    spfile.264.1170582229
ASMCMD> ls
spfile.264.1170582229
ASMCMD> 

 ------grid下为什么可以重启db 小心

 
[grid@rac1 ~]$ srvctl stop database -d cdb
[grid@rac1 ~]$ srvctl start database -d cdb
[grid@rac1 ~]$ srvctl config database -d cdb |grep Spfile
Spfile: +DATA/CDB/PARAMETERFILE/spfile
[grid@rac1 ~]$ asmcmd
 
ASMCMD> ls +DATA/CDB/PARAMETERFILE/spfile----没有了啊
ASMCMD-8002: entry 'spfile' does not exist in directory '+DATA/CDB/PARAMETERFILE/'
ASMCMD> exit
[grid@rac1 ~]$ srvctl stop database -d cdb
[grid@rac1 ~]$ ps -ef|grep pmon
grid      6379     1  0 16:32 ?        00:00:01 asm_pmon_+ASM1
grid     13079  4445  0 21:51 pts/1    00:00:00 grep --color=auto pmon

[root@rac1 ~]# reboot 看看

SQL> show parameters spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/19.0.0
                                                 /db_1/dbs/spfilecdb1.ora
SQL> 

ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/19.0.0/db_1/dbs/initcdb3.ora'
SQL> 

[oracle@rac1 ~]$ s

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Jun 2 21:58:49 2024
Version 19.20.0.0.0

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 1048573744 bytes
Fixed Size                  9172784 bytes
Variable Size             620756992 bytes
Database Buffers          411041792 bytes
Redo Buffers                7602176 bytes
Database mounted.
Database opened.
SQL> show parameters spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/19.0.0
                                                 /db_1/dbs/spfilecdb1.ora

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.20.0.0.0
[oracle@rac1 ~]$ srvctl config database -d cdb |grep Spfile
Spfile: +DATA/CDB/PARAMETERFILE/spfile
[oracle@rac1 ~]$ srvctl modify database -db cdb -spfile '+data/cdb/PARAMETERFILE/spfile.264.1170582229';
[oracle@rac1 ~]$ s

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Jun 2 22:01:50 2024
Version 19.20.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.20.0.0.0

SQL> startup force;

 NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +DATA/cdb/PARAMETERFILE/spfile
                                                 .264.1170582229

[oracle@rac1 ~]$ srvctl stop database -d cdb
[oracle@rac1 ~]$ srvctl start  database -d cdb

---------------------

GOAL

 This documents explains the steps required to recover when the parameter files are lost. 

SOLUTION

 The parameter files are read at instance startup time to get instance specific characteristics. Refer Pfile vs SPfile (Doc ID 249664.1)

Following are the various scenarios of recovering from the lost parameter file

SPFILE is lost but the pfile is present.

Rename bad or corrupted spfile from the original location. Then shutdown and restart your database with pfile (init.ora)

SQL> STARTUP PFILE='location/init<SID>.ora‎';

Then finally create spfile from this pfile. The below command will automatically create spfile with its original name.

SQL> Create spfile from pfile='location/init<SID>.ora‎';

Both spfile as well as pfile is lost or corrupted and your database is up.

Parameter files are read while starting up the instance. Hence losing parameter files when the database is up and running wont have huge impact (till next shutdown).

Query V$parameter for the non default parameters

SQL> select name,value from v$parameter where ISDEFAULT=’FALSE’ order by name;

Create pfile with these parameters.

SQL> Create spfile from pfile='location/init<SID>.ora‎';

Restart the database with this newly created spfile.

From 11g, you can directly create the pfile or spfile using the FROM MEMORY clause.

CREATE PFILE [= 'pfile_name' ] FROM { { SPFILE [= 'spfile_name'] } | MEMORY } ;

CREATE SPFILE [= 'spfile_name' ] FROM { { PFILE [= 'pfile_name' ] } | MEMORY } ;

Example:

SQL>create pfile='$ORACLE_HOME/dbs/initdb11g.txt' from memory;

File created.

Refer: Easier Recovery from Loss of SPFILE, 11g new feature (Doc ID 464781.1)

Both spfile as well as pfile is lost or corrupted and your database is down.

In that case you have remaining option to create new pfile using the non-default parameters recorded in the the alert.log file. You can find this in the previous successful startup entries.

You can then start the database using this pfile (init.ora)

SQL> STARTUP PFILE='location/init<SID>.ora‎';

Then finally create spfile from this pfile. The below command will automatically create spfile with its original name.

SQL> Create spfile from pfile='location/init<SID>.ora‎';


IF RMAN autobackup is configured in any of the above situations, you can restore the same.

RMAN> RESTORE SPFILE FROM AUTOBACKUP;

--------------------------------

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/846595.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

YOLOX源码之 wait_for_the_master

主进程读取数据 在函数 get_data_loader 中&#xff0c;下面这段代码的作用是在多节点分布式训练时&#xff0c;每个节点的主进程负责读取数据。 if self.dataset is None:with wait_for_the_master():assert cache_img is None, \"cache_img must be None if you didnt…

Python | A + B问题|||

if语句&#xff1a;if、elif、else 关系运算符 逻辑运算符&#xff1a;and&#xff08;&&&#xff09;、or&#xff08;||&#xff09;、not&#xff08;&#xff01;&#xff09; break退出循环 continue&#xff1a;只能出现在for、while循环内部&#xff0c;用法…

图解大模型分布式并行各种通信原语

背景 在分布式集群上执行大模型任务时候&#xff0c;往往使用到数据并行&#xff0c;流水线并行&#xff0c;张量并行等技术&#xff0c;这些技术本质上也就是对数据进行各种方案的切分&#xff0c;然后放到不同的节点上运算。不同节点在计算的过程中需要对数据分发或者同步等…

【精读文献】J. Environ. Manage.|青藏高原生态恢复项目下植被覆盖动态及其对生态系统服务的约束效应

目录 文章简介 01 文章摘要 02 研究背景、目标及创新点 2.1 研究背景 2.2 研究现状 03 研究区域与数据集 3.1 研究区域 3.2 研究数据 04 研究方法 4.1 趋势分析 4.2 残差趋势分析 4.3 偏相关 4.4 生态系统服务评价 4.5 约束线的定义和提取 05 研究结果 5.1 植被…

秒杀基本功能开发(不考虑高并发情况)

文章目录 1.显示秒杀状态1.controller修改GoodsController.java的toDetail方法&#xff0c;响应秒杀状态和秒杀剩余时间 2.前端1.goodsDetail.html 图片下面添加一行秒杀开始时间2.goodsDetail.html 添加计时器js代码 3.测试1.秒杀进行中2.修改db的秒杀开始时间为明天3.出现秒杀…

<Rust><iced>基于rust使用iced库构建GUI实例:动态改变主题色

前言 本专栏是Rust实例应用。 环境配置 平台&#xff1a;windows 软件&#xff1a;vscode 语言&#xff1a;rust 库&#xff1a;iced、iced_aw 概述 本篇构建了这样的一个实例&#xff0c;可以动态修改UI的主题&#xff0c;通过菜单栏来选择预设的自定义主题和官方主题&#…

python列表的扩展操作

列表的扩展操作 zip() 函数 我们先学习 zip() 函数&#xff0c;将排名与分数挂钩。 还记得期中考试的顺序排名和分数吗&#xff1f;我们把排名放在了列表 midterm_rank 中&#xff0c;把分数放在了 scores 中。不过当时 scores 并没有排序&#xff0c;我们要对数据进行预处理…

深入理解文件系统和日志分析

文件是存储在硬盘上的&#xff0c;硬盘上的最小存储单位是扇区&#xff0c;每个扇区的大小是512字节。 inode&#xff1a;存储元信息&#xff08;包括文件的属性&#xff0c;权限&#xff0c;创建者&#xff0c;创建日期等等&#xff09; block&#xff1a;块&#xff0c;连续…

小白跟做江科大32单片机之LED闪烁

原理介绍 原理介绍详见&#xff1a; 【STM32】江科大STM32学习笔记汇总(已完结)_stm32江科大笔记-CSDN博客https://blog.csdn.net/u010249597/article/details/134762513 项目准备 1.在项目文件夹中新建3-1 LED文件夹 2.keil新建项目&#xff0c;打开新建的3-1 LED&#xf…

ros2 launch 用法以及一些基础功能函数的示例

文章目录 launch启动一个节点的launch示例launch文件中添加节点的namespacelaunch文件中的话题名称映射launch文件中向节点内传入命令行参数launch文件中向节点内传入rosparam使用方法多节点启动命令行参数配置资源重映射ROS参数设置加载参数文件在launch文件中使用条件变量act…

【CC2530-操作外部flash】

zigbee cc2530操作flash&#xff0c;以cc2530读flash_id为例子&#xff1b; void InitIO() {CLKCONCMD & ~0x40; //设置系统时钟源为32MHZ晶振 while(CLKCONSTA & 0x40); //等待晶振稳定为32M CLKCONCMD & ~0x47; //设置系统主时钟频率为32MHZ…

Python知识点20---池

提前说一点&#xff1a;如果你是专注于Python开发&#xff0c;那么本系列知识点只是带你入个门再详细的开发点就要去看其他资料了&#xff0c;而如果你和作者一样只是操作其他技术的Python API那就足够了。 如果看了我发的线程和进程的知识点的朋友&#xff0c;如果发散思维能…

面试(五)

目录 1. 知道大顶堆小顶端吗&#xff0c;代码怎么区分大顶端小顶端 2. 计算机中栈地址与内存地址增长方向相反吗&#xff1f; 3. %p和%d输出指针地址 4. 为什么定义第二个变量时候&#xff0c;地址反而减了 5. 12&#xff0c;32&#xff0c;64位中数据的占字节&#xff1f;…

物质的量质量,它们可不是一个概念

物质的量&质量&#xff0c;它们可不是一个概念。 物质的量&质量 乍一听物质的量&#xff0c;还以为是和质量有什么关系&#xff0c;是不是&#xff1f;其实物质的量和质量没什么直接的联系。 物质的量是国际单位制中7个基本物理量之一&#xff0c;其符号为n&#xf…

Aras Innovator-Team(群组)的使用方法

当Aras Innovator在处理权限时&#xff0c;在不使用Team的情况下&#xff0c;系统的权限配置可以满足大部分业务场景&#xff0c;如&#xff1a;常见的按照组织架构&#xff0c;成员和角色分配权限&#xff0c;按照生命周期分配权限等。 如果遇到比较复杂的权限需求&#xff0c…

AltiumDesigner/AD添加数据库连接

1.首先确保本机电脑有无对应的数据库驱动&#xff0c;例如我这边要添加MySQL的数据&#xff0c;则需要首先下载MySQL数据驱动&#xff1a;MySQL :: Download MySQL Connector/ODBC (Archived Versions) 2.运行“odbcad32.exe”&#xff0c;如下图添加对应的数据库配置&#xf…

SpringMVC:向三大域对象存数据

1. 简介 Servlet中的三个域对象 请求域&#xff1a;request会话域&#xff1a;session应用域&#xff1a;application 主要是通过&#xff1a;setAttribute getAttribute方法来完成在域中数据的传递和共享。 点击跳转Servlet详细概念 // 向域中存储数据 void setAttribute(St…

智能sql LLM

DB-GPT&#xff1a;彻底改变数据库与私有LLM技术的交互 智能SQL生成&#xff1a;后端技术与LLM的完美结合 智能SQL生成&#xff1a;后端技术与LLM的完美结合_llm sql-CSDN博客 GitHub - eosphoros-ai/DB-GPT: AI Native Data App Development framework with AWEL(Agentic Wor…

【C/C++】C/C++车辆交通违章管理系统(源码+数据文件)【独一无二】

&#x1f449;博__主&#x1f448;&#xff1a;米码收割机 &#x1f449;技__能&#x1f448;&#xff1a;C/Python语言 &#x1f449;公众号&#x1f448;&#xff1a;测试开发自动化【获取源码商业合作】 &#x1f449;荣__誉&#x1f448;&#xff1a;阿里云博客专家博主、5…

golang字符串实用函数库go-str-utils 之字符串命名转换 大小驼峰, snake, kebab命名转换

在go语言的开发中&#xff0c;字符串的处理是最为频繁的&#xff0c; 今天给大家介绍的这个 go-str-utils 专门的字符串处理实用函数库中的 字符串命名转换 大小驼峰&#xff0c; snake, kebab命名转换。 各种命名转换规则和示例 CamelStr 大驼峰 单词全部首字母大写 如: User…