-
Notifications
You must be signed in to change notification settings - Fork 9
Mémo création stby sur FS
PhilippeLeroux edited this page May 22, 2017
·
3 revisions
- Base Primary PRIMDB (existante donc) serveur srvprimdb01
- Base Physical PHYDB (qui sera créée) serveur srvphydb01
- tnsnames.ora : ajouter les alias PRIMDB & PHYDB
- listener.ora : ajouter 2 entrées statiques :
- la base exemple :
- le broker exemple :
Arrêt/démarrage du listener pour prendre en compte la config.
alter database add standby logfile thread 1 size 64M;
[...]
La taille des SRLs doit être identique à la taille des redos.
alter system set standby_file_management='AUTO' scope=both sid='*';
alter system set dg_broker_config_file1 = '/u02/database/PRIMDB/dr1db_PRIMDB.dat' scope=both sid='*';
alter system set dg_broker_config_file2 = '/u03/recovery/PRIMDB/dr2db_PRIMDB.dat' scope=both sid='*';
alter system set dg_broker_start=true scope=both sid='*';
alter database force logging;
CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY;
(ignorer la warning)
scp $ORACLE_HOME/dbs/orapwPRIMDB srvphydb01:$ORACLE_BASE/12.2.0.1/dbhome_1/dbs/orapwPHYDB
Est ce encore utile en 12.2 ? A tester !
Créér le répertoire adump
ssh srvphydb01 mkdir -p $ORACLE_BASE/admin/PHYDB/adump
Mettre à jour oratab
ssh oracle@srvphydb01 '. .bash_profile; echo "PHYDB:$ORACLE_HOME:Y" >> /etc/oratab'
Connecter sur le serveur 'Physical' :
Créér les répertoires :
mkdir -p /u02/database/PHYDB
mkdir -p /u03/recovery/PHYDB
Démarrer la base :
echo "db_name='PHYDB'" > /u01/app/oracle/12.2.0.1/dbhome_1/dbs/initPHYDB.ora
sqlplus sys/Oracle12 as sysdba
startup nomount
exit
rman target sys/Oracle12@PRIMDB auxiliary sys/Oracle12@PHYDB @/tmp/duplicate.rman
Recovery Manager: Release 12.2.0.1.0 - Production on Wed Apr 19 16:34:52 2017
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
connected to target database: PRIMDB (DBID=3429563326)
connected to auxiliary database: PHYDB (not mounted)
RMAN> run {
2> allocate channel prim1 type disk;
3> allocate channel prim2 type disk;
4> allocate auxiliary channel stby1 type disk;
5> allocate auxiliary channel stby2 type disk;
6> duplicate target database for standby from active database
7> using compressed backupset
8> spfile
9> parameter_value_convert 'PRIMDB','PHYDB'
10> set db_name='PRIMDB' #Obligatoire en 12.2, sinon le duplicate échoue.
11> set db_unique_name='PHYDB'
12> set db_create_file_dest='/u02/database'
13> set db_recovery_file_dest='/u03/recovery'
14> set control_files='/u02/database/PHYDB/control01.ctl','/u03/recovery/PHYDB/control02.ctl'
15> set cluster_database='false'
16> nofilenamecheck
17> ;
18> }
19>
create configuration 'DGCONF' as primary database is PRIMDB connect identifier is PRIMDB;
enable configuration;
add database PHYDB as connect identifier is PHYDB maintained as physical;
enable database PHYDB;
sqlplus -s sys/Oracle12@PHYDB as sysdba
alter database open read only;
sqlplus sys/Oracle12@PHYDB as sysdba
alter database flashback on;
alter database enable block change tracking;
exit
Sinon la mise en place des sauvegardes échoues
RMAN> delete noprompt copy of database;
2> delete noprompt backup;
3> crosscheck backup;
4> delete noprompt expired backup;
5> crosscheck copy of database;
6> delete noprompt expired copy of database;
7>