通过alert日志重建参数文件

当spfile损坏,而且没有了pfile文件和init.ora文件,则我们不得不重建参数文件:
下面模拟参数文件损坏,删除了所有的参数文件:
SQL> startup nomount;
ORA-01078: failure in processing system parameters
LRM-00109: ???????????????????????? '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initorcl3939.ora'

下面通过alert日志创建了pfile:
SQL> startup nomount;
ORACLE 例程已经启动。
Total System Global Area  422670336 bytes
Fixed Size                  1336960 bytes
Variable Size             260049280 bytes
Database Buffers          155189248 bytes
Redo Buffers                6094848 bytes
SQL> create spfile from pfile;

文件已创建。


摘自alert:
processes                = 150
  memory_target            = 404M
  control_files            = "/u01/app/oracle/oradata/orcl3939/control01.ctl"
  control_files            = "/u01/app/oracle/flash_recovery_area/orcl3939/control02.ctl"
  control_files            = "/u01/app/oracle/oradata/orcl3939/control03.ctl"
  db_block_size            = 8192
  compatible               = "11.2.0.0.0"
  db_recovery_file_dest    = "/u01/app/oracle/flash_recovery_area"
  db_recovery_file_dest_size= 3852M
  undo_tablespace          = "UNDOTBS1"
  remote_login_passwordfile= "EXCLUSIVE"
  db_domain                = "localdomain"
  instance_name            = "ORCL3939"
  service_names            = "a,b,c,d"
  dispatchers              = "(PROTOCOL=TCP) (SERVICE=orcl3939XDB)"
  local_listener           = "(ADDRESS=(PROTOCOL=TCP)(HOST = localhost.localdomain)(PORT = 1521))"
  audit_file_dest          = "/u01/app/oracle/admin/orcl3939/adump"
  audit_trail              = "DB"
  db_name                  = "orcl3939"
  open_cursors             = 300
  diagnostic_dest          = "/u01/app/oracle"
  trace_enabled            = TRUE
所以当参数文件损坏,或者没有pfile,init.ora文件,不用太担心,alter日志里记录了数据库启动创建实例的信息,可以手工创建spfile,过程很简单吧!
下面给给大家做个很有意思的实验,紧紧用db_name创建了实例:
SQL> startup force nomount;
ORACLE 例程已经启动。
Total System Global Area  150667264 bytes
Fixed Size                  1335080 bytes
Variable Size              92274904 bytes
Database Buffers           50331648 bytes
Redo Buffers                6725632 bytes
下面摘自alert日志:
Starting up:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options.
Using parameter settings in server-side pfile /u01/app/oracle/product/11.2.0/dbhome_1/dbs/initorcl3939.ora
System parameters with non-default values:
  db_name                  = "orcl3939"
Thu May 07 22:13:34 2015
PMON started with pid=2, OS id=5411 
Thu May 07 22:13:34 2015
VKTM started with pid=3, OS id=5413 at elevated priority
VKTM running at (10)millisec precision with DBRM quantum (100)ms
Thu May 07 22:13:34 2015
GEN0 started with pid=4, OS id=5417 
Thu May 07 22:13:34 2015
DIAG started with pid=5, OS id=5419 
Thu May 07 22:13:34 2015
DBRM started with pid=6, OS id=5421 
Thu May 07 22:13:34 2015
PSP0 started with pid=7, OS id=5423 
Thu May 07 22:13:34 2015
DIA0 started with pid=8, OS id=5425 
......
......
所以我们由上知,在参数文件中,需要最少的参数就是db_name,数据库实例就可以启动了
虽然启动了实例,但是缺少一些参数,没有指定控制文件位置,所以mount状态出现了错误:
SQL> alter database mount;
alter database mount
*
第 1 行出现错误:
ORA-00205: ?????????, ??????, ???????


你可能感兴趣的:(通过alert日志重建参数文件)