1. 程式人生 > >oracle 12c RMAN異機恢復還原RAC叢集(ASM)為單例項庫(檔案系統)記錄

oracle 12c RMAN異機恢復還原RAC叢集(ASM)為單例項庫(檔案系統)記錄

CONFIGURE CONTROLFILE AUTOBACKUP ON
備份集準備
backup database format '/home/databak/whole_%d_%U';
backup spfile format '/home/databak/spfile_%d_%U';

切日誌
alter system switch logfile;

backup archivelog all format '/home/databak/arch_%d_%U' delete input;

切日誌
alter system switch logfile;

backup current controlfile format='/home/databak/ctl_%U_%T';

作業系統命令:傳備份集
[
[email protected]
databak]$ scp whole_G_XSHIS_07rgqf2h_1_1* arch_G_XSHIS_09rgqf89_1_1* ctl_0brgqf9j_1_1_20160926* 172.16.28.25:/home/databak/
[email protected]'s password:
whole_G_XSHIS_07rgqf2h_1_1                                                                        100% 3417MB 113.9MB/s   00:30    
arch_G_XSHIS_09rgqf89_1_1                                                                         100%   14MB  13.9MB/s   00:00    
ctl_0brgqf9j_1_1_20160926                                                                         100%   18MB  18.4MB/s   00:00    
[
[email protected]
databak]$


還少了引數檔案和口令檔案
引數檔案全備份集裡面有包含
口令檔案可以通過命令建立

克隆庫操作

orapwd file=/home/oracle/app/oracle/product/12.1.0/db_1/dbs/orapwgxshis password=oracle

恢復引數檔案

rman target /
RMAN> startup nomount;
RMAN> restore spfile from '/home/databak/spfile_G_XSHIS_0drgqgn8_1_1';

Starting restore at 27-SEP-16
using channel ORA_DISK_1

channel ORA_DISK_1: restoring spfile from AUTOBACKUP /home/databak/spfile_G_XSHIS_0drgqgn8_1_1
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 27-SEP-16

RMAN>

RMAN> shutdown immediate

處理目錄
進行到sqlplus工具

SQL> create pfile from spfile;

修改引數檔案,並根據引數檔案中的引數建立相應的目錄

[
[email protected]
dbs]$ cat initgxshis.ora
gxshis2.__data_transfer_cache_size=0
gxshis1.__data_transfer_cache_size=0
gxshis2.__db_cache_size=29259464704
gxshis1.__db_cache_size=28319940608
gxshis2.__java_pool_size=939524096
gxshis1.__java_pool_size=939524096
gxshis2.__large_pool_size=3087007744
gxshis1.__large_pool_size=3087007744
gxshis1.__oracle_base='/oracle/app/oracle'#ORACLE_BASE set from environment
gxshis2.__oracle_base='/oracle/app/oracle'#ORACLE_BASE set from environment
gxshis2.__pga_aggregate_target=13555990528
gxshis1.__pga_aggregate_target=13555990528
gxshis2.__sga_target=40667971584
gxshis1.__sga_target=40667971584
gxshis2.__shared_io_pool_size=402653184
gxshis1.__shared_io_pool_size=536870912
gxshis2.__shared_pool_size=6845104128
gxshis1.__shared_pool_size=7381975040
gxshis2.__streams_pool_size=0
gxshis1.__streams_pool_size=268435456
*.audit_file_dest='/home/oracle/app/oracle/admin/gxshis/adump'
*.audit_trail='db'
*.cluster_database=false#true/false
*.compatible='12.1.0.2.0'
*.control_files='/home/oracle/app/oracle/oradata/gxshis/current.261.922142579','/home/oracle/app/oracle/oradata/gxshis/current.256.922142579'
*.db_block_size=8192
*.db_create_file_dest='/home/oracle/app/oracle/oradata/gxshis'
*.db_domain=''
*.db_name='g_xshis'
*.db_recovery_file_dest='/home/oracle/app/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=100g
*.diagnostic_dest='/home/oracle/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=gxshisXDB)'
gxshis1.instance_number=1
gxshis2.instance_number=2
g_xshis1.instance_number=1
g_xshis2.instance_number=2
*.open_cursors=300
*.pga_aggregate_target=12900m
*.processes=1100
*.remote_login_passwordfile='exclusive'
*.sec_case_sensitive_logon=FALSE
*.sessions=1000
*.sga_target=38700m
gxshis2.thread=2
gxshis1.thread=1
gxshis1.undo_tablespace='UNDOTBS1'
gxshis2.undo_tablespace='UNDOTBS2'
[[email protected] dbs]$

SQL> startup nomount

恢復控制檔案
rman target /
RMAN> restore controlfile from '/home/databak/ctl_0brgqf9j_1_1_20160926';

Starting restore at 27-SEP-16
using channel ORA_DISK_1

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
output file name=/home/oracle/app/oracle/oradata/gxshis/current.261.922142579
output file name=/home/oracle/app/oracle/oradata/gxshis/current.256.922142579
Finished restore at 27-SEP-16
RMAN>

啟動到mount狀態,恢復資料庫

alter database mount;

注意:恢復引數檔案和控制檔案通過手工指定備份集恢復出來。所以這個備份集在哪個目錄都無所謂。但是恢復資料檔案是不能用from指定備份集。restore database;恢復資料檔案的前提是備份集所在的目錄必須跟控制檔案中記錄的目錄一致。

當目錄不一致的時候處理辦法得新catalog;
oracle]$ mv whole_ORCL_01qsbu7l_1_1 /home/oracle

RMAN> restore database;

報錯,找不到備份集


rman>catalog start with '/home/oracle';

再恢復資料庫,正常。

RMAN> restore database;

Starting restore at 27-SEP-16
Starting implicit crosscheck backup at 27-SEP-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=423 device type=DISK
Crosschecked 4 objects
Finished implicit crosscheck backup at 27-SEP-16

Starting implicit crosscheck copy at 27-SEP-16
using channel ORA_DISK_1
Finished implicit crosscheck copy at 27-SEP-16

searching for all files in the recovery area
cataloging files...
no files cataloged

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to +DATA/G_XSHIS/DATAFILE/system.258.922142465
channel ORA_DISK_1: restoring datafile 00002 to +DATA/g_xshis/tablespaces/tsp_acct.dbf
channel ORA_DISK_1: restoring datafile 00003 to +DATA/G_XSHIS/DATAFILE/sysaux.257.922142419
channel ORA_DISK_1: restoring datafile 00004 to +DATA/G_XSHIS/DATAFILE/undotbs1.260.922142521
channel ORA_DISK_1: restoring datafile 00005 to +DATA/G_XSHIS/DATAFILE/undotbs2.265.922142785
channel ORA_DISK_1: restoring datafile 00006 to +DATA/G_XSHIS/DATAFILE/users.259.922142519
channel ORA_DISK_1: restoring datafile 00007 to +DATA/g_xshis/tablespaces/tsp_bldbank.dbf
channel ORA_DISK_1: restoring datafile 00008 to +DATA/g_xshis/tablespaces/tsp_clinpath.dbf
channel ORA_DISK_1: restoring datafile 00009 to +DATA/g_xshis/tablespaces/tsp_comm.dbf
channel ORA_DISK_1: restoring datafile 00010 to +DATA/g_xshis/tablespaces/tsp_cpr.dbf
channel ORA_DISK_1: restoring datafile 00011 to +DATA/g_xshis/tablespaces/tsp_healthcare.dbf
channel ORA_DISK_1: restoring datafile 00012 to +DATA/g_xshis/tablespaces/tsp_hisuser.dbf
channel ORA_DISK_1: restoring datafile 00013 to +DATA/g_xshis/tablespaces/tsp_infect.dbf
channel ORA_DISK_1: restoring datafile 00014 to +DATA/g_xshis/tablespaces/tsp_inpadm.dbf
channel ORA_DISK_1: restoring datafile 00015 to +DATA/g_xshis/tablespaces/tsp_inpbill.dbf
channel ORA_DISK_1: restoring datafile 00016 to +DATA/g_xshis/tablespaces/tsp_inquire.dbf
channel ORA_DISK_1: restoring datafile 00017 to +DATA/g_xshis/tablespaces/tsp_insurance.dbf
channel ORA_DISK_1: restoring datafile 00018 to +DATA/g_xshis/tablespaces/tsp_interface.dbf
channel ORA_DISK_1: restoring datafile 00019 to +DATA/g_xshis/tablespaces/tsp_lab.dbf
channel ORA_DISK_1: restoring datafile 00020 to +DATA/g_xshis/tablespaces/tsp_medadm.dbf
channel ORA_DISK_1: restoring datafile 00021 to +DATA/g_xshis/tablespaces/tsp_medrec.dbf
channel ORA_DISK_1: restoring datafile 00022 to +DATA/g_xshis/tablespaces/tsp_mobile.dbf
channel ORA_DISK_1: restoring datafile 00023 to +DATA/g_xshis/tablespaces/tsp_nursing.dbf
channel ORA_DISK_1: restoring datafile 00024 to +DATA/g_xshis/tablespaces/tsp_ordadm.dbf
channel ORA_DISK_1: restoring datafile 00025 to +DATA/g_xshis/tablespaces/tsp_outpadm.dbf
channel ORA_DISK_1: restoring datafile 00026 to +DATA/g_xshis/tablespaces/tsp_outpbill.dbf
channel ORA_DISK_1: restoring datafile 00027 to +DATA/g_xshis/tablespaces/tsp_outpdoct.dbf
channel ORA_DISK_1: restoring datafile 00028 to +DATA/g_xshis/tablespaces/tsp_pharmacy.dbf
channel ORA_DISK_1: restoring datafile 00029 to +DATA/g_xshis/tablespaces/tsp_phyexam.dbf
channel ORA_DISK_1: restoring datafile 00030 to +DATA/g_xshis/tablespaces/tsp_report.dbf
channel ORA_DISK_1: restoring datafile 00031 to +DATA/g_xshis/tablespaces/tsp_surgery.dbf
channel ORA_DISK_1: restoring datafile 00032 to +DATA/g_xshis/tablespaces/tsp_tj.dbf
channel ORA_DISK_1: restoring datafile 00033 to +DATA/g_xshis/tablespaces/tsp_tjhisrpt.dbf
channel ORA_DISK_1: restoring datafile 00034 to +DATA/g_xshis/tablespaces/tsp_wsyy.dbf
channel ORA_DISK_1: restoring datafile 00035 to +DATA/g_xshis/tablespaces/tsp_exam.dbf
channel ORA_DISK_1: restoring datafile 00036 to +DATA/g_xshis/tablespaces/tsp_equipment.dbf
channel ORA_DISK_1: restoring datafile 00037 to +DATA/g_xshis/tablespaces/tsp_econstat.dbf
channel ORA_DISK_1: restoring datafile 00038 to +DATA/g_xshis/tablespaces/tsp_others.dbf
channel ORA_DISK_1: restoring datafile 00039 to +DATA/g_xshis/tablespaces/tsp_emr.dbf
channel ORA_DISK_1: restoring datafile 00040 to +DATA/g_xshis/tablespaces/tsp_nsm.dbf
channel ORA_DISK_1: reading from backup piece /home/databak/whole_G_XSHIS_07rgqf2h_1_1
channel ORA_DISK_1: ORA-19870: error while restoring backup piece /home/databak/whole_G_XSHIS_07rgqf2h_1_1
ORA-19504: failed to create file "+DATA/g_xshis/tablespaces/tsp_acct.dbf"
ORA-17502: ksfdcre:3 Failed to create file +DATA/g_xshis/tablespaces/tsp_acct.dbf
ORA-15001: diskgroup "DATA" does not exist or is not mounted
ORA-29701: unable to connect to Cluster Synchronization Service

failover to previous backup

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 09/27/2016 00:47:21
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 6 found to restore
RMAN-06023: no backup or copy of datafile 4 found to restore
RMAN-06023: no backup or copy of datafile 3 found to restore
RMAN-06023: no backup or copy of datafile 1 found to restore

RMAN>

RMAN> run {
2> allocate channel c1 device type disk;
3> allocate channel c2 device type disk;
4> set newname for datafile 1 to '/home/oracle/app/oracle/oradata/gxshis/SYSTEM';
5> set newname for datafile 3 to '/home/oracle/app/oracle/oradata/gxshis/SYSAUX';
6> set newname for datafile 5 to '/home/oracle/app/oracle/oradata/gxshis/UNDOTBS2';
7> set newname for datafile 6 to '/home/oracle/app/oracle/oradata/gxshis/USERS';
8> set newname for datafile 2 to '/home/oracle/app/oracle/oradata/gxshis/TSP_ACCT';
9> set newname for datafile 4 to '/home/oracle/app/oracle/oradata/gxshis/UNDOTBS1';
10> set newname for datafile 7 to '/home/oracle/app/oracle/oradata/gxshis/TSP_BLDBANK';
11> set newname for datafile 8 to '/home/oracle/app/oracle/oradata/gxshis/TSP_CLINPATH';
12> set newname for datafile 9 to '/home/oracle/app/oracle/oradata/gxshis/TSP_COMM';
13> set newname for datafile 10 to '/home/oracle/app/oracle/oradata/gxshis/TSP_CPR';
set newname for datafile 11 to '/home/oracle/app/oracle/oradata/gxshis/TSP_HEALTHCARE';
14> 15> set newname for datafile 12 to '/home/oracle/app/oracle/oradata/gxshis/TSP_HISUSER';
16> set newname for datafile 13 to '/home/oracle/app/oracle/oradata/gxshis/TSP_INFECT';
17> set newname for datafile 14 to '/home/oracle/app/oracle/oradata/gxshis/TSP_INPADM';
18> set newname for datafile 15 to '/home/oracle/app/oracle/oradata/gxshis/TSP_INPBILL';
19> set newname for datafile 16 to '/home/oracle/app/oracle/oradata/gxshis/TSP_INQUIRE';
20> set newname for datafile 17 to '/home/oracle/app/oracle/oradata/gxshis/TSP_INSURANCE';
21> set newname for datafile 18 to '/home/oracle/app/oracle/oradata/gxshis/TSP_INTERFACE';
22> set newname for datafile 19 to '/home/oracle/app/oracle/oradata/gxshis/TSP_LAB';
23> set newname for datafile 20 to '/home/oracle/app/oracle/oradata/gxshis/TSP_MEDADM';
24> set newname for datafile 21 to '/home/oracle/app/oracle/oradata/gxshis/TSP_MEDREC';
25> set newname for datafile 22 to '/home/oracle/app/oracle/oradata/gxshis/TSP_MOBILE';
26> set newname for datafile 23 to '/home/oracle/app/oracle/oradata/gxshis/TSP_NURSING';
27> set newname for datafile 24 to '/home/oracle/app/oracle/oradata/gxshis/TSP_ORDADM';
28> set newname for datafile 25 to '/home/oracle/app/oracle/oradata/gxshis/TSP_OUTPADM';
29> set newname for datafile 26 to '/home/oracle/app/oracle/oradata/gxshis/TSP_OUTPBILL';
30> set newname for datafile 27 to '/home/oracle/app/oracle/oradata/gxshis/TSP_OUTPDOCT';
31> set newname for datafile 28 to '/home/oracle/app/oracle/oradata/gxshis/TSP_PHARMACY';
32> set newname for datafile 29 to '/home/oracle/app/oracle/oradata/gxshis/TSP_PHYEXAM';
33> set newname for datafile 30 to '/home/oracle/app/oracle/oradata/gxshis/TSP_REPORT';
34> set newname for datafile 31 to '/home/oracle/app/oracle/oradata/gxshis/TSP_SURGERY';
35> set newname for datafile 32 to '/home/oracle/app/oracle/oradata/gxshis/TSP_TJ';
36> set newname for datafile 33 to '/home/oracle/app/oracle/oradata/gxshis/TSP_TJHISRPT';
37> set newname for datafile 34 to '/home/oracle/app/oracle/oradata/gxshis/TSP_WSYY';
38> set newname for datafile 35 to '/home/oracle/app/oracle/oradata/gxshis/TSP_EXAM';
39> set newname for datafile 36 to '/home/oracle/app/oracle/oradata/gxshis/TSP_EQUIPMENT';
40> set newname for datafile 37 to '/home/oracle/app/oracle/oradata/gxshis/TSP_ECONSTAT';
41> set newname for datafile 38 to '/home/oracle/app/oracle/oradata/gxshis/TSP_OTHERS';
42> set newname for datafile 39 to '/home/oracle/app/oracle/oradata/gxshis/TSP_EMR';
43> set newname for datafile 40 to '/home/oracle/app/oracle/oradata/gxshis/TSP_NSM';
44> restore database;   
45> switch datafile all;
46> release channel c1;
47> release channel c2;
48> }

released channel: ORA_DISK_1
allocated channel: c1
channel c1: SID=423 device type=DISK

allocated channel: c2
channel c2: SID=563 device type=DISK

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 27-SEP-16

channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00001 to /home/oracle/app/oracle/oradata/gxshis/SYSTEM
channel c1: restoring datafile 00002 to /home/oracle/app/oracle/oradata/gxshis/TSP_ACCT
channel c1: restoring datafile 00003 to /home/oracle/app/oracle/oradata/gxshis/SYSAUX
channel c1: restoring datafile 00004 to /home/oracle/app/oracle/oradata/gxshis/UNDOTBS1
channel c1: restoring datafile 00005 to /home/oracle/app/oracle/oradata/gxshis/UNDOTBS2
channel c1: restoring datafile 00006 to /home/oracle/app/oracle/oradata/gxshis/USERS
channel c1: restoring datafile 00007 to /home/oracle/app/oracle/oradata/gxshis/TSP_BLDBANK
channel c1: restoring datafile 00008 to /home/oracle/app/oracle/oradata/gxshis/TSP_CLINPATH
channel c1: restoring datafile 00009 to /home/oracle/app/oracle/oradata/gxshis/TSP_COMM
channel c1: restoring datafile 00010 to /home/oracle/app/oracle/oradata/gxshis/TSP_CPR
channel c1: restoring datafile 00011 to /home/oracle/app/oracle/oradata/gxshis/TSP_HEALTHCARE
channel c1: restoring datafile 00012 to /home/oracle/app/oracle/oradata/gxshis/TSP_HISUSER
channel c1: restoring datafile 00013 to /home/oracle/app/oracle/oradata/gxshis/TSP_INFECT
channel c1: restoring datafile 00014 to /home/oracle/app/oracle/oradata/gxshis/TSP_INPADM
channel c1: restoring datafile 00015 to /home/oracle/app/oracle/oradata/gxshis/TSP_INPBILL
channel c1: restoring datafile 00016 to /home/oracle/app/oracle/oradata/gxshis/TSP_INQUIRE
channel c1: restoring datafile 00017 to /home/oracle/app/oracle/oradata/gxshis/TSP_INSURANCE
channel c1: restoring datafile 00018 to /home/oracle/app/oracle/oradata/gxshis/TSP_INTERFACE
channel c1: restoring datafile 00019 to /home/oracle/app/oracle/oradata/gxshis/TSP_LAB
channel c1: restoring datafile 00020 to /home/oracle/app/oracle/oradata/gxshis/TSP_MEDADM
channel c1: restoring datafile 00021 to /home/oracle/app/oracle/oradata/gxshis/TSP_MEDREC
channel c1: restoring datafile 00022 to /home/oracle/app/oracle/oradata/gxshis/TSP_MOBILE
channel c1: restoring datafile 00023 to /home/oracle/app/oracle/oradata/gxshis/TSP_NURSING
channel c1: restoring datafile 00024 to /home/oracle/app/oracle/oradata/gxshis/TSP_ORDADM
channel c1: restoring datafile 00025 to /home/oracle/app/oracle/oradata/gxshis/TSP_OUTPADM
channel c1: restoring datafile 00026 to /home/oracle/app/oracle/oradata/gxshis/TSP_OUTPBILL
channel c1: restoring datafile 00027 to /home/oracle/app/oracle/oradata/gxshis/TSP_OUTPDOCT
channel c1: restoring datafile 00028 to /home/oracle/app/oracle/oradata/gxshis/TSP_PHARMACY
channel c1: restoring datafile 00029 to /home/oracle/app/oracle/oradata/gxshis/TSP_PHYEXAM
channel c1: restoring datafile 00030 to /home/oracle/app/oracle/oradata/gxshis/TSP_REPORT
channel c1: restoring datafile 00031 to /home/oracle/app/oracle/oradata/gxshis/TSP_SURGERY
channel c1: restoring datafile 00032 to /home/oracle/app/oracle/oradata/gxshis/TSP_TJ
channel c1: restoring datafile 00033 to /home/oracle/app/oracle/oradata/gxshis/TSP_TJHISRPT
channel c1: restoring datafile 00034 to /home/oracle/app/oracle/oradata/gxshis/TSP_WSYY
channel c1: restoring datafile 00035 to /home/oracle/app/oracle/oradata/gxshis/TSP_EXAM
channel c1: restoring datafile 00036 to /home/oracle/app/oracle/oradata/gxshis/TSP_EQUIPMENT
channel c1: restoring datafile 00037 to /home/oracle/app/oracle/oradata/gxshis/TSP_ECONSTAT
channel c1: restoring datafile 00038 to /home/oracle/app/oracle/oradata/gxshis/TSP_OTHERS
channel c1: restoring datafile 00039 to /home/oracle/app/oracle/oradata/gxshis/TSP_EMR
channel c1: restoring datafile 00040 to /home/oracle/app/oracle/oradata/gxshis/TSP_NSM
channel c1: reading from backup piece /home/databak/whole_G_XSHIS_07rgqf2h_1_1
channel c1: piece handle=/home/databak/whole_G_XSHIS_07rgqf2h_1_1 tag=TAG20160926T233128
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:14:50
Finished restore at 27-SEP-16

datafile 1 switched to datafile copy
input datafile copy RECID=41 STAMP=923621529 file name=/home/oracle/app/oracle/oradata/gxshis/SYSTEM
datafile 2 switched to datafile copy
input datafile copy RECID=42 STAMP=923621529 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_ACCT
datafile 3 switched to datafile copy
input datafile copy RECID=43 STAMP=923621529 file name=/home/oracle/app/oracle/oradata/gxshis/SYSAUX
datafile 4 switched to datafile copy
input datafile copy RECID=44 STAMP=923621529 file name=/home/oracle/app/oracle/oradata/gxshis/UNDOTBS1
datafile 5 switched to datafile copy
input datafile copy RECID=45 STAMP=923621530 file name=/home/oracle/app/oracle/oradata/gxshis/UNDOTBS2
datafile 6 switched to datafile copy
input datafile copy RECID=46 STAMP=923621530 file name=/home/oracle/app/oracle/oradata/gxshis/USERS
datafile 7 switched to datafile copy
input datafile copy RECID=47 STAMP=923621530 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_BLDBANK
datafile 8 switched to datafile copy
input datafile copy RECID=48 STAMP=923621530 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_CLINPATH
datafile 9 switched to datafile copy
input datafile copy RECID=49 STAMP=923621530 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_COMM
datafile 10 switched to datafile copy
input datafile copy RECID=50 STAMP=923621530 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_CPR
datafile 11 switched to datafile copy
input datafile copy RECID=51 STAMP=923621530 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_HEALTHCARE
datafile 12 switched to datafile copy
input datafile copy RECID=52 STAMP=923621530 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_HISUSER
datafile 13 switched to datafile copy
input datafile copy RECID=53 STAMP=923621530 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_INFECT
datafile 14 switched to datafile copy
input datafile copy RECID=54 STAMP=923621530 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_INPADM
datafile 15 switched to datafile copy
input datafile copy RECID=55 STAMP=923621530 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_INPBILL
datafile 16 switched to datafile copy
input datafile copy RECID=56 STAMP=923621530 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_INQUIRE
datafile 17 switched to datafile copy
input datafile copy RECID=57 STAMP=923621530 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_INSURANCE
datafile 18 switched to datafile copy
input datafile copy RECID=58 STAMP=923621530 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_INTERFACE
datafile 19 switched to datafile copy
input datafile copy RECID=59 STAMP=923621530 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_LAB
datafile 20 switched to datafile copy
input datafile copy RECID=60 STAMP=923621530 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_MEDADM
datafile 21 switched to datafile copy
input datafile copy RECID=61 STAMP=923621530 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_MEDREC
datafile 22 switched to datafile copy
input datafile copy RECID=62 STAMP=923621530 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_MOBILE
datafile 23 switched to datafile copy
input datafile copy RECID=63 STAMP=923621530 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_NURSING
datafile 24 switched to datafile copy
input datafile copy RECID=64 STAMP=923621530 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_ORDADM
datafile 25 switched to datafile copy
input datafile copy RECID=65 STAMP=923621531 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_OUTPADM
datafile 26 switched to datafile copy
input datafile copy RECID=66 STAMP=923621531 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_OUTPBILL
datafile 27 switched to datafile copy
input datafile copy RECID=67 STAMP=923621531 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_OUTPDOCT
datafile 28 switched to datafile copy
input datafile copy RECID=68 STAMP=923621531 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_PHARMACY
datafile 29 switched to datafile copy
input datafile copy RECID=69 STAMP=923621531 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_PHYEXAM
datafile 30 switched to datafile copy
input datafile copy RECID=70 STAMP=923621531 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_REPORT
datafile 31 switched to datafile copy
input datafile copy RECID=71 STAMP=923621531 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_SURGERY
datafile 32 switched to datafile copy
input datafile copy RECID=72 STAMP=923621531 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_TJ
datafile 33 switched to datafile copy
input datafile copy RECID=73 STAMP=923621531 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_TJHISRPT
datafile 34 switched to datafile copy
input datafile copy RECID=74 STAMP=923621531 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_WSYY
datafile 35 switched to datafile copy
input datafile copy RECID=75 STAMP=923621531 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_EXAM
datafile 36 switched to datafile copy
input datafile copy RECID=76 STAMP=923621531 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_EQUIPMENT
datafile 37 switched to datafile copy
input datafile copy RECID=77 STAMP=923621531 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_ECONSTAT
datafile 38 switched to datafile copy
input datafile copy RECID=78 STAMP=923621531 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_OTHERS
datafile 39 switched to datafile copy
input datafile copy RECID=79 STAMP=923621531 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_EMR
datafile 40 switched to datafile copy
input datafile copy RECID=80 STAMP=923621531 file name=/home/oracle/app/oracle/oradata/gxshis/TSP_NSM

released channel: c1

released channel: c2

RMAN>
RMAN> list backup of archivelog all;


List of Backup Sets
===================


BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
9       13.86M     DISK        00:00:00     26-SEP-16      
        BP Key: 9   Status: AVAILABLE  Compressed: NO  Tag: TAG20160926T233433
        Piece Name: /home/databak/arch_G_XSHIS_09rgqf89_1_1

  List of Archived Logs in backup set 9
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    672     9580105    26-SEP-16 9580242    26-SEP-16
  1    673     9580242    26-SEP-16 9588600    26-SEP-16
  1    674     9588600    26-SEP-16 9592473    26-SEP-16
  1    675     9592473    26-SEP-16 9592509    26-SEP-16

RMAN> recover database;

Starting recover at 27-SEP-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=423 device type=DISK

starting media recovery

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/27/2016 01:42:10
RMAN-06053: unable to perform media recovery because of missing log
RMAN-06025: no backup of archived log for thread 1 with sequence 676 and starting SCN of 9592509 found to restore

RMAN>


SQL> alter database open read only;

Database altered.

SQL> desc dba_objects
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 OWNER                                              VARCHAR2(128)
 OBJECT_NAME                                        VARCHAR2(128)
 SUBOBJECT_NAME                                     VARCHAR2(128)
 OBJECT_ID                                          NUMBER
 DATA_OBJECT_ID                                     NUMBER
 OBJECT_TYPE                                        VARCHAR2(23)
 CREATED                                            DATE
 LAST_DDL_TIME                                      DATE
 TIMESTAMP                                          VARCHAR2(19)
 STATUS                                             VARCHAR2(7)
 TEMPORARY                                          VARCHAR2(1)
 GENERATED                                          VARCHAR2(1)
 SECONDARY                                          VARCHAR2(1)
 NAMESPACE                                          NUMBER
 EDITION_NAME                                       VARCHAR2(128)
 SHARING                                            VARCHAR2(13)
 EDITIONABLE                                        VARCHAR2(1)
 ORACLE_MAINTAINED                                  VARCHAR2(1)

SQL> select instance_name, status from v$instance;                 

INSTANCE_NAME    STATUS
---------------- ------------
gxshis           OPEN

SQL> select dbid, open_mode from v$database;

      DBID OPEN_MODE
---------- --------------------
1872785972 READ ONLY

SQL> select file_name from dba_data_files;

FILE_NAME
--------------------------------------------------------------------------------
/home/oracle/app/oracle/oradata/gxshis/SYSTEM
/home/oracle/app/oracle/oradata/gxshis/SYSAUX
/home/oracle/app/oracle/oradata/gxshis/UNDOTBS1
/home/oracle/app/oracle/oradata/gxshis/USERS
/home/oracle/app/oracle/oradata/gxshis/UNDOTBS2
/home/oracle/app/oracle/oradata/gxshis/TSP_ACCT
/home/oracle/app/oracle/oradata/gxshis/TSP_BLDBANK
/home/oracle/app/oracle/oradata/gxshis/TSP_CLINPATH
/home/oracle/app/oracle/oradata/gxshis/TSP_COMM
/home/oracle/app/oracle/oradata/gxshis/TSP_CPR
/home/oracle/app/oracle/oradata/gxshis/TSP_HEALTHCARE

FILE_NAME
--------------------------------------------------------------------------------
/home/oracle/app/oracle/oradata/gxshis/TSP_HISUSER
/home/oracle/app/oracle/oradata/gxshis/TSP_INFECT
/home/oracle/app/oracle/oradata/gxshis/TSP_INPADM
/home/oracle/app/oracle/oradata/gxshis/TSP_INPBILL
/home/oracle/app/oracle/oradata/gxshis/TSP_INQUIRE
/home/oracle/app/oracle/oradata/gxshis/TSP_INSURANCE
/home/oracle/app/oracle/oradata/gxshis/TSP_INTERFACE
/home/oracle/app/oracle/oradata/gxshis/TSP_LAB
/home/oracle/app/oracle/oradata/gxshis/TSP_MEDADM
/home/oracle/app/oracle/oradata/gxshis/TSP_MEDREC
/home/oracle/app/oracle/oradata/gxshis/TSP_MOBILE

FILE_NAME
--------------------------------------------------------------------------------
/home/oracle/app/oracle/oradata/gxshis/TSP_NURSING
/home/oracle/app/oracle/oradata/gxshis/TSP_ORDADM
/home/oracle/app/oracle/oradata/gxshis/TSP_OUTPADM
/home/oracle/app/oracle/oradata/gxshis/TSP_OUTPBILL
/home/oracle/app/oracle/oradata/gxshis/TSP_OUTPDOCT
/home/oracle/app/oracle/oradata/gxshis/TSP_PHARMACY
/home/oracle/app/oracle/oradata/gxshis/TSP_PHYEXAM
/home/oracle/app/oracle/oradata/gxshis/TSP_REPORT
/home/oracle/app/oracle/oradata/gxshis/TSP_SURGERY
/home/oracle/app/oracle/oradata/gxshis/TSP_TJ
/home/oracle/app/oracle/oradata/gxshis/TSP_TJHISRPT

FILE_NAME
--------------------------------------------------------------------------------
/home/oracle/app/oracle/oradata/gxshis/TSP_WSYY
/home/oracle/app/oracle/oradata/gxshis/TSP_EXAM
/home/oracle/app/oracle/oradata/gxshis/TSP_EQUIPMENT
/home/oracle/app/oracle/oradata/gxshis/TSP_ECONSTAT
/home/oracle/app/oracle/oradata/gxshis/TSP_OTHERS
/home/oracle/app/oracle/oradata/gxshis/TSP_EMR
/home/oracle/app/oracle/oradata/gxshis/TSP_NSM

40 rows selected.

SQL> select file_name from dba_temp_files;
select file_name from dba_temp_files
                      *
ERROR at line 1:
ORA-01157: cannot identify/lock data file 202 - see DBWR trace file
ORA-01110: data file 202: '+DATA/g_xshis/tablespaces/tsp_tmp.dbf'


SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
+DATA/G_XSHIS/ONLINELOG/group_2.263.922142583
+FLASH/G_XSHIS/ONLINELOG/group_2.258.922142583
+DATA/G_XSHIS/ONLINELOG/group_1.262.922142583
+FLASH/G_XSHIS/ONLINELOG/group_1.257.922142583
+DATA/G_XSHIS/ONLINELOG/group_3.266.922142843
+FLASH/G_XSHIS/ONLINELOG/group_3.259.922142843
+DATA/G_XSHIS/ONLINELOG/group_4.267.922142843
+FLASH/G_XSHIS/ONLINELOG/group_4.260.922142843

8 rows selected.

SQL> show parameter control

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7
control_files                        string      /home/oracle/app/oracle/oradat
                                                 a/gxshis/current.261.922142579
                                                 , /home/oracle/app/oracle/orad
                                                 ata/gxshis/current.256.9221425
                                                 79
control_management_pack_access       string      DIAGNOSTIC+TUNING
SQL> show parameter pfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount pfile='/home/oracle/app/oracle/product/12.1.0/db_1/dbs/initgxshis.ora';
ORA-32006: SEC_CASE_SENSITIVE_LOGON initialization parameter has been deprecated
ORACLE instance started.

Total System Global Area 4.0668E+10 bytes
Fixed Size                  4507752 bytes
Variable Size            5502928792 bytes
Database Buffers         3.5031E+10 bytes
Redo Buffers              129708032 bytes
Database mounted.

--select 'alter database rename file '''||member||''' to ''$new_dest/redoXXX.log'';' from v$logfile;
SQL> alter database rename file '+DATA/G_XSHIS/ONLINELOG/group_2.263.922142583' to '/home/oracle/app/oracle/oradata/gxshis/redo_file/REDO02.log';
alter database rename file '+DATA/G_XSHIS/ONLINELOG/group_1.262.922142583' to '/home/oracle/app/oracle/oradata/gxshis/redo_file/REDO01.log';
alter database rename file '+DATA/G_XSHIS/ONLINELOG/group_3.266.922142843' to '/home/oracle/app/oracle/oradata/gxshis/redo_file/REDO03.log';
alter database rename file '+DATA/G_XSHIS/ONLINELOG/group_4.267.922142843' to '/home/oracle/app/oracle/oradata/gxshis/redo_file/REDO04.log';

Database altered.

SQL>
Database altered.

SQL>
Database altered.

SQL>
Database altered.

--select 'alter database rename file '''||name||''' to ''$new_dest/tempXXX.dbf'';' from v$tempfile;
SQL> alter database rename file '+DATA/g_xshis/tablespaces/tsp_tmp.dbf' to '/home/oracle/app/oracle/oradata/gxshis/tsp_tmp.dbf';

Database altered.

SQL> alter database open read only;

Database altered.

SQL> select instance_name, status from v$instance;

INSTANCE_NAME    STATUS
---------------- ------------
gxshis           OPEN

SQL> select dbid, open_mode from v$database;

      DBID OPEN_MODE
---------- --------------------
1872785972 READ ONLY

SQL> select file_name from dba_data_files;

FILE_NAME
--------------------------------------------------------------------------------
/home/oracle/app/oracle/oradata/gxshis/SYSTEM
/home/oracle/app/oracle/oradata/gxshis/SYSAUX
/home/oracle/app/oracle/oradata/gxshis/UNDOTBS1
/home/oracle/app/oracle/oradata/gxshis/USERS
/home/oracle/app/oracle/oradata/gxshis/UNDOTBS2
/home/oracle/app/oracle/oradata/gxshis/TSP_ACCT
/home/oracle/app/oracle/oradata/gxshis/TSP_BLDBANK
/home/oracle/app/oracle/oradata/gxshis/TSP_CLINPATH
/home/oracle/app/oracle/oradata/gxshis/TSP_COMM
/home/oracle/app/oracle/oradata/gxshis/TSP_CPR
/home/oracle/app/oracle/oradata/gxshis/TSP_HEALTHCARE

FILE_NAME
--------------------------------------------------------------------------------
/home/oracle/app/oracle/oradata/gxshis/TSP_HISUSER
/home/oracle/app/oracle/oradata/gxshis/TSP_INFECT
/home/oracle/app/oracle/oradata/gxshis/TSP_INPADM
/home/oracle/app/oracle/oradata/gxshis/TSP_INPBILL
/home/oracle/app/oracle/oradata/gxshis/TSP_INQUIRE
/home/oracle/app/oracle/oradata/gxshis/TSP_INSURANCE
/home/oracle/app/oracle/oradata/gxshis/TSP_INTERFACE
/home/oracle/app/oracle/oradata/gxshis/TSP_LAB
/home/oracle/app/oracle/oradata/gxshis/TSP_MEDADM
/home/oracle/app/oracle/oradata/gxshis/TSP_MEDREC
/home/oracle/app/oracle/oradata/gxshis/TSP_MOBILE

FILE_NAME
--------------------------------------------------------------------------------
/home/oracle/app/oracle/oradata/gxshis/TSP_NURSING
/home/oracle/app/oracle/oradata/gxshis/TSP_ORDADM
/home/oracle/app/oracle/oradata/gxshis/TSP_OUTPADM
/home/oracle/app/oracle/oradata/gxshis/TSP_OUTPBILL
/home/oracle/app/oracle/oradata/gxshis/TSP_OUTPDOCT
/home/oracle/app/oracle/oradata/gxshis/TSP_PHARMACY
/home/oracle/app/oracle/oradata/gxshis/TSP_PHYEXAM
/home/oracle/app/oracle/oradata/gxshis/TSP_REPORT
/home/oracle/app/oracle/oradata/gxshis/TSP_SURGERY
/home/oracle/app/oracle/oradata/gxshis/TSP_TJ
/home/oracle/app/oracle/oradata/gxshis/TSP_TJHISRPT

FILE_NAME
--------------------------------------------------------------------------------
/home/oracle/app/oracle/oradata/gxshis/TSP_WSYY
/home/oracle/app/oracle/oradata/gxshis/TSP_EXAM
/home/oracle/app/oracle/oradata/gxshis/TSP_EQUIPMENT
/home/oracle/app/oracle/oradata/gxshis/TSP_ECONSTAT
/home/oracle/app/oracle/oradata/gxshis/TSP_OTHERS
/home/oracle/app/oracle/oradata/gxshis/TSP_EMR
/home/oracle/app/oracle/oradata/gxshis/TSP_NSM

40 rows selected.

SQL> select file_name from dba_temp_files;

FILE_NAME
--------------------------------------------------------------------------------
/home/oracle/app/oracle/oradata/gxshis/G_XSHIS/datafile/o1_mf_temp_cylqxgd5_.tmp
/home/oracle/app/oracle/oradata/gxshis/tsp_tmp.dbf

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/home/oracle/app/oracle/oradata/gxshis/redo_file/REDO02.log
+FLASH/G_XSHIS/ONLINELOG/group_2.258.922142583
/home/oracle/app/oracle/oradata/gxshis/redo_file/REDO01.log
+FLASH/G_XSHIS/ONLINELOG/group_1.257.922142583
/home/oracle/app/oracle/oradata/gxshis/redo_file/REDO03.log
+FLASH/G_XSHIS/ONLINELOG/group_3.259.922142843
/home/oracle/app/oracle/oradata/gxshis/redo_file/REDO04.log
+FLASH/G_XSHIS/ONLINELOG/group_4.260.922142843

8 rows selected.

SQL> show parameter control

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7
control_files                        string      /home/oracle/app/oracle/oradat
                                                 a/gxshis/current.261.922142579
                                                 , /home/oracle/app/oracle/orad
                                                 ata/gxshis/current.256.9221425
                                                 79
control_management_pack_access       string      DIAGNOSTIC+TUNING
SQL> show parameter pfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string
SQL>
 
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount pfile='/home/oracle/app/oracle/product/12.1.0/db_1/dbs/initgxshis.ora';
ORA-32006: SEC_CASE_SENSITIVE_LOGON initialization parameter has been deprecated
ORACLE instance started.

Total System Global Area 4.0668E+10 bytes
Fixed Size                  4507752 bytes
Variable Size            5502928792 bytes
Database Buffers         3.5031E+10 bytes
Redo Buffers              129708032 bytes
Database mounted.

SQL>alter database open resetlogs;

至此rman異機恢復還原基本完成。


SQL>create spfile from pfile;

SQL> shutdown immediate

SQL> startup

select o.object_type,o.status,count(1) cnt from dba_objects o join dba_users u on o.owner = u.username  
where u.default_tablespace like 'TSP%'
group by o.object_type,o.status;

select o.object_type,o.status,o.owner||'.'||o.object_name vname from dba_objects o join dba_users u on o.owner = u.username  
where u.default_tablespace like 'TSP%' and o.status ='INVALID';







--select 'set newname for datafile '||t.file_id||' to ''/home/oracle/app/oracle/oradata/gxshis/'||t.tablespace_name||'''; ' from dba_data_files t;

rman target / log=restore.log <<EOF
run {
allocate channel c1 device type disk;
allocate channel c2 device type disk;
set newname for datafile 1 to '/home/oracle/app/oracle/oradata/gxshis/SYSTEM';
set newname for datafile 3 to '/home/oracle/app/oracle/oradata/gxshis/SYSAUX';
set newname for datafile 5 to '/home/oracle/app/oracle/oradata/gxshis/UNDOTBS2';
set newname for datafile 6 to '/home/oracle/app/oracle/oradata/gxshis/USERS';
set newname for datafile 2 to '/home/oracle/app/oracle/oradata/gxshis/TSP_ACCT';
set newname for datafile 4 to '/home/oracle/app/oracle/oradata/gxshis/UNDOTBS1';
set newname for datafile 7 to '/home/oracle/app/oracle/oradata/gxshis/TSP_BLDBANK';
set newname for datafile 8 to '/home/oracle/app/oracle/oradata/gxshis/TSP_CLINPATH';
set newname for datafile 9 to '/home/oracle/app/oracle/oradata/gxshis/TSP_COMM';
set newname for datafile 10 to '/home/oracle/app/oracle/oradata/gxshis/TSP_CPR';
set newname for datafile 11 to '/home/oracle/app/oracle/oradata/gxshis/TSP_HEALTHCARE';
set newname for datafile 12 to '/home/oracle/app/oracle/oradata/gxshis/TSP_HISUSER';
set newname for datafile 13 to '/home/oracle/app/oracle/oradata/gxshis/TSP_INFECT';
set newname for datafile 14 to '/home/oracle/app/oracle/oradata/gxshis/TSP_INPADM';
set newname for datafile 15 to '/home/oracle/app/oracle/oradata/gxshis/TSP_INPBILL';
set newname for datafile 16 to '/home/oracle/app/oracle/oradata/gxshis/TSP_INQUIRE';
set newname for datafile 17 to '/home/oracle/app/oracle/oradata/gxshis/TSP_INSURANCE';
set newname for datafile 18 to '/home/oracle/app/oracle/oradata/gxshis/TSP_INTERFACE';
set newname for datafile 19 to '/home/oracle/app/oracle/oradata/gxshis/TSP_LAB';
set newname for datafile 20 to '/home/oracle/app/oracle/oradata/gxshis/TSP_MEDADM';
set newname for datafile 21 to '/home/oracle/app/oracle/oradata/gxshis/TSP_MEDREC';
set newname for datafile 22 to '/home/oracle/app/oracle/oradata/gxshis/TSP_MOBILE';
set newname for datafile 23 to '/home/oracle/app/oracle/oradata/gxshis/TSP_NURSING';
set newname for datafile 24 to '/home/oracle/app/oracle/oradata/gxshis/TSP_ORDADM';
set newname for datafile 25 to '/home/oracle/app/oracle/oradata/gxshis/TSP_OUTPADM';
set newname for datafile 26 to '/home/oracle/app/oracle/oradata/gxshis/TSP_OUTPBILL';
set newname for datafile 27 to '/home/oracle/app/oracle/oradata/gxshis/TSP_OUTPDOCT';
set newname for datafile 28 to '/home/oracle/app/oracle/oradata/gxshis/TSP_PHARMACY';
set newname for datafile 29 to '/home/oracle/app/oracle/oradata/gxshis/TSP_PHYEXAM';
set newname for datafile 30 to '/home/oracle/app/oracle/oradata/gxshis/TSP_REPORT';
set newname for datafile 31 to '/home/oracle/app/oracle/oradata/gxshis/TSP_SURGERY';
set newname for datafile 32 to '/home/oracle/app/oracle/oradata/gxshis/TSP_TJ';
set newname for datafile 33 to '/home/oracle/app/oracle/oradata/gxshis/TSP_TJHISRPT';
set newname for datafile 34 to '/home/oracle/app/oracle/oradata/gxshis/TSP_WSYY';
set newname for datafile 35 to '/home/oracle/app/oracle/oradata/gxshis/TSP_EXAM';
set newname for datafile 36 to '/home/oracle/app/oracle/oradata/gxshis/TSP_EQUIPMENT';
set newname for datafile 37 to '/home/oracle/app/oracle/oradata/gxshis/TSP_ECONSTAT';
set newname for datafile 38 to '/home/oracle/app/oracle/oradata/gxshis/TSP_OTHERS';
set newname for datafile 39 to '/home/oracle/app/oracle/oradata/gxshis/TSP_EMR';
set newname for datafile 40 to '/home/oracle/app/oracle/oradata/gxshis/TSP_NSM';
restore database;   
switch datafile all;
release channel c1;
release channel c2;
}
EOF











相關推薦

oracle 12c RMAN恢復還原RAC叢集(ASM)例項(檔案系統)記錄

CONFIGURE CONTROLFILE AUTOBACKUP ON備份集準備 backup database format '/home/databak/whole_%d_%U'; backup spfile format '/home/databak/spfile_%

Oracle 例項 遷移到 RAC 例項 -- 使用RMAN 恢復

Oracle 官網有關單例項遷移到RAC的一個步驟說明: How to Convert 10g Single-Instance database to 10g RAC using Manua

Oracle RMAN恢復歸檔RMAN-07518(供日誌挖掘使用)及修改dbid步驟

Recovery Manager: Release 11.2.0.4.0 - Production on Sat Jul 16 15:35:06 2016 Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

RMAN恢復資料庫

      RMAN> list backup;   RMAN-00571: ===========================================================   RMAN-00569: =============== ERROR MESSAGE STACK FOL

oracle 12c 多租戶 pdb 恢復(單個pdb數據文件、非系統pdb表空間、整個pdb數據

數據文件 ota ora-01110 創建 正常 方式 cti users rman 環境:數據庫版本 Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production實驗準備:1.--

ORACLE 11G 中採用rman備份恢復資料庫詳細過程

場景:        有一個生產庫的使用者下面所有的表都不見了,懷疑人為被刪除了,現在需要用備份去恢復下,找出原來的表,線上是oracle dataguard環境,有全庫備份檔案,準備去測試庫恢復一下。1,從生產庫上copy好全備份檔案恢復資料庫需要準備的檔案:rman完整備

rac環境rman備份恢復至單機

2、將rac環境的rman備份拷貝到單機。並就rac環境pfile copy到單機,根據單機主機資源,修改叢集引數,例項名,檔案路徑以及sga和pga等引數。修改如下: [[email protected] trace]$ more /backup/test1.ora binbin1.__db_ca

ORACLE 只有rman 完整備份恢復

恢復資料庫需要準備的檔案:rman完整備份(包括資料檔案、日誌檔案、控制檔案、引數檔案),記錄源資料庫的DBID 一、安裝資料庫ORACLE資料庫軟體並建立跟源資料庫同名和資料庫SID並修改資料庫DBID跟源資料庫DBID一樣,建立跟源資料庫伺服器相同的資料檔案目錄、日誌檔

RAC+ADG 恢復報錯-ORA-16072

orm port tran sql tin ict 可用 protect store 1、環境描述11g RAC+ADG 最大可用模式 2、異機恢復告警日誌報錯如下:ORA-16072: a minimum of one standby database destinati

Rman備份恢復

最後更新時間:2018/12/29 前置條件 已準備一臺安裝好Centos6+oracle11gr2 軟體的伺服器; 只安裝了 oracle 資料庫軟體,需要手工建立以下目錄: #環境變數 export ORACLE_SID=orcl #由於只安裝軟體未建立資料庫所以需建立對應資料夾 mkdir -p $

oracle 恢復asm檔案系統成功例項

1.1   確實 源資料庫與目標庫版本一致  語句:select * from v$version; 源庫: 1.2   確認源資料庫名與目標庫資料庫名一致  查詢資料庫名語句:select name fromv$database; 如果不一致通過恢復spfile檔

oracle恢復參考官方文檔

ocata backups class sta eat ndb done online diff How to use Rman Duplicate on ASM/RAC/OMF/Single Instance (Doc ID 840647.1) How to perfo

oracle恢復測試

(一)問題背景 最近在生產環境中,開發人員誤操作,使用truncate將oracle資料庫某個表的資料全部刪除了,在刪除之後,開發人員發現自己闖禍了,於是聯絡值班的DBA進行緊急資料恢復。 經過分析,表被truncate後,使用一般的閃回表、閃回查詢、閃回事物等方法,是不可能將資料找回來的,可以使用閃回資料庫

NBU 恢復 SQL Server

nbu7 netbackup7 備份 sql server ms-sql 異機恢復創建SQL恢復腳本在SQL Server服務器上打開NBU SQL Client選擇Restore SQL Server Objects3、SQL HOST寫本機4、選擇需要還原的庫,並保存腳本創建SQL恢復策略1、類型選擇MS

Oracle 12C 新特性之 恢復

play 截斷 mman temp 租戶 ict total 重啟 修改表結構 RMAN的表級和表分區級恢復應用場景:1、You need to recover a very small number of tables to a particular point in t

Oracle 12C rman

sqlplus 通過 對象 ndb edit ise copyright 用戶 管理 1.1. RMAN連接數據庫RMAN可通過操作系統認證和密碼文件兩種方式連接到一個目標數據庫,使用RMAN備份恢復工具的用戶需要具有SYSDBA或SYSBACKUP系統權限,如果用戶需要

[原創]Oracle 12c的備份和恢復策略

alt star 恢復數據庫 空間 開啟歸檔 acl eas spf bak Oracle 12c的備份和恢復策略(RMAN備份[開啟歸檔/控制文件/數據文件/歸檔日誌]): 備份策略: * 每半年做一個數據庫的全備份(包括所有的數據和只讀表空間) * 每周做一次零

oracle 表資料刪除後恢復還原

資料庫表還原到某時間點 還原語句 使用如下sql語句就可以還原整張表格資料到某個時間點,前提條件:該表的表格式沒有變動(如:欄位的修改等) ALTER TABLE 表名 ENABLE ROW MOVEMENT; FLASHBACK TABLE 表名 TO TIMESTAMP

Oracle 12c 資料庫備份與恢復

這是一篇學習筆記,在這篇筆記中,對Oracle資料庫和歸檔日誌進行了備份,然後將資料庫刪掉。之後通過恢復spfile+恢復控制檔案+restore資料庫+recover資料庫的方式進行了恢復。環境: Oracle 12.2.0.1.0 on LINUX準備工作: 資料庫為歸檔

Oracle Database 12.1 中遷移恢復數據【實戰】

異機恢復 oracle12c restore recover 平臺環境:源OS:Oracle Linux 7.3源DB:Oracle Database 12.1.0.2 目標OS:Oracle Linux 7.3目標DB:Oracle Database 12.1.0.2一、準備工作1、查詢當前