By Mouhamadou Diaw
The ODA X4 is still in use for some customers. The last time I was asked to validate the backups . Let me explain the context. Actually the backups are done via RMAN on local in a NFS share. After these backups are backep up by Netback on tape.
The goal was just to validate that the backups done by Netback can be used to restore if needed.
So the backup teams restored the backups of one database in a directory and then we duplicate this database using these backups.
The source database is SRCDB
The target database will be named TESTQ
The backup from tape are copied in /shareback/backup/test_restauration
Below the the server characteristics
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
[root@ ~]# oakcli show server Power State : On Open Problems : 0 Model : ODA X4-2 Type : Rack Mount Part Number : 32974004+1+1 Serial Number : 1435NMP00A Primary OS : Not Available ILOM Address : 10.120.128.111 ILOM MAC Address : 00:10:E0:5F:4D:2E Description : Oracle Database Appliance X4-2 1435NMP00A Locator Light : Off Actual Power Consumption : 234 watts Ambient Temperature : 23.000 degree C Open Problems Report : System is healthy[root@ ~]# |
On the source the datafiles are stored here
|
1
|
/u02/app/oracle/oradata/datastore/.ACFS/snaps/SRCDB/SRCDB/ |
As for every duplicate we have to prepare the directories for the target database. But there is a problem with the ODA as I connot create any directory under the snaps directory
|
1
2
3
|
oracle@:/u02/app/oracle/oradata/datastore/.ACFS/snaps/ [TESTQ] mkdir TESTQmkdir: cannot create directory `TT': Permission deniedoracle@:/u02/app/oracle/oradata/datastore/.ACFS/snaps/ [TESTQ] |
As I cannot manually create any directory, I have two solutions
1-Create an empty database named TESTQ with oakcli create database and then remove the datafiles after
2-Create the storage for the future database TESTQ using oakcli create dbstorage.
|
1
2
3
4
5
6
7
8
9
10
11
12
|
[root@srvodap01n1test_restauration]# oakcli create dbstorage -hUsage: oakcli create dbstorage -db [-cdb] where: db_name - Setup the required ACFS storage structure for the database cdb - This needs to be passed in case of cdb database This storage structure can be used for migrating databases from ASM to ACFS e.t.c[root@srvodap01n1test_restauration]# |
As we can see create dbstorage will create all required directories for the new database. So we use the 2nd methode. We were using an X4 ODA and the command create storage has to be launched from the first node
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
[root@srvodap01n0 snaps]# oakcli create dbstorage -db TESTQINFO: 2020-09-17 13:49:47: Please check the logfile '/opt/oracle/oak/log/srvodap01n0/tools/12.1.2.12.0/createdbstorage_TESTQ_1793.log' for more detailsPlease enter the 'SYSASM' password : (During deployment we set the SYSASM password to 'welcome1'):Please re-enter the 'SYSASM' password:Please select one of the following for Database Class [1 .. 3] :1 => odb-01s ( 1 cores , 4 GB memory)2 => odb-01 ( 1 cores , 8 GB memory)3 => odb-02 ( 2 cores , 16 GB memory)1The selected value is : odb-01s ( 1 cores , 4 GB memory)...SUCCESS: Ran /usr/bin/rsync -tarqvz /opt/oracle/oak/onecmd/ [email protected]:/opt/oracle/oak/onecmd --exclude=*zip --exclude=*gz --exclude=*log --exclude=*trc --exclude=*rpm and it returned: RC=0.........SUCCESS: All nodes in /opt/oracle/oak/onecmd/tmp/db_nodes are pingable and alive.INFO: 2020-09-17 13:53:44: Successfully setup the storage structure for the database 'TESTQ'INFO: 2020-09-17 13:53:45: Set the following directory structure for the Database TESTQINFO: 2020-09-17 13:53:45: DATA: /u02/app/oracle/oradata/datastore/.ACFS/snaps/TESTQINFO: 2020-09-17 13:53:45: REDO: /u01/app/oracle/oradata/datastore/TESTQINFO: 2020-09-17 13:53:45: RECO: /u01/app/oracle/fast_recovery_area/datastore/TESTQSUCCESS: 2020-09-17 13:53:45: Successfully setup the Storage for the Database : TESTQ[root@srvodap01n0 snaps]# |
Once the storage created we start the new instance TESTQ on nomount state with a minimum of configuration parameters
|
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
|
oracle@srvodap01n1:/u01/app/oracle/local/dmk/etc/ [TESTQ] sqhSQL*Plus: Release 12.1.0.2.0 Production on Thu Sep 17 14:11:43 2020Copyright (c) 1982, 2014, Oracle. All rights reserved.Connected to an idle instance.SQL> startup nomount pfile='/u02/app/oracle/oradata/datastore/.ACFS/snaps/TESTQ/TESTQ/initTESTQ.ora'ORACLE instance started.Total System Global Area 4294967296 bytesFixed Size 2932632 bytesVariable Size 889192552 bytesDatabase Buffers 3372220416 bytesRedo Buffers 30621696 bytesSQL> show parameter db_uniNAME TYPE VALUE------------------------------------ ----------- ------------------------------db_unique_name string TESTQSQL> show parameter db_nameNAME TYPE VALUE------------------------------------ ----------- ------------------------------db_name string TESTQSQL> show parameter control_filesNAME TYPE VALUE------------------------------------ ----------- ------------------------------control_files string /u01/app/oracle/product/12.1.0 .2/dbhome_2/dbs/cntrlTESTQ.dbfSQL>SQL> show parameter db_creNAME TYPE VALUE------------------------------------ ----------- ------------------------------db_create_file_dest string /u02/app/oracle/oradata/datast ore/.ACFS/snaps/TESTQdb_create_online_log_dest_1 string /u01/app/oracle/oradata/datast ore/TESTQdb_create_online_log_dest_2 string /u01/app/oracle/oradata/datast ore/TESTQdb_create_online_log_dest_3 stringdb_create_online_log_dest_4 stringdb_create_online_log_dest_5 stringSQL> |
Once the instance started, we can now lunch the duplicate command. Juste note that the output was truncated
|
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
Recovery Manager: Release 12.1.0.2.0 - Production on Thu Sep 17 14:18:17 2020Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.RMAN> connect auxiliary /connected to auxiliary database: TESTQ (not mounted)run{ALLOCATE AUXILIARY CHANNEL c1 DEVICE TYPE DISK;ALLOCATE AUXILIARY CHANNEL c2 DEVICE TYPE DISK;DUPLICATE DATABASE TO TESTQ BACKUP LOCATION '/shareback/backup/test_restauration';release channel c2;release channel c2;8> }allocated channel: c1channel c1: SID=17 device type=DISKallocated channel: c2channel c2: SID=177 device type=DISKStarting Duplicate Db at 17-SEP-2020 14:18:46contents of Memory Script:{ sql clone "create spfile from memory";}executing Memory Scriptsql statement: create spfile from memorycontents of Memory Script:{ shutdown clone immediate; startup clone nomount;}executing Memory ScriptOracle instance shut downconnected to auxiliary database (not started)Oracle instance startedTotal System Global Area 4294967296 bytesFixed Size 2932632 bytesVariable Size 889192552 bytesDatabase Buffers 3372220416 bytesRedo Buffers 30621696 bytesallocated channel: c1channel c1: SID=16 device type=DISKallocated channel: c2channel c2: SID=177 device type=DISKcontents of Memory Script:{ sql clone "alter system set control_files = ''/u01/app/oracle/oradata/datastore/TESTQ/TESTQ/controlfile/o1_mf_hp6o2sb2_.ctl'', ''/u01/app/oracle/oradata/datastore/TESTQ/TESTQ/controlfile/o1_mf_hp6o2sbm_.ctl'' comment= ''Set by RMAN'' scope=spfile"; sql clone "alter system set db_name = ''SRCDB'' comment= ''Modified by RMAN duplicate'' scope=spfile"; sql clone "alter system set db_unique_name = ''TESTQ'' comment= ''Modified by RMAN duplicate'' scope=spfile"; shutdown clone immediate; startup clone force nomount restore clone primary controlfile from '/shareback/test_restauration/20200916_214502_c-2736611334-20200916-04'; alter clone database mount;}executing Memory Scriptsql statement: alter system set control_files = ''/u01/app/oracle/oradata/datastore/TESTQ/TESTQ/controlfile/o1_mf_hp6o2sb2_.ctl'', ''/u01/app/oracle/oradata/datastore/TESTQ/TESTQ/controlfile/o1_mf_hp6o2sbm_.ctl'' comment= ''Set by RMAN'' scope=spfilesql statement: alter system set db_name = ''SRCDB'' comment= ''Modified by RMAN duplicate'' scope=spfilesql statement: alter system set db_unique_name = ''TESTQ'' comment= ''Modified by RMAN duplicate'' scope=spfileOracle instance shut downOracle instance startedTotal System Global Area 4294967296 bytesFixed Size 2932632 bytesVariable Size 889192552 bytesDatabase Buffers 3372220416 bytesRedo Buffers 30621696 bytesallocated channel: c1channel c1: SID=16 device type=DISKallocated channel: c2channel c2: SID=177 device type=DISKStarting restore at 17-SEP-2020 14:20:21channel c2: skipped, AUTOBACKUP already foundchannel c1: restoring control filechannel c1: restore complete, elapsed time: 00:00:11output file name=/u01/app/oracle/oradata/datastore/TESTQ/TESTQ/controlfile/o1_mf_hp6o2sb2_.ctloutput file name=/u01/app/oracle/oradata/datastore/TESTQ/TESTQ/controlfile/o1_mf_hp6o2sbm_.ctlFinished restore at 17-SEP-2020 14:20:32.......Executing: alter database force loggingcontents of Memory Script:{ Alter clone database open resetlogs;}executing Memory Scriptdatabase openedExecuting: alter database flashback onCannot remove created server parameter fileFinished Duplicate Db at 17-SEP-2020 14:38:31 |
The duplicate was successful
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
oracle@srvodap01n1:/u01/app/oracle/local/dmk/etc/ [TESTQ] TESTQ********* dbi services Ltd. *********STATUS : OPENDB_UNIQUE_NAME : TESTQOPEN_MODE : READ WRITELOG_MODE : ARCHIVELOGDATABASE_ROLE : PRIMARYFLASHBACK_ON : YESFORCE_LOGGING : YESVERSION : 12.1.0.2.0CDB Enabled : NO*************************************oracle@srvodap01n1:/u01/app/oracle/local/dmk/etc/ [TESTQ] |
Hope that will help