Using Oracle

Contents:

Some basic information on using an Oracle database.

Command line client

Syntax to load the client to connect to a local database:

$ sqlplus <user> [as <role>]

Specifying a role is optional, but should be used when admin access is required (e.g. loading a dump). e.g.

$ sqlplus sysuser as sysdba

Exporting data to a dump file

For example:

$ exp bizcubed/bizcubed file=/backup/oracle/dumpfile.dmp tables=abc.def query=\"where COL_NAME \>= \'109001\'\" rows=yes

See this page for more information.

Importing data dumps

$ imp

Import: Release 10.2.0.1.0 - Production on Mon Jun 22 16:56:45 2009

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

Username: sysuser as sysdba
Password:

Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production

Import file: expdat.dmp >

If the dump file is in the directory from where you loaded imp, you can just type its name. You will be asked a series of questions before the import can commence.

If you see an error like this:

. importing PROD's objects into PROD
 "ALTER SESSION SET CURRENT_SCHEMA= "PROD""
IMP-00003: ORACLE error 1435 encountered
ORA-01435: user does not exist
IMP-00000: Import terminated unsuccessfully

You will need to create user "PROD".

See this page for more information.

Resources

Tools


Creator: Sridhar Dhanapalan on 2009/06/19 16:41
XWiki Enterprise 1.7.2.16857 - Documentation