primary database

db_name=zwc, db_unique_name=zwc

standby database

db_name=zwc, db_unique_name=standby

on primary database

[oracle@vmdb12c ~]$ sqlplus sys/oracle@zwc as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Thu Sep 26 16:12:10 2013

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options SQL> col username for a10
SQL> select * from v$pwfile_users; USERNAME SYSDB SYSOP SYSAS SYSBA SYSDG SYSKM CON_ID
---------- ----- ----- ----- ----- ----- ----- ----------
SYS TRUE TRUE FALSE FALSE FALSE FALSE 0
SYSDG FALSE FALSE FALSE FALSE TRUE FALSE 1
SYSBACKUP FALSE FALSE FALSE TRUE FALSE FALSE 1
SYSKM FALSE FALSE FALSE FALSE FALSE TRUE 1 SQL> Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@vmdb12c ~]$ sqlplus sys/oracle@zwc as sysdg SQL*Plus: Release 12.1.0.1.0 Production on Thu Sep 26 16:12:20 2013 Copyright (c) 1982, 2013, Oracle. All rights reserved. ERROR:
ORA-01031: insufficient privileges Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
[oracle@vmdb12c ~]$
[oracle@vmdb12c ~]$
[oracle@vmdb12c ~]$
[oracle@vmdb12c ~]$ sqlplus sys/oracle@zwc as sysbackup SQL*Plus: Release 12.1.0.1.0 Production on Thu Sep 26 16:12:37 2013 Copyright (c) 1982, 2013, Oracle. All rights reserved. ERROR:
ORA-01031: insufficient privileges Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

unlock
SYSBACKUP,SYSDG
users

[oracle@vmdb12c ~]$ sqlplus sys/oracle@zwc as sysdba   

SQL*Plus: Release 12.1.0.1.0 Production on Thu Sep 26 16:14:39 2013

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options SQL> col username for a10
SQL> select username,account_status from dba_users where username in('SYSBACKUP','SYSDG','SYS'); USERNAME ACCOUNT_STATUS
---------- --------------------------------
SYSDG EXPIRED & LOCKED
SYSBACKUP EXPIRED & LOCKED
SYS OPEN SQL> alter user sysdg identified by oracle account unlock; User altered. SQL> alter user sysbackup identified by oracle account unlock; User altered. SQL> select username,account_status from dba_users where username in('SYSBACKUP','SYSDG','SYS'); USERNAME ACCOUNT_STATUS
---------- --------------------------------
SYS OPEN
SYSBACKUP OPEN
SYSDG OPEN SQL>

retry

[oracle@vmdb12c ~]$ sqlplus sysbackup/oracle@zwc as sysbackup

SQL*Plus: Release 12.1.0.1.0 Production on Thu Sep 26 16:53:42 2013

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options SQL> Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@vmdb12c ~]$ sqlplus sysdg/oracle@zwc as sysdg SQL*Plus: Release 12.1.0.1.0 Production on Thu Sep 26 16:53:52 2013 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options SQL> Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@vmdb12c ~]$

create pdb tablespace,user

[oracle@vmdb12c ~]$ sqlplus sys/oracle@zhongwc1 as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Thu Sep 26 16:20:45 2013

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 ZHONGWC1 READ WRITE NO
SQL> create tablespace zwc datafile '/u01/app/oracle/oradata/zwc/zhongwc1/zwc01.dbf' size 50M autoextend on; Tablespace created. SQL> select name from v$datafile; NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/zwc/undotbs01.dbf
/u01/app/oracle/oradata/zwc/zhongwc1/system01.dbf
/u01/app/oracle/oradata/zwc/zhongwc1/sysaux01.dbf
/u01/app/oracle/oradata/zwc/zhongwc1/zhongwc1_users01.dbf
/u01/app/oracle/oradata/zwc/zhongwc1/zwc01.dbf SQL> create user zwc identified by zwc default tablespace zwc; User created. SQL> grant dba to zwc; Grant succeeded. SQL> conn zwc/zwc@zhongwc2
ERROR:
ORA-01017: invalid username/password; logon denied Warning: You are no longer connected to ORACLE.
SQL> conn zwc/zwc@zwc
ERROR:
ORA-01017: invalid username/password; logon denied SQL> conn zwc/zwc@zhongwc1
Connected.
SQL> create table t_01 as select * from dba_objects where rownum<101; Table created. SQL> commit; Commit complete. SQL> select count(*) from t_01; COUNT(*)
----------
100 SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 ZHONGWC1 READ WRITE NO
SQL>

create standby logfile

[oracle@vmdb12c ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Thu Sep 26 16:24:11 2013

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options SQL> show con_name CON_NAME
------------------------------
CDB$ROOT
SQL> alter database force logging; Database altered. SQL> select group#,bytes/1024/1024 "size M" from v$log; GROUP# size M
---------- ----------
1 50
2 50
3 50 SQL> alter database add standby logfile group 4 size 50M; Database altered. SQL> alter database add standby logfile group 5 size 50M; Database altered. SQL> alter database add standby logfile group 6 size 50M; Database altered. SQL> alter database add standby logfile group 7 size 50M; Database altered. SQL> select group#,bytes/1024/1024 "size M" from v$log; GROUP# size M
---------- ----------
1 50
2 50
3 50 SQL> select group#,bytes/1024/1024 "size M" from v$standby_log; GROUP# size M
---------- ----------
4 50
5 50
6 50
7 50 SQL> select member from v$logfile; MEMBER
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/zwc/redo03.log
/u01/app/oracle/oradata/zwc/redo02.log
/u01/app/oracle/oradata/zwc/redo01.log
/u01/app/oracle/fast_recovery_area/ZWC/onlinelog/o1_mf_4_947vvsg7_.log
/u01/app/oracle/fast_recovery_area/ZWC/onlinelog/o1_mf_5_947vvwvr_.log
/u01/app/oracle/fast_recovery_area/ZWC/onlinelog/o1_mf_6_947vw4dg_.log
/u01/app/oracle/fast_recovery_area/ZWC/onlinelog/o1_mf_7_947vw7x5_.log 7 rows selected.
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/arch
Oldest online log sequence 16
Next log sequence to archive 18
Current log sequence 18

tns,listener

[oracle@vmdb12c admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools. ZWC =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vmdb12c)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = zwc)
)
) zhongwc1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vmdb12c)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = zhongwc1)
)
) zhongwc2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vmdb12c)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = zhongwc2)
)
) standby =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = standby12c)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = standby)
)
) LISTENER_ZWC =
(ADDRESS = (PROTOCOL = TCP)(HOST = vmdb12c)(PORT = 1521)) [oracle@vmdb12c admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools. LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vmdb12c)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)

scp  file

[oracle@vmdb12c admin]$ scp listener.ora tnsnames.ora oracle@standby12c:$ORACLE_HOME/network/admin
oracle@standby12c's password:
listener.ora 100% 335 0.3KB/s 00:00
tnsnames.ora 100% 944 0.9KB/s 00:00
[oracle@vmdb12c admin]$ cd ../../dbs
[oracle@vmdb12c dbs]$ scp orapwzwc oracle@standby12c:$ORACLE_HOME/dbs
oracle@standby12c's password:
orapwzwc 100% 7680 7.5KB/s 00:00
[oracle@vmdb12c dbs]$

on standby

rename pwdfile,create init.ora

[oracle@standby12c dbs]$ mv orapwzwc orapwstandby
[oracle@standby12c dbs]$ echo "db_name=zwc" > initstandby.ora

create dir

[oracle@standby12c ~]$ mkdir -p /u01/app/oracle/fast_recovery_area
[oracle@standby12c ~]$ mkdir -p $ORACLE_BASE/admin/$ORACLE_SID/{a,dp}dump
[oracle@standby12c ~]$ mkdir -p $ORACLE_BASE/oradata/standby
[oracle@standby12c ~]$ mkdir -p $ORACLE_BASE/oradata/standby/pdbseed
[oracle@standby12c ~]$ mkdir -p $ORACLE_BASE/oradata/standby/zhongwc1
[oracle@standby12c ~]$ mkdir -p $ORACLE_BASE/oradata/standby/zhongwc2

tns,listener

[oracle@standby12c admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools. ZWC =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vmdb12c)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = zwc)
)
) zhongwc1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vmdb12c)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = zhongwc1)
)
) zhongwc2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vmdb12c)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = zhongwc2)
)
) standby =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = standby12c)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = standby)
)
) LISTENER_ZWC =
(ADDRESS = (PROTOCOL = TCP)(HOST = standby12c)(PORT = 1521)) [oracle@standby12c admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools. SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = standby)
(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)
(SID_NAME = standby)
)
) LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = standby12c)(PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
) ADR_BASE_LISTENER = /u01/app/oracle

startup nomount

[oracle@standby12c ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Thu Sep 26 16:49:15 2013

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup nomount
ORACLE instance started. Total System Global Area 217157632 bytes
Fixed Size 2286656 bytes
Variable Size 159386560 bytes
Database Buffers 50331648 bytes
Redo Buffers 5152768 bytes

on primary

[oracle@vmdb12c ~]$ sqlplus sys/oracle@standby as sysdba   

SQL*Plus: Release 12.1.0.1.0 Production on Thu Sep 26 16:50:39 2013

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options SQL> select status from v$instance; STATUS
------------------------
STARTED SQL> Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@vmdb12c ~]$ sqlplus sys/oracle@zwc as sysdba SQL*Plus: Release 12.1.0.1.0 Production on Thu Sep 26 16:50:48 2013 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options SQL> select status from v$instance; STATUS
------------
OPEN

RMAN create standby database

[oracle@vmdb12c ~]$ rman

Recovery Manager: Release 12.1.0.1.0 - Production on Thu Sep 26 17:18:36 2013

Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

RMAN> connect target "sysbackup/oracle@zwc as sysbackup"

connected to target database: ZWC (DBID=581429757)

RMAN> connect auxiliary "sysbackup/oracle@standby as sysbackup"

connected to auxiliary database: ZWC (not mounted)

RMAN> duplicate target database for standby nofilenamecheck
2> from active database
3> dorecover
4> spfile
5> set db_unique_name="standby"
set control_files='/u01/app/oracle/oradata/standby/control01.ctl','/u01/app/oracle/oradata/standby/control02.ctl'
set log_archive_dest_2='service=zwc async register valid_for=(online_logfile,primary_role) db_unique_name=zwc'
set memory_target='0'
set audit_file_dest='/u01/app/oracle/admin/standby/adump'
10> set fal_client='zwc'
11> set fal_server='standby'
12> set db_file_name_convert='zwc','standby'
13> set log_file_name_convert='zwc','standby'
14> set pdb_file_name_convert='zwc','standby'
15> set standby_file_management='AUTO'; Starting Duplicate Db at 26-SEP-13
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=20 device type=DISK
current log archived contents of Memory Script:
{
backup as copy reuse
targetfile '/u01/app/oracle/product/12.1.0/dbhome_1/dbs/orapwzwc' auxiliary format
'/u01/app/oracle/product/12.1.0/dbhome_1/dbs/orapwstandby' ;
restore clone from service 'zwc' spfile to
'/u01/app/oracle/product/12.1.0/dbhome_1/dbs/spfilestandby.ora';
sql clone "alter system set spfile= ''/u01/app/oracle/product/12.1.0/dbhome_1/dbs/spfilestandby.ora''";
}
executing Memory Script Starting backup at 26-SEP-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=66 device type=DISK
Finished backup at 26-SEP-13 Starting restore at 26-SEP-13
using channel ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service zwc
channel ORA_AUX_DISK_1: restoring SPFILE
output file name=/u01/app/oracle/product/12.1.0/dbhome_1/dbs/spfilestandby.ora
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 26-SEP-13 sql statement: alter system set spfile= ''/u01/app/oracle/product/12.1.0/dbhome_1/dbs/spfilestandby.ora'' contents of Memory Script:
{
sql clone "alter system set db_unique_name =
''standby'' comment=
'''' scope=spfile";
sql clone "alter system set control_files =
''/u01/app/oracle/oradata/standby/control01.ctl'', ''/u01/app/oracle/oradata/standby/control02.ctl'' comment=
'''' scope=spfile";
sql clone "alter system set log_archive_dest_2 =
''service=zwc async register valid_for=(online_logfile,primary_role) db_unique_name=zwc'' comment=
'''' scope=spfile";
sql clone "alter system set memory_target =
0 comment=
'''' scope=spfile";
sql clone "alter system set audit_file_dest =
''/u01/app/oracle/admin/standby/adump'' comment=
'''' scope=spfile";
sql clone "alter system set fal_client =
''zwc'' comment=
'''' scope=spfile";
sql clone "alter system set fal_server =
''standby'' comment=
'''' scope=spfile";
sql clone "alter system set db_file_name_convert =
''zwc'', ''standby'' comment=
'''' scope=spfile";
sql clone "alter system set log_file_name_convert =
''zwc'', ''standby'' comment=
'''' scope=spfile";
sql clone "alter system set pdb_file_name_convert =
''zwc'', ''standby'' comment=
'''' scope=spfile";
sql clone "alter system set standby_file_management =
''AUTO'' comment=
'''' scope=spfile";
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script sql statement: alter system set db_unique_name = ''standby'' comment= '''' scope=spfile sql statement: alter system set control_files = ''/u01/app/oracle/oradata/standby/control01.ctl'', ''/u01/app/oracle/oradata/standby/control02.ctl'' comment= '''' scope=spfile sql statement: alter system set log_archive_dest_2 = ''service=zwc async register valid_for=(online_logfile,primary_role) db_unique_name=zwc'' comment= '''' scope=spfile sql statement: alter system set memory_target = 0 comment= '''' scope=spfile sql statement: alter system set audit_file_dest = ''/u01/app/oracle/admin/standby/adump'' comment= '''' scope=spfile sql statement: alter system set fal_client = ''zwc'' comment= '''' scope=spfile sql statement: alter system set fal_server = ''standby'' comment= '''' scope=spfile sql statement: alter system set db_file_name_convert = ''zwc'', ''standby'' comment= '''' scope=spfile sql statement: alter system set log_file_name_convert = ''zwc'', ''standby'' comment= '''' scope=spfile sql statement: alter system set pdb_file_name_convert = ''zwc'', ''standby'' comment= '''' scope=spfile sql statement: alter system set standby_file_management = ''AUTO'' comment= '''' scope=spfile Oracle instance shut down connected to auxiliary database (not started)
Oracle instance started Total System Global Area 321548288 bytes Fixed Size 2287864 bytes
Variable Size 264242952 bytes
Database Buffers 50331648 bytes
Redo Buffers 4685824 bytes contents of Memory Script:
{
restore clone from service 'zwc' standby controlfile;
}
executing Memory Script Starting restore at 26-SEP-13
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=19 device type=DISK channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service zwc
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
output file name=/u01/app/oracle/oradata/standby/control01.ctl
output file name=/u01/app/oracle/oradata/standby/control02.ctl
Finished restore at 26-SEP-13 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
"/u01/app/oracle/oradata/standby/temp01.dbf";
set newname for tempfile 2 to
"/u01/app/oracle/oradata/standby/pdbseed/pdbseed_temp01.dbf";
set newname for tempfile 3 to
"/u01/app/oracle/oradata/standby/zhongwc1/temp01.dbf";
set newname for tempfile 4 to
"/u01/app/oracle/oradata/standby/zhongwc2/temp01.dbf";
switch clone tempfile all;
set newname for datafile 1 to
"/u01/app/oracle/oradata/standby/system01.dbf";
set newname for datafile 3 to
"/u01/app/oracle/oradata/standby/sysaux01.dbf";
set newname for datafile 4 to
"/u01/app/oracle/oradata/standby/undotbs01.dbf";
set newname for datafile 5 to
"/u01/app/oracle/oradata/standby/pdbseed/system01.dbf";
set newname for datafile 6 to
"/u01/app/oracle/oradata/standby/users01.dbf";
set newname for datafile 7 to
"/u01/app/oracle/oradata/standby/pdbseed/sysaux01.dbf";
set newname for datafile 8 to
"/u01/app/oracle/oradata/standby/zhongwc1/system01.dbf";
set newname for datafile 9 to
"/u01/app/oracle/oradata/standby/zhongwc1/sysaux01.dbf";
set newname for datafile 10 to
"/u01/app/oracle/oradata/standby/zhongwc1/zhongwc1_users01.dbf";
set newname for datafile 11 to
"/u01/app/oracle/oradata/standby/zhongwc2/system01.dbf";
set newname for datafile 12 to
"/u01/app/oracle/oradata/standby/zhongwc2/sysaux01.dbf";
set newname for datafile 13 to
"/u01/app/oracle/oradata/standby/zhongwc2/zhongwc2_users01.dbf";
set newname for datafile 14 to
"/u01/app/oracle/oradata/standby/zhongwc1/standby01.dbf";
restore
from service 'zwc' clone database
;
sql 'alter system archive log current';
}
executing Memory Script executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME renamed tempfile 1 to /u01/app/oracle/oradata/standby/temp01.dbf in control file
renamed tempfile 2 to /u01/app/oracle/oradata/standby/pdbseed/pdbseed_temp01.dbf in control file
renamed tempfile 3 to /u01/app/oracle/oradata/standby/zhongwc1/temp01.dbf in control file
renamed tempfile 4 to /u01/app/oracle/oradata/standby/zhongwc2/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 Starting restore at 26-SEP-13
using channel ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service zwc
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/standby/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:45
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service zwc
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/standby/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:45
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service zwc
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/standby/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service zwc
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/standby/pdbseed/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service zwc
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/standby/users01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service zwc
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/standby/pdbseed/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:45
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service zwc
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00008 to /u01/app/oracle/oradata/standby/zhongwc1/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service zwc
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00009 to /u01/app/oracle/oradata/standby/zhongwc1/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:35
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service zwc
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00010 to /u01/app/oracle/oradata/standby/zhongwc1/zhongwc1_users01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service zwc
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00011 to /u01/app/oracle/oradata/standby/zhongwc2/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service zwc
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00012 to /u01/app/oracle/oradata/standby/zhongwc2/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:35
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service zwc
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00013 to /u01/app/oracle/oradata/standby/zhongwc2/zhongwc2_users01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service zwc
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00014 to /u01/app/oracle/oradata/standby/zhongwc1/standby01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 26-SEP-13 sql statement: alter system archive log current
current log archived contents of Memory Script:
{
restore clone force from service 'zwc'
archivelog from scn 1983825;
switch clone datafile all;
}
executing Memory Script Starting restore at 26-SEP-13
using channel ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service zwc
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=21
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service zwc
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=22
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 26-SEP-13 datafile 1 switched to datafile copy
input datafile copy RECID=3 STAMP=827169834 file name=/u01/app/oracle/oradata/standby/system01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=4 STAMP=827169834 file name=/u01/app/oracle/oradata/standby/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=5 STAMP=827169834 file name=/u01/app/oracle/oradata/standby/undotbs01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=6 STAMP=827169834 file name=/u01/app/oracle/oradata/standby/pdbseed/system01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=7 STAMP=827169834 file name=/u01/app/oracle/oradata/standby/users01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=8 STAMP=827169834 file name=/u01/app/oracle/oradata/standby/pdbseed/sysaux01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=9 STAMP=827169834 file name=/u01/app/oracle/oradata/standby/zhongwc1/system01.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=10 STAMP=827169834 file name=/u01/app/oracle/oradata/standby/zhongwc1/sysaux01.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=11 STAMP=827169834 file name=/u01/app/oracle/oradata/standby/zhongwc1/zhongwc1_users01.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=12 STAMP=827169834 file name=/u01/app/oracle/oradata/standby/zhongwc2/system01.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=13 STAMP=827169834 file name=/u01/app/oracle/oradata/standby/zhongwc2/sysaux01.dbf
datafile 13 switched to datafile copy
input datafile copy RECID=14 STAMP=827169834 file name=/u01/app/oracle/oradata/standby/zhongwc2/zhongwc2_users01.dbf
datafile 14 switched to datafile copy
input datafile copy RECID=15 STAMP=827169835 file name=/u01/app/oracle/oradata/standby/zhongwc1/standby01.dbf contents of Memory Script:
{
set until scn 1984399;
recover
standby
clone database
delete archivelog
;
}
executing Memory Script executing command: SET until clause Starting recover at 26-SEP-13
using channel ORA_AUX_DISK_1 starting media recovery archived log for thread 1 with sequence 21 is already on disk as file /u01/app/oracle/arch1_21_825450046.dbf
archived log for thread 1 with sequence 22 is already on disk as file /u01/app/oracle/arch1_22_825450046.dbf
archived log file name=/u01/app/oracle/arch1_21_825450046.dbf thread=1 sequence=21
archived log file name=/u01/app/oracle/arch1_22_825450046.dbf thread=1 sequence=22
media recovery complete, elapsed time: 00:00:02
Finished recover at 26-SEP-13
Finished Duplicate Db at 26-SEP-13 RMAN>
SQL> alter system set log_archive_dest_2='service=standby lgwr async valid_for=(online_logfiles,primary_role) db_unique_name=standby';

System altered.

SQL> alter system set standby_file_management='AUTO';

System altered.

SQL> alter system set db_file_name_convert='standby','zwc' scope=spfile;

System altered.

SQL> alter system set log_file_name_convert='standby','zwc' scope=spfile;

System altered.

SQL> alter system set pdb_file_name_convert='standby','zwc' scope=spfile;

System altered.

on standby

SQL> select DATABASE_ROLE,PROTECTION_MODE,open_mode from v$database;

DATABASE_ROLE    PROTECTION_MODE      OPEN_MODE
---------------- -------------------- --------------------
PHYSICAL STANDBY MAXIMUM PERFORMANCE MOUNTED SQL> alter database recover managed standby database using current logfile disconnect from session; Database altered.
SQL> alter database recover managed standby database cancel;

Database altered.

SQL> alter database open;

Database altered.

SQL> alter database recover managed standby database using current logfile disconnect from session;

Database altered.

SQL> select DATABASE_ROLE,PROTECTION_MODE,open_mode from v$database;

DATABASE_ROLE    PROTECTION_MODE      OPEN_MODE
---------------- -------------------- --------------------
PHYSICAL STANDBY MAXIMUM PERFORMANCE READ ONLY WITH APPLY SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ZHONGWC1 READ ONLY NO
4 ZHONGWC2 READ ONLY NO

alert_sid.log

alter database recover managed standby database using current logfile disconnect from session
Thu Sep 26 18:48:32 2013
Attempt to start background Managed Standby Recovery process (standby)
Starting background process MRP0
Thu Sep 26 18:48:32 2013
MRP0 started with pid=26, OS id=7565
Thu Sep 26 18:48:32 2013
MRP0: Background Managed Standby Recovery process started (standby)
Thu Sep 26 18:48:37 2013
Serial Media Recovery started
Managed Standby Recovery starting Real Time Apply
Thu Sep 26 18:48:37 2013
Waiting for all non-current ORLs to be archived...
Thu Sep 26 18:48:37 2013
All non-current ORLs have been archived.
Thu Sep 26 18:48:37 2013
Recovery of Online Redo Log: Thread 1 Group 4 Seq 26 Reading mem 0
Mem# 0: /u01/app/oracle/fast_recovery_area/STANDBY/onlinelog/o1_mf_4_947z9kmq_.log
Completed: alter database recover managed standby database using current logfile disconnect from session
Thu Sep 26 18:49:20 2013
Using STANDBY_ARCHIVE_DEST parameter default value as /u01/app/oracle/arch
Thu Sep 26 18:49:20 2013
RFS[1]: Assigned to RFS process (PID:7575)
RFS[1]: Selected log 4 for thread 1 sequence 26 dbid 581429757 branch 825450046
Thu Sep 26 18:49:20 2013
Archived Log entry 6 added for thread 1 sequence 26 ID 0x22a7c6fd dest 1:
Thu Sep 26 18:49:21 2013
Media Recovery Waiting for thread 1 sequence 27
Thu Sep 26 18:49:23 2013
RFS[2]: Assigned to RFS process (PID:7579)
RFS[2]: Selected log 4 for thread 1 sequence 27 dbid 581429757 branch 825450046
Thu Sep 26 18:49:23 2013
Recovery of Online Redo Log: Thread 1 Group 4 Seq 27 Reading mem 0
Mem# 0: /u01/app/oracle/fast_recovery_area/STANDBY/onlinelog/o1_mf_4_947z9kmq_.log
Thu Sep 26 18:49:23 2013
Archived Log entry 7 added for thread 1 sequence 27 ID 0x22a7c6fd dest 1:
Thu Sep 26 18:49:24 2013
Media Recovery Waiting for thread 1 sequence 28
RFS[2]: Selected log 4 for thread 1 sequence 28 dbid 581429757 branch 825450046
Thu Sep 26 18:53:36 2013
Primary database is in MAXIMUM PERFORMANCE mode
RFS[3]: Assigned to RFS process (PID:7640)
RFS[3]: Selected log 5 for thread 1 sequence 29 dbid 581429757 branch 825450046
Thu Sep 26 18:53:36 2013
Archived Log entry 8 added for thread 1 sequence 28 ID 0x22a7c6fd dest 1:
Thu Sep 26 18:53:36 2013
Media Recovery Log /u01/app/oracle/arch1_28_825450046.dbf
Media Recovery Waiting for thread 1 sequence 29 (in transit)
Thu Sep 26 18:53:36 2013
Recovery of Online Redo Log: Thread 1 Group 5 Seq 29 Reading mem 0
Mem# 0: /u01/app/oracle/fast_recovery_area/STANDBY/onlinelog/o1_mf_5_947z9lwn_.log

Oracle Database 12c Using duplicate standby database from active database Created Active DataGuard的更多相关文章

  1. Oracle Database 12c 新特性 - Pluggable Database

    在Oracle Database 12c中,可组装式数据库 - Pluggable Database为云计算而生.在12c以前,Oracle数据库是通过Schema来进行用户模式隔离的,现在,可组装式 ...

  2. 使用duplicate target database ... from active database复制数据库

    使用duplicate target database ... from active database复制数据库 source db:ora11auxiliary db:dupdb 1.修改监听文件 ...

  3. 【原】Configuring Oracle Data Guard In Physical Standby Database

    作者:david_zhang@sh [转载时请以超链接形式标明文章] http://www.cnblogs.com/david-zhang-index/p/5042640.html参照文档:https ...

  4. 使用RMAN DUPLICATE...FROM ACTIVE DATABASE创建物理standby database

    Applies to: Oracle Server - Enterprise Edition - Version 11.1.0.6 to 11.2.0.4 [Release 11.1 to 11.2] ...

  5. [翻译] Oracle Database 12c 新特性Multitenant

    译自官方白皮书http://www.oracle.com/technetwork/database/plug-into-cloud-wp-12c-1896100.pdf,包含新的云计算相关技术的介绍. ...

  6. Creating Physical Standby Using RMAN DUPLICATE...FROM ACTIVE DATABASE执行结果

    > run { > allocate channel prmy1 type disk; > allocate channel prmy2 type disk; > alloca ...

  7. Oracle Database 12c Data Redaction介绍

    什么是Data Redaction Data Redaction是Oracle Database 12c的高级安全选项之中的一个新功能,Oracle中国在介绍这个功能的时候,翻译为“数据编纂”,在EM ...

  8. Oracle Database 12c Release 1下载安装(自身经历)

    1.访问Oracle官网:https://www.oracle.com/index.html,下载Oracle Database 12c Release 1 (注意:File1和File2都要下载!! ...

  9. 《Oracle Database 12c DBA指南》第一章 - 基本技能简介

    当前关于12c的中文资料比较少,本人将关于DBA的一部分官方文档翻译为中文,很多地方为了帮助中国网友看懂文章,没有按照原文句式翻译,翻译不足之处难免,望多多指正. 1 基本技能简介 作为一个数据库管理 ...

随机推荐

  1. 在Spring中使用异步事件实现同步事务

    结合Scala+Spring,我们将采取一个很简单的场景:下订单,然后发送一封电子邮件. 编制一个服务: @Serviceclass OrderService @Autowired() (orderD ...

  2. PHP中字符串类型与数值类型混合计算

    字符串转数值的规则 当一个字符串被当作一个数值来取值,其结果和类型如下: 如果该字符串没有包含 '.','e' 或 'E' 并且其数字值在整型的范围之内(由 PHP_INT_MAX 所定义),该字符串 ...

  3. Wamp集成环境配置多站点

    一.打开apache配置文件httpd.conf 二.修改httpd.conf配置文件 1.在配置文件httpd.conf中搜索 conf/extra/httpd-vhosts.conf,然后将该行代 ...

  4. Javascript 精髓整理篇之二(函数篇)postby:http://zhutty.cnblogs.com

    今天总结的内容是javascript的function, 涉及到function顺便讲讲this. Function 是javascript的函数,也是js的执行单元.函数是JavaScript的一种 ...

  5. 中国大推力矢量发动机WS15 跨入 世界先进水平!

    "太行"WS-15让俄闭嘴令美叹服 歼20试飞向世界证明,中国军工世界一流,并有望与美英法争夺新一代航空发动机桂冠.笔者请教解放军专家证实:中国四代机所配套的两台18吨推力的WS- ...

  6. Mysql数据库里面的String类型依照数字来排序以及按时间排序的sql语句

    今天做项目的时候,遇到个小小的问题,在数据库中查询的时候,要用String类型的ID进行一下排序!(注:ID字段为 varchar 类型) 解决的方法: 如: SELECT * FROM  Stude ...

  7. C++11: final与override

    C++11中增加了final与override关键字,貌似是从Java语言中借鉴而来,用途也一样.看例子代码: 01.#include <iostream> 02.  03.using n ...

  8. android中正确保存view的状态

    英文原文: http://trickyandroid.com/saving-android-view-state-correctly/ 转载此译文须注明出处. 今天我们聊一聊安卓中保存和恢复view状 ...

  9. CVE-2015-8660分析

    0x00测试环境   使用环境 备注 操作系统 Ubuntu15.04 虚拟机 内核版本 3.19.0-15-generic 漏洞来源 /fs/overlayfs/inode.c Before 201 ...

  10. centos7启动时出现“无法应用原保存的显示器配置”

    设置了分辨率后,登录提示“出现无法应用原保存的显示器配置”. 解决办法: 打开终端,输入 rm ~/.config/monitors.xml 然后重新登录, 问题解决.