- 浏览: 1004883 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (529)
- 服务器 (8)
- jsp (1)
- java (6)
- AIX (1)
- solaris (3)
- linux学习 (53)
- javaScript (2)
- hibernate (1)
- 数据库 (74)
- sql语句 (8)
- oracle 学习 (75)
- oracle 案例 (42)
- oracle 管理 (42)
- Oracle RAC (27)
- oracle data guard (12)
- oracle 参数讲解 (14)
- Oracle 字符集 (8)
- oracle性能调优 (24)
- oracle备份与恢复 (12)
- oracle Tablespace (9)
- oracle性能诊断艺术 (1)
- oracle 11g学习 (5)
- oracle streams (1)
- oracle upgrade and downgrade (4)
- db2学习 (13)
- db2命令学习 (2)
- mysql (28)
- sql server (30)
- sql server 2008 (0)
- 工具 (10)
- 操作系统 (3)
- c++ (1)
- stock (1)
- 生活 (5)
- HADOOP (2)
最新评论
-
massjcy:
...
如何将ubuntu文件夹中文名改为英文 -
skypiea:
谢谢。。。
终于解决了。。。
Oracle 10.2.0.4(5)EM不能启动的解决方案(Patch 8350262) -
qwe_rt:
引用vi /etc/sysconfig/network 请问 ...
Linux操作系统下配置静态IP上网 -
liuqiang:
sudo killall -9 apache2
ps 和 kill 命令详解 -
dazuiba:
引用*绝杀 kill -9 PID 当使用此命令时,一定要通过 ...
ps 和 kill 命令详解
操作系统版本:
oracle@admtps-Sun-Fire-X4150:/media/oracle/fast_recovery_area$ uname -a
Linux admtps-Sun-Fire-X4150 2.6.38-11-generic #50-Ubuntu SMP Mon Sep 12 21:17:25 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
数据库版本:
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
SQL>
数据库规划(db_unique_name):
主库: DREAM
备库: DREAM01
操作步骤如下:
1.检查主库是否为归档模式,并且主库为force logging,(database flashback模式可选,选择有利于备库在failover模式迅速恢复)
SQL> select log_mode,force_logging from v$database;
LOG_MODE FOR
------------ ---
ARCHIVELOG NO
SQL> alter database force logging;
Database altered.
SQL> select log_mode,force_logging from v$database;
LOG_MODE FOR
------------ ---
ARCHIVELOG YES
SQL>
2.检查是否创建standby log file,假如没有创建,则创建
standby log file的文件大小和redo log file 文件大小一样,并且组数为redo log group count * thread count + 1
SQL> select * from v$logfile;
rows will be truncated
GROUP# STATUS TYPE MEMBER
---------- ------- ------- -----------------------------------------------------
3 ONLINE /media/oracle/oradata/DREAM/redo03.log
2 ONLINE /media/oracle/oradata/DREAM/redo02.log
1 ONLINE /media/oracle/oradata/DREAM/redo01.log
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- ---------- --- ----------
1 1 4 52428800 512 1 YES INACTIVE
2 1 5 52428800 512 1 NO CURRENT
3 1 3 52428800 512 1 YES INACTIVE
SQL> select 52428800/1024/1024 from dual;
52428800/1024/1024
------------------
50
SQL> alter database add standby logfile '/media/oracle/oradata/DREAM/stdlog04.log' size 50m;
Database altered.
SQL> alter database add standby logfile '/media/oracle/oradata/DREAM/stdlog05.log' size 50m;
Database altered.
SQL> alter database add standby logfile '/media/oracle/oradata/DREAM/stdlog06.log' size 50m;
Database altered.
SQL> alter database add standby logfile '/media/oracle/oradata/DREAM/stdlog07.log' size 50m;
Database altered.
SQL> select * from v$standby_log;
GROUP# DBID THREAD# SEQUENCE# ARC ST
---------- ---------------------------------------- ---------- ---------- --- --
4 UNASSIGNED 0 0 YES UN
5 UNASSIGNED 0 0 YES UN
6 UNASSIGNED 0 0 YES UN
7 UNASSIGNED 0 0 YES UN
SQL> select * from v$logfile;
rows will be truncated
GROUP# STATUS TYPE MEMBER
---------- ------- ------- -----------------------------------------------------
3 ONLINE /media/oracle/oradata/DREAM/redo03.log
2 ONLINE /media/oracle/oradata/DREAM/redo02.log
1 ONLINE /media/oracle/oradata/DREAM/redo01.log
4 STANDBY /media/oracle/oradata/DREAM/stdlog04.log
5 STANDBY /media/oracle/oradata/DREAM/stdlog05.log
6 STANDBY /media/oracle/oradata/DREAM/stdlog06.log
7 STANDBY /media/oracle/oradata/DREAM/stdlog07.log
7 rows selected.
SQL>
3,修改主数据库配置DATAGUARD参数:
alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(DREAM,DREAM01)';
alter system set LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=DREAM';
alter system set LOG_ARCHIVE_DEST_2='SERVICE=DREAM01 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=DREAM01';
alter system set LOG_ARCHIVE_DEST_STATE_1=ENABLE;
alter system set FAL_SERVER=DREAM01;
alter system set FAL_CLIENT=DREAM;
alter system set DB_FILE_NAME_CONVERT='/media/oracle/oradata/DREAM01/','/media/oracle/oradata/DREAM/' scope=spfile;
alter system set LOG_FILE_NAME_CONVERT='/media/oracle/oradata/DREAM01/','/media/oracle/oradata/DREAM/' scope=spfile;
SQL> alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(DREAM,DREAM01)';
System altered.
SQL> alter system set LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=DREAM';
System altered.
SQL> alter system set LOG_ARCHIVE_DEST_2='SERVICE=DREAM01 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=DREAM01';
System altered.
SQL> alter system set LOG_ARCHIVE_DEST_STATE_1=ENABLE;
System altered.
SQL> alter system set FAL_SERVER=DREAM01;
System altered.
SQL> alter system set FAL_CLIENT=DREAM;
System altered.
SQL> alter system set DB_FILE_NAME_CONVERT='/media/oracle/oradata/DREAM01/','/media/oracle/oradata/DREAM/' scope=spfile;
System altered.
SQL> alter system set LOG_FILE_NAME_CONVERT='/media/oracle/oradata/DREAM01/','/media/oracle/oradata/DREAM/' scope=spfile;
System altered.
SQL>
4,配置主备监听器,tnsname.ora文件,使双方可以连上:
oracle@admtps-Sun-Fire-X4150:/u01/app/oracle/product/11.2.0/dbhome_1/network/admin$ vi listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ATS.COM)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = ATS)
)
(SID_DESC =
(GLOBAL_DBNAME = DREAM.COM)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = dream)
)
(SID_DESC =
(GLOBAL_DBNAME = DREAM01.COM)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = dream01)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = admtps-Sun-Fire-X4150)(PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
ADR_BASE_LISTENER = /u01/app/oracle
oracle@admtps-Sun-Fire-X4150:/u01/app/oracle/product/11.2.0/dbhome_1/network/admin$ lsnrctl reload
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 10-MAY-2012 17:05:41
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=admtps-Sun-Fire-X4150)(PORT=1521)))
The command completed successfully
oracle@admtps-Sun-Fire-X4150:/u01/app/oracle/product/11.2.0/dbhome_1/network/admin$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 10-MAY-2012 17:05:48
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=admtps-Sun-Fire-X4150)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date 09-MAY-2012 15:46:55
Uptime 1 days 1 hr. 18 min. 52 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/admtps-Sun-Fire-X4150/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=admtps-Sun-Fire-X4150)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "ATS.COM" has 2 instance(s).
Instance "ATS", status UNKNOWN, has 1 handler(s) for this service...
Instance "ATS", status READY, has 1 handler(s) for this service...
Service "ATSXDB.COM" has 1 instance(s).
Instance "ATS", status READY, has 1 handler(s) for this service...
Service "DREAM.COM" has 2 instance(s).
Instance "DREAM", status UNKNOWN, has 1 handler(s) for this service...
Instance "DREAM", status READY, has 1 handler(s) for this service...
Service "DREAM01.COM" has 1 instance(s).
Instance "DREAM01", status UNKNOWN, has 1 handler(s) for this service...
Service "DREAMXDB.COM" has 1 instance(s).
Instance "DREAM", status READY, has 1 handler(s) for this service...
The command completed successfully
oracle@admtps-Sun-Fire-X4150:/u01/app/oracle/product/11.2.0/dbhome_1/network/admin$
编辑 tnsnames.ora文件 添加
DREAM01 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.201)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = DREAM01.COM)
)
)
配置完毕以后用tnsping看是否能够相互ping通;
SQL> host;
oracle@admtps-Sun-Fire-X4150:/media/oracle/fast_recovery_area$ tnsping dream
TNS Ping Utility for Linux: Version 11.2.0.2.0 - Production on 05-JUN-2012 16:16:25
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = admtps-Sun-Fire-X4150)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = DREAM.COM)))
OK (0 msec)
oracle@admtps-Sun-Fire-X4150:/media/oracle/fast_recovery_area$ tnsping dream01
TNS Ping Utility for Linux: Version 11.2.0.2.0 - Production on 05-JUN-2012 16:16:33
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.201)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = DREAM01.COM)))
OK (0 msec)
oracle@admtps-Sun-Fire-X4150:/media/oracle/fast_recovery_area$
5.配置standby database
5.1拷贝主库的密码文件到备机,然后改成备库自己的
oracle@admtps-Sun-Fire-X4150:/u01/app/oracle/product/11.2.0/dbhome_1/dbs$ cp orapwDREAM orapwDREAM01
5.2创建备库初始化参数:
oracle@admtps-Sun-Fire-X4150:/u01/app/oracle/product/11.2.0/dbhome_1/dbs$ more initDREAM01.ora
db_name = 'DREAM01'
db_unique_name = 'DREAM'
db_domain = 'COM'
5.3创建备库文件存放路径:
SQL> show parameter user_dump_dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
user_dump_dest string /media/oracle/diag/rdbms/dream
oracle@admtps-Sun-Fire-X4150:/u01/app/oracle/product/11.2.0/dbhome_1/dbs$mkdir /media/oracle/oradata/DREAM01
oracle@admtps-Sun-Fire-X4150:/u01/app/oracle/product/11.2.0/dbhome_1/dbs$mkdir /media/oracle/diag/rdbms/dream01
5.4用SQLPLUS启动备库到nomount状态:
oracle@admtps-Sun-Fire-X4150:/media/oracle/fast_recovery_area$ export ORACLE_SID=DREAM01
oracle@admtps-Sun-Fire-X4150:/media/oracle/fast_recovery_area$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Tue Jun 5 16:29:50 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount pfile="/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initDREAM01.ora"
ORACLE instance started.
Total System Global Area 217157632 bytes
Fixed Size 2225064 bytes
Variable Size 159386712 bytes
Database Buffers 50331648 bytes
Redo Buffers 5214208 bytes
SQL> host;
oracle@admtps-Sun-Fire-X4150:/u01/app/oracle/product/11.2.0/dbhome_1/dbs$
5.5 用rman在主库上连接主库和辅助库(备库),执行创建备库操作:
rman duplicate.log
conn target sys/@dream;
conn auxiliary sys/@dream01;
run {
duplicate target database for standby from active database
spfile
parameter_value_convert 'DREAM','DREAM01'
set db_unique_name='DREAM01'
set db_file_name_convert='/DREAM/','/DREAM01/'
set log_file_name_convert='/DREAM/','/DREAM01/'
set control_files='/media/oracle/oradata/DREAM01/control01.ctl'
set log_archive_max_processes='5'
set fal_client='DREAM01'
set fal_server='DREAM'
set standby_file_management='AUTO'
set log_archive_config='dg_config=(dream,dream01)'
set log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=DREAM01'
set log_archive_dest_2='service=dream ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=DREAM';
}
oracle@admtps-Sun-Fire-X4150:/u01/app/oracle/product/11.2.0/dbhome_1/network/admin$ rman
Recovery Manager: Release 11.2.0.2.0 - Production on Tue Jun 5 17:44:14 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
RMAN> connect target sys@dream
target database Password:
connected to target database: DREAM (DBID=3778928932)
RMAN> connect auxiliary sys@dream01
auxiliary database Password:
connected to auxiliary database: DREAM (not mounted)
RMAN> run {
duplicate target database for standby from active database
spfile
parameter_value_convert 'DREAM','DREAM01'
set db_unique_name='DREAM01'
set db_file_name_convert='/DREAM/','/DREAM01/'
set log_file_name_convert='/DREAM/','/DREAM01/'
set control_files='/media/oracle/oradata/DREAM01/control01.ctl'
set log_archive_max_processes='5'
set fal_client='boston'
set fal_server='chicago'
set standby_file_management='AUTO'
set log_archive_config='dg_config=(dream,dream01)'
set log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=DREAM01'
set log_archive_dest_2='service=dream ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=DREAM';
}2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16>
Starting Duplicate Db at 05-JUN-12
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=91 device type=DISK
contents of Memory Script:
{
backup as copy reuse
targetfile '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwdream' auxiliary format
'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwdream01' targetfile
'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileDREAM.ora' auxiliary format
'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfiledream01.ora' ;
sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfiledream01.ora''";
}
executing Memory Script
Starting backup at 05-JUN-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=98 device type=DISK
Finished backup at 05-JUN-12
sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfiledream01.ora''
contents of Memory Script:
{
sql clone "alter system set audit_file_dest =
''/media/oracle/admin/DREAM01/adump'' comment=
'''' scope=spfile";
sql clone "alter system set db_create_file_dest =
''/media/oracle/oradata/DREAM01/'' comment=
'''' scope=spfile";
sql clone "alter system set dispatchers =
''(PROTOCOL=TCP) (SERVICE=DREAM01XDB)'' comment=
'''' scope=spfile";
sql clone "alter system set db_unique_name =
''DREAM01'' comment=
'''' scope=spfile";
sql clone "alter system set db_file_name_convert =
''/DREAM/'', ''/DREAM01/'' comment=
'''' scope=spfile";
sql clone "alter system set log_file_name_convert =
''/DREAM/'', ''/DREAM01/'' comment=
'''' scope=spfile";
sql clone "alter system set control_files =
''/media/oracle/oradata/DREAM01/control01.ctl'' comment=
'''' scope=spfile";
sql clone "alter system set log_archive_max_processes =
5 comment=
'''' scope=spfile";
sql clone "alter system set fal_client =
''boston'' comment=
'''' scope=spfile";
sql clone "alter system set fal_server =
''chicago'' comment=
'''' scope=spfile";
sql clone "alter system set standby_file_management =
''AUTO'' comment=
'''' scope=spfile";
sql clone "alter system set log_archive_config =
''dg_config=(dream,dream01)'' comment=
'''' scope=spfile";
sql clone "alter system set log_archive_dest_1 =
''LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=DREAM01'' comment=
'''' scope=spfile";
sql clone "alter system set log_archive_dest_2 =
''service=dream ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=DREAM'' comment=
'''' scope=spfile";
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
sql statement: alter system set audit_file_dest = ''/media/oracle/admin/DREAM01/adump'' comment= '''' scope=spfile
sql statement: alter system set db_create_file_dest = ''/media/oracle/oradata/DREAM01/'' comment= '''' scope=spfile
sql statement: alter system set dispatchers = ''(PROTOCOL=TCP) (SERVICE=DREAM01XDB)'' comment= '''' scope=spfile
sql statement: alter system set db_unique_name = ''DREAM01'' comment= '''' scope=spfile
sql statement: alter system set db_file_name_convert = ''/DREAM/'', ''/DREAM01/'' comment= '''' scope=spfile
sql statement: alter system set log_file_name_convert = ''/DREAM/'', ''/DREAM01/'' comment= '''' scope=spfile
sql statement: alter system set control_files = ''/media/oracle/oradata/DREAM01/control01.ctl'' comment= '''' scope=spfile
sql statement: alter system set log_archive_max_processes = 5 comment= '''' scope=spfile
sql statement: alter system set fal_client = ''DREAM01'' comment= '''' scope=spfile
sql statement: alter system set fal_server = ''DREAM'' comment= '''' scope=spfile
sql statement: alter system set standby_file_management = ''AUTO'' comment= '''' scope=spfile
sql statement: alter system set log_archive_config = ''dg_config=(dream,dream01)'' comment= '''' scope=spfile
sql statement: alter system set log_archive_dest_1 = ''LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=DREAM01'' comment= '''' scope=spfile
sql statement: alter system set log_archive_dest_2 = ''service=dream ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=DREAM'' comment= '''' scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 534462464 bytes
Fixed Size 2228200 bytes
Variable Size 335544344 bytes
Database Buffers 188743680 bytes
Redo Buffers 7946240 bytes
contents of Memory Script:
{
backup as copy current controlfile for standby auxiliary format '/media/oracle/oradata/DREAM01/control01.ctl';
}
executing Memory Script
Starting backup at 05-JUN-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_dream.f tag=TAG20120605T174549 RECID=18 STAMP=785180750
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 05-JUN-12
contents of Memory Script:
{
sql clone 'alter database mount standby database';
}
executing Memory Script
sql statement: alter database mount standby database
contents of Memory Script:
{
set newname for tempfile 1 to
"/media/oracle/oradata/DREAM01/temp01.dbf";
switch clone tempfile all;
set newname for datafile 1 to
"/media/oracle/oradata/DREAM01/system01.dbf";
set newname for datafile 2 to
"/media/oracle/oradata/DREAM01/sysaux01.dbf";
set newname for datafile 3 to
"/media/oracle/oradata/DREAM01/undotbs01.dbf";
set newname for datafile 4 to
"/media/oracle/oradata/DREAM01/users01.dbf";
set newname for datafile 5 to
"/media/oracle/oradata/DREAM01/indexes01.dbf";
backup as copy reuse
datafile 1 auxiliary format
"/media/oracle/oradata/DREAM01/system01.dbf" datafile
2 auxiliary format
"/media/oracle/oradata/DREAM01/sysaux01.dbf" datafile
3 auxiliary format
"/media/oracle/oradata/DREAM01/undotbs01.dbf" datafile
4 auxiliary format
"/media/oracle/oradata/DREAM01/users01.dbf" datafile
5 auxiliary format
"/media/oracle/oradata/DREAM01/indexes01.dbf" ;
sql 'alter system archive log current';
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /media/oracle/oradata/DREAM01/temp01.dbf in control file
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting backup at 05-JUN-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/media/oracle/oradata/DREAM/sysaux01.dbf
output file name=/media/oracle/oradata/DREAM01/sysaux01.dbf tag=TAG20120605T174557
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/media/oracle/oradata/DREAM/system01.dbf
output file name=/media/oracle/oradata/DREAM01/system01.dbf tag=TAG20120605T174557
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/media/oracle/oradata/DREAM/undotbs01.dbf
output file name=/media/oracle/oradata/DREAM01/undotbs01.dbf tag=TAG20120605T174557
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/media/oracle/oradata/DREAM/users01.dbf
output file name=/media/oracle/oradata/DREAM01/users01.dbf tag=TAG20120605T174557
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/media/oracle/oradata/DREAM/indexes01.dbf
output file name=/media/oracle/oradata/DREAM01/indexes01.dbf tag=TAG20120605T174557
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 05-JUN-12
sql statement: alter system archive log current
contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy RECID=18 STAMP=785180817 file name=/media/oracle/oradata/DREAM01/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=19 STAMP=785180817 file name=/media/oracle/oradata/DREAM01/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=20 STAMP=785180817 file name=/media/oracle/oradata/DREAM01/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=21 STAMP=785180817 file name=/media/oracle/oradata/DREAM01/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=22 STAMP=785180817 file name=/media/oracle/oradata/DREAM01/indexes01.dbf
Finished Duplicate Db at 05-JUN-12
RMAN>
oracle@admtps-Sun-Fire-X4150:/u01/app/oracle/product/11.2.0/dbhome_1/network/admin$ sqlplus sys/libin@dream01 as sysdba;
SQL*Plus: Release 11.2.0.2.0 Production on Tue Jun 5 17:48:42 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
SQL> alter system set fal_client='DREAM01';
System altered.
SQL> alter system set fal_server='DREAM';
System altered.
SQL> select open_mode,database_role from v$database;
OPEN_MODE DATABASE_ROLE
-------------------- ----------------
MOUNTED PHYSICAL STANDBY
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
MOUNTED
SQL> alter database recover managed standby database cancel;
Database altered.
SQL> alter database open read only;
Database altered.
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ ONLY
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ ONLY WITH APPLY
SQL>
发表评论
-
利用物理standby 进行数据库迁移总结
2012-06-19 20:35 1444物理standby进行迁移,该方法适用于在相同操作系统平台,相 ... -
oracle 快照数据库和物理备库的转换
2012-06-19 13:32 1749SQL> select * from v$version ... -
Oracle10g配置Dataguard的相关参数解释
2011-06-02 01:56 1016文档里总结的很全, 不过有几个错误的(如fal_server和 ... -
Oracle10gR2 主备自动切换之客户端Failover配置
2011-06-02 01:43 11151. 主库检查和设置假设新增的服务名为ORCL_TAF.LK. ... -
standby 管理和维护
2011-01-20 10:18 1203查询库状态:SQL> select name,SWITC ... -
oracle 10g logical standby (by otn)
2011-01-20 10:17 1177Make Recovery LogicalBy Darl Ku ... -
Oracle Standby 安装步骤
2011-01-20 10:11 1299建立数据库:环境要求OS 版本一样;Oracle 版本必须一样 ... -
一步一步学Data Guard之基础篇
2011-01-20 10:07 1313它有无数个名字,有人 ... -
Oracle Dataguard三种保护模式特点总结
2010-10-19 16:30 1432Oracle Dataguard提供了三种数据保护模式,在此分 ... -
与 redo log 有关的参数学习
2010-03-25 00:16 10101. MAXLOGFILES The MAXLOGFILES ... -
在 RHEL5 上配置 Oracle 10g Data Guard
2009-11-11 09:52 18130、规划 Host IP DB_NAM ...
相关推荐
Oracle 11gR2 使用 RMAN duplicate from active database 复制数据库 Oracle 11gR2 中使用 RMAN duplicate from active database 复制数据库是一种高效的数据库复制方法。这种方法可以直接从活动数据库复制,省去...
使用RMAN DUPLICATE...FROM ACTIVE DATABASE 创建物理备库 简化standby创建过程,提高效率
本文档主要介绍 Oracle Rman Active Database Duplicate 迁移方案,适用于 Oracle 11g/12c 版本。该方案旨在帮助数据库管理员快速迁移数据库,减少迁移时间和风险。 第 1 章概述 ================ 本文档将介绍 ...
Oracle 11g RAC-RAC DG Duplicate搭建(生产操作文档)Oracle 11g RAC-RAC DG Duplicate搭建(生产操作文档)
Oracle Data Guard单实例TO单实例迁移方案(基于active duplicate)V1.1 .pdf
Oracle 11gR2 dataguard搭建说明
16 ADG Oracle 11g:ORACLE ACTIVE DATA GUARD 17 ADG Oracle 11gR2 使用copy 数据文件搭建物理 Data Guard 18 ADG Oracle 11gR2-Data Guard 单机到集群 19 ADG Oracle 11gR2-Data Guard 单机到集群 20 ADG ...
Oracle Database 12c 部署Data Guard(ADG、LDG)并实现Switchover和Failover(Rman Duplicate和Broker).pdf
duplicate绝对干货。利用duplicate复制数据库,文档中包换每一步的试验步骤,详细说明了每一步的作用及用途,和注意事项,一步一步至试验成功,绝对一次成功。
11g rac 使用duplicate 搭建单实例adg,方案。
Oracle 19c RAC 到单机 ADG构建与来回测试 ORACLE19C安装+ADG RMAN备份搭建DATA GUARD RMAN使用DUPLICATE搭建DATA GUARD
用 Duplicate target database传输时前30s传输很快,当到了30s后,传输速度每10分钟1M.导致数据库文件无法Duplicate。
Oracle RMAN DUPLICATE教程
Oracle DataGuard搭建通过duplicate
Rman通过duplicate创建standby
某公司实施文档记录,非常珍贵的资料,通过duplicate实现oracle dataguard环境的搭建,需要的请下载。
excel duplicate data remover
This document will cover the process to duplicate an Oracle 10g database on another server using a Galaxy backup. This document should in no way be treated as the “End All” procedure. It is merely ...
Oracle RMAN Database Duplication is a deep dive into RMAN's duplication feature set, showing how RMAN can make it so much easier for you as a database administrator to satisfy the many requests from ...
android studio创建9.patch图片,使用时出现Error: Duplicate resources 笔者运行环境:MacOs Catalina , android studio 3.6.3 原创文章 5获赞 2访问量 249 关注 私信 展开阅读全文 作者:徐州捕快