Thursday, December 19, 2024

Function for fiscal year conversion to calendar year

 


CREATE OR REPLACE FUNCTION x_get_fiscal_to_calendar_date_fun (p_year NUMBER, p_period NUMBER)

RETURN VARCHAR2 IS

   v_date    DATE;

   v_result  VARCHAR2(8);

BEGIN

   -- Calculate the first day of the month based on the year and period

   v_date := ADD_MONTHS(TO_DATE(p_year || '-7', 'YYYY-MM'), p_period - 1);

   

   -- Format the result as YYYY-MON

   v_result := TO_CHAR(v_date, 'YYYY-MM');

   

   RETURN v_result;

EXCEPTION

   WHEN OTHERS THEN

      RETURN NULL; -- Handle exceptions if any

END;

/

Wednesday, December 11, 2024

How to Oracle RAC DB will into Mount stage? How to Enable & Disable Archiving into Oracle RAC?

How to Oracle RAC DB will into Mount stage?
How to Enable & Disable Archiving into Oracle RAC?


Ans: We can use normal db command for this but when are using RAC ... we have to use specific command which is being use into Oracle RAC

1) Check Current Archive Log Mode Status

Archive log list;

2) Shutdown the RAC database on each instance or simply shutdown from SRVCTL command:

srvctl stop database -d RACDB



3) Start the Oracle RAC Database in Mount Mode

srvctl start database -d RACDB -o mount


4) Set the following parameter used for enable archive log:
ENABLE
SQLPLUS / as sysdba
ALTER SYSTEM SET log_archive_dest_1='location=/u01/archive/' SCOPE=spfile;
ALTER SYSTEM SET log_archive_format='arch_%t_%s_%r.arc' SCOPE=spfile;
ALTER DATABASE ARCHIVELOG;

DISABLE
SQLPLUS / as sysdba
ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_1=defer SCOPE=SPFILE;
ALTER DATABASE NOARCHIVELOG;

6) Down & Up the Database

srvctl stop database -d RACDB
srvctl start database -d RACDB

How to install and configure Oracle Apex 24.1 with ORDS 22, Tomcat 9 and Jasper Report 7 on Oracle Linux 8.10

#########################Install Oracle  APEX 24.1################################ ----------------------------------------------------...