Quantcast
Channel: Doyensys Allappsdba Blog..
Viewing all 1640 articles
Browse latest View live

Fusion Middleware - BSU patch manually apply & rollback steps

$
0
0
Patch Rollback or Remove steps:

1. Login in FMW installed server.
2. change directory to FMW_HOME/utils/bsu
# cd $FMW_HOME//utils/bsu

3. execute below command to remove existing bsu patch

#bsu.sh -remove -patchlist=<Patch name>-prod_dir=$FMW_Home/wlserver_10.3

Applying BSU patch:

1. Login in FMW installed server.

2. download the patch file, unzip the file, we can found a jar and xml file "Eg. XNBA.jar & patch-catalog_25461.xml" . copy jar & xml file "$FMW_HOME//utils/bsu/cache_dir"

3. change directory to FMW_HOME/utils/bsu
# cd $FMW_HOME//utils/bsu

4. execute below command to apply new bsu patch.

bsu.sh -patch_download_dir=$FMW_Home/utils/bsu/cache_dir -prod_dir=$FMW_Home/wlserver_10.3 -patchlist=<Patch number> -verbose -install



HTTP Status 500 - Internal Server Error in glassfish

$
0
0
Add

<jvm-options>-Djavax.xml.accessExternalSchema=all</jvm-options>

line of code in the domain.xml file at glassfish4\glassfish\domains\domain1\config\domain.xml folder

inside <java-config> </java-config> tag as :-

<java-config>
.
.
<jvm-options>-Djavax.xml.accessExternalSchema=all</jvm-options>
</java-config>

Allow 4848 port or stop the firewall and selinux.

Seed Data Table has not been prepared for patching at "APPS.WF_EVENTS+"

$
0
0
When applying ADOP  patch, we getting below error like "APPS.WF_EVENTS+"

ORA-20002: Seed Data Table has not been prepared for patching
ORA-06512: at "APPS.WF_EVENTS+", line 1
ORA-04088: error during execution of trigger 'APPS.WF_EVENTS+'
ORA-06512: at "APPS.WF_EVENT_FUNCTIONS_PKG", line 701
ORA-06512: at "APPS.FND_PROD_LIC_TGR", line 10
ORA-04088: error during execution of trigger 'APPS.FND_PROD_LIC_TGR'

Follow below steps to solve the issue.

Step 1: check invalid objects in apps user. if invalid objects are exists compile the objects manually. and rerun the patch. 

incase if u getting same error again. perform step 2 below.

Step 2: Check /tmp free size. if free space is less then delete unwanted files from /tmp and re execute the patch again.

incase if u getting same error again. perform step 3 below.

Step 3: check the TEMP tablespace is auto expandable, by default in EBS installation it will not autoextend. auto extend the tablespace and re execute the patch again.

Adop Prepare Fails With Error 'ORA-06512: at "APPS.FND_PRINTER_TL+", line 1'

$
0
0
Below is the error when execute the ADOP Prepare fails.

ERROR at line 1:
ORA-20002: Seed Data Table has not been prepared for patching
ORA-06512: at "APPS.FND_PRINTER_TL+", line 1
ORA-04088: error during execution of trigger 'APPS.FND_PRINTER_TL+'
ORA-06512: at line 33



SOLUTION:
Please execute the following from PATCH file system.
connect as APPS/*** from PATCH File system
SQL> exec ad_zd_seed.prepare('FND_PRINTER_TL');
SQL> commit;

Check for invalid objects, if any invalid  objects present on APPS schema, compile manually.
check the patch readme for any grants missed.and run adop prepare phase.

Concurrent Managers : Overview & Concepts Oracle EBS R12

$
0
0


Concurrent Manager service is a batch processing tool which provides scheduling and queuing functionality for background jobs and is used by most of the Oracle Applications modules. It is a key service within Ebusiness Suite which runs the user requests in the background thus ensuring that the user can continue with other days to day tasks while the requested change/activity is carried out by the Concurrent Manager.

2. Variables/Executables for CM
$APPLCSF  is the top-level directory in which the Concurrent Manager puts log and output files.
$APPLLOG & $APPLOUT are the subdirectories in which the Concurrent Manager puts log and output files.
$APPLTMP is the directory in which Oracle Applications temporary files are created.
$APPLPTMP is the directory in which PL/SQL output files are created.
Note: The value must be exactly same as “utl_file_dir” value in init.ora parameter file.
FNDLIBR ( executable ) The ICM (Internal Concurrent Manager) spawns FNDLIBR processes based on the concurrent manager definitions. The number of FNDLIBR processes at the operating system level will be equal to the total number of max requests for each concurrent manager defined plus one for the ICM.
FNDLIBR processes can be queried up at the operating system level by using
$ ps -ef | grep FNDLIBR
Output:
[applmgr@1705ecloud05 scripts]$ ps -ef | grep FNDLIBR
applmgr 5075 5069 0 04:54 ? 00:00:01 FNDLIBR
applmgr 12919 12169 0 06:33 pts/9 00:00:00 grep FNDLIBR
Remember there are also other manager processes for INVLIBR, MFGLIBR, etc.


3. Start/Stop & Check Concurrent Managers (CM)
Prior to startup of CM service, you must run the environment file APPS<CONTEXT_NAME>.env
The default filename for the environment file in R12.2 is EBSapps.env and set the environment to Run Edition.
a) Start Concurrent Manager (CM) in R12:
1. Connect to Application Tier user usually its applmgr
2. Go to the admin scripts directory
3. cd $ADMIN_SCRIPTS_HOME
./adcmctl.sh start apps/<appspwd>
b) Stop Concurrent Manager in R12
1. Connect to Application Tier user usually its applmgr
2. Go to the admin scripts directory
3. cd $ADMIN_SRCIPTS_HOME
./adcmctl.sh stop apps/<appspwd>
c) To check Status of Concurrent Manager
1. Connect to Application Tier user usually its applmgr
2. Go to the admin scripts directory
3. cd $ADMIN_SRCIPTS_HOME
./adcmctl.sh status apps/<appspwd>
Output:
You are running adcmctl.sh version 120.19.12020000.7
Internal Concurrent Manager is Active.
adcmctl.sh: exiting with status 0
adcmctl.sh: check the logfile /u01/oracle/PRD122/fs1/inst/apps/PRD12111_1705ecloud05/logs/appl/admin/log/adcmctl.txt for more information …
Note: Script to start/stop concurrent manager, Similar to one in 11i. (This script, in turn, calls startmgr.sh )


4. Concurrent Manager Log file location in R12:
Each concurrent request (run by Concurrent Manager) generates a log file for details regarding the request and an outfile for report details. There are 3 types of log files for concurrent processing:
A) Request Log File – documents the execution of a particular request ( l.req )
B) Manager Log File – documents the performance of a concurrent manager process. ( W.mgr )
C) Internal Manager Log File – documents the performance of the ICM.(std.mgr). This log file displays the parameters used with the’adcmctl’ command.
Log files can be viewed as an operating system level of $product_TOP/$APPLLOG or $APPLCSF/$APPLLOG.
$APPLLOG is always set and $APPLCSF is optional. Log files can also be viewed from within the applications from the View Concurrent Requests Form
$NE_BASE/inst/<CONTEXT_NAME>/logs/appl/conc/log
The out files contain the output generated from a concurrent processing report. Out files can be viewed at an operating system level of $product_TOP/$APPLOUT or $APPLCSF/$APPLOUT (if set). Out files can also be viewed from within the applications from View Concurrent Requests form ( \ Nav Con Req).
$NE_BASE/inst/<CONTEXT_NAME>/logs/appl/conc/out

5. Concurrent Managers Tables in R12
FND_CONCURRENT_PROCESSES FND_CONCURRENT_REQUESTS
FND_CONCURRENT_QUEUES
FND_CONCURRENT_PROGRAMS
FND_CONCURRENT_PROCESSES — Lists information about managers; Useful for determining UNIX and Oracle process is associated with managers; Identifies logfiles associated with managers.
FND_CONCURRENT_REQUESTS — Primary jobs submission table; Queried by the managers; Jobs are inserted into this table; Table can grow rather large thus affecting performance; Cleanup scripts available with the Applications.
FND_CONCURRENT_PROGRAMS –Stores information about concurrent programs. Each row includes a name and description of the concurrent program. Each row also includes the execution methods for the program (EXECUTION_METHOD_CODE), the argument method (ARGUMENT_METHOD_CODE), and whether the program is constrained (QUEUE_METHOD_CODE).


Oracle Apps R12.1 Vs R12.2

$
0
0

Important differences and changes points in R12.1 and R12.2.

1. In R12.1, Oracle E-Business Suite is deployed on iAS 10.1.3 Oracle   Containers for J2EE (OC4J).
But
In R12.2 Oracle E-Business Suite is deployed on FMW 11g 11.1.1.6 (PS5), WebLogic Server 11g 10.3.6 (PS5).

2. In R12.1, EBS JDK 6.0_10 Oracle JRockit support Not Applicable to Oracle E-Business Suite 12.1 technology stack.
But
In R12.2 JRockit 1.6.0_22, JDK 1.6.0_21, Oracle JRockit  JVM certified and recommended on Linuxand Windows. Target JDK 1.7.

3. In R12.1 Oracle Database Enterprise Edition from 10g to 11gR2.
But
In R12.2 Oracle Database Enterprise Edition, 11g 11.2.0.3 with edition based redefinition.

4. In R12.1 Oracle JSP Compiler 10.1.3 is used.
But
In R12.2 WebLogic JSP Compiler 11g 10.3.6 is use.

5. In R12.1 Apache 1.3.34 is used.
But
In R12.2 the new Apache 2.2 is using.

6. In R12.1 Java Object Cache 10.1.3 is used.
But
In R12.2 FMW 11g 11.1.1.6 is used.

7. In R12.1, Oracle JDBC Thin Drivers 11gR2 repackaged and delivered via Oracle E-Business Suite. $OAD_TOP/*jdbc*.zip
But
In R12.2 Oracle JDBC Thin Drivers 11gR2 used directly from Fusion Middleware installation. 11g iAS Ojdbc6dms.jar

8. In R12.1 Oracle SSL Libraries is used.
But
In R12.2 Java Secure Socket Extension (JSSE) is used.

*: In both R12.1 and R12.2 common is Forms / Reports iAS 10.1.2 is used.

Maintenance Mode in R12.1.3

$
0
0

Maintenance Mode in R12.1.3


Maintenance Mode was introduced in Release 11.5.10, in which users are not allowing to login any responsibility.
In Maintenance mode the Oracle Applications system is made accessible only for patching activities.

Why we need to enable Maintenance Mode and their Advantages:
As we know that there are several practical points relating to the use of Maintenance Mode:

We can toggle Maintenance Mode between Enabled and Disabled using the new Change Maintenance Mode menu in AD Administration (Adadmin), or the equivalent function in Oracle Applications Manager.

Although we can run AutoPatch (Adpatch) without enabling Maintenance Mode but noted there will be a significant degradation in performance.
As we know that while the application is in Maintenance Mode there is a separate login page for Restricted Mode access.

Here, restricted Mode allows administrators access to specific privileged functionality in OAM, for example to view the timing report that shows the progress of a patching session.

In Restricted Mode, only valid database users are allowed to login into OAM via a special URL and are allowed to access a limited set of features.
The database role AD_MONITOR_ROLE has access to all the required database objects for Restricted Mode features.
Or the OAM Online Help (OAM->Patches and Utilities -> Managing Downtime Schedules -> Restricted Mode)

Conclusion:
1. To ensure optimal performance and reduce downtime during patching sessions.

2. Maintenance Mode shutdown the Workflow Business Events System (oracle application services).

3. Setup a function security so that Oracle Applications functions are unavailable to users.

4. Provide a clear visibility/information to user that System/Application is down for patching purpose.

Easy/short-cut steps to Enabling and Disabling Maintenance Mode:

This is also same as ADADMIN because when we Enable or Disable 'Maintenance Mode', adadmin will also execute the below script:

$AD_TOP/patch/115/sql/adsetmmd.sql    ####sending the parameter 'ENABLE' or 'DISABLE' as shown below as example:

SQL>@$AD_TOP/patch/115/sql/adsetmmd.sql ENABLE    ##### For ENABLE
SQL>@$AD_TOP/patch/115/sql/adsetmmd.sql DISABLE   ##### For DISABLE

Real-time scenario:
SQL> show user
USER is "APPS"
SQL>
SQL> select fnd_profile.value('APPS_MAINTENANCE_MODE') from dual;
FND_PROFILE.VALUE('APPS_MAINTENANCE_MODE')
--------------------------------------------------------------------------------
MAINT
SQL>

SQL> @$AD_TOP/patch/115/sql/adsetmmd.sql DISABLE
PL/SQL procedure successfully completed.
Commit complete.
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
$
SQL> select fnd_profile.value('APPS_MAINTENANCE_MODE') from dual;
FND_PROFILE.VALUE('APPS_MAINTENANCE_MODE')
--------------------------------------------------------------------------------
NORMAL
SQL>

If MAINT ==> Maintenance Mode is Enabled.
If NORMAL ==> Maintenance Mode is Disabled.

AD Utilities for Oracle Apps DBA

$
0
0

AD Utilities for Oracle Apps DBA


AD Utilities are a group of tools designed to install, upgrade,
maintain, and patch a specific set of products contained in a
given release of Oracle Applications.

AutoPatch (adpatch) is a utility that is used to apply
individual patches, mini-packs, or maintenance packs to an
existing Oracle Applications instance.

AD Administration (adadmin) performs maintenance tasks on an
installed Oracle Applications system to ensure that it runs
smoothly.  The tasks performed with this utility fall into
two categories: database and file system. 

1.   Generate Applications Files menu

2. Maintain Applications Files menu

3. Compile/Reload Applications Database Entities menu

4. Maintain Applications Database Entities menu

5. Change Maintenance Mode

6. Exit AD Administration

AD Controller (or adctrl) is used in conjunction with other
AD Utilities (such as AutoInstall/AutoUpgrade, adadmin or
adpatch) to determine the status of workers and restart failed
tasks.
Manages parallel workers in AD Administration and AutoPatch.

AD Relink (or adrelink) allows you to relink Oracle Applications
executable programs with the Oracle Server product libraries.
You can run the adrelink utility manually to relink individual
executable programs, or use the relink option in the AD
Administration utility to relink all executable programs.

Administration doesn’t relink AD executable.

For Example:
To relink adpatch, adsplice and adadmin:
adrelink.sh force=y “ad adpatch” “ad adsplice” “ad adadmin”

To relink all AD executables:
adrelink.sh force=y “ad all”

Article 2

$
0
0

Relink Of Module "Fndfmxit.So" Failed. The file is in use and cannot be overwritten

APPLIES TO:
Oracle Applications DBA - Version 12.0 to 12.1.3 [Release 12 to 12.1]

SYMPTOMS:
Applying Oracle E-Business Suite 12.0.3 Release Update Pack (RUP4) patch 6435000 with adpatch, get the following error:

ld: 0711-851 SEVERE ERROR: Output file:
$FNS_TOP/bin/fndfmxit.so
The file is in use and cannot be overwritten.
make: The error code from the last command is 12.

Stop.
Done with link of fnd executable 'fndfmxit.so' on Tue Sep 25 10:56:34 IST2018

Relink of module "fndfmxit.so" failed.


CAUSE:
The issue is caused by the following: executables were used at the moment when relink was performed. This issue is indicated by the error message

SOLUTION:
To implement the solution, please execute the following steps:

NOTE: This is AIX only. Slibclean is an IBM specific command.

1. Please stop all APPS services.

2. Retry patch. If is still failing please implement step 3.

3. Run (as root) slibclean command to clear unused shared libraries from memory.

4. Retry patch.


Reference:
Oracle Metalink (Doc ID 551208.1)

Article 1

$
0
0

ORA-00600 [ktte_recover_latch]

APPLIES TO:
Oracle Database - Enterprise Edition - Version 11.1.0.7 to 11.2.0.3 [Release 11.1 to 11.2]

SYMPTOMS:
User encounter this issue if PMON fails with ORA-600 [ktte_recover_latch] during process clean-up and some times terminates the instance.

/oradb/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_pmon_34221.trc  
(incident=72012):
ORA-600: internal error code, arguments: [ktte_recover_latch], [], [], [], 
[], [], [], [], [], [], [], []
Incident details in: 
/oradb/app/oracle/diag/rdbms/orcl/orcl/incident/incdir_72012/orcl_pmon_34221_i9
6017.trc
Errors in file 
/oradb/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_pmon_34221.trc:
ORA-600: internal error code, arguments: [ktte_recover_latch], [], [], [], 
[], [], [], [], [], [], [], []
PMON (ospid: 34221): terminating the instance due to error 472
Mon Sep 24 18:36:02 2018
System state dump requested by (instance=1, osid=34221 (PMON)), 
summary=[abnormal instance termination].
System State dumped to trace file 
/oradb/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_diag_20000.trc
Dumping diagnostic data in directory=[cdmp_20091201233602], requested by 
(instance=1, osid=34221 (PMON)), summary=[abnormal instance termination].
ce termination].
Instance terminated by PMON, pid = 34221  <-- instance terminated
Mon Sep 24 18:40:42 2018
Starting ORACLE instance (normal)  <--- started the instance manually

CAUSE:
This is due to the unpublished Bug 9176453: PKT-BUGOLTP: ORA-00600: [KTTE_RECOVER_LATCH]

User might encounter this bug if PMON fails with ORA-600 [KTTE_RECOVER_LATCH] during process clean-up.

SOLUTION:
This Bug is already fixed in 12.1 and is also included in the 11.2.0.2 database version

Please download and apply the patch for the Bug 9176453, if available for your database version on top of your platform
or
Upgrade to 12.1 or 11.2.0.2 and above to solve this issue.

Reference:-
Oracle Metalink (Doc ID 1402119.1)

Article 0

$
0
0

ORA-15036 After Applying Patch 12382627

APPLIES TO:
Oracle Database - Enterprise Edition - Version 11.2.0.2 to 11.2.0.4 [Release 11.2]
Information in this document applies to any platform.

SYMPTOMS:
<p >*Symptoms
<span >Briefly describe the symptoms of the problem. Remember to delete any customer specific information

You have applied Patch 12382627 as a fix for the Bug 12382627. Reference MOS Doc ID 12382627.8   and   1478482.1.

As per the Patch 12382627 readme ( Pre-install info ), ORA-15036 can be seen on some of the disks while the diskgroup is mounting. And those disks need to be resized. And to disable Patch 12382627 you need to use the following parameter in ASM's (s)pfile:

     _fourth_spare_parameter=0

But even after setting this parameter you still see the same error  ORA-15036 while mounting the diskgroup :

ERROR: diskgroup TEST was not mounted
ORA-15032: not all alterations performed
ORA-15036: disk '/oradisk/db_vol/oradb06' is truncated
ORA-15036: disk '/oradisk/db_vol/oradb05' is truncated
ORA-15036: disk '/oradisk/db_vol/oradb04' is truncated

CHANGES:
Patch 12382627 applied

CAUSE:
_fourth_spare_parameter  is applicable for 11.2.0.2.0 and 11.2.0.3.0 releases. You are on a different patchset or PSU

SOLUTION:
The patch has been built on the following versions, and the following corresponding parameter to be used to disable the patch and ORA-15036.

11.2.0.2.0    :  _fourth_spare_parameter=0
11.2.0.3.0    :  _fourth_spare_parameter=0
11.2.0.3.2    :  _eighth_spare_parameter=0
11.2.0.3.5    :  _eighth_spare_parameter=0
11.2.0.4.0    :  _io_osd_param=0  (  If this parameter is not helping then Apply Patch 18027761 for SPARC or Patch 19071440 for x86_64 and use the parameter  )

If your patch is being built for a different version, ensure you get the correct parameter to disable it, through Oracle Support.

Reference:-
Oracle Metalink (Doc ID 1539387.1)

Query to Check Information about Database Structure

$
0
0
set pages 100 lines 100;
col filename format a15;
SELECT /*+ ordered */ d.tablespace_name tablespace, d.file_name filename, d.bytes filesize, d.autoextensible autoextensible, d.increment_by * e.value increment_by, d.maxbytes maxbytes FROM sys.dba_data_files d, v$datafile v, (SELECT value FROM v$parameter WHERE name = 'db_block_size') e WHERE (d.file_name = v.name)
UNION
SELECT d.tablespace_name tablespace, d.file_name filename, d.bytes filesize, d.autoextensible autoextensible, d.increment_by * e.value increment_by, d.maxbytes maxbytes FROM sys.dba_temp_files d, (SELECT value FROM v$parameter WHERE name = 'db_block_size') e
UNION
SELECT '[ ONLINE REDO LOG ]', a.member, b.bytes, null, TO_NUMBER(null), TO_NUMBER(null)
FROM v$logfile a, v$log b WHERE a.group# = b.group#
UNION
SELECT '[ CONTROL FILE ]', a.name, TO_NUMBER(null), null, TO_NUMBER(null), TO_NUMBER(null)
FROM v$controlfile a
ORDER BY 1,2;

Query to Check Archivelog Generation by Daywise

$
0
0
set pages 1000 lines 1000
select thread#, to_char(first_time,'YYYY-MM-DD') day,
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'00',1,0)),'999') "00",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'01',1,0)),'999') "01",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'02',1,0)),'999') "02",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'03',1,0)),'999') "03",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'04',1,0)),'999') "04",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'05',1,0)),'999') "05",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'06',1,0)),'999') "06",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'07',1,0)),'999') "07",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'08',1,0)),'999') "08",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'09',1,0)),'999') "09",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'10',1,0)),'999') "10",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'11',1,0)),'999') "11",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'12',1,0)),'999') "12",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'13',1,0)),'999') "13",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'14',1,0)),'999') "14",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'15',1,0)),'999') "15",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'16',1,0)),'999') "16",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'17',1,0)),'999') "17",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'18',1,0)),'999') "18",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'19',1,0)),'999') "19",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'20',1,0)),'999') "20",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'21',1,0)),'999') "21",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'22',1,0)),'999') "22",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'23',1,0)),'999') "23",
count(*) Total from v$log_history where first_time > sysdate - &No_of_Days group by thread#, to_char(first_time,'YYYY-MM-DD') order by 2 ;

Query to Monitor Redo Log Generation

$
0
0
SELECT lq.leseq "Current log sequence No", 100*cr.cpodr_bno/lq.lesiz "Percent Full",
cr.cpodr_bno "Current Block No", lq.lesiz "Size of Log in Blocks" FROM x$kcccp cr,
x$kccle lq WHERE lq.leseq =CR.cpodr_seq AND bitand(lq.leflg,24) = 8;

Script to Display a table more than five MB in Particular Schema

$
0
0
SELECT owner, table_name, TRUNC(sum(bytes)/1024/1024) MB
FROM (SELECT segment_name table_name, owner, bytes FROM dba_segments
WHERE segment_type = 'TABLE'
UNION ALL
SELECT i.table_name, i.owner, s.bytes
FROM dba_indexes i, dba_segments s
WHERE s.segment_name = i.index_name
AND s.owner = i.owner AND s.segment_type = 'INDEX'
UNION ALL
SELECT l.table_name, l.owner, s.bytes
FROM dba_lobs l, dba_segments s
WHERE s.segment_name = l.segment_name
AND s.owner = l.owner AND s.segment_type = 'LOBSEGMENT'
UNION ALL
SELECT l.table_name, l.owner, s.bytes
FROM dba_lobs l, dba_segments s
WHERE s.segment_name = l.index_name
AND s.owner = l.owner AND s.segment_type = 'LOBINDEX')
WHERE owner in UPPER('&owner')
GROUP BY table_name, owner
HAVING SUM(bytes)/1024/1024 > 5
ORDER BY SUM(bytes) desc;

ORA-01940: cannot drop a user that is currently connected

$
0
0
Cause:

SQL> drop user data;
drop user data
*
ERROR at line 1:
ORA-01940: cannot drop a user that is currently connected

 Solution:

SQL> select sid, serial# from v$session where username = 'DATA';

       SID    SERIAL#
---------- ----------
       150   873

SQL> alter system kill session '150,873';

System altered.

SQL> drop user data;
drop user data
*
ERROR at line 1:
ORA-01922: CASCADE must be specified to drop 'DATA'


SQL> drop user data cascade;   

User dropped.

SQL> 

ORA-19815: WARNING: db_recovery_file_dest_size of xxxxxx bytes is 100.00% used

$
0
0
Check with alert Log

************************************************************************
ARC0: Error 19809 Creating archive log file to '/u01/app/oracle/product/11.2.0.4/fast_recovery_area/REDHAT/archivelog/2018_09_25/o1_mf_1_72_%u_.arc'
Errors in file /u01/app/oracle/product/11.2.0.4/diag/rdbms/redhat/REDHAT/trace/REDHAT_arc2_24458.trc:
ORA-19815: WARNING: db_recovery_file_dest_size of 2147483648 bytes is 99.97% used, and has 650752 remaining bytes available.
************************************************************************
You have following choices to free up space from recovery area:
1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard,
   then consider changing RMAN ARCHIVELOG DELETION POLICY.
2. Back up files to tertiary device such as tape using RMAN
   BACKUP RECOVERY AREA command.
3. Add disk space and increase db_recovery_file_dest_size parameter to
   reflect the new space.
4. Delete unnecessary files using RMAN DELETE command. If an operating
   system command was used to delete files, then use RMAN CROSSCHECK and
   DELETE EXPIRED commands.
************************************************************************

Cause:

Recovery Destination is full
Recovery Destination has reached the upper limit as defined by Size parameter.

Solution

Increase the Fast Recovery Area Size or Clean the destination using proper method like Using Rman, backup and delete the Archive logs.

 Then there is a scenario that as per Database Views/Metadata, Recovery Destination is full but when you check on the OS/storage level, there is plenty of space available.


SQL> select substr(name, 1, 30) name, space_limit AS quota,space_used as used,space_reclaimable as reclaimable,number_of_files as files from  v$recovery_file_dest ;

NAME          QUOTA    USED       RECLAIMABLE      FILES
------------------------------ ----------     -----------   ---------------   ------------------      ---------
/u01/app/oracle/product/11.2.0 4194304   3452050432  1767412224        27

 You can increase the Fast Recovery Area size as below 

SQL>alter system set db_recovery_file_dest_size='4G' scope=BOTH;

SQL> select substr(name, 1, 30) name, space_limit as quota,space_used as used,space_reclaimable as reclaimable,number_of_files as files from  v$recovery_file_dest ;

NAME          QUOTA       USED       RECLAIMABLE   FILES
------------------------------ ----------     -----------     ---------------    ------------------   ---------
/u01/app/oracle/product/11.2.0  4294967296   3452050432    1767412224     27

We can check Fast Recovery Area Size using Below parameter

SQL> show parameter db_recovery_file_dest_size;

NAME      TYPE   VALUE
------------------------------------   -----------  ----------------
db_recovery_file_dest_size  big integer    4G


(OR)

We can do that with RMAN using two commands, Crosscheck and Delete.


First, Run Crosscheck command for Archivelogs
crosscheck archivelog all;

Second, Delete the Expired Archive Logs
delete expired archivelog all;

Once, both of the above commands are completed, check the “v$flash_recovery_area_usage” to confirm that correct information is being reflected for used space for Archive logs.

v$rman_configuration - no rows selected

$
0
0
When you have default configurations for RMAN, then running of v$rman_configuration view will not give you any output. Once you touched any configuration item, then you able to see some outputs for this view.

Example:

My default config:

RMAN> show all;

using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name TESTTMP are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/12.1.0/dbhome_1/dbs/snapcf_testtmp.f'; # default

RMAN> 


and out put for v$rman_configuration is:

SQL> select NAME,VALUE from v$rman_configuration;

no rows selected


Now I am going to change some configuration and then you can see the difference:

RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 2;

new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
new RMAN configuration parameters are successfully stored

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

RMAN> 

SQL> select NAME,VALUE from v$rman_configuration;

NAME                   VALUE
---------------------- ---------------------------------------------
RETENTION POLICY          TO REDUNDANCY 1
CONTROLFILE AUTOBACKUP    ON

SQL> 

Some times you need to reset the whole RMAN config with one shot, instead of running several clear commands like the following,
'RMAN> CONFIGURE BACKUP OPTIMIZATION CLEAR;' , simply run the RESETCONFIG.

SQL> EXECUTE DBMS_BACKUP_RESTORE.RESETCONFIG;
PL/SQL procedure successfully completed.

-- After executing this command, the v$rman_configuration view is empty, which means that all
-- RMAN persistent settings are default.

SQL> select NAME,VALUE from v$rman_configuration;

no rows selected

SQL>

Error: ORA-16810: multiple errors or warnings detected for the database - Fix

$
0
0
Monitoring a Data Guard Configuration:

The scenario in this section demonstrates how to use the SHOW command and monitorable database properties to identify and resolve a failure situation.

Step 1   Check the configuration status.
The status of the broker configuration is an aggregated status of all databases and instances in the broker configuration. You can check the configuration status first to determine whether or not any further action needs to be taken. If the configuration status is SUCCESS, everything in the broker configuration is working fine. However, if you see the following error, it means something is wrong in the configuration:
DGMGRL> SHOW CONFIGURATION;
Configuration
 Name:                DRSolution
 Enabled:             NO
 Protection Mode:     MaxPerformance
 Fast-Start Failover: DISABLED
 Databases:
    SALESPRD    - Primary database
    SALESDR     - Physical standby database
Current status for "DRSolution":
Warning: ORA-16607: one or more databases have failed
In this case, you need to continue on to Step 2 to determine the actual failure.
Step 2   Check the database status.
To identify which database has the failure, you need to go through all of the databases in the configuration one by one. In this example, the error happens to be on the primary database SALESPRD:
DGMGRL> SHOW DATABASE 'SALESPRD';
The command returns the following output:
Database
  Name:            SALESPRD
  Role:            PRIMARY
  Enabled:         YES
  Intended State:  TRANSPORT-ON
  Instance(s):
    sales1
Current status for "SALESPRD":
Error: ORA-16810: multiple errors or warnings detected for the database
Step 3   Check the StatusReport monitorable database property.
When you see message ORA-16810, you can use the StatusReport monitorable database property to identify each of the errors or warnings:
DGMGRL> SHOW DATABASE 'SALESPRD''StatusReport';
STATUS REPORT
       INSTANCE_NAME   SEVERITY ERROR_TEXT
              sales1      ERROR ORA-16737: the redo transport service for
standby " SALESDR" has an error
             sales1    WARNING ORA-16714: the value of property
LogArchiveTrace is inconsistent with the database setting
             sales1    WARNING ORA-16715: redo transport-related property
ReopenSecs of standby database " SALESDR" is inconsistent
Step 4   Check the LogXptStatus monitorable database property.
You see error ORA-16737 in the previous status report in Step 3. To identify the exact log transport error, you can use LogXptStatus monitorable database property:
DGMGRL> SHOW DATABASE 'SALESPRD''LogXptStatus';
LOG TRANSPORT STATUS
PRIMARY_INSTANCE_NAME STANDBY_DATABASE_NAME               STATUS
              sales1              SALESDR ORA-12541: TNS:no listener
Now you know the exact reason why redo transport services failed. To fix this error, start the listener for the physical standby database  SALESDR.
Step 5   Check the InconsistentProperties monitorable database property.
You also see warning ORA-16714 reported in Step 3. To identify the inconsistent values for property LogArchiveTrace, you can use the InconsistentProperties monitorable database property:
DGMGRL> SHOW DATABASE 'SALESPRD''InconsistentProperties';
INCONSISTENT PROPERTIES
   INSTANCE_NAME   PROPERTY_NAME    MEMORY_VALUE    SPFILE_VALUE    BROKER_VALUE
          sales1   LogArchiveTrace           255            0            0
It seems that the current database memory value (255) is different from both the server parameter file (SPFILE) value (0) and Data Guard broker's property value (0). If you decide the database memory value is correct, you can update Data Guard broker's property value using the following command:
DGMGRL> EDIT DATABASE 'SALESPRD' SET PROPERTY 'LogArchiveTrace'=255;
Property "LogArchiveTrace" updated
In the previous command, Data Guard broker also updates the spfile value for you so that value for LogArchiveTrace is kept consistent.
Step 6   Check the InconsistentLogXptProps monitorable database property.
Another warning you see in the status report returned in Step 3 is ORA-16715. To identify the inconsistent values for the redo transport configurable database property, ReopenSecs, you can use the InconsistentLogXptProps monitorable database property.
DGMGRL> SHOW DATABASE 'SALESPRD''InconsistentLogXptProps';
INCONSISTENT LOG TRANSPORT PROPERTIES
   INSTANCE_NAME    STANDBY_NAME   PROPERTY_NAME    MEMORY_VALUE    BROKER_VALUE
          sales1         SALESDR      ReopenSecs             600             300
The current database memory value (600) is different from the Data Guard broker's property value (300). If you think the broker's property value is correct, you can fix the inconsistency by re-editing the property of the standby database with the same value, as shown in the following example:
DGMGRL> EDIT DATABASE 'SALESDR' SET PROPERTY 'ReopenSecs'=300;
Property "ReopenSecs" updated
You can also reenable the standby database or reset the primary database state to TRANSPORT-ON to fix the inconsistency, but re-editing the property is the simplest.

Move LOB objects and LOB indexes to different Tablespace

$
0
0
Fix a block crorruption issue for LOB indexes in a tablespace which we want to drop.

Here are some views to find LOB objects and LOB indexes:

-- To find LOB objects from a tablespace:
e.g.,
SELECT SEGMENT_NAME, SEGMENT_TYPE, OWNER, TABLESPACE_NAME
  FROM DBA_SEGMENTS
 WHERE TABLESPACE_NAME = 'PAYROLL'
   AND SEGMENT_TYPE LIKE 'LOB%'
 ORDER BY 1;

Sample out:

SEGMENT_NAME                SEGMENT_TYPE       OWNER TABLESPACE_NAME
------------------------------ ------------------ ---------- -------
SYS_IL0000077613C00006$$       LOBINDEX           PAYROLL    PAYROLL
SYS_IL0000077671C00006$$       LOBINDEX           PAYROLL    PAYROLL
SYS_IL0000078212C00001$$       LOBINDEX           PAYROLL    PAYROLL
SYS_IL0000078458C00006$$       LOBINDEX           PAYROLL    PAYROLL
SYS_LOB0000077613C00006$$      LOBSEGMENT         PAYROLL    PAYROLL
SYS_LOB0000077671C00006$$      LOBSEGMENT         PAYROLL    PAYROLL
SYS_LOB0000078212C00001$$      LOBSEGMENT         PAYROLL    PAYROLL
SYS_LOB0000078458C00006$$      LOBSEGMENT         PAYROLL    PAYROLL

8 rows selected

Note: Segments prefixed with 'SYS_IL....' is log index and segements prefixed with 'SYS_LOB.....' is table.

-- To find Table Name for Log segment
e.g.,
SQL> select owner,table_name,column_name,tablespace_name
  2  from dba_lobs
  3  where segment_name='SYS_LOB0000077613C00006$$';

OWNER      TABLE_NAME                     COLUMN_NAME        TABLESPACE_NAME
---------- ------------------------------ ----------------------------------
PAYROLL    PAY_LOAN                       INSTALLMENT        PAYROLL
SQL>

-- To find Table name for LB Index:
e.g.,
SQL> select owner, table_name, column_name, segment_name, index_name
  from dba_lobs
 where index_name = 'SYS_IL0000077613C00006$$';

OWNER      TABLE_NAME COLUMN_NAME     SEGMENT_NAME             INDEX_NAME
---------- ---------- ---------------  -------------------------
PAYROLL    PAY_LOAN   INSTALLMENT     SYS_LOB0000077613C00006$$      SYS_IL0000077613C00006$$
SQL>

A LOB is made up of a LOB data segment storing LOB data and a LOB index segment used to access LOB data. SYS_LOBxxx is the LOB data segment and SYS_ILxxx is the LOB index segment. As a consequence it is meaningless to try to drop only the LOB index segment (and I don't think it is possible to do so): you can only drop the LOB column to drop data and index segment or maybe try to move the column to be stored in row only if LOB size allows.

How to move lobsegment and  lobindex to a different Tablespace?

when I am executing the following statement in order to move the LOBINDEX, I am getting the errors listed below:

SQL> ALTER INDEX SYS_IL0000265968C00002$$ REBUILD TABLESPACE TEST;
ALTER INDEX SYS_IL0000265968C00002$$ REBUILD TABLESPACE TEST
*
ERROR at line 1:
ORA-02327: cannot create index on expression with datatype LOB



Workaround:

-- create a table in USERS tablespace

CREATE TABLE TEST_TBL
(
TEST_ID NUMBER NOT NULL,
TEST_NAME CLOB,
CONSTRAINT PK_TEST PRIMARY KEY(TEST_ID)
) tablespace USERS;

-- see the tables's tablespace name

SQL> col owner format a5;
SQL> column segment_name format a10;
SQL> col segment_type format a10;
SQL> col tablespace_name format a10;
SQL> select owner,segment_name,segment_type,tablespace_name
  2   from dba_segments where segment_name='TEST_TBL';

OWNER SEGMENT_NA SEGMENT_TY TABLESPACE
----- ---------- ---------- ----------
SYS   TEST_TBL   TABLE      USERS

SQL>

-- See the LOB index

SQL> SELECT index_name, tablespace_name
  2  FROM user_indexes WHERE table_name = 'TEST_TBL';

INDEX_NAME                     TABLESPACE
------------------------------ ----------
SYS_IL0000265968C00002$$       USERS
PK_TEST                        USERS

SQL>

-- Move table to different tablespace;

SQL> ALTER TABLE TEST_TBL MOVE TABLESPACE TEST;

Table altered.

SQL> select owner,segment_name,segment_type,tablespace_name
  2  from dba_segments where segment_name='TEST_TBL';

OWNER SEGMENT_NA SEGMENT_TY TABLESPACE
----- ---------- ---------- ----------
SYS   TEST_TBL   TABLE      TEST

SQL>

SELECT index_name, tablespace_name FROM user_indexes WHERE table_name = 'TEST_TBL';

INDEX_NAME                     TABLESPACE
------------------------------ ----------
SYS_IL0000265968C00002$$       USERS
PK_TEST                        USERS

SQL>

See the above results, table is moved from 'USERS' tablespace to 'TEST' tablespace but index remain in same USERS tablespace.  This is because LOB data is stored outside of the table.

The below example, TEST_NAME is the CLOB column which we want to move to new tablespace and EXAMPLE is target tablespace. Above command will successfully move LOB segments to the new tablespace. We can verify it by issuing same sql again.


SQL> ALTER TABLE TEST_TBL MOVE LOB(TEST_NAME) STORE AS (TABLESPACE TEST);

Table altered.

SQL> SELECT index_name, tablespace_name FROM user_indexes WHERE table_name = 'TEST_TBL';

INDEX_NAME                     TABLESPACE
------------------------------ ----------
PK_TEST                        USERS
SYS_IL0000265968C00002$$       TEST

Note : "small" LOBs stored inline (ie in the row itself) are not in a seperate LOBSEGMENT at all. That is called STORAGE IN ROW and is the default for LOBs of 4000bytes or less.
Viewing all 1640 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>