Tuesday, November 27, 2012

How to map a Windows share folder on Linux

- Create the required mount point:

[root@erpapp1 ~]# mkdir /mnt/TimeSheets
[root@erpapp1 ~]#

[root@erpapp1 ~]# cd /mnt/TimeSheets
[root@erpapp1 TimeSheets]#


- Get the UID for the user who will own the shared files:

[root@erpapp1 /]# id apstage1
uid=500(apstage1) gid=54326(dba) groups=54326(dba),54321(oinstall)
[root@erpapp1 /]#



Windows machine: file-server
Windows shared folder: TimeSheets 
Linux mount point: /mnt/TimeSheets
local user (uid=500) will become the owner of the mounted files.


[root@erpapp1 ~]# cat /root/smblogin.txt
username=rsteel/erp.auto
password=ERP112233
[root@erpapp1 ~]# 

where:
Domain Name: rsteel
Windows User Name: erp.auto
Windows user passwd: ERP112233


***********************
***********************
*** Once you mounted the folder, you can remove your password from smblogin.txt
***********************
***********************

[root@erpapp1 mnt]# diff /etc/fstab /etc/fstab_25Nov2012
10d9
\\file-server\TimeSheets /mnt/TimeSheets cifs credentials=/root/smblogin.txt,uid=500,user 0 0
[root@erpapp1 mnt]#


[root@erpapp1 TimeSheets]# mount /mnt/TimeSheets
[root@erpapp1 TimeSheets]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/cciss/c0d0p3      19G   16G  2.9G  85% /
/dev/cciss/c0d0p6     209G  174G   25G  88% /home
/dev/cciss/c0d0p5      15G  4.5G  9.1G  33% /usr
/dev/cciss/c0d0p1      99M   25M   69M  27% /boot
tmpfs                 7.7G   16M  7.7G   1% /dev/shm
//file-server/test    420G  129G  291G  31% /mnt/TimeSheets
[root@erpapp1 TimeSheets]#

[root@erpapp1 TimeSheets]# cd /mnt/TimeSheets
[root@erpapp1 TimeSheets]# ls
setup.msi
[root@erpapp1 TimeSheets]#



Regards,
Mohamed

Friday, November 16, 2012

Recreating Temporary Tablespace

1- Check existing temp tablespaces:

SQL> SELECT tablespace_name, file_name, bytes FROM dba_temp_files;

TABLESPACE_NAME            FILE_NAME                      BYTES
------------------------------ --------------------------------------------- ----------
TEMP1                   /Oracle/TEST/db/apps_st/data/temp01.dbf         2097152000
TEMP2                   /Oracle/TEST/db/apps_st/data/temp02.dbf         2097152000

SQL>

2- Check what is the default Temp Tablespace:


SQL> select PROPERTY_NAME,PROPERTY_VALUE from database_properties where property_name like '%TEMP%';

PROPERTY_NAME               PROPERTY_VALUE
------------------------------ ------------------------------
DEFAULT_TEMP_TABLESPACE        TEMP

SQL>

 
- Check if the assigned default tablespace is a tablespace or a temporary tablespace group! in the above example "TEMP" is a temporary tablespace group.

3- Create new Temporary Tablespace Tempo:


SQL> CREATE TEMPORARY TABLESPACE TEMPO TEMPFILE  '/oracle/PROD/db/apps_st/data/tempo.dbf' SIZE 3000M;

4- Change the default Temp Tablespace to be tempo tablespace:


SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE tempo;

5- Drop the old Temporary tablespaces:


> If the old temporary tablespaces are being used by some active sessions, the drop command will hang till the sessions that using those tablespaces were stopped:

-  Check the session that is currently use temporary tablespaces V$SORT_USAGE:

SQL> SELECT USERNAME,SESSION_NUM,TABLESPACE FROM V$SORT_USAGE;

-  If you decided to kill those sessions then you can do the following:

a) SQL> SELECT SID, SERIAL#, STATUS,STATE FROM V$SESSION WHERE SERIAL#=&SESSION_NUM;

b) Terminate unwanted sessions:
 
 SQL> ALTER SYSTEM KILL 'SID,SERIAL#';

c) Drop temp tablespace

SQL> DROP TABLESPACE temp1 INCLUDING CONTENTS AND DATAFILES;SQL> DROP TABLESPACE temp2 INCLUDING CONTENTS AND DATAFILES;

6- Recreate Temporary Tablespaces:


SQL> CREATE TEMPORARY TABLESPACE TEMP1 TEMPFILE '/oracle/PROD/db/apps_st/data/temp01.dbf' SIZE 6000M AUTOEXTEND ON NEXT 100M MAXSIZE unlimited EXTENT MANAGEMENT LOCAL;
 
SQL> CREATE TEMPORARY TABLESPACE TEMP2 TEMPFILE '/oracle/PROD/db/apps_st/data/temp02.dbf' SIZE 6000M AUTOEXTEND ON NEXT 100M MAXSIZE unlimited EXTENT MANAGEMENT LOCAL;

7- Add the Tablespaces to a temporary tablespace group


SQL> ALTER TEMPORARY TABLESPACE temp1 TABLESPACE GROUP TEMP;SQL> ALTER TEMPORARY TABLESPACE temp2 TABLESPACE GROUP TEMP;

- Check that both tablespaces were assigned to the group:
SQL> select * from DBA_TABLESPACE_GROUPS;

- If you need to remove the tablespace from the group use:
SQL> ALTER TEMPORARY TABLESPACE temp1 TABLESPACE GROUP '';

8- Change the default tablespace back again to it's original value:


SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp;

9- Drop the tempo tablespace:

SQL> DROP TABLESPACE tempo INCLUDING CONTENTS AND DATAFILES;

Regards,
Mohamed

Sunday, June 03, 2012

Setup a remote shared folder and configure SAMBA

Server side:

1
    Edit /etc/exports, add one line to the file for each directory to be exported:
      directory hostname(options) hostname2(options)
            directory is an absolute path to a local directory you wish to export
            hostname is the name or IP address of the client if you wish to restrict access or * if no restrictions
            options: see man exports for all options for example ro, rw...
2
    Force the nfs server daemons to reread /etc/exports: exportfs -ra

Client side

1
    Create a mount point: mkdir /mnt/remotefs
2
    Mount the NFS export: mount -t nfs <server name or ip address>:/exportedDir /mnt/remotefs
3
    Use the remote filesystem as if it were local by accessing /mnt/remotefs: ls /mnt/remotefs

Example:
========
On The server side:

[root@erpdb01 /]# cat /etc/exports
/Test erpmt01(rw,sync,no_subtree_check,no_root_squash)
[root@erpdb01 /]#
[root@erpdb01 Test]# exportfs -ra

> system-config-services mark the service "nfs" to start automatically with the OS.
[root@erpdb01 Test]# service nfs start
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
[root@erpdb01 Test]#

On the client side:

[root@erpmt01 /]# mkdir /mnt/remotefs
[root@erpmt01 /]# cd /mnt/remotefs
[root@erpmt01 remotefs]# ls
[root@erpmt01 remotefs]#

[root@erpmt01 /]# mount -t nfs erpdb01:/Test /mnt/remotefs
[root@erpmt01 /]#
[root@erpmt01 /]# cd /mnt/remotefs/
[root@erpmt01 remotefs]# ls
Clone_Files  db
[root@erpmt01 remotefs]#

###################################

Configure SAMBA:
================
- Create the user that will be used to access the files from windows...
system-config-users
username: HR
> system-config-services mark the service "smb" to start automatically with the OS.
> system-config-samba:
Add user:
Unix User: HR
Windows User: HR
password: manhr
Add share:
- Basic
Directory: /Test
Share name: images
select (writable,visible)
- Access
Only allow access to specific users
HR

Sunday, March 25, 2012

How to change Oracle applications 11i/R12passwords using FNDCPASS:

Based on Note:159244.1

NOTE 1: FNDCPASS should be run from the database tier to prevent encryption issues.

- Issue the commands at the Unix command line similar to the following:
    >> To change the APPS and APPLSYS passwords:
    FNDCPASS apps/apps 0 Y system/manager SYSTEM APPLSYS <new password>
    Ex: FNDCPASS apps/apps 0 Y system/manager SYSTEM APPLSYS NEWPASSWORD

>> Restart Concurrent manager services.

NOTE 2: Changing the APPLSYS password automatically changes the APPS password to match as these two must always agree.

    >> To change an Oracle user password:
    FNDCPASS apps/apps 0 Y system/manager ORACLE <oracle user> <new
    password
    Ex: FNDCPASS apps/apps 0 Y system/manager ORACLE GL GLPASSWORD

NOTE 3: Altering the ORACLE User name (schemas) passwords with FNDCPASS without first updating the APPS/APPLSYS password with FNDCPASS will cause the ORACLE User password to be undecodable by Applications.
Use FNDCPASS to "refresh" the APPS/APPLSYS password, even if it is to the same value.

    >> To change an application user password:
    FNDCPASS apps/apps 0 Y system/manager USER  <username>  <password>
    Ex: FNDCPASS apps/apps 0 Y system/manager USER   VISION  WELCOME

NOTE 4: VERY IMPORTANT!! >> For 11i ONLY!
When changing the password for APPS it is important to manually change the APPS
password in the following files as well as necessary:


1. $ORACLE_HOME/listener/cfg/wdbsvr.app file as well. (Otherwise users will not
be able to login to the Personal Home Page or Self-service web apps.) This may also be necessary in the $IAS_ORACLE_HOME\Apache\modplsql\cfg\wdbsvr.app file
 
2. Workflow Notification Mailer - $FND_TOP/resource/wfmail.cfg

3. The concurrrent manager start script.

4. $OA_HTML/bin/appsweb.cfg

5. $AD_TOP/admin/template/CGIcmd.dat may contain the password if it is being
used.
(Please refer to Note 159033.1 How to Setup Oracle Reports in Portal to Use
CGICMD.DAT File)

6. If your instance is Multi-node and Autoconfig enabled, it may be necessary to invoke Autoconfig to implement the above changes.

Regards,
Mohamed
How to mount NTFS media on oracle Linux 5.5:
========================================================
> If you already have the needed packages installed:

[root@ebsdb01 /]# mount -t ntfs-3g /dev/sde1 /u01 -o force
$LogFile indicates unclean shutdown (0, 0)
WARNING: Forced mount, reset $LogFile.
[root@ebsdb01 /]#

 
> If this is your first time to use NTFS on this OS:

Needed tar files have been uploaded to 4shared:
As the "root" user do:

mkdir /mnt/ntfs; cd /mnt/ntfs

tar xzf fuse-2.7.1.tar.gz

cd fuse-2.7.1;./configure --exec-prefix=/; make; make install

cd ..;tar xzf ntfs-3g-1.1120.tgz

cd ntfs-3g-1.1120;./configure; make; make install

Then:

fdisk -l  => check for your media

Mount your NTFS media:

mount -t ntfs-3g /dev/sde1 /mnt/ntfs/
Which responsibilities assigned to which users:
==================================================
- To get the list of users who assigned certain responsibility use the below query

SELECT furga.user_id
, fu.user_name
, furga.responsibility_id
, frtl.responsibility_name
, furga.responsibility_application_id
, fa.application_short_name
, furga.security_group_id
, fsg.security_group_key
, furga.start_date
, furga.end_date
, furga.created_by
, fucb.user_name
, furga.creation_date
, furga.last_updated_by
, fulub.user_name
, furga.last_update_date
, furga.last_update_login
, fulul.user_name
FROM
fnd_user_resp_groups_all furga,
fnd_user fu,
fnd_user fucb,
fnd_user fulub,
fnd_user fulul,
fnd_application fa,
fnd_responsibility_tl frtl,
fnd_security_groups fsg
WHERE
upper(frtl.responsibility_name) like upper ('%&resp_name%')
and fu.end_date is null    -- user is active
and furga.end_date is null  -- responsibility not end dated for the user.
and furga.user_id = fu.user_id (+)
and furga.created_by = fucb.user_id (+)
and furga.last_updated_by = fulub.user_id (+)
and furga.last_update_login = fulul.user_id (+)
and furga.responsibility_application_id = fa.application_id (+)
and furga.responsibility_id = frtl.responsibility_id (+)
and furga.security_group_id = fsg.security_group_id (+)
ORDER BY start_date;

Regards,
Mohamed

Tuesday, March 20, 2012


How to change IP address for Oracle E-business EBS 11i/R12 server:

- Make sure that your EBS instance services are cleanly down.

1- Change the IP at the OS level

2- Ping the server name and ensure you are pinging the new IP

ping <server_name>  (it should show the new IP) => Otherwise make sure that your entries in /etc/hosts file matches the new IP

3- Start the DB listener

lsnrctl start $ORACLE_SID

4- Start the DB

SQL> startup

select NODE_NAME, STATUS, NODE_MODE, NODE_ID,SERVER_ADDRESS, HOST, DOMAIN, WEBHOST, VIRTUAL_IP from fnd_nodes where node_name = upper('hostname');

eg.

SQL> select NODE_NAME, STATUS, NODE_MODE, NODE_ID,SERVER_ADDRESS, HOST, DOMAIN, WEBHOST, VIRTUAL_IP from apps.fnd_nodes where node_name = upper('erptestdb02');

NODE_NAME     S N    NODE_ID SERVER_ADDRES HOST     DOMAIN         WEBHOST               VIRTUAL_IP
------------- - - ---------- ------------- ------------ ---------------- ----------------------------- ---------------
ERPTESTDB02   Y O    8120 10.30.10.176  erptestdb02    rsteel.com erptestdb02.rsteel.com  erptestdb02


5- De-register the server which has the new IP:

Run the following command to remove the old IP address from Oracle Applications tables:

a- As the OS owner on the affected node run:

perl $AD_TOP/bin/adgentns.pl appspass=apps contextfile=$CONTEXT_FILE -removeserver

Then,

b- connect to sqlplus as apps user
c- Locate the System Name :
    The System name is the database name

select DB_NAME from FND_DATABASES;
        

d- Locate the server name corresponding to the tier in question :

    Query on the server :

        select NAME, SERVER_TYPE from FND_APP_SERVERS, FND_NODES
        where FND_APP_SERVERS.NODE_ID = FND_NODES.NODE_ID and
        SERVER_TYPE='DB' and FND_NODES.NODE_NAME=upper('hostname');
 eg.
col name for a30
select NAME, SERVER_TYPE 
from FND_APP_SERVERS, FND_NODES
where FND_APP_SERVERS.NODE_ID = FND_NODES.NODE_ID 
and SERVER_TYPE='DB' 
and FND_NODES.NODE_NAME=upper('erptestdb02');
        
SQL>

NAME                   SERVER_TYPE
------------------------------ ------------------------------
erptestdb02_STAGE8_DB           DB

SQL>

e- Run the following PL/SQL block :

begin
   FND_NET_SERVICES.remove_server('<SYSTEM_NAME>','<SERVER_NAME>');
end;
/
       
commit;

eg.

SQL> begin
FND_NET_SERVICES.remove_server('STAGE8','ERPTESTDB02_STAGE8_APPS');
end;
/

PL/SQL procedure successfully completed.

SQL> commit;

Commit complete.

SQL> select NAME, SERVER_TYPE from apps.FND_APP_SERVERS, apps.FND_NODES
where FND_APP_SERVERS.NODE_ID = FND_NODES.NODE_ID and
     SERVER_TYPE='APPS' and FND_NODES.NODE_NAME=upper('erptestdb02');

no rows selected

SQL>


6- Run autoconfig to populate the new IP Address


a- Ensure you can connect as apps/apps from the affected node.
b- Run AC as the DB file owner - oruser.
    $ORACLE_HOME/appsutil/bin/adconfig.sh
c- Run AC as the MT file owner - apuser.
    $AD_TOP/bin/adconfig.sh
d- Source your newly updated environment files inside your shell terminal. 
    - DB-Tier Environment. ($ORACLE_HOME/$CONTEXT_NAME.env)
    - MT-Tier Environment. ($APPL_TOP/APPS$CONTEXT_NAME.env)

7- Confirm the IP address has been changed to the new value changed in step 1:


select NODE_NAME, STATUS, NODE_MODE, NODE_ID,SERVER_ADDRESS, HOST, DOMAIN, WEBHOST, VIRTUAL_IP from apps.fnd_nodes where node_name = upper('erptestdb02');

eg.

SQL> select NODE_NAME, STATUS, NODE_MODE, NODE_ID,SERVER_ADDRESS, HOST, DOMAIN, WEBHOST, VIRTUAL_IP from apps.fnd_nodes where node_name = upper('erptestdb02');

NODE_NAME     S N    NODE_ID SERVER_ADDRES HOST     DOMAIN         WEBHOST               VIRTUAL_IP
------------- - - ---------- ------------- ------------ ---------------- ----------------------------- ---------------
ERPTESTDB02   Y O    8120 10.30.11.176  erptestdb02    rsteel.com erptestdb02.rsteel.com  erptestdb02

SQL>

8- Start MT services and do your health check.

            

- Issues you may face:

> Autoconfig may fail with the following error:
 ...
Updating s_tnsmode to 'generateTNS'
UpdateContext exited with status: 0
AC-50480: Internal error occurred: java.lang.Exception: Error while generating listener.ora.
Error generating tnsnames.ora from the database, temporary tnsnames.ora will be generated using
templates
Instantiating Tools tnsnames.ora
Tools tnsnames.ora instantiated
Web tnsnames.ora instantiated

adgentns.pl exiting with status 512
ERRORCODE = 512 ERRORCODE_END

...

Solution


1. Open a new shell and source the APPS Environment. ($APPL_TOP/APPS<SID>_<HOST>.env)

2. Start "sqlplus" and execute following commands :
$ sqlplus apps/<Password>
SQL> exec fnd_conc_clone.setup_clean

3. Open a new terminal or shell and source the DB-Tier Environment. ($ORACLE_HOME/$CONTEXT_NAME.env)

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

5. Switch back to the APPS environment or start a new shell and source the APPS environment. ($APPL_TOP/APPS$CONTEXT_NAME.env)

6. Execute Autoconfig at the Apps Tier. ($AD_TOP/bin/adconfig.sh)

7. Check the Autoconfig log for any errors and ensure that the services start correctly.

Regards,
Mohamed






Monday, February 27, 2012

Beliefs of Islam:


There are six basic beliefs shared by all Muslims:
  1. Belief in God, the one and only one worthy of all worship.
  2. Belief in the Angels.
  3. Belief in all the Books (al-Quran / The Bible / ) (sent by God).
  4. Belief in all the Prophets and Messengers (sent by God).
  5. Belief in the Day of Judgment (Qiyamah) and in the Resurrection.
  6. Belief in Fate (Qadar).
What do you know about Islam? Do you really know what you should know?



Spend some time to get a clear image.....


If you found this helpful, please leave your comments..