Tag Archives: dbca

Remove Oracle Database with DBCA from command line

The following procedure shows how to remove an Oracle database with dbca utility from the command line.

1. Logon as the oracle software owner.

[root@mylinux2 root]# su – oracle
[oracle@mylinux2 ~]$

2. Change directories to $ORACLE_HOME/bin

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

3. Obtain the ORACLE_SID of the database you wish to delete.

[oracle@mylinux2 bin]$ ps -ef|grep smon
oracle 4746 1 0 Feb09 ? 00:00:00 ora_smon_orcl
oracle 7839 7796 0 00:39 pts/1 00:00:00 grep smon
[oracle@mylinux2 bin]$

4. Obtain the userid and password of a user with sysdba privileges, normally this would be sys.

5. Logon to the database if open with the immediate option and exit.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@mylinux2 bin]$

6. Ensure that no oracle database processes are running for the ORACLE_SID you wish to delete


[oracle@mylinux2 bin]$ ps -ef|grep orcl
oracle 11485 7796 0 01:46 pts/1 00:00:00 grep orcl
[oracle@mylinux2 bin]$

7. Execute the command dbca -deleteDatabase -sourceDB -sysDBAUserName -sysDBAPassword


[oracle@mylinux2 bin]$ ./dbca -silent -deleteDatabase -sourceDB orcl – sysDBAUserName larry -sysDBAPassword larry
Connecting to database
4% complete
9% complete
14% complete
19% complete
23% complete
28% complete
47% complete
Updating network configuration files
48% complete
52% complete
Deleting instance and datafiles
76% complete
100% complete
Look at the log file “/u01/app/oracle/cfgtoollogs/dbca/orcl.log” for
further details.
[oracle@mylinux2 bin]$

This completes deleting an oracle database from command line with dbca.

Larry J. Catt, OCP
oracle@allcompute.com
www.allcompute.com

Oracle DBCA – Database Configuration assistant.

Oracle provides several Configuration Assistant tools to facility administrative duties required by an Oracle DBA or Developer. The Oracle’s DBCA (Database Configuration Assistant) is the GUI tool used to create starter databases within the Oracle RDBMS. The DBCA utility was introduced in Oracle 8i and provides the user a GUI to eliminate the need for manual configuration of database creation scripts. In this article we will review the startup of the Database Configuration Assistant within a RHEL environment.

1. Logon to your Oracle Database server as the Oracle software owner.
2. Change directories to your $ORACLE_HOME/bin.

mylinux:> cd $ORACLE_HOME/bin
mylinux:>

3. Export your display to your local machine if you are not logon to the server itself.

mylinux:> export DISPLAY=192.168.0.110:0.0
mylinux:>

4. You will require a terminal emulation program executing on your local machine to produce the display from your database server. Any terminal display software will do, however I would suggest VNC which can be downloaded for free at the URL: www.realvnc.com

5. Execute the dbca shell script to startup the database configuration assistant.

mylinux:> ./dbca

6. The Welcome screen will display and the wizard from here on is pretty self explanatory. The DBCA utility provides you the ability to Create Databases, Configure Database Options, Delete Databases, Manage Database Templates, and Configure ASM instances for storage.

Larry J. Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com

DBCA will not start with error NJNI10

1. If you see the error below when trying to execute DBCA try the next three steps to resolve.

[oracle@mylinux1 bin]$ ./dbca

UnsaUntitled 1tisfiedLinkError exception loading native library: njni10
Exception in thread “main” java.lang.UnsatisfiedLinkError: get
at oracle.net.common.NetGetEnv.get(Native Method)
at oracle.net.config.Config.getNetDir(Unknown Source)
at oracle.net.config.Config.initConfig(Unknown Source)
at oracle.net.config.Config.(Unknown Source)
at oracle.sysman.assistants.util.NetworkUtils.(NetworkUtils.java:225)
at oracle.sysman.assistants.util.step.StepContext.(StepContext.java:264)
at oracle.sysman.assistants.dbca.backend.Host.(Host.java:686)
at oracle.sysman.assistants.dbca.ui.UIHost.(UIHost.java:205)
at oracle.sysman.assistants.dbca.ui.InteractiveHost.(InteractiveHost.java:54)
at oracle.sysman.assistants.dbca.Dbca.getHost(Dbca.java:160)
at oracle.sysman.assistants.dbca.Dbca.execute(Dbca.java:94)
at oracle.sysman.assistants.dbca.Dbca.main(Dbca.java:180)

[oracle@mylinux1 bin]$

2. Create the following soft links in $ORACLE_HOME/bin directory and retry ./dbca command.

[oracle@mylinux1 bin]$ ln -s $ORACLE_HOME/lib/libnjni10.dylib $ORACLE_HOME/lib/libnjni10
[oracle@mylinux1 bin]$ ln -s $ORACLE_HOME/lib/libclntsh.dylib $ORACLE_HOME/lib/libclntsh.dylib.10.1

3. If the previous step did not resolve the issue ensure that the variable LD_LIBRARY_PATH contains both $ORACLE_HOME/lib and $ORACLE_HOME/lib32. Re-execute your .bash file and retry ./dbca command.

[oracle@mylinux1 ~]$ vi .bash_profile
[oracle@mylinux1 ~]$ . ./.bash_profile

4. If the previous step did not resolve the issue, install or re-install the following 32 bit packages: glibc-devel-2.3.4-2.36.i386.rpm and glibc-2.3.4-2.36.i686.rpm. Then cd to $ORACLE_HOME/bin and execute ./relink all. Finally, retry the ./dbca command.

[root@mylinux1 RPMS]# rpm -Uvh –force glibc-devel-2.3.4-2.36.i386.rpm
Preparing… ########################################### [100%]
1:glibc-devel ########################################### [100%]
[root@mylinux1 RPMS]# rpm -Uvh –force glibc-2.3.4-2.36.i686.rpm
Preparing… ########################################### [100%]
1:glibc ########################################### [100%]
[root@mylinux1 RPMS]#

Larry J Catt, OCP
oracle@allcompute.com
www.allcompute.com