This part mainly talk about these points:
- Import and export of database
- Start and Stop database
- Starting and stopping Nodes in the RAC
- Manage available sessions
import(imp) utilities are used to perform logical database backup and recovery. When exporting, database objects are dumped to a binary file which can then be imported into another Oracle database.
exp/impis different from
Data Pump, The detail about datapump will talk in other article.
export/importutilities are commonly used to perform the following tasks:
- Backup and recovery (small databases only, say <
+50GB, if bigger, use
- Move data between Oracle databases on different platforms (for example from Solaris to Windows)
- Reorganization of data / eliminate database fragmentation (
- Upgrade databases from extremely old versions of Oracle (when in-place upgrades are not supported by the Database Upgrade Assistant any more)
- Detect database corruption. Ensure that all the data can be read
- Transporting tablespaces between databases
Look for the
expexecutables in your
$ORACLE_HOME/bindirectory. One can run them interactively, using command line parameters, or using parameter files. Look at the
imp/expparameters before starting. These parameters can be listed by executing the following commands:
The following examples demonstrate how the
imp/exputilities can be used:
exp scott/tiger file=emp.dmp log=emp.log tables=emp rows=yes indexes=no
From Oracle 8i one can use the
QUERY=export parameter to selectively unload a subset of the data from a table. You may need to escape special chars on the command line.
query=\"where deptno=10\". Look at these examples:
exp scott/tiger tables=emp query="where deptno=10"
Before one imports rows into already populated tables, one needs to truncate or drop these tables to get rid of the old data. If not, the new data will be appended to the existing tables. One must always
DROPexisting Sequences before re-importing. If the sequences are not dropped, they will generate numbers inconsistent with the rest of the database.
Note: It is also advisable to drop indexes before importing to speed up the import process. Indexes can easily be recreated after the data was successfully imported.
Ensure oracle other service such as
Oracle start has thress modes, step by step start oracle:
PS. This mode just create instance, does not mount database, And just create memory structures and service processess for oracle instance, It can not open any data file.
In this mode, only access the dictionary views related SGA, contains
VSESSIONetc. Because these views is get from SGA area.
What you can do:
create new database
rebuild control files
PS. This mode will mount database, but database status is closed, so client user can’t operate the database.
In this mode, only access the dictionary views related Control files, contains
V$LOGFILEetc. Because these views is get from Control files.
What you can do:
Add/Del/Rename rebuild log files
Execute database recover completely
Change database to Archive mode
PS. Normal mode to start database. If occurred any error, please use
su - oracle
Shutdown the database has four methods:
This mode will forbid new client create connection, the current executing transtracion is still doing.
This mode will not wait users active disconnection and will enforce the transtractions
This mode will wait users not commit transactions to commit.
This mode will ignore everything. Be careful~
su - oracle
# check status of instance
# verify instance running
select logins from v$instance;
SELECT SID, SERIAL#, STATUS
alter system kill session ' sid, serial#' IMMEDIATE;
License: CC BY-NC-ND 4.0