Data … as usual

All things about data by Laurent Leturgez

Monthly Archives: June 2013

Oracle Database 12c released … some features

If you are an Oracle DBA and you don’t live on earth, you have not heard about Oracle Database 12c … which is finally released today.

For the moment, you can download it on otn (http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html) and on edelivery (http://edelivery.oracle.com). Documentation is available here: http://www.oracle.com/pls/db121/homepage.

As a beta tester, I can now speak about some features of this release. Of course, I could write about multitenant database or Information Lifecycle Management … I prefer to write about “smaller” features … but very useful.

  • online datafile move

Before 12c, if you wanted to move a datafile (or rename it), you had to offline it and move it on the OS Side, and then modify the control file data by renaming file, and then online the datafile. Now in 12c … it becomes a little bit easier:

SQL> select file_name from dba_data_files;

FILE_NAME
--------------------------------------------------------------------------------
/u02/oradata/orcl/system01.dbf
/u02/oradata/orcl/sysaux01.dbf
/u02/oradata/orcl/users01.dbf
/u02/oradata/orcl/example01.dbf
/u02/oradata/orcl/undotbs01.dbf

SQL> alter database move datafile '/u02/oradata/orcl/users01.dbf' to '/u02/oradata/newdest/users01.dbf';

Database altered.

SQL> !ls /u02/oradata/newdest
users01.dbf

That’s it 😉

  • write sql statement directly in RMAN
[oracle@oel ~]$ rman target /

Recovery Manager: Release 12.1.0.1.0 - Production on Tue Jun 25 21:57:09 2013

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

connected to target database: ORCL (DBID=1335655385)

RMAN> select dbid,name from v$database;

using target database control file instead of recovery catalog
      DBID NAME
---------- ---------
1335655385 ORCL
  • impdp in nologging mode

impdp utility have now many transformation functions that offer the opportunity to modify your data directly during the import process. Among these functions, you have a nologging option to reduce the redo information generated during impdp process (which was impossible with previous versions)

$ impdp USERID=\"/ as sysdba\" DIRECTORY=mydir DUMPFILE=expdp.dmp REMAP_SCHEMA=SH:SH2 TRANSFORM=DISABLE_ARCHIVE_LOGGING:Y

That’s it for today ! 🙂

Advertisement

Do you want to use BBED … on Windows ???

Recently, I had to use BBED in a windows 2008 R2 environment (to modify a checkpoint SCN in datafiles headers). To do this, I like to use BBED but this time, it was on a Windows 2008 R2 server on a 11.2 database.

2 problems :

– BBED is not shipped with Oracle since version 9.

– There’s no makefile on windows to compile bbed.

In a previous post, I wrote a little hack to compile bbed on Unix systems and to use it with oracle 9, 10, 11 and every database that have its datafiles located on a mount point (not for ASM).

On windows, to bypass this, you can copy your datafiles on a linux box, repair them with bbed, and copy them back to their original location. But when you work remotely or/and your database size is hundreds of Gigabytes … the problem is different.

So, if you want to use bbed on windows, you need to have many things:

  1. You need a bbed.exe. The only way is to get it from an Oracle 9i installation.
  2. You need to have a bunch of DLL (see above). All thoses DLLs are available in an Oracle 9i installation (in bin directory).
      • oraclient9.dll
      • oracommon9.dll
      • orageneric9.dll
      • ORACORE9.DLL
      • oraldapclnt9.dll
      • oran9.dll
      • ORANCDS9.DLL
      • orancrypt9.dll
      • oranhost9.dll
      • oranl9.dll
      • oranldap9.dll
      • ORANLS9.DLL
      • oranms.dll
      • oranmsp.dll
      • orannzsbb9.dll
      • oranoname9.dll
      • oranro9.dll
      • orantns9.dll
      • ORAPLS9.DLL
      • ORASLAX9.DLL
      • ORASNLS9.DLL
      • ORASQL9.DLL
      • oratrace9.dll
      • ORAUNLS9.DLL
      • oravsn9.dll
      • orawtc9.dll
      • ORAXML9.DLL
      • ORAXSD9.DLL
  3. You need message files for BBED. Thoses files are “bbedus.msb” and “bbedus.msg”. They are located in the mesg directory of an Oracle 9i installation. And you need to copy them in the rdbms\mesg directory of your  ORACLE_HOME.

 

If you have all these files (if not, let me know 😉 ), put them in a directory for your  bbed installation (let’s say c:\bbed), and set your ORACLE_HOME to the location where have put the message files, and finally launch BBED :

C:\bbed>dir /w
 Volume in drive C has no label.
 Volume Serial Number is 941A-E20F

 Directory of C:\bbed

[.]                [..]               bbed.exe           log.bbd            [mesg]             oraclient9.dll     oracommon9.dll     ORACORE9.DLL
orageneric9.dll    oraldapclnt9.dll   oran9.dll          ORANCDS9.DLL       orancrypt9.dll     oranhost9.dll      oranl9.dll         oranldap9.dll
ORANLS9.DLL        oranms.dll         oranmsp.dll        orannzsbb9.dll     oranoname9.dll     oranro9.dll        orantns9.dll       ORAPLS9.DLL
ORASLAX9.DLL       ORASNLS9.DLL       ORASQL9.DLL        oratrace9.dll      ORAUNLS9.DLL       oravsn9.dll        orawtc9.dll        ORAXML9.DLL
ORAXSD9.DLL        [rdbms]
              30 File(s)     12 870 233 bytes
               4 Dir(s)  26 325 200 896 bytes free
C:\bbed>echo %ORACLE_HOME%
c:\oracle\product\10.2.0\db_1

C:\bbed>dir /w %ORACLE_HOME%\rdbms\mesg
 Volume in drive C has no label.
 Volume Serial Number is 941A-E20F

 Directory of c:\oracle\product\10.2.0\db_1\rdbms\mesg

[.]          [..]         bbedus.msb   bbedus.msg   kfodus.msb   nmaf.msb     nmaus.msb    nmef.msb     nmeus.msb
               7 File(s)         72 222 bytes
               2 Dir(s)  26 404 503 552 bytes free

C:\bbed>systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"System Type"
OS Name: Microsoft Windows Server 2008 R2 Enterprise
OS Version: 6.1.7601 Service Pack 1 Build 7601
System Type: x64-based PC

C:\bbed>.\bbed
Password:

BBED: Release 2.0.0.0.0 - Limited Production on Mon Jun 17 14:46:38 2013

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

************* !!! For Oracle Internal Use only !!! ***************

Now, you have a bbed exe on Windows 2008 R2 server.