㈠ 备份
控制文件的备份和恢复在数据库的备份恢复过程中十分关键
原则是:
在数据库物理结构发生变化后备份控制文件
方法有:
① 通过操作系统命令在数据库关闭时对控制文件进行COPY
一般用于全库一致性恢复
② 利用ALTER DATABASE BACKUP CONTROLFILE TO命令将控制文件备份到二进制文件
Oracle推荐使用这种方式来备份控制文件、这也是最简单的方式、比如:
ALTER DATABASE BACKUP CONTROLFILE TO '/home/oracle/control01.bak';
③ 利用ALTER DATABASE BACKUP CONTROLFILE TO TRACE命令将重建控制文件备份的脚本备份到后台trace文件中
这种方式备份控制文件会丢失归档日志历史等许多信息
㈡ 转储
控制文件的备份和恢复在数据库的备份恢复过程中十分关键
原则是:
在数据库物理结构发生变化后备份控制文件
方法有:
① 通过操作系统命令在数据库关闭时对控制文件进行COPY
一般用于全库一致性恢复
② 利用ALTER DATABASE BACKUP CONTROLFILE TO命令将控制文件备份到二进制文件
Oracle推荐使用这种方式来备份控制文件、这也是最简单的方式、比如:
ALTER DATABASE BACKUP CONTROLFILE TO '/home/oracle/control01.bak';
③ 利用ALTER DATABASE BACKUP CONTROLFILE TO TRACE命令将重建控制文件备份的脚本备份到后台trace文件中
这种方式备份控制文件会丢失归档日志历史等许多信息
在重建控制文件时,只读表空间和脱机的数据文件的处理相对比较复杂
比如,OCP_043有道题目:
3. One of the tablespace is read-only in your database. The loss of all
control file forced you to recreate the control file. Which operation do
you need to perform after re-creating the control file and opening the
database?
A. Drop and re-create the read-only tablespaces
B. Rename the read-only data file to their correct file names.
C. Change the tablespace status from read/write to read-only.
D. Re-create the read-only tablespace because it is automatically removed.
Answer: B
㈡ 转储
oradebug必须以SYSDBA形式登陆后方能使用,可参看:oradebug使用介绍
idle> conn / as sysdba
Connected.
sys@ORCL> oradebug setmypid
Statement processed.
sys@ORCL> oradebug dump controlf 3;
Statement processed.
sys@ORCL> oradebug tracefile_name;
/u01/app/oracle/admin/orcl/udump/orcl_ora_7489.trc
㈢ OCP考题
4. You backed up the control file to trace. Which statement is true about the trace file generated?
A. The trace file is in binary format.
B. The trace file has a SQL scripts to re-create the control file.
C. The trace file is a backup set created during the backup of the control file.
D. The trace file contains the instructions to manually re-create the control file.
E. The trace file is an image copy of the control file created during the backup of
the the control file.
answer: B