Monday, October 26, 2015

WebLogic Password Recovery


There are many blogs out there providing various methods to recover WebLogic password below method is the easiest of the all.

First we need to know DOMAIN_HOME directory. My OMS is located in “/u02/Middleware/oms”. You can find yours if you read “/etc/oragchomelist”. If the full path of OMS is “/u02/Middleware/oms”, my middleware home is “/u02/Middleware/”. Under my middleware home, I need to go GCDomains folder


2
oracle@db-cloud /$ cd /u02/Middleware
oracle@db-cloud Middleware$ cd gc_inst/user_projects/domains/GCDomain



First let’s get the encrypted information from boot.properties file:

oracle@db-cloud GCDomain$ cat servers/EMGC_ADMINSERVER/security/boot.properties
 
# Generated by Configuration Wizard on Wed Jun 04 10:22:47 EEST 2014
username={AES}nPuZvKIMjH4Ot2ZiiaSVT/RKbyBA6QITJE6ox56dHvk=
password={AES}krCf4h1du93tJOQcUg0QSoKamuNYYuGcAao1tFvHxzc=


The encrypted information starts with {AES} and ends with equal (=) sign. To decrypt the username and password, we will create a simple java application:


3
4
5
6
7
8
9
10
oracle@db-cloud GCDomain$ cat recoverpassword.java
public class recoverpassword {
public static void main(String[] args)
{
  System.out.println(
  new weblogic.security.internal.encryption.ClearOrEncryptedService(
  weblogic.security.internal.SerializedSystemIni.getEncryptionService(args[0]
   )).decrypt(args[1]));
  }
}
Save it as “recoverpassword.java”. To be able to compile (and run) it, we need to set environment variables (we’re still in GCDomain folder). We’ll give the encrypted part as the last parameter:

1
2
3
4
5
6
oracle@db-cloud GCDomain$ . bin/setDomainEnv.sh
oracle@db-cloud GCDomain$ javac recoverpassword.java
oracle@db-cloud GCDomain$ java -cp $CLASSPATH:. recoverpassword \
$DOMAIN_HOME {AES}nPuZvKIMjH4Ot2ZiiaSVT/RKbyBA6QITJE6ox56dHvk=
oracle@db-cloud GCDomain$ java -cp $CLASSPATH:. recoverpassword \
$DOMAIN_HOME {AES}krCf4h1du93tJOQcUg0QSoKamuNYYuGcAao1tFvHxzc=
When we run the last two commands, we should see the weblogic administrator username and password in plain text. By the way, even if you use the same password with me, you may see different encrypted text because when encrypting and decrypting, weblogic uses the cypher key stored in “security/SerializedSystemIni.dat” file. So as long as the cypher key is different, you get different encrypted text for even same input.


Thanks to :http://www.gokhanatil.com/2015/03/how-to-recover-weblogic-administration-password-of-enterprise-manager.html


Tuesday, October 20, 2015


Sending putty content in Outlook Mail, with same/proper format.

Copy Paste putty session with same format

1) Open Putty 


 2) Expand Windows and select "Selection"

3) enable "Paste to clipboard in RTF as well as plain Text


4) save to default or named sessions


5) copy and paste from putty to outlook or other applications


Regards
Manoj

Friday, May 8, 2015

Working with Oracle Database Parallelizm Issues, specially in RAC environment


Ref:
http://docs.oracle.com/cd/E11882_01/server.112/e25523/parallel006.htm
http://docs.oracle.com/cd/E11882_01/server.112/e16638/hintsref.htm
http://docs.oracle.com/cd/E14072_01/server.112/e10837/parallel.htm
http://docs.oracle.com/cd/E11882_01/server.112/e25523/parallel002.htm
Query to check parallel executions on instance:
----------------------------------------------
SELECT QCSID, SID, INST_ID "Inst", SERVER_GROUP "Group", SERVER_SET "Set",
  DEGREE "Degree", REQ_DEGREE "Req Degree"
FROM GV$PX_SESSION ORDER BY QCSID, QCINST_ID, SERVER_GROUP, SERVER_SET;

SELECT NAME, VALUE FROM GV$SYSSTAT
WHERE UPPER (NAME) LIKE '%PARALLEL OPERATIONS%'
OR UPPER (NAME) LIKE '%PARALLELIZED%' OR UPPER (NAME) LIKE '%PX%';

SELECT px.SID "SID", p.PID, p.SPID "SPID", px.INST_ID "Inst",
       px.SERVER_GROUP "Group", px.SERVER_SET "Set",
       px.DEGREE "Degree", px.REQ_DEGREE "Req Degree", w.event "Wait Event"
FROM GV$SESSION s, GV$PX_SESSION px, GV$PROCESS p, GV$SESSION_WAIT w
WHERE s.sid (+) = px.sid AND s.inst_id (+) = px.inst_id AND
      s.sid = w.sid (+) AND s.inst_id = w.inst_id (+) AND
      s.paddr = p.addr (+) AND s.inst_id = p.inst_id (+)
ORDER BY DECODE(px.QCINST_ID,  NULL, px.INST_ID,  px.QCINST_ID), px.QCSID,
DECODE(px.SERVER_GROUP, NULL, 0, px.SERVER_GROUP), px.SERVER_SET, px.INST_ID;

SELECT * from v$pq_sysstat;
SELECT * FROM v$px_process;
SELECT * FROM v$px_sesstat;
SELECT * FROM v$px_process_sysstat;
Examples
========
ALTER TABLE table_name PARALLEL (DEGREE 8);
SELECT /*+PARALLEL(table_alias, degree, nodes)*/ *
  FROM table_name ...
OR
SELECT /*+PARALLEL */ * FROM table_name/View name ...

 
Quick Oracle Database Tunning Tips without OEM(Enterprice Manager)


http://docs.oracle.com/cd/B28359_01/server.111/b28274/sql_tune.htm
http://www.pythian.com/news/584/wouldnt-automatic-sql-plan-management-be-the-11g-killer-app/

create a tunning task
---------------------
variable stmt_task VARCHAR2(64);
variable sts_task  VARCHAR2(64);
variable spa_tune_task VARCHAR2(64);
EXEC :stmt_task := DBMS_SQLTUNE.CREATE_TUNING_TASK( sql_text => 'SELECT S.EMPLID ,S.EMPL_RCD , PDE.EFFDT ,INS.PER_ORG ,INS.ORIG_HIRE_DT ,PDE.SEX ,PRS.BIRTHDATE ,PRS.BIRTHPLACE ,PRS.BIRTHCOUNTRY ,PRS.BIRTHSTATE ,PRS.DT_OF_DEATH ,PDE.HIGHEST_EDUC_LVL ,PDE.FT_STUDENT ,PDE.LANG_CD ,PDE.ALTER_EMPLID ,PDE.MAR_STATUS ,ASG.HOME_HOST_CLASS ,ASG.CMPNY_SENIORITY_DT ,ASG.SERVICE_DT ,ASG.PROF_EXPERIENCE_DT ,ASG.LAST_VERIFICATN_DT ,ASG.OWN_5PERCENT_CO ,ASG.PROBATION_DT ,ASG.ORG_INSTANCE_ERN ,ASG.SENIORITY_PAY_DT FROM PS_PERSON PRS ,PS_PER_ORG_ASGN ASG ,PS_PER_ORG_INST INS ,PS_PERS_DATA_EFFDT PDE ,PS_GP_PYE_STAT_WRK S WHERE S.RUN_CNTL_ID ='ABS_JAN2012_IND' AND S.OPRID = 12345 AND S.EMPLID BETWEEN 1000 AND 19999 AND S.EMPLID = PRS.EMPLID AND S.EMPLID = PDE.EMPLID AND S.FRST_JOB_SEG_IND = 'Y' AND S.EMPLID = ASG.EMPLID AND S.EMPL_RCD = ASG.EMPL_RCD AND ASG.EMPLID = INS.EMPLID AND ASG.ORG_INSTANCE_ERN = INS.ORG_INSTANCE_ERN ORDER BY S.EMPLID, S.EMPL_RCD, PDE.EFFDT DESC ');
---or-----
EXEC :stmt_task := DBMS_SQLTUNE.CREATE_TUNING_TASK(task_name=>'hello1223',sql_id => '4qh14ksgd4dd8',scope='COMPREHENSIVE');
---or-----
DECLARE
sql_text clob;
sqlprofile_name varchar2(30);
task_name varchar2(100);
BEGIN
sql_text :=
task_name:=dbms_sqltune.create_tuning_task(sql_text,task_name=>'TASKREQ01',scope=>'COMPREHENSIVE');
END;
/
execute a tunning task
----------------------
EXEC DBMS_SQLTUNE.EXECUTE_TUNING_TASK(:stmt_task);
display a tunning task
----------------------
SET LONG 1000
SET LONGCHUNKSIZE 1000
SET LINESIZE 100
SELECT DBMS_SQLTUNE.report_tuning_task('TASK_4188') AS recommendations FROM dual
SELECT DBMS_SQLTUNE.report_tuning_task(:stmt_task) AS recommendations FROM dual
accept a recommendation sql profile
execute dbms_sqltune.accept_sql_profile(task_name => 'TASK_4256',task_owner => 'MD86506', replace => TRUE);
disable sql profile
EXEC DBMS_SQLTUNE.ALTER_SQL_PROFILE('SYS_SQLPROF_013c237dab800000','STATUS','DISABLED');

view task information
--------------------
SELECT task_name, status FROM dba_advisor_log WHERE owner = 'MD86506';

primary_gl_tb 

SELECT DBMS_SQLTUNE.report_tuning_task('primary_gl_tb') AS recommendations FROM dual ;
execute dbms_sqltune.accept_sql_profile(task_name => 'primary_gl_tb',task_owner => 'MD86506', replace => TRUE);

USER_ADVISOR_TASKS <-- table which have task information
•DBA_ADVISOR_TASKS
•DBA_ADVISOR_FINDINGS
•DBA_ADVISOR_RECOMMENDATIONS
•DBA_ADVISOR_RATIONALE
•DBA_SQLTUNE_STATISTICS
•DBA_SQLTUNE_BINDS
•DBA_SQLTUNE_PLANS
•DBA_SQLSET
•DBA_SQLSET_BINDS
•DBA_SQLSET_STATEMENTS
•DBA_SQLSET_REFERENCES
•DBA_SQL_PROFILES
•V$SQL
•V$SQLAREA
•V$ACTIVE_SESSION_HISTORY
enable/dislabe/delete sql profile
=================================

SELECT *
  FROM DBA_SQL_PROFILES prof,
       DBMSHSXP_SQL_PROFILE_ATTR attr
  WHERE prof.NAME=attr.PROFILE_NAME
  ORDER BY prof.name,
           attr.attr_number;
Enable/Disable
Locate the name of the SQL Profile you would like to disable and plug it in to the following statement:
EXEC DBMS_SQLTUNE.ALTER_SQL_PROFILE('PROFILE_NAME','STATUS','DISABLED');
Dropping a SQL Profile
EXEC DBMS_SQLTUNE.DROP_SQL_PROFILE('PROFILE_NAME');

 
SQL for Tunning task

Ref:
http://docs.oracle.com/cd/E11882_01/server.112/e25523/parallel006.htm
http://docs.oracle.com/cd/E11882_01/server.112/e16638/hintsref.htm
http://docs.oracle.com/cd/E14072_01/server.112/e10837/parallel.htm
http://docs.oracle.com/cd/E11882_01/server.112/e25523/parallel002.htm
Query to check parallel executions on instance:
----------------------------------------------
SELECT QCSID, SID, INST_ID "Inst", SERVER_GROUP "Group", SERVER_SET "Set",
  DEGREE "Degree", REQ_DEGREE "Req Degree"
FROM GV$PX_SESSION ORDER BY QCSID, QCINST_ID, SERVER_GROUP, SERVER_SET;

SELECT NAME, VALUE FROM GV$SYSSTAT
WHERE UPPER (NAME) LIKE '%PARALLEL OPERATIONS%'
OR UPPER (NAME) LIKE '%PARALLELIZED%' OR UPPER (NAME) LIKE '%PX%';

SELECT px.SID "SID", p.PID, p.SPID "SPID", px.INST_ID "Inst",
       px.SERVER_GROUP "Group", px.SERVER_SET "Set",
       px.DEGREE "Degree", px.REQ_DEGREE "Req Degree", w.event "Wait Event"
FROM GV$SESSION s, GV$PX_SESSION px, GV$PROCESS p, GV$SESSION_WAIT w
WHERE s.sid (+) = px.sid AND s.inst_id (+) = px.inst_id AND
      s.sid = w.sid (+) AND s.inst_id = w.inst_id (+) AND
      s.paddr = p.addr (+) AND s.inst_id = p.inst_id (+)
ORDER BY DECODE(px.QCINST_ID,  NULL, px.INST_ID,  px.QCINST_ID), px.QCSID,
DECODE(px.SERVER_GROUP, NULL, 0, px.SERVER_GROUP), px.SERVER_SET, px.INST_ID;

SELECT * from v$pq_sysstat;
SELECT * FROM v$px_process;
SELECT * FROM v$px_sesstat;
SELECT * FROM v$px_process_sysstat;


Examples
========
ALTER TABLE table_name PARALLEL (DEGREE 8);
SELECT /*+PARALLEL(table_alias, degree, nodes)*/ *
  FROM table_name ...
OR
SELECT /*+PARALLEL */ * FROM table_name/View name ...


 

CONSUMING WEB SERVICE FROM ORACLE DATABASE 11G USING UTL_HTTP PACKAGE


Contents







 

 

1. Create access control list and assign host


1.1 Create access control list


 

BEGIN

   DBMS_NETWORK_ACL_ADMIN.CREATE_ACL (

    ACL          => 'STREAM_TEST.XML',

    DESCRIPTION  => 'PERMISSIONS TO ACCESS ESUPPORT WEBSITE',

    PRINCIPAL    => 'MD86506',

    IS_GRANT     => TRUE,

    PRIVILEGE    => 'CONNECT');

   COMMIT;

END;

/

 

1.2 Create Role and assign to access control list


 

BEGIN

   DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE (

    ACL          => 'STREAM_TEST.XML',               

    PRINCIPAL    => 'DBA',

    IS_GRANT     => TRUE,

    PRIVILEGE    => 'CONNECT',

    POSITION     => NULL);

   COMMIT;

END;

/

 

1.3 Add hosts


 

BEGIN

   DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL (

    ACL          => 'STREAM_TEST.XML',               

    HOST         => '*.satyam.com);

   COMMIT;

END;

/

 

 

BEGIN

   DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL (

    ACL          => 'STREAM_TEST.XML',               

    HOST         => '172.16.187.25');

   COMMIT;

END;

/

 

1.4 Test Access


 

CREATE OR REPLACE PROCEDURE GETTITLE (PURL VARCHAR2)

IS

  VRESULT CLOB;

BEGIN

  VRESULT := REPLACE(UTL_HTTP.REQUEST(PURL),CHR(10),' ');

  VRESULT := REGEXP_REPLACE(VRESULT,'.*<TITLE> ?(.+) ?</TITLE>.*','\1',1,1,'I');

  DBMS_OUTPUT.PUT_LINE (VRESULT);

END;

/

 

SET SERVEROUTPUT ON

EXECUTE GETTITLE ('HTTP://172.16.187.119:8050');

 

 

 

 

 

 

2. Write procedure to call web service


 

2.1 UTL_HTTP


1.       UTL_HTTP.BEGIN_REQUEST : UTL_HTTP.BEGIN_REQUEST('http://172.16.187.25:8000/sap/xi/adapter_plain?bs=FILE'||'&'||'namespace=http%3A//file2file.com'||'&'||'interface=FILEHTML'||'&'||'qos=EO','POST',NULL,NULL);

Opens http request to the specified URL

2.       UTL_HTTP.SET_HEADER:

UTL_HTTP.SET_HEADER (req,'Content-Type','text/xml');

UTL_HTTP.SET_HEADER (req,'Content-Length','200');

 

Set communication parameters for the http request

 

3.       UTL_HTTP.WRITE_TEXT

 

UTL_HTTP.WRITE_TEXT (req,'<?xml version="1.0" encoding="UTF-8"?><ns0:FILEHTML xmlns:ns0="http://file2file.com"><row><EMPLID>865072</EMPLID><EMPLANAME>fromDB4</EMPLANAME></row></ns0:FILEHTML>');

Write data into http stream

4.       UTL_HTTP.RESPONSE:

-resp := UTL_HTTP.GET_RESPONSE (req);

Capture response of the http stream

5.       UTL_HTTP.END_RESPONSE:

Close request and response http connections

6.       UTL_HTTP.END_REQUEST:

Close request http connections

2.2 UTL_DBWS

Oracle Fusion Application Installation brief overview

Background
Oracle Fusion Application is best feature mix of e-business suite, jd edwards and peoplesoft integrated with Fusion Middleware products.

Installation of Fusion Application would mean installation of Fusion application components and all the fmw products.

Oracle has simplified install and configure by means of automated installation and configuration along with install validation. Oracle call this automation as provisioning.

Installation process. 
So Provisioning basically means installing various oracle products, configuration them to work with each other using oracle supplied special software(framework/life cycle managment tools)

A Framework software executes the installation, configuration and validation of all the required software components.

All the required inputs for installation/configuration and gathered in step called "creating responce file", This is the first step after installation of framework/life cycle managment tools software installation.

you would invoke resonponce file creation step using provisiongWizard and supply inputs in interview phase, after which a responce file is created. This will will be supplied during Applicaiton provisioning phase.

Application provisiong phase runs in below order.

Preverify
Install
Preconfigure
Configure
Configure Secondary
Post Configure
Startup
Validation.

Regards
Manoj

Thursday, February 6, 2014

shell script to automate oracle database cloning using rman active duplicate feature

##########################################################
#Script to clone xxxxxx from xxxxxxxx from active database #
#Author: Manoj                                           #
#Date: 30th Oct 2012                                     #
#Approximate time 1 Hour                                 #
###########################################################
#
#Be very carefully while configuring listener
#hostname and tnsnames hostname should be a perfect match
#
#

LOG_FILE=/u01/app/oracle/diag/custom_logs/FIN1_clone.log
RMAN_LOG=/u01/app/oracle/diag/custom_logs/FIN1_RMAN.log
export LOG_FILE
export RMAN_LOG


ORACLE_SID=FIN1
export ORACLE_SID

#echo "confirm"
#echo $ORACLE_SID

ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_HOME
echo "--------------------------------------" >> $LOG_FILE
echo "Start of Script at `date`" >> $LOG_FILE

#Drop database
#echo "shut immediate" | sqlplus '/ a sysdba' >> $LOG_FILE
#echo "startup nomount restrict" | sqlplus '/ as sysdba' >> $LOG_FILE
#echo "drop database" | sqlplus '/ as sysdba' >> $LOG_FILE
$ORACLE_HOME/bin/dbca -silent -deleteDatabase -sourceDB FINUAT -sysDBAUserName sys -sysDBAPassword xxxxxxxxx  >> $LOG_FILE
#add exception handling here


#Copy password file
cp $ORACLE_HOME/dbs/orapwFIN2 $ORACLE_HOME/dbs/orapwFIN1 >> $LOG_FILE
#add exception handling here

#create password file
#orapwd file=$ORACLE_HOME/dbs/orapwFIN1 password=satyam entries=10

echo "Start of clone of FINUAT from FINPRD from active databse `date`" >> $LOG_FILE
#Copy init file
cp $ORACLE_HOME/dbs/bkp_init1.ora $ORACLE_HOME/dbs/initFIN1.ora >> $LOG_FILE
#add exception handling here

#Add entry to tnsnames.ora

echo "FINUAT =   " >> $ORACLE_HOME/network/admin/tnsnames.ora
echo "  (DESCRIPTION = " >> $ORACLE_HOME/network/admin/tnsnames.ora
echo "    (ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 1621)) " >> $ORACLE_HOME/network/admin/tnsnames.ora
echo "    (CONNECT_DATA =  " >> $ORACLE_HOME/network/admin/tnsnames.ora
echo "      (SERVER = DEDICATED) " >> $ORACLE_HOME/network/admin/tnsnames.ora
echo "      (SERVICE_NAME = FIN1)" >> $ORACLE_HOME/network/admin/tnsnames.ora
echo "    )" >> $ORACLE_HOME/network/admin/tnsnames.ora
echo "  )" >> $ORACLE_HOME/network/admin/tnsnames.ora

#Shut down if started.
#echo "shut immediate" | sqlplus '/ as sysdba'

#Start database in nomount
echo "startup nomount pfile=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/bkp_initFIN1.ora" | sqlplus '/ as sysdba' >> $LOG_FILE

#create spfile from pfile
echo "create spfile from pfile;" | sqlplus '/ as sysdba' >> $LOG_FILE

#stop DB
echo "shut immediate;" | sqlplus '/ as sysdba' >> $LOG_FILE

#Stop and start listener services
lsnrctl stop FIN1 >> $LOG_FILE
lsnrctl start FIN1 >> $LOG_FILE
#

#start DB with Pfile
echo "startup nomount;" | sqlplus '/ as sysdba' >> $LOG_FILE

#clone from active database
$ORACLE_HOME/bin/rman target sys/xxxx@FIN2 auxiliary sys/xxxxxxx@FIN2 msglog $RMAN_LOG << EOF
run
{
allocate auxiliary channel a1  device type disk;
allocate auxiliary channel a2  device type disk;
allocate auxiliary channel a3  device type disk;
allocate auxiliary channel a4  device type disk;
allocate channel a5  device type disk;
allocate channel a6  device type disk;
allocate channel a7  device type disk;
allocate channel a8  device type disk;
duplicate database to FIN1 from active database;
release channel a1 ;
release channel a2 ;
release channel a3 ;
release channel a4 ;
release channel a5 ;
release channel a6 ;
release channel a7 ;
release channel a8 ;
}
EOF
echo "Backup finished at `date`" >> $LOG_FILE
echo "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||" >> $LOG_FILE

# add entry to /etc/oratab file
echo "FIN1:/u01/app/oracle/product/11.2.0/dbhome_1:N #added by md86506" >> /etc/oratab

echo
echo "@ /u01/app/oracle/Backup/SCRIPTS/FIN1_POST_CLONE.sql" | sqlplus '/ as sysdba' >> $LOG_FILE
exit ;


#LOCAL_LISTENER='ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=1621))'
#
#FINUAT =
#  (ADDRESS_LIST =
#        (ADDRESS= (PROTOCOL= IPC)(KEY= EXTPROCFINUAT))
#        (ADDRESS= (PROTOCOL= TCP)(Host= hostname)(Port= 1621))
#   )
#
#SID_LIST_FINUAT =
#  (SID_LIST =
#    (SID_DESC =
#      (ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome_1)
#      (SID_NAME = FIN1)
#    )
#    (SID_DESC =
#      (SID_NAME = PLSExtProc)
#      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
#      (PROGRAM = extproc)
#    )
#  )
#

move execution plan between two oracle databases

IMPORT/EXPORT execution plan from one Database to another

You use DBMS_SQLTUNE subprograms to move SQL profiles and SQL tuning sets from one system to another using a common programmatic model. In both cases, you create a staging table on the source system and populate that staging table with the relevant data. You then move that staging table to the destination system following the method of your choice (such as datapump, import/export, or database link), where it is used to reconstitute the objects in their original form. These steps are implemented by means of subprograms included in this package:

Call the CREATE_STGTAB_SQLPROF Procedure or the CREATE_STGTAB_SQLSET Procedure to create the staging table on the source system.

Call the PACK_STGTAB_SQLPROF Procedure or PACK_STGTAB_SQLSET Procedure to populate the staging table with information from the source system.

Once you have moved the staging table to the destination system, you call the UNPACK_STGTAB_SQLPROF Procedure or the UNPACK_STGTAB_SQLSET Procedure to recreate the object on the new system.


EXAMPLE:

NOTE: Do not sys schema for staging table

Create a staging table:
EXEC DBMS_SQLTUNE.CREATE_STGTAB_SQLPROF (table_name  => 'PROFILE_TO_PROD');

dump profile to staging table
EXEC DBMS_SQLTUNE.PACK_STGTAB_SQLPROF(profile_name => 'migrate_to_prod_1',profile_category => 'DEFAULT',staging_table_name=> 'PROFILE_TO_PROD', staging_schema_owner => 'MD86506');

export/import staging table
exp tables=PROFILE_TO_PROD file=prof01.dmp log=prof01.log
imp file=prof01.dmp log=profimp.log tables=PROFILE_TO_PROD

unpack the staging table for sql_profile to come into effect
EXEC DBMS_SQLTUNE.UNPACK_STGTAB_SQLPROF(replace            => FALSE, -
                                        staging_table_name => 'PROFILE_STGTAB');


References: http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/d_sqltun.htm#CHDGFHEC

exadata to non-exadata cloning

 clone
-----------------------
1)
Create init.ora file (example instance name: TPTST)
*._gby_hash_aggregation_enabled=FALSE
*._optimizer_cost_based_transformation='OFF'
*._optimizer_use_feedback=FALSE
*._unnest_subquery=FALSE
*.audit_sys_operations=FALSE
*.audit_trail='NONE'
*.compatible='11.2.0.2.0'
*.control_files='xxxxxxxxxxxxxxxcontrol01.ctl','xxxxxxxxxxxcontrol02.ctl'
*.cursor_sharing='EXACT'
*.db_block_size=8192
*.db_cache_size=750M
*.db_domain=''
*.db_files=1000
*.db_name='TPTST'#Reset to original value by RMAN
*.diagnostic_dest='xxxxxxxxx'
*.large_pool_size=250M
*.log_file_name_convert='xxxxxxx','/u03/','xxxxxxxxxxxx','/u02/'
*.open_cursors=700
*.optimizer_index_caching=99
*.optimizer_index_cost_adj=40
*.optimizer_use_sql_plan_baselines=FALSE
*.parallel_adaptive_multi_user=FALSE
*.parallel_execution_message_size=8384
*.parallel_max_servers=6
*.parallel_min_servers=2
*.pga_aggregate_target=800M
*.remote_login_passwordfile='EXCLUSIVE'
*.resource_limit=TRUE
*.resource_manager_plan='DEFAULT_PLAN'
*.session_cached_cursors=250
*.sga_target=2048M
*.shared_pool_size=700M
*.undo_tablespace='UNDOTBS1'

2)
source oracle_Sid

3)
start DB using init.ora file in nomount state

4)
create spfile from pfile

5)
restart DB using spfile in nomount state

6)
rman auxiliary /

7)
execute below command to create instance.
Check space usage and redirect tablespaces using "set newname for tablespace" clause.


RUN
{
ALLOCATE AUXILIARY CHANNEL c1 DEVICE TYPE disk ;
ALLOCATE AUXILIARY CHANNEL c2 DEVICE TYPE disk ;
SET NEWNAME FOR DATABASE TO '/u04/ORADATA/HREDU/%b';
duplicate database SFNPRD to SFNPRD1 BACKUP LOCATION '/xx/xx/xx'
LOGFILE GROUP 1 ('/xx/xx/xx/redo01.log') SIZE 1G REUSE,
      GROUP 2 ('/xx/xx/xx/redo02.log') SIZE 1G REUSE,
      GROUP 3 ('/xx/xx/xx/redo03.log') SIZE 1G REUSE;
}

8)
mast sensitive data
remove hybrid columanar compression if zfs storage is not available
run appliation specific post clone scripts
drop unwanted undo, temp and redo's

------Active duplicate-----

NOTE:
* make sure to have local_listener parameter in spfile
* make sure listener entries are available in listener.ora in auxiliary and in tnanames.ora in both target and auxiliary

run
{
allocate auxiliary channel a1  device type disk;
allocate auxiliary channel a2  device type disk;
allocate channel a5  device type disk;
allocate channel a6  device type disk;
SET NEWNAME FOR DATABASE TO 'xxxxxxxxxxxxx/%b';
duplicate database to xxxxxxxxxxx from active database;
release channel a1 ;
release channel a2 ;
release channel a5 ;
release channel a6 ;
}

Oracle E-business suite logs clean up

 Oracle E-business suite logs clean up #!/bin/bash cd $EBS_DOMAIN_HOME find $EBS_DOMAIN_HOME -type f -path "*/logs/*.log?*" -mtime...