Sei sulla pagina 1di 4

cloning using coldbackup--

source databse--os user=prod oracle_sid=prod oracle_home=/tererpdwp/prod/app/11.2.0 db_name=prod target server configuration---

first we create one user and install oracle home first time os user -- clone oracle_sid= clone oracle_home=/tererpdwt/clone/11.2.0 db_name=clone after installing the oracle_home we set the bash_profile for clone user export ORACLE_SID=clone export ORACLE_HOME=/tererpdwt/clone/11.2.0 export PATH=$ORACLE_HOME/bin:$PATH:. and run bash_profile

we create oradata directory and archivelog directory first we prepare pfile in target side ,we are copy pfile from prod to clone and changes some parameters in pfile db_name,controlfile location.diag destinaion location and etc...

vi init.clone.ora db_name='clone' memory_target=500m db_block_size=8192 log_archive_dest=/tererpdwt/clone/archive compatible ='11.2.0' remote_login_passwordfile='EXCLUSIVE' diagnostic_dest=/tererpdwt/clone

control_files=/tererpdwt/clone/oradata/control01.ctl','/tererpdwt/clone/oradata/ control02.ctl' ~ [clone@tererpdw dbs]$ sqlplus SQL*Plus: Release 11.2.0.1.0 Production on Sat Jun 23 09:36:22 2012 Copyright (c) 1982, 2009, Oracle. All rights reserved. Enter user-name: /as sysdba Connected to an idle instance. SQL> startup nomount; ORACLE instance started. Total System Global Area 523108352 bytes Fixed Size 1337632 bytes Variable Size 314574560 bytes Database Buffers 201326592 bytes Redo Buffers 5869568 bytes SQL>

now we target database is nomount stage,we required next step mount the database in product db sid e we trace controlfile or run create controlfile script (we ch anges in controlfile script db name,and datafile and redologfile locations) [prod@tererpdw ~]$ sqlplus SQL*Plus: Release 11.2.0.1.0 Production on Sat Jun 23 09:40:01 2012 Copyright (c) 1982, 2009, Oracle. All rights reserved. Enter user-name: /as sysdba 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 SQL> alter database backup controlfile to trace; Database altered. SQL> create table clone (c char(9)); Table created. SQL> insert into clone values('first'); 1 row created. SQL> commit;

Commit complete. SQL> alter system switch log file; alter system switch log file * ERROR at line 1: ORA-01900: LOGFILE keyword expected SQL> alter system switch logfile; System altered.

SQL> shut immediate;

[prod@tererpdw oradata]$ scp * clone@tererpdw:/tererpdwt/clone/oradata Warning: Permanently added the RSA host key for IP address '192.168.204.128' to the list of known hosts. clone@tererpdw's password: redo101.log 100% 10MB 10.0MB/s 00:01 redo202.log 100% 10MB 10.0MB/s 00:00 redo303.log 100% 10MB 10.0MB/s 00:00 redo32.log 100% 10MB 10.0MB/s 00:00 redo402.log 100% 100MB 14.3MB/s 00:07 redo4.log 100% 100MB 11.1MB/s 00:09 statspack01.dbf 100% 100MB 11.1MB/s 00:09 sysaux01.dbf 100% 200MB 16.7MB/s 00:12 system01.dbf 100% 300MB 12.0MB/s 00:25 temp01.dbf 100% 100MB 12.5MB/s 00:08 undotbs01.dbf 100% 300MB 7.5MB/s 00:40 users01.dbf 100% 10MB 10.0MB/s 00:01 in clone side we run controlfile script [clone@tererpdw ~]$ vi con.sql [clone@tererpdw ~]$ sqlplus SQL*Plus: Release 11.2.0.1.0 Production on Sat Jun 23 11:06:22 2012 Copyright (c) 1982, 2009, Oracle. All rights reserved. Enter user-name: /as sysdba 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 SQL> @con.sql Control file created. sql> alter database open resetlogs; database altered

SQL> select * from clone; C --------first SQL> select name from v$database; NAME --------CLONE

Potrebbero piacerti anche