clone database other machine same instance name

13 Sep

===============================================================
komputer source
komputer source
===============================================================
1. Konfigurasi RMAN pada database harus dalam mode archive log.
[oracle@iscdd ~]$ ORACLE_SID=iscdd; export ORACLE_SID
[oracle@iscdd ~]$ sqlplus / as sysdba
SQL> alter database archivelog;
alter database archivelog
*
ERROR at line 1:
ORA-01126: database must be mounted in this instance and not open in any
instance
SQL> shutdown immediate;
SQL> startup mount;
SQL> alter database archivelog;
SQL> alter database open;

2. Konfigurasi  RMAN agar archive log disimpan pada folder tertentu sesuai dengan DB_RECOVERY_FILE_DEST.
SQL> host;
[oracle@iscdd ~]$ mkdir /u02/archive/iscdd
[oracle@iscdd ~]$ exit
SQL> alter system set log_archive_dest_1=’location=/u02/archive/iscdd/archive01′;
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u02/archive/iscdd/archive01
Oldest online log sequence     1
Next log sequence to archive   2
Current log sequence           2
SQL> exit;

3. Setting RMAN
[oracle@iscdd ~]$ cd $ORACLE_HOME/bin
[oracle@iscdd bin]$ ./rman target / NOCATALOG
Recovery Manager: Release 10.2.0.1.0 – Production on Fri Sep 12 21:51:36 2008
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
connected to target database: ISCDD (DBID=2058697900)
using target database control file instead of recovery catalog
RMAN> configure controlfile autobackup on;
RMAN> configure backup optimization on;
RMAN> host;
[oracle@iscdd bin]$ mkdir /home/oracle/backup/iscdd/ -p
[oracle@iscdd bin]$ exit
RMAN> configure channel device type disk format ‘/home/oracle/backup/iscdd/%d-id-%I-%s.bkp’;
RMAN> exit;

4. Test
a. tambahan tablespace
[oracle@iscdd ~]$ ORACLE_SID=iscdd; export ORACLE_SID
[oracle@iscdd ~]$ sqlplus / as sysdba
SQL> create tablespace senin_ts
datafile ‘/u02/oradata/iscdd/iscdd/senin_ts01.dbf’
size 2M
segment space management auto;

b. tambahan record.
SQL> conn scott/tiger;
SQL> insert into dept values(61,’IT’,’surabaya’);
SQL> insert into dept values(62,’IT’,’madiun’);
SQL> commit;
SQL> select * from dept;
DEPTNO         DNAME          LOC
———-     ————– ————-
61             IT             surabaya
62             IT             madiun
10             ACCOUNTING     NEW YORK
20             RESEARCH       DALLAS
30             SALES          CHICAGO
40             OPERATIONS     BOSTON
6 rows selected.
SQL> exit;

5. Lakukan backup ditambah dengan archive log
a. lakukan full backup
[oracle@iscdd ~]$ ORACLE_SID=iscdd; export ORACLE_SID
[oracle@iscdd ~]$ cd $ORACLE_HOME/bin
[oracle@iscdd bin]$ ./rman target /
Recovery Manager: Release 10.2.0.1.0 – Production on Fri Sep 12 22:07:39 2008
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
connected to target database: ISCDD (DBID=2058697900)

RMAN> backup database plus archivelog delete input TAG=clone_backup;
Starting backup at 12-SEP-08
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=5 recid=4 stamp=665276689
channel ORA_DISK_1: starting piece 1 at 12-SEP-08
channel ORA_DISK_1: finished piece 1 at 12-SEP-08
piece handle=/home/oracle/backup/iscdd/ISCDD-id-2058697900-6.bkp tag=CLONE_BACKUP comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:05
channel ORA_DISK_1: deleting archive log(s)
archive log filename=/u02/archive/iscdd/archive011_5_665265839.dbf recid=4 stamp=665276689
Finished backup at 12-SEP-08

Starting backup at 12-SEP-08
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u02/oradata/iscdd/iscdd/system01.dbf
input datafile fno=00003 name=/u02/oradata/iscdd/iscdd/sysaux01.dbf
input datafile fno=00005 name=/u02/oradata/iscdd/iscdd/example01.dbf
input datafile fno=00002 name=/u02/oradata/iscdd/iscdd/undotbs01.dbf
input datafile fno=00004 name=/u02/oradata/iscdd/iscdd/users01.dbf
input datafile fno=00006 name=/u02/oradata/iscdd/iscdd/senin_ts01.dbf
channel ORA_DISK_1: starting piece 1 at 12-SEP-08
channel ORA_DISK_1: finished piece 1 at 12-SEP-08
piece handle=/home/oracle/backup/iscdd/ISCDD-id-2058697900-7.bkp tag=TAG20080912T230454 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:04:38
Finished backup at 12-SEP-08

Starting backup at 12-SEP-08
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=6 recid=5 stamp=665276975
channel ORA_DISK_1: starting piece 1 at 12-SEP-08
channel ORA_DISK_1: finished piece 1 at 12-SEP-08
piece handle=/home/oracle/backup/iscdd/ISCDD-id-2058697900-8.bkp tag=CLONE_BACKUP comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
channel ORA_DISK_1: deleting archive log(s)
archive log filename=/u02/archive/iscdd/archive011_6_665265839.dbf recid=5 stamp=665276975
Finished backup at 12-SEP-08

Starting Control File and SPFILE Autobackup at 12-SEP-08
piece handle=/u01/app/oracle/flash_recovery_area/ISCDD/autobackup/2008_09_12/o1_mf_s_665276977_4do524wf_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 12-SEP-08

b. delete obsolote backup dan lihat daftar backupset
RMAN> delete noprompt obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type                     Key    Completion Time    Filename/Handle
——————–     —— —————— ——————–
Backup Set               1      12-SEP-08
Backup Piece               1      12-SEP-08          /u01/app/oracle/flash_recovery_area/ISCDD/autobackup/2008_09_12/o1_mf_s_665272954_4do14fy3_.bkp
Backup Set               2      12-SEP-08
Backup Piece               2      12-SEP-08          /home/oracle/backup/iscdd/ISCDD-id-2058697900-2.bkp
Backup Set               3      12-SEP-08
Backup Piece               3      12-SEP-08          /home/oracle/backup/iscdd/ISCDD-id-2058697900-3.bkp
Backup Set               4      12-SEP-08
Backup Piece               4      12-SEP-08          /home/oracle/backup/iscdd/ISCDD-id-2058697900-4.bkp
Backup Set               5      12-SEP-08
Backup Piece               5      12-SEP-08          /u01/app/oracle/flash_recovery_area/ISCDD/autobackup/2008_09_12/o1_mf_s_665273811_4do1z6wc_.bkp
Backup Set               6      12-SEP-08
Backup Piece               6      12-SEP-08          /home/oracle/backup/iscdd/ISCDD-id-2058697900-6.bkp
deleted backup piece
backup piece handle=/u01/app/oracle/flash_recovery_area/ISCDD/autobackup/2008_09_12/o1_mf_s_665272954_4do14fy3_.bkp recid=1 stamp=665272957
deleted backup piece
backup piece handle=/home/oracle/backup/iscdd/ISCDD-id-2058697900-2.bkp recid=2 stamp=665273519
deleted backup piece
backup piece handle=/home/oracle/backup/iscdd/ISCDD-id-2058697900-3.bkp recid=3 stamp=665273548
deleted backup piece
backup piece handle=/home/oracle/backup/iscdd/ISCDD-id-2058697900-4.bkp recid=4 stamp=665273810
deleted backup piece
backup piece handle=/u01/app/oracle/flash_recovery_area/ISCDD/autobackup/2008_09_12/o1_mf_s_665273811_4do1z6wc_.bkp recid=5 stamp=665273814
deleted backup piece
backup piece handle=/home/oracle/backup/iscdd/ISCDD-id-2058697900-6.bkp recid=6 stamp=665276690
Deleted 6 objects

RMAN> list backupset;
List of Backup Sets
===================
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— —————
7       Full    585.95M    DISK        00:04:28     12-SEP-08
BP Key: 7   Status: AVAILABLE  Compressed: NO  Tag: TAG20080912T230454
Piece Name: /home/oracle/backup/iscdd/ISCDD-id-2058697900-7.bkp
List of Datafiles in backup set 7
File LV Type Ckp SCN    Ckp Time  Name
—- — —- ———- ——— —-
1       Full 502242     12-SEP-08 /u02/oradata/iscdd/iscdd/system01.dbf
2       Full 502242     12-SEP-08 /u02/oradata/iscdd/iscdd/undotbs01.dbf
3       Full 502242     12-SEP-08 /u02/oradata/iscdd/iscdd/sysaux01.dbf
4       Full 502242     12-SEP-08 /u02/oradata/iscdd/iscdd/users01.dbf
5       Full 502242     12-SEP-08 /u02/oradata/iscdd/iscdd/example01.dbf
6       Full 502242     12-SEP-08 /u02/oradata/iscdd/iscdd/senin_ts01.dbf

BS Key  Size       Device Type Elapsed Time Completion Time
——- ———- ———– ———— —————
8       374.50K    DISK        00:00:02     12-SEP-08
BP Key: 8   Status: AVAILABLE  Compressed: NO  Tag: CLONE_BACKUP
Piece Name: /home/oracle/backup/iscdd/ISCDD-id-2058697900-8.bkp

List of Archived Logs in backup set 8
Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
—- ——- ———- ——— ———- ———
1    6       502235     12-SEP-08 502814     12-SEP-08

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— —————
9       Full    6.80M      DISK        00:00:06     12-SEP-08
BP Key: 9   Status: AVAILABLE  Compressed: NO  Tag: TAG20080912T230937
Piece Name: /u01/app/oracle/flash_recovery_area/ISCDD/autobackup/2008_09_12/o1_mf_s_665276977_4do524wf_.bkp
Control File Included: Ckp SCN: 502820       Ckp time: 12-SEP-08
SPFILE Included: Modification time: 12-SEP-08

c. copykan backupset fullbackup ke local file system, dimana terlihat pada langkah diatas
BS (Backup Set) no 7 adalah BS full backup

RMAN> host;
[oracle@iscdd bin]$ mkdir /home/oracle/clone/ -p
[oracle@iscdd bin]$ exit

RMAN> backup backupset 7 format ‘/home/oracle/clone/%U’;
Starting backup at 13-SEP-08
using channel ORA_DISK_1
input backupset count=7 stamp=665276694 creation_time=12-SEP-08
channel ORA_DISK_1: starting piece 1 at 13-SEP-08
channel ORA_DISK_1: backup piece /home/oracle/backup/iscdd/ISCDD-id-2058697900-7.bkp
piece handle=/home/oracle/07jqek8m_1_2 comment=NONE
channel ORA_DISK_1: finished piece 1 at 13-SEP-08
channel ORA_DISK_1: backup set complete, elapsed time: 00:04:58
Finished backup at 13-SEP-08

Starting Control File and SPFILE Autobackup at 13-SEP-08
piece handle=/u01/app/oracle/flash_recovery_area/ISCDD/autobackup/2008_09_13/o1_mf_s_665282854_4dobssnd_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 13-SEP-08

d. juga lakukan backup secara manual spfile dan control file
backup spfile include current controlfile format ‘/home/oracle/controlfile’;

RMAN> backup spfile include current controlfile format ‘/home/oracle/clone/controlfile’;
Starting backup at 13-SEP-08
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 13-SEP-08
channel ORA_DISK_1: finished piece 1 at 13-SEP-08
piece handle=/home/oracle/controlfile tag=TAG20080913T004936 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:11
Finished backup at 13-SEP-08

Starting Control File and SPFILE Autobackup at 13-SEP-08
piece handle=/u01/app/oracle/flash_recovery_area/ISCDD/autobackup/2008_09_13/o1_mf_s_665282987_4dobxyr1_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 13-SEP-08

RMAN> exit

e. periksa hasil backup backupset dan controlfile yang akan dibutuhkan untuk clone
[oracle@iscdd ~]$ ls -la /home/oracle/clone/
total 607612
drwxr-xr-x   2 oracle oinstall      4096 Sep 13 00:53 .
drwx——  24 oracle oinstall      4096 Sep 13 00:53 ..
-rw-r—–   1 oracle oinstall 614424576 Sep 13 00:44 07jqek8m_1_2
-rw-r—–   1 oracle oinstall   7143424 Sep 13 00:49 controlfile
[oracle@iscdd ~]$

f. pindahkan hasil backup ke komputer target
[oracle@iscdd iscdd]$ cd /home/oracle/clone/
[oracle@iscdd clone]$ scp 07jqek8m_1_2 controlfile 172.20.141.151:/home/oracle/
oracle@172.20.141.151’s password:
07jqek8m_1_2                                  100%  586MB   2.3MB/s   04:17
controlfile                                   100% 6976KB   2.3MB/s   00:03

===============================================================
komputer target
Sudah diinstall oracle database software
===============================================================
6. Menyiapkan directory admin oracle, datafile oracle dan oratab.
Misalkan diinginkan SID bernama clone
[oracle@iscatm2 ~]$ id
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba),502(oper),503(asmadmin)

a. menyiapkan folder admin oracle clone
[oracle@iscatm2 ~]$ mkdir -p /u01/app/oracle/admin/iscdd/adump
[oracle@iscatm2 ~]$ mkdir -p /u01/app/oracle/admin/iscdd/bdump
[oracle@iscatm2 ~]$ mkdir -p /u01/app/oracle/admin/iscdd/cdump
[oracle@iscatm2 ~]$ mkdir -p /u01/app/oracle/admin/iscdd/dpdump
[oracle@iscatm2 ~]$ mkdir -p /u01/app/oracle/admin/iscdd/pfile
[oracle@iscatm2 ~]$ mkdir -p /u01/app/oracle/admin/iscdd/scripts
[oracle@iscatm2 ~]$ mkdir -p /u01/app/oracle/admin/iscdd/udump
[oracle@iscatm2 ~]$ mkdir -p /u01/app/oracle/flash_recovery_area

b. menyiapkan folder datafile dan archive oracle clone
[oracle@iscatm2 ~]$ mkdir -p /u02/oradata/iscdd/iscdd
[oracle@iscatm2 ~]$ mkdir -p /u02/archive/iscdd

c. menyiapkan oratab
[oracle@iscatm2 ~]$ echo “iscdd:/u01/app/oracle/product/10.2.0/db_1:N” >> /etc/oratab
[oracle@iscatm2 ~]$ ORACLE_SID=iscdd; export ORACLE_SID
[oracle@iscatm2 ~]$ oraenv
ORACLE_SID = [iscdd] ?
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1 is /u01/app/oracle

7. Menyiapkan Oracle Password File oracle clone
[oracle@iscatm2 ~]$ orapwd file=$ORACLE_HOME/dbs/orapwiscdd password=ora

8. Restore SPFILE
a. menyiapkan temporary file initialization
[oracle@iscatm2 ~]$ vi $ORACLE_HOME/dbs/initiscdd.ora
*.db_name=’iscdd’

b. menjalankan instance nomount
[oracle@iscatm2 ~]$ ORACLE_SID=iscdd; export ORACLE_SID
[oracle@iscatm2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.1.0.6.0 – Production on Fri Sep 12 14:21:20 2008
Copyright (c) 1982, 2007, Oracle.  All rights reserved.
Connected to an idle instance.

SQL> startup nomount;
ORACLE instance started.
Total System Global Area  150667264 bytes
Fixed Size                  1298472 bytes
Variable Size              92278744 bytes
Database Buffers           50331648 bytes
Redo Buffers                6758400 bytes
SQL> exit

c. restore spfile
[oracle@iscatm2 ~]$ ORACLE_SID=iscdd; export ORACLE_SID
[oracle@iscatm2 ~]$ rman target /

RMAN> restore spfile from ‘/home/oracle/controlfile’;
Starting restore at 12-SEP-08
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=98 device type=DISK
channel ORA_DISK_1: restoring spfile from AUTOBACKUP /home/oracle/controlfile
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 12-SEP-08
RMAN> exit

d. menghapus temporary file initialization dan membuat pfile
[oracle@iscatm2 ~]$ ORACLE_SID=iscdd; export ORACLE_SID
[oracle@iscatm2 ~]$ sqlplus / as sysdba
SQL> host
[oracle@iscatm2 ~]$ rm $ORACLE_HOME/dbs/initiscdd.ora
[oracle@iscatm2 ~]$ exit
SQL> create pfile from spfile;

9. Edit PFILE
SQL> host;
[oracle@iscatm2 ~]$ vi $ORACLE_HOME/dbs/initiscdd.ora
iscdd.__db_cache_size=738197504
iscdd.__java_pool_size=4194304
iscdd.__large_pool_size=4194304
iscdd.__shared_pool_size=247463936
iscdd.__streams_pool_size=0
*.audit_file_dest=’/u01/app/oracle/admin/iscdd/adump’
*.background_dump_dest=’/u01/app/oracle/admin/iscdd/bdump’
*.compatible=’10.2.0.1.0′
*.control_files=’/u02/oradata/iscdd/iscdd/control01.ctl’,’/u02/oradata/iscdd/iscdd/control02.ctl’,’/u02/oradata/iscdd/iscdd/control03.ctl’
*.core_dump_dest=’/u01/app/oracle/admin/iscdd/cdump’
*.db_block_size=8192
*.db_domain=”
*.db_file_multiblock_read_count=16
*.db_name=’iscdd’
*.db_recovery_file_dest=’/u01/app/oracle/flash_recovery_area’
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=iscddXDB)’
*.job_queue_processes=10
*.log_archive_dest_1=’location=/u02/archive/iscdd/archive01′
*.log_archive_format=’%t_%s_%r.dbf’
*.open_cursors=300
*.pga_aggregate_target=333447168
*.processes=150
*.remote_login_passwordfile=’EXCLUSIVE’
*.sga_target=1002438656
*.undo_management=’AUTO’
*.undo_tablespace=’UNDOTBS1′
*.user_dump_dest=’/u01/app/oracle/admin/iscdd/udump’

tambahkan dan edit, jika folder berbeda dengan perintah :
*.db_file_multiblock_read_count=16
*.db_file_name_convert=’/u02/oradata/iscdd’,’/u02/oradata/iscdd’

*.job_queue_processes=10
*.log_file_name_convert=’/u02/oradata/iscdd’,’/u02/oradata/iscdd’

menjadi :
iscdd.__db_cache_size=738197504
iscdd.__java_pool_size=4194304
iscdd.__large_pool_size=4194304
iscdd.__shared_pool_size=247463936
iscdd.__streams_pool_size=0
*.audit_file_dest=’/u01/app/oracle/admin/iscdd/adump’
*.background_dump_dest=’/u01/app/oracle/admin/iscdd/bdump’
*.compatible=’10.2.0.1.0′
*.control_files=’/u02/oradata/iscdd/iscdd/control01.ctl’,’/u02/oradata/iscdd/iscdd/control02.ctl’,’/u02/oradata/iscdd/iscdd/control03.ctl’
*.core_dump_dest=’/u01/app/oracle/admin/iscdd/cdump’
*.db_block_size=8192
*.db_domain=”
*.db_file_multiblock_read_count=16
*.db_file_name_convert=’/u02/oradata/iscdd’,’/u02/oradata/iscdd’
*.db_name=’iscdd’
*.db_recovery_file_dest=’/u01/app/oracle/flash_recovery_area’
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=iscddXDB)’
*.job_queue_processes=10
*.log_file_name_convert=’/u02/oradata/iscdd’,’/u02/oradata/iscdd’
*.log_archive_dest_1=’location=/u02/archive/iscdd/archive01′
*.log_archive_format=’%t_%s_%r.dbf’
*.open_cursors=300
*.pga_aggregate_target=333447168
*.processes=150
*.remote_login_passwordfile=’EXCLUSIVE’
*.sga_target=1002438656
*.undo_management=’AUTO’
*.undo_tablespace=’UNDOTBS1′
*.user_dump_dest=’/u01/app/oracle/admin/iscdd/udump’

10. create SPFILE dari PFILE yang sudah diedit
[oracle@iscatm2 ~]$ exit
SQL> create spfile from pfile;
SQL> shutdown abort;
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 1002438656 bytes
Fixed Size                  1223080 bytes
Variable Size             255854168 bytes
Database Buffers          738197504 bytes
Redo Buffers                7163904 bytes
SQL> exit

11. Restore Controlfile
[oracle@iscatm2 ~]$ ORACLE_SID=clone; export ORACLE_SID
[oracle@iscatm2 ~]$ rman target /
RMAN> restore controlfile from ‘/home/oracle/controlfile’;
Starting restore at 13-SEP-08
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
output filename=/u02/oradata/iscdd/iscdd/control01.ctl
output filename=/u02/oradata/iscdd/iscdd/control02.ctl
output filename=/u02/oradata/iscdd/iscdd/control03.ctl
Finished restore at 13-SEP-08

12. Restore Database
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1

RMAN> restore database;
Starting restore at 13-SEP-08
Starting implicit crosscheck backup at 13-SEP-08
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
Crosschecked 5 objects
Finished implicit crosscheck backup at 13-SEP-08
Starting implicit crosscheck copy at 13-SEP-08
using channel ORA_DISK_1
Finished implicit crosscheck copy at 13-SEP-08
searching for all files in the recovery area
cataloging files…
no files cataloged
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u02/oradata/iscdd/iscdd/system01.dbf
restoring datafile 00002 to /u02/oradata/iscdd/iscdd/undotbs01.dbf
restoring datafile 00003 to /u02/oradata/iscdd/iscdd/sysaux01.dbf
restoring datafile 00004 to /u02/oradata/iscdd/iscdd/users01.dbf
restoring datafile 00005 to /u02/oradata/iscdd/iscdd/example01.dbf
restoring datafile 00006 to /u02/oradata/iscdd/iscdd/senin_ts01.dbf
channel ORA_DISK_1: reading from backup piece /home/oracle/07jqek8m_1_2
channel ORA_DISK_1: restored backup piece 1
piece handle=/home/oracle/07jqek8m_1_2 tag=TAG20080912T230454
channel ORA_DISK_1: restore complete, elapsed time: 00:00:36
Finished restore at 13-SEP-08
RMAN> exit;

13. Recover Database
[oracle@iscatm2 ~]$ sqlplus / as sysdba
SQL> recover database until cancel using backup controlfile;
ORA-00279: change 502242 generated at 09/12/2008 23:04:54 needed for thread 1
ORA-00289: suggestion : /u02/archive/iscdd/archive011_6_665265839.dbf
ORA-00280: change 502242 for thread 1 is in sequence #6

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
CANCEL
Media recovery cancelled.
SQL> alter database open resetlogs;
Database altered.

14. test apakah data terakhir sudah dipindahkan ?
SQL> conn scott/tiger
Connected.

SQL> select * from dept;
DEPTNO DNAME          LOC
—— ————– ————-
61 IT             surabaya
62 IT             madiun
10 ACCOUNTING     NEW YORK
20 RESEARCH       DALLAS
30 SALES          CHICAGO
40 OPERATIONS     BOSTON

6 rows selected.

SQL> exit

15. Configure tnsnames.ora and listner.ora instance clone
[oracle@iscatm2 ~]$ vi $ORACLE_HOME/network/admin/tnsnames.ora
iscdd =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = iscatm2)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = iscdd)
)
)

[oracle@iscatm2 ~]$ vi $ORACLE_HOME/network/admin/listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = iscdd)(PORT = 1521))
)
)

[oracle@iscdd iscdd]$ lsnrctl reload

16. test apakah listener ok ?
[oracle@iscatm2 ~]$ sqlplus scott/tiger@clone
SQL> select * from dept;
DEPTNO DNAME          LOC
—— ————– ————-
61 IT             surabaya
62 IT             madiun
10 ACCOUNTING     NEW YORK
20 RESEARCH       DALLAS
30 SALES          CHICAGO
40 OPERATIONS     BOSTON

6 rows selected.
SQL> exit

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: