獲取Oracle DBID

tolilong發表於2014-04-21
SQL> select dbid from v$database;
      DBID
----------
2936527823
[oracle@primary ~]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Mon Apr 21 19:12:14 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: WLCSP (DBID=2936527823)
[oracle@primary ~]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Mon Apr 21 19:14:45 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: WLCSP (DBID=2936527823)
RMAN> backup current controlfile;
Starting backup at 21-APR-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=37 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 21-APR-14
channel ORA_DISK_1: finished piece 1 at 21-APR-14
piece handle=/u01/rmanbackup/1lp6ad1d_1_1 tag=TAG20140421T191452 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 21-APR-14
Starting Control File and SPFILE Autobackup at 21-APR-14
piece handle=/u01/rmanbackup/c-2936527823-20140421-00 comment=NONE
Finished Control File and SPFILE Autobackup at 21-APR-14
[oracle@primary ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Mon Apr 21 19:18:07 2014
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 417546240 bytes
Fixed Size 2213936 bytes
Variable Size 360712144 bytes
Database Buffers 50331648 bytes
Redo Buffers 4288512 bytes
SQL> alter system dump datafile '/u01/oradata/wlcsp/sysaux01.dbf' block 1;
System altered.
SQL> oradebug setmypid
Statement processed.
SQL> oradebug tracefile_name;
/u01/oracle/diag/rdbms/wlcsp/wlcsp/trace/wlcsp_ora_5429.trc
Start dump data block from file /u01/oradata/wlcsp/sysaux01.dbf minblk 1 maxblk 1
 V10 STYLE FILE HEADER:
        Compatibility Vsn = 186646528=0xb200000
        Db ID=2936527823=0xaf07dbcf, Db Name='WLCSP'
        Activation ID=0=0x0
        Control Seq=825986197=0x313b8c95, File size=110080=0x1ae00
        File Number=2, Blksiz=8192, File Type=3 DATA
Dump all the blocks in range:
End dump data block from file /u01/oradata/wlcsp/sysaux01.dbf minblk 2 maxblk 1
select to_number('af07dbcf','xxxxxxxxx') from dual;


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-1146391/,如需轉載,請註明出處,否則將追究法律責任。

相關文章