How to get the database DBID

2010-12-20  来源:本站原创  分类:Database  人气:98 

DBID role:

1 When the lost control file, used to automatically recover data DBID.

RMAN> restore controlfile from autobackup;

Restore the 15-2 start on -08

Using channel ORA_DISK_1

RMAN-00571: ============================================== =============

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ============================================== =============

RMAN-03002: failure of restore command at 02/15/2008 00:43:38

RMAN-06495: must explicitly specify DBID with SET DBID command

2 to rman restore, or sometimes the DBID.

3 oracle automatic control file is also used to do file name DBID

4 DBID exist in the data file and control file

During the database recovery process, many times we need to know the Oracle database, DBID, usually there are several ways to access the database DBID.

1. Query v $ database access

The DBID in the control file and data files exist in the record, so if you can mount the database to query v $ database view can be obtained.

SQL> alter database mount;

Database altered.

SQL> select dbid from v $ database;

DBID
----------
3152029224

2. In nomount state

If the database configuration of the automatic control file backup (Oracle9i), and the name is the default, then we can get from the automatic backup file DBID.

[Oracle @ jumper dbs] $ cd $ ORACLE_HOME / dbs
[Oracle @ jumper dbs] $ ll c-*
-Rw-r ----- 1 oracle dba 3375104 Dec 21 11:13 c-3152029224-20051221-00
-Rw-r ----- 1 oracle dba 3358720 Jan 21 14:03 c-3152029224-20060121-00
-Rw-r ----- 1 oracle dba 3358720 Jan 21 14:08 c-3152029224-20060121-01

Where 3152029224 is the DBID. In 10g, use the Flash Recovery Area, you do not have this naming convention.

3. To recover from automatic backups

Need or lack of DBID to recover is usually because all the control files missing. Encounter an error in the recovery.

[Oracle @ jumper dbs] $ rman target /

Recovery Manager: Release 9.2.0.4.0 - Production

Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.

connected to target database: conner (not mounted)

RMAN> restore controlfile from autobackup;

Starting restore at 05-FEB-06

using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid = 11 devtype = DISK
RMAN-00571: ============================================== =============
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ============================================== =============
RMAN-03002: failure of restore command at 02/05/2006 20:47:25
RMAN-06495: must explicitly specify DBID with SET DBID command

If there are automatically backed up, we usually can restore the control file, mount the database after the easier to handle:

RMAN> restore controlfile from '/ opt/oracle/product/9.2.0/dbs/c-3152029224-20051221-00';

Starting restore at 05-FEB-06

using channel ORA_DISK_1
channel ORA_DISK_1: restoring controlfile
channel ORA_DISK_1: restore complete
replicating controlfile
input filename = / opt/oracle/oradata/conner/control01.ctl
output filename = / opt/oracle/oradata/conner/control02.ctl
output filename = / opt/oracle/oradata/conner/control03.ctl
Finished restore at 05-FEB-06

4. Directly read from the surviving documents

As exists in the data file DBID and control file, so we can PL / SQL program to read directly from the file:

SQL> select eygle.get_dbid ('/ opt / oracle / oradata / conner', 'user02.dbf') from dual;

EYGLE.GET_DBID ('/ OPT / ORACLE / OR
------------------------------
3152029224

SQL> select dbid from v $ database;

DBID
----------
3152029224

In fact, more simple, like the use of BBED

相关文章
  • How to get the database DBID 2010-12-20

    DBID role: 1 When the lost control file, used to automatically recover data DBID. RMAN> restore controlfile from autobackup; Restore the 15-2 start on -08 Using channel ORA_DISK_1 RMAN-00571: ============================================== ===========

  • How to get database DBID 2010-12-20

    DBID role: 1 When the lost control file, automatically recover data when used DBID. RMAN> restore controlfile from autobackup; Starting restore at 15-2 months -08 Using channel ORA_DISK_1 RMAN-00571: ============================================== ===

  • Misoperation caused by a large Oracle database recovery 2010-03-10

    The story goes from the building in the Oracle 10g database scripts manually to see dbms_backup_restore.zerodbid (0) process, in which role is to modify the database dbid. So think through the store in the implementation of the changes directly in sq

  • Remember a large storage block corrupt database recovery led to 2010-04-04

    A few days ago in vmware installed a Oracle 10g + rac + asm, see http://itspace.javaeye.com/blog/631585. Stop mcrac1 node vip, note marked red font will also mcrac1 node asm instance stopped. Quote [Oracle @ mcrac1 dbs] $ crs_stop ora.mcrac1.vip-f At

  • Oracle Database Backup and Recovery Summary -exp/imp (Export and Import Bank and unloading equipment library) 2010-04-20

    sqlldr userid = B / A @ D control = result.ctl log = resulthis.out rows = 10000 bindsize = 8192000 1.1 Basic commands 1. Get Help $ Exp help = y $ Imp help = y 2. 3 kinds of work (1) Interactive $ Exp / / and then press the prompt for the required pa

  • Offers four database transaction isolation level 2011-01-14

    sql server locking mechanism Locks of the two classification methods. (1) From the perspective of the database system is divided into the following three types of locks: Exclusive lock (Exclusive Lock) Exclusive locks lock the resources operate only

  • Oracle Database: archive mode (archivelog) and non-archive mode (noarchivelog) 2011-01-17

    Oracle database can run in two modes: archive mode (archivelog) and non-archive mode (noarchivelog) The difference between archiving and non-archive Please refer to ORACLE documentation. Recycling database LOG file, if the database is in "non-archive

  • 1.Oracle database structure 2011-04-09

    First, the basic terminology 1. Distinguish between the database instance (instance) and database (database) Database instance: ORACLE instance = process + process used by the memory (SGA), said the state of the database at the time! System Global Ar

  • Duplicate to create a local database 2011-10-08

    RMAN Duplicate is an integral part of, the use of Duplicate copy of a database is quite simple, Duplicate target database can not affect the case, relying on the target database backup copy of a database or set of common standby database, (11g of Dup

  • oracle中如何获得数据库的DBID信息 2014-03-18

    在进行数据库恢复的过程中,很多时候我们需要知道Oracle数据库的DBID,通常有以下几种方法可以获得数据库的DBID 1.查询v$database获得 由于DBID在控制文件和数据文件中都存在记录,所以如果能够mount数据库就可以查询v$database视图获得. SQL> alter database mount; Database altered. SQL> select dbid from v$database; DBID ---------- 3152029224 2.在nomou

  • rman oracle spfile restore lost files 2010-05-06

    1, into the rman: rman target / a, RMAN> restore spfile from autobacku / / backup path is the default can use this. CONFIGURE CONTROLFILE AUTOBACKUP ON is will controlfile and spfile auto backup to reduce the default flash recovery area b, RMAN> res

  • sql server system tables detail 2010-06-23

    sysaltfiles master database file stored database syscharsets primary database character set and sort order sysconfigures the main database configuration options syscurconfigs primary database the current configuration options sysdatabases primary dat

  • RMAN Backup format in% of the meaning FORMAT 2010-12-16

    In the configuration of Oracle 9i with RMAN> show all; RMAN configuration parameters can be displayed as: CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default CONFIGURE BACKUP OPTIMIZATION OFF; # default CONFIGURE DEFAULT DEVICE TYPE TO DISK; # defa

  • SQL Server data dictionary 2011-07-29

    sysaltfiles main database to save the database file syscharsets main database character set and sort order sysconfigures main database configuration options syscurconfigs primary database the current configuration options sysdatabases primary databas

  • RMAN backup FORMAT format% meaning 2010-12-16

    In the configuration of Oracle 9i, use RMAN> show all; RMAN configuration parameters can be displayed as: CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default CONFIGURE BACKUP OPTIMIZATION OFF; # default CONFIGURE DEFAULT DEVICE TYPE TO DISK; # defa

  • Oracle's startup process 2011-01-24

    oracle startup process of four stages: shutdown → nomount → mount → open 1.shutdown → nomount process: The initial parameter file reading Physical memory allocation Start the background process Navigate to the control file Open / write alert file nom

  • ORACLE - little by little learn RMAN backup 3 2011-03-01

    RMAN backup batch command. Backup using run {}, braces inside RMAN backup command. FORMAT format string Use the FORMAT parameter can be replaced with a variety of variables, as follows (case sensitive) below: % A: Oracle Database activation ID that R

  • Oracle ADDM automatic diagnostic monitoring tool introduced 2011-04-14

    Oracle AWR Introduction (AWR - Automatic Workload Repository) http://blog.csdn.net/tianlesoftware/archive/2009/10/17/4682300.aspx One. ADDM Overview ADDM (Automatic Database Diagnostic Monitor) is a self-implantation diagnosis Oracle database engine.

  • RMAN uses the Detailed 2011-04-28

    In Oracle 10g, the configuration using the RMAN> show all; RMAN configuration parameters can be displayed as: CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default CONFIGURE BACKUP OPTIMIZATION OFF; # default CONFIGURE DEFAULT DEVICE TYPE TO DISK; #

  • oralce delete table data recovery operations 2011-07-11

    Normally we operate the database when the database may be some wrong operation is not careful to do common data in the table to be deleted or directly to the table to drop the. In fact, these operations, we are for data recovery, here is what I have