Quantcast
Channel: Sameer Shaik. B.E,M.S,M.B.A,P.M.P,C.S.M
Viewing all 191 articles
Browse latest View live

Change EXADATA explain plan to Traditional Oracle explain plan

$
0
0
In EXADATA explain plans you will see "storage" and this sometimes is diffcult to compare with traditional oracle explain plan.
In EXADATA parameter CELL_OFFLOCAD_PLAN controls this behaviour.






Ex:-
SQL> show parameter cell_offload_plan_display

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
cell_offload_plan_display            string      AUTO

SQL> select * from dual;

 



SQL> alter session set cell_offload_plan_display=NEVER ;

Session altered.

SQL> /

Session altered.

SQL> select * from dual;
 






SQL> show parameter cell_offload_plan_display

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
cell_offload_plan_display            string      NEVER
SQL>

EXADATA KVM- How To Start an Avocent KVM Remote Console to Manage CELLs & Compute Nodes?

$
0
0
1) Obtain the Avocent KVM hostname or IP address.

If you are not sure then after the install. goto

cd /opt/oracle.SupportTools/onecommand
cat  dbm.dat | grep kvm
This will give you the KVM switch details as below:
SWITCH "Switch" absw-kvm 10.1.1.1

2) Using any browser, in the URL section specify the hostname using the https protocol:

ex: https://abcsw-kvm/login.php




Give the credentials:

a) Default is Admin and empty password string
else
b) Admin/welcome1

3) Then press the [Login] button

Then the “Target Devices” console will appear:



On your left side you will see all the available Tabs:


Under Tools TAB -you will numerous tools :




Now to Start a KVM session click on the Node either database node or cell node:

6) Here I am using the cell node:




Click on cell:




Click on the KVM Session and this will open a new java session with the login prompt:








EXADATA ILOM

$
0
0
ILOM is included on certain Sun servers. If you have one of these servers, it will
include an ILOM supplement, which contains platform-specific information, such as
sensors and thresholds, and details about the hardware

The ILOM is a dedicated system of hardware and supporting software that allows
you to manage your Sun server independently of the operating system.
ILOM includes the following components:
■ Service Processor (SP) – This is the hardware. It consists of a dedicated processor
board that communicates through the system serial port and a dedicated Ethernet
port.
■ Command-Line Interface (CLI) – The command-line interface is a dedicated
software application that allows you to operate the ILOM using keyboard
commands. You can use the command-line interface to send commands to the
ILOM. You can connect a terminal or emulator directly to the system serial port,
or connect over the Ethernet using a secure shell (ssh).
To log in to and use the CLI, see Chapter 3.
■ WebGUI – The WebGUI provides a powerful, yet easy-to-use browser interface
that allows you to log in to the SP and perform system management, monitoring,
and IPMI tasks.

Remote Console/Java™ Client – The Java Client supports the Remote Console
functionality, which allows you to access your server’s console remotely. It
redirects the keyboard, mouse, and video screen, and can redirect input and
output from the local machine’s CD and diskette drives.

If you don't have the ILOM IP address then go to:
cd  /opt/oracle.SupportTools/onecommand

>cat dbm.dat | grep ILOM
ILOM "Ilom" my1db01-ilom 1.1.71.72
ILOM "Ilom" my1db02-ilom 1.1.71.73
ILOM "Ilom" my1db03-ilom 1.1.71.74
ILOM "Ilom" my1db04-ilom 1.1.71.75
ILOM "Ilom" my1cel01-ilom 1.1.71.76

Now goto https://my1db01-ilom



Type the credentials:







 Overview:

 Available Tabs:




EXADATA Inifiniband ILOM

$
0
0
If you cannot access the webpage then make sure https access is not turned off via cli after logging into IB switch.
Note-:
If You disable both HTTP and HTTPS access to the switch by doing so in the Web Server Settings section in ILOM, or in paths /SP/services/http and /SP/services/https in the CLI.
It can be re-enabled in the CLI. This will not impact the EM IB switch plug-in, which relies on SNMP.


ssh into the IP switch and change the configuration as needed.


To get the IB switch details:

 cd    /opt/oracle.SupportTools/onecommand
>cat dbm.dat | grep ib
SWITCH "Switch" pda1sw-ib1 1.1.71.85
SWITCH "Switch" pda1sw-ib2 1.1.71.86
SWITCH "Switch" pda1sw-ib3 1.1.71.87


now pull the ILOM page  https://pda1sw-ib1















go to switch monitoring tab:





This will pull the switch info:




Passed Exadata 1Z0-536

$
0
0
Got the result today and passed the 1Z0-536 Exadata implementation specialist certification.

Those who are planning to take the test.

Read the student guide-1 atleast 4-5 times and practice IORM as many times as possible. Most of the questions are scenario based and difficulty level was easy to moderate .

http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getpage?page_id=609&p_org_id=1001&lang=US&get_params=dc:D73668GC10,p_preview:N

From student guide-2 read the best practices and migrations, there was only one to two questions on monitoring so I wouldn't spend much time on guide-2 on the monitoring side.

Anyway it was easy and finally passed the test with 88% and now I am Oracle certified specialist..

Good luck everyone.


Kill all the O.S process of a particular user | kill -9

$
0
0
Want to kill all the O.S process that are running under particular user.

UNIX$ ps -aef  | grep -i shaik | awk '{print $2}' | sed 's/^/kill -9 /'> 1.txt
UNIX$./1.txt


11i/R12 query FND_NODES

$
0
0
    set lines 200
    col host_name for a11
    col node_name for a11
    col database for a10
    col concmgr for a9
    col forms for a7
    col webserver for a11
    col admin for a7
    select
    NODE_NAME,
    decode(STATUS,'Y','ACTIVE','INACTIVE') Status,
    decode(SUPPORT_CP,'Y', 'YES','NO') ConcMgr,
    decode(SUPPORT_FORMS,'Y','YES', 'NO') Forms,
    decode(SUPPORT_WEB,'Y','YES', 'NO') WebServer,
    decode(SUPPORT_ADMIN, 'Y','YES', 'NO') Admin,
    decode(SUPPORT_DB, 'Y','YES', 'NO') Database
    from fnd_nodes
    where node_name != 'AUTHENTICATION' order by NODE_NAME;

ORA-27054: NFS file system where the file is created or resides is not mounted with correct options ORA-27054 ORA-01580

$
0
0


RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 01/08/2014 18:02:28
ORA-01580: error creating control backup file /export/u0/DBS/dbs/snapcf_DBSP1.f
ORA-27054: NFS file system where the file is created or resides is not mounted with correct options
Additional information: 3
Additional information: 1


The workaround recommended is to use the Event 10298.
sql> alter system set events '10298 trace name context forever, level 32';

 

 

Enable FND Debug and get data from FND_LOG_MESSAGES table

$
0
0

Enable FND Debug and get log information from FND_LOG_MESSAGES table:

 

If the size of FND_LOG_MESSAGES table is too big? then

Considering running the concurrent request:  “Purge Debug Log and System Alerts”. 

 

 Enable Debug mode:-

=================

1)Log into system admin responsibility and set the following profile options
FND: Debug Log Enabled - Yes
FND: Debug Log Level - Statement  (Consider other options from the drop down if needed)
FND: Debug Log Module - %

 2)Capture the Max sequence number
 SELECT MAX(log_sequence)  b4seq# FROM fnd_log_messages;


 3)Try to reproduce the issue with above user for which FND profile options are set.

4)Capture the Max sequence number again:
SELECT MAX(log_sequence) afterseq# FROM fnd_log_messages;


5)Run following select to get the log messages
SELECT LOG_SEQUENCE, MESSAGE_TEXT, USER_ID FROM fnd_log_messages WHERE
log_sequence > b4seq# -1 and b4seq# 

OID Get ORASSO password

$
0
0

Obtaining the Single Sign-On Schema Password



$ORACLE_HOME/bin/ldapsearch -h oidhostname -p portnumber -D "cn=orcladmin" -w orcladminpwd -b "orclReferenceName=, cn=IAS Infrastructure  Databases, cn=ias, cn=products, cn=oracleContext" -s sub "orclResourceName=ORASSO" orclpasswordattribute


Ex:-

$ORACLE_HOME/bin/ldapsearch -h oidhost01 -p 389 -D "cn=orcladmin" -w mypass -b "orclReferenceName=OIDDB, cn=IAS Infrastructure  Databases, cn=ias, cn=products, cn=oracleContext" -s sub "orclResourceName=ORASSO" orclpasswordattribute

Result:-
OrclResourceName=ORASSO,orclReferenceName=OIDDB,cn=IAS Infrastructure Databases,cn=IAS,cn=Products,cn=OracleContext
orclpasswordattribute=PASSWORDHERE


Reference:-
========
http://docs.oracle.com/cd/B14099_19/idmanage.1012/b14078/schema.htm

Weblogic silent install

$
0
0
Sample xml file to install weblogic in silent mode. I have tested this on weblogic 10.3.6 /Linux OEL6


Create the xml file using the below options, remember to take out the products that you don't need.

vi weblogic_install.xml

<?xml version="1.0" encoding="UTF-8"?>
<!-- Silent installer option: -mode=silent -silent_xml=/PATH/silent.xml -->
<bea-installer>
  <input-fields>
  <data-value name="BEAHOME" value="/oracle/FMW/WebLogic" />
  <data-value name="COMPONENT_PATHS"
        value="WebLogic Server/Core Application Server|WebLogic Server/Administration Console|WebLogic Server/Configuration Wizard and Upgrade Framework|WebLogic Server/Web 2.0 HTTP Pub-Sub Server|WebLogic Server/WebLogic JDBC Drivers|WebLogic Server/Third Party JDBC Drivers|WebLogic Server/WebLogic Server Clients|WebLogic Server/WebLogic Web Server Plugins|WebLogic Server/UDDI and Xquery Support|Oracle Coherence/Coherence Product Files" />
  <data-value name="USE_EXTERNAL_ECLIPSE" value="false" />
  <data-value name="INSTALL_NODE_MANAGER_SERVICE" value="no" />
  <data-value name="NODEMGR_PORT" value="5559" />
  <data-value name="LOCAL_JVMS" value="/oracle/comn/java/jdk1.7.0_25"/>
  </input-fields>
</bea-installer>


Download weblogic from:-
=================
http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-main-097127.html


Install:-
======
java -Xmx1024m -jar ../weblogic64/wls1036_generic.jar -mode=silent -silent_xml=weblogic_install.xml
Extracting 0%....................................................................................................100%


Reference:-
http://docs.oracle.com/cd/E23943_01/doc.1111/e14142/silent.htm#i1044116

Create weblogic domain using silent install

$
0
0
Create weblogic domain using silent file.



Create the silent file that you will use for domain creation:-
=====================================

vi /weblogic_path/stage/response_files/wl_create_domain_demo.rsp
************ File starts here ***********
read template from "/weblogic_path/WL_DEMO/wlserver_10.3/common/templates/domains/wls.jar";

set JavaHome "/weblogic_path/java/jdk1.8.0_05"; //Set JDK to use

set ServerStartMode "dev"; //production mode or development mode

//To create a Admin server find it from wls template
find Server "AdminServer" as AdminServer;
set AdminServer.ListenAddress "";
set AdminServer.ListenPort "8001";
set AdminServer.SSL.Enabled "true";
set AdminServer.SSL.ListenPort "8002";

//We can directly create a new managed server.
create Server "ms1" as MS1;
set MS1.ListenAddress "";
set MS1.ListenPort "8003";
//set MS1.SSL.Enabled "true";
//set MS1.SSL.ListenPort "7004″;

//Craeting Cluster
//create Cluster "MyCluster" as MyCl;

//Putting managed servers into the cluster
//assign Server "MS1″ to Cluster "MyCluster";
//assign Server "MS2″ to Cluster "MyCluster";

//Create Machine
create Machine "shaiksameer.com" as Machinename;

//Create JDBC datasource and targeting it to cluster
//create JDBCConnectionPool "demoPool" as mypool;
//set mypool.DriverName "com.pointbase.jdbc.jdbcUniversalDriver";
//set mypool.URL "jdbc:pointbase:server://localhost:9092/demo";
//set mypool.Password "PBPUBLIC";
//set mypool.Properties "user=PBPUBLIC";
//assign JDBCConnectionPool "*" to target "MyCluster";

//Create File Store
//create JMSFileStore "FileStore" as filestore;
//set filestore.Directory "d:\FStore";
//create JMS server
//create JMSServer "JMSServer" as jmsserver;
//set jmsserver.PersistentStore "FileStore"; //Add persistence store to the JMS server
//assign JMSServer "*" to target "MS1″;

//create JMS queue, default subdeployment will be created and targeted. Not sure
//create JMSQueue "Queue" as queue;
//set queue.JNDIName "jms/queue"; //JNDI name for Queue
//set queue.JMSServer "JMSServer"; //Target queue to JMS server

//use templates default weblogic user
find User "weblogic" as u1;
set u1.password "weblogic4u";

//create a new user
create User "shaiksameer" as u2;
set u2.password "weblogic4u";

write domain to "/weblogic_path/WL_DEMO/user_projects/domains/demo_domain"; // The domain name will be "demo-domain"

close template;

********File end here ********


Start the domain creation:-
==================
/weblogic_path/WL_DEMO/wlserver_10.3/common/bin> ./config.sh -mode=silent -silent_script=/weblogic_path/stage/response_files/wl_create_domain_demo.rsp -logfile=/weblogic_path/WL_DEMO/create_domain.log

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
<< read template from "/weblogic_path/WL_DEMO/wlserver_10.3/common/templates/domains/wls.jar"
>>  succeed: read template from "/weblogic_path/WL_DEMO/wlserver_10.3/common/templates/domains/wls.jar"
<< set config option JavaHome to "/weblogic_path/java/jdk1.8.0_05"
>>  succeed: set config option JavaHome to "/weblogic_path/java/jdk1.8.0_05"
<< set config option ServerStartMode to "dev"
>>  succeed: set config option ServerStartMode to "dev"
<< find Server "AdminServer" as AdminServer
>>  succeed: find Server "AdminServer" as AdminServer
<< set AdminServer attribute ListenAddress to ""
>>  succeed: set AdminServer attribute ListenAddress to ""
<< set AdminServer attribute ListenPort to "8001"
>>  succeed: set AdminServer attribute ListenPort to "8001"
<< set AdminServer attribute SSL!Enabled to "true"
>>  succeed: set AdminServer attribute SSL!Enabled to "true"
<< set AdminServer attribute SSL!ListenPort to "8002"
>>  succeed: set AdminServer attribute SSL!ListenPort to "8002"
<< create Server "ms1" as MS1
>>  succeed: create Server "ms1" as MS1
<< set MS1 attribute ListenAddress to ""
>>  succeed: set MS1 attribute ListenAddress to ""
<< set MS1 attribute ListenPort to "8003"
>>  succeed: set MS1 attribute ListenPort to "8003"
<< create Machine "shaiksameer.com" as Machinename
>>  succeed: create Machine "shaiksameer.com" as Machinename
<< find User "weblogic" as u1
>>  succeed: find User "weblogic" as u1
<< set u1 attribute Password to "********"
>>  succeed: set u1 attribute Password to "********"
<< create User "shaiksameer" as u2
>>  succeed: create User "shaiksameer" as u2
<< set u2 attribute Password to "********"
>>  succeed: set u2 attribute Password to "********"
<< write Domain to "/weblogic_path/WL_DEMO/user_projects/domains/demo_domain"
...............................................................................................
>>  succeed: write Domain to "/weblogic_path/WL_DEMO/user_projects/domains/demo_domain"
<< close template
>>  succeed: close template

The local BEA product registry is corrupted. Please select another Middleware Home or contact Oracle Support

$
0
0
While installing weblogic using silent install file you may get the below error:


Issue:-
=====
java -Xmx5096m -jar weblogic64/wls1036_generic.jar -mode=silent -silent_xml=weblogic_install.xml -logfile=weblogic_install.log
Extracting 0%....................................................................................................100%
The local BEA product registry is corrupted. Please select another Middleware Home or contact Oracle Support


Fix:-
====
Silent file contains incorrect product list, please correct the product list and try again. i.e either a "|" is missed or quotes so on...

Recitfy the silent file and rerun the install.

Ex:-
  <data-value name="COMPONENT_PATHS"
        value="WebLogic Server/Core Application Server|WebLogic Server/Administration Console|WebLogic Server/Configuration Wizard and Upgrade Framework|WebLogic Server/Web 2.0 HTTP Pub-Sub Server|WebLogic Server/WebLogic JDBC Drivers|WebLogic Server/Third Party JDBC Drivers|WebLogic Server/WebLogic Server Clients|WebLogic Server/WebLogic Web Server Plugins|WebLogic Server/UDDI and Xquery Support|Oracle Coherence/Coherence Product Files" />

Create Oracle RAC 11gR2 database using dbca silent file

$
0
0

How to create a 11g RAC database using dbca silent response file.

dbca -progress_only -responseFile “/home/shaiksameer/dbca_testdb.rsp”

vi dbca_testdb.rsp
RESPONSEFILE_VERSION = "11.2.0"
OPERATION_TYPE = "createDatabase"
GDBNAME = "TESTDB"
SID = "TESTDB"
NODELIST=machine1,machine2,machine3,machine4
TEMPLATENAME = "General_Purpose.dbc"
SYSPASSWORD = "syspass12"
SYSTEMPASSWORD = "systempass12"
STORAGETYPE=ASM
DISKGROUPNAME=DATA
CHARACTERSET = "AL32UTF8"
NATIONALCHARACTERSET= "AL16UTF16
SAMPLESCHEMA=FALSE
MEMORYPERCENTAGE = "10"
DATABASETYPE = "MULTIPURPOSE"
AUTOMATICMEMORYMANAGEMENT = "TRUE"

or you can pass the variable values directly.

dbca -silent -nodelist machine1,machine2,machine3,machine4 
 -createDatabase -templateName General_Purpose.dbc 
 -gdbName TESTDB 
 -sid TESTDB 
 -SysPassword syspass12
 -SystemPassword systempass12 
-emConfiguration NONE 
-characterSet WE8ISO8859P15
 -totalMemory 500

rsync - scp to Copy files between servers

$
0
0


rsync
Use this command to transfer files remotely and locally in Linux based machines.

-v : verbose
-r : copies data recursively (but don’t preserve timestamps and permission while transferring data
-a : archive mode, archive mode allows copying files recursively and it also preserves symbolic links, file permissions, user & group ownerships and timestamps
-z : compress file data
-h : human-readable, output numbers in a human-readable format

example:

rsync -avzh source destination
rsync -avzh username@shaiksameer.com:/u0/db/oracle/oradata/ /u0/db/oracle/oradata 
 

ORA-15001: diskgroup "" does not exist or is not mounted

$
0
0

Issue:
====
SQL> drop diskgroup TESTDAT;
drop diskgroup TESTDAT
*
ERROR at line 1:
ORA-15039: diskgroup not dropped
ORA-15001: diskgroup "TESTDAT" does not exist or is not mounted


SQL> select name from v$asm_diskgroup;

NAME
------------------------------
TESTDAT


Fix:-
====
SQL> drop diskgroup TESTDAT force including contents;

Diskgroup dropped.



ORA-245: control file backup operation failed

$
0
0
In 11.2 RAC:

SQL> alter database create standby controlfile as '/home/oracle/cntrl01.ctl';
alter database create standby controlfile as 
'/home/oracle/renostdbycntrl.ctl'
*
ERROR at line 1:
ORA-245: control file backup operation failed

or

RMAN-00571: ========================================================
RMAN-00569: ============ ERROR MESSAGE STACK FOLLOWS =============
RMAN-00571: =========================================================
RMAN-03009: failure of resync command on default channel at 03/13/2015 10:19:41
ORA-00245: control file backup operation failed


Fix:-

Configure the snapshot controlfile to a shared disk:

RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO '<shared_disk>/snapcf_<DBNAME>.f';

RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO '+<DiskGroup>/snapcf_<DBNAME>.f';

Oracle Flashback database

$
0
0

Enable flashback:



SQL> select name,open_mode,flashback_on from v$database;

NAME                    OPEN_MODE          FLASHBACK_ON
---------------------------------------- -------------------- ------------------
ORCL                    READ WRITE          NO

SQL> alter database flashback on;

Database altered.

SQL> select name,open_mode,flashback_on from v$database;

NAME                    OPEN_MODE          FLASHBACK_ON
---------------------------------------- -------------------- ------------------
ORCL                    READ WRITE          YES

SQL> alter database add supplemental log data;

Database altered.


SQL> col name for a30
SQL> select * from v$restore_point;

no rows selected

SQL> create restore point before_truncate guarantee flashback database;

Restore point created.

SQL> select * from v$restore_point;

      SCN DATABASE_INCARNATION# GUA STORAGE_SIZE TIME
---------- --------------------- --- ------------ ---------------------------------------------------------------------------
RESTORE_POINT_TIME                               PRE NAME
--------------------------------------------------------------------------- --- ------------------------------
  1095503              3 YES      8192000 05-AUG-15 02.30.32.000000000 PM
                                      YES BEFORE_TRUNCATE


SQL> select count(*) from hr.job_history;

 COUNT(*)
----------
   10

SQL> truncate table hr.job_history;

Table truncated.

SQL> select count(*) from hr.job_history;

 COUNT(*)
----------
    0

SQL> flashback database to restore point before_truncate;
flashback database to restore point before_truncate
*
ERROR at line 1:
ORA-38757: Database must be mounted and not open to FLASHBACK.


SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount
ORACLE instance started.

Total System Global Area  430075904 bytes
Fixed Size           2214056 bytes
Variable Size         406849368 bytes
Database Buffers       16777216 bytes
Redo Buffers           4235264 bytes
Database mounted.

SQL> flashback database to restore point before_truncate;

Flashback complete.

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


SQL> alter database open resetlogs;

Database altered.

SQL> select count(*) from hr.job_history;

 COUNT(*)
----------
   10

rman report/delete obsolete

$
0
0

Rman report/delete obsolete:

 

[oracle@collabn1 sshaik]$ rman target / catalog rcuser/rcuser@prod1

Recovery Manager: Release 11.2.0.1.0 - Production on Wed Aug 5 14:37:37 2015

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

connected to target database: ORCL (DBID=1414564590)
connected to recovery catalog database

RMAN> report obsolete;

new incarnation of database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Report of obsolete backups and copies
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set           69     04-AUG-15       
 Backup Piece       72     04-AUG-15          +DATA2/orcl/backupset/2015_08_04/nnndf0_tag20150804t152113_0.282.886864875
Backup Set           70     04-AUG-15       
 Backup Piece       73     04-AUG-15          +DATA2/orcl/autobackup/2015_08_04/s_886864881.283.886864881
Backup Set           105    04-AUG-15       
 Backup Piece       109    04-AUG-15          /home/oracle/sshaik/backup/orcl-backup-05qdovfo_1_1.bak
Backup Set           140    04-AUG-15       
 Backup Piece       142    04-AUG-15          +DATA2/orcl/autobackup/2015_08_04/s_886865409.287.886865409
Backup Set           174    04-AUG-15       
 Backup Piece       177    04-AUG-15          +DATA2/orcl/autobackup/2015_08_04/s_886868088.263.886868089
Backup Set           232    05-AUG-15       
 Backup Piece       233    05-AUG-15          +DATA2/orcl/autobackup/2015_08_05/s_886923509.295.886923509
Backup Set           296    05-AUG-15       
 Backup Piece       298    05-AUG-15          +DATA2/orcl/autobackup/2015_08_05/s_886923900.298.886923901
Backup Set           376    05-AUG-15       
 Backup Piece       384    05-AUG-15          +DATA2/orcl/autobackup/2015_08_05/s_886948165.300.886948167

RMAN> delete obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=53 device type=DISK
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set           69     04-AUG-15       
 Backup Piece       72     04-AUG-15          +DATA2/orcl/backupset/2015_08_04/nnndf0_tag20150804t152113_0.282.886864875
Backup Set           70     04-AUG-15       
 Backup Piece       73     04-AUG-15          +DATA2/orcl/autobackup/2015_08_04/s_886864881.283.886864881
Backup Set           105    04-AUG-15       
 Backup Piece       109    04-AUG-15          /home/oracle/sshaik/backup/orcl-backup-05qdovfo_1_1.bak
Backup Set           140    04-AUG-15       
 Backup Piece       142    04-AUG-15          +DATA2/orcl/autobackup/2015_08_04/s_886865409.287.886865409
Backup Set           174    04-AUG-15       
 Backup Piece       177    04-AUG-15          +DATA2/orcl/autobackup/2015_08_04/s_886868088.263.886868089
Backup Set           232    05-AUG-15       
 Backup Piece       233    05-AUG-15          +DATA2/orcl/autobackup/2015_08_05/s_886923509.295.886923509
Backup Set           296    05-AUG-15       
 Backup Piece       298    05-AUG-15          +DATA2/orcl/autobackup/2015_08_05/s_886923900.298.886923901
Backup Set           376    05-AUG-15       
 Backup Piece       384    05-AUG-15          +DATA2/orcl/autobackup/2015_08_05/s_886948165.300.886948167

Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=+DATA2/orcl/backupset/2015_08_04/nnndf0_tag20150804t152113_0.282.886864875 RECID=1 STAMP=886864874
deleted backup piece
backup piece handle=+DATA2/orcl/autobackup/2015_08_04/s_886864881.283.886864881 RECID=2 STAMP=886864881
deleted backup piece
backup piece handle=+DATA2/orcl/autobackup/2015_08_04/s_886865409.287.886865409 RECID=6 STAMP=886865409
deleted backup piece
backup piece handle=+DATA2/orcl/autobackup/2015_08_04/s_886868088.263.886868089 RECID=7 STAMP=886868088
deleted backup piece
backup piece handle=+DATA2/orcl/autobackup/2015_08_05/s_886923509.295.886923509 RECID=7 STAMP=886923509
deleted backup piece
backup piece handle=+DATA2/orcl/autobackup/2015_08_05/s_886923900.298.886923901 RECID=12 STAMP=886923901
deleted backup piece
backup piece handle=+DATA2/orcl/autobackup/2015_08_05/s_886948165.300.886948167 RECID=13 STAMP=886948166
Deleted 7 objects

RMAN-06207: WARNING: 1 objects could not be deleted for DISK channel(s) due
RMAN-06208:          to mismatched status.  Use CROSSCHECK command to fix status
RMAN-06210: List of Mismatched objects
RMAN-06211: ==========================
RMAN-06212:   Object Type   Filename/Handle
RMAN-06213: --------------- ---------------------------------------------------
RMAN-06214: Backup Piece    /home/oracle/sshaik/backup/orcl-backup-05qdovfo_1_1.bak


RMAN> crosscheck backup;

using channel ORA_DISK_1
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/home/oracle/sshaik/backup/orcl-backup-04qdovfm_1_1.bak RECID=3 STAMP=886865398
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/home/oracle/sshaik/backup/orcl-backup-05qdovfo_1_1.bak RECID=4 STAMP=886865400
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/home/oracle/sshaik/backup/orcl-backup-06qdovg0_1_1.bak RECID=5 STAMP=886865408
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/home/oracle/sshaik/backup/orcl_backup_0bqdqojh_1_1.bak RECID=8 STAMP=886923889
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/home/oracle/sshaik/backup/orcl_backup_0cqdqoji_1_1.bak RECID=9 STAMP=886923890
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/home/oracle/sshaik/backup/orcl_backup_0dqdqojj_1_1.bak RECID=10 STAMP=886923891
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/home/oracle/sshaik/backup/orcl_backup_0eqdqojr_1_1.bak RECID=11 STAMP=886923899
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+DATA2/orcl/autobackup/2015_08_05/s_886948447.304.886948447 RECID=14 STAMP=886948447
Crosschecked 8 objects


RMAN> delete obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set           105    04-AUG-15       
 Backup Piece       109    04-AUG-15          /home/oracle/sshaik/backup/orcl-backup-05qdovfo_1_1.bak

Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=/home/oracle/sshaik/backup/orcl-backup-05qdovfo_1_1.bak RECID=4 STAMP=886865400
Deleted 1 objects


RMAN>

Oracle external tables using datapump

$
0
0

External table using datapump:

Below we will create an external table "sales_ch"and its data will be stored in a datapump file.


SQL> select username,default_tablespace from dba_users where username='SH';

USERNAME              DEFAULT_TABLESPACE
------------------------------ ------------------------------
SH                  USERS

SQL> create directory data_dir as '/home/oracle/sshaik';

Directory created.


SQL> create directory log_dir as '/home/oracle/sshaik/log';

Directory created.

SQL> grant all on directory data_dir to sh;



SQL> !pwd
/home/oracle/sshaik

SQL> !ls -lrt sales_ch.exp
ls: cannot access sales_ch.exp: No such file or directory


SQL> create table sales_ch organization external (
 2  type oracle_datapump
 3  default directory data_dir
 4  location ('sales_ch.exp')
 5  )
 6  as select * from sales
 7  where channel_id='4';

Table created.


Verify that the datapump file is created at the OS level:

SQL> !ls -lrt sales_ch.exp
-rw-r----- 1 oracle dba 4018176 Aug  5 15:25 sales_ch.exp

SQL> select count(*) from sales_ch;

 COUNT(*)
----------
    118416

SQL> select count(*) from sales where channel_id='4';

 COUNT(*)
----------
    118416


SQL> select object_name,object_type from dba_objects where object_name='SALES_CH';

OBJECT_NAME          
OBJECT_TYPE                   
--------------------------------------------------------------------------------
SALES_CH                        TABLE




SQL>  select owner,table_name,type_owner,type_name from dba_external_tables where table_name='SALES_CH'

OWNER                   TABLE_NAME              TYP TYPE_NAME
------------------------------ ------------------------------ --- ------------------------------
SH                   SALES_CH               SYS ORACLE_DATAPUMP


 
 
Viewing all 191 articles
Browse latest View live