sh: error importing function definition for `BASH_FUNC_module' in linux

Error:

sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for 'BASH_FUNC_module'

or

sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `module'


This is related to OS level profiles setup referencing modules.sh .


This issue may occur when doing any of the following:


1. Attempting to start the Admin Server:

    $ sh adadminsrvctl.sh start


2. Running either adop prepare o apply phases:

$ adop phase=prepare or adop phase=apply   



To implement the solution, test the following steps in a Test or Development instance and migrate  on production accordingly :-


1. Please rename the /etc/profile.d/modules.sh to /etc/profile.d/modules.sh.bkup h.

Connect as root and check the shell file modules.sh under '/etc/profile.d':

#ls -ltr /etc/profile.d/modules.sh



-rw-rw-r--. 1 root root 168 Mar 25  2014 /etc/profile.d/modules.sh


# mv /etc/profile.d/modules.sh /etc/profile.d/modules.sh.bkup



2. Run ./adadminsrvctl.sh start to test whether the issue (sh: module: line 1: syntax error: unexpected end of file) is resolved.


After doing the above steps , hope this will fix the error 'bash: syntax error near unexpected token.



drop database command in oracle


how to drop database in oracle 11g/12c
Drop oracle Database

Steps to remove oracle database in Oracle | . Suppose we have requirement to drop entire oracle database if we are planing to refresh test or development database instance, To fulfill the requirement we must drop/delete/remove the database. There are several way to remove database. We will discuss here using CLI to delete oracle database instance.


Below are steps to delete oracle database instance.  We will aware how to delete oracle instance.

Check the database status.

SQL> select name,open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
PHASE1    READ WRITE

Shutdown if database in open mode.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>

Here introducing two way to mount database in exclusive/restricted mode.

Execute 'alter system enable restricted session' , if database in mount mode.

SQL> startup mount
ORACLE instance started.

Total System Global Area 6413680640 bytes
Fixed Size                  2265224 bytes
Variable Size             805310328 bytes
Database Buffers         5586812928 bytes
Redo Buffers               19292160 bytes
Database mounted.



SQL> alter system enable restricted session;

System altered.


Execute 'startup mount exclusive restrict' , if database already shutdown.


SQL> startup mount exclusive restrict;
ORACLE instance started.

Total System Global Area 6413680640 bytes
Fixed Size                  2265224 bytes
Variable Size             805310328 bytes
Database Buffers         5586812928 bytes
Redo Buffers               19292160 bytes
Database mounted.

After that run drop database command on sql prompt to remove the oracle database.


SQL>drop database;