Popular Posts

Wednesday, October 21, 2020

Link to Tape backup Library for Oracle Database

backup incremental level 0 database

 using target database control file instead of recovery catalog

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03009: failure of allocate command on t1 channel at 10/22/2020 05:50:38

ORA-19554: error allocating device, device type: SBT_TAPE, device name:

ORA-27211: Failed to load Media Management Library

Additional information: 2


sbttest test
The sbt function pointers are loaded from oracle.static library.
libobk.a(shr.o) could not be loaded.  Check that it is installed


Create link as below 
ln -s /usr/tivoli/tsm/client/oracle/bin64/libobk64.a $ORACLE_HOME/lib/libobk.a

sbttest test
The sbt function pointers are loaded from libobk.a(shr.o) library.
-- sbtinit succeeded
Return code -1 from sbtinit, bsercoer = 0, bsercerrno = 0
Message 0 not found;  product=RDBMS; facility=SBT

Sunday, October 11, 2020

Query to View all the Parent and Child Tables - Oracle

To View all the Child tables for a Given table

 SELECT rownum,LPAD(' ',4*(LEVEL-1)) || table1 || ' <-- ' || table2 tables, table2_fkey

FROM

  (SELECT a.table_name table1, b.table_name table2, b.constraint_name table2_fkey

  FROM user_constraints a, user_constraints b 

  WHERE a.constraint_type IN('P', 'U') AND A.OWNER=B.OWNER AND A.OWNER='PCISDBA' 

  AND b.constraint_type = 'R' 

  AND a.constraint_name = b.r_constraint_name 

  AND a.table_name != b.table_name

  AND b.table_name <> '&TABLE_NAME')

CONNECT BY PRIOR  table2 = table1  AND LEVEL <= 5

START WITH table1 = '&TABLE_NAME' ;


To View all the Parent and Child Tables for a Given table

select p.table_name Parent , c.table_name Child ,p.constraint_name

from user_constraints p , user_constraints c

where c.table_name = '&TABLE_NAME'

and c.constraint_type = 'R'

and p.constraint_name = c.r_constraint_name

union

select p.table_name Parent , c.table_name Child ,p.constraint_name

from user_constraints p, user_constraints c

where p.table_name = '&TABLE_NAME'

and c.constraint_type = 'R'

and p.constraint_name = c.r_constraint_name 

order by 2;


To view all the table Relations in a user.

with pur as (
  select table_name, constraint_type, constraint_name, r_constraint_name,
    max(decode(constraint_type,'R',1,0)) over(partition by table_name) is_r
  from user_constraints 
  where constraint_type in ('P', 'U', 'R')
)
, son_dad as (
  select distinct s.table_name son, d.table_name dad, d.constraint_type
  from (select * from pur where constraint_type = 'R' or is_r = 0) s
  left join pur d
    on s.r_constraint_name = d.constraint_name
    and s.table_name != d.table_name
)
select level lvl, son, dad, constraint_type
from son_dad
start with dad is null
connect by dad = prior son
order siblings by dad, son;

Wednesday, August 19, 2020

Error During 19c GI installation : [INS-44000] Passwordless SSH connectivity is not setup from the local node node1



 Cause - Installer requires that a minimum of 2 nodes remain for the Oracle Grid Infrastructure configuration to proceed.  

Action - Ensure that at least 2 nodes remain for the configuration to proceed, otherwise specify a single cluster node information.  

Additional Information:

 - [INS-44000] Passwordless SSH connectivity is not setup from the local node node1 to the following nodes: 

 [node1] 


 These nodes will be ignored and not participate in the configured Grid Infrastructure.   - 

 Action: Refer to the logs for more details or contact Oracle Support Services. 

 

Cause - Installer requires that a minimum of 2 nodes remain for the Oracle Grid Infrastructure configuration to proceed.  

Action - Ensure that at least 2 nodes remain for the configuration to proceed, otherwise specify a single cluster node information.  

Additional Information:


 - [INS-44000] Passwordless SSH connectivity is not setup from the local node node2 to the following nodes: 

 [node2] 


 These nodes will be ignored and not participate in the configured Grid Infrastructure.   - 

 Action: Refer to the logs for more details or contact Oracle Support Services. 

 

 

 Before installation, as root user: ( change the path if the location of your "scp" is not the same with below)

# Rename the original scp.


mv /usr/bin/scp /usr/bin/scp.orig


# Create a new file </usr/bin/scp>.


vi /usr/bin/scp

# Add the below line to the new created file </usr/bin/scp>.

/usr/bin/scp.orig -T $*

# Change the file permission.

chmod 555 /usr/bin/scp

or 

 mv /usr/bin/scp /usr/bin/scp.orig

 echo "/usr/bin/scp.orig -T $*" > /usr/bin/scp

 chmod 555 /usr/bin/scp


After installation:

mv /usr/bin/scp.orig /usr/bin/scp


cluvfy - pre installation check

 


runcluvfy.sh stage -pre crsinst -n node1,node2 -fixup -fixupnoexec -verbose -method root


runcluvfy.sh stage -pre crsinst -n node1,node2 -fixup -fixupnoexec -verbose -method 


To install Oracle Clusterware/Grid Infrastructure using the Oracle Universal Installer

  1. Ensure that the Oracle grid user has the following capabilities:

    CAP_NUMA_ATTACH, CAP_BYPASS_RAC_VMM, and CAP_PROPAGATE

    To check existing capabilities, enter the following command as root; in this example, the Oracle grid user is grid:

    # lsuser -a capabilities grid

    To add capabilities, enter a command similar to the following:

    # /usr/bin/chuser \
    capabilities=CAP_NUMA_ATTACH,CAP_BYPASS_RAC_VMM,CAP_PROPAGATE grid
  2. The ncargs attribute controls the maximum command line length, including the environment variables on the AIX nodes. Verify the current value of the ncargs attribute.
    # lsattr -l sys0 -a ncargs -E

    If the value is less than 128, change the attribute to a larger value before invoking the Oracle Installer.

    # chdev -l sys0 -a ncargs=128
  3. set DISPLAY varraible
  4. execute $GI_HOME/gridSetup.sh as grid 


Sunday, August 9, 2020

Thursday, August 6, 2020

Move RMAN backupset from disk to tape

To back up backup sets from disk to tape:

  1. Assuming that you have configured an automatic sbt channel, issue the BACKUP BACKUPSET command at the RMAN prompt. This example backs up all disk backup sets to tape:

    RMAN> BACKUP DEVICE TYPE sbt BACKUPSET ALL;
    
    

    This example backs up all disk backup sets to tape and then deletes the input disk backups:

    RMAN> BACKUP DEVICE TYPE sbt BACKUPSET ALL DELETE INPUT; 
    
    
  2. Issue a LIST command to see a listing of backup sets and pieces.