Sunday, September 20, 2020

ORA-15234: target RDBMS compatibility (12.1.0.2.0) exceeds ASM compatibility (10.1.0.0.0)


New Disks are provisioned , which is greater than 2TB but unable to create disk group using those disks
 
devhost:NOTSET:/home/oracle $ oracleasm listdisks  | grep -i CBDEV
CBDEV_DATA1
CBDEV_RECO1
 
devhost:NOTSET:/home/oracle $ oracleasm querydisk CBDEV_DATA1
Disk "CBDEV_DATA1" is a valid ASM disk
 
devhost:NOTSET:/home/oracle $ oracleasm querydisk CBDEV_RECO1
Disk "CBDEV_RECO1" is a valid ASM disk
 
devhost:NOTSET:/home/oracle $ oracleasm querydisk /dev/asm/asm_CBDEV_DATA1
Device "/dev/asm/asm_cbdev_DATA1" is marked an ASM disk with the label "CBDEV_DATA1"
 
devhost:NOTSET:/home/oracle $  oracleasm querydisk /dev/asm/asm_CBDEV_RECO1
Device "/dev/asm/asm_cbdev_RECO1" is marked an ASM disk with the label "CBDEV_RECO1"
 
 
devhost:+ASM:/home/oracle $ sqlplus / as sysasm
 
SQL*Plus: Release 12.1.0.2.0 Production on Fri Mar 27 11:34:48 2020
 
Copyright (c) 1982, 2014, Oracle.  All rights reserved.
 
 
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Automatic Storage Management option
 
SQL> col header for a22
SQL> set pages 999 lines 280
SQL> col path for a33
SQL>  select header_status "Header", mode_status  "Mode", path "Path", lpad(round(os_mb/1024),7)||'Gb' "Disk Size" from   v$asm_disk where path like ‘%CB%’;
 
Header                 Mode    Path                              Disk Size
---------------------- ------- --------------------------------- ---------
PROVISIONED            ONLINE  ORCL:CBDEV_DATA1                    4096Gb
PROVISIONED            ONLINE  ORCL:CBDEV_RECO1                    1024Gb
 
 
SQL> select GROUP_NUMBER,MOUNT_STATUS,STATE,REDUNDANCY,NAME,PATH from v$asm_disk where path like ‘%CB%’;
 
GROUP_NUMBER MOUNT_S STATE    REDUNDA NAME                           PATH
------------ ------- -------- ------- ------------------------------ ---------------------------------
           0 CLOSED  NORMAL   UNKNOWN                                ORCL:CBDEV_DATA1
           0 CLOSED  NORMAL   UNKNOWN                                ORCL:CBDEV_RECO1
 
SQL> select state, name, type from v$asm_diskgroup;
 
STATE       NAME                           TYPE
----------- ------------------------------ ------
MOUNTED     RECO1                        EXTERN
MOUNTED     DATA1                   EXTERN
 
 
SQL> create diskgroup CBDEVDATA1 external redundancy disk  'ORCL:CBDEV_DATA1' name CBDEVDATA1;
create diskgroup CBDEVDATA1 external redundancy disk  'ORCL:CBDEV_DATA1' name CBDEVDATA1
*
ERROR at line 1:
ORA-15018: diskgroup cannot be created
ORA-15099: disk 'ORCL:CBDEV_DATA1' is larger than maximum size of 2097152 MBs
 
 
SQL> select group_number,name,state,compatibility, database_compatibility from v$asm_diskgroup where name like ‘%CB%’ ;
 
GROUP_NUMBER NAME                STATE       COMPATIBILITY                                                DATABASE_COMPATIBILITY
------------ ------------------------------ ----------- ---------------------------------------------------    --------------------------------------------
          11 RECO1                        MOUNTED     10.1.0.0.0                                                   10.1.0.0.0
          13 DATA1                       MOUNTED     10.1.0.0.0                                                   10.1.0.0.0
          
 
 
SQL> col name for a28
SQL> col VALUE for a22
SQL> select name, value,GROUP_NUMBER from  v$asm_attribute where name like 'comp%';
 
 
NAME                         VALUE                  GROUP_NUMBER
---------------------------- ---------------------- ------------
compatible.asm               12.1.0.2.0                        3
compatible.rdbms             12.1.0.2.0                        3
compatible.asm               12.1.0.2.0                        8
compatible.rdbms             12.1.0.2.0                        8
compatible.asm               12.1.0.2.0                       14
compatible.rdbms             12.1.0.2.0                       14
compatible.asm               12.1.0.2.0                       18
compatible.rdbms             12.1.0.2.0                       18
 
8 rows selected.
 
 
SQL> create diskgroup CBRECO1 external redundancy disk  'ORCL:CBDEV_RECO1' name CBDEV_RECO1;
 
Diskgroup created.
 
SQL> select group_number,name,state,compatibility, database_compatibility from v$asm_diskgroup;
 
GROUP_NUMBER NAME                         STATE       COMPATIBILITY                                                DATABASE_COMPATIBILITY
------------ ---------------------------- ----------- ------------------------------------------------------------ -------------------------------------------------
          11 RECO1                      MOUNTED     10.1.0.0.0                                                   10.1.0.0.0
          13 DATA1                     MOUNTED     10.1.0.0.0                                                   10.1.0.0.0
          15 CBRECO1                     MOUNTED     10.1.0.0.0                                                   10.1.0.0.0
 
16 rows selected.
 
Note:
Starting with Oracle ASM version 12.2.0.1, the minimum and default settings for Oracle ASM disk group attributes are:
COMPATIBLE.ASM = 11.2.0.2 and COMPATIBLE.RDBMS = 10.1 for EXTERNAL, NORMAL, and HIGH redundancy disk groups
 
COMPATIBLE.ASM = 12.2.0.1 and COMPATIBLE.RDBMS = 12.2.0.1 for FLEX and EXTENDED disk groups
 
 
SQL> create diskgroup CBDEVDATA1 external redundancy disk  'ORCL:CBDEV_DATA1' name CBDEVDATA1 attribute  'compatible.rdbms'='12.1.0.2.0';
create diskgroup CBDEVDATA1 external redundancy disk  'ORCL:CBDEV_DATA1' name CBDEVDATA1 attribute  'compatible.rdbms'='12.1.0.2.0'
*
ERROR at line 1:
ORA-15018: diskgroup cannot be created
ORA-15234: target RDBMS compatibility (12.1.0.2.0) exceeds ASM compatibility (10.1.0.0.0)
 
SQL>  create diskgroup CBDEVDATA1 external redundancy disk  'ORCL:CBDEV_DATA1' name CBDEVDATA1 attribute  'compatible.asm'='12.1.0.2.0' ,  'compatible.rdbms'='12.1.0.2.0';
 
Diskgroup created.
 
SQL>  select group_number,name,state,compatibility, database_compatibility from v$asm_diskgroup where name like '%CB%';
 
GROUP_NUMBER NAME                         STATE       COMPATIBILITY                                                DATABASE_COMPATIBILITY
------------ ---------------------------- --------------------------------- ---------------------------------
          16 CBDEVDATA1                  MOUNTED     12.1.0.2.0                                                   12.1.0.2.0
          15 CBRECO1                     MOUNTED     10.1.0.0.0                                                   10.1.0.0.0
 
SQL> select GROUP_NUMBER,MOUNT_STATUS,STATE,REDUNDANCY,NAME,PATH from v$asm_disk where name like '%CB%';
 
GROUP_NUMBER MOUNT_S STATE    REDUNDA NAME                         PATH
------------ ------- -------- ------- ---------------------------- ---------------------------------
          16 CACHED  NORMAL   UNKNOWN CBDEVDATA1                  ORCL:CBDEV_DATA1
          15 CACHED  NORMAL   UNKNOWN CBDEV_RECO1                 ORCL:CBDEV_RECO1
 
SQL> select header_status "Header", mode_status  "Mode", path "Path", lpad(round(os_mb/1024),7)||'Gb' "Disk Size" from   v$asm_disk where path like '%CB%';
 
Header                 Mode    Path                              Disk Size
---------------------- ------- --------------------------------- ---------
MEMBER                 ONLINE  ORCL:CBDEV_DATA1                    4096Gb
MEMBER                 ONLINE  ORCL:CBDEV_RECO1                    1024Gb
 
So finally, I have successfully created DG with 4TB disk
 

Sunday, June 7, 2020

ORA-29283: invalid file operation: path traverses a symlink [29433]



DB : Oracle 19.5
OS : RHEL 7

Expdp is failing due to the below error in my 19c database

Export: Release 19.0.0.0.0 - Production on Thu Apr 30 06:06:42 2020
Version 19.5.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-29283: invalid file operation: path traverses a symlink [29433]


Reason:

here my export directory is using symlink and as per oracle from 18c onwards No symbolic links for Data Pump directories
  
lrwxrwxrwx  1 oracle oinstall   10 Aug 24  2017 exp_symlk -> /export/gold


Solution :

Remove symlink for that directory and rerun export again

$ rm -f expimp
$ mkdir expimp

(OR)

If you don’t want to remove symlink then you have to restore back to old behavior
To restore the old behavior, the following underscore parameter must be set.

SQL> ALTER SYSTEM SET "_disable_directory_link_check" = TRUE SCOPE=SPFILE; (Recommend NOT to use)

NOTE :
To identify directory objects with symbolic links in the path name, run
      $ORACLE_HOME/rdbms/admin/utldirsymlink.sql AS SYSDBA

Refer :
DataPump Export (EXPDP) Fails Due to ORA-39155 ORA-48128 (Doc ID 2654167.1)

ORA-20005: object statistics are locked (stattype = ALL)



DB : Oracle 19.5
OS : RHEL 7

When try to run stats on table the following error appears 

SQL>  execute dbms_stats.gather_table_stats(ownname => 'ADMIN', tabname =>'CUST_TBL', estimate_percent =>DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZEAUTO');
BEGIN dbms_stats.gather_table_stats(ownname => 'ADMIN', tabname =>'CUST_TBL', estimate_percent =>DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZEAUTO'); END;

*
ERROR at line 1:
ORA-20005: object statistics are locked (stattype = ALL)
ORA-06512: at "SYS.DBMS_STATS", line 40751
ORA-06512: at "SYS.DBMS_STATS", line 40035
ORA-06512: at "SYS.DBMS_STATS", line 9393
ORA-06512: at "SYS.DBMS_STATS", line 10317
ORA-06512: at "SYS.DBMS_STATS", line 39324
ORA-06512: at "SYS.DBMS_STATS", line 40183
ORA-06512: at "SYS.DBMS_STATS", line 40732
ORA-06512: at line 1


SQL> select table_name, stattype_locked,last_analyzed from dba_tab_statistics where owner='ADMIN' and table_name='CUST_TBL';

TABLE_NAME         STATT          LAST_ANAL
----------------------     ---------      ---------
CUST_TBL                 ALL     06-APR-20
CUST_TBL                          06-APR-20

Use below command to unlock the table 

SQL>  exec dbms_stats.unlock_table_stats ('ADMIN','CUST_TBL');

PL/SQL procedure successfully completed.

Elapsed: 00:00:01.31

SQL>  select table_name, stattype_locked from dba_tab_statistics where owner='ADMIN' and table_name='CUST_TBL';

TABLE_NAME             STATT
---------------------- -----
CUST_TBL
CUST_TBL


SQL>  execute dbms_stats.gather_table_stats(ownname => 'ADMIN', tabname =>'CUST_TBL', estimate_percent =>DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZE AUTO');

PL/SQL procedure successfully completed.

Elapsed: 00:00:05.00


To find all table stats locked in a database:

SQL> select owner,count(*) from dba_tab_statistics where stattype_locked is not null group by owner;

OWNER                    COUNT(*)
---------------------- ----------
SYS                            13
ADMIN                        331
SCOTT                         51
GSMADMIN_INTERNAL               1
GGOLD                        2

5 rows selected.

You can generate script to unlock all at once

select 'exec dbms_stats.unlock_table_stats  (''’ ||a.owner || ‘'',''' || a.table_name || ''')' ||’;’  from dba_tab_statistics a 
 where stattype_locked is not null and owner='<OWNER_NAME>';

Friday, March 20, 2020

OGG-01184 Expected 4 bytes, but got 0 bytes



 While starting my extract  it is getting ABENDED with below error

DB version  : 19c
OGG version : 19c
OS version : RHEL 7

GGSCI (myoraqe.domain.com) 4> start EXTQE

Sending START request to MANAGER ...
EXTRACT EXTQE starting

GGSCI (myoraqe.domain.com) 6> info EXTQE

EXTRACT    EXTQE   Last Started 2019-02-13 12:06   Status ABENDED
Checkpoint Lag       00:00:07 (updated 30:48:03 ago)
Log Read Checkpoint  Oracle Integrated Redo Logs
                     2019-02-12 05:18:53
                     SCN 88.3221809052 (381178931100)

2019-02-13 12:06:27  ERROR   OGG-01184  Expected 4 bytes, but got 0 bytes, in trail /goldengate/home/dirdat/SRC/sxtqe/tgxqe/mt000001148, seqno 1148, reading record trailer token at RBA 1525.

2019-02-13 12:06:27  ERROR   OGG-01668  PROCESS ABENDING.


Extract Abends with "Expected <n> bytes, but got <n> bytes, in trail " (Doc ID 1968574.1)


GGSCI (myoraqe.domain.com) 10> info PXTQE

EXTRACT    PXTQE   Last Started 2019-02-08 16:43   Status RUNNING
Checkpoint Lag       00:00:00 (updated 00:00:08 ago)
Process ID           170397
Log Read Checkpoint  File /goldengate/home/dirdat/SRC/sxtqe/tgxqe/mt000001148
                     First Record  RBA 0


GGSCI (myoraqe.domain.com) 11> send PXTQE logend

Sending LOGEND request to EXTRACT PXTQE ...
YES.


GGSCI (myoraqe.domain.com) 12> stop PXTQE

Sending STOP request to EXTRACT PXTQE ...
STOP request pending. Recovery is not complete.
This normal stop will wait and checkpoint recovery's work when recovery has finished.
To force Extract to stop now, use the SEND EXTRACT PXTQE, FORCESTOP command..


GGSCI (myoraqe.domain.com) 13> info PXTQE

EXTRACT    PXTQE   Last Started 2019-02-08 16:43   Status RUNNING
Checkpoint Lag       00:00:00 (updated 00:00:06 ago)
Process ID           170397
Log Read Checkpoint  File /goldengate/home/dirdat/SRC/sxtqe/tgxqe/mt000001148
                     First Record  RBA 0


GGSCI (myoraqe.domain.com) 14> !
info PXTQE

EXTRACT    PXTQE   Last Started 2019-02-08 16:43   Status RUNNING
Checkpoint Lag       00:00:00 (updated 00:00:06 ago)
Process ID           170397
Log Read Checkpoint  File /goldengate/home/dirdat/SRC/sxtqe/tgxqe/mt000001148
                     First Record  RBA 0


GGSCI (myoraqe.domain.com) 15> send PXTQE logend

Sending LOGEND request to EXTRACT PXTQE ...
YES.


GGSCI (myoraqe.domain.com) 16> stop PXTQE !

Sending FORCESTOP request to EXTRACT PXTQE ...
STOP request will be executed immediately (recovery aborted).


GGSCI (myoraqe.domain.com) 17> alter EXTQE ETROLLOVER

2019-02-13 12:11:38  INFO    OGG-01520  Rollover performed.  For each affected output trail of Version 10 or higher format, after starting the source extract, issue ALTER EXTSEQNO for that trail's reader (either pump EXTRACT or REPLICAT) to move the reader's scan to the new trail file;  it will not happen automatically.
EXTRACT altered.


GGSCI (myoraqe.domain.com) 18> start EXTQE

Sending START request to MANAGER ...
EXTRACT EXTQE starting


GGSCI (myoraqe.domain.com) 19> info EXTQE

EXTRACT    EXTQE   Last Started 2019-02-13 12:11   Status RUNNING
Checkpoint Lag       25:04:57 (updated 00:00:03 ago)
Process ID           268862
Log Read Checkpoint  Oracle Integrated Redo Logs
                     2019-02-12 11:06:51
                     SCN 88.3221882653 (381179004701)


GGSCI (myoraqe.domain.com) 20> alter PXTQE extseqno 1149 extrba 00
EXTRACT altered.


GGSCI (myoraqe.domain.com) 21> start PXTQE

Sending START request to MANAGER ...
EXTRACT PXTQE starting


GGSCI (myoraqe.domain.com) 22> info PXTQE

EXTRACT    PXTQE   Last Started 2019-02-13 12:12   Status RUNNING
Checkpoint Lag       00:00:00 (updated 00:00:02 ago)
Process ID           270788
Log Read Checkpoint  File /goldengate/home/dirdat/SRC/sxtqe/tgxqe/mt000001149
                     First Record  RBA 0


GGSCI (myoraqe.domain.com) 23> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
JAGENT      RUNNING
EXTRACT     RUNNING     ESXTQEQ1     00:00:05      00:00:07
EXTRACT     RUNNING     ESXTQEQ2     00:00:07      00:00:00
EXTRACT     RUNNING     EXTQE     00:00:05      00:00:02
EXTRACT     RUNNING     PSXTQEQ1     00:00:00      00:00:10
EXTRACT     STOPPED     PSXTQEQ2     00:00:00      339:08:25
EXTRACT     RUNNING     PXTQE     00:00:00      00:00:05

Auto Scroll Stop Scroll