Wednesday, 19 June 2019

Linux find string in file recursively and replace

Find string in files recursively:
 grep -r -l "" .

Replace a string in files recursively
sed -i 's/' *

Saturday, 15 June 2019

Changing HOSTNAME in oracle EBS VM Appliance steps Release 12.2.7 (Doc ID 2328923.1)

Changing the logical host name of the virtual machine is not mandatory for accessing Oracle E-Business Suite applications. Our recommendation is to continue using the logical or virtual name as set when you install and front end the virtual machine with the virtual machine's public host name or any other device, such as a reverse proxy or a load-balancer, for access from external clients. Administrators can use the script shipped in the /u01/install/scripts directory for this purpose.
Please note that the instructions described in this section have been validated on the single node Vision instance virtual machine.
Perform the following steps to change the host name of the virtual machine:
  1. Start the virtual machine.
  2. Log in as the oracle user.
  3. Source the runtime environment:
  4. [oracle@apps ~]$ . /u01/install/APPS/EBSapps.env run
  5. Execute the following command to start the Admin server:
  6. [oracle@apps ~]$ $INST_TOP/admin/scripts/ start
  7. Execute the following command:
  8. [oracle@apps ~]$ $INST_TOP/admin/scripts/ appsTier
  9. Source the patch environment in the patch edition file system:
  10. [oracle@apps ~]$ . /u01/install/APPS/EBSapps.env patch
  11. Execute the following command:
  12. [oracle@apps ~]$ $INST_TOP/admin/scripts/ start forcepatchfs
  13. Execute the following command:
  14. [oracle@apps ~]$ $INST_TOP/admin/scripts/ appsTier
  15. Execute the following command to shut down the Oracle E-Business Suite application tier services:
  16. [oracle@apps ~]$ /u01/install/APPS/scripts/
  17. Execute the following command to shut down the Oracle E-Business Suite database tier services:
  18. [oracle@apps ~]$ /u01/install/APPS/scripts/
  19. Execute the following command as the root user and provide the same IP configuration details and the new host name:
  20. [root@apps ~]# /u01/install/scripts/
  21. Use the following two chkconfig commands to ensure that the boot scripts will not automatically start the database and application tiers upon boot. Use init 6 to reboot the VM.
  22. [root@apps ~]# chkconfig apps off
    [root@apps ~]# chkconfig ebsdb off
    [root@apps ~]# init 6
    It is important that the database and application tier processes do not start when the VM boots.
  23. Once the virtual machine has rebooted, log in as the root user and ensure echo $HOSTNAME returns the new host name.
  24. Execute the following command as the root user:
    Note: Change the SID of the Database (Conditional)
    If you want to change the SID of the database at this stage, perform the following task before running
    • Edit the db_pairs.txt file in the /u01/install/APPS/scripts/ directory using the following commands:
      [root@apps ~]# cd /u01/install/APPS/scripts/
      [root@apps ~]# sed -i "s/^s_dbSid=.*$/s_dbSid=VIS1227/" db_pairs.txt 
    In this example, consider "VIS1227" the new SID.
  25. [root@apps ~]# /u01/install/APPS/scripts/
    When the script completes, the database is left running with its new SID, such as "VIS1227", in this example.
  26. Execute the following command as the root user:
  27. [root@apps ~]# /u01/install/APPS/scripts/
    If the script returns an error while creating the patch file system, perform the following steps to re-create the patch file system:
    1. Stop any processes that is running from the patch file system.
    2. Log in as the oracle user and source the run file system.
    3. [oracle@apps ~]$ . /u01/install/APPS/EBSapps.env run
    4. Execute the following command to create the patch file system:
    5. [oracle@apps ~]$ adop phase=fs_clone force=yes
    6. Perform the following steps to ensure that you can run online patching cycles without any errors on the reconfigured environment:
      1. Bring up processes from the run file system if they are down.
      2. Execute two adop empty cycles using the following commands:
      3. [oracle@apps ~]$ adop phase=prepare
        [oracle@apps ~]$ adop phase=cutover
        [oracle@apps ~]$ adop phase=prepare
        [oracle@apps ~]$ adop phase=cutover
  28. Attach inventory post appsconfig by executing the following command as the oracle user:
  29. [oracle@apps ~]$ /u01/install/APPS/12.1.0/oui/bin/

Wednesday, 8 May 2019

Oracle DBA: To un-quiesce Oracle database

SQL> select active_state from v$instance;
SQL> alter system unquiesce;
System altered.
SQL> select active_state from v$instance;

Sunday, 31 March 2019

UNIX and Windows : Command to find a string in a files including sub-directories

Search for ORACLE_HOME in UNIX

grep -H -r "ORACLE_HOME" /home/oracle

Search for ORACLE_HOME in Windows

finstr /M /C:"ORACLE_HOME"  *.*

Saturday, 2 March 2019

ORA-39171: Job is experiencing a resumable wait

ORA-39171: Job is experiencing a resumable wait
                                                 Last update (2012-05-03 06:48:50)
                                                                                                                   Date added (2019-01-25 04:08:20)
In the datapump import phase you get errors related to tablespace allocation. For example you don't have any more space left at the filesystem. So at the import you have errors:
Import: Release - 64bit Production on Wednesday, 25 Jan, 2019 12:06:16

Copyright (c) 2003, 2007, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_FULL_01":  HOSPITAL/******** DIRECTORY=DWH_TRANSFER_DIR DUMPFILE=HOSPITAL.dmp parfile=target_bill_par.par
Processing object type TABLE_EXPORT/TABLE/TABLE
ORA-39171: Job is experiencing a resumable wait.
ORA-01658: unable to create INITIAL extent for segment in tablespace USERS
How to restart Datapump
1. In the IMPDP command line, press CTRL-C to stop the job.
2. At the command line of the import
Import> stop_job=immediate
Are you sure you wish to stop this job ([yes]/no): y
3. Fix the tablespace error
4. Attach again the job. Check sqlplus>SELECT * FROM DBA_DATAPUMP_JOBS;
Use the job name which is something like "SYS_IMPORT_FULL_*"
$impdp system/**** attach=SYS_IMPORT_FULL_01
5. At the command line of the import
Import> start_job
6. Check sqlplus>SELECT * FROM DBA_DATAPUMP_JOBS; It is running again.

Wednesday, 27 February 2019

Oracle Database: Open Wallet Automatically After Starting The Database.

create one trigger which will open the wallet automatically immediately after database opened:

execute immediate ‘ALTER SYSTEM SET ENCRYPTION WALLET OPEN identified by “xxxxx”’;

Tuesday, 26 February 2019

Number of Visitors