Wednesday, March 27, 2013

DBID

Find DBID ?


1. select name, dbid from v$database
2. strings file_name |grep MAXVALUE, (In case of SYSTEM datafile)
3. strings file_name |grep MAXVALUE (In case of UNDO datafile)
4. strings file_name |grep 'database id'
5. when you login to rman



==================
Example
======================================================================

SQL> select name, dbid from v$database;
NAME            DBID
--------- ----------
AON       3575888991

======================================================================
[oracle@rusk BACKUP]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Wed Mar 27 11:52:10 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: AON (DBID=3575888991)
======================================================================
UNDO BACKUP PIECE
----------------------

RMAN> backup as copy datafile 2;
Starting backup at 27-MAR-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=29 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u02/oradata/AON/undotbs01.dbf
output file name=/u04/app/oracle/product/11.2.0/dbs/data_D-AON_I-3575888991_TS-UNDOTBS_FNO-2_08o5io5m tag=TAG20130327T111710 RECID=1 STAMP=811163885
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:55
Finished backup at 27-MAR-13

RMAN> exit
[oracle@rusk BACKUP]$ strings /u04/app/oracle/product/11.2.0/dbs/data_D-AON_I-3575888991_TS-UNDOTBS_FNO-2_08o5io5m |grep MAXVALUE
3575888991, MAXVALUE
3575888991, MAXVALUE

======================================================================
SYSTEM BACKUP PIECE
---------------------------

[oracle@rusk BACKUP]$ strings backup01o59nur | grep MAXVALUE,
3575888991, MAXVALUE,

======================================================================
SYSAUX BACKUP PIECE
---------------------------

strings /u04/app/oracle/product/11.2.0/dbs/09o5iqh9_1_1 | grep 'database id'
ADDM:3575888991_1_26GADDM auto run: snapshots [25, 26],  instance 1,  database id 3575888991
ADDM:3575888991_1_21GADDM auto run: snapshots [20, 21],  instance 1,  database id 3575888991

======================================================================

No comments:

Post a Comment