本文主要是介绍Oracle数据库:从alert log恢复spfile,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
今天做实验,改了几个系统参数,结果数据库无法启动,报错:
SQL> startup
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/opt/oracle/product/19c/dbhome_1/dbs/initORCLCDB.ora'
在$ORACLE_HOME/dbs
目录下找不到spfile,也找不到pfile。
但controlfile还在:
$ ls -l $ORACLE_BASE/oradata/ORCLCDB/*.ctl
-rw-r-----. 1 oracle oinstall 18759680 Feb 20 17:40 /opt/oracle/oradata/ORCLCDB/control01.ctl
-rw-r-----. 1 oracle oinstall 18759680 Feb 20 17:40 /opt/oracle/oradata/ORCLCDB/control02.ctl
controlfile在就比较好。因为数据文件的位置都在这里。
关于恢复的思路,参考了这篇文章:How to Recover From Lost or Missing Database Parameter Files (PFILE or SPFILE。
选择从alert log恢复spfile。alert log位置在$ORACLE_BASE/diag/rdbms/<sid>/<sid>/trace
:
$ cat /opt/oracle/diag/rdbms/orclcdb/ORCLCDB/trace/alert_ORCLCDB.log
...processes = 300sga_max_size = 2000Mnls_language = "AMERICAN"nls_territory = "AMERICA"filesystemio_options = "setall"resource_manager_plan = "low_prio_apps"_exadata_feature_on = TRUEsga_target = 1500Mcontrol_files = "/opt/oracle/oradata/ORCLCDB/control01.ctl"control_files = "/opt/oracle/oradata/ORCLCDB/control02.ctl"db_block_size = 8192compatible = "19.0.0"db_create_file_dest = "/opt/oracle/oradata"undo_tablespace = "UNDOTBS1"heat_map = "OFF"inmemory_size = 700Minmemory_automatic_level = "OFF"remote_login_passwordfile= "EXCLUSIVE"audit_sys_operations = FALSEdispatchers = "(PROTOCOL=TCP) (SERVICE=ORCLCDBXDB)"local_listener = "LISTENER_ORCLCDB"audit_file_dest = "/opt/oracle/admin/ORCLCDB/adump"commit_wait = "nowait"commit_logging = "batch"audit_trail = "NONE"db_name = "ORCLCDB"open_cursors = 300pga_aggregate_target = 384Mdiagnostic_dest = "/opt/oracle"enable_pluggable_database= TRUE
...
将以上部分存为文件/tmp/pfile。
然后:
$ sqlplus / as sysdba
SQL> create spfile from pfile='/tmp/pfile'
SQL> startup
或者:
$ sqlplus / as sysdba
SQL> startup pfile='/tmp/pfile'
SQL> create spfile from memory
这篇关于Oracle数据库:从alert log恢复spfile的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!