Sunday, November 3, 2019

LINUX Change Home Directory

Change the home directory of a Linux user with a simple usermod command. While creating a user if you didn’t specify any –home parameter Linux assumes the home directory of the user to be /home/username even if you did specify you can later change it to something else according to your needs. Apart from changing the home directory using the usermod command you’ll have to assign proper ownership and permissions to the new folder. You can also change the home directory by editing the /etc/passwd file. I’ll outline both the steps here.

Change the home directory using usermod

This method is for command line warriors. Before you use the usermod command the new home directory should be created, ownership should be assigned to the new user and the folder should be chmoded correctly so that no one else can access it. Run the following commands to do it.
mkdir /home/new_home_directory
chown username:username /home/new_home_directory
chmod 700 /home/new_home_directory
usermod --home /home/new_home_directory username

Change the home directory by editing /etc/passwd

Alternatively you can also edit the /etc/passwd to change the home directory. But you should be careful not to edit anything else. Before editing this file it is always better to create the new home directory and assign proper permissions and ownership to it. Execute the following commands.
mkdir /home/new_home_directory
chown username:username /home/new_home_directory
chmod 700 /home/new_home_directory

Open the /etc/passwd file using a text editor and locate the line containing the required username it should look something like this
username:x:500:500::/home/username:/bin/bash
change it to
username:x:500:500::/home/new_home_directory:/bin/bash
Save the file.
Finally copy all the old content to the new home directory
cp -f /home/username/* /home/new_home_dir/

Tuesday, October 22, 2019

adgendbc.sh INSTE8_SETUP 1

Autoconfig Fails with error adgendbc.sh INSTE8_SETUP 1
login to database and check

show parameter jit, set it to false from true

alter system set JAVA_JIT_ENABLED= FALSE scope = both;

Bounce both DB and Application Tier and then re-run the autoconfig. The autoconfig will complete successfully

ref:Adgendbc Fails With Database Connection Failure (Doc ID 1302708.1)

Monday, October 21, 2019

ORA-17629: Cannot connect to the remote database server

The situation was I had to clone another ebs from artemis:hrcp to Athena:hrcd..  This two servers were created hap hazardly before. My plan was to restore o cone the Athena with artemis using rman duplicate. normally I would use a dr to do this. but unfortunately artemis does not have a dr site. Instead we will be duplication g from al ive database.

The hallenges I had was with connection.s.

I keep getting n n error that I connect to the remote server.

Artemis cannot ping hrcp and hrcd this is further complicated that it was looking for iflies. so I had to ocpy the old files. example
hrp_

Tuesday, October 15, 2019

Monday, October 14, 2019

ERROR at line 1: ORA-01940: cannot drop a user that is currently connected

SQL>  select s.sid, s.serial#, s.status, p.spid
from v$session s, v$process p
where s.username = 'CHRS'
and p.addr (+) = s.paddr;  2    3    4

       SID    SERIAL# STATUS   SPID
---------- ---------- -------- ------------------------
       139      17563 INACTIVE 21630
       142      56779 ACTIVE   10920
       148      20995 INACTIVE 27150
SQL> alter system kill session '142,56779';

System altered.

Saturday, October 12, 2019

Moving UNDO datafiles Oracle

SELECT a.name,b.status , d.username , d.sid , d.serial#
FROM   v$rollname a,v$rollstat b, v$transaction c , v$session d
WHERE  a.usn = b.usn
AND    a.usn = c.xidusn
AND    c.ses_addr = d.saddr
AND    a.name IN (
  SELECT segment_name
  FROM dba_segments
 WHERE tablespace_name = 'RBS'
);

create undo tablespace UNDOTBS2 datafile '/dba0B/oradata/ORAP/UNDOTBS01.DBF' size 5000M;

select tablespace_name, status, count(*) from dba_rollback_segs group by tablespace_name, status;

ALTER SYSTEM SET UNDO_TABLESPACE = UNDOTBS2 SCOPE=BOTH;

select * from dba_rollback_segs group by tablespace_name, status;


select count(segment_name),sum(bytes/1024/1024),status from dba_undo_extents group by status;


To do
1. after rbs is offline drop it
2. create new undo tablespace /dba0a
3. switch to undotbs
4. drop unotbs2

Friday, October 11, 2019

Oracle moving datafiles

https://oracle-base.com/articles/misc/renaming-or-moving-oracle-files

use rman


/dba0A/oradata/ORAP/APPS_TS_SUMMARY37.dbf  36

copy datafile 36 TO '/dba0B/oradata/ORAP/APPS_TS_SUMMARY37.dbf'

SQL 'ALTER TABLESPACE APPS_TS_SUMMARY OFFLINE';

SWITCH DATAFILE 36 TO COPY;
RECOVER TABLESPACE APPS_TS_SUMMARY;

SQL 'ALTER TABLESPACE APPS_TS_SUMMARY ONLINE';

HOST 'rm /dba0A/oradata/ORAP/APPS_TS_SUMMARY37.dbf';

Tuesday, October 8, 2019

Setting FAST RECOVERY AREA for Oracle

Today I have a new database that was just cloned from a VM. I wanted to make improvements on it by putting a backup on both disk and tape.

The first command I use was to show the existing parameters on the database.

show parameter recovery

SQL> show parameter recovery

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string
db_recovery_file_dest_size           big integer 0
recovery_parallelism                 integer     0

SQL>


We see that there is nothing set. The first thing we want to do is to set a recovery size and after that the destination.

SQL> alter system set db_recovery_file_dest_size=150G;

System altered.

SQL> alter system set db_recovery_file_dest ='/backup/fast_recovery_area';

System altered.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> show parameter db_reco

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /backup/fast_recovery_area
db_recovery_file_dest_size           big integer 150G
SQL> alter system set log_archive_dest_1='location=USE_DB_RECOVERY_FILE_DEST';

System altered.

Sunday, September 29, 2019

ORACLE AUDITING 01

I was seeing this on my OEM and try to remember what was it for 


These raised a couple of questions

1.  What are the current settings of audit in my database?

 Answer: show parameter audit

2. What can you audit?

  • Statements
  • Privileges
  • Objects
3. How do you turn on auditing?


To set the audit trail to OS, use the following and then restart the database:
SQL> alter system set audit_trail='os' scope=spfile;

To enable (or disable) the audit trail you need to set the AUDIT_TRAIL initialization parameter. You then need to restart the database. For example:
SQL> alter system set audit_trail=db scope=spfile;


4. What is being audited?

Seeing What is Being Audited
There are three views that show you what is currently being audited by the standard audit facility. DBA_STMT_AUDIT_OPTS shows you what statement auditing is enabled, DBA_PRIV_AUDIT_OPTS shows you what privilege auditing is enabled, and DBA_OBJ_AUDIT_OPTS shows you what object auditing is enabled.
SQL> select * from dba_stmt_audit_opts;
Reference

Friday, September 27, 2019

Find stored procedure by SID: SQL SERVER

select Object_Name(2103678542);

SELECT  requests.session_id,
        requests.status,
        requests.command,
        requests.statement_start_offset,
        requests.statement_end_offset,
        requests.total_elapsed_time,
        details.text
FROM    sys.dm_exec_requests requests
CROSS APPLY sys.dm_exec_sql_text (requests.sql_handle) details
WHERE   requests.session_id =194
ORDER BY total_elapsed_time DESC

SELECT  SUBSTRING(detail.text,
                  requests.statement_start_offset / 2,
                  (requests.statement_end_offset - requests.statement_start_offset) / 2)
FROM    sys.dm_exec_requests requests
CROSS APPLY sys.dm_exec_sql_text (requests.sql_handle) detail
WHERE   requests.session_id = 194

Thursday, September 26, 2019

SSMS stuck in Database (Expanding)

Check if you have query store enabled.

select * from sys.databases

alter database adventureworks SET QUERY_STORE = OFF

Tuesday, September 24, 2019

SQL Server Stored Procedure Example

use Halloween;
go

create procedure dbo.SelectEmployees
as
begin;
select * from dbo.Employee;
end;

exec dbo.SelectEmployees;

Thursday, September 12, 2019

Latest Query on SQL Server

SELECT dest.TEXT AS [Query],
deqs.execution_count [Count],
deqs.last_execution_time AS [Time]
FROM sys.dm_exec_query_stats AS deqs
CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest
ORDER BY deqs.last_execution_time DESC

Monday, September 2, 2019

SQL Server list partitioned tables

SELECT partition_number,rows,object_name(object_id)
FROM sys.partitions s
WHERE EXISTS(SELECT NULL
FROM sys.partitions s2
WHERE s.object_id = s2.object_id
AND partition_number > 1
AND s.index_id = s2.index_id);

Saturday, August 31, 2019

ORA-39071: Value for EXCLUDE is badly formed

This is for Linux
save or adjust the script below to your environment

#!/bin/bash
#Script to Perform Datapump Export
################################################################
#
. /oracle/local/.profile
export ORACLE_SID=cpwebp
#
expdate=`date '+%d%m%Y%H'`
dat=`date '+%m%d%y %H:%M'`
schema1=WEBP
################################
# export  schemas
expdp system/****** full=y dumpfile=expdp$schema1-$expdate.dmp directory=BKUPDUMP logfile=expdp$schema1-$expdate.log exclude=SCHEMA:\"IN \(\'SYSTEM\', \'PRESS\'\)\"
#Compressing files
/bin/gzip /dbapps/oracle/BACKUP/expdp$schema1-$expdate.dmp
######################################################################################
#Removing 7 days old dump and log  files
find /dbapps/oracle/BACKUP -mtime +7 -exec rm {} \;
######################################################################################
echo "hoy"

Sunday, August 25, 2019

ORA-19809

ORA-19815: WARNING: db_recovery_file_dest_size of 8499757056 bytes is 100.00% used, and has 0 remaining bytes available.
2019-08-25T07:45:13.120912-07:00
************************************************************************
You have following choices to free up space from recovery area:
1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard,
   then consider changing RMAN ARCHIVELOG DELETION POLICY.
2. Back up files to tertiary device such as tape using RMAN
   BACKUP RECOVERY AREA command.
3. Add disk space and increase db_recovery_file_dest_size parameter to
   reflect the new space.
4. Delete unnecessary files using RMAN DELETE command. If an operating
   system command was used to delete files, then use RMAN CROSSCHECK and
   DELETE EXPIRED commands.


SQL> ALTER SYSTEM SETDB_RECOVERY_FILE_DEST_SIZE = 20G SCOPE=BOTH

Thursday, August 22, 2019

RMAN

http://www.juliandyke.com/Research/RMAN/CrossCheckCommand.php


CROSSCHECK ARCHIVELOG ALL;

RMAN> DELETE EXPIRED ARCHIVELOG ALL;
RMAN> delete noprompt archivelog until time SYSDATE-10’; 
For changing tablespace:

impdp system@cpwebp DIRECTORY=ORCL_DUMP DUMPFILE=capex.dmp logfile=impdp_capex.log REMAP_TABLESPACE=USERS:CAPEX

Saturday, August 17, 2019

Current size of file recovery db_recovery_file_dest_size

SELECT name
, ceil( space_limit / 1024 / 1024) SIZE_M
, ceil( space_used  / 1024 / 1024) USED_M
, decode( nvl( space_used, 0),
0, 0
, ceil ( ( space_used / space_limit) * 100) ) PCT_USED
FROM v$recovery_file_dest
ORDER BY name
/

Wednesday, August 14, 2019

Cannot Access Oracle Express OEM

Do these three steps Then try to access it again

SELECT DBMS_XDB_CONFIG.gethttpport FROM dual;

SELECT DBMS_XDB_CONFIG.gethttpsport FROM dual;

EXEC DBMS_XDB_CONFIG.sethttpsport(5500);

Saturday, August 10, 2019

Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) TNS-12555: TNS:permission denied TNS-12560: TNS:protocol adapter error TNS-00525: Insufficient privilege for operation Linux Error: 1: Operation not permitted

Problem Symptoms

When one tries to start the Oracle Listener by executing the command "lsnrctl start" as UNIX user oracle, the following error messages appear:

---------------------------------
$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 10-APR-2014 20:36:19

Copyright (c) 1991, 2011, Oracle. All rights reserved.

Starting /exlibris/app/oracle/product/11r2/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /exlibris/app/oracle/product/11r2/network/admin/listener.ora
Log messages written to /exlibris/app/oracle/diag/tnslsnr/<server_name>/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<server_name>)(PORT=1521)))
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=REGISTER)))
TNS-12555: TNS:permission denied
TNS-12560: TNS:protocol adapter error
TNS-00525: Insufficient privilege for operation
Linux Error: 1: Operation not permitted

Listener failed to start. See the error message(s) above...
---------------------------------

Cause

(1)
In the directory /var/tmp/.oracle there exist some socket files which do not belong to UNIX user oracle and group dba, but to another user (e.g. daemon) and another group (e.g. root).

Example:

$ ls -l /var/tmp/.oracle
4259873 0 srwxrwxrwx 1 daemon root 0 Mar 22 09:53 /var/tmp/.oracle/s#10534.1
4259874 0 srwxrwxrwx 1 daemon root 0 Mar 22 09:53 /var/tmp/.oracle/s#10534.2
4259865 0 srwxrwxrwx 1 daemon root 0 Mar 22 09:53 /var/tmp/.oracle/sREGISTER


(2)
When the Listener process starts, it tries to create the following socket files:

/var/tmp/.oracle/s#<pid>.1
/var/tmp/.oracle/s#<pid>.2
/var/tmp/.oracle/sREGISTER

where <pid> is the ID of the operating system process for the Listener.

As the file /var/tmp/.oracle/sREGISTER already exists and belongs to a UNIX user other than oracle, the Listener process (running with privileges of user oracle) cannot create a new socket file with that name. Therefore the Listener fails to start.

Resolution

(1)
Delete all socket files from directory /var/tmp/.oracle as UNIX user root.

(2)
Start the Listener by executing the command "lsnrctl start" as UNIX user oracle.

Which one is using port 1521

netstat -ntap | grep 1521

Thursday, August 8, 2019

ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

alter system set local_listener='(ADDRESS=(PROTOCOL=tcp)(HOST=10.10.13.134)(PORT=1521))';
alter system register;

Monday, August 5, 2019

Find Oracle Temp Usage

column sum_max_mb format 999,999,999;
column temporary_tablespace format A20
WITH
pivot1 AS
(
SELECT
trunc(ash.sample_time,'MI') sample_time,
ash.SESSION_ID,
ash.SESSION_SERIAL#,
ash.SQL_ID,
ash.sql_exec_id,
U.temporary_tablespace,
max(temp_space_allocated)/(1024*1024) max_temp_mb
FROM  GV$ACTIVE_SESSION_HISTORY ash, dba_users U
WHERE
ash.user_id = U.user_id
and ash.session_type = 'FOREGROUND'
and ash.temp_space_allocated > 0
GROUP BY
trunc(ash.sample_time,'MI'),
ash.SESSION_ID,
ash.SESSION_SERIAL#,
ash.SQL_ID,
ash.sql_exec_id,
U.temporary_tablespace
)
SELECT  temporary_tablespace, sample_time, sum(max_temp_mb) sum_max_mb
from pivot1
GROUP BY sample_time, temporary_tablespace
ORDER BY temporary_tablespace, sample_time
DESC;


SELECT * FROM DBA_TEMP_FREE_SPACE;

Thursday, August 1, 2019

SQL Server list connection details between dates

SELECT 
    c.session_id, c.net_transport, c.encrypt_option, 
    c.auth_scheme, s.host_name, s.program_name, 
    s.client_interface_name, s.login_name, s.nt_domain, 
    s.nt_user_name, s.original_login_name, c.connect_time, 
    s.login_time 
FROM sys.dm_exec_connections AS c 
JOIN sys.dm_exec_sessions AS s 
    ON c.session_id = s.session_id
where last_request_start_time
between  '2019-07-29' and '2019-08-01'

Monday, July 29, 2019

SQL SERVER WAIT TYPES

https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-os-wait-stats-transact-sql?view=sql-server-2017#WaitTypes

How to create SQL SERVER email notification


EXEC msdb.dbo.sp_add_alert
@name=N'AlwaysOn - Role Change',
@message_id=1480,
@severity=0,
@enabled=1,
@delay_between_responses=0,
@include_event_description_in=0,
@category_name=N'[Uncategorized]',
@job_id=N'00000000-0000-0000-0000-000000000000'
GO

--AlwaysOn - Data Movement Suspended
EXEC msdb.dbo.sp_add_alert
@name=N'AlwaysOn - Data Movement Suspended',
@message_id=35264,
@severity=0,
@enabled=1,
@delay_between_responses=0,
@include_event_description_in=0,
@category_name=N'[Uncategorized]',
@job_id=N'00000000-0000-0000-0000-000000000000'
GO

--AlwaysOn - Data Movement Resumed
EXEC msdb.dbo.sp_add_alert
@name=N'AlwaysOn - Data Movement Resumed',
@message_id=35265,
@severity=0,
@enabled=1,
@delay_between_responses=0,
@include_event_description_in=0,
@category_name=N'[Uncategorized]',
@job_id=N'00000000-0000-0000-0000-000000000000'
GO


Then create operator
SSMS> object explorer>sql server agent>operators

Sunday, July 28, 2019

Find longest running query in SQL SERVER

CREATE TABLE T1(Col1 int, Col2 char(3));
GO
BEGIN TRAN
INSERT INTO T1 VALUES (101, 'abc');
GO
DBCC OPENTRAN;
ROLLBACK TRAN;
GO
DROP TABLE T1;
GO

Saturday, July 27, 2019

How to find stored procedure containing example SQL SERVER

I was running Top Queries Consuming CPU report the top query was


"SELECT "Tbl1002"."Model" "Col1007" FROM "eTrace"."dbo"."T_WIPHeader" "Tbl1002" WITH (NOLOCK) WHERE CONVERT(nvarchar(100),"Tbl1002"."IntSN",0)=@P"

I first used the actual text in the like of the ROUTINE_DEFINITION so at first it looked like this.

SELECT
ROUTINE_NAME,
ROUTINE_DEFINITION ,
ROUTINE_SCHEMA
FROM
    INFORMATION_SCHEMA.ROUTINES
WHERE
    ROUTINE_TYPE='PROCEDURE' AND
    ROUTINE_DEFINITION LIKE '%SELECT "Tbl1002"."Model" "Col1007" FROM "eTrace"."dbo"."T_WIPHeader" "Tbl1002" WITH (NOLOCK) WHERE CONVERT(nvarchar(100),"Tbl1002"."IntSN",0)=@P%'

I was getting no results and was getting frustrated. After a short nap, I had an idea of breaking down the query something like below.

SELECT
ROUTINE_NAME,
ROUTINE_DEFINITION ,
ROUTINE_SCHEMA
FROM
    INFORMATION_SCHEMA.ROUTINES
WHERE
    ROUTINE_TYPE='PROCEDURE' AND
    ROUTINE_DEFINITION LIKE '%nvarchar(100)%' AND
    ROUTINE_DEFINITION like '%T_WIPHeader%'   AND
    ROUTINE_DEFINITION like '%IntSN%' and ROUTINE_DEFINITION like '%convert%'

From there I found out that the stored proc is called sp_WIPOutATE

then I found the line that it was creating it. It was using a dynamic SQL

select @Wipid=Wipid ,@changedon =changedon,@DJ=DJ,@Model=upper(Model),@PCBA=upper(PCBA) ,@currentprocess=upper(CurrentProcess), @wipresult=result from T_wipheader with (nolock) where IntSN=@IntSerialNo

Wednesday, July 10, 2019

Symantec PGP Command Line Tutorial




Installation


1. Goto https://www.symantec.com/products/command-line
2. Click Free Trial
3. Fillup the information and download
4. You should get a zip file mine was "PGP_CommandLine_10.4.2_MP2.zip"
5.  Unzip then transfer the installer to the system you are going to install. Mine was a redhat
 (Hint: click to zoom)



 To install PGP Command Line into a different directory: 
1 If you have an existing version of PGP Command Line installed on the computer, uninstall it. 
2 Download the installer file called PGPCommandLine[version]Linux.tar to a known location on your system.
3 Untar the package first. You will get the following file: PGPCommandLine[version]Linux.rpm 
4 Type: rpm --prefix=/opt -ivh PGPCommandLine[version]Linux.rpm 
5 Press Enter. This command will install the application binary in the directory /opt/bin/pgp, libraries in /opt/lib, etc. 

You will need to edit the environment variable LD_LIBRARY_PATH to include the new library path for the software to function in any location other than the default.



 pgp --license-authorize --license-number "D4LVN-LH6UG-CUNWP-YLMBP-GDR59-PVA"

 CREATE KEYS 



Example: pgp --gen-key "Skull" --key-type RSA --bits 2048 --passphrase "King Kong"

Example 2: pgp --gen-key "Dexter Velasco <dexter.velasco@arttesyn.com>" --key-type DH --encryption-bits 2048 --signing-bits 2048 --passphrase "AshleyRocks"


 List key
 pgp --list-keys


 How to encrypt ?


/dbapps/applmgr/pgp-10.3.1/bin/pgp -esa $OUTGOING_TOP/mapm/processed/$DATA_FILE.$DATE -r "Bank of Amerika BA-CLEAR" -u EMRNETW10876



To encrypt

-e encrypt
-s sign
-a armor
-r recipient
-u user
--passphrase

Example : pgp -esa open.txt -r "Skull" -u Skull --passphrase "King Kong"

To decrypt

pgp --decrypt open.txt.asc

pgp --decrypt open.txt.asc --passphrase "King Kong"

Theory how to
Export key
Import key





How  to Export Keys



Public key

pgp --export "Dexter Velasco <dexter.velasco@arttesyn.com>" --output DAV

Private key
pgp --export-key-pair "Dexter Velasco <dexter.velasco@arttesyn.com>" --output DA.PRV


Scenario
A message can be encrypted by Skull but decrypted by DAV

  1. pgp -esa missile.txt -r "Dexter Velasco <dexter.velasco@arttesyn.com>" -u Skull --passphrase "King Kong"
  2. pgp --decrypt missile.txt.asc --passphrase "AshleyRocks"

  1. Encrypt missile.txt with Dexter
  2. Delete key Dexter
  3. Import Private key Dexter
  4. Decrypt missile.txt


  1. Import Public key Dexter
  2. Encrypt missile.txt
  3. Decrypt
  4. Import private key dexter
  5. Decrype

Remove key

pgp --remove-key-pair "Dexter Velasco <dexter.velasco@artesyn.com>" --force

How to import key

pgp --import "DAV"  (this contains the public)
 pgp --import "DA.V"

Monday, July 8, 2019

Can't reach this page + EBS

to see if something connects
use   $IAS_ORACLE_HOME/instances/ EBS_web_<instance>_OHS<no>/diagnostics/logs/OHS/EBS_web_<instance> acces_log

How To Stop Concurrent Managers on EBS

Concurrent manager can be stopped by running 

adcmctl.sh stop  <appsusername/password>

We can check if the Concurrent processes are still running by 

ps -ef |grep FNDLIBR 

If there are processes running the we can manually kill the processes.

kill -9 `ps -ef|grep FNDLIBR|awk '{print $2}'`

or

ps -ef|grep FNDLIBR|awk '{print $2}'|xargs kill -9

Sunday, July 7, 2019

How to run Autoconfig on EBS

Database Tier:


Execute Autoconfig on the DB Tier. ($ORACLE_HOME/appsutil/bin/adconfig.sh)


Application Tier:

Execute  apollo:/dbapps/applmgr/HRD2/inst/apps/HRD2_apollo/admin/scripts
ADOP Fails With Error Unable to Find Appltop_id (Doc ID 1907419.1)

There are duplicates on the table use the following to verify


Query
select node_name from FND_OAM_CONTEXT_FILES
where NAME not in ('TEMPLATE','METADATA','config.txt') and
CTX_TYPE='A' and (status is null or upper(status) in ('S','F'))
and EXTRACTVALUE(XMLType(TEXT),'//file_edition_type') = 'run'
and EXTRACTVALUE(XMLType(TEXT),'//oa_service_group_status[@oa_var=''s_web_admin_status'']')='enabled'

and EXTRACTVALUE(XMLType(TEXT),'//oa_service_list/oa_service[@type=''admin_server'']/oa_service_status')='enabled';



SQL> conn apps
Enter password:
Connected.
SQL> select node_name from FND_OAM_CONTEXT_FILES
where NAME not in ('TEMPLATE','METADATA','config.txt') and
  2    3  CTX_TYPE='A' and (status is null or upper(status) in ('S','F'))
and EXTRACTVALUE(XMLType(TEXT),'//file_edition_type') = 'run'
and EXTRACTVALUE(XMLType(TEXT),'//oa_service_group_status[@oa_var=''s_web_admin_status'']')='enabled'
and EXTRACTVALUE(XMLType(TEXT),'//oa_service_list/oa_service[@type=''admin_server'']/oa_service_status')='enabled';  4    5    6

NODE_NAME
------------------------------
rend
rend


SQL>

SEVERE : Jul 7, 2019 8:11:12 PM - ERROR - CLONE-20275 Insufficient space to create /tmp/CLONINGCLIENT-1225975372382435825.

Running Rapid Clone with command:
Running:
perl /upgrade/R12_R12T1/fs1/EBSapps/comn/clone/bin/adclone.pl java=/upgrade/R12_R12T1/fs1/EBSapps/comn/clone/bin/../jre mode=apply stage=/upgrade/R12_R12T1/fs1/EBSapps/comn/clone component=appsTier method=CUSTOM appctxtg=/upgrade/R12_R12T1/fs1/inst/apps/R12T1_crcdevportal/appl/admin/R12T1_crcdevportal.xml showProgress contextValidated=true



FMW Pre-requisite check log file location : /upgrade/R12_R12T1/fs1/EBSapps/comn/clone/FMW/logs/prereqcheck.log

Running: /upgrade/R12_R12T1/fs1/EBSapps/comn/clone/FMW/t2pjdk/bin/java -classpath /upgrade/R12_R12T1/fs1/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/engine.jar:/upgrade/R12_R12T1/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraPrereq.jar:/upgrade/R12_R12T1/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraPrereqChecks.jar:/upgrade/R12_R12T1/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraInstaller.jar:/upgrade/R12_R12T1/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraInstallerNet.jar:/upgrade/R12_R12T1/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/srvm.jar:/upgrade/R12_R12T1/fs1/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/ojdl.jar:/upgrade/R12_R12T1/fs1/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/ojdl2.jar:/upgrade/R12_R12T1/fs1/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/ojdl-log4j.jar:/upgrade/R12_R12T1/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/xmlparserv2.jar:/upgrade/R12_R12T1/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/share.jar:/upgrade/R12_R12T1/fs1/EBSapps/comn/clone/jlib/java oracle.apps.ad.clone.util.FMWOracleHomePreReqCheck -prereqCheckFMW -e /upgrade/R12_R12T1/fs1/inst/apps/R12T1_crcdevportal/appl/admin/R12T1_crcdevportal.xml -stage /upgrade/R12_R12T1/fs1/EBSapps/comn/clone -log /upgrade/R12_R12T1/fs1/EBSapps/comn/clone/FMW/logs/prereqcheck.log

Beginning application tier Apply - Sun Jul  7 20:09:44 2019

/upgrade/R12_R12T1/fs1/EBSapps/comn/clone/bin/../jre/bin/java -Xmx600M -DCONTEXT_VALIDATED=true -Doracle.installer.oui_loc=/oui -classpath /upgrade/R12_R12T1/fs1/EBSapps/comn/clone/jlib/xmlparserv2.jar:/upgrade/R12_R12T1/fs1/EBSapps/comn/clone/jlib/ojdbc6.jar:/upgrade/R12_R12T1/fs1/EBSapps/comn/clone/jlib/java:/upgrade/R12_R12T1/fs1/EBSapps/comn/clone/jlib/oui/OraInstaller.jar:/upgrade/R12_R12T1/fs1/EBSapps/comn/clone/jlib/oui/ewt3.jar:/upgrade/R12_R12T1/fs1/EBSapps/comn/clone/jlib/oui/share.jar:/upgrade/R12_R12T1/fs1/FMW_Home/webtier/../Oracle_EBS-app1/oui/jlib/srvm.jar:/upgrade/R12_R12T1/fs1/EBSapps/comn/clone/jlib/ojmisc.jar:/upgrade/R12_R12T1/fs1/FMW_Home/wlserver_10.3/server/lib/weblogic.jar:/upgrade/R12_R12T1/fs1/EBSapps/comn/clone/jlib/obfuscatepassword.jar  oracle.apps.ad.clone.ApplyAppsTier -e /upgrade/R12_R12T1/fs1/inst/apps/R12T1_crcdevportal/appl/admin/R12T1_crcdevportal.xml -stage /upgrade/R12_R12T1/fs1/EBSapps/comn/clone    -showProgress -nopromptmsg
Log file located at /upgrade/R12_R12T1/fs1/inst/apps/R12T1_crcdevportal/admin/log/clone/ApplyAppsTier_07072009.log
  |      0% completed
ERROR while running Apply...
Sun Jul  7 20:11:13 2019

 ERROR: Failed to execute /upgrade/R12_R12T1/fs1/EBSapps/comn/clone/bin/adclone.pl

 Please check logfile.



We then check

crcdevportal:/usr/applmgr> cd /upgrade/R12_R12T1/fs1/inst/apps/R12T1_crcdevportal/admin/log
! crcdevportal:/upgrade/R12_R12T1/fs1/inst/apps/R12T1_crcdevportal/admin/log> ls
07072009  clone
! crcdevportal:/upgrade/R12_R12T1/fs1/inst/apps/R12T1_crcdevportal/admin/log> cd clone/
! crcdevportal:/upgrade/R12_R12T1/fs1/inst/apps/R12T1_crcdevportal/admin/log/clone> cd ..
! crcdevportal:/upgrade/R12_R12T1/fs1/inst/apps/R12T1_crcdevportal/admin/log> cd clone/
! crcdevportal:/upgrade/R12_R12T1/fs1/inst/apps/R12T1_crcdevportal/admin/log/clone> ls
ApplyAppsTier_07072009.log  fmwT2PApply
! crcdevportal:/upgrade/R12_R12T1/fs1/inst/apps/R12T1_crcdevportal/admin/log/clone> cd fmwT2PApply/
! crcdevportal:/upgrade/R12_R12T1/fs1/inst/apps/R12T1_crcdevportal/admin/log/clone/fmwT2PApply> ls
CLONE2019-07-07_08-09-46PM.error  CLONE2019-07-07_08-09-46PM.log
! crcdevportal:/upgrade/R12_R12T1/fs1/inst/apps/R12T1_crcdevportal/admin/log/clone/fmwT2PApply> cat CLONE2019-07-07_08-09-46PM.error
SEVERE : Jul 7, 2019 8:11:12 PM - ERROR - CLONE-20275   Insufficient space to create /tmp/CLONINGCLIENT-1225975372382435825.
SEVERE : Jul 7, 2019 8:11:12 PM - CAUSE - CLONE-20275   Minimum required space was at least "3,350" MB, but only "3,003" MB was available for use.
SEVERE : Jul 7, 2019 8:11:12 PM - ACTION - CLONE-20275   Make sure that the minimum required space is available for use.
SEVERE : Jul 7, 2019 8:11:12 PM - ERROR - CLONE-20233   Restoring Middleware home for sourceid "mwhome1@FMW_Home" has failed.
SEVERE : Jul 7, 2019 8:11:12 PM - CAUSE - CLONE-20233   An internal operation failed.
SEVERE : Jul 7, 2019 8:11:12 PM - ACTION - CLONE-20233   Check the clone log and error file for more details.
SEVERE : Jul 7, 2019 8:11:12 PM - ERROR - CLONE-20237   Restoring the sourceid "mwhome1@FMW_Home" has failed.
SEVERE : Jul 7, 2019 8:11:12 PM - CAUSE - CLONE-20237   An internal operation failed.
SEVERE : Jul 7, 2019 8:11:12 PM - ACTION - CLONE-20237   Check the clone log and error file for more details.
SEVERE : Jul 7, 2019 8:11:13 PM - ERROR - CLONE-20218   Cloning is not successful.
SEVERE : Jul 7, 2019 8:11:13 PM - CAUSE - CLONE-20218   An internal operation failed.
SEVERE : Jul 7, 2019 8:11:13 PM - ACTION - CLONE-20218   Provide the clone log and error file for investigation.
! crcdevportal:/upgrade/R12_R12T1/fs1/inst/apps/R12T1_crcdevportal/admin/log/clone/fmwT2PApply> cd /tmp



SOLUTION:


CAUSE

The default /tmp directory doesn't have enough free space available to run the copyBinary.sh script and create the temporary files like CLONINGCLIENT202653551162129417.

Customer can't increase the space in the default /tmp directory.
 

SOLUTION

1) Create a new temporary directory in a location of your choice.
  Just make sure that:

  a) Oracle user has the right privileges to write on this directory and,
  b) There is plenty of free space, at least more than 5Gb free.

2) You can create a script to execute the cloning command or set the environment variable at command line.
  For example:
  $ export T2P_JAVA_OPTIONS="-Djava.io.tmpdir=/home/Oracle/testcase/tmp"


On my case

export T2P_JAVA_OPTIONS="-Djava.io.tmpdir=/upgrade/skullone/tmp"

It works