Archive for the ‘TEChNoLoGY’ Category

Commonly used ILOM commands

December 27th, 2022, posted in Oracle, Solaris
Share

Integrated Lights-out Manager (ILOM) helps to manage and troubleshoot the complete hardware of a server. With the help of ILOM we can remotely manage a server. We can power on and power off it remotely. Let us see some of the most commonly used commands in the ILOM shell.

 

Login related commands

-> start /SP/console        -- start the SP-console
-> show /SP/sessions        -- see the currently active sessions
-> stop /SP/console         -- to stop any user session

Start and stop system

-> start /SYS                            (start system)  
-> stop [-force] /SYS                    (stop system)
-> show /SYS                             (shows the power status)
-> reset /SYS                            (reset host)
-> reset /SP                             (reset ILOM SP)
-> set /HOST send_break_action=break     (send break signal to the OS)
-> reset /CMM                            (to reset CMM on a blade Chassis)

 

Locator commands

To set the locator on or off

-> set /SYS LOCATE=on
-> set /SYS LOCATE=off

Networking Commands

To see the current network configuration of ILOM

-> show /SP/network

To set an IP address for ILOM

-> set pendingipdiscovery=static 
-> set pendingipaddress=10.10.10.10
-> set pendingipnetmask=255.255.255.0
-> set pendingipgateway=10.10.10.1
-> set commitpending=true

To show SP MAC address

show /SP/network macaddress

If on a Blade chassis, to check the CMM IP :

-> show /CMM/network

User administration

-> show /SP/users                  (Display all the ILOM users)
-> show /SP/user/admin             (Display configuration settings of a specific user)
-> create /SP/users/user_name password=PWD role=[administrator|operator]    (create new user)
-> delete /SP/users/username       (Delete a user)
-> set /SP/users/admin01 role=administrator           (set the role of a user)
-> set /SP/users/admin01           (set or change password of user)

Monitoring and logs

-> show /SP/logs/event/list     (ILOM event log)
-> show -level all -output table /SP/faultmgmt     (List all hardware faults)
-> show -level all -output table /SYS type==Temperature value       (List all temperature sensor readings)

Hardware info

-> show -level all -output table /SYS type==DIMM                (show DIMMS)
-> show -level all -output table /SYS type=='Host Processor'    (show CPUs)
-> show -l all /SYS type=='Hard Disk'                           (show disks)

 

Share

VNC Server On Solaris

November 6th, 2022, posted in Solaris
Share
for S11_u10:
pkg publisher -P
pkg install solaris-desktop


Path should be :

PATH=$PATH:/usr/X11/bin
PATH=$PATH:/usr/openwin/bin
export PATH
Share

How To Get Last Record From The Table In Oracle Sql

October 30th, 2022, posted in Oracle Queries
Share

select * from (
  select * from oe_order_headers_all
   order by creation_date desc
  )
 where rownum = 1;

Share

AP_SUPPLIERS , AR_CUSTOMERS DETAILS QUERY IN ORACLE APPS R12

October 16th, 2022, posted in Oracle Queries
Share
AP_SUPPLIERS MASTER DETAILS QUERY:-
*****************************************

select  a.SEGMENT1 vendor_code,    
       b.VENDOR_ID,
       a.VENDOR_NAME,
       b.VENDOR_SITE_ID,
       (select organization_id
         from hr_operating_units
        where organization_id=b.ORG_ID
       )ou_id,
        (select name
         from hr_operating_units
        where organization_id=b.ORG_ID
       )operating_name,
       b.VENDOR_SITE_CODE,
       (b.ADDRESS_LINE1||b.ADDRESS_LINE2||b.ADDRESS_LINE3||b.CITY||b.STATE||b.ZIP) address,
       null GST_REGISTRATION_NO,    
       c.PAN_NO,
       b.state
  from ap_suppliers a,
     ap_supplier_sites_All b,
     JAI_AP_TDS_VENDOR_HDRS c,
     JAI_CMN_VENDOR_SITES d
where a.vendor_id=b.vendor_id
  and b.VENDOR_ID=c.vendor_id(+)
  and b.VENDOR_SITE_ID=c.VENDOR_SITE_ID(+)
  and b.VENDOR_ID=d.vendor_id(+)
  and b.VENDOR_SITE_ID=d.VENDOR_SITE_ID(+)
   AND (NVL(A.ENABLED_FLAG,'N')='Y' OR NVL(D.INACTIVE_FLAG,'N') <> 'N')
  and b.INACTIVE_DATE is  null
  and a.end_date_active is null
  AND A.SEGMENT1 = 'PRMAAA1'
 order by a.VENDOR_NAME,b.VENDOR_SITE_CODE,b.ORG_ID

AR_CUSTOMERS MASTER DETAILS QUERY:-
**********************************************

select hp.party_number customer_number,
       hca.cust_account_id customer_id,
       hp.party_name customer_name,
       hca.account_number customer_account_number,
       hcas.org_id ou_id,
       (select name from hr_operating_units where organization_id = hcas.org_id) operating_unit_name,
       HCAS.PARTY_SITE_ID CUSTOMER_SITE_ID,
        HPS.PARTY_SITE_NUMBER CUSTOMER_SITE_NUMBER,
       (   HL.ADDRESS1
        || HL.ADDRESS2
        || HL.ADDRESS3
        || HL.ADDRESS4
        || HL.CITY
        || HL.POSTAL_CODE)
          ADDRESS,
       NULL GST_REGISTRATION_NO,
       jac.PAN_NO PAN_NO,
       hl.state,
       HP.PARTY_TYPE CUSTOMER_TYPE
from hz_cust_acct_sites_all hcas,
              hz_cust_accounts_all hca,
              hz_parties hp,
              hz_party_sites hps,
              hz_locations hl,
              JAI_CMN_CUS_ADDRESSES jac
where 1=1
--and hca.account_number = 'RDAAAG2'
and hca.cust_account_id = hcas.cust_account_id
and hca.party_id = hp.party_id
and hcas.party_site_id = hps.party_site_id
and hca.party_id = hps.party_id
and hps.location_id = hl.location_id
and jac.address_id(+) = hcas.CUST_ACCT_SITE_ID
order by customer_name
Share

Find And Delete Files Older Than Some Particular Time Period In Linux

October 9th, 2022, posted in Solaris
Share

Searching By File Timestamp

Unix/Linux filesystems have three types of timestamp on each file. They are as follows:

  1. Access time (-atime): The timestamp when the file was last accessed.
  2. Modification time (-mtime): The timestamp when the file was last modified.
  3. Change time (-ctime): The timestamp when the metadata for a file (such as permissions or ownership) was last modified.

 

Search and delete file older than 7 days

Lets take an example, wherein we will find and delete file older than 7 days. We will be using the option “-mtime” of the find command for this.

1. Get a list of files using find command as follows:

# find /path_to_directory -mtime +7 -type f -exec ls {}\;

2. If the filenames start with any particular pattern, filter using that as follows:

# find /path_to_directory -name 'filenamepattern*' -mtime +7 -type f -exec ls {}\;

3. After checking and confirming the output, go for removal script(It is very IMPORTANT), otherwise there will be irrecoverable data loss.

# find /path_to_directory -name 'filenamepattern*' -mtime +7 -type f -exec rm -fv {}\;

# find . -name “*.pdf” -atime +7 -exec rm {} \;

4. If this needs to be done on a remote server through cron job and log the filenames of deleted files, use the following command

# ssh user@remote_ip "find /path_to_directory -name 'filenamepattern*' -mtime +7 -type f -exec rm -fv {} \; >> /tmp/backup_deletion`date +%Y%m%d`.log 2>&1"

 

Conclusion

The -mtime parameter will search for files based on the modification time; -ctime searches based on the change time. The -atime, -mtime, and -ctime use time measured in days. The find command also supports options that measure in minutes. These are as follows:

  1. -amin (access time)
  2. -mmin (modification time)
  3. -cmin (change time)

For example, to print all the files that have an access time older than seven minutes, use the following command:

# find . -type f -amin +7 -print

-newer option

The -newer option specifies a reference file with a modification time that will be used to select files modified more recently than the reference file.

Find all the files that were modified more recently than file.txt file:

# find . -type f -newer file.txt -print
Share