Scripts to resize standby redolog files
来源:互联网 发布:易语言玫瑰花表白源码 编辑:程序博客网 时间:2024/06/05 19:21
I have already posted about an issue that required me to drop and recreate standby log files so I thought I would post the scripts I used.
Resize Standby Redo Logs
1. On primary defer log shipping (dynamic change)
alter
system
set
log_archive_dest_state_2 = defer scope = memory;
2. On standby database cancel managed recovery
alter
database
recover managed standby
database
cancel;
3. Drop standby logs on standby database
ALTER
DATABASE
DROP
STANDBY LOGFILE
GROUP
4;
ALTER
DATABASE
DROP
STANDBY LOGFILE
GROUP
5;
ALTER
DATABASE
DROP
STANDBY LOGFILE
GROUP
6;
ALTER
DATABASE
DROP
STANDBY LOGFILE
GROUP
7;
4. Recreate the new Standby logs
alter
database
add
standby logfile THREAD 1
group
4 (
'+DATA(ONLINELOG)'
,
'+FRA(ONLINELOG)'
)
SIZE
1000M;
alter
database
add
standby logfile THREAD 1
group
5 (
'+DATA(ONLINELOG)'
,
'+FRA(ONLINELOG)'
)
SIZE
1000M;
alter
database
add
standby logfile THREAD 1
group
6 (
'+DATA(ONLINELOG)'
,
'+FRA(ONLINELOG)'
)
SIZE
1000M;
alter
database
add
standby logfile THREAD 1
group
7 (
'+DATA(ONLINELOG)'
,
'+FRA(ONLINELOG)'
)
SIZE
1000M;
5. Enable log shipping on the Primary database
alter
system
set
log_archive_dest_state_2 = enable scope = memory;
6. Enable managed recovery on standby database
alter
database
recover managed standby
database
using
current
logfile disconnect;
7. Check the the standby logs are being used by running following query :
set
lines 155 pages 9999
col thread#
for
9999990
col
sequence
#
for
999999990
col grp
for
990
col fnm
for
a50 head
"File Name"
col
"Fisrt SCN Number"
for
999999999999990
break
on
thread
# skip 1
select
a.thread#
,a.
sequence
#
,a.
group
# grp
, a.bytes/1024/1024 Size_MB
,a.status
,a.archived
,a.first_change#
"First SCN Number"
,to_char(FIRST_TIME,
'DD-Mon-RR HH24:MI:SS'
)
"First SCN Time"
,to_char(LAST_TIME,
'DD-Mon-RR HH24:MI:SS'
)
"Last SCN Time"
from
v$standby_log a
order
by
1,2,3,4
/
Should return the following :
THREAD#
SEQUENCE
# GRP SIZE_MB STATUS ARC Fisrt SCN Number
First
SCN
Time
Last
SCN
Time
-------- ---------- ---- ---------- ---------- --- ---------------- --------------------------- ---------------------------
1 0 4 100 UNASSIGNED
NO
0
0 6 100 UNASSIGNED YES 0
0 7 100 UNASSIGNED YES 0
7316 5 100 ACTIVE YES 153517071 04-Feb-11 13:39:32 04-Feb-11 13:40:41
0 0
- Scripts to resize standby redolog files
- Scripts to manage files
- redolog files
- [转]Scripts to manage Text Files
- How to Add/Drop/Resize Redo Log with Physical Standby in place. [ID 473442.1]
- How to Add/Drop/Resize Redo Log with Physical Standby in place. [ID 473442.1]
- op08-bash scripts config files
- image to resize bmp
- dataguard 下主备 online redo 与 standby redo log resize 重建
- How to Package Python Scripts
- How to add custom scripts
- how to write shell scripts
- How to calculate a session redolog bytes from get_stat_val
- 【DG实验】搭建physical standby——copy files
- To many open files
- save Objects to Files
- 汇编Writing to Files
- resize
- JS里获取到for循环中i的实时值。
- Android中AIDL进程间通信
- 比赛分组问题(一)
- 带有行标题栏的表格
- 详解正则表达式
- Scripts to resize standby redolog files
- ios自定义UITabBar-仿写掌上英雄联盟的UITabBar
- PHP+MYSQL+AJAX 第二章 PHP入门
- 倒排索引算法的Java实现
- MySQL数据库的常用命令
- jquery获取表单元素select option的值,对select option操作
- 大数据应用时Oracle优化实例
- Kotlin学习笔记——基本类型
- ORA-01093: ALTER DATABASE CLOSE only permitted with no sessions connected