Welcome to Sol 3 Sign in | Join | Help
CS Search | Live Search Search

Sol 3

Home of Barrows Software Solutions, LLC

Keith Barrows - StarPilot

Subjects range from Personal to Technical.

Importing a DMP file into Oracle

This is more for my own notes but you are welcome to glean from it what you can.  Smile

There are a couple main steps involved in pumping a DMP file back into a blank Oracle database. 

  1. Round up the user, schema and tablespace info
  2. Create the tablespaces
  3. Create the users
  4. Create a parameter file
  5. Import the DMP file

For (1) this can be done a few ways.  First, get the info from the person who gave you the DMP file.  Failing that, use a tool to read the DMP file (notepad works I think) and glean the info.

For (2) I would suggest putting the commands into a SQL file.  I saved this file as CreateTablespaces.sql.  Here are the contents:

  DROP tablespace [tablespaceName];
  create tablespace [tablespaceName] datafile '[path]' size [size & k|m|g] -- k=kilobytes, m=megabytes, g=gigabytes
  EXTENT MANAGEMENT LOCAL;
  DROP tablespace [tablespaceNameForIndices];
  create tablespace [tablespaceNameForIndices] datafile '[pathForIndices]' size [size & k|m|g]
  EXTENT MANAGEMENT LOCAL;

Again, for (3) put the commands in a SQL file.  I saved it as CreateUsers.sql.  Here are the contents:

  drop user [user/schema name] cascade;
  create user [user/schema name] identified by [password]
  default tablespace [tablespaceName];
  grant dba to [user/schema name];

Now, let's create the parameters we want to use  I saved this as IMP.PAR.  Here are the contents

  userid=[dba user]/[password]@[database]
  touser=[user/schema]
  fromuser=[original user/schema]
  file=[DMP file path]
  log=[log file path]
  indexes=[y|n]
  grants=[y|n]
  rows=[y|n]
  constraints=[y|n]
  ignore=[y|n]

And now it's time to open SQL*Plus in command line mode and do our do...

  c:\> sqlplus [user]/[password]@[database]
  SQL> @CreateTablespaces.sql
  SQL> @CreateUsers.sql
  SQL> exit
  c:\> imp parfile=imp.par

I hope this helps someone.

Published Wednesday, March 21, 2007 12:16 PM by Keith Barrows
Filed under:

Comments

No Comments
New Comments to this post are disabled

About Keith Barrows

I've been in computing since 1975. I started on an old PDP-8J with 3k of memory and 2 teletypes. I learned BASIC and Octal based assembly. I later moved into CPM, TR-DOS, Apple and finally into PC-DOS, Dr DOS and MS-DOS. I've been a beta tester for over a decade, got into web applications as a means to handle B2B requirements and have specialized in data movement between applications and businesses since. I have been a MVP, ASP Elite and was selected by Microsoft as one of the original 15 board members for ASPInsiders.

This Blog

Syndication

News

Disclaimer
About me

Locations of visitors to this page
weblogs.asp.net/kbarrows
BlogMailr Enabled <script type='text/javascript' src='http://track3.mybloglog.com/js/jsserv.php?mblID=2008010310421330'&gt;&lt;/script> <script type="text/javascript" src="http://pub.mybloglog.com/comm2.php?mblID=2008010310421330&amp;c_width=180&amp;c_sn_opt=y&amp;c_rows=5&amp;c_img_size=f&amp;c_heading_text=Recent+Readers&amp;c_color_heading_bg=005A94&amp;c_color_heading=ffffff&amp;c_color_link_bg=E3E3E3&amp;c_color_link=005A94&amp;c_color_bottom_bg=005A94"></script>
CS Build: 2.1.61129.2
1999
Listed on the CS Listings Powered By Community Server Themed by nb development