Wednesday, July 24, 2019

Networker issue | solution


Error :

[root@restoredb ~]# nsradmin -p nsrexec
173680:nsradmin: RPC client handle: Connection refused.
172089:nsradmin: Unable to create the connection with 'portmapper' to host 'localhost' with address '127.0.0.1' at port number 7938.
173677:nsradmin: Check whether the client services are running on the host '127.0.0.1'.
145072:nsradmin: Unable to get port range from local nsrexecd: Failed to initialize ports using nsrexecd on restoredb.kahramaa.corp: Remote system error - No such file or directory
173680:nsradmin: RPC client handle: Connection refused.
172089:nsradmin: Unable to create the connection with 'portmapper' to host 'localhost' with address '127.0.0.1' at port number 7938.
173677:nsradmin: Check whether the client services are running on the host '127.0.0.1'.
143820:nsradmin: Unable to establish RAP connection with restoredb.kahramaa.corp: Remote system error - Connection refused
There does not appear to be a nsrexec server running on restoredb.kahramaa.corp

Solution :

1. Shutdown the NetWorker (or kill all its daemons, if cannot shutdown clearly)

e.g /opt/nsr/admin/networker stop

2. Rename /nsr/res directory to res.old and /nsr/mm to mm.old


3. Start the NetWorker

e.g /opt/nsr/admin/networker start
e.g /opt/nsr/admin/networker status

Monday, June 24, 2019

Generate a certificate signing request


Generate a certificate signing request

1. Generate the RSA key

mkdir ~/domain.com.ssl/

cd ~/domain.com.ssl/

openssl genrsa -out ~/domain.com.ssl/domain.com.key 2048


2. Create a CSR


openssl req -new -sha256 -key ~/domain.com.ssl/domain.com.key -out ~/domain.com.ssl/domain.com.csr



Tuesday, May 22, 2018

ORA-27211: Failed to load Media Management Library – EMC Networker – Oracle RMAN

Error : 

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of allocate command on t1 channel at 07/27/2015 15:33:28
ORA-19554: error allocating device, device type: SBT_TAPE, device name:
ORA-27211: Failed to load Media Management Library
Additional information: 2


Cause:
The Oracle library file was not linked correctly.  The soft link name should be use specific to the operating system type. In current server the softlink was created with name of library that must be used with IBM-AIX but the server operating system is Solaris 11.
Solution:
To take oracle backup on EMC networker bakcup solution we have to Install the Oracle networker module and link the library with Oracle home library file with correct operating system library name.
Correct Library :
lrwxrwxrwx   1 oracle   dba           21 Jul 28 08:43 libobk.so -> /usr/lib/libnsrora.so

oracle@sa01cdb05:/oradb/oracle/app/oracle/product/12.1.0/dbhome_1/lib$
It should be configured to libobk.so as the EMC Networker documentation. The below table list provide the correct soft links that should be used with EMC Networked Media management module.
To create link use command:
$ cd $ORACLE_HOME/lib

$ ln -s /usr/lib/libnsrora.so libobk.so
After linking of correct oracle library backup script should run successful without any issues.
To check the correct library name specific to OS please refer official http://finland.emc.com/collateral/TechnicalDocument/docu50647.pdf

Saturday, April 21, 2018

Recover standby database using RMAN Incremental backup


1. Get current SCN from standby database 

sql > select current_scn from v$database;

2. Take rman backup and backup of controlfile from primary 

RMAN> backup incremental from scn 12252407093884 database format '/u03/rman_backup/inc_backup_%U';
RMAN> backup current controlfile for standby format '/u03/rman_backup/stnd_%U.ctl';

3. copy all backup pieces to standby and catalog it

RMAN> catalog start with '/u03/rman_backup/';

4. Restore standby database 

RMAN> recover database noredo;

5. shut down database, start in nomount mode and restore standby controlfile. restart db in mount mode

RMAN> shutdown immediate
RMAN> startup nomount
RMAN> restore standby controlfile from '/u03/rman_backup/stnd_12n6p3qt_1_1.ctl';

RMAN> <strong>shutdown immediate
RMAN> startup mount

6. if standby and primary database datafile location is diffrant then catalog standby datafiles and switch to datafile. 

RMAN> catalog start with '+DATA/SSSB/DATAFILE';
RMAN> switch database to copy;

7. Start Recovery. 

SQL> alter database recover managed standby database disconnectfrom session;

8. Switch logfile on primary and check gap. 

# On Primary 

sql > alter system switch logfile;

-- Query to check archivelog GAP on standby 

col SPACE_LIMIT_GB for 999,999,999,999
col SPACE_USED_GB for 999,999,999,999
col name for a30

SELECT ARCH.THREAD# "Thread",
         ARCH.SEQUENCE# "Last Sequence Received",
         APPL.SEQUENCE# "Last Sequence Applied",
         (ARCH.SEQUENCE# - APPL.SEQUENCE#) "Difference"
    FROM (SELECT THREAD#, SEQUENCE#
            FROM V$ARCHIVED_LOG
           WHERE (THREAD#, FIRST_TIME) IN (  SELECT THREAD#, MAX (FIRST_TIME)
                                               FROM V$ARCHIVED_LOG
                                           GROUP BY THREAD#)) ARCH,
         (SELECT THREAD#, SEQUENCE#
            FROM V$LOG_HISTORY
           WHERE (THREAD#, FIRST_TIME) IN (  SELECT THREAD#, MAX (FIRST_TIME)
                                               FROM V$LOG_HISTORY
                                           GROUP BY THREAD#)) APPL
   WHERE ARCH.THREAD# = APPL.THREAD# 
ORDER BY 1;

ASM Space Monitoring

# ASM Space Monitoring 


 set line 280 pagesize 10000
col gname form a10
col dbname form a10
col file_type form a30
col MB for 999,999,999,999
col GB for 999,999,999,999
col FREE_MB for 999,999,999,999
col TOTAL_MB for 999,999,999,999
col PERCENTAGE for 999

SELECT name, free_mb, total_mb, free_mb/total_mb*100 as percentage 
     FROM v$asm_diskgroup;

 
SELECT
    gname,
    dbname,
    file_type,
    round(SUM(space)/1024/1024) mb,
    round(SUM(space)/1024/1024/1024) gb,
    COUNT(*) "#FILES"
FROM
    (
        SELECT
            gname,
            regexp_substr(full_alias_path, '[[:alnum:]_]*',1,4) dbname,
            file_type,
            space,
            aname,
            system_created,
            alias_directory
        FROM
            (
                SELECT
                    concat('+'||gname, sys_connect_by_path(aname, '/')) full_alias_path,
                    system_created,
                    alias_directory,
                    file_type,
                    space,
                    level,
                    gname,
                    aname
                FROM
                    (
                        SELECT
                            b.name            gname,
                            a.parent_index    pindex,
                            a.name            aname,
                            a.reference_index rindex ,
                            a.system_created,
                            a.alias_directory,
                            c.type file_type,
                            c.space
                        FROM
                            v$asm_alias a,
                            v$asm_diskgroup b,
                            v$asm_file c
                        WHERE
                            a.group_number = b.group_number
                        AND a.group_number = c.group_number(+)
                        AND a.file_number = c.file_number(+)
                        AND a.file_incarnation = c.incarnation(+) ) START WITH (mod(pindex, power(2, 24))) = 0
                AND rindex IN
                    (
                        SELECT
                            a.reference_index
                        FROM
                            v$asm_alias a,
                            v$asm_diskgroup b
                        WHERE
                            a.group_number = b.group_number
                        AND (
                                mod(a.parent_index, power(2, 24))) = 0
                            and a.name like '%'
                    ) CONNECT BY prior rindex = pindex )
        WHERE
            NOT file_type IS NULL
            and system_created = 'Y' )
WHERE
    dbname like '%'
GROUP BY
    gname,
    dbname,
    file_type
ORDER BY 5 desc,
    gname,
    dbname,
    file_type
/

ORA-01341: LogMiner out-of-memory

ORA-01280: Fatal LogMiner Error.
ORA-01341: LogMiner out-of-memory



Solution :  

Increase size of below parameter to fix error.

exec dbms_capture_adm.stop_capture(‘CAPTURE_NAME’);
exec dbms_capture_adm.set_parameter(‘CAPTURE_NAME’,’_SGA_SIZE’,’50’);
exec dbms_capture_adm.start_capture(‘CAPTURE_NAME’);
The above changes space for named capture process : 'CAPTURE_NAME'  from  10M -> 50M

Note: If you change the value of the hidden capture parameter _SGA_SIZE, 
then you should also increase the streams_pool_size (10.1 and above) correspondingly. 
For 9.2, increase the shared_pool parameter correspondingly.

Creating FS on linux

# Creating FS on linux 

fdisk /dev/xvdb
pvcreate /dev/xvdb1
vgcreate vg_u01 /dev/xvdb1
df -h
vgs
lvcreate -L 99.99g -n lv_u01 vg_u01
lvs
df -h
mkfs.ext4 /dev/mapper/vg_u01-lv_u01
mkdir /u01
vi /etc/fstab  -- add new entry in it
mount -a