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

For Any queries, please mail us at support@funoracleapps.com

How to Set or Change the Time Zone in Linux Server

How to Set or Change the Time Zone in Linux Server


1. Check  the Current Time Zone

timedatectl
  
  Local time: Mon 2020-07-06 22:22:40 +08
  Universal time: Mon 2020-07-06 14:22:40 UTC
        RTC time: Mon 2020-07-06 14:22:40
       Time zone: Asia/Singapore (+08, +0800)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: n/a

The output above shows that the system’s time zone is set to Singapore.

The system time zone is configured by a link i.e. /etc/localtime file to a binary time zone’s identifier in the /usr/share/zoneinfo directory.

$ ls -l /etc/localtime
lrwxrwxrwx 1 root root 36 Jul  6 22:03 /etc/localtime -> ../usr/share/zoneinfo/Asia/Singapore

2. Change  the Time Zone Now

Make sure to identify the exact time zone which needs to be set in Region/City format.

To view all available time zones, use the timedatectl command or list the files in the /usr/share/zoneinfo directory:

# timedatectl list-timezones

America/Montserrat
America/Nassau
America/New_York
America/Nipigon
America/Nome
America/Noronha


Run Command
sudo timedatectl set-timezone America/New_York
or  doing in UTC then

sudo timedatectl set-timezone UTC

To verify the change, invoke the timedatectl command again:


timedatectl
                    Local time: Mon 2020-07-06 14:28:53 UTC
  Universal time: Mon 2020-07-06 14:28:53 UTC
        RTC time: Mon 2020-07-06 14:28:53
       Time zone: UTC (UTC, +0000)
     NTP enabled: no
NTP synchronized: yes
 RTC in local TZ: yes
      DST active: n/a

--------------------------------------------------------------------------

We can also change Time Zone by Creating a Symlink(Especially used in old system)

If you are running an older Linux distribution and the timedatectl utility is not present on your system, you can change the timezone by symlinking /etc/localtime to the time zone in the /usr/share/zoneinfo directory.

Remove the current symlink or file:

sudo rm -rf /etc/localtime or  sudo unlink /etc/localtime 

Identify the timezone you want to configure and create a symlink:

sudo ln -s /usr/share/zoneinfo/UTC /etc/localtime

Verify the /etc/localtime file 

 ls -l /etc/localtime
lrwxrwxrwx. 1 root root 25 Jul  6  2020 /etc/localtime -> ../usr/share/zoneinfo/UTC

Query to find OPP database session details

Query to find OPP database session details






Query:

select s.ECID ,s.inst_id, s.SID,s.SERIAL#,p.spid,s.status,s.machine, s.ACTION, s.MODULE, s.TERMINAL,s.sql_id,s.last_call_et,s.event, s.client_info,s.PLSQL_SUBPROGRAM_ID,s.PROGRAM,s.client_identifier
, ( SELECT max( substr( sql_text , 1, 40 )) FROM gv$sql sq WHERE sq.sql_id = s.sql_id ) AS sql_text
, ( SELECT object_name FROM dba_procedures WHERE object_id = plsql_entry_object_id AND subprogram_id = 0) AS plsql_entry_object
, ( SELECT procedure_name FROM dba_procedures WHERE object_id = plsql_entry_object_id AND subprogram_id = plsql_entry_subprogram_id) AS plsql_entry_subprogram
, ( SELECT object_name FROM dba_procedures WHERE object_id = plsql_object_id AND subprogram_id = 0) AS plsql_entry_object
, ( SELECT procedure_name FROM dba_procedures WHERE object_id = plsql_object_id AND subprogram_id = PLSQL_SUBPROGRAM_ID) AS plsql_entry_subprogram
, 'alter system kill session ' || '''' || s.SID || ',' || s.serial# ||',@'|| s.inst_id||''''|| ' immediate;' kill_session
from gv$session s ,gv$process p
where
s.module like '%OPP%'
and p.addr=s.paddr
and p.inst_id = s.inst_id

Query to find the OPP Actual and Target Process

Query to find the OPP Actual and Target Process

Query:


   SELECT b.user_concurrent_queue_name "Concurrent Manager", b.target_node "Node", a.running_processes "Actual Processes", a.max_processes "Target Processes"
    FROM apps.fnd_concurrent_queues a, apps.fnd_concurrent_queues_vl b
   WHERE a.concurrent_queue_id = b.concurrent_queue_id
    AND a.concurrent_queue_name = 'FNDCPOPP' ;

SQL*Loader-128: unable to begin a session ORA-01017: invalid username/password; logon denied

SQL*Loader-128: unable to begin a session ORA-01017: invalid username/password; logon denied


When running SQL loader concurrent request, we are seeing below error.

Error:

SQL*Loader-128: unable to begin a session
ORA-01017: invalid username/password; logon denied

SQL*Loader: Release 10.1.0.5.0 - Production on Wed Jun 24 14:08:27 2020

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

SQL*Loader-128: unable to begin a session
ORA-01017: invalid username/password; logon denied


Program exited with status 1
Concurrent Manager encountered an error while running SQL*Loader for your concurrent request 57822615.


Cause:

Service Manager logfile (for all managers started by FNDSM). This causes FNDSM log to grow to enormous size 2 GB

$ du -sh FNDSM2342760.mgr
2.1G    FNDSM2342760.mgr


Workaround:

Workaround 1: Restart Concurrent Managers

Workaround 2: Take backup of the file and nullify the file to reduce the size.

$ >FNDSM2342760.mgr


Also you can refer below Oracle Doc for more details and other solution

Concurrent Requests fail with SQL*Loader-101: Invalid Argument for username/password (Due to FNDSM Log File Size Grows 2 GB ) (Doc ID 1542216.1)



Error in DB Tier Auto Config (java.lang.UnsatisfiedLinkError: libnjni11.so: libnjni11.so: wrong ELF class: ELFCLASS64)

Error in DB Tier Auto Config (java.lang.UnsatisfiedLinkError: libnjni11.so: libnjni11.so: wrong ELF class: ELFCLASS64)


After upgrading EBS database to 11GR2, we can encounter error while running autoconfig on the DB node 

Error:

java.lang.UnsatisfiedLinkError: /d11/oracle/TEST/db/tech_st/11.2.0/lib/libnjni11.so: /d11/oracle/TEST/db/11.2.0/lib/libnjni11.so: wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)

Solution :

To fix this issue, Edit the database node xml as below and re-run the autoconfig.

 <JDK_TOP oa_var="s_jdktop">/d11/oracle/TEST/db/tech_st/11.2.0/appsutil/jre</JDK_TOP>
 <JRE_TOP oa_var="s_jretop">/d11/oracle/TEST/db/tech_st/11.2.0/appsutil/jre</JRE_TOP>

update to 

 <JDK_TOP oa_var="s_jdktop">/d11/oracle/TEST/db/tech_st/11.2.0/jdk/jre</JDK_TOP>
 <JRE_TOP oa_var="s_jretop">/d11/oracle/TEST/db/tech_st/11.2.0/jdk/jre</JRE_TOP>



Important Note:
----
From 11gR2 DB version onwards AutoConfig on DB node uses the JRE from <Oracle_Home>/jdk/jre where as earlier versions of DB uses JRE from $ORACLE_HOME/appsutil/jre

Downgrading Oracle Database Without Executing catdwgrd.sql or Backup plan to downgrade oracle db

Downgrading Oracle Database Without Executing catdwgrd.sql or Backup plan to downgrade


When we are upgrading the database, we need to ensure that we have a backup plan to downgrade in case of failure. We can create a guaranteed  restore point.

My Source version: 10.2.0.4
Target version to upgrade 11.2.0.3

Configure Flashback database in the Source version

The Flashback Database feature provides a way to quickly revert entire Oracle database to the state it was in at a past point in time.

To use the Flashback database feature the database must be running in archivelog mode.

Enable flashback feature in the database when it was running in the source release.

Set the environment variables to point to the source Oracle Home (10.2.0.4) and perform a 'startup mount'

SQL> startup mount
ORACLE instance started.

Total System Global Area  918552576 bytes
Fixed Size                  2025072 bytes
Variable Size             239077776 bytes
Database Buffers          675282944 bytes
Redo Buffers                2166784 bytes
Database mounted.

Turn on flashback

SQL> alter database flashback on;

Database altered

Create guaranteed restore point

SQL> CREATE RESTORE POINT before_upgrade GUARANTEE FLASHBACK DATABASE;

Restore point created.

Run the following query to view all guaranteed restore points created.

SQL> SELECT NAME, SCN, TIME, DATABASE_INCARNATION# DI,GUARANTEE_FLASHBACK_DATABASE,
     STORAGE_SIZE FROM V$RESTORE_POINT WHERE GUARANTEE_FLASHBACK_DATABASE='YES';

NAME             SCN     TIME                 DI         GUA     STORAGE_SIZE
----------       --- ------------       -------------    ---    ------------
BEFORE_UPGRADE  34552155 23-JUN-20  10.58.42.000000000 AM  YES    312672256

Query the dba_registry view to see the component status and version before upgrade

SQL> select comp_name, status, version from dba_registry;

COMP_NAME
--------------------------------------------------------------------------------
STATUS      VERSION
----------- ------------------------------
Oracle Database Catalog Views
VALID       10.2.0.4.0

Oracle Database Packages and Types
VALID       10.2.0.4.0


Shutdown the database

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
 

Upgrade the database to the target version(Dont change compatibility parameter to higher version while upgrade)

Set the environment variables to point to the target Oracle Home (11.2.0.4) to which the database will be upgraded to.

compatible-10.2.0.4

Please note that changing COMPATIBLE initialization parameter at this stage will prevent use of the downgrade procedure or the ability to flash back the database to a point prior to this.

Startup the database in upgrade mode using the 11.2.0.4 Oracle Home

SQL> startup upgrade (using 11.2.0.4 Oracle Home)
ORACLE instance started.

Total System Global Area  918552576 bytes
Fixed Size                  2077008 bytes
Variable Size             234884784 bytes
Database Buffers          675282944 bytes
Redo Buffers                6307840 bytes
Database mounted.
Database opened.

Run the upgrade script (catupgrd.sql)

SQL> @?/rdbms/admin/catupgrd.sql


Validate any invalid objects after upgrade if any

SQL> @?/rdbms/admin/utlrp.sql

Query the dba_registry view to see the component status and version after upgrade

SQL> select comp_name, version, status from dba_registry;

COMP_NAME
--------------------------------------------------------------------------------
VERSION STATUS
------------------------------ -----------
Oracle Database Catalog Views
11.2.0.4.0 VALID

Oracle Database Packages and Types
11.2.0.4.0 VALID
 

Downgrading database to previous version using Flashback database

Note that data from any transactions that occur after the point in time to which the database is recovered are lost. Flashback Database is an excellent tool for backing out the database upgrade, Using Flashback Database with sufficient space and creating a guaranteed restore point immediately prior to the upgrade is the fastest method to fallback as compared to a restore operation or a database downgrade.

Using flashback database rather than the conventional downgrade procedure is far quicker. This is only practical when only the database upgrade has been done and no application data changes have occurred.

The steps for flashing back the database after upgrade or after a failed upgrade are

Set the environment variables to the 11.2.0.4 Oracle Home

Shut down the upgraded database

SQL> shutdown immediate

Startup mount the 11.2.0.4 database using the 11.2.0.4 Oracle Home and flashback the database to the guaranteed restore point which was created prior to the upgrade.

SQL> startup mount

SQL> flashback database to restore point before_upgrade;

SQL> shutdown immediate

Set the environment variable to point to the old Oracle Home (10.2.0.4)

SQL> startup mount

SQL> alter database open resetlogs;

query the dba_registry view to see the database component status and version

SQL> select comp_name, version, status from dba_registry;

COMP_NAME
--------------------------------------------------------------------------------
VERSION STATUS
------------------------------ -----------
Oracle Database Catalog Views
10.2.0.4.0 VALID

Oracle Database Packages and Types
10.2.0.4.0 VALID



Query to find any Mview Refresh is going on currently in Oracle DB

Query to find any Mview Refresh is going on currently in Oracle DB


Query:

select s.obj#,o.obj#,s.containerobj#,lastrefreshdate,pflags,xpflags,o.name,o.owner#, bitand(s.mflags, 8)
from obj$ o, sum$ s
where o.obj# = s.obj# and o.type# = 42 AND bitand(s.mflags, 8) = 8;