Select Menu

Ads

Random Posts

Powered By Blogger
Powered By Blogger

Blog Archive

Search This Blog

Thirupal Boreddy. Powered by Blogger.

My Blog List

Followers

Lorem 1

Technology

Circle Gallery

Shooting

Racing

News

Lorem 4

STOP SEQUENCE

START SEQUENCE


OTHER USEFUL COMMANDS
http://www.oracleracexpert.com/2013/04/oracle-rman-backup-fails-with-ora-01031.html

RMAN> 
RMAN> connect target * 
RMAN-00571: ============================================ 
RMAN-00569: ======== ERROR MESSAGE STACK FOLLOWS ============ 
RMAN-00571: ============================================ 
ORA-01031: insufficient privileges

grant sysdba to <user>


Query v$pwfile_users to see the list of users who have been granted SYSDBA and SYSOPER privilege as derived from password file
http://www.pythian.com/blog/duplicate-from-active-database-using-rman-step-by-step/
http://oracle-base.com/articles/11g/duplicate-database-using-rman-11gr2.php#active_database_duplication

In active database duplication, RMAN connects as TARGET to the source database instance and as AUXILIARY to the auxiliary instance. RMAN copies the live source database over the network to the auxiliary instance, thereby creating the duplicate database. No backups of the source database are required. 

1)Start the db in nomount ON TARGET SERVER
2)Run the following commands from source
$ cat run_duplicate_db.sh
rman cmdfile=/rama/local/oracle/bin/dup_target_db02.rman log=/rama/local/oracle/bin/dup_target_db01.log
$ cat /rama/local/oracle/bin/dup_target_db02.rman
CONNECT TARGET sys/pwd@source_db
CONNECT AUXILIARY SYS/pwd@target_db
run {
ALLOCATE CHANNEL l1 TYPE DISK;
ALLOCATE CHANNEL l2 TYPE DISK;
ALLOCATE AUXILIARY CHANNEL a1 TYPE DISK;
ALLOCATE AUXILIARY CHANNEL a2 TYPE DISK;
DUPLICATE TARGET DATABASE TO target_db FROM ACTIVE DATABASE
SPFILE
parameter_value_convert 'source_db','target_db'
set control_files =
'/rama/local/oracle/database/target_db/cntl/cntl_01.ctl','/rama/local/oracle/database/target_db/cntl/cntl_02.ctl','/rama/local/oracle/database/target_db/cntl/cntl_03.ctl'
set db_file_name_convert='/rama/local/oracle/database/source_db','/rama/local/oracle/database/target_db'
set log_file_name_convert='/rama/local/oracle/database/source_db','/rama/local/oracle/database/target_db'
set db_recovery_file_dest='/rama/local/oracle/flashback'
set db_unique_name='target_db'
set instance_name='target_db'
set log_archive_format='target_db%t_%s_%r.arc'
set log_archive_dest_state_1='enable'
set remote_login_passwordfile='exclusive'
set service_names='target_db'
NOFILENAMECHECK;
}

RMAN Duplication Scenarios

This section presents several representative scenarios for using RMAN DUPLICATE:



for DBNAME in `ps -ef|grep pmon|grep -v grep|grep -v ASM|awk '{print $9}'|cut -d "_"  -f3`
do

. /usr/local/oracle/bin/my.env $DBNAME

sqlplus -s /nolog <<EOF >> /tmp/db_status.log
connect / as sysdba
set pause off
set heading on
set echo on
set feedback on
set pause off
@/tmp/db_status.sql
EOF

done

QUERY FOR CPU USAGE

select  a.target_name as HOST, to_char(a.rollup_timestamp,' dd-Mon-yy::hh24:mi') as "DAY-TIME", sum(c.cpu_count) as ...