본문 바로가기
스터디북

[10/13] 실습 - 2 RMAN을 이용한 Duplicate 복제 DB 생성

by 파이어볼러 2015. 10. 13.

============================================

RMAN을 이용한 Duplicate 복제 DB 생성

============================================


[root@lnx04 /]# mkdir -p /data/reorcl

[root@lnx04 /]# chown -R oracle.oinstall /data/


SYS@orcl>create pfile from spfile
  2  ;

File created.

vi tnsnames.ora

reorcl =
 (description =
  (address_list =
   (address = (protocol=tcp)(host=lnx04.ocmkorea.com)(port=1521))
   (load_balance = yes)
  )
 (connect_data =
  (server=dedicated)
  (sid=reorcl)
 )
)


[oracle@lnx04 dbs]$ cp initorcl.ora initreorcl.ora


[oracle@lnx04 dbs]$ vi initreorcl.ora
reorcl.__pga_aggregate_target=687865856
reorcl.__sga_target=1023410176
reorcl.__shared_io_pool_size=0
reorcl.__shared_pool_size=285212672
reorcl.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/reorcl/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/data/reorcl/control01.ctl','/data/reorcl/control02.ctl'
#Restore Controlfile
*.db_block_size=8192
*.db_domain=''
*.db_name='reorcl'
#*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
#*.db_recovery_file_dest_size=4039114752
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=reorclXDB)'
*.log_archive_dest_1='location=/data/arc2'
*.log_archive_format='ORCL_%r_%t_%s.arc'
*.log_archive_max_processes=4
*.memory_target=1697644544
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
*.db_file_name_convert=(/u01/app/oracle/oradata/orcl,/data/reorcl)
*.log_file_name_convert=(/u01/app/oracle/oradata/orcl,/data/reorcl)

[oracle@lnx04 dbs]$ orapwd file=orapwreorcl password=oracle entries=5

[oracle@lnx04 dbs]$ cd /u01/app/oracle/admin/
[oracle@lnx04 admin]$ mkdir reorcl

[oracle@lnx04 reorcl]$ mkdir -p bdump cdump udump adump pfile


[oracle@lnx04 dbs]$ vi initreorcl.ora

[oracle@lnx04 dbs]$ ss


[oracle@lnx04 ~]$ export ORACLE_SID=reorcl

[oracle@lnx04 ~]$ echo $ORACLE_SID

reorcl

[oracle@lnx04 ~]$ sqlplus sys/oracle as sysdba


SQL*Plus: Release 11.2.0.1.0 Production on Tue Oct 13 12:27:21 2015


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


Connected to an idle instance.



SQL*Plus: Release 11.2.0.1.0 Production on Tue Oct 13 12:28:35 2015


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


Connected to an idle instance.


SYS@reorcl>startup nomount

ORACLE instance started.


Total System Global Area 1046224896 bytes

Fixed Size                  1341140 bytes

Variable Size             318769452 bytes

Database Buffers          721420288 bytes

Redo Buffers                4694016 bytes



[oracle@lnx04 reorcl]$ rman nocatalog

Recovery Manager: Release 11.2.0.1.0 - Production on Tue Oct 13 12:44:37 2015

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

RMAN> connect target sys/oracle@orcl

connected to target database: ORCL (DBID=1420439357)
using target database control file instead of recovery catalog

RMAN> connect auxiliary sys/oracle

connected to auxiliary database: REORCL (not mounted)

RMAN> duplicate target database to reorcl;


database opened

Finished Duplicate Db at 2015-10-13:12:45:53


RMAN> exit



Recovery Manager complete.

[oracle@lnx04 reorcl]$ echo $ORACLE_SID

reorcl

[oracle@lnx04 reorcl]$ ss


SQL*Plus: Release 11.2.0.1.0 Production on Tue Oct 13 12:46:10 2015


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



Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options


SYS@reorcl>select instance_name, status from v$instance;


INSTANCE_NAME    STATUS

---------------- ------------

reorcl           OPEN


SYS@reorcl>select name from v$datafile;


NAME

------------------------------------------------------------------------------------------------------------------------------------------------------

/data/reorcl/system01.dbf

/data/reorcl/sysaux01.dbf

/data/reorcl/undotbs01.dbf

/data/reorcl/users01.dbf

/data/reorcl/example01.dbf

/data/reorcl/rman_tbs.dbf


6 rows selected.


SYS@reorcl>select name from v$tablespace;


NAME

------------------------------

SYSTEM

TEMP

SYSAUX

UNDOTBS1

USERS

EXAMPLE

RMAN_TBS


7 rows selected.


이현룡 교수님 수업 PDF 파일 참고 실습