Stay at Home!! Be Safe!! Take Care!!

Thanks all my viewers for your support, I am an Oracle Ace now. For Any queries, please mail us at support@funoracleapps.com

SED Command Basic Tutorial in Linux

1 comment

SED Command Tutorial in Linux



Introduction:

SED command is very powerful tool in Linux and can be used vastly in shell scripting. It is called as stream editor.
It can perform lot of function on a file like replacing,finding,insertion and deletion.It is capable of solving complex text processing tasks with few lines of code.


Syntax:



sed OPTIONS... [SCRIPT] [INPUTFILE...] 




Examples:

Lets create a sample file with some context.

cat DEMO.txt


Example 1) Replace a pattern in a file. It will replace all occurrence of the pattern.
I the demo file I am going to replace the word "We" with "I". Please note it don't save the changes it is just show on the screen.

himanshu@himanshu-ThinkPad-T430 ~ $ sed 's/We/I/g' DEMO.txt 
I are an IT Services and Training provider. I are the believers in quality services and support.
I develop, support and maintenance services across the globe. 
I have been dealing with customers across the globe and deliver quality solutions and training to them. 
I practice and believe in Green IT initiatives, improve and optimize customer’sbusiness processes.


Example 2)  Replace an exact word in a file.

We use \b for boundation of exact word. I am replacing the word "Green" with "Black"


himanshu@himanshu-ThinkPad-T430 ~ $ sed 's/\bGreen\b/Black/g' DEMO.txt 
We are an IT Services and Training provider. We are the believers in quality services and support.
We develop, support and maintenance services across the globe. 
We have been dealing with customers across the globe and deliver quality solutions and training to them. 
We practice and believe in Black IT initiatives, improve and optimize customer’sbusiness processes.

Example 3)  Replace a pattern which comes in starting of a line.



I am going to replace "We" to "I" but only where it comes at beginning of line.


himanshu@himanshu-ThinkPad-T430 ~ $ sed 's/^We/I/g' DEMO.txt 
I are an IT Services and Training provider. We are the believers in quality services and support.
I develop, support and maintenance services across the globe. 
I have been dealing with customers across the globe and deliver quality solutions and training to them. 
I practice and believe in Green IT initiatives, improve and optimize customer’sbusiness processes.


Example 4) Replace a pattern which comes at end of line.


I am replacing "support" with "fun" but only present at end of line. Please also note that the pattern is "support."



himanshu@himanshu-ThinkPad-T430 ~ $ sed 's/support.$/fun/g' DEMO.txt 
We are an IT Services and Training provider. We are the believers in quality services and fun
We develop, support and maintenance services across the globe. 
We have been dealing with customers across the globe and deliver quality solutions and training to them. 
We practice and believe in Green IT initiatives, improve and optimize customer’sbusiness processes.

Example 5)  Delete any line that contains a pattern.


I am deleting lines which contains "support" .

himanshu@himanshu-ThinkPad-T430 ~ $ sed '/support/d' DEMO.txt 
We have been dealing with customers across the globe and deliver quality solutions and training to them. 
We practice and believe in Green IT initiatives, improve and optimize customer’sbusiness processes.




Example 6)  If we want to make changes directly to file permanently.

I want to permanently replace "We" to I.


himanshu@himanshu-ThinkPad-T430 ~ $ sed -i 's/We/I/g' DEMO.txt
himanshu@himanshu-ThinkPad-T430 ~ $ cat DEMO.txt
I are an IT Services and Training provider. I are the believers in quality services and support.
I develop, support and maintenance services across the globe. 
I have been dealing with customers across the globe and deliver quality solutions and training to them. 
I practice and believe in Green IT initiatives, improve and optimize customer’sbusiness processes.

1 comment :

Post a Comment

Script to update profile in EBS R12

No comments

Script to update profile in EBS R12 



Script:

 Declare
Result Boolean;
BEGIN

   Result:= fnd_profile.SAVE ('APPS_SSO_LDAP_SYNC', 'N', 'SITE');
   IF Result
   THEN
      DBMS_OUTPUT.put_line ('Profile Updated');
   ELSE
      DBMS_OUTPUT.put_line ('Profile Not Updated');
   END IF;
   COMMIT;
END;

No comments :

Post a Comment

Completely Remove All VirtualBox Setup/Packages and Folders from Linux Mint

No comments

Completely Remove All VirtualBox Setup/Packages and Folders from Linux Mint

If we are installing virtual box after linux mint update, we might see error "The VirtualBox Kernel Modules Do Not Match This Version of VirtualBox" or rc=-1912.
This might happen due to conflicts with prior installed packages before upgrade.

Steps:

1. Check the packages which are installed for virtualbox.

himanshu@himanshu-LIFEBOOK-A555 ~ $ dpkg -l | grep virtualbox
rc  virtualbox                              5.2.34-dfsg-0~ubuntu18.04.1                         amd64        x86 virtualization solution - base binaries
rc  virtualbox-5.2                          5.2.22-126460~Ubuntu~xenial                         amd64        Oracle VM VirtualBox
ii  virtualbox-6.0                          6.0.16-135674~Ubuntu~bionic                         amd64        Oracle VM VirtualBox
rc  virtualbox-6.1                          6.1.2-135662~Ubuntu~bionic                          amd64        Oracle VM VirtualBox
ii  virtualbox-dkms                         5.2.34-dfsg-0~ubuntu18.04.1                         all          x86 virtualization solution - kernel module sources for dkms
rc  virtualbox-qt                           5.2.34-dfsg-0~ubuntu18.04.1                         amd64        x86 virtualization solution - Qt based user interface


2. Uninstall  packages for virtual box.

sudo apt-get remove virtualbox* --purge

3. Check again , all the packages would be removed.

No comments :

Post a Comment

Installing and Configuring VNC Server on Linux

No comments

Installing and Configuring VNC Server on Linux



In this post I am going to share the steps to install VNC server on Linux/Oracle Enterprise Linux server.

1)Install the VNC Server.

yum install tigervnc-server

2) Edit the file "/etc/sysconfig/vncservers" file to configure the required displays. 

 Note: Multiple "display:user" pairs are defined on a single line, but the arguments for each display are defined separately.

VNCSERVERS="2:root 3:oracle"
VNCSERVERARGS[2]="-geometry 1280x1024 -nolisten tcp -localhost"
VNCSERVERARGS[3]="-geometry 1280x1024"

3) Setup the VNC password for all users defined in the "/etc/sysconfig/vncservers" file.
Root User
# vncpasswd
Password:
Verify:
#

Oracle User
# su - oracle
$ vncpasswd
Password:
Verify:


4) From root user enable the "vncserver" service for autostart and start the service.

chkconfig vncserver on
 service vncserver start

5)Now install/use VNC viewer to connect to system using the display numbers and passwords defined.
hostname:2--> for root
hostname:3--> for oracle





6)Use the following commands to stop the service and disable autostart.

service vncserver stop
chkconfig vncserver off

No comments :

Post a Comment

Changing Weblogic Administrative Password in EBS/Apps R12.2 if it has been Lost or Forgot

1 comment

Changing Weblogic Administrative Password in EBS/Apps R12.2 if it has been Lost or Forgot


For the EBS WebLogic domain, the Node Manager and WebLogic AdminServer passwords must be same. If the passwords are different, the AD control scripts will not work properly.

The following steps has to be performed in RUN file system.

Steps:

1)  Shut down all running services. Since the AdminServer password is not known, the servers cannot be stopped from the console and so must be killed.

1. Connect to the Oracle E-Business Suite instance and source the application tier environment file.

2. Identify the PIDs of Node Manager, AdminServer, and all running Managed
Servers:
$ ps -ef | grep "NodeManager"
$ ps -ef | grep "weblogic.Name=AdminServer"
$ ps -ef | grep "weblogic.Name=forms-c4ws_server"
$ ps -ef | grep "weblogic.Name=forms_server"
$ ps -ef | grep "weblogic.Name=oafm_server"
$ ps -ef | grep "weblogic.Name=oacore_server"

3. Kill all these processes, starting with Node Manager and followed by the Managed Servers.

2) Back up these folders, and then delete them

/security/ DefaultAuthenticatorInit.ldift
/servers//data/ldap
/servers//security/boot.properties
/servers//data/nodemanager/boot.properties

3)  Set up a new environment to change the WLS AdminServer password.

1. Start a new session and connect to the Oracle E-Business Suite instance.
2. Do not source the application tier environment file.
3. Run the following command to source the WebLogic Server domain environment:
$ cd /bin
$ source setDomainEnv.sh
4. Run the following commands:
$ cd /security
$ java weblogic.security.utils.AdminAccount
.

4) Start AdminServer from the command line. You will be prompted for the WebLogic

Server username and password, so that the AdminServer boot.properties file can be generated.
1. Go to the EBS Domain Home:
$ cd
2. Start AdminServer:
$ java -Dweblogic.system.StoreBootIdentity=true -Dweblogic.Name=AdminServer weblogic.Server
Where:
is the same as the value of context variable
ss_nm_jvm_startup_properties
The above command prompts for the WebLogic Server username and
password:
Enter username to boot WebLogic server:
Enter password to boot WebLogic server:
Provide the same credentials as you provided in Step 3.

5) Change the Node Manager password.

1. Log in to the WebLogic Administration console.
2. Click the 'Lock & Edit' button.
3. In the left panel, click on the EBS Domain link.
4. Select the 'Security' tab.
5. Click on the 'Advanced' link.
6. Edit the 'Node Manager password' field and set it to the new WebLogic Server password. The password should be same as set in Step 3.
7. Edit the 'Confirm Node Manager Password' field and set it to the new
WebLogic Server password. The password should be same as set in Step 3.
8. Save and activate the changes.

6) The first time, AdminServer has to be stopped from the Admin console. Follow
these steps:
1. Log in to the WebLogic Administration console.
2. Shut down AdminServer.

7) Set up your environment to start AdminServer again. AdminServer should now be started using the normal AD script, which will also start Node Manager using the new password.

1. Launch a new session and connect to the Oracle E-Business Suite instance.
2. Source the application tier environment file.
3. Start AdminServer with the following command:
$ $ADMIN_SCRIPTS_HOME/adadminsrvctl.sh start

8) Start the Managed Servers. For the first time, all Managed Servers should be started from the WebLogic Server Admin console. This step will create boot.properties files for the respective Managed Servers. Follow these steps:

1. Log in to the WebLogic Server Administration Console.
2. Start all Managed Servers, one at a time.

9) Shut down all the Managed Servers. This is so the new credentials will be picked up at the next startup. Follow these steps:

1. Log in to the WebLogic AdminServer console.
2. Shut down all Managed Servers.
3. Shut down AdminServer.

10) Shut down Node Manager using the normal AD script.
$ $ADMIN_SCRIPTS_HOME/adnodemgrctl.sh stop

11) Copy the boot.properties file for each Managed Server.
WebLogic Server native scripts use the boot.properties file. The above steps have created the boot.properties file under /servers//data/nodemanager, which is used by Node Manager. For each Managed Server, copy the newly-generated boot.properties file from /servers/
name>/data/nodemanager to /servers//security.

The EBS WebLogic Server domain password has now been changed, and all servers can now be started using the normal AD scripts.
To start AdminServer:
$ADMIN_SCRIPTS_HOME/adadminsrvctl.sh start
To start the Managed Servers:
$ $ADMIN_SCRIPTS_HOME/admanagedsrvctl.sh start

12) The above steps have changed the Oracle WebLogic AdminServer password on the run file system. You now need to perform an fs_clone operation, to change the WebLogic EBS Domain password on the patch file system:

1. Launch a new session and connect to the Oracle E-Business Suite instance.
2. Source the application tier environment file.
3. Run the following command:
$ adop phase=fs_clone

1 comment :

Post a Comment

Changing Weblogic Administrative Password in EBS/Apps R12.2

No comments

Changing Weblogic Administrative Password in EBS/Apps R12.2





We need to follow below steps to change the weblogic password in R12.2 EBS. 

Note: I am assuming that your EBS environment already has R12.TXK.C.Delta.7  or higher patch applied.

Steps:

1) Shut down all application tier services except the Admin Server.

1. On the primary node, run the command:
 $ /adstpall.sh -skipNM -skipAdmin

This command will not stop node manager and Weblogic Admin server as they are required to be running during password change.

2. On all secondary nodes, run the command:
 $ /adstpall.sh 

2) Change the Oracle WebLogic Server Administration User(weblogic) password by performing
the following steps as applicable.

1. Source the environment on the run file system.
2. Run the commands appropriate for your platform:

$ perl $FND_TOP/patch/115/bin/txkUpdateEBSDomain.pl -
action=updateAdminPassword

3) Now we need to start all services on all nodes using the appropriate
command for your platform.

$ /adstrtal.sh 

4) We  need to run  fs_clone  to change the WebLogic EBS Domain password on the patch file system:

1. Launch a new session and connect to the Oracle E-Business Suite instance.
2. Source the application tier environment file.
3. Run the following command:
$ adop phase=fs_clone

No comments :

Post a Comment