Export Full de um Banco de Dados Oracle

Por . | 25/08/2012 | Tecnologia

Hoje estarei abordando sobre como se fazer um Export Full em um Banco de Dados, o que pode ser muito útil para se utilizar como backup, quando se vai executar um tarefa crítica no ambiente.Todavia, se o banco for muito grande, o processo pode levar horas.


Para se executar esta rotina, primeiramente há a necessidade de setar as variáveis de ambiente:


[oracle@localhost ~]$ export ORACLE_SID=dbbruno
[oracle@localhost ~]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

Posteriormente, executar o comando para a efetuação do Export Full:

[oracle@localhost ~]$ exp \'/ as sysdba \' file=/home/oracle/dbbruno.dmp log=dbbruno.log full=y

Export: Release 11.2.0.1.0 - Production on Sat Aug 25 15:32:51 2012

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.


Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses AL32UTF8 character set (possible charset conversion)

About to export the entire database ...
. exporting tablespace definitions
. exporting profiles
. exporting user definitions
. exporting roles
. exporting resource costs
. exporting rollback segment definitions
. exporting database links
. exporting sequence numbers
. exporting directory aliases
. exporting context namespaces
. exporting foreign function library names
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions
. exporting system procedural objects and actions
. exporting pre-schema procedural objects and actions
. exporting cluster definitions
. about to export SYSTEM's tables via Conventional Path ...
. . exporting table                    DEF$_AQCALL          0 rows exported
. . exporting table                   DEF$_AQERROR          0 rows exported
. . exporting table                  DEF$_CALLDEST          0 rows exported
. . exporting table               DEF$_DEFAULTDEST          0 rows exported
. . exporting table               DEF$_DESTINATION          0 rows exported
. . exporting table                     DEF$_ERROR          0 rows exported
. . exporting table                       DEF$_LOB          0 rows exported
. . exporting table                    DEF$_ORIGIN          0 rows exported
. . exporting table                DEF$_PROPAGATOR          0 rows exported
. . exporting table       DEF$_PUSHED_TRANSACTIONS          0 rows exported
. . exporting table                            OL$
. . exporting table                       OL$HINTS
. . exporting table                       OL$NODES
. . exporting table        REPCAT$_AUDIT_ATTRIBUTE          2 rows exported
. . exporting table           REPCAT$_AUDIT_COLUMN          0 rows exported
. . exporting table           REPCAT$_COLUMN_GROUP          0 rows exported
. . exporting table               REPCAT$_CONFLICT          0 rows exported
. . exporting table                    REPCAT$_DDL          0 rows exported
. . exporting table             REPCAT$_EXCEPTIONS          0 rows exported
. . exporting table              REPCAT$_EXTENSION          0 rows exported
. . exporting table                REPCAT$_FLAVORS          0 rows exported
. . exporting table         REPCAT$_FLAVOR_OBJECTS          0 rows exported
. . exporting table              REPCAT$_GENERATED          0 rows exported
. . exporting table         REPCAT$_GROUPED_COLUMN          0 rows exported
. . exporting table      REPCAT$_INSTANTIATION_DDL          0 rows exported
. . exporting table            REPCAT$_KEY_COLUMNS          0 rows exported
. . exporting table           REPCAT$_OBJECT_PARMS          0 rows exported
. . exporting table           REPCAT$_OBJECT_TYPES         28 rows exported
. . exporting table       REPCAT$_PARAMETER_COLUMN          0 rows exported
. . exporting table               REPCAT$_PRIORITY          0 rows exported
. . exporting table         REPCAT$_PRIORITY_GROUP          0 rows exported
. . exporting table      REPCAT$_REFRESH_TEMPLATES          0 rows exported
. . exporting table                 REPCAT$_REPCAT          0 rows exported
. . exporting table              REPCAT$_REPCATLOG          0 rows exported
. . exporting table              REPCAT$_REPCOLUMN          0 rows exported
. . exporting table         REPCAT$_REPGROUP_PRIVS          0 rows exported
. . exporting table              REPCAT$_REPOBJECT          0 rows exported
. . exporting table                REPCAT$_REPPROP          0 rows exported
. . exporting table              REPCAT$_REPSCHEMA          0 rows exported
. . exporting table             REPCAT$_RESOLUTION          0 rows exported
. . exporting table      REPCAT$_RESOLUTION_METHOD         19 rows exported
. . exporting table  REPCAT$_RESOLUTION_STATISTICS          0 rows exported
. . exporting table    REPCAT$_RESOL_STATS_CONTROL          0 rows exported
. . exporting table          REPCAT$_RUNTIME_PARMS          0 rows exported
. . exporting table              REPCAT$_SITES_NEW          0 rows exported
. . exporting table           REPCAT$_SITE_OBJECTS          0 rows exported
. . exporting table              REPCAT$_SNAPGROUP          0 rows exported
. . exporting table         REPCAT$_TEMPLATE_PARMS          0 rows exported
. . exporting table     REPCAT$_TEMPLATE_REFGROUPS          0 rows exported
. . exporting table         REPCAT$_TEMPLATE_SITES          0 rows exported
. . exporting table        REPCAT$_TEMPLATE_STATUS          3 rows exported
. . exporting table       REPCAT$_TEMPLATE_TARGETS          0 rows exported
. . exporting table         REPCAT$_TEMPLATE_TYPES          2 rows exported
. . exporting table    REPCAT$_USER_AUTHORIZATIONS          0 rows exported
. . exporting table       REPCAT$_USER_PARM_VALUES          0 rows exported
. about to export OUTLN's tables via Conventional Path ...
. . exporting table                            OL$          0 rows exported
. . exporting table                       OL$HINTS          0 rows exported
. . exporting table                       OL$NODES          0 rows exported
. about to export RMAN's tables via Conventional Path ...
. about to export BRUNORS's tables via Conventional Path ...
. about to export EXEMPLO_FINAL's tables via Conventional Path ...
. exporting synonyms
. exporting views
. exporting referential integrity constraints
. exporting stored procedures
. exporting operators
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting triggers
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting user history table
. exporting default and system auditing options
. exporting statistics
Export terminated successfully without warnings.

Onde, a sintaxe básica seria:

exp -> Clásula que precisa ser passada para dizer que se deseja exportar algo. No caso do import é imp.

\'/ as sysdba\' -> Usuário máximo do banco, com grant de DBA.

File ->  Nome que se deseja que seja gerado o arquivo de DUMP.

Full -> Clausúla que define se será efetuado o export do banco inteiro ou não, sendo  full=y para sim (yes).



É importante observar se o export foi executado sem erros, reportando a expressão :"Export terminated successfully without warnings.", que em português seria : " Export terminou com sucesso sem erros.".

 

Sendo assim, segue o Dump:


[oracle@localhost ~]$ pwd
/home/oracle
[oracle@localhost ~]$ ls -ltr
total 10296
drwxr-xr-x 2 oracle oracle    4096 Jul 29  2011 Desktop
drwxr-xr-x 3 oracle oracle    4096 Jul 30  2011 oradiag_oracle
-rw-r--r-- 1 oracle oracle   19506 Jul 30  2011 grid.rsp
-rw-r--r-- 1 oracle oracle   15626 Jul 30  2011 db.rsp
-rw-rw---- 1 oracle dba    9748481 Nov  8  2011 backup.bkp
-rw-rw-r-- 1 oracle oracle   13583 Aug 25 15:37 dbbruno.log
-rw-rw-r-- 1 oracle oracle  696320 Aug 25 15:37 dbbruno.dmp


Espero tê-lo ajudado, abraços!