--现象:
修改 SGA 参数 没有修改 sga_max_size 导致数据库启动失败;
SQL>alter system set sga_target=270G scope=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: 3
---没有备份参数文件!!!
--解决办法
1.从最近的一次启动数据库日志里面找到 对应的参数,手动编写参数 文件启动数据库
processes = 5000
sessions = 7552
sga_max_size = 270G
spfile = "+DATA/psdb/spfilepsdb.ora"
sga_target = 270G
control_files = "+DATA/psdb/controlfile/control01.ctl"
control_files = "+DATA/psdb/controlfile/control02.ctl"
control_files = "+DATA/psdb/controlfile/control03.ctl"
db_file_name_convert = "+DATA/psdg/DATAFILE"
db_file_name_convert = "+DATA/psdb/DATAFILE"
log_file_name_convert = "+DATA/psdg/ONLINELOG"
log_file_name_convert = "+DATA/psdb/ONLINELOG"
db_block_size = 8192
compatible = "11.2.0.4.0"
log_archive_dest_1 = "location=+ARCH valid_for=(all_logfiles,all_roles) db_unique_name=psdb"
log_archive_dest_2 = "service=psdg lgwr async NOAFFIRM valid_for=(online_logfiles,primary_role) db_unique_name=psdg"
fal_client = "psdb"
fal_server = "psdg"
log_archive_config = "dg_config=(psdb,psdg)"
log_archive_format = "psdb_%t_%s_%r.arc"
db_files = 4096
cluster_database = TRUE
db_create_file_dest = "+DATA"
standby_file_management = "AUTO"
_gc_undo_affinity = FALSE
_gc_policy_time = 0
thread = 2
undo_tablespace = "UNDOTBS2"
_undo_autotune = FALSE
undo_retention = 7200
instance_number = 2
recyclebin = "OFF"
remote_login_passwordfile= "EXCLUSIVE"
db_domain = ""
dispatchers = "(PROTOCOL=TCP) (SERVICE=psdbXDB)"
remote_listener = "scan-psdb:1521"
session_cached_cursors = 100
job_queue_processes = 1
result_cache_max_size = 0
audit_file_dest = "/u01/app/oracle/admin/psdb/adump"
audit_trail = "NONE"
db_name = "psdb"
open_cursors = 1000
_serial_direct_read = "NEVER"
pga_aggregate_target = 80G
deferred_segment_creation= FALSE
enable_ddl_logging = TRUE
diagnostic_dest = "/u01/app/oracle"
2.从其他库拷贝一份参数文件(由于是同时安装好几个新库。系统 内存等信息一致,所以可以直接使用),修改数据库相关参数,目录等;
*._gc_policy_time=0
*._gc_undo_affinity=FALSE
*._serial_direct_read='NEVER'
*._undo_autotune=FALSE
*.audit_file_dest='/u01/app/oracle/admin/asdb/adump'
*.audit_trail='NONE'
*.cluster_database=true
*.compatible='11.2.0.4.0'
*.control_files='+DATA/asdb/controlfile/control01.ctl','+DATA/asdb/controlfile/control02.ctl','+DATA/asdb/controlfile/control03.ctl'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_domain=''
*.db_file_name_convert='+DATA/asdg/DATAFILE','+DATA/asdb/DATAFILE'
*.db_files=4096
*.db_name='asdb'
*.deferred_segment_creation=FALSE
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=asdbXDB)'
*.enable_ddl_logging=TRUE
*.fal_client='asdb'
*.fal_server='asdg'
*.job_queue_processes=1
*.log_archive_config='dg_config=(asdb,asdg)'
*.log_archive_dest_1='location=+ARCH valid_for=(all_logfiles,all_roles) db_unique_name=asdb'
*.log_archive_dest_2='service=asdg lgwr async NOAFFIRM valid_for=(online_logfiles,primary_role) db_unique_name=asdg'
*.log_archive_format='asdb_%t_%s_%r.arc'
*.log_file_name_convert='+DATA/asdg/ONLINELOG','+DATA/asdb/ONLINELOG'
*.open_cursors=1000
*.pga_aggregate_target=85899345920
*.processes=5000
*.recyclebin='OFF'
*.remote_listener='scan-asdb:1521'
*.remote_login_passwordfile='exclusive'
*.result_cache_max_size=0
*.session_cached_cursors=100
*.sessions=7552
*.sga_max_size=270g
*.sga_target=332859965440
*.standby_file_management='AUTO'
*.undo_retention=7200
*.undo_tablespace='UNDOTBS1'
*.undo_tablespace='UNDOTBS2'
---按照新的参数文件启动数据库---次参数文件存放到 Oracle 指定目录下
$ORACLE_HOME/dbs/
命名方式 init.ORACLE_SID.ora
登陆该节点启动数据库
sqlplus / as sysdba
startup
-----数据库可以正常启动;
--目前数据库启动是按照 pfile 参数文件行;修改成 spfile
--根据当前 pfile 创建 spfile
create spfile='+DATA/posdb/spfilepsdb.ora' from pfile;
---修改 init 参数文件内容,让他根据 spfile 启动
[oracle@psdb1 dbs]$ cat initpsdb1.ora
SPFILE='+DATA/posdb/spfilepsdb.ora'
---至此数据库 正常启动!!!