首页 > 数据库 > Oracle > Oracle控制文件相关的其他(五)
DBID的确定
控制文件的备份恢复中,我们经常需要DBID,如下为常用的查询方法:
方法1、在数据库mount或open状态下:
[oracle@dbserv ~]$ sqlplus / as sysdba
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select dbid,name from v$database;
DBID NAME
---------- ---------
2083742440 TEST
[@more@]方法2、在数据库mount或open状态下:
[oracle@dbserv ~]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Sat Jun 16 00:51:21 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: TEST (DBID=2083742440)
如果控制文件损坏,则如上两种方法是无法查到的,只能采取如下方式:
方法3、Oracle默认情况下,会在 $ORACLE_HOME/dbs/下生成控制文件自动备份和快照备份,在windows环境在 $ORACLE_HOME/database/目录下:
[oracle@dbserv ~]$ ls -lrt $ORACLE_HOME/dbs/
总用量 21592
-rw-r----- 1 oracle oinstall 8385 1998-09-11 init.ora
-rw-r----- 1 oracle oinstall 12920 2001-05-03 initdw.ora
-rw-r----- 1 oracle oinstall 1536 6月 10 13:06 orapwtest
-rw-rw---- 1 oracle oinstall 24 6月 10 13:06 lkTEST
-rw-rw---- 1 oracle oinstall 1544 6月 10 13:06 hc_test.dat
-rw-r----- 1 oracle oinstall 7143424 6月 10 16:42 c-2083742440-20120610-00
-rw-r--r-- 1 oracle oinstall 1827 6月 15 21:38 alert_test.log
-rw-r----- 1 oracle oinstall 2560 6月 15 21:38 spfiletest.ora
-rw-r----- 1 oracle oinstall 7389184 6月 15 21:38 snapcf_test.f
-rw-r----- 1 oracle oinstall 7471104 6月 15 21:38 c-2083742440-20120615-00
[oracle@xjtvpay ~]$
方法4、如果配置了rman备份,则查看过去Rman备份生成的日志文件内容….
方法5、BBED或oradebug等工具直接导出数据文件头块…
控制文件信息:
Displaying Control File Information
The following views display information about control files:
|
View |
Description |
|
V$DATABASE |
Displays database information from the control file |
|
V$CONTROLFILE |
Lists the names of control files |
|
V$CONTROLFILE_RECORD_SECTION |
Displays information about control file record sections |
|
V$PARAMETER |
Displays the names of control files as specified in the CONTROL_FILES initialization parameter |
This example lists the names of the control files.
SQL>
SELECT NAME FROM
V$CONTROLFILE;
NAME
-------------------------------------
/u01/oracle/prod/control01.ctl
/u02/oracle/prod/control02.ctl
/u03/oracle/prod/control03.ctl
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/18841027/viewspace-1058558/ ,如需转载,请注明出处,否则将追究法律责任。