Sunday, October 1, 2023

Steps to configure WebUtil

Steps to configure WebUtil in your 12c Forms installation.

 

1.       Execute create_webutil_db.sql located in the ORACLE_HOME/forms directory against the application schema in your database.

Ex. 

cd /u01/app/oracle/product/12.2.1.3/forms

 

cat /etc/oratab

 

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

#

#

ABC:/u01/app/oracle/product/12.2.0/dbhome_1:N

 

[oracle@antiquity-app fmwconfig]$ . oraenv

ORACLE_SID = [ABC] ?

The Oracle base remains unchanged with value /u01/app/oracle

 

 

[oracle@antiquity-app fmwconfig]$ sqlplus abc/abc@XXX

 

 

SQL*Plus: Release 12.2.0.1.0 Production on Wed Sep 27 03:24:03 2023

 

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

 

Last Successful login time: Wed Sep 27 2023 03:22:55 +00:00

 

Connected to:

Oracle Database 12c Standard Edition Release 12.2.0.1.0 - 64bit Production

 

SQL>

SQL> @create_webutil_db.sql;

 

Package created.

 

 

Package body created.

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

 

Disconnected from Oracle Database 12c Standard Edition Release 12.2.0.1.0 - 64bit Production

[oracle@antiquity-app forms]$

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

 

 

 

 

 

 

2.            Download the Jacob file and copy to the server.

 

https://github.com/freemansoft/jacob-project/releases

3.            Unzip the Jacob

 

[oracle@antiquity-app jacob-1.18]$ unzip jacob-1.18.zip

[oracle@antiquity-app jacob-1.18]$ ll

 

total 456

drwxr-xr-x. 3 oracle oinstall   4096 Apr 11  2012 docs

-rw-r--r--. 1 oracle oinstall 205312 Aug  5  2015 jacob-1.18-x64.dll

-rw-r--r--. 1 oracle oinstall 167936 Aug  5  2015 jacob-1.18-x86.dll

-rw-r--r--. 1 oracle oinstall  49231 Aug  5  2015 jacob.jar

-rw-r--r--. 1 oracle oinstall  26944 Sep 11  2008 LICENSE.TXT

-rw-r--r--. 1 oracle oinstall    519 Nov  6  2010 README.txt

[oracle@antiquity-app jacob-1.18]$

 

 

 

 

 

4.            Copy the files to your respective locations as follows.

[oracle@antiquity-app jacob-1.18]$ cp jacob-1.18-x64.dll /u01/app/oracle/product/12.2.1.3/forms/webutil/win64/

[oracle@antiquity-app jacob-1.18]$ cp jacob-1.18-x86.dll /u01/app/oracle/product/12.2.1.3/forms/webutil/win32/

[oracle@antiquity-app jacob-1.18]$ cp jacob.jar /u01/app/oracle/product/12.2.1.3/forms/java

[oracle@antiquity-app jacob-1.18]$

 

 

5.            Take a backup of your respective sign_webutil.sh file.

 

Ex.

 

[oracle@antiquity-app jacob-1.18]$ cd /u01/app/oracle/product/12.2.1.3/user_projects/domains/base_domain/config/fmwconfig/components/FORMS/instances/forms1/bin/

 

[oracle@antiquity-app bin]$ cp sign_webutil.sh sign_webutil.sh_ORG

 

 

 

 

6.            Amend the values as below in the sign_webutil.sh file.

•             weblogic123 is the password of the weblogic

 

KEYSTORE_PASSWORD=weblogic123

JAR_KEY_PASSWORD=weblogic123

 

error_text=`/home/oracle/jdk1.6.0_34/bin/keytool -genkey -dname "CN=$DN_CN, OU=$DN_OU, O=$DN_O, C=$DN_C" \

        -alias $JAR_KEY -keypass $JAR_KEY_PASSWORD -keystore $KEYSTORE \

        -storepass $KEYSTORE_PASSWORD -validity $VALIDDAYS`

 

error_text=`/home/oracle/jdk1.6.0_34/bin/jarsigner -keystore $KEYSTORE -storepass $KEYSTORE_PASSWORD -keypass $JAR_KEY_PASSWORD \

          $1 $JAR_KEY`

 

 

7.            sign the Jacob.jar file.

 

[oracle@antiquity-app bin]$ ./sign_webutil.sh /u01/app/oracle/product/12.2.1.3/forms/java/jacob.jar

WARNING:

 

Self-signing Jar files is no longer recommended.

Jar files should be digitally signed using a trusted certificate.

 

Generating a self signing certificate for key=webutil2...

...successfully done.

\n

Backing up /u01/app/oracle/product/12.2.1.3/forms/java/jacob.jar as /u01/app/oracle/product/12.2.1.3/forms/java/jacob.jar.old...

\n

Signing /u01/app/oracle/product/12.2.1.3/forms/java/jacob.jar using key=webutil2...

...successfully done.

[oracle@antiquity-app bin]$

 

 

 

 

8.            sign the frmwebutil.jar

 

 

[oracle@antiquity-app bin]$ ./sign_webutil.sh /u01/app/oracle/product/12.2.1.3/forms/java/frmwebutil.jar

WARNING:

 

Self-signing Jar files is no longer recommended.

Jar files should be digitally signed using a trusted certificate.

 

Generating a self signing certificate for key=webutil2...

Warning: webutil2 already present in /home/oracle/.keystore

\n

Backing up /u01/app/oracle/product/12.2.1.3/forms/java/frmwebutil.jar as /u01/app/oracle/product/12.2.1.3/forms/java/frmwebutil.jar.old...

\n

Signing /u01/app/oracle/product/12.2.1.3/forms/java/frmwebutil.jar using key=webutil2...

...successfully done.

[oracle@antiquity-app bin]$

 

 

 

9. Amend the extensions.jnlp file in the /u01/app/oracle/product/12.2.1.3/forms/java/

Location as follows.

 

From : <!-- <jar href="jacob.jar"/> -->

 

To : <jar href="jacob.jar"/>

 

 

 

10.            Add the values as follows to the formsweb.cfg file under your forms URL configuration.

 

WebUtilArchive=frmwebutil.jar,jacob.jar

basejnlp=webutil.jnlp

 

 

11.          Check the URL functionality.

 

 

 

 

 

 

 

 

 

Sunday, December 4, 2022

Recover standby database with Archive Log backup

Step 01. 

Cancel the MRP process and run the query below with sqlplus to find the required sequence.

SQL > alter database recover managed standby database cancel;

Check the archivelog required to recover the standby DB.

SQL> alter database recover standby database;

============

alter database recover standby database

*

ERROR at line 1:

ORA-00279: change 76791978408 generated at 12/01/2022 08:13:07 needed for

thread 1

ORA-00289: suggestion : +RECOC1

ORA-00280: change 76791978408 for thread 1 is in sequence #432918

 SQL>

==================

Step 02.

 In this scenario, thread 1 sequence 432918 is required to recover.

Check the max sequence generated on Primary database.

SQL> select max(SEQUENCE#),thread# from v$archived_log group by thread#;

Run the RMAN command below to take the backup accordingly.

RMAN > BACKUP AS COMPRESSED BACKUPSET ARCHIVELOG FROM SEQUENCE 432918 UNTIL SEQUENCE 433570 THREAD 1 format '/mnt/nfs/Ora_back/RMAN/DBM01/%U';

 

Step 03.

Copy the Backup files to the Standby database server.

Step 04.

Catalog the backup files.

RMAN> catalog start with '/acfs01/Ora_back/RMAN/DBM01/Arc_T1';

Step 05.

Recover the database.

RMAN> recover database;

 --- Got below error as I've to take a thread 2 backup as well because this is a RAC Database.

RMAN-06054: media recovery requesting unknown archived log for thread 2 with sequence 545051 and starting SCN of 7679200924

------

 

Step 06.

 

Take the backup of thread 2.

 

RMAN > BACKUP AS COMPRESSED BACKUPSET ARCHIVELOG FROM SEQUENCE 545051 UNTIL SEQUENCE 545510 THREAD 2 format '/mnt/nfs/Ora_back/RMAN/DBM01/%U';

 

Step 07.

 Copy the Files and Catalog again as thread 1.

 Step 08.

 RMAN> recover database;

 

SQL > alter database recover managed standby database disconnect from session;

 

Sunday, November 27, 2022

REP-501: The specified database cannot be connected.

Check for the "TNS_ADMIN" value in the "reports_process.xml" file in the
" /u01/app/oracle/config/domains/mydomain/system_components/ReportsServerComponent/rep_wls_reports_andrew-app/data/nodemanager ".
Change the value as per the tnsnames.ora location as per below.
ie. "/u01/app/oracle/config/domains/mydomain/config/fmwconfig"
Eventually reports_process.xml file shold looks like below.

[oracle@andrew-app nodemanager]$ cat reports_process.xml







[oracle@andrew-app nodemanager]$
[oracle@andrew-app nodemanager]$ cat reports_process.xml # [oracle@andrew-app nodemanager]$

Thursday, November 24, 2022

RMAN-06172:


RMAN> restore controlfile from '/home/oracle/dms_mount/RMAN/STB02/stb02control.ctl';

Starting restore at 26-OCT-22
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=6273 instance=dbm02_dg device type=DISK

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================

RMAN-03002: failure of restore command at 10/26/2022 10:20:18

RMAN-06172: no AUTOBACKUP found or specified handle is not a valid copy or piece

Solution ->

The controlfile was on shared storage.
It is require to copy the controlfile to a local disk.

cp /home/oracle/dms_mount/RMAN/STB02/stb02control.ctl /tmp/


RMAN> restore controlfile from '/tmp/stb02control.ctl';

Starting restore at 26-OCT-22
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=6900 instance=dbm02_dg device type=DISK
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=3 instance=dbm02_dg device type=SBT_TAPE
channel ORA_SBT_TAPE_1: Oracle Secure Backup

channel ORA_SBT_TAPE_1: skipped, AUTOBACKUP already found
channel ORA_DISK_1: copied control file copy
output file name=+DATA/dbm02_dg/controlfile/dbm02_stby.ctl
output file name=+REDO/dbm02_dg/controlfile/dbm02_stby.ctl
Finished restore at 26-OCT-22

RMAN>

Thursday, January 17, 2019

Change AMM to ASMM

SQL> show parameter memory;

NAME                                        TYPE        VALUE
------------------------------------ ----------- ------------------------------
hi_shared_memory_address         integer     0
memory_max_target                    big integer 1680M
memory_target                             big integer 1680M
shared_memory_address              integer     0
SQL>
SQL>
SQL> show parameter sga

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
lock_sga                             boolean     FALSE
pre_page_sga                         boolean     FALSE
sga_max_size                         big integer 1680M
sga_target                           big integer 0

SQL> show parameter pga

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
pga_aggregate_target                 big integer 0

SQL> create pfile='/tmp/memcheck_pfile.ora' from spfile;

File created.

SQL> exit


alter system set sga_target=1200M scope=spfile;
alter system set pga_aggregate_target=300M scope=spfile;

SQL> shu immediate;
SQL> startup;

alter system set memory_target=0;

SQL> shu immediate;
SQL> startup;

SQL> show parameter memory;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
hi_shared_memory_address             integer     0
memory_max_target                    big integer 0
memory_target                        big integer 0
shared_memory_address                integer     0

SQL> show parameter sga

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
lock_sga                             boolean     FALSE
pre_page_sga                         boolean     FALSE
sga_max_size                         big integer 1200M
sga_target                           big integer 1200M

SQL> show parameter pga

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
pga_aggregate_target                 big integer 480M

Sunday, August 26, 2018

Change standby database Protection mode


         Convert MAXIMUM PERFORMANCE to MAXIMUM AVAILABILITY

On Primary DB

SQL> select status,instance_name,database_role,protection_mode from v$database,v$instance;

STATUS       INSTANCE_NAME    DATABASE_ROLE    PROTECTION_MODE
------------ ---------------- ---------------- --------------------
OPEN         KANDY            PRIMARY          MAXIMUM PERFORMANCE


* Number of standby and online redo logs and it’s sizes should be same

SQL> select group#,bytes/1024/1024 from v$log;

    GROUP# BYTES/1024/1024
---------- ---------------
         1              50
         2              50
         3              50

SQL> select group#,bytes/1024/1024 from v$standby_log;

    GROUP# BYTES/1024/1024
---------- ---------------
         4              50
         5              50
         6              50


SQL> select thread#,max(sequence#) from v$archived_log group by thread#;

   THREAD# MAX(SEQUENCE#)
---------- --------------
         1             49

ON STANDBY DB

SQL> select thread#,max(sequence#) from v$archived_log group by thread#;

   THREAD# MAX(SEQUENCE#)
---------- --------------
         1             49

SQL> select status,instance_name,database_role,protection_mode from v$database,v$instance;

STATUS       INSTANCE_NAME    DATABASE_ROLE    PROTECTION_MODE
------------ ---------------- ---------------- --------------------
MOUNTED      COLOMBO          PHYSICAL STANDBY MAXIMUM PERFORMANCE


ON PRIME DB

Configure to use SYNCHRONOUS mode

SQL> select value from v$parameter where name='log_archive_dest_2';

VALUE
--------------------------------------------------------------------------------
service=TNS_COL LGWR ASYNC NOAFFIRM max_failure=10 max_connections=5 reopen=180
valid_for=(online_logfiles,primary_role) db_unique_name=colombo

alter system set log_archive_dest_2='service="TNS_COL" LGWR AFFIRM SYNC db_unique_name="colombo" valid_for=(all_logfiles,primary_role)';
alter database set standby database to maximize availability;
select status,instance_name,database_role,protection_mode from v$database,v$instance;

SQL> select status,instance_name,database_role,protection_mode from v$database,v$instance;

STATUS       INSTANCE_NAME    DATABASE_ROLE    PROTECTION_MODE
------------ ---------------- ---------------- --------------------
OPEN         KANDY            PRIMARY          MAXIMUM AVAILABILITY


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

If you have configured broker , change the below parameter

edit database 'colombo' SET PROPERTY LogXptMode='SYNC';




Tuesday, April 10, 2018

ADD IP to Solaris 11

Step 1 : Set the NCP

To check the current NCP setting:
# netadm list
TYPE        PROFILE        STATE
ncp         Automatic      disabled
ncp         DefaultFixed   online
loc         Automatic      offline
loc         NoNet          offline
loc         DefaultFixed   online
As seen in the output above, the NCP is set to DefaultFixed. In case it is not set, use netadm command to set it to DefaultFixed :
# netadm enable -p ncp DefaultFixed
Step 2 : Check the link status
The command to check the link status in Solaris 11 is :
# dladm show-phys
LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
net0              Ethernet             up         1000   full      e1000g0
 Step 3 : Create a new interface
The ipadm command creates the new interface to be configured :
# ipadm create-ip net0
Check the newly created interface :
# ipadm show-if
IFNAME     CLASS      STATE      ACTIVE      OVER
lo0        loopback   ok         yes         ---
net0       ip         down       no          ---
Step 4 : Creating IP address

-T specifies either static, dhcp or addrconf (for IPv6) types of addresses.
# ipadm create-addr –T static –a local=192.168.1.10/24 net0/techh
To check the interface status of the interface :
# ipadm show-if
IFNAME     CLASS    STATE    ACTIVE OVER
lo0        loopback ok       yes    --
net0       ip       ok       yes    --
To check the configured IP address :
# ipadm show-addr
ADDROBJ                TYPE     STATE        ADDR
lo0/v4                 static   ok           127.0.0.1/8
net0/geeklab           static   ok           192.168.1.20/24
lo0/v6                 static   ok           ::1/128

delete the interface

 
# ipadm delete-ip net0

Wednesday, March 14, 2018

RMAN Configuration


BACKUP AS COMPRESSED BACKUPSET DATABASE PLUS ARCHIVELOG;

CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 2G;

 
To Change the archivelog destination

 
alter system set log_archive_dest_1='LOCATION=/vol2/oracle/Archives’;

 
To change the rman backup location..
 

CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/vol0/RMAN_BK/%d-%T-%U';
 

To change the controlfile  location..

 

CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 
'/u01/app/oracle/admin/flash/%F';

 

 

LOG_ARCHIVE_FORMAT = “LOG%s_%t_%r.arc”
Various parameters that can be used with the LOG_ARCHIVE_FORMAT parameter are given below:
%s – log sequence number
%S – log sequence number, padded with zero
%t – thread number
%T – thread number, padded with zero
%a – activation id
%d – database id
%r – reset logs id

 

SQL> alter system set log_archive_format='hasaral_%s_%t_%r.arc' scope=spfile;
System altered.

SQL> shut immediate
SQL>startup

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

 

Steps to enable archivelog—

 

 

SQL> archive log list

SQL> show parameter recovery_file_dest

 

alter system set log_archive_dest_1='LOCATION=/u02/app/oracle/oradata/orcl/arch' scope = both;

 

shutdown immediate;

 

SQL> startup mount

SQL> alter database archivelog;

SQL> alter database open;

SQL> archive log list

SQL> alter system switch logfile;

 

SQL> host

[oracle@ora1 ~]$ ls /u02/app/oracle/oradata/orcl/arch

1_27_711369564.dbf

[oracle@ora1 ~]$ exit

exit

 

SQL>

 

 

 

 

 

 

 

1. show parameter db_recovery_file_dest;

2. Alter system set  db_recovery_file_dest=’/vol1/oracle/backup’;

3. Alter system set db_recovery_file_dest_size=2G;

 

 

4. rman target /

 

Offline Backup--------

 

5. RMAN> configure retention policy to redundancy 2; (This means RMAN will try to keep                         

      2 copies of the database backups)

6. RMAN>configure controlfile autobackup on;

 

 

 CONFIGURE DEFAULT DEVICE TYPE DISK FORMAT ‘/vol0/rman_backups/cdb/%U’;

 

 

CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 
'/u01/app/oracle/admin/flash/%F';

 

7. RMAN>shutdown immediate

8. RMAN>startup mount

9. RMAN>backup database;

1. RMAN>sql ’alter database open’;

 

 

 

Online Backup---------

 

1. RMAN>backup database plus archivelog delete input;

2. RMAN>backup archivelog all delete input;

 

 

-------- To Find the archive Destination---------

 

SQL> archive log list

SQL> show parameter db_recovery_file_dest

SQL> select dest_name,status,destination from v$archive_dest;

 

 

ENABLE BLOCK CHANGE TRACKING

 

SQL> alter database enable block change tracking
using file /u01/app/oracvle/mysid/data/block_change_tracking.dbf';

 

SQL> alter database enable block change tracking;


 

 

 

 

select filename, status, bytes from   v$block_change_tracking
SELECT * FROM v$sgastat WHERE name like 'CTWR%';

 

 

 

 

 

Startup nomount pfile=c:\oracle\product\10.1.0.3\database\initbooktst.ora

restore spfile from autobackup;

 

RMAN>list archivelog all;
RMAN>list copy of archivelog until time
‘SYSDATE-10′;
RMAN>list copy of archivelog from time
‘SYSDATE-10′
RMAN>list copy of archivelog from time
‘SYSDATE-10′ until time ‘SYSDATE-2′;
RMAN>list copy of archivelog from sequence 1000;
RMAN>list copy of archivelog until sequence 1500;
RMAN>list copy of archivelog from sequence 1000 until sequence 1500;

 

 

Archivelog Delete Commands

 

RMAN>delete archivelog all;
RMAN>delete archivelog until time
‘SYSDATE-10′;
RMAN>delete archivelog from time
‘SYSDATE-10′
RMAN>delete archivelog from time
‘SYSDATE-10′ until time ‘SYSDATE-2′;
RMAN>delete archivelog from sequence 1000;
RMAN>delete archivelog until sequence 1500;
RMAN>delete archivelog from sequence 1000 until sequence 1500;

Note : Also, you can use noprompt statement for do not yes-no question.
RMAN>delete noprompt archivelog until time
‘SYSDATE-10′;

 

delete noprompt force archivelog all;

delete noprompt force archivelog all completed before 'SYSDATE-2';

 

 

crosscheck backup;

Crosscheck archivelog all;

delete backup tag=TAG20131112T041335;

delete backup;

List backup summary;

 

 

select dbid from v$database;

 

 

LIST COPY;

LIST INCARNATION OF DATABASE;

DELETE EXPIRED BACKUP

DELETE EXPIRED ARCHIVELOG ALL

 

 

 

 

 

--------- Database must be in mount mode to change the archivelog mode--------

 

Disable flashback mode first if it enabled..

 

 

SQL> alter database flashback off;

alter database noarchivelog;

DELETE FORCE NOPROMPT BACKUPSET TAG 'weekly_bkup';

 

backup current controlfile;

 

backup datafile 4 include current controlfile;

backup as copy current controlfile format c:\bkp_controlfile.ctl

alter system switch logfile;

alter system archive log current

 

 

 

RESTORE DATABASE UNTIL TIME "to_date('07/23/2010 00:00:00' , 'mm/dd/yy hh24:mi:ss')";

 

 

 

restore archivelog from logseq 665 until logseq 671;