Tuesday, 21 March 2017

Clone Process individually on Oracle E-Business Suite 12.2.4

Detail Clone for Technology Stack Only
  • Database tier
    Run this command to clone the database tier technology stack:
    $ perl adcfgclone.pl dbTechStack
  • Applications tier
    Run this command to clone the applications tier technology stack, namely the OracleAS 10.1.2 Oracle Cloning Procedures Home, Oracle Fusion Middleware (FMW) Home, Oracle WebLogic Server domain configuration, and Oracle HTTP Server configuration:
    $ perl adcfgclone.pl atTechStack
    Run this command to clone the OracleAS 10.1.2 Oracle Home only:
    $ perl adcfgclone.pl dev10gHome
    Run this command to clone the FMW Home binaries only:
    $ perl adcfgclone.pl fmwHome
    Run this command to clone the Oracle WebLogic Server domain configuration only:
    $ perl adcfgclone.pl wlsConfig
    Run this command to clone the Oracle HTTP Server configuration only: 
    $ perl adcfgclone.pl ohsConfig
Important Restrictions on Application Tier Cloning
  • The wlsConfig and ohsConfig cloning commands will work only if a context file is passed in as an argument. In other words, for the wlsConfig and ohsConfigcommands the context file will not be cloned.
  • The fmwHome cloning command should be performed before the wlsConfig command is performed.
  • The ohsConfig cloning command cannot be performed before the wlsConfig command is performed.
  • Even though the ohsConfig cloning command will work without WebLogic Admin Server running, it is advisable to ensure WebLogic Admin Server has been started before performing the ohsConfig cloning command.

7.2 Cloning the Database Only

Run the following command to re-create the control file and configure the database. This command will not reconfigure the database Oracle Home.
$ perl adcfgclone.pl database

7.3 Configuring the Database Only

Run the following command to clean the topology data model and nodes, as well as to reconfigure the Oracle E-Business Suite data for the new Target. Ensure that the database is running and open before executing this command.
$ perl adcfgclone.pl dbconfig

7.4 Cloning the APPL_TOP Only

Run the following command to only clone and configure the APPL_TOP only. This command will not clone or configure the applications tier technology stack.
$ perl adcfgclone.pl appltop

Removing a Swap File From Use

Removing a Swap File From Use

If you have unneeded swap space, you can remove it.

How to Remove Unneeded Swap Space in UFS Root Environment

Become superuser.
Remove the swap space in a UFS root environment.
# /usr/sbin/swap -d /path/filename
The swap file name is removed so that it is no longer available for swapping. The file itself is not deleted.

Edit the /etc/vfstab file and delete the entry for the swap file.
Recover the disk space so that you can use it for something else.
# rm /path/filename
If the swap space is a file, remove it. Or, if the swap space is on a separate slice and you are sure you will not need it again, make a new file system and mount the file system.

For information on mounting a file system, see Mounting and Unmounting Oracle Solaris File Systems.

Verify that the swap file is no longer available.
# swap -l
Example 19-2 Removing Unneeded Swap Space

The following examples shows how to delete the /files/swapfile swap file.

# swap -d /files/swapfile
# (Remove the swap entry from the /etc/vfstab file)
# rm /files/swapfile
# swap -l
swapfile             dev  swaplo  blocks   free
/dev/dsk/c0t0d0s1   136,1      16 1638608 1600528
How to Remove a Swap Volume in a ZFS Root Environment

Most systems require some amount of swap space configured. If your system's swap space requirements change, then you might need to remove a swap volume before you can increase or decrease space allocated for swap. On a busy system, it might be easier to create a second swap volume if you need to increase swap space rather than trying to remove a swap volume that is busy just to increase its size.

Become superuser.
If the swap volume is in use, then you might not be able to delete it. Check to see if the swap area is in use.
# swap -l
swapfile             dev    swaplo   blocks     free
/dev/zvol/dsk/rpool/swap 102,2        16 16646128 16646128
In the above output, blocks == free, so the swap device is not actually being used.

If the swap area is not is use, remove the swap area.
# swap -d /dev/zvol/dsk/rpool/swap
Edit the /etc/vfstab file and delete the entry for the swap volume.
Verify that the swap volume is no longer available.
# swap -l

Adding or Changing Swap Space in an Oracle Solaris 11.1

You should have root privileges to add or change swap sapce

1. Identify the current Swap Volume

# swap -l
swapfile                 dev  swaplo   blocks   free
/dev/zvol/dsk/rpool/swap 256,1      16 1058800 1058800

2. Select one of the following to resize the swap volume.

a.If the current swap area is not in use, you can resize the size of the current swap volume, but you must reboot the system to see the increased swap space.
For example:

# zfs get volsize rpool/swap
NAME        PROPERTY  VALUE    SOURCE
rpool/swap  volsize   517M     -
# zfs set volsize=2g rpool/swap
# zfs get volsize rpool/swap
NAME        PROPERTY  VALUE    SOURCE
rpool/swap  volsize   2G       -
# init 6
If the system cannot be rebooted, add another swap volume to increase your total swap space.
For example:

# zfs create -V 2G rpool/swap2
Then, activate the second swap volume.

# swap -a /dev/zvol/dsk/rpool/swap2
# swap -l
swapfile                  dev  swaplo   blocks   free
/dev/zvol/dsk/rpool/swap  256,1      16 1058800 1058800
/dev/zvol/dsk/rpool/swap2 256,3      16 4194288 4194288
If necessary, add an entry for the second swap volume in the /etc/vfstab file.
For example:

/dev/zvol/dsk/rpool/swap2    -        -       swap    -       no      -

Saturday, 14 January 2017

Rotating stdout Log Files with UNIX OS Commands in Weblogic

SOLUTION

You can use the logrotate command along with the copytruncate option to rotate the log files in your environment. This option can also be combined with any other option pertaining to size-based or time-based rotation. For example, logrotate.conf:

/opt/weblogic/user_projects/domains/my_domain/servers/Server1/logs/er.out (or *.out) {
rotate 7 # rotates keeps logs for 7 weeks then overwrites.
size 200M # rotates log after the size reaches 200m
copytruncate # Copy logfile, then truncate it in place
missingok # tells logrotate not to issue an error if the log file is missing
notifempty # tells logrotate not to rotate a log if it's already empty

create 644 weblogic users # After rotation, re-create logfile with the specified permissions, owner, and group

endscript
}
The above script is simply an example of what parameters we can enter.

After creating the above script the following command can be used for log rotation.

logrotate -f logrotate.conf
Here -f is used for forced log rotation. For daily rotation we can setup something like a cron job. Following is an example of the same.

more /etc/cron.daily/logrotate

Default :


[root@mac2 bin]#  more /etc/cron.daily/logrotate
#!/bin/sh

/usr/sbin/logrotate /etc/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
   /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
exit 0
You can consider something like the following for using a custom logrotate.conf:

$ cat /etc/cron.daily/logrotate
#!/bin/sh

/usr/sbin/logrotate /home/anjhawar/Oracle/Middleware/user_projects/domains/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
   /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
exit 0

PGA memory used by the instance exceeds PGA_AGGREGATE_LIMIT of 30720 MB

Oracle Database - Enterprise Edition - Version 12.1.0.1 and later
Information in this document applies to any platform.


If the value of PGA_AGGREGATE_LIMIT is reached, an error will be reported.

ORA-04036: PGA memory used by the instance exceeds PGA_AGGREGATE_LIMIT
Cause: Private memory across the instance exceeded the limit specified in the PGA_AGGREGATE_LIMIT initialization parameter. The largest sessions using Program Global Area (PGA) memory were interrupted to get under the limit.
Action: Increase the PGA_AGGREGATE_LIMIT initialization parameter or reduce memory usage.




ORA-00756 detected lost write of a data block

Found below error message in alert log while switch over in DR site.

ORA-00756: recovery detected a lost write of a data block
ORA-10567: Redo is inconsistent with data block (file# 60, block# 871712, file offset is 2846097408 bytes)
ORA-10564: tablespace APPS_UNDOTS1
ORA-01110: data file 60: '/d4/oraprod/PROD/apps_st/data/undo_ts1b.dbf'
ORA-10560: block type 'KTU UNDO BLOCK'

Lost writes are caused by factors external to Oracle RDBMS. This normally happens when the operating system does not raised any errors while trying to write a blcok on disk, but still the write didn't get into the persistent storage.
So since there is no error, for Oracle, this is a complete write because the system call didn't produce any errors.
And then later, when reading the block, Oracle may realize by comparing the block with a different block that the block is not current.

As the affected datafile is part of UNDO tablespace you should replace the datafiles on STANDBY using the steps from Note 453153.1 - Recovering the primary database's datafile using the physical standby, and vice versa

Solution:

Please set below parameter on both primary and standby database . Please refer document 1265884.1 & 1302539.1 for more details and parameter impact on the database . 
DB_LOST_WRITE_PROTECT =TYPICAL 
DB_BLOCK_CHECKING=FULL 

ORA-07445: [slmecpy()+56] and ORA-600 [kghubigallasp_02]]

Facing above error in 12.1.0.2 Database.

ORA-00600: internal error code, arguments: [kghubigallasp_02], [0xFFFFFFFF58C48080], [0], [0], [0], [], [], [], [], [], [], [] 
ORA-07445: exception encountered: core dump [slmecpy()+56] [SIGSEGV] [ADDR:0x0] [PC:0x10B676DEC] [Address not mapped to object] [] 




Oracle raised bug request with development team for resolution.
 Bug 16729624 

Adgendbc.sh Fails With Invalid Arguments

While running autoconfig ,it is failing with following error


Generating <$FND_TOP>/secure/<Hostname>_<SID>.dbc
java.sql.SQLException: Io exception: Connection
refused(DESCRIPTION=(ERR=1153)(VSNNUM=153093632)(ERROR_STACK=(ERROR=(CODE=1153)(EMFI=4)(ARGS='(DESCR
IPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=<Hostname>)(PORT=<Port Number>)))(CONNECT_DATA=(CID=
(PROGRAM=)(HOST=__jdbc__)(USER=))SERVICE_NAME, <SID>))'))(ERROR=(CODE=303)(EMFI=1))))
Database connection to
jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=YES)(FAILOVER=YES)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)
(HOST=<Hostname>)(PORT=<Port Number>)))(CONNECT_DATA=(SERVICE_NAME=<Hostname>, <SID>))) failed
DBC generation failed with exit code 1
Updating parameters: fnd_jdbc_stmt_cache_free_mem=TRUE fnd_jdbc_buffer_min=1 fnd_jdbc_buffer_max=5
Invalid arguments - 'PROD)))' not recognized

Updating parameters: fnd_jdbc_buffer_decay_interval=300 fnd_jdbc_buffer_decay_size=5
fnd_jdbc_usable_check=false
Invalid arguments - 'PROD)))' not recognized

Updating parameters: fnd_jdbc_context_check=true fnd_jdbc_plsql_reset=false
Invalid arguments - 'PROD)))' not recognized

DBC generation failed with exit code 1

Updating Server Security Authentication
java.sql.SQLException: Io exception: Invalid number format for port number
Database connection to jdbc:oracle:thin:@host_name:port_number:database failed
Updating Server Security Authentication failed with exit code 1
adgendbc.sh exiting with status 1
ERRORCODE = 1 ERRORCODE_END

Solution
1) Take a backup of the FND_DATABASE_SERVICES table.

2)  Delete entry of the "<Name of the Service>" in table FND_DATABASE_SERVICES.

3)  Run Autoconfig and re-test.