Database 11g

Monday, January 29, 2018

ORA-29701,ORA-01078



Hi Guy's,

Our Test server was abnormally shutdown when i restarted my ASM instance its showing ORA-29701,ORA-01078

and it starts working when i restarted the ASM from services and HAS service using 'CRSCTL' in Windows.



C:\Windows\system32>set oracle_sid=+asm

C:\Windows\system32>sqlplus / as sysasm

SQL*Plus: Release 11.2.0.3.0 Production on Mon Jan 29 11:34:05 2018
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to an idle instance.

SQL> startup

ORA-01078: failure in processing system parameters
ORA-29701: unable to connect to Cluster Synchronization Service



SQL> exit
Disconnected

C:\Windows\system32> crsctl enable has
CRS-4622: Oracle High Availability Services autostart is enabled.

C:\Windows\system32>crsctl start has
CRS-4123: Oracle High Availability Services has been started.


C:\Windows\system32>crs_stat -t

Name                           Type               Target                State               Host
-------------------------------------------------------------------------------------------------
ora.DATA.dg        ora....up.type        ONLINE           ONLINE        moinit-pc
ora.DATA1.dg      ora....up.type        ONLINE           ONLINE        moinit-pc
ora....ER.lsnr        ora....er.type         ONLINE           ONLINE       moinit-pc
ora.asm                 ora.asm.type        ONLINE          ONLINE       moinit-pc
ora.cssd                ora.cssd.type        ONLINE          ONLINE       moinit-pc
ora.evmd              ora.evm.type         ONLINE           ONLINE       moinit-pc
ora.kkprod.db      ora....se.type          ONLINE           ONLINE       moinit-pc
ora.ons                 ora.ons.type           OFFLINE        OFFLINE
ora.test.db            ora....se.type           ONLINE         ONLINE       moinit-pc
ora.tstrd.db           ora....se.type          ONLINE          ONLINE      moinit-pc



C:\Windows\system32> sqlplus / as sysasm

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Automatic Storage Management option


SQL> select instance_name,status from v$instance;

INSTANCE_NAME        STATUS
---------------- --------------------------------
+asm                             STARTED



Happy Learning...



Wednesday, January 10, 2018

ORA-31626, UDE-31626,39086,ORA-06512,ORA-19815,ORA-03113




#####################################
      ERRORS IN MY ALERT-LOG FILE
#####################################


Errors in file C:\APP\MOIN\diag\rdbms\kkprod\kkprod\trace\kkprod_ora_5720.trc:
ORA-19815: WARNING: db_recovery_file_dest_size of 2147483648 bytes is 99.02% used, and has 20971520 remaining bytes available.

************************************************************************
You have following choices to free up space from recovery area:

1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard,
   then consider changing RMAN ARCHIVELOG DELETION POLICY.
2. Back up files to tertiary device such as tape using RMAN
   BACKUP RECOVERY AREA command.
3. Add disk space and increase db_recovery_file_dest_size parameter to
   reflect the new space.
4. Delete unnecessary files using RMAN DELETE command. If an operating
   system command was used to delete files, then use RMAN CROSSCHECK and
   DELETE EXPIRED commands.
************************************************************************
ARCH: Error 19809 Creating archive log file to '+DATA1'
ARC0: STARTING ARCH PROCESSES
Mon Jan 01 15:48:40 2018
ARC1 started with pid=26, OS id=2984
Mon Jan 01 15:48:40 2018
ARC2 started with pid=27, OS id=5724
Mon Jan 01 15:48:40 2018
ARC3 started with pid=28, OS id=1764
Errors in file C:\APP\MOIN\diag\rdbms\kkprod\kkprod\trace\kkprod_ora_5720.trc:
ORA-16038: log 3 sequence# 33 cannot be archived
ORA-19809: limit exceeded for recovery files
ORA-00312: online log 3 thread 1: '+DATA/kkprod/onlinelog/group_3.259.963052735'
ORA-00312: online log 3 thread 1: 'E:\FRA\KKPROD\ONLINELOG\O1_MF_3_F3GW4JG3_.LOG'
USER (ospid: 5720): terminating the instance due to error 16038
Mon Jan 01 15:48:41 2018
System state dump requested by (instance=1, osid=5720), summary=[abnormal instance termination].
System State dumped to trace file C:\APP\MOIN\diag\rdbms\kkprod\kkprod\trace\kkprod_diag_3272.trc
Dumping diagnostic data in directory=[cdmp_20180101154841], requested by (instance=1, osid=5720), summary=[abnormal instance termination].
ARC1: Archival started
ARC0: Detected ARCH process failure
ARC0: STARTING ARCH PROCESSES COMPLETE
ARC0: Archival disabled due to shutdown: 1092
Shutting down archive processes
Archiving is disabled
ARC0: Detected ARCH process failure
Mon Jan 01 15:48:49 2018
Instance terminated by USER, pid = 5720

#############################################################################


 Below is the output generated when i exit Datapump job full=y by pressing CTRL+C job was hanging since 2 hrs.....


UDE-31626: operation generated ORACLE error 31626
ORA-31626: job does not exist

ORA-39086: cannot retrieve job information
ORA-06512: at "SYS.DBMS_DATAPUMP", line 3326
ORA-06512: at "SYS.DBMS_DATAPUMP", line 4551
ORA-06512: at line 1


  ASM started sucessfully ....

  When i started Database it shows ORA-03113 


SQL> startup

ORACLE instance started.
Total System Global Area 1.0689E+10 bytes
Fixed Size                  2264616 bytes
Variable Size            9160360408 bytes
Database Buffers         1509949440 bytes
Redo Buffers               16900096 bytes
Database mounted.
ORA-03113: end-of-file on communication channel
Process ID: 5132
Session ID: 193 Serial number: 3


C:\Windows\system32>sqlplus /nolog

SQL*Plus: Release 11.2.0.3.0 Production on Mon Jan 1 15:53:09 2018
Copyright (c) 1982, 2011, Oracle.  All rights reserved.


SQL> conn / as sysdba
Connected to an idle instance.

SQL> startup mount;

ORACLE instance started.
Total System Global Area        1.0689E+10 bytes
Fixed Size                                2264616 bytes
Variable Size                            9160360408 bytes
Database Buffers                     1509949440 bytes
Redo Buffers                           16900096 bytes
Database mounted.


SQL> show parameter db_reco

NAME                                       TYPE                    VALUE
--------------------------------------------------------------------------------
db_recovery_file_dest                string                   +DATA1
db_recovery_file_dest_size        big integer 2G


SQL> alter system set db_recovery_file_dest_size = 20G scope=both;

System altered.

SQL> EXIT
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

C:\Windows\system32> rman

Recovery Manager: Release 11.2.0.3.0 - Production on Mon Jan 1 16:12:21 2018

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

RMAN> connect target /

connected to target database: KKPROD (DBID=1757363720, not open)

RMAN> delete backup of archivelog all;

RMAN> crosscheck backup;

using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=63 device type=DISK
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=+DATA1/kkprod/autobackup/2017_12_25/s_963661884.274.963661885 RECID=12 STAMP=963661885
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=+DATA1/kkprod/autobackup/2017_12_25/s_963663274.268.963663275 RECID=13 STAMP=963663275
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=+DATA1/kkprod/autobackup/2017_12_25/s_963664178.275.963664179 RECID=14 STAMP=963664178
Crosschecked 3 objects


RMAN> delete expired backup;

using channel ORA_DISK_1

List of Backup Pieces
BP    Key     BS    Key     Pc#    Cp#    Status      Device Type      Piece Name
------- ------- --- --- ----------- ----------- ----------------------------------------------------------------------------------------
12      12      1   1   EXPIRED     DISK        +DATA1/kkprod/autobackup/2017_12_25/s_963661884.274.963661885
13      13      1   1   EXPIRED     DISK        +DATA1/kkprod/autobackup/2017_12_25/s_963663274.268.963663275
14      14      1   1   EXPIRED     DISK        +DATA1/kkprod/autobackup/2017_12_25/s_963664178.275.963664179

Do you really want to delete the above objects (enter YES or NO)? y
deleted backup piece
backup piece handle=+DATA1/kkprod/autobackup/2017_12_25/s_963661884.274.963661885 RECID=12 STAMP=963661885
deleted backup piece
backup piece handle=+DATA1/kkprod/autobackup/2017_12_25/s_963663274.268.963663275 RECID=13 STAMP=963663275
deleted backup piece
backup piece handle=+DATA1/kkprod/autobackup/2017_12_25/s_963664178.275.963664179 RECID=14 STAMP=963664178
Deleted 3 EXPIRED objects


C:\Windows\system32> sqlplus / as sysdba

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> show parameter db_reco

NAME                                         TYPE            VALUE
-------------------------------------------------------------------
db_recovery_file_dest                string             +DATA1
db_recovery_file_dest_size        big integer      20G

SQL> select instance_name,status from v$instance;

INSTANCE_NAME            STATUS
-------------------------------------------------------
kkprod                                MOUNTED

SQL> alter database open;

Database altered.

SQL> select instance_name,status from v$instance;

INSTANCE_NAME              STATUS
-------------------------------------------------
kkprod                                     OPEN


 Now check any previous expdp jobs are running.


SQL> set lines 200
SQL> SELECT owner_name, job_name, operation, job_mode,state, attached_sessions FROM dba_datapump_jobs ORDER BY 1,2;

OWNER_NAME      JOB_NAME            OPERATION  JOB_MODE               STATE        ATTACHED_SESSIONS
------------------------------ ------------------------------ ----------------------------------------------------------------------------
SYSTEM      SYS_EXPORT_FULL_01       EXPORT         FULL                   NOT RUNNING          0
SYSTEM      SYS_IMPORT_FULL_01        IMPORT          FULL                   NOT RUNNING          0


SQL>  drop table  system.SYS_EXPORT_FULL_01;

Table dropped.


SQL> drop table  SYSTEM.SYS_IMPORT_FULL_01;

Table dropped.


>>> INCREASE SGA SIZE <<<<


SQL> select sum(value)/1024/1024/1024 "TOTAL SGA (GB)" from v$sga;

TOTAL SGA (GB)
--------------
    9.95534897

SQL> select sum(bytes)/1024/1024/1024 " GB" from v$sgastat where name!='free memory';

        GB
----------
1.55478944

SQL>  alter system set sga_max_size=20g scope=spfile;

SQL> alter system set memory_max_target=25g scope=spfile;

SQL>  alter system set memory_target=25g scope=spfile;


SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup

ORACLE instance started.
Total System Global Area 2.1379E+10 bytes
Fixed Size                  2264616 bytes
Variable Size            1.9931E+10 bytes
Database Buffers         1409286144 bytes
Redo Buffers               36073472 bytes
Database mounted.
Database opened.


SQL> select sum(value)/1024/1024/1024 "TOTAL SGA (GB)" from v$sga;
TOTAL SGA (GB)
--------------
    19.9107056


SQL> select sum(bytes)/1024/1024/1024 " GB" from v$sgastat where name!='free memory';
        GB
----------
1.36548476


SQL> select owner, count(1), object_type from dba_objects group by owner, object_type having owner in
     (select username from dba_users where default_tablespace = 'USERS') and object_type = 'TABLE';

OWNER                   COUNT(1)        OBJECT_TYPE
----------------------------------------------------------------------
HMIS                            1998                  TABLE
SCOTT                            4                     TABLE
ARCHIVEDB                 1                      TABLE
CMIS                            410                    TABLE
IDMS7                         1978                  TABLE



 All the tables restored as soon i increase the size db_recovery_file_dest and SGA size.
And Import Run Successfully.


E:\imp_kkprod>impdp directory=imp_kkprod log=kkprod_impfull full=y dumpfile=IECLIVE_01JAN2018FULL.DMP


Username: system
Password:

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/PRE_TABLE_ACTION
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA

. . imported "HMIS"."SHSHTDTA"                                        3.524 GB   41666374 rows
. . imported "IDMS7"."TBL_HIJRI_CONTROLS"                 2.403 GB   4982267 rows
. . imported "HMIS"."OTOCURNC"                                      1.446 GB   10604454 rows

100 % Executed Successfully.



Happy Learning....









Tuesday, January 9, 2018

Logical Cumulative Backups in Oracle 11g using Exp Utility



>> Cumulative Export backsup the tables that have changed since the last cumulative or complete Export.

>> To understand more clearly pls check this scenario in which i took 'Complete' backup first and then i
   perform 'Cumulative' backup.

E:\exp_full> exp file=E:\exp_full\newcomplete_bkp log=newcomplete.log full=y inctype=complete

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
EXP-00041: INCTYPE parameter is obsolete
Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set

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 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       WWV_FLOW_PICK_PAGE_VIEWS                    5 rows exported
. . exporting table         WWV_FLOW_PLATFORM_PREF                    0 rows exported
. . exporting table        WWV_FLOW_PLATFORM_PREFS                   21 rows exported
. . exporting table    WWV_FLOW_POPUP_LOV_TEMPLATE             10 rows exported
. . exporting table          WWV_FLOW_PREFERENCES$                       0 rows exported
. . exporting table            WWV_FLOW_PROCESSING                          45 rows exported
. . exporting table     WWV_FLOW_PROVISION_COMPANY               0 rows exported
. . exporting table  WWV_FLOW_PROVISION_SERICE_MOD             0 rows exported
. . exporting table      WWV_FLOW_PURGED_SESSIONS$                   0 rows exported
. . exporting table         WWV_FLOW_QB_SAVED_COND                     0 rows exported
. . exporting table         WWV_FLOW_QB_SAVED_JOIN                        0 rows exported
. . exporting table        WWV_FLOW_QB_SAVED_QUERY                    0 rows exported
. . exporting table         WWV_FLOW_QB_SAVED_TABS                      0 rows exported
. . exporting table          WWV_FLOW_QUERY_COLUMN                    18 rows exported
. . exporting table       WWV_FLOW_QUERY_CONDITION                   6 rows exported
. . exporting table      WWV_FLOW_QUERY_DEFINITION                   6 rows exported
. . exporting table          WWV_FLOW_QUERY_OBJECT                       6 rows exported
. . exporting table         WWV_FLOW_RANDOM_IMAGES                    42 rows exported
. . exporting table WWV_FLOW_REGION_CHART_SER_ATTR           0 rows exported
. . exporting table  WWV_FLOW_REGION_REPORT_COLUMN          7903 rows exported
. . exporting table  WWV_FLOW_REGION_REPORT_FILTER               0 rows exported
. . exporting table   WWV_FLOW_REGION_UPD_RPT_COLS              439 rows exported
. . exporting table        WWV_FLOW_REPORT_LAYOUTS                     0 rows exported
. . exporting table WWV_FLOW_REQUEST_VERIFICATIONS             0 rows exported
. . exporting table        WWV_FLOW_REQUIRED_ROLES                     0 rows exported
. . exporting table    WWV_FLOW_RESTRICTED_SCHEMAS              46 rows exported
. . exporting table         WWV_FLOW_ROW_TEMPLATES                    54 rows exported
. . exporting table  WWV_FLOW_WORKSHEET_CATEGORIES          0 rows exported
. . exporting table     WWV_FLOW_WORKSHEET_COLUMNS            721 rows exported
. . exporting table  WWV_FLOW_WORKSHEET_COL_GROUPS         0 rows exported
 . exporting table                        OWBRTPS                                             0 rows exported
. about to export OWBSYS_AUDIT's tables via Conventional Path ...
. about to export DAVID's tables via Conventional Path ...
. . exporting table                            EMP                    0 rows exported
. . exporting table                            INV                     0 rows exported
. about to export ROSY's tables via Conventional Path ...
. . exporting table                            ACC                    0 rows exported
. . exporting table                           DEPT                   4 rows exported
. about to export SARA's tables via Conventional Path ...
. . exporting table                           DEPT                   4 rows exported
. . exporting table                            EMP                  14 rows exported
. . exporting table                       SALGRADE          5 rows exported

. about to export SCOTT's tables via Conventional Path ...
. . exporting table                          BONUS              0 rows exported
. . exporting table                           DEPT               4 rows exported
. . exporting table                            EMP               14 rows exported
. . exporting table                         EMPNEW         14 rows exported
. . exporting table                       SALGRADE       5 rows exported
. 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 with warnings.


>> All the tables are exported in this above output.


                              ####################################################
                                          CREATED ONE USER AND ADDED 4 TABLES
                               ####################################################


SQL> create table lab.lab_emp as select * from scott.emp;

Table created.

SQL> create table lab.lab_salgrade as select * from scott.salgrade;

Table created.

SQL> create table lab.lab_bonus as select * from scott.bonus;

Table created.

SQL> create table lab.lab_department as select * from scott.dept;

Table created.

SQL> commit;



 Now Take Cumulative Backup


E:\exp_full> exp file=E:\exp_full\labcum_bkp log=labcum.log full=y inctype=cumulative

Username: system
Password:

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
EXP-00041: INCTYPE parameter is obsolete
Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set

About to export the entire database ...
. exporting tablespace definitions
. exporting profiles
. exporting user definitions
. exporting roles
. exporting resource costs
. exporting rollback segment definitions
EXP-00107: Feature (BINARY XML) of column OPERAND in table ORDDATA.ORDDCM_CT_PRED_OPRD is not supported. The table will not be exported.
. . exporting table        ORDDCM_CT_PRED_OPRD_TMP
EXP-00107: Feature (BINARY XML) of column OPERAND in table ORDDATA.ORDDCM_CT_PRED_OPRD_TMP is not supported. The table will not be exported.
. . exporting table        ORDDCM_CT_PRED_OPRD_WRK
EXP-00107: Feature (BINARY XML) of column OPERAND in table ORDDATA.ORDDCM_CT_PRED_OPRD_WRK is not supported. The table will not be exported.
. . exporting table                    ORDDCM_DOCS
EXP-00107: Feature (BINARY XML) of column XML_CONTENT in table APEX_030200.WWV_MIG_RPTS is not supported. The table will not be exported.
. about to export OWBSYS's tables via Conventional Path ...
. about to export OWBSYS_AUDIT's tables via Conventional Path ...
. about to export DAVID's tables via Conventional Path ...
. about to export ROSY's tables via Conventional Path ...
. about to export SARA's tables via Conventional Path ...
. about to export SCOTT's tables via Conventional Path ...

. about to export LAB's tables via Conventional Path ...
. . exporting table                      LAB_BONUS                        0 rows exported
. . exporting table                 LAB_DEPARTMENT                 4 rows exported
. . exporting table                        LAB_EMP                           14 rows exported
. . exporting table                   LAB_SALGRADE                    5 rows exported

. 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 information about dropped objects
. exporting statistics
Export terminated successfully with warnings.


>> You can observe in both this scenarios output, how 'COMPLETE' option is taking all the tables backup which is nothing but full=y and compare this from the 'CUMULATIVE' output which is exported only 4 tables  which we added after complete backup.




Happy Learning....





Monday, January 8, 2018

Remap Schema in Oracle 11g




>> Oracle Remap option will create SCHEMA on the fly if it is not created before importing.


E:\exp_full> expdp system/kkk666 schemas=scott directory=exp_full dumpfile=scott.dmp logfile=scott.log

Export: Release 11.2.0.3.0 - Production on Mon Jan 8 12:11:15 2018

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
Starting "SYSTEM"."SYS_EXPORT_SCHEMA_04":  system/******** schemas=scott directory=exp_full dumpfile=scott.dmp logfile=scott.log
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 256 KB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "SCOTT"."DEPT"                              5.937 KB       4 rows
. . exported "SCOTT"."EMP"                               8.570 KB      14 rows
. . exported "SCOTT"."EMPNEW"                            8.570 KB      14 rows
. . exported "SCOTT"."SALGRADE"                          5.867 KB       5 rows
. . exported "SCOTT"."BONUS"                                 0 KB       0 rows
Master table "SYSTEM"."SYS_EXPORT_SCHEMA_04" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_04 is:
  E:\EXP_FULL\SCOTT.DMP
Job "SYSTEM"."SYS_EXPORT_SCHEMA_04" successfully completed at 12:11:40



        ########################################################
                         IMPORT SCHEMA IN ANOTHER DATABASE
        ########################################################



E:\imp_inc> impdp dumpfile=SCOTT.DMP directory=imp_inc remap_schema=scott : scott log=impscott.log

Import: Release 11.2.0.3.0 - Production on Mon Jan 8 12:17:42 2018

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

Username: system
Password:

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
Legacy Mode Active due to the following parameters:
Legacy Mode Parameter: "log=impscott.log" Location: Command Line, Replaced with: "logfile=impscott.log"
Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_FULL_01":  system/******** dumpfile=SCOTT.DMP directory=imp_inc remap_schema=scott:scott logfile=impscott.log
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported "SCOTT"."DEPT"                                5.937 KB       4 rows
. . imported "SCOTT"."EMP"                                  8.570 KB      14 rows
. . imported "SCOTT"."EMPNEW"                         8.570 KB      14 rows
. . imported "SCOTT"."SALGRADE"                     5.867 KB       5 rows
. . imported "SCOTT"."BONUS"                             0 KB              0 rows
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "SYSTEM"."SYS_IMPORT_FULL_01" successfully completed at 12:17:55


Happy Learning...


Incremental Backups Using Exp / Imp Utility in Oracle 11g


Hi Guy's

You can perform all levels of logical backups using (9i-exp) utility in oracle 11g.

>> You can do incremental, cumulative, and complete exports only in full database mode (FULL=Y).
>> Only users who have the role EXP_FULL_DATABASE can run incremental, cumulative, and complete Exports.

Note:- An incremental Export backups only those tables that have changed since the last incremental, cumulative, or complete Export. this is the reason we have to take complete backup first in-order to take incremental backup.


>> inctype=Complete

E:\ test_exp > exp file=E:\test_fullbkp log=test.log full=y inctype=complete

Export: Release 11.2.0.3.0 - Production on Wed Jan 3 11:33:43 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Username: system
Password:

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
EXP-00041: INCTYPE parameter is obsolete
Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set

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 object type definitions
. exporting system procedural objects and actions
. . exporting table     WWV_MIG_OLB_T_TP_GG_CPDTXT              0 rows exported
. . exporting table  WWV_MIG_OLB_T_TP_GG_CT_TXTSGT          0 rows exported
. . exporting table   WWV_MIG_OLB_T_TP_GG_GRAPHICS            0 rows exported
. . exporting table    WWV_MIG_OLB_T_TP_G_GRAPHICS              0 rows exported
. . exporting table    WWV_MIG_OLB_VISUALATTRIBUTE               0 rows exported
. . exporting table             WWV_MIG_OLB_WINDOW                        0 rows exported
. . exporting table             WWV_MIG_PLSQL_LIBS
EXP-00107: Feature (BINARY XML) of column XML_CONTENT in table APEX_030200.WWV_MIG_PLSQL_LIBS is not supported. The table will not be exported.
. . exporting table               WWV_MIG_PROJECTS                           0 rows exported
. . exporting table     WWV_MIG_PROJECT_COMPONENTS          0 rows exported
. . exporting table       WWV_MIG_PROJECT_TRIGGERS               0 rows exported
. . exporting table                 WWV_MIG_REPORT                             0 rows exported
. . exporting table         WWV_MIG_RESERVED_WORDS             87 rows exported
. . exporting table            WWV_MIG_REV_APEXAPP             0 rows exported
. . exporting table              WWV_MIG_REV_FORMS               0 rows exported
. . exporting table            WWV_MIG_REV_QUERIES              0 rows exported
. . exporting table            WWV_MIG_REV_REPORTS             0 rows exported
. . exporting table             WWV_MIG_REV_TABLES               0 rows exported
. . exporting table                   WWV_MIG_RPTS
EXP-00107: Feature (BINARY XML) of column XML_CONTENT in table APEX_030200.WWV_MIG_RPTS is not supported. The table will not be exported.
. . exporting table               WWV_MIG_RPT_DATA                       0 rows exported
. . exporting table            WWV_MIG_RPT_DATASRC                  0 rows exported
. . exporting table        WWV_MIG_RPT_DATASRC_GRP            0 rows exported
. . exporting table     WWV_MIG_RPT_DATASRC_SELECT        0 rows exported
. . exporting table       WWV_MIG_RPT_DATA_SUMMARY        0 rows exported
. . exporting table       WWV_MIG_RPT_GRP_DATAITEM           0 rows exported
. . exporting table  WWV_MIG_RPT_GRP_DATAITEM_DESC    0 rows exported
. . exporting table  WWV_MIG_RPT_GRP_DATAITEM_PRIV     0 rows exported
. . exporting table          WWV_MIG_RPT_GRP_FIELD                 0 rows exported
. . exporting table         WWV_MIG_RPT_GRP_FILTER                0 rows exported
. . exporting table        WWV_MIG_RPT_GRP_FORMULA           0 rows exported
. . exporting table       WWV_MIG_RPT_GRP_ROWDELIM          0 rows exported
. . exporting table        WWV_MIG_RPT_GRP_SUMMARY           0 rows exported
. . exporting table      WWV_MIG_RPT_REPORTPRIVATE            0 rows exported
. . exporting table     WWV_MIG_RPT_XMLTAGTABLEMAP         15 rows exported
. about to export OWBSYS's tables via Conventional Path ...
. . exporting table                        OWBRTPS          0 rows exported
. about to export OWBSYS_AUDIT's tables via Conventional Path ...
. about to export SCOTT's tables via Conventional Path ...
. . exporting table                          BONUS               0 rows exported
. . exporting table                           DEPT                  4 rows exported
. . exporting table                            EMP                 14 rows exported
. . exporting table                       SALGRADE           5 rows exported

. about to export SAM'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 with warnings.

>> You can observe in above output there are no tables in SAM's user

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
              ADD 2 TABLES IN USER SAM
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

SQL> create table sam.emp as select * from scott.emp;

Table created.

SQL> create table sam.dept as select * from scott.dept;

Table created.

SQL> commit;

Commit complete.

SQL> conn sam/s
Connected.

SQL> select * from tab;

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
DEPT                           TABLE
EMP                            TABLE


>> Now take Inctype=incremental


>> You can see in this below output how oracle take incremental exports of the newly added tables.


E:\test_exp> exp file=E:\test_fullbkp log=test.log full=y inctype=incremental


Username: system
Password:

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
EXP-00041: INCTYPE parameter is obsolete
Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set

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 object type definitions
. exporting system procedural objects and actions
. exporting cluster definitions
. about to export SYSTEM's tables via Conventional Path ...
. about to export OUTLN's tables via Conventional Path ...
. about to export ORDDATA's tables via Conventional Path ...
. . exporting table            ORDDCM_CT_PRED_OPRD
EXP-00107: Feature (BINARY XML) of column OPERAND in table ORDDATA.ORDDCM_CT_PRED_OPRD is not supported. The table will not be exported.
. . exporting table        ORDDCM_CT_PRED_OPRD_TMP
EXP-00107: Feature (BINARY XML) of column OPERAND in table ORDDATA.ORDDCM_CT_PRED_OPRD_TMP is not supported. The table will not be exported.
. . exporting table        ORDDCM_CT_PRED_OPRD_WRK
EXP-00107: Feature (BINARY XML) of column OPERAND in table ORDDATA.ORDDCM_CT_PRED_OPRD_WRK is not supported. The table will not be exported.
. . exporting table                    ORDDCM_DOCS
EXP-00107: Feature (BINARY XML) of column DOC_CONTENT in table ORDDATA.ORDDCM_DOCS is not supported. The table will not be exported.
. . exporting table                ORDDCM_DOCS_TMP
EXP-00107: Feature (BINARY XML) of column DOC_CONTENT in table ORDDATA.ORDDCM_DOCS_TMP is not supported. The table will not be exported.
. . exporting table                ORDDCM_DOCS_WRK
EXP-00107: Feature (BINARY XML) of column DOC_CONTENT in table ORDDATA.ORDDCM_DOCS_WRK is not supported. The table will not be exported.
. . exporting table            ORDDCM_MAPPING_DOCS
EXP-00107: Feature (BINARY XML) of column XSLT in table ORDDATA.ORDDCM_MAPPING_DOCS is not supported. The table will not be exported.
. . exporting table        ORDDCM_MAPPING_DOCS_TMP
EXP-00107: Feature (BINARY XML) of column XSLT in table ORDDATA.ORDDCM_MAPPING_DOCS_TMP is not supported. The table will not be exported.
. . exporting table        ORDDCM_MAPPING_DOCS_WRK
EXP-00107: Feature (BINARY XML) of column XSLT in table ORDDATA.ORDDCM_MAPPING_DOCS_WRK is not supported. The table will not be exported.
. about to export OLAPSYS's tables via Conventional Path ...
. about to export MDDATA's tables via Conventional Path ...
. about to export SPATIAL_WFS_ADMIN_USR's tables via Conventional Path ...
. about to export SPATIAL_CSW_ADMIN_USR's tables via Conventional Path ...
. about to export SYSMAN's tables via Conventional Path ...
. about to export MGMT_VIEW's tables via Conventional Path ...
. about to export FLOWS_FILES's tables via Conventional Path ...
. about to export APEX_PUBLIC_USER's tables via Conventional Path ...
. about to export APEX_030200's tables via Conventional Path ...
. . exporting table                  WWV_MIG_FORMS
EXP-00107: Feature (BINARY XML) of column XML_CONTENT in table APEX_030200.WWV_MIG_FORMS is not supported. The table will not be exported.
. . exporting table              WWV_MIG_FRM_MENUS
EXP-00107: Feature (BINARY XML) of column XML_CONTENT in table APEX_030200.WWV_MIG_FRM_MENUS is not supported. The table will not be exported.
. . exporting table                    WWV_MIG_OLB
EXP-00107: Feature (BINARY XML) of column XML_CONTENT in table APEX_030200.WWV_MIG_OLB is not supported. The table will not be exported.
. . exporting table             WWV_MIG_PLSQL_LIBS
EXP-00107: Feature (BINARY XML) of column XML_CONTENT in table APEX_030200.WWV_MIG_PLSQL_LIBS is not supported. The table will not be exported.
. . exporting table                   WWV_MIG_RPTS
EXP-00107: Feature (BINARY XML) of column XML_CONTENT in table APEX_030200.WWV_MIG_RPTS is not supported. The table will not be exported.
. about to export OWBSYS's tables via Conventional Path ...
. about to export OWBSYS_AUDIT's tables via Conventional Path ...
. about to export SCOTT's tables via Conventional Path ...

. about to export SAM's tables via Conventional Path ...
. . exporting table                           DEPT          4 rows exported
. . exporting table                            EMP         14 rows exported

. 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 information about dropped objects
. exporting statistics
Export terminated successfully with warnings.


>> Now Import this Incremental Backups of 2 Tables in Another Database  


>> Create User at Target Machine in which you want to import these 2 incremental backup tables.


E:\imp_kkprod> imp file=E:\imp_kkprod\empdept.dmp fromuser=sam touser=sam

Import: Release 11.2.0.3.0 - Production on Mon Jan 8 13:18:46 2018

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

Username: system
Password:

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

Export file created by EXPORT:V11.02.00 via conventional path
import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
. importing SAM's objects into SAM

. . importing table                         "DEPT"          4 rows imported
. . importing table                          "EMP"         14 rows imported

Import terminated successfully without warnings.



Enjoy Reading....





Monday, January 1, 2018

How to Check Particular Tablespace Size with Datafiles in Oracle




SQL> select tablespace_name,file_name,(bytes/1024/1024) from dba_data_files where tablespace_name='USERS'

TABLESPACE                                   FILE_NAME                                   (BYTES/1024/1024)
-------------- -----------------------------------------------------------------------------------------------------------------
USERS                          +DATA/kkprod/datafile/users.267.962995627                 25600
USERS                          +DATA/kkprod/datafile/users.269.963077837                 20480



Happy Learning....