Move Datafiles Online 12c

As you know Oracle database 12c released Yesterday and we all still test it and learn what are the new features !!

For the first time in Oracle Database you can move objects online without offline or shutdown database which is very useful and helpful for any DBA’s

Check the example below :

SQL> select file_name from dba_data_files ;

FILE_NAME
——————————————————————————–
/u01/app/oracle/oradata/db12c/system01.dbf
/u01/app/oracle/oradata/db12c/sysaux01.dbf
/u01/app/oracle/oradata/db12c/users01.dbf
/u01/app/oracle/oradata/db12c/undotbs01.dbf

Let’s move system01.dbf 
SQL> alter database move datafile ‘/u01/app/oracle/oradata/db12c/system01.dbf’ to ‘/u01/system.dbf’;

SQL> select File_name from dba_data_files ;
FILE_NAME
——————————————————————————–
/u01/system.dbf
/u01/app/oracle/oradata/db12c/sysaux01.dbf
/u01/app/oracle/oradata/db12c/users01.dbf
/u01/app/oracle/oradata/db12c/undotbs01.dbf

Thank you
Osama mustafa 

New Features 12c EXPDP

While i am testing Oracle 12c i notice new features in expdp , which you can export view like the following :

SQL> create table test ( id number);
Table created.

SQL> create view test_vw as select * from test ;
View created.

SQL> create directory dump as ‘/u01/dump’;
Directory created.

SQL> grant read,write on directory dump to osama ;
Grant succeeded.

[oracle@test12c u01]$ expdp directory=dump dumpfile=test.dmp logfile=test.log VIEWS_AS_TABLES=test_vw
Export: Release 12.1.0.1.0 – Production on Wed Jun 26 18:33:52 2013
Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.
Username: osama
Password: 
Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 – 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
Starting “OSAMA”.”SYS_EXPORT_TABLE_01″:  osama/******** directory=dump dumpfile=test.dmp logfile=test.log VIEWS_AS_TABLES=test_vw 
Estimate in progress using BLOCKS method…
Processing object type TABLE_EXPORT/VIEWS_AS_TABLES/TABLE_DATA
Total estimation using BLOCKS method: 0 KB
Processing object type TABLE_EXPORT/VIEWS_AS_TABLES/TABLE
. . exported “OSAMA”.”TEST_VW”                              0 KB       0 rows
Master table “OSAMA”.”SYS_EXPORT_TABLE_01″ successfully loaded/unloaded
******************************************************************************
Dump file set for OSAMA.SYS_EXPORT_TABLE_01 is:
  /u01/dump/test.dmp
Job “OSAMA”.”SYS_EXPORT_TABLE_01″ successfully completed at Wed Jun 26 18:34:15 2013 elapsed 0 00:00:17
I dropped the view 

SQL> drop view Test_vw ;
View dropped.
impdp directory=dump dumpfile=test.dmp logfile=test.log VIEWS_AS_TABLES=test_vw


Thank you 
Osama mustafa