compatible=10.2.0.4 db_cache_size=500M pga_aggregate_target=300M shared_pool_size=200M open_cursors=300 processes=150 nls_language="AMERICAN" nls_territory="AMERICA" PLSQL_OPTIMIZE_LEVEL=0 aq_tm_processes=1 db_block_size=8192 timed_statistics=TRUE query_rewrite_enabled=FALSE star_transformation_enabled=FALSE java_pool_size=0 large_pool_size=0 fast_start_mttr_target=1200 audit_trail=TRUE remote_login_passwordfile=EXCLUSIVE sort_area_size=262144 undo_management=AUTO undo_retention=600 undo_tablespace=UNDOTBS1 job_queue_processes=10 workarea_size_policy=AUTO _trace_files_public = TRUE #local_listener=ORALIST10 db_name=day_test background_dump_dest=/day_test/bdump core_dump_dest=/day_test/cdump user_dump_dest=/day_test/udump control_files=(/day_test/control01.ctl, /day_test/control02.ctl, /day_test/control03.ctl) instance_name=day_test db_recovery_file_dest=/day_test db_recovery_file_dest_size=200G DB_CREATE_FILE_DEST=/day_test/ DB_FILE_NAME_CONVERT=(/pilot/,/day_test/) LOG_FILE_NAME_CONVERT=(/pilot,/day_test)
rman target / connect auxiliary sys/qqq@day_test duplicate target database to day_test;
select 'set newname for tempfile '||file#||' to '||'$NEW_PATH/'||''''||name||''';' from v$tempfile;
alter database default temporary tablespace tmp;
recreate_pilot.sh #!/usr/bin/bash export ORACLE_HOME=/u01/app/oracle/product/10.2.0/Db_1; export NLS_LANG=AMERICAN_AMERICA.UTF8; export LD_LIBRARY_PATH=$ORACLE_HOME/lib; export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/lib:$ORACLE_HOME/OPatch; export ORACLE_SID=pilot; sqlplus / as sysdba @/u01/app/oracle/nomount export ORACLE_SID=work; rman target / nocatalog @/u01/app/oracle/dup_pilot export ORACLE_SID=pilot; sqlplus / as sysdba @/u01/app/oracle/tmp_recr nomount.sql startup force nomount exit dup_pilot connect auxiliary sys/qqq@pilot duplicate target database to pilot; exit tmp_recr.sql create temporary tablespace tmp tempfile size 10M autoextend on next 1G maxsize 10G; alter database default temporary tablespace tmp; drop tablespace temp including contents and datafiles; create temporary tablespace temp tempfile size 10M autoextend on next 1G maxsize 10G; alter database default temporary tablespace temp; drop tablespace tmp including contents and datafiles; exit tmp_recr.sql create temporary tablespace tmp tempfile 'tmp.dbf' size 10M reuse autoextend on next 1G maxsize 10G; alter database default temporary tablespace tmp; drop tablespace temp including contents and datafiles; create temporary tablespace temp tempfile 'temp.dbf' size 10M reuse autoextend on next 1G maxsize 10G; alter database default temporary tablespace temp; drop tablespace tmp including contents and datafiles; exit
export ORACLE_SID=day_test (в которую заливаем бекап) startup nomount; rman auxiliary / duplicate database to day_test backup location '/путь/fra/'; exit;
rman auxiliary /<<EOF run{ set newname for database to '/u02/db/%N%f'; duplicate database to suntst backup location '/mnt/backup/sun/' logfile group 1 ('/u02/db/log1') size 1g reuse, group 2 ('/u02/db/log2') size 1g reuse, group 3 ('/u02/db/log3') size 1g reuse, group 4 ('/u02/db/log4') size 1g reuse, group 5 ('/u02/db/log5') size 1g reuse, group 6 ('/u02/db/log6') size 1g reuse, group 7 ('/u02/db/log7') size 1g reuse nofilenamecheck; } exit; EOF
export ORACLE_SID=suntst rman target sys/pwd@sun auxiliary sys/pwd@suntst<<EOF spool log to "`date +%Y%m%d_%H%M%S_%N`_duplicate_suntest_from_sun.log"; duplicate target database to suntst from active database nofilenamecheck; EOF
rman target sys/pwd@sun auxiliary sys/pwd@sun_st<<EOF spool log to "`date +%Y%m%d_%H%M%S_%N`_duplicate_sunst.log"; duplicate target database for standby from active database dorecover nofilenamecheck; EOF
allocate auxiliary channel disk1 device type disk; allocate auxiliary channel disk2 device type disk; allocate auxiliary channel disk3 device type disk; allocate auxiliary channel disk4 device type disk; allocate auxiliary channel disk5 device type disk; allocate auxiliary channel disk6 device type disk; allocate auxiliary channel disk7 device type disk; allocate auxiliary channel disk8 device type disk; allocate auxiliary channel disk9 device type disk; allocate auxiliary channel disk10 device type disk; allocate auxiliary channel disk11 device type disk; allocate auxiliary channel disk12 device type disk; allocate auxiliary channel disk13 device type disk; allocate auxiliary channel disk14 device type disk; allocate auxiliary channel disk15 device type disk; allocate auxiliary channel disk16 device type disk;