2011-12-13
---核心standby 恢复
---核心standby 恢复
SQL> show parameter spfile;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string /dev/rlvbusspfile
------------------------------------ ----------- ------------------------------
spfile string /dev/rlvbusspfile
SQL> show parameter control;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 7
control_files string /dev/rlvbusctl01, /dev/rlvbusc
tl02, /dev/rlvbusctl03
SQL> select * from v$tempfile;
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 7
control_files string /dev/rlvbusctl01, /dev/rlvbusc
tl02, /dev/rlvbusctl03
SQL> select * from v$tempfile;
FILE# CREATION_CHANGE# CREATION_T TS# RFILE# STATUS ENABLED BYTES BLOCKS CREATE_BYTES BLOCK_SIZE NAME
---------- ---------------- ---------- ---------- ---------- ------- ---------- ---------- ---------- ------------ ---------- -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 7370 2010-06-14 3 1 ONLINE READ WRITE 20971520 2560 20971520 8192 /dev/rlvbustmp01
2 233099 2010-06-14 3 2 ONLINE READ WRITE 3.2211E+10 3932032 3.2211E+10 8192 /dev/rlvbustmp02
3 233106 2010-06-14 3 3 ONLINE READ WRITE 3.2211E+10 3932032 3.2211E+10 8192 /dev/rlvbustmp03
4 233113 2010-06-14 3 4 ONLINE READ WRITE 3.2211E+10 3932032 3.2211E+10 8192 /dev/rlvbustmp04
---------- ---------------- ---------- ---------- ---------- ------- ---------- ---------- ---------- ------------ ---------- -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 7370 2010-06-14 3 1 ONLINE READ WRITE 20971520 2560 20971520 8192 /dev/rlvbustmp01
2 233099 2010-06-14 3 2 ONLINE READ WRITE 3.2211E+10 3932032 3.2211E+10 8192 /dev/rlvbustmp02
3 233106 2010-06-14 3 3 ONLINE READ WRITE 3.2211E+10 3932032 3.2211E+10 8192 /dev/rlvbustmp03
4 233113 2010-06-14 3 4 ONLINE READ WRITE 3.2211E+10 3932032 3.2211E+10 8192 /dev/rlvbustmp04
SQL> select bytes/1024/1024/1024 from v$tempfile;
BYTES/1024/1024/1024
--------------------
.01953125
29.9990234
29.9990234
29.9990234
--------------------
.01953125
29.9990234
29.9990234
29.9990234
SQL> select file_name from dba_data_files;
FILE_NAME
--------------------------------------------------
/dev/rlvbussystem01
/dev/rlvbusundo101
/dev/rlvbussysaux01
/dev/rlvbusundo201
/dev/rlvbususer01
/dev/rlvbusundo102
/dev/rlvbusundo202
/dev/rlvbusdata01
/dev/rlvbusdata02
/dev/rlvbusidx01
/dev/rlvbusdata03
/dev/rlvbusdata04
/dev/rlvbusdata05
/dev/rlvbusdata06
/dev/rlvbusidx02
/dev/rlvbusdata07
/dev/rlvbusidx03
/dev/rlvaccbiz01
/dev/rlvbusdata08
/dev/rlvbusidx04
/dev/rlvbusidx05
/dev/rlvbusdata09
/dev/rlvbusidx06
/dev/rlvbusrnd01
/dev/rlvbusdata10
/dev/rlvbusidx07
/dev/rlvbusdata11
/dev/rlvbusidx08
/dev/rlvbusrnd02
/dev/rlvbusdata12
/dev/rlvbusidx09
/dev/rlvbusdata13
/dev/rlvbusidx10
/dev/rlvaccbiz02
/dev/rlvbusdata14
/dev/rlvbusidx11
/dev/rlvbusidx12
/dev/rlvbusdata15
/dev/rlvbusidx13
/dev/rlvbusdata16
/dev/rlvbusidx14
/dev/rlvbusdata17
/dev/rlvbusidx15
/dev/rlvbusidx16
/dev/rlvbusdata18
/dev/rlvbusidx17
/dev/rlvbusdata19
/dev/rlvbusidx18
/dev/rlvbusdata20
/dev/rlvbusidx19
/dev/rlvbusidx20
/dev/rlvbusdata21
/dev/rlvbusidx21
/dev/rlvbusdata22
/dev/rlvbusidx22
/dev/rlvbusdata23
/dev/rlvbusidx23
/dev/rlvbusidx24
/dev/rlvbusdata24
/dev/rlvbusidx25
/dev/rlvbusdata25
/dev/rlvbusidx26
/dev/rlvbusidx27
/dev/rlvbusdata26
/dev/rlvbusidx28
/dev/rlvbusdata27
/dev/rlvbusidx29
/dev/rlvbusidx30
/dev/rlvbusdata28
/dev/rlvbusdata29
/dev/rlvbusdata30
--------------------------------------------------
/dev/rlvbussystem01
/dev/rlvbusundo101
/dev/rlvbussysaux01
/dev/rlvbusundo201
/dev/rlvbususer01
/dev/rlvbusundo102
/dev/rlvbusundo202
/dev/rlvbusdata01
/dev/rlvbusdata02
/dev/rlvbusidx01
/dev/rlvbusdata03
/dev/rlvbusdata04
/dev/rlvbusdata05
/dev/rlvbusdata06
/dev/rlvbusidx02
/dev/rlvbusdata07
/dev/rlvbusidx03
/dev/rlvaccbiz01
/dev/rlvbusdata08
/dev/rlvbusidx04
/dev/rlvbusidx05
/dev/rlvbusdata09
/dev/rlvbusidx06
/dev/rlvbusrnd01
/dev/rlvbusdata10
/dev/rlvbusidx07
/dev/rlvbusdata11
/dev/rlvbusidx08
/dev/rlvbusrnd02
/dev/rlvbusdata12
/dev/rlvbusidx09
/dev/rlvbusdata13
/dev/rlvbusidx10
/dev/rlvaccbiz02
/dev/rlvbusdata14
/dev/rlvbusidx11
/dev/rlvbusidx12
/dev/rlvbusdata15
/dev/rlvbusidx13
/dev/rlvbusdata16
/dev/rlvbusidx14
/dev/rlvbusdata17
/dev/rlvbusidx15
/dev/rlvbusidx16
/dev/rlvbusdata18
/dev/rlvbusidx17
/dev/rlvbusdata19
/dev/rlvbusidx18
/dev/rlvbusdata20
/dev/rlvbusidx19
/dev/rlvbusidx20
/dev/rlvbusdata21
/dev/rlvbusidx21
/dev/rlvbusdata22
/dev/rlvbusidx22
/dev/rlvbusdata23
/dev/rlvbusidx23
/dev/rlvbusidx24
/dev/rlvbusdata24
/dev/rlvbusidx25
/dev/rlvbusdata25
/dev/rlvbusidx26
/dev/rlvbusidx27
/dev/rlvbusdata26
/dev/rlvbusidx28
/dev/rlvbusdata27
/dev/rlvbusidx29
/dev/rlvbusidx30
/dev/rlvbusdata28
/dev/rlvbusdata29
/dev/rlvbusdata30
71 rows selected.
----和rac 数据库作对比。一样
1:重建cf
--rac主库上执行:
ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/tmp/stdby_238.ctl';
--传输到238(略)
--传输到238(略)
--standby 执行:
--备份238的老的standby cf(DD命令),谨慎,在谨慎。
shutdown immediate
--备份238的老的standby cf(DD命令),谨慎,在谨慎。
shutdown immediate
--查看cf lv的大小
[oracle@DB01_manage] /dev 726> lslv lvbusctl01
LOGICAL VOLUME: lvbusctl01 VOLUME GROUP: vgbus
LV IDENTIFIER: 00c87a4d00004c000000012c0fc5b403.76 PERMISSION: read/write
VG STATE: active/complete LV STATE: closed/syncd
TYPE: raw WRITE VERIFY: off
MAX LPs: 512 PP SIZE: 128 megabyte(s)
COPIES: 1 SCHED POLICY: parallel
LPs: 1 PPs: 1
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: no
INTRA-POLICY: middle UPPER BOUND: 128
MOUNT POINT: N/A LABEL: None
MIRROR WRITE CONSISTENCY: off
EACH LP COPY ON A SEPARATE PV ?: no
Serialize IO ?: NO
DEVICESUBTYPE : DS_LVZ
LOGICAL VOLUME: lvbusctl01 VOLUME GROUP: vgbus
LV IDENTIFIER: 00c87a4d00004c000000012c0fc5b403.76 PERMISSION: read/write
VG STATE: active/complete LV STATE: closed/syncd
TYPE: raw WRITE VERIFY: off
MAX LPs: 512 PP SIZE: 128 megabyte(s)
COPIES: 1 SCHED POLICY: parallel
LPs: 1 PPs: 1
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: no
INTRA-POLICY: middle UPPER BOUND: 128
MOUNT POINT: N/A LABEL: None
MIRROR WRITE CONSISTENCY: off
EACH LP COPY ON A SEPARATE PV ?: no
Serialize IO ?: NO
DEVICESUBTYPE : DS_LVZ
--lv size = LPs*PP SIZE=1*128=128m
134217728
SQL> select 134217728/4096 from dual;
SQL> select 134217728/4096 from dual;
134217728/4096
--------------
32768
--------------
32768
dd if=/dev/rlvbusctl01 f=/tmp/std_238bak.ctl bs=4096 count=32768
32768+0 records in.
32768+0 records out.
32768+0 records out.
--------------------------备份完毕---,现在可以dd进新的standby- cf------------------------------
--先清空/dev/rlvbusctl01
dd if=/dev/zero f=/dev/rlvbusctl01 bs=4096 count=32768
dd if=/tmp/stdby_238.ctl f=/dev/rlvbusctl01 bs=4096 count=32768
----------------------------------------------------------------
dd if=/dev/zero f=/dev/rlvbusctl02 bs=4096 count=32768
dd if=/dev/zero f=/dev/rlvbusctl02 bs=4096 count=32768
dd if=/tmp/stdby_238.ctl f=/dev/rlvbusctl02 bs=4096 count=32768
------------------------------------------------------
dd if=/dev/zero f=/dev/rlvbusctl03 bs=4096 count=32768
dd if=/tmp/stdby_238.ctl f=/dev/rlvbusctl03 bs=4096 count=32768
----mount 上 standby database 开始恢复
oracle@DB01_manage] /oracle 643> sqlplus /nolog
SQL*Plus: Release 10.2.0.4.0 - Production on Mon Dec 12 11:09:23 2011
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup nomount;
ORACLE instance started.
Connected to an idle instance.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 8589934592 bytes
Fixed Size 2097800 bytes
Variable Size 1358957944 bytes
Database Buffers 7214202880 bytes
Redo Buffers 14675968 bytes
SQL> alter database mount standby database;
Fixed Size 2097800 bytes
Variable Size 1358957944 bytes
Database Buffers 7214202880 bytes
Redo Buffers 14675968 bytes
SQL> alter database mount standby database;
Database altered.
---------
run{
sql 'alter session set nls_date_format= "YYYY-MM-DD HH24:MI:SS"';
set until time '2011-12-11 17:59:59';
allocate channel s1 type 'sbt_tape' parms 'ENV=(tdpo_optfile=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
allocate channel s2 type 'sbt_tape' parms 'ENV=(tdpo_optfile=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
Restore database;
release channel s1;
release channel s2;
}
sql 'alter session set nls_date_format= "YYYY-MM-DD HH24:MI:SS"';
set until time '2011-12-11 17:59:59';
allocate channel s1 type 'sbt_tape' parms 'ENV=(tdpo_optfile=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
allocate channel s2 type 'sbt_tape' parms 'ENV=(tdpo_optfile=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
Restore database;
release channel s1;
release channel s2;
}
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/713360/viewspace-713203/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/713360/viewspace-713203/