Disable automatic table creation in Entity Framework

Usually I prefer code first approach which in turn leads to create or update database based on the any change that I do in my entity model classes. This is very straight forward.

But in one of my recent project for and enterprise client they asked not to do any change in database from code as database should be maintained by the DBA team only so I have to disable database creation and upgrade from my code. To do that I simply have to update one line in my code that is Database.SetInitializer. Keep on reading

Export Oracle database using Oracle SQL Developer

Now it’s time to export your Oracle database with ease. This is the easiest method to export Oracle database I found so far. So let us start the exercise.

First thing you need for this exercise is Oracle SQL Developer installed on your system. For using Oracle SQL Developer you must have Java installed on your system. If Java is installed on your system and SQL Developer can’t find the file then it will show a dialog box to locate the java.exe file. After installing Java and selecting java.exe from the dialog box your SQL Developer will start and will show some useful tips. Read these tips or skip (as you wish)…

Now follow below steps to export you Oracle database in and SQL file (filename.sql)

  1. Select Database Export option from the Tools menu in Oracle SQL Developer.
  2. Now you will see a five step dialog box for exporting you database. In first step you have to select path and name of the SQL file where you want your database script along with the Oracle schema name (this is the database you are going to export). Also select DDL option before proceeding further like “Include Grants” to add script for assigned permissions on the schema. Click Next.
  3. If you schema password is not saved in SQL Developer then it will prompt you for your schema password. Fill the password and click Ok.
  4. Select object types you want to exports from your database. Select all if you want to export everything from you database and click Next.
  5. If you want to export some specific objects then type object name here and add them through arrow buttons or just leave it as it is to export all objects. Click Next.
  6. If you want to export objects with specific data then type data and click Go and add it to export list through arrow buttons or leave it as it is to export all objects. Click Next.
  7. This step will show a summary of you database export. Review you settings for database export and click Finish.

After clicking on Finish it will process the schema and database script will be stored in the file on selected location in first step. Export script will also be displayed in an SQL Worksheet.

Finally you database export script is generated and be prepared to import this database on another oracle instance (in my next article).

Step by step instructions to install ODAC with Oracle Developer Tools for Visual Studio

In my previous post you can find step by step instructions to install Oracle 11g R2. After installing oracle we have to install ODAC to connect our application to Oracle database.

You can download Oracle Data Access Components from these links : ODAC 32-Bit, ODAC 64-Bit

Extract the download files to a folder and run setup.exe file. The setup will start with a consol screen and then it will open a blue color welcome window.

Now click next and it will show two options there for the installation:

  • Oracle Data Access Components for Oracle Client
  • Oracle Data Access Components for Oracle Server

Select first option because we are installing ODAC for client not for server and click next.

In this screen you can choose the location on you hard drive where you want to install the components. By default it will show the path of the current drive from where you are running this setup. After setting your location or leaving default location as it is just click next.

Here you will see list of components to be installed and you can chose the components which you need on your system. My  personal opinion is to select all the components. I’ll select all and click next.

Now it will show a message and a summery window. Click next on both the windows and installation will start

And finally after installation is completed it will show the installation successful message with the path of the hard drive where components are installed.

Yes, we are all done with Oracle Data Access Components installation.


Step by step instructions to install Oracle 11g R2 with screenshots

So we are going to start with steps of installing Oracle 11g Release 2. First you have to download the setup of Oracle 11g R2. You can download it from HERE based on your requirement (32-Bit or 64-Bit).

Note: These instruction are only for installing Oracle 11g R2 in Windows (32 or 64 Bit) systems not for Linux or any other platform.

Select oracle setup for your platform on the link above and accept license agreement before clicking on download link. Before downloading you have to login on Oracle and if you don’t have an account register for free from signup link there. After login you can download both setup zip files (win64_11gR2_database_1of2.zip & win64_11gR2_database_2of2.zip).

Extract both the zip files in he same folder and run setup.exe.

It will ask for email address before installation for support purpose. If you want support from Oracle enter the email address and password of your Oracle account otherwise just click on next. It will then show a message to enter email address for oracle support. (If you have not entered your email address it will show a message just click yes to continue)

In the installation option select “Create and Configure database” and click next

Now select type of the installation you want to run on your system.

  1. Desktop Class
  2. Server Class

In these instructions we will continue with Desktop Class installation so select Desktop Class and click next

Now you will see a screen asking various path for the database engine. It will also show default path selected in the fields and if you want to change it then browse and select your path but my suggestion is leave the default path as they are and enter the Global database name and password of your choice.

Here it will show summary of all the settings before starting installation. Check all the settings and click finish to start the installation process.

After installation starts first of all database components will be installed

After complication of this installation a new window will open which will create and configure your database.

There is nothing to do for you here, it will automatically create and configure database.

When database is configured it will show another message box which contains some information of your database like global database name, SID and server parameter file name etc.

Click OK and that it. You are done with your Oracle 11g R2 installation.

Note down your Enterprise Manager Database Control URL from this window. This control URL runs on your your local system in your browser to manage your Oracle database instance.

To login to this manager control user these details :

  • Username : SYSTEM
  • Password : Password you have set during installation