Sunday, May 10, 2020

Steps to drop oracle database manually

Steps to drop oracle database manually





Prerequisite Steps

send mail to application team that you going to drop database 
spool the output of datafiles, redo logs, etc



Step 1: Connect to the database with sysdba privilege after that execute below query  and keep output

select name from v$datafile;
select name from v$controlfile;
select member from v$logfile;


output 

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/ritvik/data01/system.258.1039853925
/u01/app/oracle/oradata/ritvik/data01/sysaux.257.1039853883
/u01/app/oracle/oradata/ritvik/data01/undotbs1.260.1039853971
/u01/app/oracle/oradata/ritvik/data01/example.266.1039854013
/u01/app/oracle/oradata/ritvik/data01/users.259.1039853969

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/ritvik/control01.ctl

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/ritvik/group_3.264.1039854011
/u01/app/oracle/oradata/ritvik/group_2.263.1039854011
/u01/app/oracle/oradata/ritvik/group_1.262.1039854011

SQL>

Step 2: Shutdown the database

shut immediate;

Step 3: Start the database in Exclusive mode

startup mount exclusive restrict;
startup mount restrict;




[oracle@ip-10.0.0.1 data02]$ sqlplus "/as sysdba"

SQL*Plus: Release 12.1.0.2.0 Production on Sat May 9 16:42:01 2020

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup mount restrict;
ORACLE instance started.

Total System Global Area 2466250752 bytes
Fixed Size                  2927384 bytes
Variable Size             671089896 bytes
Database Buffers         1778384896 bytes
Redo Buffers               13848576 bytes
Database mounted.
SQL>


Step 4: Drop the database


SQL> drop database;

Database dropped.

Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL>
SQL>
SQL> exit
[oracle@ip-10.0.0.1 data02]$
[oracle@ip-10.0.0.1 data02]$
[oracle@ip-10.0.0.1 data02]$ sqlplus "/as sysdba"

SQL*Plus: Release 12.1.0.2.0 Production on Sat May 9 16:43:07 2020

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> exit
Disconnected
[oracle@ip-10.0.0.1 data02]$
[oracle@ip-10.0.0.1 data02]$

Step 5: Post Change Steps


  •  Cross verify if all the associated datafiles, comntrolfile and online redo logs are removed
  •  Remove the directories if not required
  •  Remove the entry of the database from /etc/oratab
  •  Modify/drop any of the scripts used for this database 
  •  Remove database details from catalog database
  •  Drop backup, archive log and other script associated with the database

Tuesday, April 21, 2020

Adding swap space in Linux

Adding swap space in Linux


[root@ip-anurag grid]#
[root@ip-anurag grid]#
[root@ip-anurag grid]# free -g
              total        used        free      shared  buff/cache   available
Mem:              3           0           0           0           2           2
Swap:             0           0           0
[root@ip-anurag grid]#
[root@ip-anurag grid]# dd if=/dev/zero of=/swap_file bs=2G count=1
0+1 records in
0+1 records out
2147479552 bytes (2.1 GB) copied, 29.8424 s, 72.0 MB/s
[root@ip-anurag grid]# chmod 600 /swap_file
[root@ip-anurag grid]# mkswap /swap_file
Setting up swapspace version 1, size = 2097144 KiB
no label, UUID=9bd76b65-4abe-4ffb-a580-d4e9283daac2
[root@ip-anurag grid]#
[root@ip-anurag grid]# swapon /swap_file
[root@ip-anurag grid]#
[root@ip-anurag grid]# vi /etc/fstab
[root@ip-anurag grid]#

[root]# swapon --show
NAME       TYPE SIZE USED PRIO
/swap_file file   2G   0B   -2
[root@ip-10-0-1-12 ~]#


/swap_file               swap                    swap    defaults        0 0



[root@ip-anurag grid]#
[root@ip-anurag grid]# free -m
              total        used        free      shared  buff/cache   available
Mem:           3787         655        2274          16         857        2898
Swap:          2047           0        2047
[root@ip-anurag grid]#
[root@ip-anurag grid]#

Tuesday, April 14, 2020

Oracle 19c installation on Linux 8 : error while loading shared libraries: libnsl.so.1: cannot open shared object file: No such file or directory


Error while starting ./runInstaller for oracle 19c installation on Linux 8




[oracle@ip-192-168-43-225 oracle]$ ./runInstaller
/u01/oracle/perl/bin/perl: error while loading shared libraries: libnsl.so.1: cannot open shared object file: No such file or directory
[oracle@ip-192-168-43-225 oracle]$

Solutions: error while loading shared libraries: libnsl.so.1: cannot open shared object


In addition, we need to install below RPM after that start the Oracle 19c installation.


dnf install -y libnsl
dnf install -y libnsl.i686
dnf install -y libnsl2
dnf install -y libnsl2.i686




further, follow below link to complete the oracle database installation 

https://anuragkumarjoy.blogspot.com/2020/04/oracle-database-19c-step-by-step.html


[oracle@ip-192-168-43-225 ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Apr 13 18:56:09 2020
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> select name ,open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------

INDIA     READ WRITE


[oracle@ip-192-168-43-225 ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux release 8.0 (Ootpa)
[oracle@ip-192-168-43-225 ~]$

19c Database Installation on Linux 8 fails with Error [INS-08101] Unexpected error while executing the action at state:'SupportedOSCheck'



19c Database Installation fails with Error:[INS-08101] Unexpected error while executing the action at state:'SupportedOSCheck'


Define below parameter before start ./runInstaller for oracle 19c installation on Linux 8




export CV_ASSUME_DISTID=RHEL7.6


To avoid below error :





further, follow below link to complete the oracle database installation 

https://anuragkumarjoy.blogspot.com/2020/04/oracle-database-19c-step-by-step.html


[oracle@ip-192-168-43-225 ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Apr 13 18:56:09 2020
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> select name ,open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------

INDIA     READ WRITE

[oracle@ip-192-168-43-225 ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux release 8.0 (Ootpa)

[oracle@ip-192-168-43-225 ~]$

Oracle support doc


19c Database/client Installation fails with Error:[INS-08101] Unexpected error while executing the action at state:'clientSupportedOSCheck' (Doc ID 2584365.1)