- стопаем базу eisgs03 на уровне кластера
[oracle@odadb1 ~]$ srvctl stop database -d eisgs03
2. применяем окружение
[oracle@odadb1 flashdata]$ . oraenv ORACLE_SID = [oracle] ? eisgs03 The Oracle base has been set to /u01/app/oracle [oracle@odadb1 flashdata]$ export ORACLE_SID=eisgs031
3. подключаемся к экземпляру и стартуем его в режиме nomount
[oracle@odadb1 flashdata]$ sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Fri May 5 09:00:23 2017 Copyright (c) 1982, 2014, Oracle. All rights reserved. Connected to an idle instance. SQL> startup nomount; ORACLE instance started. Total System Global Area 2.1475E+10 bytes Fixed Size 7654304 bytes Variable Size 5301601376 bytes Database Buffers 1.6106E+10 bytes Redo Buffers 59453440 bytes
4. отключаем кластер БД
SQL> alter system set cluster_database = false scope = spfile;
5. рестартуем БД
SQL> shutdown immediate; ORA-01507: database not mounted ORACLE instance shut down. SQL> startup nomount; ORACLE instance started. Total System Global Area 6,4425E+10 bytes Fixed Size 7662000 bytes Variable Size 6174017104 bytes Database Buffers 5,8116E+10 bytes Redo Buffers 126554112 bytes SQL> exit Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, Real Application Clusters, OLAP, Advanced Analytics and Real Application Testing options
После того как мы убедились, что текущая тестовая база больше нам не нужна, можем (опционально) удалить файлы данных базы
они находятся по адресу /u02/app/oracle/oradata/datastore/EISGS03
Подключаемся к RMAN
[oracle@odadb1 flashdata]$ rman Recovery Manager: Release 12.1.0.2.0 - Production on Fri May 5 09:05:46 2017 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
Конектимся к EISGS03 как к вспомогательной
RMAN> connect auxiliary / connected to auxiliary database: EISGS03 (not mounted)
конектимся к EISGS00 как к целевой
RMAN> connect target sys/Пароль_sys@eisgs00
connected to target database: EISGS00 (DBID=3030418748)
запускаем дублирование БД
RMAN> duplicate target database to eisgs03;
/*
Для восстановления базы из чистого бэкапа, мы не подключаемся к целевой (target) базе, а запускаем дублирование, указав место размещение бэкапа, в нашем случае
RMAN> duplicate database to eisgs03 backup location '/u02/app/oracle/oradata/datastore/backup';
*/
После удачного восстановления
выходим из RMAN и переводим базу в режим noarchivelog
RMAN> exit [oracle@odadb1 EISGS03]$ sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Fri May 5 14:20:19 2017 Copyright (c) 1982, 2014, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, Real Application Clusters, OLAP, Advanced Analytics and Real Application Testing options SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> startup mount; ORACLE instance started. Total System Global Area 3,2212E+10 bytes Fixed Size 7662000 bytes Variable Size 6106908240 bytes Database Buffers 2,6038E+10 bytes Redo Buffers 59445248 bytes Database mounted. SQL> alter database noarchivelog; Database altered. SQL> alter database open; Database altered.
переводим базу в кластерный режим
SQL> alter system set cluster_database = TRUE scope=spfile;
Настраиваем XDB
SQL> EXECUTE DBMS_XDB.SETFTPPORT (2122); PL/SQL procedure successfully completed. SQL> EXECUTE DBMS_XDB.SETHTTPPORT ( 8081); PL/SQL procedure successfully completed. SQL> ALTER SYSTEM REGISTER; System altered. SQL> ALTER SYSTEM SET dispatchers = '(PROTOCOL=TCP)(SERVICE=EISGS03XDB)' SCOPE = SPFILE; System altered.
Понижаем оптимизатор
SQL> ALTER SYSTEM SET optimizer_features_enable='11.2.0.4' SCOPE = SPFILE; System altered. SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> exit
Стартуем кластер
[oracle@odadb1 EISGS03]$ srvctl start database -d eisgs03