Documente Academic
Documente Profesional
Documente Cultură
modus operandi:
1. Mount primary .. take full backup
RMAN> startup mount;
RMAN> backup database plus archivelog;
2. start primary .. create a lot of tables
RMAN> shutdown immediate;
RMAN> startup;
SQL> create table table_dummy as select * from dba_tables;
SQL> insert into table_dummy select * from table_dummy; - rep t
his multiple times
3. switch lot of logfiles ..
this will happen automatically as the table gets large
just commit;
**** dont start the listeners just yet
4. now mount the standby and take a full backup
5. now check the current SCN of the standby
SQL> select current_scn from v$database;
6. take incremental backup on primary for standby
RMAN> backup incremental from scn <current_scn> database format
'/tmp/forStandby_%U' tag 'forStandby';
7. send over the files to the standby server
scp /tmp/forStandby_%U oracle@dg2:/tmp/
8. catalog the files using RMAN with standby as target
RMAN> catalog start with '/tmp/forStand';
9. recover standby database with noredo - recover the standby database w
ith cataloged incremental backup
RMAN> recover database noredo
10. this is in case changes to the database structure have been made:
with RMAN target as primary, backup current controlfile for stan
dby
RMAN> backup current controlfile for standby format '/tmp/forSta
ndbyCtrl.bkp'
11. send over the contrlfile backup to standby.
scp /tmp/forStandbyCtrl.bkp oracle@dg2:/tmp/
database
database
database
database
clear
clear
clear
clear
logfile
logfile
logfile
logfile
group
group
group
group
4;
5;
6;
7;
16. toggle the flshback to invalidate the prior flshback logs (probly)
alter database flashback off;
alter database flashback on;
17. start the MRP.
---------------------------Physical Standby database has NOLOGGING changes on a subset of datafiles
To create this scenario we'll have to turn off force logging, th
en create a table without logging in the users tablespace.
1. create a table on primary and insert values
SQL> desc tmp_tab01
Name
Null?
Type
----------------------------------------- -------- --------------------------A
NUMB
ER
SQL> select * from tmp_tab01;
A
---------1
1
1
1
1
2. create another table on primary as CTAS as:
SQL> create table tmp_tab05 tablespace users nologging a
s select * from tmp_tab01;
Table created.
SQL> select * from tmp_tab05;
A
---------1
1
1
1
1
NUMB
ER
SQL> select * from tmp_tab05;
select * from tmp_tab05
*
ERROR at line 1:
ORA-01578: ORACLE data block corrupted (file # 4, block
# 235)
ORA-01110: data file 4: '/u01/app/oracle/oradata/orcl1/u
sers01.dbf'
ORA-26040: Data block was loaded using the NOLOGGING opt
ion
In Alert Log file at standby
Errors in file /u01/app/oracle/diag/rdbms/orcl1/orcl1/tr
ace/orcl1_ora_4775.trc (incident=25353):
ORA-01578: ORACLE data block corrupted (file # 4, block
# 235)
ORA-01110: data file 4: '/u01/app/oracle/oradata/orcl1/u
sers01.dbf'
ORA-26040: Data block was loaded using the NOLOGGING opt
ion
Incident details in: /u01/app/oracle/diag/rdbms/orcl1/or
cl1/incident/incdir_25353/orcl1_ora_4775_i25353.trc
Errors in file /u01/app/oracle/diag/rdbms/orcl1/orcl1/tr
ace/orcl1_ora_4775.trc (incident=25354):
ORA-01578: ORACLE data block corrupted (file # 4, block
# 235)
ORA-01110: data file 4: '/u01/app/oracle/oradata/orcl1/u
sers01.dbf'
ORA-26040: Data block was loaded using the NOLOGGING opt
ion
Incident details in: /u01/app/oracle/diag/rdbms/orcl1/or
cl1/incident/incdir_25354/orcl1_ora_4775_i25354.trc
Only the following operations can make use of nologging:
SQL*Loader in direct mode
ONLINE
3 /u01/app/oracle/oradata/orcl1/undotbs01.dbf
ONLINE
4 /u01/app/oracle/oradata/orcl1/users01.dbf
RECOVER
5 /u01/app/oracle/oradata/orcl1/tmp_perm01.dbf
ONLINE
alter database recover managed standby database using cu
rrent logfile disconnect;
SQL> select file#, name, status from v$datafile;
FILE# NAME
STATUS
---------- --------------------------------------------------1 /u01/app/oracle/oradata/orcl1/system01.dbf
SYSTEM
2 /u01/app/oracle/oradata/orcl1/sysaux01.dbf
ONLINE
3 /u01/app/oracle/oradata/orcl1/undotbs01.dbf
ONLINE
4 /u01/app/oracle/oradata/orcl1/users01.dbf
ONLINE
5 /u01/app/oracle/oradata/orcl1/tmp_perm01.dbf
ONLINE
----------------------------