Saturday, May 7, 2011

How Data Pump Export Parameters Map to Those of the Original Export Utility

Here are the mapping of Data Pump Export parameters to original Export parameters. In some cases, because of feature redesign, the original Export parameter is no longer needed, so there is no Data Pump parameter to compare it to. Also, some of the parameter names may be the same, but the functionality is slightly different. The parameter are as 


Original Export Parameter
Comparable Data Pump Export Parameter
BUFFER
A parameter comparable to BUFFER is not needed.
COMPRESS
A parameter comparable to COMPRESS is not needed.
CONSISTENT
A parameter comparable to CONSISTENT is not needed. Use FLASHBACK_SCN and FLASHBACK_TIME for this functionality.
CONSTRAINTS
EXCLUDE=CONSTRAINT
DIRECT
A parameter comparable to DIRECT is not needed. Data Pump Export automatically chooses the best method (direct path mode or external tables mode).
FEEDBACK
STATUS
FILE
DUMPFILE
FILESIZE
FILESIZE
FLASHBACK_SCN
FLASHBACK_SCN
FLASHBACK_TIME
FLASHBACK_TIME
FULL
FULL
GRANTS
EXCLUDE=GRANT
HELP
HELP
INDEXES
EXCLUDE=INDEX
LOG
LOGFILE
OBJECT_CONSISTENT
A parameter comparable to OBJECT_CONSISTENT is not needed.
OWNER
SCHEMAS
PARFILE
PARFILE
QUERY
QUERY
RECORDLENGTH
A parameter comparable to RECORDLENGTH is not needed because sizing is done automatically.
RESUMABLE
A parameter comparable to RESUMABLE is not needed. This functionality is automatically provided for users who have been granted the EXP_FULL_DATABASE role.
RESUMABLE_NAME
A parameter comparable to RESUMABLE_NAME is not needed. This functionality is automatically provided for users who have been granted the EXP_FULL_DATABASE role.
RESUMABLE_TIMEOUT
A parameter comparable to RESUMABLE_TIMEOUT is not needed. This functionality is automatically provided for users who have been granted the EXP_FULL_DATABASE role.
ROWS=N
CONTENT=METADATA_ONLY
ROWS=Y
CONTENT=ALL
STATISTICS
A parameter comparable to STATISTICS is not needed. Statistics are always saved for tables.
TABLES
TABLES
TABLESPACES
TABLESPACES (Same parameter; slightly different behavior)
TRANSPORT_TABLESPACE
TRANSPORT_TABLESPACES (Same parameter; slightly different behavior)
TRIGGERS
EXCLUDE=TRIGGER
TTS_FULL_CHECK
TRANSPORT_FULL_CHECK
USERID
A parameter comparable to USERID is not needed. This information is supplied as the username and password when you invoke Export.
VOLSIZE
A parameter comparable to VOLSIZE is not needed.


Enjoy  :-) 

RMAN : Create Script Command


Create Script command is one of the Rman command which is used to stored script in recovery catalog.A stored script may be local or global. A local script is created for the current target database only, whereas a global script is available for use with any database registered in the recovery catalog.
We can use a stored script as an alternative to a command file for managing frequently used sequences of RMAN commands. The script is stored in the recovery catalog rather than on the file system.

The commands allowable within the brackets of the CREATE SCRIPT command are the same commands supported within a RUN block. Any command that is legal within a RUN command is permitted in the stored script.
Here, in this scenario we will perform the following steps :
1.) Create   Script
2.) Replace Script
3.) Execute Script 


Create Script  :  Assume that we want to create a local stored script for backing up database "noida". we start RMAN, connect to "noida" as TARGET, and connect to a recovery catalog. we create a stored script called rman_backup . 


C:\>rman
Recovery Manager: Release 11.1.0.6.0 - Production on Sat May 7 15:15:02 2011
Copyright (c) 1982, 2007, Oracle.  All rights reserved.
RMAN> connect target sys/ramtech@noida
connected to target database: NOIDA (DBID=1503672566)
RMAN> connect catalog  rcat/rcat@catdb
connected to recovery catalog database

RMAN> Create script rman_backup
2> Comment "backup Whole Database and archived redo logs "
3> {
4> backup incremental level 0
5> format "D:\rman_bkp\%U"
6> Database plus archivelog;
7> }


Replace Scripts :  To update stored scripts, we use the REPLACE SCRIPT command. If we are replacing a local script, then we must be connected to the target database that we connected to when we created the script. If the script does not already exist, then RMAN creates it.

RMAN> replace script rman_backup 
{
  backup database plus archivelog  skip inaccessible ;
}
         We can update global scripts by specifying the GLOBAL keyword .

Execute Script :   We use the EXECUTE SCRIPT command to run a stored script. If GLOBAL is specified, then a global script with this name must already exist in the recovery catalog; otherwise, RMAN returns error RMAN-06004. If GLOBAL is not specified, then RMAN searches for a local stored script defined for the current target database. If no local script with this name is found, then RMAN searches for a global script by the same name and executes it if one is found.

To execute a stored script run EXECUTE SCRIPT. This command requires a RUN block, as shown in the following example:


RMAN> run  

  excute script rman_backup; 
}


Enjoy  : -)

RMAN SET NEWNAME Command


The  SET NEWNAME  command  is  more powerful  and easier  to  use. We can use this command on a specific  tablespace  or  on  all data  files and  temp files. We can  also  change  the names  for  multiple  files in  the  database .This command is very useful in reestore th database .let;s have an example 

Suppose  a   disk  containing  the datafiles  get  corrupt  and  we  have  to restore the datafile  on   different disk . In  this  scenario  we  cannot  use  “restore  database“  command  because  it  wil  restore  the datafile  on  default  location  i.e,  on  corrupt  disk . To overcome  from   this  type  of   scenario’s   we  have  “set newname“  command  to solve this  problem . For  this  we  should  have the valid   rman  backup. 

Here we will restore all the datafile in  'C'  drive which  was  originally on  'D'  drive . Below is an example of   set newname  command .

RMAN> run {
Set  newname  for datafile  1  to  ‘C:\app\SYSTEM.DBF’ ;
Set  newname  for datafile  2  to  ‘C:\app\SYSAUX.DBF’ ;
Set  newname  for datafile  3  to  ‘C:\app\UNDOTBS1.DBF’ ;
Set  newname  for datafile  4  to  ‘C:\app\EXAMPLE.DBF’ ;
Set  newname  for datafile  5  to  ‘C:\app\USERS01.DBF’ ;
Restore database ;
Switch datafile all;
}

SET  command  is  specified  within  a  run  block  to  specify  new  filenames   for  restored  datafiles .  If  we  restore  to  default   location  (that is, we do  not  run  set newname ), then  RMAN  overwrites  file with  the  same  filename. If  we  restore to  a  new  location, then   we   use  SET NEWNAME  commands  to  rename  the  files and  issue  a  SWITCH  command  to  make  the  restored files current. 

If   we  do  not  issue  SWITCH  commands, then   RMAN  restores  the  files  to  the  path  names  specified by SET NEWNAME  and  does  not  remove  the  repository  records  for  the datafile  copies  created during the  restore. If   we  use  SWITCH  command  in  run  block , then  RMAN  updates   the  datafile  names in  the  control  file to  the  names  of  the  restored  files . 



Enjoy     :-)