}dump
[oracle@edbjr2p2 dbs]$ mkdir /home/oracle/aux1_arclog
[oracle@edbjr2p2 dbs]$ mkdir /home/oracle/aux1_stdlog
[oracle@edbjr2p2 dbs]$ mkdir $ORACLE_BASE/oradata/AUX1
4.创建监听和TNS
主库中:
[oracle@edbjr2p1 admin]$ netca

然后一路下一步创建完监听
之后创建TNS














因为主库和备库使用的tnsnames相同 则把tnsname.ora从主库传到备库
[oracle@edbjr2p1 admin]$ scp $ORACLE_HOME/network/admin/tnsnames.ora edbjr2p2:$ORACLE_HOME/network/admin/tnsnames.ora
oracle@edbjr2p2's password:
tnsnames.ora 100% 700 0.7KB/s 00:00
[oracle@edbjr2p1 admin]$
备库中:
在备库上创建监听,过程略。。。
5.在主库中穿件rman备份
[oracle@edbjr2p1 admin]$ export ORACLE_SID=ORCL
[oracle@edbjr2p1 admin]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Tue Dec 31 09:56:56 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: ORCL (DBID=1363387608, not open)
RMAN> backup database;
Starting backup at 31-DEC-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/ORCL/system01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/ORCL/undotbs01.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/ORCL/sysaux01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/ORCL/users01.dbf
channel ORA_DISK_1: starting piece 1 at 31-DEC-13
channel ORA_DISK_1: finished piece 1 at 31-DEC-13
piece handle=/u01/app/oracle/product/10.2.0/db_1/dbs/01osspjr_1_1 tag=TAG20131231T095715 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:06
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 31-DEC-13
channel ORA_DISK_1: finished piece 1 at 31-DEC-13
piece handle=/u01/app/oracle/product/10.2.0/db_1/dbs/02ossplt_1_1 tag=TAG20131231T095715 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 31-DEC-13
RMAN> exit;
Recovery Manager complete.
[oracle@edbjr2p1 admin]$
然后在主库中创建备库的controlfile
SYS@ORCL>alter database create standby controlfile as '/home/oracle/control.ctl';
Database altered.
把控制文件传输到备库主机中
[oracle@edbjr2p1 admin]$ scp /home/oracle/control.ctl edbjr2p2:$ORACLE_BASE/oradata/AUX1/control01.ctl
oracle@edbjr2p2's password:
control.ctl 100% 6896KB 6.7MB/s 00:01
[oracle@edbjr2p1 admin]$ scp /home/oracle/control.ctl edbjr2p2:$ORACLE_BASE/oradata/AUX1/control02.ctl
oracle@edbjr2p2's password:
control.ctl 100% 6896KB 6.7MB/s 00:00
[oracle@edbjr2p1 admin]$ scp /home/oracle/control.ctl edbjr2p2:$ORACLE_BASE/oradata/AUX1/control03.ctl
oracle@edbjr2p2's password:
control.ctl 100% 6896KB 6.7MB/s 00:00
[oracle@edbjr2p1 admin]$
传输rman备份的文件到备库主机的相同位置
[oracle@edbjr2p1 dbs]$ scp 01osspjr_1_1 edbjr2p2:$ORACLE_HOME/dbs/01osspjr_1_1
oracle@edbjr2p2's password:
01osspjr_1_1 100% 656MB 5.7MB/s 01:55
[oracle@edbjr2p1 dbs]$ scp 02ossplt_1_1 edbjr2p2:$ORACLE_HOME/dbs/02ossplt_1_1
oracle@edbjr2p2's password:
02ossplt_1_1 100% 6976KB 6.8MB/s 00:01
[oracle@edbjr2p1