DBA Blogs
Let's have a quick overview of what Gitops is. Gitops is a new cool kid in the town. Gitops is a subset of Devops. GitOps is a practice that helps automate application deployment and infrastructure provisioning. It typically involves using Git, an open source version control system, as a single source of truth for declarative infrastructure and applications. Gitops is mostly used in deploying containerized application on Kubernetes cluster along with Kubernetes resources. I have another video in more detail around this and the link is in the description.
Tom:
What is really the difference and when you would use each of oracle datatypes:
1. Index-by-tables
2. Nested Tables
3. Varrays
My understanding is that index by tables are for data of same type that is stored in memory.
For nested tables you can store the variables values in oracle table.
Varrays are same as nested except they are confined to a certain number.
AM I correct?
Would you use a nested table for two tables like a PO table and items table iinstead of referring to two tables.
Thank you,
If I trace an execution of this statement
<code>alter table TAB1 enable foreign_key_cons_on_tab2</code>
then a recursive query similar to the following will attempt to find rows in TAB1 with no matching row in TAB2. If it fetches zero rows, then the constraint is enabled.
<code>
select /*+ all_rows ordered dynamic_sampling(2) */
A.rowid
from TAB1 A , TAB2 B
where ( A.KEY1 is not null )
and ( B.KEY1 (+) = A.KEY1 )
and ( B.KEY1 is null)
</code>
When I look at the recursive statement's execution plan, I see that it is serial in nature. If I manipulate some parameters I can coerce a parallel execution plan.
But the execution of that plan remains serial. No parallel query slaves are enlisted and the query ends up taking longer to finish than the serial plan.
If I take that recursive query and execute it in SQL*Plus (at depth 0), then it executes in parallel and uses all the PQ slaves I expected.
Why? Since exclusive locks are taken, there should be no reason to preclude parallel execution.
I tried the following with no success
- alter session force parallel ddl
- alter session force parallel query
- creating a SQL profile to add a parallel
- increasing the table's degree of parallelism
UPDATE #1
Thanks to Tanel Poder's advice, I was able to make this work.
1. enable novalidate
2. enable validate
I would be lying if I said I wasn't disappointed in having to cache this kind of information.
Hi,
I am getting a table dump using an SQLplus client. The code is mentioned below.
The problem is, the value of any varchar field of the dump table is saved in the dump file with padded space.
means, if f1 is of varchar2(6) type field in a table. It has a value as "API" in the table. But when we took a dump of that table, the same field value is saved as "API " in the dump file.
code snapshot
******************************
<code>
sqlplus -s ${DB_USERNAME}/${DB_PASSWORD}@'(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = '"${CONN_STR}"')(PORT = '"${CONN_PORT}"'))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = '"${DB_NAME}"')))' << !EOF!
--/*************************/--
set echo off
set feedback off
set linesize 4000
set newpage NONE
set pagesize 0
set serveroutput off
set termout off
set flush off
set NUMWIDTH 128
set COLSEP ","
set markup csv on
set trimspool on
set sqlprompt ''
set long 9999999
set VERIFY OFF
set TERM OFF
set headsep off
set TRIMOUT ON
--/*******************************/--
--/**** Clear Screen & Buffer ****/--
--/*******************************/--
--/********clear scree***********************/--
clear screen
--/*****************************/--
--/**** Start spooling file ****/--
--/*****************************/--
---/*column record_count format 9999999*/--
set heading off
SPOOL $FILE_COUNT_FILE
select count(*) as record_count from ${SCHEMA_NAME}.$TABLE_NAME;
SPOOL OFF
set heading on
set pagesize 0 embedded on
SPOOL $FILE
select * from ${SCHEMA_NAME}.$TABLE_NAME;
SPOOL OFF
EXIT
!EOF!
******************************
The dump file snapshot is
******************************
"RATE_PLAN_CD","EFFECTIVE_DATE","SYS_CREATION_DATE","SYS_UPDATE_DATE","OPERATOR_ID","APPLICATION_ID","DL_SERVICE_CODE","DL_UPDATE_STAMP","BUNDLE_VALUE","DWN_RND_CP_IND","TIER_CHRG_IND","TENANT_CD","EXPIRATION_DATE"
"SO_PAYG_DFL_ALL_1911","01-JAN-09","21-JAN-16",,460,,"API ",,0,"N","FL","M2M","31-DEC-00"
"SI_MT_PAYG_ALL_1793","01-JAN-09","21-JAN-16",,460,,"API ",,0,"N","FL","M2M","31-DEC-00"
******************************
</code>
Pls guide, how to solve it.
I'm an 'accidental' DBA that's also been tasked with PL/SQL development work.
Ours is a small environment; I'm the only DBA plus another developer who is completely new to PL/SQL.
I'm working (development environment) on a basic package and after getting some compilation errors, I discovered the PLSQL_WARNINGS parameter and found it was set to:
<code>NAME TYPE VALUE
-------------- ------ --------------------------------------------------------
plsql_warnings string ERROR:INFORMATIONAL, DISABLE:PERFORMANCE, DISABLE:SEVERE </code>
Not quite what we want, so I ran this in SQL*Plus as SYS:
<code>ALTER SYSTEM SET PLSQL_WARNINGS = 'ENABLE:ALL' SCOPE=BOTH;</code>
which returned:
<code>System SET altered.</code>
To confirm it:
<code>show parameter PLSQL_WARNINGS;</code>
returned:
<code>NAME TYPE VALUE
-------------- ------ ----------
plsql_warnings string ENABLE:ALL </code>
So far, so good. Later that day I was demonstrating this setting to my boss and the settings had reverted back to the previous values.
This was not only awkward, but confusing as well. MOS tells me there is no known bug or other explanation for this behavior. The system is not getting restarted and the developer does not have privileges to change this parameter.
What gives?
Hi, Is it possible to convert a collection into json_object?
I have a collection named code1 of type codelist of table of Varchar2(2).
code1 = codelist('AB','CD', 'EF');
I want the above in JSOn format as below:
Is it possible? Please help
{
"codelist" : ['AB','CD',EF']
}
Hi
I had Oracle <b>12c Enterprise on Windows 64 </b>and MariaDB 10.2 on Ubuntu .
I have been using ODBC transparent gateway to send the data from Oracle to MariaDB.
I am in the process of transitioning to <b>Oracle Enterprise 19c on Solari</b>s and MariaDB 10.4 on RHEL8 .
It looks like , there are no native mariadb odbc drivers for Solaris.
What is your recommendation on connecting Maria DB ( RHEL) to Oracle 19 ( Solaris ) ?
With the current licensing model , only the ODBC Transparent Gateway covered with regular licensing?
This data transfer happens once a day ( via dbms_scheduler).
At the maximum , we will have 2000 records transferred between these DBMSes.
What is the best approach ?
Thanks very much.
Hi Tom,
I have recently upgraded a couple of databases (12.1 -> 19.17) and remote oracle client (19.3 - 19.14 ) on application servers connecting upgraded databases.
There exist only one case where 'set feedback off' is not working as expected when I commit from sqlplus client 19.14 to only one of those upgraded 19.17 DBs.
How may I trace sqlplus to find out reason of unexpected behaviour for 'set feedback of'.
Here is the test case I produced.
<code>
#########Connect to a database ( test1 ) on the same db_host and using same db_oracle_home where "SET FEEDBACK OFF" is working as EXPECTED.
infa64@dwhsas15> sqlplus test_user@dwhpx-scan:1521/test1
SQL*Plus: Release 19.0.0.0.0 - Production on Mi Jan 25 09:47:34 2023
Version 19.14.0.0.0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
Kennwort eingeben:
Letzte erfolgreiche Anmeldezeit: Mi Jan 25 2023 09:46:38 +01:00
Verbunden mit:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.17.0.0.0
SQL> commit;
Transaktion mit COMMIT abgeschlossen.
SQL> set feedback off
SQL> commit;
SQL> exit
Verbindung zu Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.17.0.0.0 beendet
#########Connect to a different database ( test2 ) on the same db_host and using same db_oracle_home where "SET FEEDBACK OFF" is NOT working as EXPECTED.
infa64@dwhsas15> sqlplus test_user@dwhpx-scan:1521/sim
SQL*Plus: Release 19.0.0.0.0 - Production on Mi Jan 25 09:48:01 2023
Version 19.14.0.0.0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
Kennwort eingeben:
Letzte erfolgreiche Anmeldezeit: Mi Jan 25 2023 06:01:50 +01:00
Verbunden mit:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.17.0.0.0
SQL> commit;
Transaktion mit COMMIT abgeschlossen.
SQL> set feedback off
SQL> commit;
Transaktion mit COMMIT abgeschlossen. --<< UNEXPECTED >>--
SQL>
</code>
I have a materialised view in my own schema which based on a table in another schema. However I want to modify the matrealise view to add a where clause which will never becomes true e.g. Where 1=2
Can i alter an existing materialised view to add this where clause in the MView query . Will alter command works or I have to drop and recreate the Mview (Which i am rluctatant to do actually)
Hi,
I have a table that holds about 2 million records. No column in the table can be used to divide rows equally. Initially when the data is loaded into the table, the bucket_number column is null. After data loaded, I would like to calculate and equally divide the total no. of records and update bucket_number column with number. Later the buckets will be processed parallelly by another batch process. I could use ntile to bucketize data but I want to persist the bucket number in table.
What is the best way to bucketize and update column in Oracle?
Dear Tom,
how can I create bind variable in Oracle Live SQL,
<code><variable variable_name data_type;>
example <variable dusko number;> </code>
just doesn't work, i get "Ussuported command" message...
Thanks and best regards
ORA-04063: package body "SYS.DBMS_NETWORK_ACL_ADMIN" has errors,
how do I reinstall this package?
I need to CREATE some test data where I want to CREATE N number of timestamps between 2 times for every 15 minute interval including the start time and less than the end time.
N would be defined as dbms_random between a low_number and a high_number.
I want to run something like this get_dates TIMESTAMP'2023-01-25 03:00:00', TIMESTAMP'2023-01-27 13:30:00', 10, 25
Any help would be greatly appreciated.
Pages
|