21 Haziran 2013 Cuma

RMAN DBID



In different situations you need to know your database dbid. You can learn your dbid easily from connect to to RMAN tool.  You must record your dbid to anywhere.

[oracle@server ~]$ rman target /

Recovery Manager: Release 11.2.0.2.0 - Production on Fri Jun 21 13:35:02 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
connected to target database: HR  (DBID=7264534995)
RMAN>

Sometimes disasters have unexpected behaviours so we couldnt find dbid where we recorded it.
But still we need to  restore rman backup,  control file,  spfile, whole database  etc.  We have a small tip for writing dbid to alertlog file.



[oracle@server ~]$  sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Fri Nov 9 15:16:45 2012
Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining
and Real Application Testing options
SQL> declare
  2  l_dbid number;
  3  begin
  4  select dbid into l_dbid from v$database;
  5  dbms_system.ksdwrt(2,'DBID='||l_dbid);
  6  end;
  7  /
PL/SQL procedure successfully completed.

SQL> commit;

Commit complete.

Procedure  "dbms_system.ksdwrt" writes dbid at alertlog file.  This procedure  write messages to alertlog file. I learned from Arup Nanda.





Hiç yorum yok: