Wednesday, 25 August 2021

listener service register


alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = demo.localdomain)(PORT = 1531))';


alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = demo.localdomain)(PORT = 1531))','(ADDRESS = (PROTOCOL = TCP)(HOST = demo.localdomain)(PORT = 1522))' scope=both;


stop and start the listener


lsnrctl status LISTENR.



agent status check scripts for oem13c agent

 agent_check.sh



#!/bin/bash


agent_status=`ps -ef | grep -i gcagent.tmmain.TMMain|grep -i sysman |grep -v grep | wc -l`


if [ $agent_status = 0 ]

then

date >> /u01/app/agent13c/log/agentStarted.log

/u01/app/agent13c/agent_13.4.0.0.0/bin/emctl start agent >> /u01/app/agent13c/log/agentStarted.log & > /dev/null

#mailing program

#mail -s "OEM Agent 13c was not running...  Restarted on `hostname` $i `basename $0`" 'EM13c@*****' < agentStarted.log

else

date >> /u01/app/agent13c/log/agentStarted.log

echo 'Agent is running' >> /u01/app/agent13c/log/agentStarted.log

fi

MULTITENANT service register in 19c

 MULTITENANT:


BEGIN

  DBMS_SERVICE.create_service(

    service_name => 'my_new_service',

    network_name => 'my_new_service'

  );

END;

/



COLUMN name FORMAT A30

COLUMN network_name FORMAT A30


SELECT name,

       network_name

FROM   dba_services

ORDER BY 1;


SELECT name,

       network_name

FROM   v$active_services

ORDER BY 1;




BEGIN

    DBMS_SERVICE.START_SERVICE (SERVICE_NAME   => 'herospdb.localdomain');

END;

/


BEGIN

  DBMS_SERVICE.modify_service(

    service_name => 'my_new_service',

    goal         => DBMS_SERVICE.goal_throughput

  );

END;

/



sqlplus ram/ram@demo:1521/herospdb.localdomain

services for pluggable database in 19c

 command for pluggable database services.



COLUMN NAME FORMAT A12;

SELECT NAME, CON_ID, DBID, CON_UID, GUID FROM V$CONTAINERS ORDER BY CON_ID;


show pdbs;


alter session set container=PDB01;


check the services for pluggable database:


COLUMN NAME FORMAT A15;

COLUMN NETWORK_NAME FORMAT A15;

SELECT NAME,NETWORK_NAME FROM DBA_SERVICES;


other network name


lsnrctl status|grep -i pdb01 -A 1


srvctl status service -d CDBAMN   //check the service for container database.


lsnrctl status|grep -i SOA -A 1   // soa is service name


crsctl stat res ora.cdbamn.soa.svc -t


crsctl stat res ora.cdbamn.db -t


FRa space:


column SPACE_LIMIT_Gb format 999;

column SPACE_USED_Gb format 999;

select name, SPACE_LIMIT/1024/1024/1024 SPACE_LIMIT_Gb, SPACE_USED/1024/1024/1024 SPACE_USED_Gb, SPACE_RECLAIMABLE from v$recovery_file_dest;


Tuesday, 3 August 2021

OUI-10166: The permission 0755 cannot be set for the file rootconfig.sh 19c grid upgrade from 12c


 

While starting the actual upgrade, If you are seeing the error. as

OUI-10166: The permissions 0755 cannot be set for the file $GRID_HOME/crs/config/rootconfig.sh. OUI-10175: The effective user ID does not match the owner of the file or the process is not the user user.

 SOLUTION:

Check the owner of the file. $GRID_HOME/crs/config/rootconfig.sh . If it is owned by root , then change it to oracle and rerun the gridsetup.sh script.

chown oracle:oinstall rootconfig.sh



PRVF-5311 : File “/tmp/InstallActions error:

If at pre-requisite stage this error is coming, then you can try below solution.

Do below changes to scp. (

# Rename the original scp. ( find where is the scp executable file present)

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

# Create a new file .

vi /usr/bin/scp

# Add the below line to the new created file .
/usr/bin/scp.orig -T $*

# Change the file permission to 555.

chmod 555 /usr/bin/scp


RETRY THE UPGRADE PROCESS .

###Once upgrade is done , you can revert to the original

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

Tuesday, 27 July 2021

How to increase the size of root( / ) on a linux vmware

 

Increasing the size of a root partition on a Linux VM

[root@cogni01 ~]# df -h

Filesystem           Size  Used Avail Use% Mounted on

devtmpfs             2.4G     0  2.4G   0% /dev

tmpfs                2.4G     0  2.4G   0% /dev/shm

tmpfs                2.4G  9.1M  2.4G   1% /run

tmpfs                2.4G     0  2.4G   0% /sys/fs/cgroup

/dev/mapper/ol-root   51G   51G  656M  99% /

/dev/mapper/ol-home  5.0G   39M  5.0G   1% /home

/dev/sda1            497M  308M  190M  62% /boot

tmpfs                491M     0  491M   0% /run/user/54321




shut down the vm on node1 


cd "c:\Program Files\Oracle\VirtualBox"


vboxmanage list hdds


 vboxmanage modifymedium disk "E:\vmware\Rac01\cogi01\cogi01.vdi" --resize 93488


E:\vmware\Rac02\cogi02\cogi02.vdi



vboxmanage modifymedium disk "E:\vmware\Rac02\cogi02\cogi02.vdi" --resize 93488



fdisk -l


fdisk /dev/sda


[root@cogni02 ~]# fdisk /dev/sda

Welcome to fdisk (util-linux 2.23.2).


Changes will remain in memory only, until you decide to write them.

Be careful before using the write command.



Command (m for help): n

Partition type:

   p   primary (2 primary, 0 extended, 2 free)

   e   extended

Select (default p): p

Partition number (3,4, default 3):

First sector (128960512-191463423, default 128960512):

Using default value 128960512

Last sector, +sectors or +size{K,M,G} (128960512-191463423, default 191463423):

Using default value 191463423

Partition 3 of type Linux and of size 29.8 GiB is set


Command (m for help): t

Partition number (1-3, default 3): 3

Hex code (type L to list all codes): 8e

Changed type of partition 'Linux' to 'Linux LVM'


Command (m for help): w



[root@cogni02 ~]# pvcreate /dev/sda3

  Physical volume "/dev/sda3" successfully created.




[root@cogni02 ~]# pvdisplay

  --- Physical volume ---

  PV Name               /dev/sda2

  VG Name               ol

  PV Size               61.00 GiB / not usable 4.00 MiB

  Allocatable           yes (but full)

  PE Size               4.00 MiB

  Total PE              15616

  Free PE               0

  Allocated PE          15616

  PV UUID               GK7Lru-MwVh-1Lkd-Qosy-ZpKZ-MmbE-d2N6KN


  "/dev/sda3" is a new physical volume of "29.80 GiB"

  --- NEW Physical volume ---

  PV Name               /dev/sda3

  VG Name

  PV Size               29.80 GiB

  Allocatable           NO

  PE Size               0

  Total PE              0

  Free PE               0

  Allocated PE          0

  PV UUID               i7B650-7E7m-3eBi-BLqb-aEaR-ZR3L-dHsnZQ




[root@cogni02 ~]# vgextend ol /dev/sda3


  Volume group "ol" successfully extended


[root@cogni02 ~]# lvdisplay

  --- Logical volume ---

  LV Path                /dev/ol/root

  LV Name                root

  VG Name                ol

  LV UUID                543gTj-HSc3-dKix-b1kV-QJAv-Cl12-2AJrvs

  LV Write Access        read/write

  LV Creation host, time cogni01.localdomain, 2021-06-12 19:49:35 +0530

  LV Status              available

  # open                 1

  LV Size                51.00 GiB

  Current LE             13056

  Segments               1

  Allocation             inherit

  Read ahead sectors     auto

  - currently set to     8192

  Block device           249:0


  --- Logical volume ---

  LV Path                /dev/ol/swap

  LV Name                swap

  VG Name                ol

  LV UUID                wHo57d-I8FE-QygS-i1kc-QgI5-qNe3-hmTkn5

  LV Write Access        read/write

  LV Creation host, time cogni01.localdomain, 2021-06-12 19:49:36 +0530

  LV Status              available

  # open                 2

  LV Size                5.00 GiB

  Current LE             1280

  Segments               1

  Allocation             inherit

  Read ahead sectors     auto

  - currently set to     8192

  Block device           249:1


  --- Logical volume ---

  LV Path                /dev/ol/home

  LV Name                home

  VG Name                ol

  LV UUID                84jXc0-mfRH-h2Zo-c9mA-NdIF-p793-6wkGVx

  LV Write Access        read/write

  LV Creation host, time cogni01.localdomain, 2021-06-12 19:49:36 +0530

  LV Status              available

  # open                 1

  LV Size                5.00 GiB

  Current LE             1280

  Segments               1

  Allocation             inherit

  Read ahead sectors     auto

  - currently set to     8192

  Block device           249:2




lvextend --size +29G --resizefs /dev/ol/root



df -h


[root@cogni01 ~]# df -h

Filesystem           Size  Used Avail Use% Mounted on

devtmpfs             2.4G     0  2.4G   0% /dev

tmpfs                2.4G  644M  1.8G  27% /dev/shm

tmpfs                2.4G  9.6M  2.4G   1% /run

tmpfs                2.4G     0  2.4G   0% /sys/fs/cgroup

/dev/mapper/ol-root   74G   51G   24G  69% /

/dev/mapper/ol-home  5.0G   39M  5.0G   1% /home

/dev/sda1            497M  308M  190M  62% /boot

tmpfs                491M     0  491M   0% /run/user/54321

shared_folder        500G  443G   58G  89% /media/sf_shared_folder

tmpfs                491M   12K  491M   1% /run/user/42


Sunday, 20 June 2021

How to delete MGMTDB IN RAC

 [root@cogni01 disks]# ps -ef |grep pmon

oracle    5422     1  0 13:12 ?        00:00:00 asm_pmon_+ASM1

oracle    6442     1  0 13:13 ?        00:00:00 mdb_pmon_-MGMTDB

oracle   12510     1  0 13:19 ?        00:00:00 ora_pmon_lmnx1

root     20892  4763  0 13:35 pts/0    00:00:00 grep --color=auto pmon

[root@cogni01 disks]# free -m

              total        used        free      shared  buff/cache   available

Mem:           4900        2793          42        1241        2065         687

Swap:          5119        1190        3929

[root@cogni01 disks]# crsctl stop res ora.crf -init

bash: crsctl: command not found...

[root@cogni01 disks]# . oraenv

ORACLE_SID = [root] ? +ASM1

The Oracle base has been set to /u01/app/oracle

[root@cogni01 disks]# crsctl stop res ora.crf -init

CRS-2673: Attempting to stop 'ora.crf' on 'cogni01'

CRS-2677: Stop of 'ora.crf' on 'cogni01' succeeded

[root@cogni01 disks]# ps -ef |grep pmon

oracle    5422     1  0 13:12 ?        00:00:00 asm_pmon_+ASM1

oracle    6442     1  0 13:13 ?        00:00:00 mdb_pmon_-MGMTDB

oracle   12510     1  0 13:19 ?        00:00:00 ora_pmon_lmnx1

root     22957  4763  0 13:38 pts/0    00:00:00 grep --color=auto pmon

[root@cogni01 disks]#

[root@cogni01 disks]#

[root@cogni01 disks]# crsctl modify res ora.crf -attr ENABLED=0 -init

[root@cogni01 disks]# crsctl status res ora.crf -init

NAME=ora.crf

TYPE=ora.crf.type

TARGET=OFFLINE

STATE=OFFLINE


[root@cogni01 disks]# cd $ORACLE_HOME/bin

[root@cogni01 bin]# dbca -silent -deleteDatabase -sourceDB -MGMTDB

DBCA cannot be run as root.

[root@cogni01 bin]# su - oracle

Last login: Sun Jun 20 13:34:32 IST 2021


[oracle@cogni01 ~]$

[oracle@cogni01 ~]$ . oraenv

ORACLE_SID = [cdbrac1] ? +ASM1

The Oracle base remains unchanged with value /u01/app/oracle

[oracle@cogni01 ~]$ cd $ORACLE_HOME/bin

[oracle@cogni01 bin]$ dbca -silent -deleteDatabase -sourceDB -MGMTDB

Connecting to database

4% complete

9% complete

14% complete

19% complete

23% complete

28% complete

47% complete

Updating network configuration files

52% complete


Deleting instance and datafiles
76% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/_mgmtdb.log" for further details.

[oracle@cogni01 bin]$ ps -ef |grep pmon
oracle    5422     1  0 13:12 ?        00:00:00 asm_pmon_+ASM1
oracle   12510     1  0 13:19 ?        00:00:00 ora_pmon_lmnx1
oracle   20663 30781  0 13:46 pts/0    00:00:00 grep --color=auto pmon
[oracle@cogni01 bin]$

Featured post

Restircted session due to sync filed with ora-65177

Application is unable to connect the database due to restricted session. sql> show pdbs; SQL> show con_name CON_NAME -----------------...