Monday, October 12, 2015

Oracle 10.2.0.1 in RHEL 5.4 64bit libXp.so.6: cannot open shared object file

Error while installing Oracle 10.2.0.1 in RHEL 5.4 64bit libxp.so.6: cannot open shared object file

while issuing

$ ./runInstaller


Error 500--Internal Server Error
java.lang.UnsatisfiedLinkError: /home/hpsindia/bea/jrockit81sp6_142_10/jre/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Ljava.lang.String; )V(Native Method)
at java.lang.ClassLoader.loadLibrary0(Ljava.lang.Class;Ljava.io.File; )Z(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Ljava.lang.Class;Ljava.lang.String;Z)V(Unknown Source)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(Ljava.lang.String; )V(Unknown Source)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1437)
at java.awt.Toolkit.(Toolkit.java:1458)
at java.awt.Color.(Color.java:250)
at net.sf.jasperreports.engine.xml.JRXmlConstants.getColor(JRXmlConstants.java:1251)
at net.sf.jasperreports.engine.xml.JRElementFactory.createObject(JRElementFactory.java:138)
at org.apache.commons.digester.FactoryCreateRule.begin(FactoryCreateRule.java:389)
at org.apache.commons.digester.Digester.startElement(Digester.java:1361)
at weblogic.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:459)
at weblogic.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java :221)
at weblogic.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(XMLSchemaValidator.java:618)


SOLUTION: Install the required rpm's

# rpm -ivh libXp-1.0.0-8.1.el5.i386.rpm
# rpm -ivh libXp-1.0.0-8.1.el5.x86_64.rpm
# rpm -ivh libXp-devel-1.0.0-8.1.el5.i386.rpm
# rpm -ivh libXp-devel-1.0.0-8.1.el5.x86_64.rpm

Sunday, April 19, 2015

Query for Database Schema Size

select OWNER,round (sum(bytes/1024/1024/1024)) "SIZE_IN_GB" from dba_segments
group by owner
order by SIZE_IN_GB desc;

Recovery Manager Commands

Command
Purpose
@ (at sign)
Run a command file.
@@ (double at sign)
Run a command file in the same directory as another command file that is currently running. The @@ command differs from the @command only when run from within a command file.
ADVISE FAILURE
Display repair options.
ALLOCATE CHANNEL
Establish a channel, which is a connection between RMAN and a database instance.
ALLOCATE CHANNEL FOR MAINTENANCE
Allocate a channel in preparation for issuing maintenance commands such as DELETE.
BACKUP
Back up database files, copies of database files, archived logs, or backup sets.
CATALOG
Add information about file copies and user-managed backups to the repository.
CHANGE
Mark a backup piece, image copy, or archived redo log as having the status UNAVAILABLE or AVAILABLE; remove the repository record for a backup or copy; override the retention policy for a backup or copy; update the recovery catalog with theDB_UNIQUE_NAME for the target database.
CONFIGURE
Configure persistent RMAN settings. These settings apply to all RMAN sessions until explicitly changed or disabled.
CONNECT
Establish a connection between RMAN and a target, auxiliary, or recovery catalog database.
CONVERT
Convert data file formats for transporting tablespaces and databases across platforms.
CREATE CATALOG
Create the schema for the recovery catalog.
CREATE SCRIPT
Create a stored script and store it in the recovery catalog.
CROSSCHECK
Determine whether files managed by RMAN, such as archived logs, data file copies, and backup pieces, still exist on disk or tape.
DELETE
Delete backups and copies, remove references to them from the recovery catalog, and update their control file records to statusDELETED.
DELETE SCRIPT
Delete a stored script from the recovery catalog.
DESCRIBE
List the column definitions of a table or view.
DROP CATALOG
Remove the schema from the recovery catalog.
DROP DATABASE
Delete the target database from disk and unregisters it.
DUPLICATE
Use backups of the target database to create a duplicate database that you can use for testing purposes or to create a standby database.
EXECUTE SCRIPT
Run an RMAN stored script.
EXIT
Quit the RMAN executable.
FLASHBACK DATABASE
Return the database to its state at a previous time or SCN.
GRANT
Grant privileges to a recovery catalog user.
HOST
Invoke an operating system command-line subshell from within RMAN or run a specific operating system command.
IMPORT CATALOG
Imports the metadata from one recovery catalog into a different recovery catalog.
LIST
Produce a detailed listing of backup sets or copies.
PRINT SCRIPT
Display a stored script.
QUIT
Exit the RMAN executable.
RECOVER
Apply redo log files and incremental backups to data files or data blocks restored from backup or data file copies, to update them to a specified time.
REGISTER DATABASE
Register the target database in the recovery catalog.
RELEASE CHANNEL
Release a channel that was allocated with an ALLOCATE CHANNELcommand or ALLOCATE CHANNEL FOR MAINTENANCE command.
REPAIR FAILURE
Repair one or more failures recorded in the automated diagnostic repository.
REPLACE SCRIPT
Replace an existing script stored in the recovery catalog. If the script does not exist, then REPLACE SCRIPT creates it.
REPORT
Perform detailed analyses of the content of the recovery catalog.
RESET DATABASE
Inform RMAN that the SQL statement ALTER DATABASE OPEN RESETLOGS has been executed and that a new incarnation of the target database has been created, or reset the target database to a prior incarnation.
RESTORE
Restore files from backup sets or from disk copies to the default or a new location.
RESYNC CATALOG
Perform a full resynchronization, which creates a snapshot control file and then copies any new or changed information from that snapshot control file to the recovery catalog.
REVOKE
Revoke privileges from a recovery catalog user.
RMAN
Start RMAN from the operating system command line.
RUN
Execute a sequence of one or more RMAN commands, which are one or more statements executed within the braces of RUN.
SEND
Send a vendor-specific quoted string to one or more specific channels.
SET
Set the value of various attributes that affect RMAN behavior for the duration of a RUN block or a session.
SHOW
Display the current CONFIGURE settings.
SHUTDOWN
Shut down the target database. This command is equivalent to the SQL*Plus SHUTDOWN command.
SPOOL
Write RMAN output to a log file.
SQL
Execute a SQL statement or PL/SQL procedures from within Recovery Manager.
SQL (Quoted)
Execute a SQL statement from within Recovery Manager. See the SQL command for improved syntax.
STARTUP
Start the target database. This command is equivalent to the SQL*Plus STARTUP command.
SWITCH
Specify that a data file copy is now the current data file, that is, the data file pointed to by the control file. This command is equivalent to the SQL statement ALTER DATABASE RENAME FILE as it applies to data files.
TRANSPORT TABLESPACE
Create transportable tablespace sets from backup for one or more tablespaces.
UNREGISTER
Unregister a database from the recovery catalog.
UPGRADE CATALOG
Upgrade the recovery catalog schema from an older version to the version required by the RMAN executable.
VALIDATE
Examine a backup set and report whether its data is intact. RMAN scans all of the backup pieces in the specified backup sets and looks at the checksums to verify that the contents can be successfully restored.

Tuesday, February 17, 2015

Upgrade the recovery catalog

If you created the recovery catalog owner in a release before 10gR1, and if the RECOVERY_CATALOG_OWNER role did not include the CREATE TYPE privilege, then grant it.

1. For example, start SQL*Plus, You can then execute the following GRANT statement:

SQL> GRANT CREATE TYPE TO rman;
SQL> EXIT;

2. Start RMAN and connect RMAN to the recovery catalog database.

3. Run the UPGRADE CATALOG command:

 RMAN> UPGRADE CATALOG;

recovery catalog owner is rman enter UPGRADE CATALOG command again to confirm catalog upgrade

4. Run the UPDATE CATALOG command again to confirm:

RMAN> UPGRADE CATALOG;


recovery catalog upgraded to version 11.01.00 DBMS_RCVMAN package upgraded to version 11.01.00 DBMS_RCVCAT package upgraded to version 11.01.00

Querying Details of Past and Current RMAN Jobs

An RMAN job is the set of commands executed within an RMAN session. Thus, one RMAN job can contain multiple commands. For example, you may execute two separate BACKUP commands and a RECOVER COPY command in a single session. An RMAN backup job is the set of BACKUP commands executed in one RMAN job. For example, a BACKUP DATABASE and BACKUP ARCHIVELOG ALL command executed in the same RMAN job constitute a single RMAN backup job.

The views V$RMAN_BACKUP_JOB_DETAILS and V$RMAN_BACKUP_SUBJOB_DETAILS and their corresponding recovery catalog versions provide details of RMAN backup jobs. For example, the views show how long a backup took, how many backup jobs have been issued, the status of each backup job (for example, whether it failed or completed), when a job started and finished, and what type of backup was performed. The SESSION_KEY column is the unique key for the RMAN session in which the backup job occurred.

RMAN backups often write less than they read. Because of RMAN compression, the OUTPUT_BYTES_PER_SEC column cannot be used as the measurement of backup speed. The appropriate column to measure backup speed is INPUT_BYTES_PER_SEC. The ratio between read and written data is described in the COMPRESSION_RATIO column.
To query details about past and current RMAN jobs:
  1. Connect SQL*Plus to the database whose backup history you intend to query.
  2. Query the V$RMAN_BACKUP_JOB_DETAILS view for information about the backup type, status, and start and end time.
The following query shows the backup job history ordered by session key, which is the primary key for the RMAN session:

COL STATUS FORMAT a9
COL hrs    FORMAT 999.99
SELECT SESSION_KEY, INPUT_TYPE, STATUS,
       TO_CHAR(START_TIME,'mm/dd/yy hh24:mi') start_time,
       TO_CHAR(END_TIME,'mm/dd/yy hh24:mi')   end_time,
       ELAPSED_SECONDS/3600                   hrs
FROM V$RMAN_BACKUP_JOB_DETAILS
ORDER BY SESSION_KEY;
The following sample output shows the backup job history:
SESSION_KEY INPUT_TYPE    STATUS    START_TIME     END_TIME           HRS
----------- ------------- --------- -------------- -------------- -------
          9 DATAFILE FULL COMPLETED 04/18/07 18:14 04/18/07 18:15     .02
         16 DB FULL       COMPLETED 04/18/07 18:20 04/18/07 18:22     .03
        113 ARCHIVELOG    COMPLETED 04/23/07 16:04 04/23/07 16:05     .01
  1. Query the V$RMAN_BACKUP_JOB_DETAILS view for the rate of backup jobs in an RMAN session.
The following query shows the backup job speed ordered by session key, which is the primary key for the RMAN session. The columns IN_SEC and OUT_SEC display the data input and output per second.

COL in_sec FORMAT a10
COL out_sec FORMAT a10
COL TIME_TAKEN_DISPLAY FORMAT a10
SELECT SESSION_KEY,
       OPTIMIZED,
       COMPRESSION_RATIO,
       INPUT_BYTES_PER_SEC_DISPLAY in_sec,
       OUTPUT_BYTES_PER_SEC_DISPLAY out_sec,
       TIME_TAKEN_DISPLAY
FROM   V$RMAN_BACKUP_JOB_DETAILS
ORDER BY SESSION_KEY;

The following sample output shows the speed of the backup jobs:
SESSION_KEY OPT COMPRESSION_RATIO IN_SEC     OUT_SEC    TIME_TAKEN
----------- --- ----------------- ---------- ---------- ----------
          9 NO                  1     8.24M      8.24M  00:01:14
         16 NO         1.32732239     6.77M      5.10M  00:01:45
        113 NO                  1     2.99M      2.99M  00:00:44
  1. Query the V$RMAN_BACKUP_JOB_DETAILS view for the size of the backups in an RMAN session.
If you run BACKUP DATABASE, then V$RMAN_BACKUP_JOB_DETAILS.OUTPUT_BYTES shows the total size of backup sets written by the backup job for the database that you are backing up. To view backup set sizes for all registered databases, query V$RMAN_BACKUP_JOB_DETAILS.
The following query shows the backup job size and throughput ordered by session key, which is the primary key for the RMAN session. The columns IN_SIZE and OUT_SIZE display the data input and output per second.

COL in_size  FORMAT a10
COL out_size FORMAT a10
SELECT SESSION_KEY,
       INPUT_TYPE,
       COMPRESSION_RATIO,
       INPUT_BYTES_DISPLAY in_size,
       OUTPUT_BYTES_DISPLAY out_size
FROM   V$RMAN_BACKUP_JOB_DETAILS
ORDER BY SESSION_KEY;

The following sample output shows the size of the backup jobs:
SESSION_KEY INPUT_TYPE    COMPRESSION_RATIO IN_SIZE    OUT_SIZE
----------- ------------- ----------------- ---------- ----------
         10 DATAFILE FULL                 1   602.50M    602.58M
         17 DB FULL              1.13736669   634.80M    558.13M