Locations of visitors to this page

Wednesday, March 4, 2009

creating standby database with image copies 使用映像拷贝创建备用数据库

creating standby database with image copies
使用复制文件备份方式创建备用数据库


1.
主库停远程归档
sqlplus /nolog <<EOF
conn / as sysdba
alter system set log_archive_dest_2='';
alter system set log_archive_dest_state_2='enable';
exit
EOF


2.
删除备库
sqlplus /nolog <<EOF
conn / as sysdba
shutdown immediate
exit
EOF

cd /home/oracle/app/oracle/oradata
rm -rf test_s.bak
mv test_s test_s.bak
mkdir -p test_s/{archive,flash_recovery_area,utlfile}


3. NFS共享目录
备库共享数据文件目录, 让主库服务器访问, 主库备份到这个目录

备库开启NFS
su - root
service nfs start
exportfs -iv -o rw,no_root_squash dev-rpt-2:/home/oracle/app/oracle/oradata/test_s
[root@DEV-pxy-1 ~]# service nfs start
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
[root@DEV-pxy-1 ~]# exportfs -iv -o rw,no_root_squash dev-rpt-2:/home/oracle/app/oracle/oradata/test_s
exporting DEV-RPT-2.s3lab.mot.com:/home/oracle/app/oracle/oradata/test_s
[root@DEV-pxy-1 ~]#
no_root_squash保留root权限
首先要启portmap服务, 否则启nfs服务报错
Starting NFS services:  [  OK  ]
Starting NFS quotas: Cannot register service: RPC: Unable to receive; errno = Connection refused
rpc.rquotad: unable to register (RQUOTAPROG, RQUOTAVERS, udp).
[FAILED]
Starting NFS daemon: 
...

主库挂载NFS目录
su - root
mkdir -p /mnt/standby-db-oradata
mount -v -t nfs -o rw dev-pxy-1:/home/oracle/app/oracle/oradata/test_s /mnt/standby-db-oradata
[root@DEV-RPT-2 mnt]# mount -v -t nfs -o rw dev-pxy-1:/home/oracle/app/oracle/oradata/test_s /mnt/standby-db-oradata
dev-pxy-1:/home/oracle/app/oracle/oradata/test_s on /mnt/standby-db-oradata type nfs (rw,addr=192.168.12.51)
[root@DEV-RPT-2 mnt]# ls -l /mnt/standby-db-oradata
total 12
drwxr-x---  2 oracle oinstall 4096 Mar  4 02:53 archive
drwxr-x---  2 oracle oinstall 4096 Mar  4 02:53 flash_recovery_area
drwxr-x---  2 oracle oinstall 4096 Mar  4 02:53 utlfile
[root@DEV-RPT-2 mnt]#
挂载nfs最好加上oracle的建议参数 hard,bg,proto=tcp,suid,rsize=32768,wsize=32768,noac
(noac用于RAC环境)
比如: rw,bg,hard,rsize=32768,wsize=32768,nfsvers=3,proto=tcp,nointr,timeo=600
否则RMAN报错ORA-27054
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on c1 channel at 03/04/2009 17:29:27
ORA-19504: failed to create file "/mnt/other/df_data01.dbf"
ORA-27054: NFS file system where the file is created or resides is not mounted with correct options
Add ...

如何取消NFS共享:
备库端先umount nfs目录, 主库端再用exportfs -u ... 取消共享, 最后停止nfs等服务


4. 查询数据库信息

查询系统变更号, 数据文件名等
sqlplus -s /nolog <<'EOF'
conn / as sysdba
set pages 9999 line 140
select current_scn from v$database;
col ts_name for a20
col df_name for a70
select df.file# df_no,ts.name ts_name,df.name df_name
  from v$datafile df, v$tablespace ts
 where df.ts# = ts.ts#
 order by df.file#;
select value from v$parameter where name='log_archive_format';
select * from (select resetlogs_id from v$archived_log order by completion_time desc) where rownum=1;
exit
EOF
[oracle@DEV-RPT-2 ~]$ sqlplus -s /nolog <<'EOF'
> conn / as sysdba
> set pages 9999 line 140
> select current_scn from v$database;
> col ts_name for a20
> col df_name for a70
> select df.file# df_no,ts.name ts_name,df.name df_name
>   from v$datafile df, v$tablespace ts
>  where df.ts# = ts.ts#
>  order by df.file#;
> select value from v$parameter where name='log_archive_format';
> select * from (select resetlogs_id from v$archived_log order by completion_time desc) where rownum=1;
> exit
> EOF

CURRENT_SCN
-----------
    2391414


     DF_NO TS_NAME              DF_NAME
---------- -------------------- ----------------------------------------------------------------------
         1 SYSTEM               /home/oracle/app/oracle/oradata/test/system01.dbf
         2 UNDOTBS1             /home/oracle/app/oracle/oradata/test/undotbs01.dbf
         3 SYSAUX               /home/oracle/app/oracle/oradata/test/sysaux01.dbf
         4 USERS                /home/oracle/app/oracle/oradata/test/users01.dbf
         5 TS_TEST              /home/oracle/app/oracle/oradata/test/ts_test01.dbf


VALUE
--------------------------------------------------------------------------------------------------------------------------------------------
%t_%s_%r.arc


RESETLOGS_ID
------------
   676622925

[oracle@DEV-RPT-2 ~]$



5.
删除主库原来的备份, 以免干扰
rman target /
crosscheck archivelog all;
delete noprompt expired archivelog all;
list backupset;
delete noprompt backupset;
list copy;
delete noprompt copy of controlfile;
delete noprompt copy of datafile 1,2,3,4,5;
delete noprompt copy of archivelog like '/mnt/standby-db-oradata/archive%';
exit


6.
创建IMAGE COPY备份

主库上运行
rman target /
run {
 allocate channel c1 type disk rate 5M;
 copy datafile 1 to '/mnt/standby-db-oradata/system01.dbf';
 backup as copy datafile 2 format '/mnt/standby-db-oradata/undotbs01.dbf';
 backup as copy datafile 3 format '/mnt/standby-db-oradata/sysaux01.dbf';
 backup as copy datafile 4 format '/mnt/standby-db-oradata/users01.dbf';
 backup as copy datafile 5 format '/mnt/standby-db-oradata/ts_test01.dbf';
 sql 'alter system archive log current';
 backup as copy archivelog from scn=2391414 format '/mnt/standby-db-oradata/archive/%h_%e_676622925.arc';
 backup as copy current controlfile for standby format '/mnt/standby-db-oradata/control01.ctl';
 backup as copy controlfilecopy '/mnt/standby-db-oradata/control01.ctl' format '/mnt/standby-db-oradata/control02.ctl';
 backup as copy controlfilecopy '/mnt/standby-db-oradata/control01.ctl' format '/mnt/standby-db-oradata/control03.ctl';
 release channel c1;
}
list copy;
exit
用 allocate channel ... rate ...限制读取的速率

10g中 backup as copy 取代了copy 命令, 这里用copy是为了避免备份system表空间时自动备份控制文件
copy允许覆盖同名文件, 不报错
backup as copy不允许同名文件, 会报错ORA-27038: created file already exists

归档日志可以不用backup as copy备份, 用操作系统命令拷贝到备库也行

用backup as copy controlfilecopy .. 复制2份控制文件备份, 也可以操作系统命令拷贝

[oracle@DEV-RPT-2 ~]$ rman target /

Recovery Manager: Release 10.2.0.4.0 - Production on Wed Mar 4 06:09:45 2009

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database: TEST (DBID=1973292924)

RMAN>

Recovery Manager complete.
[oracle@DEV-RPT-2 ~]$ rman target /

Recovery Manager: Release 10.2.0.4.0 - Production on Wed Mar 4 06:10:38 2009

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database: TEST (DBID=1973292924)

RMAN> run {
2>  allocate channel c1 type disk rate 5M;
3>  copy datafile 1 to '/mnt/standby-db-oradata/system01.dbf';
 backup as copy datafile 2 format '/mnt/standby-db-oradata/undotbs01.dbf';
4> 5>  backup as copy datafile 3 format '/mnt/standby-db-oradata/sysaux01.dbf';
6>  backup as copy datafile 4 format '/mnt/standby-db-oradata/users01.dbf';
7>  backup as copy datafile 5 format '/mnt/standby-db-oradata/ts_test01.dbf';
 sql 'alter system archive log current';
8> 9>  backup as copy archivelog from scn=2391414 format '/mnt/standby-db-oradata/archive/%h_%e_676622925.arc';
10>  backup as copy current controlfile for standby format '/mnt/standby-db-oradata/control01.ctl';
11>  backup as copy controlfilecopy '/mnt/standby-db-oradata/control01.ctl' format '/mnt/standby-db-oradata/control02.ctl';
12>  backup as copy controlfilecopy '/mnt/standby-db-oradata/control01.ctl' format '/mnt/standby-db-oradata/control03.ctl';
13>  release channel c1;
14> }

using target database control file instead of recovery catalog
allocated channel: c1
channel c1: sid=1632 devtype=DISK

Starting backup at 04-MAR-09
channel c1: starting datafile copy
input datafile fno=00001 name=/home/oracle/app/oracle/oradata/test/system01.dbf
output filename=/mnt/standby-db-oradata/system01.dbf tag=TAG20090304T061050 recid=36 stamp=680595110
channel c1: datafile copy complete, elapsed time: 00:01:05
channel c1: throttle time: 0:00:49
Finished backup at 04-MAR-09

Starting backup at 04-MAR-09
channel c1: starting datafile copy
input datafile fno=00002 name=/home/oracle/app/oracle/oradata/test/undotbs01.dbf
output filename=/mnt/standby-db-oradata/undotbs01.dbf tag=TAG20090304T061155 recid=37 stamp=680595155
channel c1: datafile copy complete, elapsed time: 00:00:45
channel c1: throttle time: 0:00:32
Finished backup at 04-MAR-09

Starting backup at 04-MAR-09
channel c1: starting datafile copy
input datafile fno=00003 name=/home/oracle/app/oracle/oradata/test/sysaux01.dbf
output filename=/mnt/standby-db-oradata/sysaux01.dbf tag=TAG20090304T061241 recid=38 stamp=680595198
channel c1: datafile copy complete, elapsed time: 00:00:45
channel c1: throttle time: 0:00:30
Finished backup at 04-MAR-09

Starting backup at 04-MAR-09
channel c1: starting datafile copy
input datafile fno=00004 name=/home/oracle/app/oracle/oradata/test/users01.dbf
output filename=/mnt/standby-db-oradata/users01.dbf tag=TAG20090304T061326 recid=39 stamp=680595208
channel c1: datafile copy complete, elapsed time: 00:00:03
channel c1: throttle time: 0:00:01
Finished backup at 04-MAR-09

Starting backup at 04-MAR-09
channel c1: starting datafile copy
input datafile fno=00005 name=/home/oracle/app/oracle/oradata/test/ts_test01.dbf
output filename=/mnt/standby-db-oradata/ts_test01.dbf tag=TAG20090304T061329 recid=40 stamp=680595229
channel c1: datafile copy complete, elapsed time: 00:00:25
channel c1: throttle time: 0:00:16
Finished backup at 04-MAR-09

sql statement: alter system archive log current

Starting backup at 04-MAR-09
current log archived
channel c1: starting archive copy
input archive log thread=1 sequence=2081 recid=3470 stamp=680594623
output filename=/mnt/standby-db-oradata/archive/1_2081_676622925.arc recid=3478 stamp=680595237
channel c1: archivelog copy complete, elapsed time: 00:00:02
channel c1: starting archive copy
input archive log thread=1 sequence=2079 recid=3466 stamp=680594351
output filename=/mnt/standby-db-oradata/archive/1_2079_676622925.arc recid=3479 stamp=680595239
channel c1: archivelog copy complete, elapsed time: 00:00:02
channel c1: starting archive copy
input archive log thread=1 sequence=2083 recid=3476 stamp=680595235
output filename=/mnt/standby-db-oradata/archive/1_2083_676622925.arc recid=3480 stamp=680595241
channel c1: archivelog copy complete, elapsed time: 00:00:02
channel c1: starting archive copy
input archive log thread=1 sequence=2080 recid=3467 stamp=680594351
output filename=/mnt/standby-db-oradata/archive/1_2080_676622925.arc recid=3481 stamp=680595243
channel c1: archivelog copy complete, elapsed time: 00:00:02
channel c1: starting archive copy
input archive log thread=1 sequence=2082 recid=3471 stamp=680594624
output filename=/mnt/standby-db-oradata/archive/1_2082_676622925.arc recid=3482 stamp=680595245
channel c1: archivelog copy complete, elapsed time: 00:00:02
channel c1: starting archive copy
input archive log thread=1 sequence=2084 recid=3477 stamp=680595235
output filename=/mnt/standby-db-oradata/archive/1_2084_676622925.arc recid=3483 stamp=680595247
channel c1: archivelog copy complete, elapsed time: 00:00:02
Finished backup at 04-MAR-09

Starting backup at 04-MAR-09
channel c1: starting datafile copy
copying standby control file
output filename=/mnt/standby-db-oradata/control01.ctl tag=TAG20090304T061408 recid=41 stamp=680595250
channel c1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 04-MAR-09

Starting backup at 04-MAR-09
channel c1: starting datafile copy
input control file copy name=/mnt/standby-db-oradata/control01.ctl
output filename=/mnt/standby-db-oradata/control02.ctl tag=TAG20090304T061408 recid=42 stamp=680595255
channel c1: datafile copy complete, elapsed time: 00:00:07
channel c1: throttle time: 0:00:03
Finished backup at 04-MAR-09

Starting backup at 04-MAR-09
channel c1: starting datafile copy
input control file copy name=/mnt/standby-db-oradata/control01.ctl
output filename=/mnt/standby-db-oradata/control03.ctl tag=TAG20090304T061408 recid=43 stamp=680595263
channel c1: datafile copy complete, elapsed time: 00:00:07
channel c1: throttle time: 0:00:03
Finished backup at 04-MAR-09

released channel: c1

RMAN> list copy;


List of Datafile Copies
Key     File S Completion Time Ckp SCN    Ckp Time        Name
------- ---- - --------------- ---------- --------------- ----
36      1    A 04-MAR-09       2392559    04-MAR-09       /mnt/standby-db-oradata/system01.dbf
37      2    A 04-MAR-09       2392586    04-MAR-09       /mnt/standby-db-oradata/undotbs01.dbf
38      3    A 04-MAR-09       2392609    04-MAR-09       /mnt/standby-db-oradata/sysaux01.dbf
39      4    A 04-MAR-09       2392629    04-MAR-09       /mnt/standby-db-oradata/users01.dbf
40      5    A 04-MAR-09       2392635    04-MAR-09       /mnt/standby-db-oradata/ts_test01.dbf

List of Control File Copies
Key     S Completion Time Ckp SCN    Ckp Time        Name
------- - --------------- ---------- --------------- ----
43      A 04-MAR-09       2392663    04-MAR-09       /mnt/standby-db-oradata/control03.ctl
42      A 04-MAR-09       2392663    04-MAR-09       /mnt/standby-db-oradata/control02.ctl
41      A 04-MAR-09       2392663    04-MAR-09       /mnt/standby-db-oradata/control01.ctl

List of Archived Log Copies
Key     Thrd Seq     S Low Time  Name
------- ---- ------- - --------- ----
3262    1    1973    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1973_676622925.arc
3264    1    1974    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1974_676622925.arc
3266    1    1975    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1975_676622925.arc
3268    1    1976    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1976_676622925.arc
3270    1    1977    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1977_676622925.arc
3272    1    1978    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1978_676622925.arc
3274    1    1979    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1979_676622925.arc
3276    1    1980    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1980_676622925.arc
3278    1    1981    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1981_676622925.arc
3280    1    1982    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1982_676622925.arc
3282    1    1983    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1983_676622925.arc
3284    1    1984    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1984_676622925.arc
3286    1    1985    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1985_676622925.arc
3288    1    1986    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1986_676622925.arc
3290    1    1987    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1987_676622925.arc
3292    1    1988    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1988_676622925.arc
3294    1    1989    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1989_676622925.arc
3296    1    1990    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1990_676622925.arc
3298    1    1991    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1991_676622925.arc
3300    1    1992    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1992_676622925.arc
3302    1    1993    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1993_676622925.arc
3304    1    1994    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1994_676622925.arc
3306    1    1995    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1995_676622925.arc
3308    1    1996    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1996_676622925.arc
3310    1    1997    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1997_676622925.arc
3312    1    1998    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1998_676622925.arc
3314    1    1999    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_1999_676622925.arc
3316    1    2000    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2000_676622925.arc
3318    1    2001    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2001_676622925.arc
3320    1    2002    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2002_676622925.arc
3322    1    2003    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2003_676622925.arc
3324    1    2004    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2004_676622925.arc
3326    1    2005    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2005_676622925.arc
3328    1    2006    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2006_676622925.arc
3330    1    2007    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2007_676622925.arc
3332    1    2008    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2008_676622925.arc
3334    1    2009    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2009_676622925.arc
3336    1    2010    A 02-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2010_676622925.arc
3338    1    2011    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2011_676622925.arc
3340    1    2012    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2012_676622925.arc
3342    1    2013    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2013_676622925.arc
3344    1    2014    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2014_676622925.arc
3346    1    2015    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2015_676622925.arc
3348    1    2016    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2016_676622925.arc
3350    1    2017    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2017_676622925.arc
3352    1    2018    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2018_676622925.arc
3354    1    2019    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2019_676622925.arc
3356    1    2020    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2020_676622925.arc
3358    1    2021    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2021_676622925.arc
3360    1    2022    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2022_676622925.arc
3362    1    2023    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2023_676622925.arc
3364    1    2024    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2024_676622925.arc
3366    1    2025    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2025_676622925.arc
3368    1    2026    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2026_676622925.arc
3370    1    2027    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2027_676622925.arc
3372    1    2028    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2028_676622925.arc
3374    1    2029    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2029_676622925.arc
3376    1    2030    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2030_676622925.arc
3378    1    2031    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2031_676622925.arc
3380    1    2032    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2032_676622925.arc
3381    1    2033    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2033_676622925.arc
3382    1    2034    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2034_676622925.arc
3383    1    2035    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2035_676622925.arc
3384    1    2036    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2036_676622925.arc
3385    1    2037    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2037_676622925.arc
3386    1    2038    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2038_676622925.arc
3387    1    2039    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2039_676622925.arc
3388    1    2040    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2040_676622925.arc
3389    1    2041    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2041_676622925.arc
3391    1    2042    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2042_676622925.arc
3393    1    2043    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2043_676622925.arc
3395    1    2044    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2044_676622925.arc
3397    1    2045    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2045_676622925.arc
3399    1    2046    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2046_676622925.arc
3401    1    2047    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2047_676622925.arc
3403    1    2048    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2048_676622925.arc
3405    1    2049    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2049_676622925.arc
3407    1    2050    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2050_676622925.arc
3409    1    2051    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2051_676622925.arc
3411    1    2052    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2052_676622925.arc
3413    1    2053    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2053_676622925.arc
3415    1    2054    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2054_676622925.arc
3417    1    2055    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2055_676622925.arc
3419    1    2056    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2056_676622925.arc
3421    1    2057    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2057_676622925.arc
3423    1    2058    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2058_676622925.arc
3425    1    2059    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2059_676622925.arc
3427    1    2060    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2060_676622925.arc
3429    1    2061    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2061_676622925.arc
3431    1    2062    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2062_676622925.arc
3433    1    2063    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2063_676622925.arc
3435    1    2064    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2064_676622925.arc
3437    1    2065    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2065_676622925.arc
3439    1    2066    A 03-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2066_676622925.arc
3441    1    2067    A 04-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2067_676622925.arc
3443    1    2068    A 04-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2068_676622925.arc
3445    1    2069    A 04-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2069_676622925.arc
3447    1    2070    A 04-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2070_676622925.arc
3449    1    2071    A 04-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2071_676622925.arc
3451    1    2072    A 04-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2072_676622925.arc
3452    1    2073    A 04-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2073_676622925.arc
3453    1    2074    A 04-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2074_676622925.arc
3457    1    2075    A 04-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2075_676622925.arc
3458    1    2076    A 04-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2076_676622925.arc
3464    1    2077    A 04-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2077_676622925.arc
3465    1    2078    A 04-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2078_676622925.arc
3479    1    2079    A 04-MAR-09 /mnt/standby-db-oradata/archive/1_2079_676622925.arc
3466    1    2079    A 04-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2079_676622925.arc
3481    1    2080    A 04-MAR-09 /mnt/standby-db-oradata/archive/1_2080_676622925.arc
3467    1    2080    A 04-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2080_676622925.arc
3478    1    2081    A 04-MAR-09 /mnt/standby-db-oradata/archive/1_2081_676622925.arc
3470    1    2081    A 04-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2081_676622925.arc
3482    1    2082    A 04-MAR-09 /mnt/standby-db-oradata/archive/1_2082_676622925.arc
3471    1    2082    A 04-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2082_676622925.arc
3480    1    2083    A 04-MAR-09 /mnt/standby-db-oradata/archive/1_2083_676622925.arc
3476    1    2083    A 04-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2083_676622925.arc
3483    1    2084    A 04-MAR-09 /mnt/standby-db-oradata/archive/1_2084_676622925.arc
3477    1    2084    A 04-MAR-09 /home/oracle/app/oracle/oradata/test/archive/1_2084_676622925.arc

RMAN> exit


Recovery Manager complete.
[oracle@DEV-RPT-2 ~]$


7. 启动备库

密码文件用原来的就行
初始化参数audit_trail不能是db了, 得改成os

启动备库到mount standby database状态
rman target /
startup mount
10g以前用
startup nomount
sql 'alter database mount standby database';

[oracle@DEV-pxy-1 ~]$ rman target /

Recovery Manager: Release 10.2.0.4.0 - Production on Wed Mar 4 06:20:19 2009

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database (not started)

RMAN> startup mount

Oracle instance started
database mounted

Total System Global Area    2147483648 bytes

Fixed Size                     2085320 bytes
Variable Size                486542904 bytes
Database Buffers            1644167168 bytes
Redo Buffers                  14688256 bytes

RMAN>

告警日志:
Wed Mar  4 06:20:39 2009
Starting ORACLE instance (normal)
LICENSE_MAX_SESSION = 500
LICENSE_SESSIONS_WARNING = 150
Picked latch-free SCN scheme 3
Autotune of undo retention is turned on.
IMODE=BR
ILAT =182
LICENSE_MAX_USERS = 0
SYS auditing is enabled
ksdpec: called for event 13740 prior to event group initialization
Starting up ORACLE RDBMS Version: 10.2.0.4.0.
System parameters with non-default values:
  processes                = 1500
  sessions                 = 1655
  resource_limit           = TRUE
  license_max_sessions     = 500
  license_sessions_warning = 150
  __shared_pool_size       = 452984832
  __large_pool_size        = 16777216
  __java_pool_size         = 16777216
  __streams_pool_size      = 0
  filesystemio_options     = setall
  sga_target               = 2147483648
  control_files            = /home/oracle/app/oracle/oradata/test_s/control01.ctl, /home/oracle/app/oracle/oradata/test_s/control02.ctl, /home/oracle/app/oracle/oradata/test_s/control03.ctl
  db_file_name_convert     = /home/oracle/app/oracle/oradata/test/, /home/oracle/app/oracle/oradata/test_s/
  log_file_name_convert    = /home/oracle/app/oracle/oradata/test/, /home/oracle/app/oracle/oradata/test_s/
  control_file_record_keep_time= 30
  db_block_size            = 8192
  __db_cache_size          = 1644167168
  compatible               = 10.2.0.4.0
  log_archive_dest_1       = LOCATION=/home/oracle/app/oracle/oradata/test_s/archive
  log_archive_dest_state_1 = ENABLE
  standby_archive_dest     = /home/oracle/app/oracle/oradata/test_s/archive
  log_archive_format       = %t_%s_%r.arc
  archive_lag_target       = 1800
  db_file_multiblock_read_count= 16
  db_recovery_file_dest    = /home/oracle/app/oracle/oradata/test_s/flash_recovery_area
  db_recovery_file_dest_size= 2147483648
  fast_start_mttr_target   = 300
  undo_management          = AUTO
  undo_tablespace          = UNDOTBS1
  undo_retention           = 10800
  remote_login_passwordfile= EXCLUSIVE
  audit_sys_operations     = TRUE
  db_domain                =
  instance_name            = test_s
  session_cached_cursors   = 200
  utl_file_dir             = /home/oracle/app/oracle/oradata/test_s/utlfile
  job_queue_processes      = 10
  background_dump_dest     = /home/oracle/app/oracle/admin/test_s/bdump
  user_dump_dest           = /home/oracle/app/oracle/admin/test_s/udump
  core_dump_dest           = /home/oracle/app/oracle/admin/test_s/cdump
  audit_file_dest          = /home/oracle/app/oracle/admin/test_s/adump
  audit_trail              = OS
  db_name                  = test
  db_unique_name           = test_s
  open_cursors             = 3000
  pga_aggregate_target     = 52428800
PMON started with pid=2, OS id=15607
PSP0 started with pid=3, OS id=15609
MMAN started with pid=4, OS id=15611
DBW0 started with pid=5, OS id=15613
LGWR started with pid=6, OS id=15615
CKPT started with pid=7, OS id=15617
SMON started with pid=8, OS id=15619
RECO started with pid=9, OS id=15621
CJQ0 started with pid=10, OS id=15623
MMON started with pid=11, OS id=15625
MMNL started with pid=12, OS id=15627
Wed Mar  4 06:20:41 2009
alter database mount
Wed Mar  4 06:20:45 2009
Setting recovery target incarnation to 2
ARCH: STARTING ARCH PROCESSES
ARC0 started with pid=15, OS id=15631
Wed Mar  4 06:20:45 2009
ARC0: Archival started
ARC1: Archival started
ARCH: STARTING ARCH PROCESSES COMPLETE
Wed Mar  4 06:20:45 2009
ARC0: Becoming the 'no FAL' ARCH
ARC0: Becoming the 'no SRL' ARCH
ARC0: Thread not mounted
ARC1 started with pid=16, OS id=15633
ARC1: Becoming the heartbeat ARCH
ARC1: Thread not mounted
Wed Mar  4 06:20:45 2009
Successful mount of redo thread 1, with mount id 1978778425
Wed Mar  4 06:20:45 2009
Physical Standby Database mounted.
Completed: alter database mount


11. 媒体恢复备库

recover database;
RMAN> recover database;

Starting recover at 04-MAR-09
Starting implicit crosscheck backup at 04-MAR-09
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1642 devtype=DISK
Finished implicit crosscheck backup at 04-MAR-09

Starting implicit crosscheck copy at 04-MAR-09
using channel ORA_DISK_1
Crosschecked 5 objects
Finished implicit crosscheck copy at 04-MAR-09

searching for all files in the recovery area
cataloging files...
no files cataloged

using channel ORA_DISK_1

starting media recovery

archive log filename=/home/oracle/app/oracle/oradata/test_s/archive/1_2083_676622925.arc thread=1 sequence=2083
archive log filename=/home/oracle/app/oracle/oradata/test_s/archive/1_2084_676622925.arc thread=1 sequence=2084
archive log filename=/home/oracle/app/oracle/oradata/test_s/archive/1_2084_676622925.arc thread=1 sequence=2085
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 03/04/2009 06:21:05
RMAN-11003: failure during parse/execution of SQL statement: alter database recover logfile '/home/oracle/app/oracle/oradata/test_s/archive/1_2084_676622925.arc'
ORA-00310: archived log contains sequence 2084; sequence 2085 required
ORA-00334: archived log: '/home/oracle/app/oracle/oradata/test_s/archive/1_2084_676622925.arc'

RMAN>

告警日志:
Wed Mar  4 06:21:05 2009
alter database recover datafile list clear
Wed Mar  4 06:21:05 2009
Completed: alter database recover datafile list clear
Wed Mar  4 06:21:05 2009
alter database recover datafile list
 1 , 2 , 3 , 4 , 5
Completed: alter database recover datafile list
 1 , 2 , 3 , 4 , 5
Wed Mar  4 06:21:05 2009
alter database recover if needed
 standby start
Media Recovery Start
Managed Standby Recovery not using Real Time Apply
 parallel recovery started with 2 processes
ORA-279 signalled during: alter database recover if needed
 standby start
...
Wed Mar  4 06:21:05 2009
alter database recover logfile '/home/oracle/app/oracle/oradata/test_s/archive/1_2083_676622925.arc'
Wed Mar  4 06:21:05 2009
Media Recovery Log /home/oracle/app/oracle/oradata/test_s/archive/1_2083_676622925.arc
ORA-279 signalled during: alter database recover logfile '/home/oracle/app/oracle/oradata/test_s/archive/1_2083_676622925.arc'...
Wed Mar  4 06:21:05 2009
alter database recover logfile '/home/oracle/app/oracle/oradata/test_s/archive/1_2084_676622925.arc'
Wed Mar  4 06:21:05 2009
Media Recovery Log /home/oracle/app/oracle/oradata/test_s/archive/1_2084_676622925.arc
ORA-279 signalled during: alter database recover logfile '/home/oracle/app/oracle/oradata/test_s/archive/1_2084_676622925.arc'...
Wed Mar  4 06:21:05 2009
alter database recover logfile '/home/oracle/app/oracle/oradata/test_s/archive/1_2084_676622925.arc'
Wed Mar  4 06:21:05 2009
Media Recovery Log /home/oracle/app/oracle/oradata/test_s/archive/1_2084_676622925.arc
Errors with log /home/oracle/app/oracle/oradata/test_s/archive/1_2084_676622925.arc
ORA-310 signalled during: alter database recover logfile '/home/oracle/app/oracle/oradata/test_s/archive/1_2084_676622925.arc'...
Wed Mar  4 06:21:05 2009
alter database recover cancel
Wed Mar  4 06:21:07 2009
Media Recovery Canceled
Completed: alter database recover cancel


12. 主库开启远程归档
tnsping test_s
sqlplus -s /nolog <<EOF
conn / as sysdba
alter system set log_archive_dest_2='service=test_s optional reopen=60';
alter system set log_archive_dest_state_2='enable';
exit
EOF


13. 备库开启自动恢复
sqlplus /nolog <<EOF
conn / as sysdba
alter database recover managed standby database disconnect from session;
exit
EOF

告警日志:
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
RFS[1]: Assigned to RFS process 15720
RFS[1]: Identified database type as 'physical standby'
Wed Mar  4 06:22:07 2009
RFS LogMiner: Client disabled from further notification
Wed Mar  4 06:22:11 2009
alter database recover managed standby database disconnect from session
Wed Mar  4 06:22:11 2009
Attempt to start background Managed Standby Recovery process (test_s)
MRP0 started with pid=17, OS id=15724
Wed Mar  4 06:22:11 2009
MRP0: Background Managed Standby Recovery process started (test_s)
Managed Standby Recovery not using Real Time Apply
 parallel recovery started with 2 processes
Wed Mar  4 06:22:16 2009
Waiting for all non-current ORLs to be archived...
Wed Mar  4 06:22:16 2009
Errors in file /home/oracle/app/oracle/admin/test_s/bdump/test_s_mrp0_15724.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/home/oracle/app/oracle/oradata/test_s/redo01b.rdo'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 1 thread 1: '/home/oracle/app/oracle/oradata/test_s/redo01.rdo'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Wed Mar  4 06:22:16 2009
Errors in file /home/oracle/app/oracle/admin/test_s/bdump/test_s_mrp0_15724.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/home/oracle/app/oracle/oradata/test_s/redo01b.rdo'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 1 thread 1: '/home/oracle/app/oracle/oradata/test_s/redo01.rdo'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Clearing online redo logfile 1 /home/oracle/app/oracle/oradata/test_s/redo01.rdo
Clearing online log 1 of thread 1 sequence number 2083
Wed Mar  4 06:22:16 2009
Errors in file /home/oracle/app/oracle/admin/test_s/bdump/test_s_mrp0_15724.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/home/oracle/app/oracle/oradata/test_s/redo01b.rdo'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 1 thread 1: '/home/oracle/app/oracle/oradata/test_s/redo01.rdo'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Wed Mar  4 06:22:17 2009
Completed: alter database recover managed standby database disconnect from session
Wed Mar  4 06:22:22 2009
Clearing online redo logfile 1 complete
Wed Mar  4 06:22:22 2009
Errors in file /home/oracle/app/oracle/admin/test_s/bdump/test_s_mrp0_15724.trc:
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: '/home/oracle/app/oracle/oradata/test_s/redo02b.rdo'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 2 thread 1: '/home/oracle/app/oracle/oradata/test_s/redo02.rdo'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Wed Mar  4 06:22:22 2009
Errors in file /home/oracle/app/oracle/admin/test_s/bdump/test_s_mrp0_15724.trc:
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: '/home/oracle/app/oracle/oradata/test_s/redo02b.rdo'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 2 thread 1: '/home/oracle/app/oracle/oradata/test_s/redo02.rdo'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Clearing online redo logfile 2 /home/oracle/app/oracle/oradata/test_s/redo02.rdo
Clearing online log 2 of thread 1 sequence number 2084
Wed Mar  4 06:22:22 2009
Errors in file /home/oracle/app/oracle/admin/test_s/bdump/test_s_mrp0_15724.trc:
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: '/home/oracle/app/oracle/oradata/test_s/redo02b.rdo'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 2 thread 1: '/home/oracle/app/oracle/oradata/test_s/redo02.rdo'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Clearing online redo logfile 2 complete
Wed Mar  4 06:22:27 2009
Errors in file /home/oracle/app/oracle/admin/test_s/bdump/test_s_mrp0_15724.trc:
ORA-00313: open failed for members of log group 3 of thread 1
ORA-00312: online log 3 thread 1: '/home/oracle/app/oracle/oradata/test_s/redo03b.rdo'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 3 thread 1: '/home/oracle/app/oracle/oradata/test_s/redo03.rdo'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Wed Mar  4 06:22:27 2009
Errors in file /home/oracle/app/oracle/admin/test_s/bdump/test_s_mrp0_15724.trc:
ORA-00313: open failed for members of log group 3 of thread 1
ORA-00312: online log 3 thread 1: '/home/oracle/app/oracle/oradata/test_s/redo03b.rdo'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 3 thread 1: '/home/oracle/app/oracle/oradata/test_s/redo03.rdo'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Clearing online redo logfile 3 /home/oracle/app/oracle/oradata/test_s/redo03.rdo
Clearing online log 3 of thread 1 sequence number 2085
Wed Mar  4 06:22:27 2009
Errors in file /home/oracle/app/oracle/admin/test_s/bdump/test_s_mrp0_15724.trc:
ORA-00313: open failed for members of log group 3 of thread 1
ORA-00312: online log 3 thread 1: '/home/oracle/app/oracle/oradata/test_s/redo03b.rdo'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 3 thread 1: '/home/oracle/app/oracle/oradata/test_s/redo03.rdo'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Wed Mar  4 06:22:32 2009
Clearing online redo logfile 3 complete
Media Recovery Waiting for thread 1 sequence 2085


14.测试打开备库

只读打开
alter database recover managed standby database cancel;
alter database open;
10g以前用
alter database open read only;


告警日志
Wed Mar  4 06:28:46 2009
alter database recover managed standby database cancel
Wed Mar  4 06:28:48 2009
MRP0: Background Media Recovery cancelled with status 16037
Wed Mar  4 06:28:48 2009
Errors in file /home/oracle/app/oracle/admin/test_s/bdump/test_s_mrp0_15724.trc:
ORA-16037: user requested cancel of managed recovery operation
Recovery interrupted!
Wed Mar  4 06:28:49 2009
Errors in file /home/oracle/app/oracle/admin/test_s/bdump/test_s_mrp0_15724.trc:
ORA-16037: user requested cancel of managed recovery operation
Wed Mar  4 06:28:49 2009
MRP0: Background Media Recovery process shutdown (test_s)
Wed Mar  4 06:28:49 2009
Managed Standby Recovery Canceled (test_s)
Wed Mar  4 06:28:49 2009
Completed: alter database recover managed standby database cancel
Wed Mar  4 06:29:00 2009
alter database open
Wed Mar  4 06:29:00 2009
SMON: enabling cache recovery
Wed Mar  4 06:29:00 2009
Re-creating tempfile /home/oracle/app/oracle/oradata/test_s/temp01.dbf
Re-creating tempfile /home/oracle/app/oracle/oradata/test_s/ts_temp01.dbf
Database Characterset is AL32UTF8
Opening with internal Resource Manager plan
where NUMA PG = 1, CPUs = 2
replication_dependency_tracking turned off (no async multimaster replication found)
Physical standby database opened for read only access.
Completed: alter database open
Wed Mar  4 06:29:01 2009
db_recovery_file_dest_size of 2048 MB is 0.00% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.

复原
alter database recover managed standby database disconnect from session;
告警日志
Wed Mar  4 06:29:26 2009
alter database recover managed standby database disconnect from session
Wed Mar  4 06:29:26 2009
Stopping background process CJQ0
Wed Mar  4 06:29:26 2009
Stopping Job queue slave processes, flags = 27
Wed Mar  4 06:29:26 2009
Job queue slave processes stopped
Wed Mar  4 06:29:26 2009
SMON: disabling cache recovery
Wed Mar  4 06:29:26 2009
Attempt to start background Managed Standby Recovery process (test_s)
MRP0 started with pid=10, OS id=16009
Wed Mar  4 06:29:26 2009
MRP0: Background Managed Standby Recovery process started (test_s)
Managed Standby Recovery not using Real Time Apply
 parallel recovery started with 2 processes
Wed Mar  4 06:29:31 2009
Waiting for all non-current ORLs to be archived...
Media Recovery Waiting for thread 1 sequence 2086
Wed Mar  4 06:29:32 2009
Completed: alter database recover managed standby database disconnect from session


15.
第6步备份数据文件,还有一种方式

首先转换表空间到热备份模式(hot backup mode), alter tablespace xxx begin backup, 10g可以在数据库级alter database begin backup
然后用rsync等工具复制到备库服务器上(rsync能限制传输速度,断点续传)
如:
cd /home/oracle/app/oracle/oradata/test/
rsync -azv --progress --bwlimit=1024 -e ssh ts_test01.dbf oracle@dev-pxy-1:/home/oracle/app/oracle/oradata/test_s/
最后转换成正常模式, alter tablespace xxx end backup;

如果没有切换到热备份模式, 直接就拷数据文件, 到时恢复会报错
WARNING! Recovering data file 1 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 2 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 3 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 4 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 5 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
 parallel recovery started with 2 processes

每个表空间都这样备份一遍
转换表空间到热备份模式的问题是, 导致产生很多重做日志, 影响性能, 所以也不推荐在事务繁忙的生产系统上使用





外部链接:
Creating a Standby Database with Image Copies(这个要备份恢复, 太费事了)
What Happens When A Tablespace/Database Is Kept In Begin Backup Mode
What Happens During a Hot Backup
ORA-27054 ERRORS WHEN RUNNING RMAN WITH NFS


-fin-

No comments:

Website Analytics

Followers