Monday, July 6, 2020

ORA-31626: job does not exist ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79

Error
ERROR at line 1:
ORA-31626: job does not exist
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
ORA-06512: at "SYS.DBMS_DATAPUMP", line 1137
ORA-06512: at "SYS.DBMS_DATAPUMP", line 3440
ORA-06512: at "SYS.DBMS_DATAPUMP", line 5296
ORA-06512: at line 7

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit
Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-31626: job does not exist
ORA-31650: timeout waiting for master process response

Action
check streams_pool_size
check ophan job

Cause
SYS datapump object corrupted or missing

Solution

spool d:\ab.txt
@d:\app\Administrator\product\11.2.0\dbhome_1\RDBMS\ADMIN\catproc.sql
@d:\app\Administrator\product\11.2.0\dbhome_1\RDBMS\ADMIN\utlrp.sql
spool off


or

shutdown immediate;
startup upgrade;

@d:\app\Administrator\product\11.2.0\dbhome_1\RDBMS\ADMIN\catalog.sql
@d:\app\Administrator\product\11.2.0\dbhome_1\RDBMS\ADMIN\catproc.sql
@d:\app\Administrator\product\11.2.0\dbhome_1\RDBMS\ADMIN\utlrp.sql


ORA-00600: internal error code, arguments: [qm_get_kusr]

Error
ORA-00604: error occurred at recursive SQL level 1
ORA-01001: invalid cursor
ORA-00600: internal error code, arguments: [qm_get_kusr], [], [], [], [], [], [], [], [], [], [], []
XDB SGA reset to NULL.


Cause
XML corrupted

Solution

uninstall

shutdown immediate;
startup;

@D:\app\Administrator\product\11.2.0\dbhome_1\RDBMS\ADMIN\catnoqm.sql


shutdown immediate;
startup upgrade;

spool D:\app\install_xml_db.log
@d:\app\Administrator\product\11.2.0\dbhome_1\RDBMS\admin\catqm.SQL xdb sysaux temporary YES

shutdown immediate;
startup;
@d:\app\Administrator\product\11.2.0\dbhome_1\RDBMS\admin\utlrp.sql


Sunday, July 5, 2020

Happy Guru Purnima

Saturday, July 4, 2020

Cyber Security Precautions

Union to Unpivot convert for performance

SELECT
    DISTINCT Remissierdetail.Scode AS oowncode
  FROM Remissierdetail Remissierdetail
  WHERE Remissierdetail.firmnumber   = 'KSH-000001'
  AND Remissierdetail.Scode !        = Rpad(' ',10)
  UNION
  SELECT
    DISTINCT Remissierdetail.Scode1 AS oowncode
  FROM Remissierdetail Remissierdetail
  WHERE Remissierdetail.firmnumber   = 'KSH-000001'
  AND Remissierdetail.Scode1 !       = Rpad(' ',10)
  UNION
  SELECT
    DISTINCT Remissierdetail.Scode2 AS oowncode
  FROM Remissierdetail remissierdetail
  WHERE Remissierdetail.Firmnumber   = 'KSH-000001'
  AND Remissierdetail.Scode2 !       = Rpad(' ',10)
  UNION
  SELECT
    DISTINCT Remissierdetail.Scode3 AS oowncode
  FROM Remissierdetail Remissierdetail
  WHERE remissierdetail.Firmnumber   = 'KSH-000001'
  AND remissierdetail.Scode3 !       = Rpad(' ',10)




select /* kshitij */ distinct coowncode
from Remissierdetail
unpivot 
(
  coowncode
  for node in (Scode, 
               Scode1, 
               Scode2, 
               Scode3)
) where  Firmnumber   = 'KSH-000001' and coowncode != Rpad(' ',10);

ORA-31626 ORA-31633 ORA-06512 ORA-01950

ORA-31626 ORA-31633 ORA-06512 ORA-01950
ORA-31626: job does not exist
ORA-31633: unable to create master table "SYSTEM.SYS_EXPORT_FULL_09"
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPV$FT", line 1020
ORA-01950: no privileges on tablespace 'SYSTEM'

 

ALTER USER system QUOTA unlimited ON SYSTEM;
ALTER USER system QUOTA unlimited ON USR;
ALTER USER system QUOTA unlimited ON INDX;

GRANT UNLIMITED TABLESPACE TO SYSTEM;

 

ALTER USER ldbo QUOTA unlimited ON SYSTEM;
ALTER USER ldbo QUOTA unlimited ON USR;
ALTER USER ldbo QUOTA unlimited ON INDX;

GRANT UNLIMITED TABLESPACE TO ldbo;

 

ORA-12170: TNS:Connect timeout occurred

If error is occur at time of software login, plz check tnsping for db service at local / App server.
if error is occur at time of process, plz check the db links.

Tnsping 172.168.1.7:1521/kshitij

Telnet 172.168.1.7 1521


ORA-01536: space quota exceeded for tablespace 'USR'


ALTER USER LDBO QUOTA unlimited ON USR;

 

ORA-14400 inserted partition key does not map to any partition

Alter table LDBO.POWEROFATTORNEYSTOCKS add PARTITION SAUDA_APR2019 values LESS THAN (TO_DATE('01-MAY-2019','DD-MON-YYYY'))  TABLESPACE USR STORAGE (INITIAL 100M NEXT 100M );

 

 

Alter table LDBO.TBLSNPRISKDETAILS add PARTITION SAUDA_APR2019 values LESS THAN (TO_DATE('01-MAY-2019','DD-MON-YYYY'))  TABLESPACE USR STORAGE (INITIAL 100M NEXT 100M );

 

Oracle 19c Features for Developer and DBA

Features which can help us

Row limiting : Oracle 12c onwards introduces sql syntax for row limiting.  This makes it easier to retrieve records in sets for display or processing.

 

Example :-

 

create table employee (id integer primary key, name varchar2(10));

insert into employee values (1,'Adam');

insert into employee values (2,'Ben');

insert into employee values (3,'Colin');

insert into employee values (4,'Dean');

insert into employee values (5,'Evan');

insert into employee values (6,'Frank');

insert into employee values (7,'Greg');

insert into employee values (8,'Hank');

insert into employee values (9,'Ian');

insert into employee values (10,'Jack');

commit;

 

SQL> select * from employee order by id fetch first 3 rows only;

 

        ID NAME

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

         1 Adam

         2 Ben

         3 Colin

 

SQL> select * from employee order by id offset 3 rows fetch next 3 rows only;

 

        ID NAME

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

         4 Dean

         5 Evan

         6 Frank

 

SQL> select * from employee order by id fetch first 50 percent rows only;

 

        ID NAME

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

         1 Adam

         2 Ben

         3 Colin

         4 Dean

         5 Evan

 

Extended Datatypes VARCHAR2 32767 bytes

it is now possible to create VARCHAR2, NVARCHAR2, and RAW attributes of size 32767 bytes.

 

Limitations to RESOURCE, SELECT ANY DICTIONARY

Dictionary tables containing password hashes (DEFAULT_PWD$, ENC$, LINK$, USER$, USER_HISTORY$, XS$VERIFIERS) are no longer included in the SELECT ANY DICTIONARY system privilege.  This makes it safer to give developers access to dictionary tables for tuning and debugging, without giving them the chance to run brute force attacks ...

 

Data Redaction via DBMS_REDACT SECURE SENSTIVE DATA(MASKING) which I shared previously

 

some bulk transactions like "create table as" and "insert into select from" will automatically collect statistics. No need to analyze

 

Identity columns

In previous versions of Oracle there was no implicit relationship between a primary key and the sequence that maintained it's value, so developers needed to implement this relationship via insert triggers or application code.  Oracle 12c removes that requirement for custom coding by implementing the relationship in the CREATE TABLE statement using the IDENTITY clause.

 

 

SQL> CREATE TABLE TEST_TABLE (ID NUMBER GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY, TEXT VARCHAR2(100));

 

Table created.

 

When we insert into the table the ID column is automatically populated.

 

SQL> insert into test_table (text) values ('aaa');

1 row created.

 

SQL>commit;

 

Commit complete.

 

SQL> select * from test_table;

 

     ID TEXT

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

      1 aaa

 

When we created the table a sequence was also created.

 

SQL> select object_name, object_type from dba_objects where owner = 'TEST';

 

OBJECT_NAME     OBJECT_TYPE

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

SYS_C009854     INDEX

ISEQ$$_91602    SEQUENCE

TEST_TABLE      TABLE

 

sequence.nextval as default and identity columns

The new Oracle 12c now allows to define a table with the sequence.nextval directly in the in-line column definition:

 

SQL> create table bar (

2 id number generated as identity,

3 foo varchar2(50) not null,

4 constraint bar_pk primary key (id)

5 );

 

Table created.

 

SQL> insert into bar (foo) values ('baz');

 

1 row created.

 

SQL> insert into bar (foo) values ('test');

 

1 row created.

 

SQL> insert into bar (foo) values ('whoo');

 

1 row created.

 

SQL> commit;

 

Commit complete.

 

SQL> select * from bar;

 

ID FOO

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

1 baz

2 test

3 whoo

 

Concurrent Execution of UNION and UNION ALL Branches Oracle Database 12C release 1

 

UNION or UNION ALL consists of many queries(branches) that in pre 12C releases were executed one by one.

 

<BRANCH1>

UNION

<BRANCH2>

 

<BRANCH1>

UNION ALL

<BRANCH2>

 

 

So in pre 12C first  is processed BRANCH1 then BRANCH2. Of course each individual query(branch) can be processed in serial or in parallel but only one branch at time.

 

Oracle 12C allows to run branches(statement) of UNION or UNION ALL concurrently. It means that BRANCH2 can be processed together with BRANCH1 :) . It can even return data faster than BRANCH1.

 

This feature is turned on automatically and entire UNION or UNION ALL is processed in parallel

 

 

Enhancement allows PLSQL declarations in the WITH clause

https://oracle-base.com/articles/12c/with-clause-enhancements-12cr1

 

JSON compatiabilty

Already shared

 

SQL Plus Last Login Time

select USERNAME,LAST_LOGIN from DBA_USERS where LAST_LOGIN is not null;

 

sequence reset

alter sequence ldbo.FWDBROKUNIQUENUMBER restart start with 1;

SELECT ldbo.FWDBROKUNIQUENUMBER.NEXTVAL FROM dual;

 

default on null

There is new feature: default on null. For example:

 

CREATE TABLE tab1 (

  col1        NUMBER DEFAULT 5,

  col2        NUMBER DEFAULT ON NULL 7,

  description VARCHAR2(30)

);

So when you try to INSERT null in col2, this will automatically be 7.

 

Oracle Default User

select * from dba_users where oracle_maintained='Y';

 

READ ANY TABLE

GRANT READ ANY TABLE TO psmith;

As with the READ object privilege, the READ ANY TABLE system privilege does not enable users to lock tables in exclusive mode nor select tables for update operations. Conversely, the SELECT ANY TABLE system privilege enables users to lock the rows of a table, or lock the entire table, through a SELECT ... FOR UPDATE statement, in addition to querying any table.

 

PRIVATE TEMPORARY TABLES

Private temporary tables enables Oracle 19c users to create temporary database objects that are automatically dropped at the end of a transaction or a session.

 

You can create temporary tables with these characteristics:

– NAME must be prefixed by “ORA$PTT_” (or the current value of PRIVATE_TEMP_TABLE_PREFIX initialization parameter)

– DATA is automatically deleted at the end of the transaction (just like GLOBAL TEMPORARY TABLES created with ON COMMIT DELETE ROWS clause)

– DEFINITION is automatically dropped at the end of the transaction (ON COMMIT DELETE DEFINITION) or at the end of the session (ON COMMIT PRESERVE DEFINITION)

This feature is useful for developers as well as DBAs, because it could reduce the number of temporary or “test” tables created in the database.

Example:

CREATE PRIVATE TEMPORARY TABLE ora$ptt_testptt (testcol NUMBER)

ON COMMIT DROP DEFINITION;

 

 

SQL CANCELLING

A new command is introduced for DBAs to cancel blocking or too expensive statements instead of kill the originating session.

ALTER SYSTEM CANCEL SQL ‘sid,serial#’;

ALTER SYSTEM CANCEL SQL ‘sid,serial#,sqlid’;

ALTER SYSTEM CANCEL SQL ‘sid,serial#,@inst#’;

ALTER SYSTEM CANCEL SQL ‘sid,serial#,@inst#,sqlid’;

 

 

APPROX_COUNT(), APPROX_SUM() and APPROX_RANK() are introduced with Oracle 18c, which can calculate 99% accurate results in very high speed.

select oowncode, approx_count(*) 

from sauda

group by oowncode

having approx_rank(partition by oowncode order by approx_count(*) desc) <= 1

order by 1;

 

DBMS_LOCK.SLEEP is depreciated in Oracle 18c and DBMS_SESSION.SLEEP is introduced, and is available with no additional grants needed.

 

 

DBMS_LOB UTL directory checking ORA-22288 file or LOB operation FILEOPEN failed File does not exists or user does not have read or write privileges

alter system set "_kolfuseslf" = true scope=spfile sid='*';

 

restart both node services

 

select inst_id,name,value from gv$parameter where name like '%kolfuseslf%';

 

Virtual Private Database VPD to hide/secure table column data | Not Encryption

CREATE OR REPLACE

FUNCTION FN_LDVPD (obj_owner IN VARCHAR2, obj_name IN VARCHAR2)

RETURN VARCHAR2

AS

BEGIN

RETURN 'rowid = ''0''';

END FN_LDVPD;

/

 

begin

      dbms_rls.drop_policy (

          object_schema     => 'LDBO',

          object_name      => 'ACCOUNTADDRESSDETAIL',

          policy_name      => 'LD_PAN_POLICY'

      );

END;

/

 

 

SELECT OOWNCODE,PANGIR FROM ACCOUNTADDRESSDETAIL WHERE TRIM(PANGIR) IS NOT NULL;

 

BEGIN

DBMS_RLS.ADD_POLICY(object_schema=> 'LDBO',

object_name=> 'ACCOUNTADDRESSDETAIL',

policy_name=> 'LD_PAN_POLICY',

function_schema=> 'LDBO',

policy_function=> 'FN_LDVPD',

statement_types   => 'SELECT',

sec_relevant_cols=> 'PANGIR',

policy_type => DBMS_RLS.SHARED_STATIC,

sec_relevant_cols_opt=> dbms_rls.ALL_ROWS);

END;

/

 

SELECT OOWNCODE,PANGIR FROM ACCOUNTADDRESSDETAIL WHERE TRIM(PANGIR) IS NOT NULL;

ODAC for Visual Studio Download Link Oracle.ManagedDataAccess.dll

https://www.oracle.com/technetwork/developer-tools/visual-studio/downloads/index.html

 

install it at Visual Studio machine to select the dll in project

 

 

DLL location

Oracle.ManagedDataAccess.dll

C:\Program Files (x86)\Oracle Developer Tools for VS2017\odp.net\managed\common

 

Ora-24247 Add User

Exec dbms_network_acl_admin.add_privilege ('utl_http.xml','KSHITIJ',TRUE,'connect',null,null);  

Exec dbms_network_acl_admin.add_privilege ('utl_http.xml','KSHITIJ',TRUE,'resolve',null,null);  
commit; 

Oracle Error Exception Handling User Defined Message

ORA-01652

Temporary tablespace or server space is full. Please contact to your IT/Server Team.

 

ORA-01653

Database tablespace or server space is full. Please contact to your IT/Server Team.

 

ORA-01691

Database tablespace or server space is full. Please contact to your IT/Server Team.

 

ORA-12801

Check the Server Resources. Please contact to your IT/Server Team.

 

ORA-12805

Check the Server Resources. Please contact to your IT/Server Team.

 

 

ORA-03111

Network/Firewall timeout between application and server. Please contact to your IT/Network Team.

 

ORA-03135

Network/Firewall timeout between application and server. Please contact to your IT/Network Team.

               

ORA-00054

Resource is busy. Please try after sometimes.

 

ORA-12805: parallel query server died unexpectedly

Error
ORA-12805: parallel query server died unexpectedly

Cause
The Oracle parallel query server is unable to handle the degree of parallelism specified either due to a conflict or because

the number of parallel progress is too many for the resources in the environment on which it runs.

Solution
Check alert.log

Increase Resources(Server Space/Add more temp files/oracle memory) where you are running that query/report.
This query/report is working fine in production.


for Details please raise the SR to Oracle Global Support.

ORA-08103 object no longer exists

Error
ORA-08103 object no longer exists


Cause

1:  Database corruption of a header block.

2:  Accidental delete of the target table. (check the recyclebin)

3: Data file I/O error (check alert log)

4: corruption in UNDO log (drop and re-create)

5. An index is disabled or is offline.

6. Rebuild index job is running for tables and indexes used in error raised query.

Solution
6. Check process/report/query after completed rebuild index.

For other cause contact to Production DBA team, they will contact to Oracle global support.

Ora-03111 break received on communication channel

Error: Ora-03111 break received on communication channel

Cause:

a. Network/Firewall timeout between application server and database server.
eg. If firewall timeout is 1 min then query takes more than 1 min to give result to application, then it will throw that
error.

b. SQL Query cross the specified timeout value from web services like IIS connection.


Analysis
run same query from plsql developer/Toad and Application at machine or server at Data Center.


Action/Solution
Increase the Network/Firewall timeout if any.
Increase any IIS timeout if any.

if issue still exists, then please raise the SR to Oracle Global Support.

ORA-01758: table must be empty to add mandatory (NOT NULL) column

Command

Alter Table Tblpledgeemaster add nFundingallowed number(16,4) not null /* Contains Total Funding allowed */ ;

 

Error

ORA-01758: table must be empty to add mandatory (NOT NULL) column

 

 

Solution

 

1) provide a default value for the column along with alter table add column command.

 

 

2) Add the column without the NOT NULL constraint then update then modify not null

 

 

Alter Table Tblpledgeemaster add nFundingallowed number(16,4) /* Contains Total Funding allowed */ ;

 

UPDATE Tblpledgeemaster set nFundingallowed= 0;  /* Please contact to business team or developer for default value */

 

commit;

 

ALTER TABLE Tblpledgeemaster MODIFY (nFundingallowed NOT NULL);

 

3)  Empty the table, apply the NOT NULL and add the data back to the table

 

Tuesday, January 24, 2017

how to enable silverlight in chrome latest version

To work around Silverlight Chrome compatibility issue, 

Please add Chrome Extension: IE Tab in Chrome browser.



Followers