Feed aggregator
Can we Add C Style Pointers to PL/SQL?
In my last blog on Extreme PL/SQL I mentioned pointers in PL/SQL. PL/SQL does not support pointers or dynamic memory management in the same way that we can write in C code. In C code we can define a variable....[Read More]
Posted by Pete On 28/06/24 At 09:03 AM
Categories: Security Blogs
APEX AI Assistance ? Does it comes out of the Box ? or We need to Pay to AI Provider like ChatGPT ?
Hi There,
all the recent news about APEX AI Assistance for code generation ? doe sit comes out of the box ? or we need to configure and pay to AI/LLM provider like ChatGPT ?
I am referring to your recent video Build AI-Powered Enterprise Apps Faster with Oracle APEX (https://www.youtube.com/watch?v=qZD8wtn7qoI )
Regards,
Dr. Gyana
Categories: DBA Blogs
Export backup fails with ORA-39127: unexpected error from call to TAG: SCHEDULER Calling: SYS.DBMS_SCHED_CLASS_EXPORT.GRANT_EXP obj:
we see this error in the daily full=Y backup :
Processing object type DATABASE_EXPORT/SCHEMA/PROCACT_SCHEMA
ORA-39127: unexpected error from call to TAG: SCHEDULER Calling: SYS.DBMS_SCHED_CLASS_EXPORT.GRANT_EXP obj: SYS.IDX_RB$CLASS_54724 - SCHEDULER CLASS
ORA-01031: insufficient privileges
ORA-06512: at "SYS.DBMS_SCHED_MAIN_EXPORT", line 2601
ORA-06512: at "SYS.DBMS_SCHED_CLASS_EXPORT", line 41
ORA-06512: at line 1
ORA-06512: at "SYS.DBMS_SCHED_MAIN_EXPORT", line 2601
ORA-06512: at "SYS.DBMS_SCHED_CLASS_EXPORT", line 41
ORA-06512: at line 1
ORA-06512: at "SYS.DBMS_METADATA", line 11144
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
Processing object type DATABASE_EXPORT/EARLY_POST_INSTANCE_IMPCALLOUT/MARKER
But, when we checked ( as sysdba) - this object dosn't exist in the container that it runs:
SYS.IDX_RB$CLASS_54724
no changes were made to the database/ shell script that runs the export datapump backup.
we had seen the same issue on 10th june 2024, but without any changes the next days export backups ran good.
yesterday - again the same error is seen.
not sure what could be causing it - here is the export command that we use for daily backup:
( the $vars are location/filenames generated in script)
expdp $pcsbackup job_name=${jobname}\
directory=DIR_DBEXP\
dumpfile=${dmpfile_name}\
logfile=${logfile_name}\
full=y\
cluster=no \
parallel=4\
exclude=STATISTICS\
exclude=SCHEMA:\" IN \(SELECT USERNAME FROM DBATOOL.EXPDP_EXCLUDE_DWP_BACKUP_TABLES\)\"\
ENCRYPTION=DATA_ONLY \
ENCRYPTION_PASSWORD=<OurProdEncPassowrd> \
ENCRYPTION_MODE=DUAL \
COMPRESSION=DATA_ONLY
Categories: DBA Blogs
not able to export AUDSYS.AUD$UNIFIED:SYS_P23021 -- same table/partition was exported w/o issues yesterday by job using full=yes
our Daily job expdp has full=yes and worked OK till last night.
last night the expdp log showed:
ORA-31693: Table data object
"AUDSYS"."AUD$UNIFIED":"SYS_P23021" failed to load/unload and is being skipped due to error:
ORA-02354: error in exporting/importing data
ORA-08103: object no longer exists
Attempt to manually backup the same using same user created to export full database - fails with:
expdp $pcsbackup cluster=NO parallel=1 job_name=expdp_tbl DUMPFILE=expdp_gecdwp_full_2024_0618_222801_failedobjs_%U.dmp LOGFILE=expdp_gecdwp_full_2024_0618_222801_failedobjs.log directory=dir_dbexp exclude=statistics encryption=data_only ENCRYPTION_PASSWORD=***** ENCRYPTION_MODE=DUAL COMPRESSION=DATA_ONLY full=no tables=AUDSYS.AUD\$UNIFIED\:SYS_P23021
Export: Release 19.0.0.0.0 - Production on Wed Jun 19 09:03:27 2024
Version 19.20.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 19c EE Extreme Perf Release 19.0.0.0.0 - Production
Starting "PCSBACKUP"."EXPDP_TBL": /********@gecdwp_pcsbackup cluster=NO parallel=1 job_name=expdp_tbl DUMPFILE=expdp_gecdwp_full_2024_0618_222801_failedobjs_%U.dmp LOGFILE=expdp_gecdwp_full_2024_0618_222801_failedobjs.log directory=dir_dbexp exclude=statistics encryption=data_only ENCRYPTION_PASSWORD=******** ENCRYPTION_MODE=DUAL COMPRESSION=DATA_ONLY full=no tables=AUDSYS.AUD$UNIFIED:SYS_P23021
ORA-39166: Object AUDSYS.AUD$UNIFIED was not found or could not be exported or imported.
ORA-31655: no data or metadata objects selected for job
Job "PCSBACKUP"."EXPDP_TBL" completed with 2 error(s) at Wed Jun 19 09:04:08 2024 elapsed 0 00:00:39
tried different combos for table name:
AUDSYS.AUD\$UNIFIED:SYS_P23021 -- AND ABOVE - same error
expdp $pcsbackup cluster=NO parallel=1 job_name=expdp_tbl DUMPFILE=expdp_gecdwp_full_2024_0618_222801_failedobjs_%U.dmp LOGFILE=expdp_gecdwp_full_2024_0618_222801_failedobjs.log directory=dir_dbexp exclude=statistics encryption=data_only ENCRYPTION_PASSWORD=***** ENCRYPTION_MODE=DUAL COMPRESSION=DATA_ONLY full=no tables=AUDSYS.AUD$UNIFIED:SYS_P23021
Export: Release 19.0.0.0.0 - Production on Wed Jun 19 09:00:37 2024
Version 19.20.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 19c EE Extreme Perf Release 19.0.0.0.0 - Production
Starting "PCSBACKUP"."EXPDP_TBL": /********@gecdwp_pcsbackup cluster=NO parallel=1 job_name=expdp_tbl DUMPFILE=expdp_gecdwp_full_2024_0618_222801_failedobjs_%U.dmp LOGFILE=expdp_gecdwp_full_2024_0618_222801_failedobjs.log directory=dir_dbexp exclude=statistics encryption=data_only ENCRYPTION_PASSWORD=******** ENCRYPTION_MODE=DUAL COMPRESSION=DATA_ONLY full=no tables=AUDSYS.AUD:SYS_P23021
ORA-39166: Object AUDSYS.AUD was not found or could not be exported or imported.
ORA-31655: no data or metadata objects selected for job
Job "PCSBACKUP"."EXPDP_TBL" completed with 2 error(s) ...
Categories: DBA Blogs
LOB caching check
Hi,
In order to improve reading performance of a LOB column in my table, I enable CACHE option for it.
But when I check in the buffer cache using gv$bh (I did some SELECT queries on it so it can be cached), I cannot find any entries for my cached LOB.
<code>SELECT *
FROM gv$bh
WHERE lobid =
(SELECT object_id
FROM dba_lobs lob, dba_objects obj
WHERE lob.table_name = 'MY_TABLE' -- it contains only one lob column, so the returned result is unique
AND lob.SEGMENT_NAME = obj.object_name
AND lob.owner = obj.owner);</code>
Is this the way to go? or I m missing something?
Thanks.
Categories: DBA Blogs
Need a sql to find break hours hours between two dates and between 10PM to next day 6AM. 30mins break for every 4 hours
Could you please kindly check and advise on the following. i need to find break hours between two dates. and also i need to find if this break mins is within night hours (10PM to 6AM next day).
ex:
employee work schedule 11-MAY-2012 16:00:00 and 12-MAY-2012 09:00:00.
Break hour that fall between 10PM to 6 AM is as follows
8:00PM to 8:30PM - 1st Break
12:30 Am to 1:00 AM - 2nd Break
5:00AM to 05:30 AM - 3rd break
two of the breaks are between 10PM and 6AM next day hence my night hours break time is 60mins.
i am using following, but is there any better solution
<code> (SELECT COUNT(1)
FROM (SELECT TO_CHAR ((:SHIFT_START + ((val*4.5)/24)), 'YYYY-MM-DD HH24:MI:SS') TIME ,VAL
FROM (select to_number(val,0) VAL
from (select distinct regexp_substr('1,2,3,4,5','[^,]+',1,level) val
from dual
connect by level <=regexp_count('1,2,3,4,5',',')+1
order by val)
WHERE ROWNUM <=
( FLOOR (
( 24
* ( TO_DATE (
TO_CHAR (:SHIFT_END, 'YYYY-MM-DD hh24:mi'),
'YYYY-MM-DD hh24:mi')
- TO_DATE (
TO_CHAR (:SHIFT_START,
'YYYY-MM-DD hh24:mi'),
'YYYY-MM-DD hh24:mi')))
/ 4))
)
) DT
WHERE TO_DATE (DT.TIME,'YYYY-MM-DD HH24:MI:SS')
BETWEEN TO_DATE(TRUNC(:SHIFT_START),'YYYY-MM-DD HH24:MI:SS')+22/24 AND
TO_DATE(TRUNC(:SHIFT_START),'YYYY-MM-DD HH24:MI:SS')+24/24+6/24
)*0.5
ELSE 0 END NIGHT_BREAK_HOURS</code>
Appreciated your kind help in check and advise on this
Categories: DBA Blogs
unable to successfully created Rest Enabled Sql
1) I am using oracle xe 21c database, apex 24.1 and deployed on tomcat 9.0.90 on my labtop
2) I try to connect my office server using Rest enabled sql service. Where I rest enabled entire schema
3) On my labtop when I try to connect it giving me error : The URL of this remote server does not point to a REST Enabled SQL service. Please check the details of your REST Enabled SQL service definition.
4) When I write same url in browser and ending with table name it showing the data.
5) Before 24.1 menas in 18.x to 20.x its working.
6) For rest enabled sql require same version of ords both side? Please guide because both side apex version and ords version are different (my labtop and my office server I am try using remotely )
7) At my office I rest enabled schema from sql workshop->restfull service also run the following scripts
BEGIN
ORDS.enable_schema(
p_enabled => TRUE,
p_schema => 'SVM',
p_url_mapping_type => 'BASE_PATH',
p_url_mapping_pattern => 'hr',
p_auto_rest_auth => FALSE
);
COMMIT;
END;
/
PLEASE REFERE THE ATTACHED VIDEO
https://drive.google.com/file/d/1VONL-ngqD53xjnxKLWSzob63qtD-jSdy/view?usp=sharing
same case appear on apex.oracle.com
workspace :[redacted]
username:[redacted]
password :[redacted]
Application id :[redacted]
Rest enabled SQL service name : svm
Categories: DBA Blogs
Using pragma inline to affect every invocation of the specified subprogram
I understand how to use the online pragma before the invocation of a subprogram that should be inline, but based on the Oracle documentation (https://docs.oracle.com/en/database/oracle/oracle-database/19/lnpls/plsql-optimization-and-tuning.html#GUID-2E78813E-CF29-409D-9F8B-AA24B294BFA2) it should also be possible to use pragma inline to affect every invocation of the specified subprogram:
<i>When the INLINE pragma immediately precedes a declaration, it affects: Every invocation of the specified subprogram in that declaration</i>
Unfortunately when trying to do so it seems as if this would not work as expected when reading the documentation:
<code>
ALTER SESSION SET PLSQL_WARNINGS = 'ENABLE:ALL';
CREATE OR REPLACE PACKAGE foo IS
PROCEDURE bar;
END foo;
/
CREATE OR REPLACE PACKAGE BODY foo IS
PRAGMA INLINE (sub, 'YES');
PROCEDURE sub;
PROCEDURE bar IS
BEGIN
dbms_output.put_line('bar');
sub;
END bar;
PROCEDURE sub IS
BEGIN
dbms_output.put_line('sub');
END sub;
END foo;
/
SELECT * FROM user_errors;
</code>
PLW-05011: pragma INLINE for procedure 'SUB' does not apply to any calls
Categories: DBA Blogs
Can we Hack an Oracle APEX Application?
I talked recently about securing APEX and the different security angles that should be considered when securing data in application that is written using APEX and hosted in an Oracle database. There are multiple attack vectors from a web based....[Read More]
Posted by Pete On 28/05/24 At 09:35 AM
Categories: Security Blogs
Extreme PL/SQL
It has been a while since my last blog post here. I have not abandoned blogging. Over the last year and more I have blogged regularly and this is reflected in my Oracle ACE Pro contributions this last year. I....[Read More]
Posted by Pete On 25/06/24 At 10:04 AM
Categories: Security Blogs
AIOUG Oracle Community Yatra 2024 … I’m excited, are you?
I started my career in IT back in 1995 when I joined the United States Military (Army). As an eighteen-year-old […]
The post AIOUG Oracle Community Yatra 2024 … I’m excited, are you? appeared first on DBASolved.
Categories: DBA Blogs
Video on the Maximum Availability Protection Mode in Oracle DataGuard (with RAC)
I've published a new video demonstrating Maximum Availability Protection Mode in Oracle DataGuard.
Categories: DBA Blogs