Friday, December 11, 2015

Enable Cut-Copy on Oracle VM (Virtual Box)


  1. Open Oracle VM Virtualbox Manager
  2. Choose Bidirectional for Shared Clipboard and folders.


Below are the screenshots for the same:




Enable Internet Access to Virtual Box (Oracle VM)


  1. Open Oracle VM Virtualbox Manager
  2. Right Click on Settings of the VM you want to enable
  3. Click on the Network tab, Enable Network Adapter
  4. Attached to Bridge Adapter and choose the Name of your internet adapter. Refer the screenshots below
  5. Then, start the VM and using root, enter the command ifup eth0 to enable the network interface of the VM. (more details see the link http://www.computerhope.com/unix/ifup.htm)
Below are the screenshots showing the same:







Install CentOS 6 on Oracle VM (Virtual Box)



Initial Software requirements:

Install Oracle VM Virtualbox
Download Link: http://www.oracle.com/technetwork/server-storage/virtualbox/downloads/index.html

CentOS 6.4 minimal iso file
Download link: https://wiki.centos.org/Download
Choose CentOS Linux version 6 and download the x86_64 iso image.

Lets Begin the installation process:

  1. Open Oracle VM Virtualbox, and click New.
  2. Choose Default parameters until you see the final screen. (refer below screenshots)
  3. Start the VM with the CentOS 6.4 iso file
  4. Choose defaults and you will asked to enter Country, timezone and root password details
  5. Voila!!! your VM is ready with CentOS 6.4 Linux version.


Below are the above steps in details with screenshots:















Monday, October 5, 2015

Connect to 11gR2 Oracle database with SCAN IP using SQL Developer

1. Open SQL Developer and click + sign for new connection

2. Connection Type: Advanced
Enter the jdbc URL of the Database with scan ip.

3. Click Test, if it shows success then save.

Monday, September 21, 2015

RMAN-06059: expected archived log not found and ORA-19625

Problem:


RMAN-03002: failure of backup command at 03/04/2013 08:00:23
RMAN-06059: expected archived log not found, lost of archived log compromises recoverability
ORA-19625: error identifying file /opt/oracle/archredo0/foprod1/1_49507_765747965.arc
ORA-27037: unable to obtain file status


Solution:


1. Login rman

fodbsx7.hk.ocean.local:/opt/oracle/archredo0/foprod1$ so -a -s foprod1 rman target /

2. Run crosscheck copy

RMAN> crosscheck copy;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=263 devtype=DISK
validation failed for archived log
archive log filename=/opt/oracle/archredo0/foprod1/1_49507_765747965.arc recid=67567 stamp=809109558
validation failed for archived log
archive log filename=/opt/oracle/archredo0/foprod1/1_49508_765747965.arc recid=67568 stamp=809109559
validation failed for archived log
archive log filename=/opt/oracle/archredo0/foprod1/1_49509_765747965.arc recid=67569 stamp=809109560
validation failed for archived log
archive log filename=/opt/oracle/archredo0/foprod1/1_49510_765747965.arc recid=67570 stamp=809109562
validation failed for archived log
archive log filename=/opt/oracle/archredo0/foprod1/1_49511_765747965.arc recid=67571 stamp=809109564
validation failed for archived log

3. Delete expired copy;

RMAN> delete expired copy;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=263 devtype=DISK

List of Archived Log Copies
Key     Thrd Seq     S Low Time  Name
------- ---- ------- - --------- ----
67567   1    49507   X 02-MAR-13 /opt/oracle/archredo0/foprod1/1_49507_765747965.arc
67568   1    49508   X 02-MAR-13 /opt/oracle/archredo0/foprod1/1_49508_765747965.arc
67569   1    49509   X 02-MAR-13 /opt/oracle/archredo0/foprod1/1_49509_765747965.arc
67570   1    49510   X 02-MAR-13 /opt/oracle/archredo0/foprod1/1_49510_765747965.arc

4. Re-run the log backup for check from crontab

fodbsx7.hk.ocean.local:/opt/oracle/archredo0/foprod1$ /usr/local/bin/descron "/opt/oracle/ocean_rman_backup.sh log" "Oracle Backups" logs-oracle

How to change DBID of Oracle Database



use Note: 224266.1 From Metalink


-Check DBID for both target and source instance ( they will be same)
select dbid, name, open_mode, activation#, created from v$database;

Command to change: 
-nid target=sys/manager@TEST_DB

Command to change Password file:
--Backup password file
[orafvnd@db1001]$ mv orapwTEST orapwTEST_old
 -rwSr-----   1 oratest  fvndba      1536 Sep  3 17:05 orapwFVND_old

[oratest@db1001]$ orapwd file=orapwTEST password=manager entries=2

Sunday, September 20, 2015

SQL query to check Tablespace Utilization in Oracle Database.



SET LINESIZE 150
SET PAGESIZE 9999
SET VERIFY OFF
COLUMN status FORMAT a9 HEADING 'Status'
COLUMN name FORMAT a25 HEADING 'Tablespace Name'
COLUMN ts_size FORMAT 999999.99 HEADING 'Tablespace Size'
COLUMN used FORMAT 999999.99 HEADING 'Used (in megabytes)'
COLUMN free FORMAT 999999.99 HEADING 'Free (in megabytes)'
COLUMN pct_used FORMAT 999.99 HEADING 'Pct. Used'
SELECT d.tablespace_name name,
       d.status status,
       NVL(a.bytes, 0)/1024/1024 ts_size,
       NVL(a.bytes - NVL(f.bytes, 0), 0)/1024/1024 used,
       NVL(f.bytes, 0)/1024/1024 free,
       NVL((a.bytes - NVL(f.bytes, 0)) / a.bytes * 100, 0) pct_used
  FROM sys.dba_tablespaces d,
       ( select tablespace_name, sum(bytes) bytes from dba_data_files group by tablespace_name) a,
       ( select tablespace_name, sum(bytes) bytes from dba_free_space group by tablespace_name) f
 WHERE d.tablespace_name = a.tablespace_name(+)
   AND d.tablespace_name = f.tablespace_name(+)
ORDER BY pct_used desc;


Sample output: