Oracle笔记
2010年9月10日 05:08
alter database backup controlfile to trace;
虽然曾经说过凡是“alter database”的都不能在数据库打开的情况下修改memory,但是这句语句似乎是例外。输入后,trace文件即生成在了$ORACLE_BASE/admin/<sid>/bdump下,可以通过时间(Linux命令: ll -t)去寻找这个文件,打开就可以找到控制文件的恢复SQL语句,似乎还有两个版本,一个NORESETLOGS版本和一次RESETLOGS版本。
/*NORESETLOGS版本*/
STARTUP NOMOUNT //这里没分号?大概startup语句就是不加分号的。
CREATE CONTROLFILE REUSE DATABASE "ORCL" NORESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 '/home/oracle/oracle/oradata/orcl/redo01.log' SIZE 50M,
GROUP 2 '/home/oracle/oracle/oradata/orcl/redo02.log' SIZE 50M,
GROUP 3 '/home/oracle/oracle/oradata/orcl/redo03.log' SIZE 50M
-- STANDBY LOGFILE
DATAFILE
'/home/oracle/oracle/oradata/orcl/system01.dbf',
'/home/oracle/oracle/oradata/orcl/undotbs01.dbf',
'/home/oracle/oracle/oradata/orcl/sysaux01.dbf',
'/home/oracle/oracle/oradata/orcl/users01.dbf',
'/home/oracle/oracle/oradata/orcl/example01.dbf'
CHARACTER SET WE8ISO8859P1
;
/*RESETLOGS版本*/
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 '/home/oracle/oracle/oradata/orcl/redo01.log' SIZE 50M,
GROUP 2 '/home/oracle/oracle/oradata/orcl/redo02.log' SIZE 50M,
GROUP 3 '/home/oracle/oracle/oradata/orcl/redo03.log' SIZE 50M
-- STANDBY LOGFILE
DATAFILE
'/home/oracle/oracle/oradata/orcl/system01.dbf',
'/home/oracle/oracle/oradata/orcl/undotbs01.dbf',
'/home/oracle/oracle/oradata/orcl/sysaux01.dbf',
'/home/oracle/oracle/oradata/orcl/users01.dbf',
'/home/oracle/oracle/oradata/orcl/example01.dbf'
CHARACTER SET WE8ISO8859P1
;