oracle 12c RMAN异机恢复还原RAC集群(ASM)为单实例库(文件系统)记录

时间:2023-01-26 21:36:51
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';

操作系统命令:传备份集
[oracle@oracle1 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/
oracle@172.16.28.25'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    
[oracle@oracle1 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;

修改参数文件,并根据参数文件中的参数创建相应的目录

[oracle@orcl 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'
[oracle@orcl 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