-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRMAN_Restore_test_scripts.txt
More file actions
94 lines (74 loc) · 2.75 KB
/
RMAN_Restore_test_scripts.txt
File metadata and controls
94 lines (74 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
Restore and recover a tablespace
rman target / nocatalog
run {
allocate channel a2 type 'SBT_TAPE';
send 'NB_ORA_CLIENT=vorcdevin1,NB_ORA_SERV=untcpnbu01';
SQL 'ALTER TABLESPACE VJTEST OFFLINE';
RESTORE TABLESPACE VJTEST;
RECOVER TABLESPACE VJTEST;
SQL 'ALTER TABLESPACE VJTEST ONLINE';
}
run{
startup mount pfile=/usr/oracle/admin/stgap1a/pfile/initstgap1a.ora;
allocate channel a1 type 'SBT_TAPE';
send 'NB_ORA_CLIENT=vorcprdap1bbk1,NB_ORA_SERV=uhdcbpnbu41';
set newname for datafile 1 to '+STGAP1DG';
set newname for datafile 2 to '+STGAP1DG';
set newname for datafile 3 to '+STGAP1DG';
set newname for datafile 4 to '+STGAP1DG';
set newname for datafile 5 to '+STGAP1DG';
set newname for datafile 6 to '+STGAP1DG';
set newname for datafile 7 to '+STGAP1DG';
set newname for datafile 8 to '+STGAP1DG';
set newname for datafile 9 to '+STGAP1DG';
set newname for datafile 10 to '+STGAP1DG';
set newname for datafile 11 to '+STGAP1DG';
set newname for datafile 12 to '+STGAP1DG';
set newname for datafile 13 to '+STGAP1DG';
set until time "to_date('Oct 07 2011 17:01:42','MON DD YYYY HH24:MI:SS')";
restore database check readonly ;
switch datafile all;
recover database delete archivelog, check readonly;
alter database open RESETLOGS;
release channel a1;
}
restore archivelog
Restore and recover the whole database
startup mount;
rman target / nocatalog
run {
set until time "to_date('Mar 25 2010 02:00:00','MON DD YYYY HH24:MI:SS')";
allocate channel a2 type 'SBT_TAPE';
RESTORE DATABASE;
RECOVER DATABASE;
ALTER DATABASE OPEN RESETLOGS;
}
Restore and recover a datafile
run {
allocate channel a2 type 'SBT_TAPE';
SQL 'ALTER DATABASE DATAFILE 64 OFFLINE';
RESTORE DATAFILE 64;
RECOVER DATAFILE 64;
SQL 'ALTER DATABASE DATAFILE 64 ONLINE';
}
********************************************************************
rman target / nocatalog
run {
set until time "to_date('Mar 22 2010 11:00:00','MON DD YYYY HH24:MI:SS')";
allocate channel a1 type 'SBT_TAPE';
send 'NB_ORA_CLIENT=uddcbdlab01,NB_ORA_SERV=uddcbdlab12';
RESTORE DATABASE;
RECOVER DATABASE;
ALTER DATABASE OPEN RESETLOGS;
release channel a1;
}
*****************************************************************
rman target / nocatalog
run {
allocate channel a1 type 'SBT_TAPE';
send 'NB_ORA_CLIENT=uddcbdlab01,NB_ORA_SERV=uddcbdlab12';
SQL 'ALTER TABLESPACE USERS OFFLINE';
RESTORE TABLESPACE USERS;
RECOVER TABLESPACE USERS;
SQL 'ALTER TABLESPACE USERS ONLINE';
}