【dataguard】使用deplicate创建异机的dataguard

简介: 版本:11gr2  环境:linux 实施dg的方法有很多种,这里介绍使用oracle提供的deplicate复制功能建立异机的dg的方法。对于备库安装和主库一样路径的软件和数据存放结构。

版本:11gr2  环境:linux

实施dg的方法有很多种,这里介绍使用oracle提供的deplicate复制功能建立异机的dg的方法。对于备库安装和主库一样路径的软件和数据存放结构。配置参数文件,监听文件,启动到nomount状态后,就可以在主库上使用rman进行建立dg!

一前期准备工作
---对于主库:
1 开启归档功能
shutdown normal
shutdown immediate
startup mount
alter database archivelog;
alter database open;
--设置归档路径
alter system set log_archive_format = "archive_%t_%s_%r.log" scope=spfile;
alter system set log_archive_dest_1='LOCATION=/home/opt/oracle/archive_log';
alter database force logging;
2 拷贝源库的密码文件到备库主机和主机的一样的路径。
3 修改spfile参数文件。

db_name=yangql
alter system set db_unique_name=yangql scope=spfile;
alter system set log_archive_config='dg_config=(yangql,yangqldg)' scope=both;
alter system set log_archive_dest_1='LOCATION=/home/opt/oracle/archive_log' scope=both;
alter system set log_archive_dest_2='SERVICE=yangqldg LGWR ASYN VALID_FOR=(ALL_LOGFILES,PRIMARY_ROLES) DB_UNIQUE_NAME=yangqldg' scope=both;
alter system set log_archive_dest_state_1=enable scope=both;
alter system set log_archive_dest_state_2=enable scope=both;
alter system set remote_login_passwordfile=exclusive scope=spfile;
alter system set log_archive_format=%t_%s_%r.arc scope=spfile;
alter system set log_archive_max_processes=30 scope=spfile;
alter system set FAL_SERVER=yangqldg scope=both;
alter system set FAL_CLIENT=yangql scope=both;
ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT =AUTO SCOPE=both;
4 修改listener.ora  tnames.ora文件
---listener.ora
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = pre_publish)(PORT = 1521))
    )
  )
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = yangql)
      (ORACLE_HOME = /home/opt/oracle/products/11.2.0)
      (SID_NAME = yangql)
    )
  )

----tnsnames.ora-----
yangql =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.18.112.230)(PORT = 1521))
    )
    (CONNECT_DATA =
      (server = dedicated)
      (service_name = yangql)
    )
  )


yangqldg =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.18.87.199)(PORT = 1521))
    )
    (CONNECT_DATA =
      (server = dedicated)
      (service_name = yangql)
    )
  )
----备库操作

---备库的参数文件yangqldg.ora中关于dg的部分内容----
db_name=yangql
db_unique_name=yangqldg
log_archive_config='db_config=(yangqldg,yangql)'
log_archive_dest_1='LOCATION=/home/opt/oracle/archive_log'
log_archive_dest_2='SERVICE=yangql LGWR ASYN VALID_FOR=(ALL_LOGFILES,PRIMARY_ROLES) DB_UNIQUE_NAME=yangql'
log_archive_dest_state_1=enable
log_archive_dest_state_2=enable/defer
remote_login_passwordfile=exclusive
log_archive_format=%t_%s_%r.arc
log_archive_max_processes=30
FAL_SERVER=yangqldg
FAL_CLIENT=yangql


-----listener.ora
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = alibank_pre_publish)(PORT = 1521))
    )
  )
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = yangql)
      (ORACLE_HOME = /home/opt/oracle/products/11.2.0)
      (SID_NAME = yangql)
    )
  )

----tnsnames.ora-----
yangql =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.18.112.230)(PORT = 1521))
    )
    (CONNECT_DATA =
      (server = dedicated)
      (service_name = yangql)
    )
  )
 
yangqldg =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.18.87.199)(PORT = 1521))
    )
    (CONNECT_DATA =
      (server = dedicated)
      (service_name = yangql)
    )
  )
--rman 复制
--启动备库到nomount状态
sqlplus "/as sysdba"
startup nomount pfile='/yangqldg.ora'

--执行duplicate standby 库
主库登陆rman,并auxiliary连接备库

oracle>rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Tue Apr 26 14:42:24 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
connected to target database: yangql (DBID=3584031961)
RMAN> connect auxiliary
sys/yangql@yangqldg
connected to auxiliary database: yangql (not mounted)
RMAN> run {
2>  allocate channel c1 type disk;
3>   allocate auxiliary channel s1 type disk;
4>    allocate auxiliary channel s2 type disk;
5>    sql channel c1 "alter system archive log current";
6>    duplicate target database for standby 
7>         from active database
8>         spfile
9>         set db_name='yangql'
10>         set db_unique_name='yangqldg'
11>         set instance_name='yangql'
12>         set audit_file_dest='/home/opt/oracle/admin/yangql/adump'
13>         set log_archive_dest_1='LOCATION=/home/opt/oracle/archive_log'
14>         set control_files='/home/opt/oracle/oradata/yangql/control01.ctl','/home/opt/oracle/oradata/yangql/control02.ctl'
15>         set standby_file_management='AUTO'
16>         set log_archive_config='dg_config=(yangqldg,yangql)'
17>         set log_archive_dest_2='service=yangql LGWR ASYNC valid_for=(ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=yangql'
18>         set log_archive_dest_state_1='enable'
19>         set log_archive_dest_state_2='enable'
20>         set log_archive_format='%t_%s_%r.dbf'
21>         set undo_tablespace='UNDOTBS1'
22>         set LOG_FILE_NAME_CONVERT='/home/opt/oracle/oradata/yangql','/home/opt/oracle/oradata/yangql'
23>         set fal_client='yangqldg'
24>         set fal_server='yangql'
25>         NOFILENAMECHECK; 
26>    sql channel c1 "alter system archive log current";
27> }

using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=838 device type=DISK

allocated channel: s1
channel s1: SID=91 device type=DISK

allocated channel: s2
channel s2: SID=113 device type=DISK

sql statement: alter system archive log current

Starting Duplicate Db at 26-APR-11

contents of Memory Script.:
{
   backup as copy reuse
   targetfile  '/home/opt/oracle/products/11.2.0/dbs/orapwyangql' auxiliary format
 '/home/opt/oracle/products/11.2.0/dbs/orapwyangql'   targetfile
 '/home/opt/oracle/products/11.2.0/dbs/spfileyangql.ora' auxiliary format
 '/home/opt/oracle/products/11.2.0/dbs/spfileyangql.ora'   ;
   sql clone "alter system set spfile= ''/home/opt/oracle/products/11.2.0/dbs/spfileyangql.ora''";
}
executing Memory Script
Starting backup at 26-APR-11
Finished backup at 26-APR-11
sql statement: alter system set spfile= ''/home/opt/oracle/products/11.2.0/dbs/spfileyangql.ora''
contents of Memory Script.:
{
   sql clone "alter system set  db_name =  ''yangql'' comment= '''' scope=spfile";
   sql clone "alter system set  db_unique_name =  ''yangqldg'' comment= '''' scope=spfile";
   sql clone "alter system set  instance_name =  ''yangql'' comment= '''' scope=spfile";
   sql clone "alter system set  audit_file_dest =  ''/home/opt/oracle/admin/yangql/adump'' comment= '''' scope=spfile";
   sql clone "alter system set  log_archive_dest_1 =  ''LOCATION=/home/opt/oracle/archive_log'' comment= '''' scope=spfile";
   sql clone "alter system set  control_files =  ''/home/opt/oracle/oradata/yangql/control01.ctl'', ''/home/opt/oracle/oradata/yangql/control02.ctl'' 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=(yangqldg,yangql)'' comment= '''' scope=spfile";
   sql clone "alter system set  log_archive_dest_2 =  ''service=yangql LGWR ASYNC valid_for=(ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=yangql'' comment= '''' scope=spfile";
   sql clone "alter system set  log_archive_dest_state_1 =  ''enable'' comment= '''' scope=spfile";
   sql clone "alter system set  log_archive_dest_state_2 =  ''enable'' comment= '''' scope=spfile";
   sql clone "alter system set  log_archive_format =  ''%t_%s_%r.dbf'' comment= '''' scope=spfile";
   sql clone "alter system set  undo_tablespace =  ''UNDOTBS1'' comment= '''' scope=spfile";
   sql clone "alter system set  LOG_FILE_NAME_CONVERT =  ''/home/opt/oracle/oradata/yangql'', ''/home/opt/oracle/oradata/yangql'' comment= '''' scope=spfile";
   sql clone "alter system set  fal_client =  ''yangqldg'' comment= '''' scope=spfile";
   sql clone "alter system set  fal_server =  ''yangql'' comment= '''' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script
sql statement: alter system set  db_name =  ''yangql'' comment= '''' scope=spfile
sql statement: alter system set  db_unique_name =  ''yangqldg'' comment= '''' scope=spfile
sql statement: alter system set  instance_name =  ''yangql'' comment= '''' scope=spfile
sql statement: alter system set  audit_file_dest =  ''/home/opt/oracle/admin/yangql/adump'' comment= '''' scope=spfile
sql statement: alter system set  log_archive_dest_1 =  ''LOCATION=/home/opt/oracle/archive_log'' comment= '''' scope=spfile
sql statement: alter system set  control_files =  ''/home/opt/oracle/oradata/yangql/control01.ctl'', ''/home/opt/oracle/oradata/yangql/control02.ctl'' 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=(yangqldg,yangql)'' comment= '''' scope=spfile
sql statement: alter system set  log_archive_dest_2 =  ''service=yangql LGWR ASYNC valid_for=(ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=yangql'' comment= '''' scope=spfile
sql statement: alter system set  log_archive_dest_state_1 =  ''enable'' comment= '''' scope=spfile
sql statement: alter system set  log_archive_dest_state_2 =  ''enable'' comment= '''' scope=spfile
sql statement: alter system set  log_archive_format =  ''%t_%s_%r.dbf'' comment= '''' scope=spfile
sql statement: alter system set  undo_tablespace =  ''UNDOTBS1'' comment= '''' scope=spfile
sql statement: alter system set  LOG_FILE_NAME_CONVERT =  ''/home/opt/oracle/oradata/yangql'', ''/home/opt/oracle/oradata/yangql'' comment= '''' scope=spfile
sql statement: alter system set  fal_client =  ''yangqldg'' comment= '''' scope=spfile
sql statement: alter system set  fal_server =  ''yangql'' comment= '''' scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area    1653518336 bytes
Fixed Size                     2213896 bytes
Variable Size                939526136 bytes
Database Buffers             704643072 bytes
Redo Buffers                   7135232 bytes
allocated channel: s1
channel s1: SID=958 device type=DISK
allocated channel: s2
channel s2: SID=1149 device type=DISK
contents of Memory Script.:
{
   backup as copy current controlfile for standby auxiliary format  '/home/opt/oracle/oradata/yangql/control01.ctl';
   restore clone controlfile to  '/home/opt/oracle/oradata/yangql/control02.ctl' from
 '/home/opt/oracle/oradata/yangql/control01.ctl';
}
executing Memory Script

Starting backup at 26-APR-11
channel c1: starting datafile copy
copying standby control file
output file name=/home/opt/oracle/products/11.2.0/dbs/snapcf_yangql.f tag=TAG20110426T144453 RECID=3 STAMP=749486694
channel c1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 26-APR-11
Starting restore at 26-APR-11
channel s2: skipped, AUTOBACKUP already found
channel s1: copied control file copy
Finished restore at 26-APR-11
contents of Memory Script.:
{
   sql clone 'alter database mount standby database';
}
executing Memory Script
sql statement: alter database mount standby database
RMAN-05538: WARNING: implicitly using DB_FILE_NAME_CONVERT

contents of Memory Script.:
{
   set newname for tempfile  1 to  "/home/opt/oracle/oradata/yangql/temp01.dbf";
   switch clone tempfile all;
   set newname for datafile  1 to  "/home/opt/oracle/oradata/yangql/system01.dbf";
   set newname for datafile  2 to  "/home/opt/oracle/oradata/yangql/sysaux01.dbf";
   set newname for datafile  3 to  "/home/opt/oracle/oradata/yangql/undotbs01.dbf";
   set newname for datafile  4 to  "/home/opt/oracle/oradata/yangql/users01.dbf";
   set newname for datafile  5 to  "/home/opt/oracle/oradata/yangql/alijr01.dbf";
   set newname for datafile  6 to  "/home/opt/oracle/oradata/yangql/alijr02.dbf";
   set newname for datafile  7 to  "/home/opt/oracle/oradata/yangql/alijr03.dbf";
   set newname for datafile  8 to  "/home/opt/oracle/oradata/yangql/alijr04.dbf";
   set newname for datafile  9 to  "/home/opt/oracle/oradata/yangql/alijr05.dbf";
   set newname for datafile  10 to  "/home/opt/oracle/oradata/yangql/alijr06.dbf";
   set newname for datafile  11 to  "/home/opt/oracle/oradata/yangql/alijr07.dbf";
   set newname for datafile  12 to  "/home/opt/oracle/oradata/yangql/alijr08.dbf";
   set newname for datafile  13 to  "/home/opt/oracle/oradata/yangql/alijr09.dbf";
   set newname for datafile  14 to  "/home/opt/oracle/oradata/yangql/alijr10.dbf";
   set newname for datafile  15 to  "/home/opt/oracle/oradata/yangql/alijr11.dbf";
   set newname for datafile  16 to  "/home/opt/oracle/oradata/yangql/alijr12.dbf";
   set newname for datafile  17 to  "/home/opt/oracle/oradata/yangql/alijr13.dbf";
   set newname for datafile  18 to  "/home/opt/oracle/oradata/yangql/alijr14.dbf";
   set newname for datafile  19 to  "/home/opt/oracle/oradata/yangql/alijr15.dbf";
   set newname for datafile  20 to  "/home/opt/oracle/oradata/yangql/alijr16.dbf";
   set newname for datafile  21 to  "/home/opt/oracle/oradata/yangql/alijr17.dbf";
   set newname for datafile  22 to  "/home/opt/oracle/oradata/yangql/alijr18.dbf";
   set newname for datafile  23 to  "/home/opt/oracle/oradata/yangql/alijr19.dbf";
   backup as copy reuse
   datafile
    1 auxiliary format  "/home/opt/oracle/oradata/yangql/system01.dbf"   datafile
 2 auxiliary format  "/home/opt/oracle/oradata/yangql/sysaux01.dbf"   datafile
 3 auxiliary format  "/home/opt/oracle/oradata/yangql/undotbs01.dbf"   datafile
 4 auxiliary format  "/home/opt/oracle/oradata/yangql/users01.dbf"   datafile
 5 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr01.dbf"   datafile
 6 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr02.dbf"   datafile
 7 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr03.dbf"   datafile
 8 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr04.dbf"   datafile
 9 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr05.dbf"   datafile
 10 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr06.dbf"   datafile
 11 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr07.dbf"   datafile
 12 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr08.dbf"   datafile
 13 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr09.dbf"   datafile
 14 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr10.dbf"   datafile
 15 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr11.dbf"   datafile
 16 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr12.dbf"   datafile
 17 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr13.dbf"   datafile
 18 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr14.dbf"   datafile
 19 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr15.dbf"   datafile
 20 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr16.dbf"   datafile
 21 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr17.dbf"   datafile
 22 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr18.dbf"   datafile
 23 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr19.dbf"   ;
   sql 'alter system archive log current';
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /home/opt/oracle/oradata/yangql/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
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting backup at 26-APR-11
channel c1: starting datafile copy
input datafile file number=00005 name=/home/opt/oracle/oradata/yangql/alijr01.dbf
output file name=/home/opt/oracle/oradata/yangql/alijr01.dbf tag=TAG20110426T144511
channel c1: datafile copy complete, elapsed time: 00:01:55
channel c1: starting datafile copy
input datafile file number=00006 name=/home/opt/oracle/oradata/yangql/alijr02.dbf
output file name=/home/opt/oracle/oradata/yangql/alijr02.dbf tag=TAG20110426T144511
channel c1: datafile copy complete, elapsed time: 00:02:05
channel c1: starting datafile copy
input datafile file number=00007 name=/home/opt/oracle/oradata/yangql/alijr03.dbf
output file name=/home/opt/oracle/oradata/yangql/alijr03.dbf tag=TAG20110426T144511
channel c1: datafile copy complete, elapsed time: 00:01:45
channel c1: starting datafile copy
input datafile file number=00008 name=/home/opt/oracle/oradata/yangql/alijr04.dbf
output file name=/home/opt/oracle/oradata/yangql/alijr04.dbf tag=TAG20110426T144511
channel c1: datafile copy complete, elapsed time: 00:01:35
channel c1: starting datafile copy
input datafile file number=00009 name=/home/opt/oracle/oradata/yangql/alijr05.dbf
output file name=/home/opt/oracle/oradata/yangql/alijr05.dbf tag=TAG20110426T144511
channel c1: datafile copy complete, elapsed time: 00:01:35
channel c1: starting datafile copy
input datafile file number=00010 name=/home/opt/oracle/oradata/yangql/alijr06.dbf
output file name=/home/opt/oracle/oradata/yangql/alijr06.dbf tag=TAG20110426T144511
channel c1: datafile copy complete, elapsed time: 00:01:35
channel c1: starting datafile copy
input datafile file number=00011 name=/home/opt/oracle/oradata/yangql/alijr07.dbf
output file name=/home/opt/oracle/oradata/yangql/alijr07.dbf tag=TAG20110426T144511
channel c1: datafile copy complete, elapsed time: 00:01:35
channel c1: starting datafile copy
input datafile file number=00012 name=/home/opt/oracle/oradata/yangql/alijr08.dbf
output file name=/home/opt/oracle/oradata/yangql/alijr08.dbf tag=TAG20110426T144511
channel c1: datafile copy complete, elapsed time: 00:01:35
channel c1: starting datafile copy
input datafile file number=00013 name=/home/opt/oracle/oradata/yangql/alijr09.dbf
output file name=/home/opt/oracle/oradata/yangql/alijr09.dbf tag=TAG20110426T144511
channel c1: datafile copy complete, elapsed time: 00:01:55
channel c1: starting datafile copy
input datafile file number=00014 name=/home/opt/oracle/oradata/yangql/alijr10.dbf
output file name=/home/opt/oracle/oradata/yangql/alijr10.dbf tag=TAG20110426T144511
channel c1: datafile copy complete, elapsed time: 00:01:35
channel c1: starting datafile copy
input datafile file number=00015 name=/home/opt/oracle/oradata/yangql/alijr11.dbf
output file name=/home/opt/oracle/oradata/yangql/alijr11.dbf tag=TAG20110426T144511
channel c1: datafile copy complete, elapsed time: 00:01:35
channel c1: starting datafile copy
input datafile file number=00016 name=/home/opt/oracle/oradata/yangql/alijr12.dbf
output file name=/home/opt/oracle/oradata/yangql/alijr12.dbf tag=TAG20110426T144511
channel c1: datafile copy complete, elapsed time: 00:01:45
channel c1: starting datafile copy
input datafile file number=00017 name=/home/opt/oracle/oradata/yangql/alijr13.dbf
output file name=/home/opt/oracle/oradata/yangql/alijr13.dbf tag=TAG20110426T144511
channel c1: datafile copy complete, elapsed time: 00:01:35
channel c1: starting datafile copy
input datafile file number=00018 name=/home/opt/oracle/oradata/yangql/alijr14.dbf
output file name=/home/opt/oracle/oradata/yangql/alijr14.dbf tag=TAG20110426T144511
channel c1: datafile copy complete, elapsed time: 00:01:41
channel c1: starting datafile copy
input datafile file number=00019 name=/home/opt/oracle/oradata/yangql/alijr15.dbf
output file name=/home/opt/oracle/oradata/yangql/alijr15.dbf tag=TAG20110426T144511
channel c1: datafile copy complete, elapsed time: 00:02:35
channel c1: starting datafile copy
input datafile file number=00020 name=/home/opt/oracle/oradata/yangql/alijr16.dbf
output file name=/home/opt/oracle/oradata/yangql/alijr16.dbf tag=TAG20110426T144511
channel c1: datafile copy complete, elapsed time: 00:01:55
channel c1: starting datafile copy
input datafile file number=00021 name=/home/opt/oracle/oradata/yangql/alijr17.dbf
output file name=/home/opt/oracle/oradata/yangql/alijr17.dbf tag=TAG20110426T144511
channel c1: datafile copy complete, elapsed time: 00:02:00
channel c1: starting datafile copy
input datafile file number=00022 name=/home/opt/oracle/oradata/yangql/alijr18.dbf
output file name=/home/opt/oracle/oradata/yangql/alijr18.dbf tag=TAG20110426T144511
channel c1: datafile copy complete, elapsed time: 00:01:44
channel c1: starting datafile copy
input datafile file number=00023 name=/home/opt/oracle/oradata/yangql/alijr19.dbf
output file name=/home/opt/oracle/oradata/yangql/alijr19.dbf tag=TAG20110426T144511
channel c1: datafile copy complete, elapsed time: 00:01:45
channel c1: starting datafile copy
input datafile file number=00003 name=/home/opt/oracle/oradata/yangql/undotbs01.dbf
output file name=/home/opt/oracle/oradata/yangql/undotbs01.dbf tag=TAG20110426T144511
channel c1: datafile copy complete, elapsed time: 00:01:36
channel c1: starting datafile copy
input datafile file number=00001 name=/home/opt/oracle/oradata/yangql/system01.dbf
output file name=/home/opt/oracle/oradata/yangql/system01.dbf tag=TAG20110426T144511
channel c1: datafile copy complete, elapsed time: 00:00:35
channel c1: starting datafile copy
input datafile file number=00002 name=/home/opt/oracle/oradata/yangql/sysaux01.dbf
output file name=/home/opt/oracle/oradata/yangql/sysaux01.dbf tag=TAG20110426T144511
channel c1: datafile copy complete, elapsed time: 00:00:15
channel c1: starting datafile copy
input datafile file number=00004 name=/home/opt/oracle/oradata/yangql/users01.dbf
output file name=/home/opt/oracle/oradata/yangql/users01.dbf tag=TAG20110426T144511
channel c1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 26-APR-11
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=3 STAMP=749488890 file name=/home/opt/oracle/oradata/yangql/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=4 STAMP=749488890 file name=/home/opt/oracle/oradata/yangql/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=5 STAMP=749488890 file name=/home/opt/oracle/oradata/yangql/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=6 STAMP=749488890 file name=/home/opt/oracle/oradata/yangql/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=7 STAMP=749488890 file name=/home/opt/oracle/oradata/yangql/alijr01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=8 STAMP=749488890 file name=/home/opt/oracle/oradata/yangql/alijr02.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=9 STAMP=749488890 file name=/home/opt/oracle/oradata/yangql/alijr03.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=10 STAMP=749488890 file name=/home/opt/oracle/oradata/yangql/alijr04.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=11 STAMP=749488890 file name=/home/opt/oracle/oradata/yangql/alijr05.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=12 STAMP=749488890 file name=/home/opt/oracle/oradata/yangql/alijr06.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=13 STAMP=749488890 file name=/home/opt/oracle/oradata/yangql/alijr07.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=14 STAMP=749488890 file name=/home/opt/oracle/oradata/yangql/alijr08.dbf
datafile 13 switched to datafile copy
input datafile copy RECID=15 STAMP=749488890 file name=/home/opt/oracle/oradata/yangql/alijr09.dbf
datafile 14 switched to datafile copy
input datafile copy RECID=16 STAMP=749488890 file name=/home/opt/oracle/oradata/yangql/alijr10.dbf
datafile 15 switched to datafile copy
input datafile copy RECID=17 STAMP=749488890 file name=/home/opt/oracle/oradata/yangql/alijr11.dbf
datafile 16 switched to datafile copy
input datafile copy RECID=18 STAMP=749488890 file name=/home/opt/oracle/oradata/yangql/alijr12.dbf
datafile 17 switched to datafile copy
input datafile copy RECID=19 STAMP=749488890 file name=/home/opt/oracle/oradata/yangql/alijr13.dbf
datafile 18 switched to datafile copy
input datafile copy RECID=20 STAMP=749488890 file name=/home/opt/oracle/oradata/yangql/alijr14.dbf
datafile 19 switched to datafile copy
input datafile copy RECID=21 STAMP=749488890 file name=/home/opt/oracle/oradata/yangql/alijr15.dbf
datafile 20 switched to datafile copy
input datafile copy RECID=22 STAMP=749488891 file name=/home/opt/oracle/oradata/yangql/alijr16.dbf
datafile 21 switched to datafile copy
input datafile copy RECID=23 STAMP=749488891 file name=/home/opt/oracle/oradata/yangql/alijr17.dbf
datafile 22 switched to datafile copy
input datafile copy RECID=24 STAMP=749488891 file name=/home/opt/oracle/oradata/yangql/alijr18.dbf
datafile 23 switched to datafile copy
input datafile copy RECID=25 STAMP=749488891 file name=/home/opt/oracle/oradata/yangql/alijr19.dbf
Finished Duplicate Db at 26-APR-11
sql statement: alter system archive log current
released channel: c1
released channel: s1
released channel: s2
RMAN> exit
Recovery Manager complete.
======================备库的操作================

检查备库上的数据文件。
oracle>sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on Tue Apr 26 13:07:48 2011
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to an idle instance.
@>startup nomount pfile='/home/opt/oracle/products/11.2.0/dbs/yangql.ora'
ORACLE instance started.
Total System Global Area 1653518336 bytes
Fixed Size                  2213896 bytes
Variable Size            1006635000 bytes
Database Buffers          637534208 bytes
Redo Buffers                7135232 bytes
@>exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning option
oracle>sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on Tue Apr 26 14:04:43 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning option

@>select * from v$logfile;
GROUP# STATUS  TYPE   MEMBER   IS_
------ ------- ----------------------------------------------------------------------
 3     ONLINE      /home/opt/oracle/oradata/yangql/redo03.log NO
2      ONLINE      /home/opt/oracle/oradata/yangql/redo02.log NO
1      ONLINE      /home/opt/oracle/oradata/yangql/redo01.log NO

@>col member for a45
@>select * from v$logfile;
    GROUP# STATUS  TYPE    MEMBER                                        IS_
---------- ------- ------- --------------------------------------------- ---
         3         ONLINE  /home/opt/oracle/oradata/yangql/redo03.log   NO
         2         ONLINE  /home/opt/oracle/oradata/yangql/redo02.log   NO
         1         ONLINE  /home/opt/oracle/oradata/yangql/redo01.log   NO
@>col ts#        format 9999
@>col tablespace format a20
@>col file       format a52
@>select t.ts#, t.name "tablespace", d.file#, d.name "file", d.status, d.enabled
  2  from v$tablespace t, v$datafile d
  3  where t.ts#=d.ts#
  4  union all
  5  select t.ts#, t.name "tablespace", d.file#, d.name "file", d.status, d.enabled
  6  from v$tablespace t, v$tempfile d
  7  where t.ts#=d.ts#  order by 1, 4;
  TS# tablespace                FILE# file                                                 STATUS  ENABLED
----- -------------------- ---------- ---------------------------------------------------- ------- ----------
    0 SYSTEM                        1 /home/opt/oracle/oradata/yangql/system01.dbf        SYSTEM  READ WRITE
    1 SYSAUX                        2 /home/opt/oracle/oradata/yangql/sysaux01.dbf        ONLINE  READ WRITE
    2 UNDOTBS1                      3 /home/opt/oracle/oradata/yangql/undotbs01.dbf       ONLINE  READ WRITE
    3 TEMP                          1 /home/opt/oracle/oradata/yangql/temp01.dbf          ONLINE  READ WRITE
    4 USERS                         4 /home/opt/oracle/oradata/yangql/users01.dbf         ONLINE  READ WRITE
    6 AJR                         5 /home/opt/oracle/oradata/yangql/alijr01.dbf         ONLINE  READ WRITE
    6 AJR                         6 /home/opt/oracle/oradata/yangql/alijr02.dbf         ONLINE  READ WRITE
    6 AJR                         7 /home/opt/oracle/oradata/yangql/alijr03.dbf         ONLINE  READ WRITE
    6 AJR                         8 /home/opt/oracle/oradata/yangql/alijr04.dbf         ONLINE  READ WRITE
    6 AJR                         9 /home/opt/oracle/oradata/yangql/alijr05.dbf         ONLINE  READ WRITE
    6 AJR                        10 /home/opt/oracle/oradata/yangql/alijr06.dbf         ONLINE  READ WRITE
    6 AJR                        11 /home/opt/oracle/oradata/yangql/alijr07.dbf         ONLINE  READ WRITE
    6 AJR                        12 /home/opt/oracle/oradata/yangql/alijr08.dbf         ONLINE  READ WRITE
    6 AJR                        13 /home/opt/oracle/oradata/yangql/alijr09.dbf         ONLINE  READ WRITE
    6 AJR                        14 /home/opt/oracle/oradata/yangql/alijr10.dbf         ONLINE  READ WRITE
    6 AJR                        15 /home/opt/oracle/oradata/yangql/alijr11.dbf         ONLINE  READ WRITE
    6 AJR                        16 /home/opt/oracle/oradata/yangql/alijr12.dbf         ONLINE  READ WRITE
    6 AJR                        17 /home/opt/oracle/oradata/yangql/alijr13.dbf         ONLINE  READ WRITE
    6 AJR                        18 /home/opt/oracle/oradata/yangql/alijr14.dbf         ONLINE  READ WRITE
    6 AJR                        19 /home/opt/oracle/oradata/yangql/alijr15.dbf         ONLINE  READ WRITE
    6 AJR                        20 /home/opt/oracle/oradata/yangql/alijr16.dbf         ONLINE  READ WRITE
    6 AJR                        21 /home/opt/oracle/oradata/yangql/alijr17.dbf         ONLINE  READ WRITE
    6 AJR                        22 /home/opt/oracle/oradata/yangql/alijr18.dbf         ONLINE  READ WRITE
    6 AJR                        23 /home/opt/oracle/oradata/yangql/alijr19.dbf         ONLINE  READ WRITE

24 rows selected.

@>exit             
剩下的就是进行切换日志检查dg的功能了~!

目录
相关文章
|
6天前
|
存储 弹性计算 缓存
阿里云服务器租赁费用:新版租赁收费标准及活动报价参考
本文更新了2026年阿里云全系列云服务器租赁活动报价,所有特惠资源均可前往阿里云活动中心选购,整体覆盖从个人入门到企业级高性能场景的全梯度需求。其中轻量应用服务器主打极致性价比,2核2G峰值200M带宽配置每日10点、15点限时抢购价仅38元/年,2核4G配置379元/年起;高性价比的经济型e实例、通用算力型u2i实例覆盖2核4G至4核32G全档位,适配开发测试与中小型企业业务;搭载英特尔至强6处理器的第九代c9i企业级实例算力较上代提升20%,支撑高并发生产环境,不同实例规格价差清晰,用户可根据自身业务负载与预算灵活选型。
1628 116
|
7天前
|
人工智能 程序员 API
Codex 接入 DeepSeek-V4-Flash:还能补上识图,提供两套方案
Codex 接入 DeepSeek-V4-Flash 怎么配?本文覆盖 CLI 与桌面端,再用 qwen3-vl-flash 补识图,两套方案可直接照做
1110 5
|
13天前
|
云安全 人工智能 运维
阿里云联动百位企业安全专家,共识Agent防御最佳实践
当Agent成为新员工,你的安全边界在哪里?
1954 9
阿里云联动百位企业安全专家,共识Agent防御最佳实践
|
7天前
|
编解码 人工智能 安全
2核4G/4核8G/8核16G阿里云服务器如何选择实例?经济型e、通用算力型u2i与计算型c9i选哪个?
本文介绍了阿里云2核4G、4核8G、8核16G三档主流配置下经济型e、通用算力型u2i和计算型c9i三种实例的最新活动价格与适用场景。同配置下三者价差显著,以2核4G为例,经济型e低至599.93元/年,计算型c9i则高达1742.08元/年。文章详细解析了各实例的性能定位:经济型e适合轻负载入门场景,u2i兼顾稳定算力与性价比,c9i凭借第9代至强处理器与芯片级安全能力支撑高性能业务。同时提示用户可叠加满减优惠券享受折上折,建议根据业务负载与预算综合决策。
538 112
|
19天前
|
人工智能 前端开发 Linux
Codex 桌面版安装 + CC Switch 接入第三方 API 完整教程(2026 最新)
2026最新教程:手把手教你安装Codex桌面版,通过CC Switch v3.17.0一键接入Fenno等国产API(兼容OpenAI Responses格式),跳过账号登录,完整启用代码审查、多步任务与上下文感知功能。零基础友好,全程图文实操。(239字)
2753 4
|
11天前
|
存储 人工智能 关系型数据库
阿里云AI产品与云产品最新组合套餐:Token Plan、AI coding及云服务器和建站等组合优惠价
阿里云推出全新“算力+模型+应用”一站式云与AI组合套餐活动,覆盖从个人开发者到中大型企业的全场景需求。核心亮点为分三档定价的Token Plan订阅服务,支持Qwen3.8-Max-Preview大模型调用,错峰时段最低可享0.2折优惠。活动同步推出AI Coding、智能体部署、云电脑托管、0代码建站等十余类场景化组合,搭配99元/年的普惠云服务器、88元/年的入门数据库等经典特惠产品,还为企业提供1V1定制化AI转型方案,大幅降低了不同用户群体拥抱AI的技术门槛与采购成本。
730 111
|
21天前
|
人工智能 JSON 安全
Fastjson远程代码执行漏洞,阿里云AI安全为您保驾护航
阿里云AI安全产品联动防御Fastjson攻击
2653 13
Fastjson远程代码执行漏洞,阿里云AI安全为您保驾护航
|
7天前
|
人工智能 JSON Shell
2026AI漫剧本地全开源方案(附各个软件模型链接),8G显卡也能流畅运行
这是一套完全本地化部署的AI漫剧生成技术链路:涵盖LLM剧本分镜生成、FLUX文生图(IP-Adapter人脸锁定)、StoryDiffusion时序连贯控制、LTX-2.3唇形同步视频生成,及ComfyUI全流程调度。零云端费用,仅耗硬件算力,单集2–4小时可产出竖屏短视频,适配抖音/B站分发。
|
5天前
|
人工智能 API 开发工具
2026 零基础本地 AI 漫剧完整实操教程(8G 笔记本显卡可用|附可直接复制命令与代码)
本方案提供完全离线、本地运行的漫剧全自动制作流程:RTX3060/4050 8G显卡即可驱动,涵盖Qwen写分镜→ComfyUI统一角色绘图→LTX2.3图生微动画→Qwen3-TTS本地配音→FFmpeg自动合成,全程无水印、免API、不限次。专为低显存优化,解决变脸、闪烁、爆内存三大痛点。(239字)

热门文章

最新文章