Friday, April 20, 2012

How to set up exclude_list files on NetBackup clients



Question: how to set up exclude_list files on NetBackup clients?

Answer: Symantec website has an excellent article to explain this: DOCUMENTATION: Additional examples for setting up exclude_list files on NetBackup clients

An exclude_list file can be created for a specific client, policy or schedule.  The exclude_list file must be created by the administrator in the /usr/openv/netbackup directory on UNIX clients.

The following options exist when creating an exclude_list file:
- Create an exclude_list file if the exclude list will apply to all backups of the client.
- Create an exclude_list. if the exclude list will apply only for a specific policy.
- Create an exclude_list.. if the exclude list will apply to only one schedule in a policy.

NetBackup will use only read the exclude_list file that most closely matches the backup policy and schedule being performed. The and used in the file name must be an exact match to the policy and schedule defined on the master server.

The following examples are meant to show different methods to format an exclude_list on a NetBackup client.  It is important to note that exclude list entries need to follow UNIX rules and conventions. 

How to properly exclude a file name by the extension:
 
The following is a valid way to handle file names by extension: 
   *.log 
   *_log
 
This will properly exclude all files and directory names that end in .log or _log. The asterisk character is needed to do the wildcard expansion.
  
The incorrect way to exclude by extension is to use: 
   .log 
   _log 
 
This will only match specific file or directory names for .log or _log. Without the asterisk character, there is no wildcard expansion done to match files ending in these entries.
 

How to properly exclude a filename that contains a specific string:
 
The following is a valid way to handle filenames that contain a specific string: 
   *.log.* 
   *_log_*

This will match any file or directory name that contains .log. or _log_. The period or underscore has no specific meaning in this example. The asterisk does the wildcard expansion.
 

How to properly exclude a specific filename or directory:
 
The following is a valid way to handle specific file or directory names. 
   log 
   logs

This will match any file or directory names called log or logs.  In this case, no asterisk is needed since there isn't any matching to be done.
 

How to use the ? character in an exclude_list entry:
 
A valid way to use the ? character in an exclude_list entry would be: 
   log.??????

This would exclude any file that begins with log. and follows with six characters. This would match log.021804 but not match log. since log. must be followed by six characters. The ? is used as a wildcard for any single character in a file or directory name. Each question mark is used to match a single character.
 

How to use the [] characters in an exclude_list entry:

      EXAMPLE 1: A valid way to use the [] characters in an exclude_list entry would be:
      
   log[12345]
 
This would exclude the files log1, log2, log3, log4, log5 but would not match log or log12345. The characters inside the [] are used to match any single character that is contained between the [].
 

     EXAMPLE 2: Suppose path "/path" contains several subdirectories, u01, u02, u03, u04, u10, u12, u13, u14.

     If you only want to back up /path/u01, the following exclude entry would *not* work, and all subdirectories would be backed up:
            
/path/u[02-14] 

     To exclude every subdirectory except u01, two lines would be needed in the exclude_list, using the following syntax:
           
/path/u0[2-4]
           
/path/u1[0-4]

    An easy way to confirm before the backup whether the syntax is correct is to use an "ls" command. For the above incorrect syntax, "ls" would reveal that the syntax is incorrect:
          
ls /path/u[02-14]
          
No Match.

How to exclude a file or directory that contains a special character:
    A valid way to exclude files that contain special characters in the name would be:
 
\*logfile\*

This would match the file named *logfile* but would not match logfile or any filename that contains logfile. The backslash character will de-reference any of the special characters used in a NetBackup exclude_list.
  
These special characters are: 
asterisk * 
comment # 
square brackets  [ ] 
backslash \ 
question mark ?
 


 


Reference: DOCUMENTATION: Additional examples for setting up exclude_list files on NetBackup clients



Clone database from a RMAN Cold back in Oracle 10g


Clone database from a RMAN Cold back in Oracle 10g


Database environment:
·         Oracle version: 10.2.0.4se
·         RMAN version: 10.2.0.4
·         OS: Solaris 10
·         Target database: TargetDB
·         Auxiliary database: AuxDB
·         RMAN catalog database: RcatDB

1. Take a cold backup from the target database TargetDB (source database) and using RMAN catalog database RcatDB

2. Prepare the directory structure for the auxiliary database AuxDB (cloned database)

Scenario:
·         The target database and the auxiliary database are on different database servers.
·         Need to copy the cold backups of the target database from one server to the server where the auxiliary database resides.
·         The file structure of the cold  backup should be the same as on the target database server.

3. Ensure the following two parameters are included in the pfile:

############################################
# for rman database duplication
###########################################

db_file_name_convert=('/oracle_data/TargetDB', '/oracle_data/AuxDB')
log_file_name_convert=('/oracle_data/TargetDB', '/oracle_data/AuxDB')

4. Add the auxiliary database to /etc/oratab:

AuxDB:/fs/u02/sw_ux/oracle/product/10.2.0.4se:Y

5. Add the auxiliary database to tnsnames.ora

AuxDB =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = host_name)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = AuxDB)
      (SERVER = DEDICATED)
    )
  )

6. Add a Oracle password file for the auxiliary database

orapwd file=$ORACLE_HOME/dbs/orapwAuxDB password= entries=10

7. Start the auxiliary database in NOMOUNT mode

$ . oraenv
ORACLE_SID = [AuxDB] ? AuxDB
The /oracle/product/10.2.0.4se/bin/orabase binary does not exist
You can set ORACLE_BASE manually if it is required.

$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Mon Oct 25 11:26:32 2010
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
Connected to an idle instance.

SQL> create spfile from pfile='/oracle/admin/AuxDB/pfile/initAuxDB.ora';
File created.

SQL> startup nomount
ORACLE instance started.

Total System Global Area  683671552 bytes
Fixed Size                  2043136 bytes
Variable Size             276828928 bytes
Database Buffers          398458880 bytes
Redo Buffers                6340608 bytes
8. Use RMAN to clone the auxiliary database

$ rman trace clone_AuxDB.log

Recovery Manager: Release 10.2.0.4.0 - Production on Mon Oct 25 11:44:53 2010

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

RMAN> connect target sys/syspwd@TargetDB;

connected to target database: TargetDB (DBID=1722637034)

RMAN>  connect catalog rman/rcpwd@RcatDB;

connected to recovery catalog database

RMAN> connect auxiliary /

connected to auxiliary database: AuxDB (not mounted)

RMAN> duplicate target database to AuxDB;

Finished restore at 25-OCT-10

sql statement: CREATE CONTROLFILE REUSE SET DATABASE "AUXDB" RESETLOGS NOARCHIVELOG
  MAXLOGFILES     16
  MAXLOGMEMBERS      2
  MAXDATAFILES       30
  MAXINSTANCES     1
  MAXLOGHISTORY     2337
 LOGFILE
  GROUP 1 ( '/oracle_data/AuxDB/redo01.log', '/oracle_data/AuxDB/redo01b.log' ) SIZE 10 M  REUSE,
  GROUP 2 ( '/oracle_data/AuxDB/redo02.log', '/oracle_data/AuxDB/redo02b.log' ) SIZE 10 M  REUSE,
  GROUP 3 ( '/oracle_data/AuxDB/redo03.log', '/oracle_data/AuxDB/redo03b.log' ) SIZE 10 M  REUSE
 DATAFILE
  '/oracle_data/AuxDB/system_01.dbf'
 CHARACTER SET UTF8


contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

released channel: ORA_AUX_DISK_1
datafile 3 switched to datafile copy
input datafile copy recid=1 stamp=733319493 filename=/oracle_data/AuxDB/sysaux_01.dbf
datafile 12 switched to datafile copy
input datafile copy recid=10 stamp=733319493 filename=/oracle_data/AuxDB/users01.dbf
datafile 13 switched to datafile copy
input datafile copy recid=11 stamp=733319493 filename=/oracle_data/AuxDB/undotbs01.dbf

contents of Memory Script:
{
   recover
   clone database
   noredo
   ,
    delete archivelog
   ;
}
executing Memory Script

Starting recover at 25-OCT-10
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=104 devtype=DISK
Finished recover at 25-OCT-10

contents of Memory Script:
{
   shutdown clone;
   startup clone nomount ;
}
executing Memory Script

database dismounted
Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     683671552 bytes

Fixed Size                     2043136 bytes
Variable Size                276828928 bytes
Database Buffers             398458880 bytes
Redo Buffers                   6340608 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "AUXDB" RESETLOGS NOARCHIVELOG
  MAXLOGFILES     16
  MAXLOGMEMBERS      2
  MAXDATAFILES       30
  MAXINSTANCES     1
  MAXLOGHISTORY     2337
 LOGFILE
  GROUP  1 ( '/oracle_data/AuxDB/redo01.log', '/oracle_data/AuxDB/redo01b.log' ) SIZE 10 M  REUSE,
  GROUP  2 ( '/oracle_data/AuxDB/redo02.log', '/oracle_data/AuxDB/redo02b.log' ) SIZE 10 M  REUSE,
  GROUP  3 ( '/oracle_data/AuxDB/redo03.log', '/oracle_data/AuxDB/redo03b.log' ) SIZE 10 M  REUSE
 DATAFILE
  '/oracle_data/AuxDB/system_01.dbf'
 CHARACTER SET UTF8

contents of Memory Script:
{
   set newname for tempfile  1 to
 "/oracle_data/AuxDB/temp_01.dbf";
   switch clone tempfile all;
   catalog clone datafilecopy  "/oracle_data/AuxDB/sysaux_01.dbf";
   catalog clone datafilecopy  "/oracle_data/AuxDB/data_01.dbf";
   catalog clone datafilecopy  "/oracle_data/AuxDB/indexes_01.dbf";
   catalog clone datafilecopy  "/oracle_data/AuxDB/users01.dbf";
   catalog clone datafilecopy  "/oracle_data/AuxDB/undotbs01.dbf";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed temporary file 1 to /oracle_data/AuxDB/temp_01.dbf in control file

cataloged datafile copy
datafile copy filename=/oracle_data/AuxDB/sysaux_01.dbf recid=1 stamp=733319503


cataloged datafile copy
datafile copy filename=/oracle_data/AuxDB/undotbs01.dbf recid=11 stamp=733319503

datafile 3 switched to datafile copy
input datafile copy recid=1 stamp=733319503 filename=/oracle_data/AuxDB/sysaux_01.dbf
datafile 4 switched to datafile copy
input datafile copy recid=2 stamp=733319503 filename=/oracle_data/AuxDB/data_01.dbf
datafile 5 switched to datafile copy
input datafile copy recid=5 stamp=733319503 filename=/oracle_data/AuxDB/indexes_01.dbf
datafile 8 switched to datafile copy
input datafile copy recid=10 stamp=733319503 filename=/oracle_data/AuxDB/users01.dbf
datafile 13 switched to datafile copy
input datafile copy recid=11 stamp=733319503 filename=/oracle_data/AuxDB/undotbs01.dbf

contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 25-OCT-10

RMAN>

RMAN> exit


Recovery Manager complete.
9. Complete.

DBA_REGISTRY_HISTORY IS SHOWING 11.2.0.20 FOR THE COMMENT COLUMN FOR 11.2.0.3


DBA_REGISTRY_HISTORY IS SHOWING 11.2.0.20  FOR THE COMMENT COLUMN FOR 11.2.0.3

After upgrading from 11.2.0.2se to 11.2.0.3se, DBA_REGISTRY_HISTORY shows Patchset 11.2.0.2.0 for 11.2.0.3. For example:
select * from dba_registry_history order by action_time;
ACTION_TIME
ACTION
NAMESPACE
VERSION
ID
BUNDLE_SERIES
COMMENTS
2007-04-27 1:24:06.000000 PM
CPU
SERVER
10.2.0.2.0
5689957

CPUJan2007
2009-05-23 2:38:48.000000 AM
UPGRADE
SERVER
10.2.0.4.0


Upgraded from 10.2.0.2.0
2011-11-10 12:31:30.905842 PM
VIEW INVALIDATE


8289601

view invalidation
2011-11-10 12:31:31.708360 PM
UPGRADE
SERVER
11.2.0.3.0


Upgraded from 10.2.0.4.0
2011-11-10 12:59:23.315431 PM
APPLY
SERVER
11.2.0.3
0
PSU
Patchset 11.2.0.2.0

Oracle has confirmed that it is a bug (Bug 13360611).
DBA_REGISTRY_HISTORY provides information about upgrades, downgrades, and critical patch updates that have been performed on the database.
Column
Datatype
NULL
Description
ACTION_TIME
TIMESTAMP(6)

The time the upgrade, downgrade, or patch action was completed
ACTION
VARCHAR2(30)

The specific action (for example, UPGRADE or DOWNGRADE)
NAMESPACE
VARCHAR2(30)

The namespace of the components affected (for example, SERVER)
VERSION
VARCHAR2(30)

The version number of the server (for example, 10.2.0.1.0)
ID
NUMBER

The identification number of the Critical Patch Update
COMMENTS
VARCHAR2(255)

Additional comments about the action taken


Oracle Database Limits in Oracle 11g Release 2 (11.2, 11gR2)


Oracle Database Limits in Oracle 11g Release 2  (11.2, 11gR2)
This article lists the limits of values associated with Oracle database functions and objects on several levels. There is usually a hard-coded limit that cannot be exceeded. This value may be further restricted for any given operating system.
Database limits are divided into four categories:
·         Datatype Limits
Datatypes
Limit
Comments
BFILE
Maximum size: 4 GB
Maximum size of a file name: 255 characters
Maximum size of a directory name: 30 characters
Maximum number of open BFILEs: see Comments
The maximum number of BFILEs is limited by the value of theSESSION_MAX_OPEN_FILES initialization parameter, which is itself limited by the maximum number of open files the operating system will allow.
BLOB
Maximum size: (4 GB - 1) * DB_BLOCK_SIZEinitialization parameter (8 TB to 128 TB)
The number of LOB columns per table is limited only by the maximum number of columns per table (that is, 1000).
CHAR
Maximum size: 2000 bytes
None
CHAR VARYING
Maximum size: 4000 bytes
None
CLOB
Maximum size: (4 GB - 1) * DB_BLOCK_SIZEinitialization parameter (8 TB to 128 TB)
The number of LOB columns per table is limited only by the maximum number of columns per table (that is, 1000).
Literals (characters or numbers in SQL or PL/SQL)
Maximum size: 4000 characters
None
LONG
Maximum size: 2 GB - 1
Only one LONG column is allowed per table.
NCHAR
Maximum size: 2000 bytes
None
NCHAR VARYING
Maximum size: 4000 bytes
None
NCLOB
Maximum size: (4 GB - 1) * DB_BLOCK_SIZEinitialization parameter (8 TB to 128 TB)
The number of LOB columns per table is limited only by the maximum number of columns per table (that is, 1000).
NUMBER
999...(38 9's) x10125 maximum value
-999...(38 9's) x10125 minimum value
Can be represented to full 38-digit precision (the mantissa)
Can be represented to full 38-digit precision (the mantissa)
Precision
38 significant digits
None
RAW
Maximum size: 2000 bytes
None
VARCHAR
Maximum size: 4000 bytes
None
VARCHAR2
Maximum size: 4000 bytes
None

·         Physical Database Limits
Item
Type of Limit
Limit Value
Database Block Size
Minimum
2048 bytes; must be a multiple of operating system physical block size
Database Block Size
Maximum
Operating system dependent; never more than 32 KB
Database Blocks
Minimum in initial extent of a segment
2 blocks
Database Blocks
Maximum per datafile
Platform dependent; typically 222 - 1 blocks
Controlfiles
Number of control files
1 minimum; 2 or more (on separate devices) strongly recommended
Controlfiles
Size of a control file
Dependent on operating system and database creation options; maximum of20,000 x (database block size)
Database files
Maximum per tablespace
Operating system dependent; usually 1022
Database files
Maximum per database
65533
May be less on some operating systems
Limited also by size of database blocks and by the DB_FILES initialization parameter for a particular instance
Database extents
Maximum per dictionary managed tablespace
4 GB * physical block size (with K/M modifier); 4 GB (without K/M modifier)
Database extents
Maximum per locally managed (uniform) tablespace
2 GB * physical block size (with K/M modifier); 2 GB (without K/M modifier)
Database file size
Maximum
Operating system dependent. Limited by maximum operating system file size; typically 222 or 4 MB blocks
MAXEXTENTS
Default value
Derived from tablespace default storage or DB_BLOCK_SIZE initialization parameter
MAXEXTENTS
Maximum
Unlimited
Redo Log Files
Maximum number of logfiles
Limited by value of MAXLOGFILES parameter in the CREATE DATABASEstatement
Control file can be resized to allow more entries; ultimately an operating system limit
Redo Log Files
Maximum number of logfiles per group
Unlimited
Redo Log File Size
Minimum size
4 MB
Redo Log File Size
Maximum Size
Operating system limit; typically 2 GB
Tablespaces
Maximum number per database
64 K
Number of tablespaces cannot exceed the number of database files because each tablespace must include at least one file
Bigfile Tablespaces
Number of blocks
A bigfile tablespace contains only one datafile or tempfile, which can contain up to approximately 4 billion ( 232 ) blocks. The maximum size of the single datafile or tempfile is 128 terabytes (TB) for a tablespace with 32 K blocks and 32 TB for a tablespace with 8 K blocks.
Smallfile (traditional) Tablespaces
Number of blocks
A smallfile tablespace is a traditional Oracle tablespace, which can contain 1022 datafiles or tempfiles, each of which can contain up to approximately 4 million (222) blocks.
External Tables file
Maximum size
Dependent on the operating system.
An external table can be composed of multiple files.

·         Logical Database Limits
Item
Type of Limit
Limit Value
GROUP BY clause
Maximum length
The GROUP BY expression and all of the nondistinct aggregate functions (for example, SUMAVG) must fit within a single database block.
Indexes
Maximum per table
Unlimited
Indexes
Total size of indexed column
75% of the database block size minus some overhead
Columns
Per table
1000 columns maximum
Columns
Per index (or clustered index)
32 columns maximum
Columns
Per bitmapped index
30 columns maximum
Constraints
Maximum per column
Unlimited
Subqueries
Maximum levels of subqueries in a SQL statement
Unlimited in the FROM clause of the top-level query
255 subqueries in the WHERE clause
Partitions
Maximum length of linear partitioning key
4 KB - overhead
Partitions
Maximum number of columns in partition key
16 columns
Partitions
Maximum number of partitions allowed per table or index
1024K - 1
Rows
Maximum number per table
Unlimited
Stored Packages
Maximum size
PL/SQL and Developer/2000 may have limits on the size of stored procedures they can call. The limits typically range from 2000 to 3000lines of code.
Trigger Cascade Limit
Maximum value
Operating system-dependent, typically 32
Users and Roles
Maximum
2,147,483,638
Tables
Maximum per clustered table
32 tables
Tables
Maximum per database
Unlimited

·         Process and Runtime Limits
Item
Type of Limit
Limit Value
Instances per database
Maximum number of cluster database instances per database
Operating system-dependent
Locks
Row-level
Unlimited
Locks
Distributed Lock Manager
Operating system dependent
SGA size
Maximum value
Operating system-dependent; typically 2 to 4 GB for 32-bit operating systems, and > 4 GB for 64-bit operating systems
Advanced Queuing Processes
Maximum per instance
10
Job Queue Processes
Maximum per instance
1000
I/O Slave Processes
Maximum per background process (DBWR, LGWR, etc.)
15
I/O Slave Processes
Maximum per Backup session
15
Sessions
Maximum per instance
32 KB; limited by the PROCESSES and SESSIONS initialization parameters
Global Cache Service Processes
Maximum per instance
10
Shared Servers
Maximum per instance
Unlimited within constraints set by the PROCESSES and SESSIONSinitialization parameters, for instance
Dispatchers
Maximum per instance
Unlimited within constraints set by PROCESSES and SESSIONSinitialization parameters, for instance
Parallel Execution Slaves
Maximum per instance
Unlimited within constraints set by PROCESSES and SESSIONSinitialization parameters, for instance
Backup Sessions
Maximum per instance
Unlimited within constraints set by PROCESSES and SESSIONSinitialization parameters, for instance