Saturday, 25 September 2021

𝗔𝗽𝗲𝘅 𝟮𝟭.𝟭 𝗔𝗽𝗽𝗹𝗶𝗰𝗮𝘁𝗶𝗼𝗻 𝗠𝗶𝗴𝗿𝗮𝘁𝗶𝗼𝗻 𝗙𝗿𝗼𝗺 𝘀𝗼𝘂𝗿𝗰𝗲 𝘁𝗼 𝗧𝗮𝗿𝗴𝗲𝘁 𝘀𝗲𝗿𝘃𝗲𝗿 (𝗢𝗻-𝗽𝗿𝗲𝗺𝗶𝘀𝗲 𝘁𝗼 𝗢𝗖𝗜 𝗖𝗹𝗼𝘂𝗱 𝗣𝗹𝗮𝘁𝗳𝗼𝗿𝗺)

                                                             ░APEX

𝐻𝑒𝓁𝓁𝑜 𝑒𝓋𝑒𝓇𝓎𝑜𝓃𝑒𝒜𝒻𝓉𝑒𝓇 𝒶 𝓂𝑜𝓃𝓉𝒽 𝑜𝒻 𝑔𝒶𝓅, 𝐼 𝒽𝒶𝓋𝑒 𝒹𝑒𝒸𝒾𝒹𝑒𝒹 𝓉𝑜 𝓈𝒽𝒶𝓇𝑒 𝒜𝓅𝑒𝓍 𝑀𝒾𝑔𝓇𝒶𝓉𝒾𝑜𝓃 𝓼𝓽𝓮𝓹𝓼 𝓌𝒾𝓉𝒽 𝒶𝓁𝓁 𝑜𝒻 𝓎𝑜𝓊.

𝐼 𝒽𝑜𝓅𝑒 𝒾𝓉 𝓌𝒾𝓁𝓁 𝒽𝑒𝓁𝓅 𝒶𝓁𝓁 𝑜𝒻 𝓎𝑜𝓊  𝒾𝓃 𝓎𝑜𝓊𝓇 𝓅𝓇𝑜𝒻𝑒𝓈𝓈𝒾𝑜𝓃𝒶𝓁 𝒸𝒶𝓇𝓇𝑒e𝓇 𝑒𝓋𝑒𝓃 𝒾𝒻 𝓎𝑜𝓊 𝒶𝓇𝑒 𝓃𝑜𝓉 𝒻𝒶𝓂𝒾𝓁𝒾𝒶𝓇 𝓌𝒾𝓉𝒽 "𝒜𝓅𝑒𝓍".

𝒮𝑜 𝓁𝑒𝓉'𝓈 𝓈𝓉𝒶𝓇𝓉 𝒻𝓇𝑜𝓂 𝒽𝑒𝓇𝑒..!!


Step 1:  Create backups of the APEX Workspaces and Applications

At First, Go to  $ORACLE_HOME/apex/utilities

 Take Workspace backup:

java oracle.apex.APEXExport -db hostname:PORT:SID -user <username> -password <password> -expWorkspace

 















 Take every application and shared component backup:

java oracle.apex.APEXExport -db hostname:Port:SID -user <username> -password <password> -instance





Step 2: On the Target Database Node 19C Create the Apex schema by Installing Apex

 

SQL> @apexins.sql tablespace_apex tablespace_files tablespace_temp images














Now, Change Apex Admin Password:














Step 3: Configuring Oracle REST Data Services

Sql> @apex_rest_config.sql



 




Install ORDS Service:

$ java -jar ords.war install advanced



Now, Import Apex workspaces and Application:

$ sqlplus "/as sysdba"

alter session set current_schema = APEX_210100;

--Run the scripts to create the workspaces..!!

In my case I have created one shell script and executed all at once.

SQL> @/orahome/oracle/PROD/19.3.0/software/apex/utilities/Apex_WFexport.sql

 

Session altered.

 

 

Session altered.

 

--application/set_environment

WORKSPACE 1368305965994364

Creating workspace PRODICS...

Creating Groups...

Creating group grants...

Creating Users...

...RESTful Services

SCHEMA PRODICS - User Interface Defaults, Table Defaults

User Interface Defaults, Attribute Dictionary

...done

--application/set_environment

WORKSPACE 6468418341304004

Creating workspace XXFMPROJ...

Creating Groups...

Creating group grants...

Creating Users...

...RESTful Services

SCHEMA XXFMPROJ - User Interface Defaults, Table Defaults

User Interface Defaults, Attribute Dictionary

...done

--application/set_environment

WORKSPACE 1247603809411412

Creating workspace EXCELVENA...

Creating Groups...

Creating group grants...

Creating Users...

...RESTful Services

SCHEMA APPS - User Interface Defaults, Table Defaults

SCHEMA XXFMIT - User Interface Defaults, Table Defaults

User Interface Defaults, Attribute Dictionary

...done


Apex URL: http://localhost:8080/ords/apex_admin























~~~~~If you liked my Post please share OR Comment....Thanks !!

Tuesday, 6 July 2021

𝗖𝗥𝗘𝗔𝗧𝗜𝗡𝗚 𝗦𝗡𝗔𝗣𝗦𝗛𝗢𝗧 𝗦𝗧𝗔𝗡𝗗𝗕𝗬 𝗗𝗔𝗧𝗔𝗕𝗔𝗦𝗘 𝗜𝗡 𝗘𝗕𝗦 𝗥𝟭𝟮 𝗔𝗡𝗗 𝗔𝗣𝗟𝗟𝗜𝗖𝗔𝗧𝗜𝗢𝗡 𝗦𝗔𝗡𝗜𝗧𝗬 𝗖𝗛𝗘𝗖𝗞..!!

In PRIMARY DB:

SQL> Alter system set log_archive_dest_state_2=DEFER scope=both;

 

In STANDBY DB:

SQL> Alter database recover managed standby database cancel;

 

>> Wait to clear RFS files in progress….!!

SQL> shu immediate;                                                        


SQL> startup mount;


  In DR (Standby):

$ cd $TNS_ADMIN

Change the ifile - ASCPOCI_ascpoci105_ifile.ora entry to open application in DR Instance.

ASCPOCI =

  (DESCRIPTION =

    (ADDRESS_LIST =

#      (ADDRESS = (PROTOCOL = TCP)(HOST = ascpoci25.co.in)(PORT = 1521)) 

      (ADDRESS = (PROTOCOL = TCP)(HOST = ascpoci105.co.in)(PORT = 1521))

    )

    (CONNECT_DATA =

      (SID = ASCPOCI)

    )

  )  


Note:- Primary host is ascpoci25.co.in (To open apps from DR we have to disable it and point to DR host)


In STANDBY DB (DR) Check the following parameters:




At First, Set the both db_recovery_file_dest parameters:









Convert to snapshot standby DB:








v  Now, login to application user.

         $ sqlplus apps/apps  [Use Source apps user password]

  • Run the below command to remove the Source Instance entries.

Note: After execution FND_CONC_CLEAN.SETUP_CLEAN >> COMMIT;
    


v  Run Autoconfig on DBTier  & APPS Tier:-

         $ cd /ascpoci/erp/12.1.0/appsutil/scripts/ASCPOCI_ascpoci105

          [oradev@vm4db DEV_vm4db]$  adautocfg.sh

          Enter the APPS user password:

    



v Start the Application tier.

                 $ cd $ADMIN_SCRIPTS_HOME

                 $ sh adstrtal.sh apps/<apps-password>

                                                      <weblogic-password

 

[ascpociappl@ascpoci105 ~]$ adopmnctl.sh status


You are running adopmnctl.sh version 120.0.12020000.2


Checking status of OPMN managed processes...


Processes in Instance: ASCPOCI_web_ASCPOCI_OHS1

---------------------------------+--------------------+---------+---------

ias-component                    | process-type       |     pid | status

---------------------------------+--------------------+---------+---------

ASCPOCI_web_ASCPOCI   | OHS                |   27620 | Alive



adopmnctl.sh: exiting with status 0

   

APPLICATION SANITY CHECK:

         v  Login as SYSADMIN to Application.

             Go to System administrator -> Concurrent Manager-> Submit a New Request->Single Request.

       



































































     v    Revert back to the Physical Standby database:

          At First, Stop the application service.

          $ cd $ADMIN_SCRIPTS_HOME

          $ adstpall.sh  apps/<apps-password>

                                 <weblogic-password>


   Now, Login to database as sysdba:

 [ascpocidb@ascpoci105 ~]$ sqlplus / as sysdba


 SQL> shu immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup mount;

ORACLE instance started.


Total System Global Area 3.7413E+10 bytes

Fixed Size                  2261048 bytes

Variable Size            1.1677E+10 bytes

Database Buffers         2.5636E+10 bytes

Redo Buffers               98385920 bytes

Database mounted.



SQL> alter database convert to physical standby;


Database altered.


SQL> shu immediate;

ORA-01507: database not mounted



ORACLE instance shut down.



SQL> startup mount;

ORACLE instance started.


Total System Global Area 1.0689E+10 bytes

Fixed Size                  2262656 bytes

Variable Size            1577060736 bytes

Database Buffers         9093251072 bytes

Redo Buffers               16900096 bytes

Database mounted.


SQL> select name,open_mode,database_role,protection_mode from v$database;


NAME      OPEN_MODE   DATABASE_ROLE       PROTECTION_MODE

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

ASCPOCI   MOUNTED     PHYSICAL STANDBY  MAXIMUM PERFORMANCE


   



Wednesday, 12 May 2021

𝘿𝙖𝙩𝙖 𝙂𝙪𝙖𝙧𝙙 𝙎𝙮𝙣𝙘𝙝𝙧𝙤𝙣𝙞𝙯𝙖𝙩𝙞𝙤𝙣 𝙘𝙝𝙖𝙣𝙜𝙚𝙨 𝙞𝙣 𝙙𝙞𝙛𝙛𝙚𝙧𝙚𝙣𝙩 𝙋𝙧𝙤𝙩𝙚𝙘𝙩𝙞𝙤𝙣 𝙈𝙤𝙙𝙚: 𝘾𝙤𝙢𝙥𝙡𝙚𝙩𝙚 𝙜𝙪𝙞𝙙𝙚 !!

                                ░D░a░t░a░ ░G░u░a░r░d░























Data Guard:  It is a setup in which you can have one or more standby database available for a production database. Data guard ensures that another database is available as a copy of production database at almost real time. As a result, we have higher protection for enterprise data and the new database is available very quickly without the need to actually restore and recover from backup. Therefore, data guard offers an excellent disaster recovery solution.

 

§  Architecture:- 

Ø  Primary database – It refers to the production database.

Ø  Standby database – It refers to a copy of primary/Production database. Data guard architecture must have at least one or more than one standby database.


Ø  Log transport service –It manages transfer of archive log files from primary to standby database.


Ø  Network configuration – It refers to the network connection between primary and standby database. This connection is based on Oracle Net.


Ø  Log apply services – It applies archived logs to the standby database.


Ø  Role management services – It manages the role change between primary and standby database.


Ø  Data guard broker – It manages data guard creation process and monitors the data guard.




  §  Data Guard Protection Modes:-

Ø  Maximum Protection Mode:

It specifies that a data change on primary Database is acknowledged only when it is available to standby database at least in the form of redo log information.In this mode, primary database shuts down if at least one standby database cannot be updated.So in MAXIMUM PROTECTION mode, user don't get a commit acknowledgment until transactions are successfully written to at least one standby destination.

Redo Archival Process: LGWR

Network Transmission mode: SYNC

Disk Write Option: AFFIRM

Standby Redo Logs: Yes

Standby Database Type: Physical standby database And Logical standby database.

Ø  Maximum Availability Mode:

 It Specifies that a transaction cannot be committed unless redo logs of at least one standby database are completely synchronized with primary database. However, this mode is more tolerant in terms of fault in updating standby database. It allows the primary database to function temporary in maximum performance mode until such error is resolved and gaps are analysed.


Unlike maximum protection mode, the primary database

will not shut down if a fault prevents it from writing its redo stream to a synchronized standby database. Instead, the primary

database will operate in RESYNCHRONIZATION until the fault is corrected and all log gaps have been resolved. When all log gaps

have been resolved, the primary database automatically resumes operating in maximum availability mode.


Redo Archival Process: LGWR

Network Transmission mode: SYNC

Disk Write Option: AFFIRM / NO AFFIRM

Standby Redo Logs: Yes

Standby Database Type: Physical standby database, Logical standby database and Snapshot standby database.

 

Ø  Maximum Performance Mode:

 It allows slight delay in updating standby database and therefore, it offers certain performance gain. In this mode, transaction can be committed as long as the change is written to an online redo log of the primary database without waiting to transfer the redo log to the standby database.


Redo Archival Process: LGWR or ARCH (ARCH is not recommended)

Network Transmission mode: ASYNC

Disk Write Option: NO AFFIRM

Standby Redo Logs: NO (But it is recommended for Real-Time Apply)

Standby Database Type: Physical standby database, Logical standby database and Snapshot standby database.

 




 §  Services Required on Standby database:

Ø  Fetch Archive Log (FAL) – Standby database requires Fetch Archive Log (FAL) client to request and fetch archive log files from primary database.

Ø  Remote File Server (RFS) – RFS to receive archived log files   from primary database,

Ø  Archiver process – It is used to archive redo logs applied to standby database.

Ø  Managed Recovery Process (MRP) – MRP is used to apply redo logs to the standby database.




§  Role Transition:

v  Role Transition is the change of role between primary and standby database.

It can happen in the following two cases:

Ø  Switchover – When primary database is switched to standby database and standby database is switched to primary database (Vice-Versa).

 

Ø  Failover – Where Standby database can be used as a disaster recover solution in case of a failure in the primary database.



§  Changing the Data Guard Protection Mode:

By default protection mode is MAXIMUM PERFORMANCE. So we will change it to MAXIMUM PROTECTION Mode. But we have to make Primary database in mount stage to change the existing protection mode.

The data protection mode can be set to MAXIMUM PROTECTION on an open database only if the current data protection mode is MAXIMUM AVAILABILITY and if there is at least one synchronized standby database. 

[oracle@PRODDB~]$ sqlplus / as sysdba

SQL*Plus:

Release 19.0.0.0.0 - Production on Wed May 12 01:05:27 2021

Version 19.3.0.0.0

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

Connected to:

Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Version 19.3.0.0.0

SQL> select name,db_unique_name,open_mode,database_role,protection_mode from v$database;

SQL> show pdbs
 
    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
 
         3 PRODDB_PDB                     READ WRITE NO
 
SQL> show parameter log_archive_dest_2 

NAME

TYPE

VALUE

log_archive_dest_2

string

service=PRODDR NOAFFIRM LGWR ASYNC VALID_FOR=(ALL_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=PRODDR

SQL> shut immediate;

 Database closed.

Database dismounted.

ORACLE instance shut down.


SQL> startup mount;

 ORACLE instance started.

SQL> ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE {AVAILABILITY | PERFORMANCE | PROTECTION};

SQL> ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PROTECTION;

 Database altered.

SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=PRODDR AFFIRM LGWR SYNC VALID_FOR=(ALL_LOGFILES,PRIMARY_ROLE)  DB_UNIQUE_NAME=PRODDR' scope=both;

SQL> show parameter log_archive_dest_2

NAME

TYPE

VALUE

log_archive_dest_2

string

service=PRODDR AFFIRM LGWR SYNC VALID_FOR=(ALL_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=PRODDR

SQL> alter database open;

Database altered.


SQL> select

name,db_unique_name,open_mode,database_role,protection_mode from v$database.

NAME

DB_UNIQUE_NAME

OPEN_MODE

DATABASE_ROLE

PROTECTION_MODE

PRODDB

PRODDB

READ WRITE

PRIMARY

MAXIMUM PERFORMANCE