1.查看主库ZDJS并使用RMAM进行备份
[[email protected] ~]$ sqlplus ‘/as sysdba‘ SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jan 14 14:13:14 2015 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to an idle instance. SQL> startup ORACLE instance started. Total System Global Area 608174080 bytes Fixed Size 1220820 bytes Variable Size 159387436 bytes Database Buffers 440401920 bytes Redo Buffers 7163904 bytes Database mounted. Database opened.
SQL> show parameter name NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_file_name_convert string db_name string ZDJS db_unique_name string ZDJS global_names boolean FALSE instance_name string ZDJS lock_name_space string log_file_name_convert string service_names string ZDJS
[[email protected] ~]$ rman target / Recovery Manager: Release 10.2.0.1.0 - Production on Wed Jan 14 14:26:58 2015 Copyright (c) 1982, 2005, Oracle. All rights reserved. connected to target database: ZDJS (DBID=3486931402) RMAN> run { 2> allocate channel c1 type disk; 3> allocate channel c2 type disk; 4> backup full database format ‘/u01/rman_bak/%d_%s_%t.bak‘; 5> backup archivelog all format ‘/u01/rman_bak/arch_%s.bak‘; 6> backup current controlfile format ‘/u01/rman_bak/ctl_%s.bak‘; 7> } using target database control file instead of recovery catalog allocated channel: c1 channel c1: sid=143 devtype=DISK allocated channel: c2 channel c2: sid=142 devtype=DISK Starting backup at 14-JAN-15 channel c1: starting full datafile backupset channel c1: specifying datafile(s) in backupset input datafile fno=00001 name=/u02/app/oradata/ZDJS/system01.dbf input datafile fno=00006 name=/u02/app/oradata/ZDJS/plat01.dbf input datafile fno=00008 name=/u02/app/oradata/ZDJS/rlsm01.dbf input datafile fno=00002 name=/u02/app/oradata/ZDJS/undotbs01.dbf input datafile fno=00004 name=/u02/app/oradata/ZDJS/users01.dbf channel c1: starting piece 1 at 14-JAN-15 channel c2: starting full datafile backupset channel c2: specifying datafile(s) in backupset input datafile fno=00003 name=/u02/app/oradata/ZDJS/sysaux01.dbf input datafile fno=00010 name=/u02/app/oradata/ZDJS/qhrlst01.dbf input datafile fno=00005 name=/u02/app/oradata/ZDJS/example01.dbf input datafile fno=00007 name=/u02/app/oradata/ZDJS/rlst01.dbf input datafile fno=00009 name=/u02/app/oradata/ZDJS/rlsc01.dbf channel c2: starting piece 1 at 14-JAN-15 channel c1: finished piece 1 at 14-JAN-15 piece handle=/u01/rman_bak/ZDJS_6_868976951.bak tag=TAG20150114T142911 comment=NONE channel c1: backup set complete, elapsed time: 00:01:07 channel c1: starting full datafile backupset channel c1: specifying datafile(s) in backupset including current control file in backupset channel c1: starting piece 1 at 14-JAN-15 channel c1: finished piece 1 at 14-JAN-15 piece handle=/u01/rman_bak/ZDJS_8_868977018.bak tag=TAG20150114T142911 comment=NONE channel c1: backup set complete, elapsed time: 00:00:03 channel c1: starting full datafile backupset channel c1: specifying datafile(s) in backupset including current SPFILE in backupset channel c1: starting piece 1 at 14-JAN-15 channel c1: finished piece 1 at 14-JAN-15 piece handle=/u01/rman_bak/ZDJS_9_868977021.bak tag=TAG20150114T142911 comment=NONE channel c1: backup set complete, elapsed time: 00:00:02 channel c2: finished piece 1 at 14-JAN-15 piece handle=/u01/rman_bak/ZDJS_7_868976952.bak tag=TAG20150114T142911 comment=NONE channel c2: backup set complete, elapsed time: 00:01:18 Finished backup at 14-JAN-15 Starting backup at 14-JAN-15 current log archived channel c1: starting archive log backupset channel c1: specifying archive log(s) in backup set input archive log thread=1 sequence=49 recid=1 stamp=868977033 channel c1: starting piece 1 at 14-JAN-15 channel c1: finished piece 1 at 14-JAN-15 piece handle=/u01/rman_bak/arch_10.bak tag=TAG20150114T143033 comment=NONE channel c1: backup set complete, elapsed time: 00:00:03 Finished backup at 14-JAN-15 Starting backup at 14-JAN-15 channel c1: starting full datafile backupset channel c1: specifying datafile(s) in backupset including current control file in backupset channel c1: starting piece 1 at 14-JAN-15 channel c1: finished piece 1 at 14-JAN-15 piece handle=/u01/rman_bak/ctl_11.bak tag=TAG20150114T143038 comment=NONE channel c1: backup set complete, elapsed time: 00:00:02 Finished backup at 14-JAN-15 released channel: c1 released channel: c2
SQL> col file_name for a50 SQL> select file_id,file_name,tablespace_name from dba_data_files; FILE_ID FILE_NAME TABLESPACE_NAME ---------- -------------------------------------------------- ------------------------------ 4 /u02/app/oradata/ZDJS/users01.dbf USERS 3 /u02/app/oradata/ZDJS/sysaux01.dbf SYSAUX 2 /u02/app/oradata/ZDJS/undotbs01.dbf UNDOTBS1 1 /u02/app/oradata/ZDJS/system01.dbf SYSTEM 5 /u02/app/oradata/ZDJS/example01.dbf EXAMPLE 6 /u02/app/oradata/ZDJS/plat01.dbf PLAT 7 /u02/app/oradata/ZDJS/rlst01.dbf RLST 8 /u02/app/oradata/ZDJS/rlsm01.dbf RLSM 9 /u02/app/oradata/ZDJS/rlsc01.dbf RLSC 10 /u02/app/oradata/ZDJS/qhrlst01.dbf QHRLST 10 rows selected.
2.建立pfile文件
SQL> create pfile from spfile; File created.
3.建立克隆库的目录
[[email protected] oradata]$ mkdir -p $ORACLE_BASE/admin/clonedb/{a,b,c,u}dump [[email protected] oradata]$ mkdir -p $ORACLE_BASE/oradata/clonedb/
4.将主库pfile拷贝生成克隆库的pfile,并生成克隆库的口令文件
##红字部分是修改的部分,蓝字部分是需要增加的
[[email protected] dbs]$ cp initZDJS.ora initclonedb.ora [[email protected] dbs]$ vi initclonedb.ora [[email protected] dbs]$ cat initclonedb.ora *.audit_file_dest=‘/u02/app/admin/clonedb/adump‘ *.background_dump_dest=‘/u02/app/admin/clonedb/bdump‘ *.compatible=‘10.2.0.1.0‘ *.control_files=‘/u02/app/oradata/clonedb/control01.ctl‘,‘/u02/app/oradata/clonedb/control02.ctl‘,‘/u02/app/oradata/clonedb/control03.ctl‘ *.core_dump_dest=‘/u02/app/admin/clonedb/cdump‘ *.db_block_size=8192 *.db_domain=‘‘ *.db_file_multiblock_read_count=16 *.db_name=‘clonedb‘ *.dispatchers=‘(PROTOCOL=TCP) (SERVICE=ZDJSXDB)‘ *.job_queue_processes=10 *.log_archive_dest_1=‘location=/u01/clonedb_arch‘ *.open_cursors=300 *.pga_aggregate_target=201326592 *.processes=150 *.remote_login_passwordfile=‘EXCLUSIVE‘ *.sga_target=605028352 *.undo_management=‘AUTO‘ *.undo_tablespace=‘UNDOTBS1‘ *.user_dump_dest=‘/u02/app/admin/clonedb/udump‘ db_file_name_convert=("/u02/app/oradata/ZDJS","/u02/app/oradata/clonedb") log_file_name_convert=("/u02/app/oradata/ZDJS","/u02/app/oradata/clonedb")
时间: 2024-10-10 08:21:17