Just a sample case about rebuilding standby database using dd command
来源:互联网 发布:泗阳网络问政123456 编辑:程序博客网 时间:2024/06/05 06:06
ORACLE_DATAGUARD_Rebuild standby database using dd command
Rebuildstandby database using ddcommand:
-- Create the standby database:
-- 1. rcp the orapw<ORACLE_SID> to the standby
$ rcp $ORACLE_HOME/dbs/orapworahw sun880-2:$ORACLE_HOME/dbs/orapworahw
-- 2. On the primary, create standby controlfile and rcp to the standby
rman nocatalog target /
RMAN>backupcurrentcontrolfileforstandby format '/opt/oracle/test/controlforstandby.bak';
$ rcp /opt/oracle/test/controlforstandby.bak sun880-2:/opt/oracle/test/controlforstandby.bak
-- 3. On the standby, create standby controlfile
rman nocatalog target /
RMAN>restorestandbycontrolfilefrom'/opt/oracle/test/controlforstandby.bak';
-- 4. On the standby, Create standby logfile group
SQL> ALTERDATABASEMOUNTSTANDBYDATABASE;
SQL> select * from v$log;
SQL> select * from v$logfile;
SQL> ALTERDATABASE ADD STANDBY LOGFILE GROUP4 ('/opt/oracle/db/oradata/orahw/srl01.log')SIZE 50M;
SQL> ALTERDATABASE ADD STANDBY LOGFILE GROUP5 ('/opt/oracle/db/oradata/orahw/srl02.log')SIZE 50M;
SQL> ALTERDATABASE ADD STANDBY LOGFILE GROUP6 ('/opt/oracle/db/oradata/orahw/srl03.log')SIZE 50M;
-- 5. On the primary database, copy the datafile to the standby using “dd”
SQL> select 'alter tablespace '||name||' begin backup;'from v$tablespacewhere name!='TEMP';
SQL> select'!dd if='||name||' ibs=4194304 | rsh sun880-2 dd of='||name||' obs=4194304' from v$datafile;
SQL> select 'alter tablespace '||name||' end backup;'from v$tablespacewhere name!='TEMP';
Like this:
$ touch OnlineCopyDatafile.sh
$ chmod 775 OnlineCopyDatafile.sh
$ vi OnlineCopyDatafile.sh <======= The content come from the SQL results.
alter tablespace SYSTEM begin backup;
alter tablespace SYSAUX begin backup;
alter tablespace UNDOTBS1begin backup;
alter tablespace USERS begin backup;
alter tablespace TEST begin backup;
alter tablespace UNDO_SMALLbegin backup;
!dd if=/opt/oracle/db/oradata/orahw/system01.dbf ibs=4194304 | rsh sun880-2 ddof=/opt/oracle/db/oradata/orahw/system01.dbf obs=4194304
!dd if=/opt/oracle/db/oradata/orahw/sysaux01.dbf ibs=4194304 | rsh sun880-2 ddof=/opt/oracle/db/oradata/orahw/sysaux01.dbf obs=4194304
!dd if=/opt/oracle/db/oradata/orahw/undotbs01.dbf ibs=4194304 | rsh sun880-2 ddof=/opt/oracle/db/oradata/orahw/undotbs01.dbf obs=4194304
!dd if=/opt/oracle/db/oradata/orahw/users01.dbf ibs=4194304 | rsh sun880-2 ddof=/opt/oracle/db/oradata/orahw/users01.dbf obs=4194304
!dd if=/opt/oracle/db/oradata/orahw/test01.dbf ibs=4194304 | rsh sun880-2 ddof=/opt/oracle/db/oradata/orahw/test01.dbf obs=4194304
!dd if=/opt/oracle/db/oradata/orahw/users2.dbf ibs=4194304 | rsh sun880-2 ddof=/opt/oracle/db/oradata/orahw/users2.dbf obs=4194304
!dd if=/opt/oracle/db/oradata/orahw/users3.dbf ibs=4194304 | rsh sun880-2 ddof=/opt/oracle/db/oradata/orahw/users3.dbf obs=4194304
!dd if=/opt/oracle/db/oradata/orahw/undo_small.dbf ibs=4194304 | rsh sun880-2 ddof=/opt/oracle/db/oradata/orahw/undo_small.dbf obs=4194304
alter tablespace SYSTEM end backup;
alter tablespace SYSAUX end backup;
alter tablespace UNDOTBS1end backup;
alter tablespace USERS end backup;
alter tablespace TEST end backup;
alter tablespace UNDO_SMALLend backup;
$ sqlplus / as sysdba
SQL> @ OnlineCopyDatafile.sh
-- 6. On the standby, add tempfile, and recover managed standby database
$sqlplus / as sysdba
SQL> alter database open read only;
SQL> alter database tempfile '/opt/oracle/db/oradata/orahw/temp01.dbf' drop;
SQL> alter tablespace temp add tempfile '/opt/oracle/db/oradata/orahw/temp01.dbf' size 2000M REUSE;
SQL> alter database recover managed standby database disconnect;
SQL> select process,status,thread#,sequence#,block#,blocks from v$managed_standby;
- Just a sample case about rebuilding standby database using dd command
- Just a sample case about rebuilding the redo group
- Truncate a file by using dd command
- Just a simple case about the oracle 11gR1 dataguard configuration
- Steps to perform for Rolling Forward a Physical Standby Database using RMAN Incremental Backup. (文档
- Creating a Physical Standby Database 11g
- Switchover to a Physical Standby Database
- Oracle 11g Active Data Guard step by step: How to create a Physical Standby Database using RMAN
- About relationships in a database
- Just a complaint about the college examinations
- How to create a logical standby database based on a physical standby database
- Standby Database
- Oracle Database 12c Using duplicate standby database from active database Created Active DataGuard
- Database '' is in warm standby. A warm-standby database is read-only.
- using switch case block not just under the integral type
- DG(1)Performing a Failover to a Physical Standby Database
- Using dd as a Swiss Army knife
- Use the physical standby database as a test environment
- UNIX网络编程——套接字选项(SO_RCVBUF和SO_SNDBUF)(SO_REUSEADDR)
- C/S架构和B/S架构的概念和区别
- 安装好maya后运行不了并弹出如图的错误
- 黑马程序员--MSDN2010安装及使用
- Linux工具安装---eclipse
- Just a sample case about rebuilding standby database using dd command
- [排序数组合并]
- Graphics View Framework
- Android自定义属性
- 后缀树的构造方法-Ukkonen详解
- 【1】Golismero插件编写-UI插件编写
- Linux工具安装---MySQL
- WPF
- office 文档解析