--prod 主機 找到nbu要還原的log .
$  cd /nbu/PROD/
$  ls -al |grep 031612
-rw-rw-rw-   1 root     root       23676 Mar 16 07:23 hot_database_backup_20110524.sh_0600031612.out
-rw-rw-rw-   1 root     root       17134 Mar 16 13:43 hot_database_backup_20110524.sh_1230031612.out
$vi hot_database_backup_20110524.sh_1230031612.out

--check backup log satus and get control file backup name
Starting backup at 16-MAR-12
channel ch00: starting full datafile backup set
channel ch00: specifying datafile(s) in backup set
including current control file in backup set
channel ch00: starting piece 1 at 16-MAR-12
channel ch00: finished piece 1 at 16-MAR-12
piece handle=cntrl_10313_1_778081272 tag=TAG20120316T134112 comment=API Version
2.0,MMS Version 5.0.0.0
channel ch00: backup set complete, elapsed time: 00:01:05
Finished backup at 16-MAR-12

Starting Control File Autobackup at 16-MAR-12
piece handle=c-137585719-20120316-05 comment=API Version 2.0,MMS Version 5.0.0.0
Finished Control File Autobackup at 16-MAR-12

released channel: ch00

log control file name: c-137585719-20120316-05

--找到dbid
SQL>select name,dbid from v$database;
Name         dbid
======================================
PROD         137585719

--CRP2O 異機還原主機
bash-3.00$ rman target / nocatalog

Recovery Manager: Release 11.1.0.7.0 - Production on Sat Mar 17 01:28:01 2012

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database (not started)

RMAN> startup nomount

Oracle instance started

Total System Global Area    1069252608 bytes

Fixed Size                     2115496 bytes
Variable Size                431265880 bytes
Database Buffers             624951296 bytes
Redo Buffers                  10919936 bytes

RMAN>  set DBID=137585719

executing command: SET DBID

RMAN> RUN {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
SEND 'NB_ORA_CLIENT=erpdb,NB_ORA_POLICY=erpdb_PROD_backup_full_DLY,NB_ORA_SERV=t5140-t,NB_ORA_SCHED=Full_PROD_1230';
restore controlfile from 'cntrl_10313_1_778081272' ;
RELEASE CHANNEL ch00;
};2> 3> 4> 5> 6>

released channel: ORA_DISK_1
allocated channel: ch00
channel ch00: SID=400 device type=SBT_TAPE
channel ch00: Veritas NetBackup for Oracle - Release 6.5 (2010042405)

sent command to channel: ch00

Starting restore at 17-MAR-12

channel ch00: restoring control file
channel ch00: restore complete, elapsed time: 00:03:26
output file name=/data/PROD/db/apps_st/data/cntrl01.dbf
output file name=/data/PROD/db/apps_st/data/cntrl02.dbf
output file name=/data/PROD/db/apps_st/data/cntrl03.dbf
Finished restore at 17-MAR-12

 

RMAN> ALTER DATABASE MOUNT;

database mounted

RUN {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
SEND 'NB_ORA_CLIENT=yens-erpdb,NB_ORA_POLICY=erpdb_PROD_backup_full_DLY,NB_ORA_SERV=t5140-t,NB_ORA_SCHED=Full_PROD_1230';
restore database;
RELEASE CHANNEL ch00;
};


allocated channel: ch00
channel ch00: SID=377 device type=SBT_TAPE
channel ch00: Veritas NetBackup for Oracle - Release 6.5 (2010042405)

sent command to channel: ch00

Starting restore at 17-MAR-12

channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00002 to /data/PROD/db/apps_st/data/system02.dbf
channel ch00: restoring datafile 00011 to /data/PROD/db/apps_st/data/system11.dbf
channel ch00: restoring datafile 00025 to /data/PROD/db/apps_st/data/a_txn_ind01.dbf
channel ch00: restoring datafile 00034 to /data/PROD/db/apps_st/data/portal01.dbf
channel ch00: restoring datafile 00044 to /data/PROD/db/apps_st/data/sysaux03.dbf
channel ch00: restoring datafile 00045 to /data/PROD/db/apps_st/data/sysaux04.dbf
channel ch00: restoring datafile 00048 to /data/PROD/db/apps_st/data/sysaux07.dbf
channel ch00: restoring datafile 00055 to /data/PROD/db/apps_st/data/xxyensx02.dbf
channel ch00: restoring datafile 00076 to /data/PROD/db/apps_st/data/xxyens04.dbf
channel ch00: restoring datafile 00093 to /data/PROD/db/apps_st/data/a_txn_data20.dbf
channel ch00: reading from backup piece bk_10298_1_778077007
channel ch00: piece handle=bk_10298_1_778077007 tag=HOT_DB_BK_LEVEL0
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:11:15
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00007 to /data/PROD/db/apps_st/data/system07.dbf
channel ch00: restoring datafile 00010 to /data/PROD/db/apps_st/data/system10.dbf
channel ch00: restoring datafile 00012 to /data/PROD/db/apps_st/data/undo01.dbf
channel ch00: restoring datafile 00014 to /data/PROD/db/apps_st/data/a_int01.dbf
channel ch00: restoring datafile 00042 to /data/PROD/db/apps_st/data/xxyensx01.dbf
channel ch00: restoring datafile 00046 to /data/PROD/db/apps_st/data/sysaux05.dbf
channel ch00: restoring datafile 00049 to /data/PROD/db/apps_st/data/sysaux08.dbf
channel ch00: restoring datafile 00059 to /data/PROD/db/apps_st/data/discoverer01.dbf
channel ch00: restoring datafile 00064 to /data/PROD/db/apps_st/data/system12.dbf
channel ch00: restoring datafile 00084 to /data/PROD/db/apps_st/data/a_txn_data14.dbf
channel ch00: reading from backup piece bk_10299_1_778077512
channel ch00: piece handle=bk_10299_1_778077512 tag=HOT_DB_BK_LEVEL0
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:10:15
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00006 to /data/PROD/db/apps_st/data/system06.dbf
channel ch00: restoring datafile 00019 to /data/PROD/db/apps_st/data/a_ref01.dbf
channel ch00: restoring datafile 00041 to /data/PROD/db/apps_st/data/xxyens01.dbf
channel ch00: restoring datafile 00058 to /data/PROD/db/apps_st/data/sysaux14.dbf
channel ch00: restoring datafile 00062 to /data/PROD/db/apps_st/data/a_txn_data06.dbf
channel ch00: restoring datafile 00070 to /data/PROD/db/apps_st/data/a_txn_ind08.dbf
channel ch00: restoring datafile 00073 to /data/PROD/db/apps_st/data/xxyens03.dbf
channel ch00: restoring datafile 00077 to /data/PROD/db/apps_st/data/undo03.dbf
channel ch00: restoring datafile 00086 to /data/PROD/db/apps_st/data/a_txn_ind10.dbf
channel ch00: reading from backup piece bk_10300_1_778077887
channel ch00: piece handle=bk_10300_1_778077887 tag=HOT_DB_BK_LEVEL0
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:10:26
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00008 to /data/PROD/db/apps_st/data/system08.dbf
channel ch00: restoring datafile 00017 to /data/PROD/db/apps_st/data/a_queue01.dbf
channel ch00: restoring datafile 00020 to /data/PROD/db/apps_st/data/a_ref02.dbf
channel ch00: restoring datafile 00036 to /data/PROD/db/apps_st/data/apps_ts_tools01.dbf
channel ch00: restoring datafile 00067 to /data/PROD/db/apps_st/data/a_txn_data07.dbf
channel ch00: restoring datafile 00071 to /data/PROD/db/apps_st/data/a_txn_ind09.dbf
channel ch00: restoring datafile 00078 to /data/PROD/db/apps_st/data/undo04.dbf
channel ch00: restoring datafile 00081 to /data/PROD/db/apps_st/data/a_queue04.dbf
channel ch00: restoring datafile 00087 to /data/PROD/db/apps_st/data/a_txn_data16.dbf
channel ch00: reading from backup piece bk_10301_1_778078223
channel ch00: piece handle=bk_10301_1_778078223 tag=HOT_DB_BK_LEVEL0
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:11:46
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00009 to /data/PROD/db/apps_st/data/system09.dbf
channel ch00: restoring datafile 00018 to /data/PROD/db/apps_st/data/a_queue02.dbf
channel ch00: restoring datafile 00021 to /data/PROD/db/apps_st/data/a_summ01.dbf
channel ch00: restoring datafile 00022 to /data/PROD/db/apps_st/data/a_txn_data01.dbf
channel ch00: restoring datafile 00038 to /data/PROD/db/apps_st/data/a_txn_data4.dbf
channel ch00: restoring datafile 00057 to /data/PROD/db/apps_st/data/sysaux13.dbf
channel ch00: restoring datafile 00068 to /data/PROD/db/apps_st/data/a_txn_data08.dbf
channel ch00: restoring datafile 00082 to /data/PROD/db/apps_st/data/a_queue05.dbf
channel ch00: restoring datafile 00088 to /data/PROD/db/apps_st/data/a_txn_data17.dbf
channel ch00: reading from backup piece bk_10302_1_778078548
channel ch00: piece handle=bk_10302_1_778078548 tag=HOT_DB_BK_LEVEL0
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:12:46
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00015 to /data/PROD/db/apps_st/data/a_media01.dbf
channel ch00: restoring datafile 00030 to /data/PROD/db/apps_st/data/ctxd01.dbf
channel ch00: restoring datafile 00047 to /data/PROD/db/apps_st/data/sysaux06.dbf
channel ch00: restoring datafile 00050 to /data/PROD/db/apps_st/data/undo02.dbf
channel ch00: restoring datafile 00056 to /data/PROD/db/apps_st/data/sysaux12.dbf
channel ch00: restoring datafile 00065 to /data/PROD/db/apps_st/data/a_queue03.dbf
channel ch00: restoring datafile 00066 to /data/PROD/db/apps_st/data/a_media02.dbf
channel ch00: restoring datafile 00085 to /data/PROD/db/apps_st/data/a_txn_data15.dbf
channel ch00: reading from backup piece bk_10303_1_778078913
channel ch00: piece handle=bk_10303_1_778078913 tag=HOT_DB_BK_LEVEL0
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:12:06
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00001 to /data/PROD/db/apps_st/data/system01.dbf
channel ch00: restoring datafile 00031 to /data/PROD/db/apps_st/data/odm.dbf
channel ch00: restoring datafile 00035 to /data/PROD/db/apps_st/data/sysaux01.dbf
channel ch00: restoring datafile 00039 to /data/PROD/db/apps_st/data/a_txn_ind06.dbf
channel ch00: restoring datafile 00051 to /data/PROD/db/apps_st/data/sysaux09.dbf
channel ch00: restoring datafile 00053 to /data/PROD/db/apps_st/data/sysaux11.dbf
channel ch00: restoring datafile 00061 to /data/PROD/db/apps_st/data/sysaux16.dbf
channel ch00: restoring datafile 00072 to /data/PROD/db/apps_st/data/system13.dbf
channel ch00: restoring datafile 00075 to /data/PROD/db/apps_st/data/a_txn_data11.dbf
channel ch00: restoring datafile 00092 to /data/PROD/db/apps_st/data/a_txn_data19.dbf
channel ch00: reading from backup piece bk_10304_1_778079349
channel ch00: piece handle=bk_10304_1_778079349 tag=HOT_DB_BK_LEVEL0
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:13:26
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00005 to /data/PROD/db/apps_st/data/system05.dbf
channel ch00: restoring datafile 00027 to /data/PROD/db/apps_st/data/a_txn_ind03.dbf
channel ch00: restoring datafile 00028 to /data/PROD/db/apps_st/data/a_txn_ind04.dbf
channel ch00: restoring datafile 00037 to /data/PROD/db/apps_st/data/interim.dbf
channel ch00: restoring datafile 00043 to /data/PROD/db/apps_st/data/sysaux02.dbf
channel ch00: restoring datafile 00052 to /data/PROD/db/apps_st/data/sysaux10.dbf
channel ch00: restoring datafile 00069 to /data/PROD/db/apps_st/data/a_txn_data09.dbf
channel ch00: restoring datafile 00074 to /data/PROD/db/apps_st/data/a_txn_data10.dbf
channel ch00: restoring datafile 00091 to /data/PROD/db/apps_st/data/a_txn_data18.dbf
channel ch00: reading from backup piece bk_10305_1_778079704
channel ch00: piece handle=bk_10305_1_778079704 tag=HOT_DB_BK_LEVEL0
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:11:45
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00004 to /data/PROD/db/apps_st/data/system04.dbf
channel ch00: restoring datafile 00016 to /data/PROD/db/apps_st/data/a_nolog01.dbf
channel ch00: restoring datafile 00023 to /data/PROD/db/apps_st/data/a_txn_data02.dbf
channel ch00: restoring datafile 00029 to /data/PROD/db/apps_st/data/a_txn_ind05.dbf
channel ch00: restoring datafile 00060 to /data/PROD/db/apps_st/data/sysaux15.dbf
channel ch00: restoring datafile 00063 to /data/PROD/db/apps_st/data/a_txn_ind07.dbf
channel ch00: restoring datafile 00079 to /data/PROD/db/apps_st/data/a_txn_data12.dbf
channel ch00: restoring datafile 00083 to /data/PROD/db/apps_st/data/a_media03.dbf
channel ch00: restoring datafile 00089 to /data/PROD/db/apps_st/data/sysaux17.dbf
channel ch00: reading from backup piece bk_10306_1_778080059
channel ch00: piece handle=bk_10306_1_778080059 tag=HOT_DB_BK_LEVEL0
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:11:25
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00003 to /data/PROD/db/apps_st/data/system03.dbf
channel ch00: restoring datafile 00013 to /data/PROD/db/apps_st/data/a_archive01.dbf
channel ch00: restoring datafile 00024 to /data/PROD/db/apps_st/data/a_txn_data03.dbf
channel ch00: restoring datafile 00026 to /data/PROD/db/apps_st/data/a_txn_ind02.dbf
channel ch00: restoring datafile 00032 to /data/PROD/db/apps_st/data/olap.dbf
channel ch00: restoring datafile 00033 to /data/PROD/db/apps_st/data/owad01.dbf
channel ch00: restoring datafile 00040 to /data/PROD/db/apps_st/data/a_txn_data05.dbf
channel ch00: restoring datafile 00054 to /data/PROD/db/apps_st/data/xxyens02.dbf
channel ch00: restoring datafile 00080 to /data/PROD/db/apps_st/data/a_txn_data13.dbf
channel ch00: restoring datafile 00090 to /data/PROD/db/apps_st/data/sysaux18.dbf
channel ch00: reading from backup piece bk_10307_1_778080374
channel ch00: piece handle=bk_10307_1_778080374 tag=HOT_DB_BK_LEVEL0
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:11:45
Finished restore at 17-MAR-12

released channel: ch00
NBU restore job list
 
RUN {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
SEND 'NB_ORA_CLIENT=yens-erpdb,NB_ORA_POLICY=erpdb_PROD_backup_full_DLY,NB_ORA_SERV=t5140-t,NB_ORA_SCHED=Full_PROD_1230';
restore archivelog all;
RELEASE CHANNEL ch00;
};2> 3> 4> 5> 6>

allocated channel: ch00
channel ch00: SID=377 device type=SBT_TAPE
channel ch00: Veritas NetBackup for Oracle - Release 6.5 (2010042405)

sent command to channel: ch00

Starting restore at 17-MAR-12

archived log for thread 1 with sequence 5661 is already on disk as file /data/PROD/db/apps_st/data/archive_data1_5661_763561214.dbf
archived log for thread 1 with sequence 5662 is already on disk as file /data/PROD/db/apps_st/data/archive_data1_5662_763561214.dbf
archived log for thread 1 with sequence 5663 is already on disk as file /data/PROD/db/apps_st/data/archive_data1_5663_763561214.dbf

RMAN> RUN {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
SEND 'NB_ORA_CLIENT=yens-erpdb,NB_ORA_POLICY=erpdb_PROD_backup_full_DLY,NB_ORA_SERV=t5140-t,NB_ORA_SCHED=Full_PROD_1230';
recover database;
RELEASE CHANNEL ch00;
};2> 3> 4> 5> 6>

released channel: ORA_DISK_1
allocated channel: ch00
channel ch00: SID=377 device type=SBT_TAPE
channel ch00: Veritas NetBackup for Oracle - Release 6.5 (2010042405)

sent command to channel: ch00

Starting recover at 17-MAR-12

starting media recovery

channel ch00: starting archived log restore to default destination
channel ch00: restoring archived log
archived log thread=1 sequence=5661
channel ch00: restoring archived log
archived log thread=1 sequence=5662
channel ch00: restoring archived log
archived log thread=1 sequence=5663
channel ch00: reading from backup piece al_10311_1_778081081
channel ch00: piece handle=al_10311_1_778081081 tag=TAG20120316T133330
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:03:55
archived log file name=/data/PROD/db/apps_st/data/archive_data1_5661_763561214.dbf thread=1 sequence=5661

archived log file name=/data/PROD/db/apps_st/data/archive_data1_5662_763561214.dbf thread=1 sequence=5662
archived log file name=/data/PROD/db/apps_st/data/archive_data1_5663_763561214.dbf thread=1 sequence=5663
unable to find archived log
archived log thread=1 sequence=5664
released channel: ch00

RMAN> alter database open resetlogs;

database opened

RMAN>
RMAN> exit
--recover 後測試

Recovery Manager complete.
bash-3.00$ sqlplus / as sysdba

SQL*Plus: Release 11.1.0.7.0 - Production on Sat Mar 17 23:16:48 2012

Copyright (c) 1982, 2008, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> select user_name from apps.fnd_user where rownum<=10;

USER_NAME
--------------------------------------------------------------------------------
ANNIE
PAN
MARGRA
KIMA
YUEH
WILLSON
NICK0522
ALLEN2
FAN
MYPOLI

10 rows selected.
--重新啟動測試
SQL>
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 1069252608 bytes
Fixed Size                  2115496 bytes
Variable Size             431265880 bytes
Database Buffers          624951296 bytes
Redo Buffers               10919936 bytes
Database mounted.
Database opened.
SQL> select user_name from apps.fnd_user where rownum<=5;

USER_NAME
--------------------------------------------------------------------------------
ANNIE
PAN
MARGRA
KIMA
YUEH

SQL>
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
bash-3.00$ who am i
oraprod    pts/3        Mar 16 14:11    (10.16.26.3)
bash-3.00$ cat /etc/hosts
#
# Internet host table
#
::1     localhost
127.0.0.1       localhost
10.16.1.179     yens-ascpt.yens.com.tw  yens-ascpt      loghost
10.16.1.140     yens-eip.yens.com.tw     yens-eip
10.16.1.165     yens-erpdb.yens.com.tw   yens-erpdb
10.16.1.175     yens-erptap.yens.com.tw yens-erptap
10.16.1.174     t5140-t         t5140-t.yens.com.tw
--測試client連接
bash-3.00$
bash-3.00$ lsnrctl start prod

LSNRCTL for Solaris: Version 11.1.0.7.0 - Production on 17-MAR-2012 23:28:08

Copyright (c) 1991, 2008, Oracle.  All rights reserved.

Starting /data/PROD/db/tech_st/11.1.0/bin/tnslsnr: please wait...

TNSLSNR for Solaris: Version 11.1.0.7.0 - Production
System parameter file is /data/PROD/db/tech_st/11.1.0/network/admin/PROD_yens-ascpt/listener.ora
Log messages written to /data/PROD/db/tech_st/11.1.0/log/diag/tnslsnr/yens-ascpt/prod/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=yens-ascpt.yens.com.tw)(PORT=1541)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=yens-ascpt.yens.com.tw)(PORT=1541)))
STATUS of the LISTENER
------------------------
Alias                     prod
Version                   TNSLSNR for Solaris: Version 11.1.0.7.0 - Production
Start Date                17-MAR-2012 23:28:08
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /data/PROD/db/tech_st/11.1.0/network/admin/PROD_yens-ascpt/listener.ora
Listener Log File         /data/PROD/db/tech_st/11.1.0/log/diag/tnslsnr/yens-ascpt/prod/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=yens-ascpt.yens.com.tw)(PORT=1541)))
Services Summary...
Service "PROD" has 1 instance(s).
  Instance "PROD", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
bash-3.00$
 
本機tnsname 設定~
CRP2O= (DESCRIPTION=
                (ADDRESS=(PROTOCOL=tcp)(HOST=yens-ascpt.yens.com.tw)(PORT=1541))
            (CONNECT_DATA=
                (SID=PROD)))

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 Nolem 的頭像
    Nolem

    Nolem的部落格

    Nolem 發表在 痞客邦 留言(0) 人氣()