Visit Counter

Tuesday, December 22, 2015

(90) media manager received no data for backup image

 

 
 
 (90) media manager received no data for backup image
 
 
 
Cause
 
 
The Backup Policy is configured as:
·               Backup Selection is  "All Local Drives"
·               one or more drives are excluded
·               Multi-streaming is enabled.





Solution

Modify the excluded drive as follows:
Add an asterisk (*) to the excluded drive list:
i.e.
If drive X is to be excluded and is listed in the excluded list as "X:\"
Add an asterisk  "*" to make the exclusion "X:\*"
Modify Exclude list, and retry backup.

Tuesday, December 15, 2015

ORA-15063: ASM discovered an insufficient number of disks for diskgroup

 
When Start the Database getting error.
 
 
 
SQL> startup
ASM instance started
...
ORA-15032: not all alterations performed
ORA-15063: ASM discovered an insufficient number of disks for diskgroup "RECO"
ORA-15063: ASM discovered an insufficient number of disks for diskgroup "DATA"
 
 
 
 
Action:

 Check that the disks in the diskgroup are present and functioning, that the owner of the ORACLE binary has read/write permission to the disks, and that the ASM_DISKSTRING initialization parameter has been set correctly. Verify that ASM discovers the appropriate disks by querying V$ASM_DISK from the ASM instance
 
 
Solution:
 
 #/etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks: DISK1
                                                           [  OK  ]
 
 
 
There are two disk for ASM but it showing one disk.
 
 
$ /etc/init.d/oracleasm init
 
 
$ /etc/init.d/oracleasm listdisks
 
DISK1
DISK2
 
 
$ ls -ltr /dev/oracleasm/disk/*
 
/dev/oracleasm/disks/DISK2
/dev/oracleasm/disks/DISK1
 
 
 
 
$ cd /grid/bin
 
$ ./crsctl stop resource -all
 
$ ./crsctl start resource -all
 
 
 
 $ crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       localhost
ora.LISTENER.lsnr
               ONLINE  ONLINE       localhost
ora.LISTENER_GRID.lsnr
               ONLINE  ONLINE       localhost
ora.asm
               ONLINE  ONLINE       localhost                Started
ora.eons
               OFFLINE OFFLINE      localhost
ora.ons
               OFFLINE OFFLINE      localhost
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       localhost
ora.diskmon
      1        ONLINE  ONLINE       localhost
ora.migrate.db
      1        ONLINE  OFFLINE                               Instance Shutdown
ora.orcl.db
      1        OFFLINE OFFLINE
ora.orcl.test.svc
      1        OFFLINE OFFLINE
ora.stby.db
      1        OFFLINE OFFLINE

 
 
 
 
 
                                                     
 
 
 

Monday, December 14, 2015

Cross-Platform Transportable Database: RMAN CONVERT DATABASE



Transportable database is used to transport an entire database (user data and the Oracle dictionary) to a new platform with the same endian format. Transportable database permits a minimal downtime migration to a new platform by avoiding the time-consuming method of unloading all user data from the source database and loading it into the target database

Cross-Platform Tranportable Tablespace: CONVERT DATAFILE or TABLESPACE

Introduction
 
Data migration is the process of making an exact copy of an organization’s current data from one device to another device—preferably without disrupting or disabling active applications—and then redirecting all input/output (I/O) activity to the new device.
 
There are a variety of circumstances that might cause an organization to undertake a data migration, including:



Server or storage technology replacement or upgrade

Server or storage consolidation

Relocation of the data center

Server or storage equipment maintenance, including workload balancing or other performance-related maintenance.

This document explains how to migrate an oracle database from a big-endian platform like HPUX on PA-RISC to a little-endian platform like Linux on X86_64. This migration is based on Cross-Platform Tranportable Tablespaces. Transportable tablespaces allow you to copy an entire tablespace between Oracle databases.
 
 


Assumptions made
Oracle version on source and target
Oracle database used in both the platforms is Oracle 10g.

Oracle database is installed in both the source and the target platforms.
Source and target platforms
1. Source machine is big-endian platform (Solaris 10 Sparc 64-bit)

2. Target machine is little-endian platform (Linux on X86-64)

Compatibility criteria
A tablespace can always be transported to a database with the same or higher compatibility setting, whether the target database is on the same or a different platform. The database signals an error if the compatibility level of the transportable set is higher than the compatibility level of the target database.
Service status of the platform
The status of the set of source tablespaces to be transported in Read-only mode..
 
Transportable Technologies
Transportable technologies provide transportable database and transportable tablespace:


Transportable Tablespaces is a feature designed to move a subset of one database into another, even among platforms that differ in endian format. The cross-platform capability of transportable tablespaces can be used to migrate all user data within a database to a new platform with a different endian format. Leveraging transportable tablespaces in this manner permits a minimal downtime migration to a new platform by avoiding the time-consuming method of unloading all user data from the source database and loading it into the target database.



About Cross platform transportable tablespaces
Starting with Oracle Database 10g, you can transport tablespaces across platforms. This functionality can be used to:

1. Allow a database to be migrated from one platform to another

2. Provide an easier and more efficient means for content providers to publish structured data and distribute it to customers running Oracle Database on different platforms

3. Simplify the distribution of data from a data warehouse environment to data marts, which are often running on smaller platforms

4. Enable the sharing of read-only tablespaces between Oracle Database installations on different operating systems or platforms, assuming that your storage system is accessible from those platforms and the platforms all have the same endianness, as described in the sections that follow
Benefits of Transportable Tablespace
1. Move entire tablespace data

2. Supports media recovery

3. Reduces Server Burden - When transportable tablespaces replace large export/import or other loading, a significant processing burden disappears.

4. Higher Reliability - Fewer processing steps and quicker processing reduce the opportunities for human Errors and system problems

Limitations on Transportable Tablespace

The following are the limitations of using Transportable tablespace.

1. The source and target database must use the same character set and national character set.

2. We cannot transport a tablespace to a target database in which a tablespace with the same name already exists. However, you can rename either the tablespace to be transported or the destination tablespace before the transport operation.

3. Objects with underlying objects (such as materialized views) or contained objects (such as partitioned tables) are not transportable unless all of the underlying or contained objects are in the tablespace set.

4. Tablespaces that do not use block encryption but that contain tables with encrypted columns cannot be transported. You must use Oracle Data Pump to export and import the tablespace's schema objects. You can take advantage of Oracle Data Pump features that enable you to maintain encryption for the data while it is being exported and imported.

5. Beginning with Oracle Database 10g Release 2, we can transport tablespaces that contain XMLTypes. Beginning with Oracle Database 11g Release 1, you must use only Data Pump to export and import the tablespace metadata for tablespaces that contain XMLTypes.

6. We cannot transport the SYSTEM tablespace or objects owned by the user SYS. Some examples of such objects are PL/SQL, Java classes, callouts, views, synonyms, users, privileges, dimensions, directories, and sequences.

7. Transportable tablespaces do not support 8.0-compatible advanced queues  with multiple recipients.

Cross-Platform Transportable Tablespace Migration procedure
 
The following steps summarize the process of transporting a tablespace. Details for each step are provided in the subsequent example.

1. For cross-platform transport, check the endian format of both platforms.

2. Select a self-contained set of tablespaces.

3. Generate a transportable tablespace set.

4. A transportable tablespace set (or transportable set) consists of datafiles for the set of tablespaces being transported and an export file containing structural information (metadata) for the set of tablespaces. use Data Pump to perform the export.

5. If you are transporting the tablespace set to a platform with different endianness from the source platform, you must convert the tablespace set to the endianness of the target platform. You can perform a source-side conversion at this step in the procedure, or you can perform a target-side conversion as part of step 4.

6. convert the tablespace set to the endianness of the target platform

7. We are transporting the tablespace set to a platform with different endianness from the source platform, so we must convert the tablespace set to the endianness of the target platform

8. Transport the tablespace set.

9. Copy the datafiles and the export file to a place that is accessible to the target database.

10. Import the tablespace set.

11. Invoke the Data Pump utility to import the metadata for the set of tablespaces into the target database.
 
Cross-platform Tranportable Tablespace Migration Steps








In Source Machine
1. Login as oracle user on the source machine

2. Export the environment variables like ORACLE_HOME, ORACLE_SID, PATH appropriately.

$ export ORACLE_HOME=/u02/product/11.1.0/db_1

$ export ORACLE_SID=sample

$ export PATH=$PATH:$ORACLE_HOME/bin

3. Login to oracle as dba user

$ sqlplus / as sysdba

4. Start the database
SQL> startup Copyright © 2012 ViSolve Inc. All rights reserved. 7



5. Find the Endian fromat

SQL> SELECT d.PLATFORM_NAME, ENDIAN_FORMAT FROM V$TRANSPORTABLE_PLATFORM tp, V$DATABASE d WHERE tp.PLATFORM_NAME = d.PLATFORM_NAME;

Result:

PLATFORM_NAME ENDIAN_FORMAT

--------------------- --------------

HP-UX (64-bit) Big
In Target Machine
1. Login as oracle user on the target machine.

2. Export the environment variables like ORACLE_HOME, ORACLE_SID, PATH appropriately.

$ ORACLE_HOME=/u02/product/11.1.0/db_1

$ ORACLE_SID=SAMPLE

$ PATH=$PATH:$ORACLE_HOME/bin

$ export ORACLE_HOME ORACLE_SID PATH

3. Login to oracle as dba user

$ sqlplus / as sysdba

4. Start the database

SQL> startup

5. Find the Endian fromat

SQL> SELECT d.PLATFORM_NAME, ENDIAN_FORMAT FROM V$TRANSPORTABLE_PLATFORM tp, V$DATABASE d WHERE tp.PLATFORM_NAME = d.PLATFORM_NAME;

Result:

PLATFORM_NAME ENDIAN_FORMAT

--------------------- --------------

Linux IA (32-bit) Little
Select a self-contained set of tablespaces
There may be logical or physical dependencies between objects in the transportable set and those outside of the set. We can only transport a set of tablespaces that is self-contained.
Here self-contained tablespace means that there are no references from inside the set of tablespaces pointing outside of the tablespaces. Copyright © 2012 ViSolve Inc. All rights reserved. 8



Self contained tablespace violations
Some examples of self contained tablespace violations are listed here,

1. An index inside the set of tablespaces is for a table outside of the set of tablespaces.

2. A partitioned table is partially contained in the set of tablespaces.

3. A referential integrity constraint points to a table across a set boundary
4. A table inside the set of tablespaces contains a LOB column that points to LOBs outside the set of tablespaces.



In source machine
1. Find the list of table spaces in source database

SQL> select name from v$tablespace;

NAME

------------------------------

SYSTEM

SYSAUX

UNDOTBS1

USERS

TEMP

SAMPLE

Here we cannot transport system, sysaux, undotbs1, and temp, because these tablespace are system tablespace or contain objects owned by the user SYS. So we select USERS and SAMPLE tablespace to transport from source database to target database.

2. Check any self contained violations present in the tablespaces

SQL> EXECUTE DBMS_TTS.TRANSPORT_SET_CHECK('USERS,SAMPLE',TRUE);

PL/SQL procedure successfully completed.

SQL> SELECT * FROM TRANSPORT_SET_VIOLATIONS;

no rows selected
Here the set of tablespaces is self-contained, this view is empty. If these query returns any violations then this view return the violations. Then those violations must be resolved before set of tablespaces are transportable. Copyright © 2012 ViSolve Inc. All rights reserved. 9



Steps needed before generating a transportable tablespace set
Sys user or Any EXP_FULL_DATABASE privileged user can perform the following steps.

1. Find the required space needed for storing the dump files and converted data files in the source database.

2. Login to oracle as dba user

$ cd $ORACLE_HOME/bin

$ sqlplus / as sysdba

SQL> SELECT TABLESPACE_NAME, FILE_NAME, BYTES FROM DBA_DATA_FILES where TABLESPACE_NAME in('USERS','SAMPLE');

3. Exit from the database

SQL> exit

4. Based on the size of the data files, check for the availability of free space on the disks using the below command.

$ bdf

5. Now create a folder 'backup' in the disk that have sufficient space and store the backup file.

6. Note: Here we have the directory '/u02' with sufficient space to store the exported data. Hence we have created a folder 'backup' in /u02.

$ mkdir /u02/backup

$ chmod 700 /u02/backup
Generate a transportable tablespace set
1. Login to oracle as dba user

$ cd $ORACLE_HOME/bin

$ sqlplus / as sysdba

2. Create a directory in the source database

SQL> create directory expdp_dir as '/u02/backup';

3. Grant permission to that directory

SQL> grant read, write on directory expdp_dir to system;

4. Make all tablespaces in the set that we are copying read-only.

SQL> alter tablespace users read only;

Tablespace altered.
SQL> alter tablespace sample read only; Copyright © 2012 ViSolve Inc. All rights reserved. 10



Tablespace altered.

5. Invoke the Data Pump export utility on the host system and specify which tablespaces are in the transportable set.

SQL> host

$ ./expdp system/sys DUMPFILE=expdata.dmp DIRECTORY=expdp_dir TRANSPORT_TABLESPACES =USERS,SAMPLE LOGFILE=expdata.log

Result:

Job "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01" successfully completed

6. Collect the required users,roles,grants,profile to create again in the target database

$ ./expdp system/sys DUMPFILE=exp_meta_dmp.dmp DIRECTORY=expdp_dir full=y INCLUDE=USER,ROLE,ROLE_GRANT,PROFILE content=METADATA_ONLY

Result:

Job "SYSTEM"."SYS_EXPORT_FULL_01" successfully completed

7. exit back to SQL*Plus

$ exit

SQL> exit
Here users and sample tablespace are being transported to a different platform, and the endianness of the platforms is different. So we want to convert before transporting the tablespace set, and then convert the datafiles composing the users and sample tablespaces.

8. The RMAN CONVERT command is used to do the conversion. Start RMAN and connect to the target database.



$ RMAN TARGET /

9. Convert the datafiles into a backup location on the source platform.

RMAN> CONVERT TABLESPACE 'USERS','SAMPLE' TO PLATFORM 'Linux IA (32-bit)' FORMAT='/u02/backup/%U';

Result:

channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:02

Finished conversion at source at 02-FEB-11

10. Exit from Rman

RMAN> exit
Recovery Manager complete. Copyright © 2012 ViSolve Inc. All rights reserved. 11



Transport the tablespace set
Transport both the datafiles and the export file of the tablespaces to a place that is accessible to the target database

Here dump files and converted data files are present in the backup directory (/u02/backup).

1. Login as oracle user on the target machine

2. In order to restore the backup of the database taken, check for the availability of free space on the disks using the below
$ df

3. Now create a folder 'backup' in the disk that have sufficient space and store

the backup file.

4. Note: Here we have the directory '/u02' with sufficient space to store the

exported data. Hence we have created a folder 'backup' in /u02. In order to

avoid confusion in restoring the database, use the same directory names as in

the source machine.

$ mkdir /u02/backup

$ chmod 700 /u02/backup

5. Copy the source backup directory files (~/u02/backup) to the target directory

/u02/backup
Convert the data files in Target machine
1. The RMAN CONVERT command is used to do the conversion. Start RMAN and

connect to the target database.

$ cd $ORACLE_HOME/bin

$ RMAN TARGET /

RMAN> CONVERT DATAFILE '/u02/backup/data_D-RAN_I-2884613691_TSSAMPLE_

FNO-5_0em3mj05' format "/*existing database data file

path*/sample01.dbf";

Result:

channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:07

Finished conversion at target at 04-FEB-11
RMAN> CONVERT DATAFILE '/u02/ran/data_D-RAN_I-2884613691_TS-USERS_FNOCopyright

© 2012 ViSolve Inc. All rights reserved. 12



4_0fm3mj0r' format '/* existing database data file path* /users01.dbf';

Result:

channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:03

Finished conversion at target at 04-FEB-11

RMAN> exit

Recovery Manager complete.
Import the Tablespace Set
1. Import the required users, roles, grants, profiles metadata using the Data
Pump Import utility, impdp.



$ cd $ORACLEHOME/bin

$ ./impdp system/sys DIRECTORY=expdp_dir DUMPFILE=exp_meta_dmp.dmp

full=y

Result:

Job "SYSTEM"."SYS_IMPORT_FULL_02" successfully completed
2. Now Import the tablespace metadata using Data Pump Import utility, impdp.



$ ./impdp system/sys DIRECTORY=expdp_dir DUMPFILE=expdata.dmp

TRANSPORT_DATAFILES='/ existing database data file path/users01.dbf','/

existing database data file path /sample01.dbf';

Result:

Job "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully completed

3. Import the completed tablespaces and check the imported tablespace and

data in the target machine.
Verify the imported tablespace and data in target database
1. Login to the database as as a dba user

$ cd $ORACLE_HOME/bin

$ sqlplus / as sysdba
Copyright © 2012 ViSolve Inc. All rights reserved. 13



2. List the tablespaces for verify the imported tablespace

SQL> select name from v$tablespace;

NAME

------------------------------

SYSTEM

SYSAUX

UNDOTBS1

TEMP

SAMPLE

3. USERS

Here USERS and SAMPLE tablespaces are imported from source machine and issue the

queries to check the availability of data in the database.

4. Enable read/write mode for the specific imported tablespaces.

SQL> alter tablespace USERS read write;

Tablespace altered.

SQL> alter tablespace SAMPLE read write;

Tablespace altered.

SQL> exit

Now imported Tablespaces in target machine is ready to use. At this point the
tablespace with data file from the source platform is migrated to the target platform.





Conclusion:
With Oracle 10g and 11g, the cross-platform transportable tablespace feature provides
a powerful method to easily and efficiently move data between heterogeneous systems.

This methodology can be used to:

1. Provide an easy and different method for content providers to publish
structures data and distribute it to customers running Oracle on different platform.

 
 
2. Simplify the distribution of data from a data warehouse environment to data
marts, which are often running on lower-end storage and host platforms.
 
 
3. Simplify the migration of a database from one host platform to another
(through the use of Data Pump or import/export

 

 
 
 

 



Sunday, November 15, 2015

Oracle 12c Database Upgrade 12.1.0.1 to 12.1.0.2



Oracle Linux 6    (64-bit)
---------------------------------------------------
Upgrade 12.1.0.1 to 12.1.0.2



I installed 12.1.0.2 binary under /ora/oracle/app/product/12.1.0.2/db_home2 folder

 Also I performed full database backup before upgrade, in case of any disaster.

Go to new installed binary home under< ORACLE_HOME>/bin and run database upgrade assistance.

$ ./dbua





















































































































































 

Sunday, November 8, 2015

Netbackup does not utilize a tape drive and fails with error "EMM staus: No drives are available"




Problem

Problem occurs when NetBackup fails to utilize the tape drive and tape drives show available in device monitor.

Error Message

NBU status: 800, EMM status: No drives are available

Cause

Run /usr/openv/volmgr/bin/tpconfig -emm_dev_list
For drive in question see Flags attribute:
Flags:                         1073741952
The drives flag was 1073741952 which in hexadecimal is 40000080
From LTItypes.h:
#define MM_RESTART_LTID 0x40000000 /* a device configuration change has occurred on the emm server, and this host's daemons should be restarted */

Solution

In order to resolve this issue clear the flag or restart ltid on all media servers sharing the tape drive if vmoprcmd does not clear the flag.
Perform following command to clear the flag :
vmoprcmd -reset_ltid_restarted_bit -h <host name>
Location :
Unix : /usr/openv/volmgr/bin/
Windows : Program Files\Veritas\Volmgr\bin

No drives are available (2001)


Problem
Backup job failed with status code 2001

Error Message

9/17/2010 11:57:57 AM - requesting resource yow-netbackup01-hcart-robot-tld-2-yow-nas1
9/17/2010 11:57:57 AM - requesting resource yow-netbackup01.NBU_CLIENT.MAXJOBS.yow-nas1
9/17/2010 11:57:57 AM - requesting resource yow-netbackup01.NBU_POLICY.MAXJOBS.YOW-NAS1
9/17/2010 11:57:57 AM - Error nbjm(pid=2016) NBU status: 2001, EMM status: No drives are available  No drives are available(2001)

Cause

Incompatible Drive Type
Drive Type= HCART3
Media Type =HCART

Solution

Change the Drive Type to match the Media Type


Applies To
Windows 2003
NetBackup 6.5.5

Wednesday, October 28, 2015

ORA-01565: error in identifying file '+DATA/orcl/spfileorcl.ora'



SQL> startup
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+DATA/orcl/spfileorcl.ora'
ORA-17503: ksfdopn:2 Failed to open file +DATA/orcl/spfileorcl.ora
ORA-15056: additional error message
ORA-17503: ksfdopn:DGOpenFile05 Failed to open file +DATA/orcl/spfileorcl.ora
ORA-17503: ksfdopn:2 Failed to open file +DATA/orcl/spfileorcl.ora
ORA-15173: entry 'spfileorcl.ora' does not exist in directory 'orcl'





[oracle@ora11 bin]$ ./crsctl stat res -t -init

--------------------------------------------------------------------------------

Name Target State Server State details

--------------------------------------------------------------------------------

Local Resources

--------------------------------------------------------------------------------

ora.DATA.dg

ONLINE OFFLINE ora11 STABLE

ora.LISTENER.lsnr

ONLINE ONLINE ora11 STABLE

ora.asm

ONLINE ONLINE ora11 Started,STABLE

ora.ons

OFFLINE OFFLINE ora11 STABLE

--------------------------------------------------------------------------------

Cluster Resources

--------------------------------------------------------------------------------

ora.cssd

1 ONLINE ONLINE ora11 STABLE

ora.diskmon

1 OFFLINE OFFLINE STABLE

ora.evmd

1 ONLINE ONLINE ora11 STABLE

ora.oraafi.db

1 ONLINE OFFLINE STABLE

ora.orabig.db

1 ONLINE OFFLINE STABLE

ora.oradb.db

1 ONLINE OFFLINE STABLE

--------------------------------------------------------------------------------

[oracle@ora11 bin]$










Solution
----------

[oracle@ora11 bin]$ ./crsctl start resource -all

CRS-5702: Resource 'ora.LISTENER.lsnr' is already running on 'ora11'

CRS-5702: Resource 'ora.asm' is already running on 'ora11'

CRS-5702: Resource 'ora.cssd' is already running on 'ora11'

CRS-5702: Resource 'ora.evmd' is already running on 'ora11'

CRS-2501: Resource 'ora.ons' is disabled

CRS-2672: Attempting to start 'ora.DATA.dg' on 'ora11'

CRS-2672: Attempting to start 'ora.diskmon' on 'ora11'

CRS-2676: Start of 'ora.diskmon' on 'ora11' succeeded

CRS-2676: Start of 'ora.DATA.dg' on 'ora11' succeeded

CRS-2679: Attempting to clean 'ora.oraafi.db' on 'ora11'

CRS-2679: Attempting to clean 'ora.orabig.db' on 'ora11'

CRS-2679: Attempting to clean 'ora.oradb.db' on 'ora11'

CRS-2681: Clean of 'ora.oraafi.db' on 'ora11' succeeded

CRS-2672: Attempting to start 'ora.oraafi.db' on 'ora11'

CRS-2681: Clean of 'ora.orabig.db' on 'ora11' succeeded

CRS-2672: Attempting to start 'ora.orabig.db' on 'ora11'

CRS-2681: Clean of 'ora.oradb.db' on 'ora11' succeeded

CRS-2672: Attempting to start 'ora.oradb.db' on 'ora11'

CRS-5010: Update of configuration file "/ora/oracle/app/oracle/product/12.1.0/grid/srvm/admin/oratab.bak.ora11" failed: details at "(:CLSN00011:)" in "/ora/oracle/app/oracle/product/12.1.0/grid/log/ora11/agent/ohasd/oraagent_oracle/oraagent_oracle.log"

 

CRS-2676: Start of 'ora.oraafi.db' on 'ora11' succeeded

CRS-5702: Resource 'ora.oraafi.db' is already running on 'ora11'

CRS-2676: Start of 'ora.oradb.db' on 'ora11' succeeded

CRS-2676: Start of 'ora.orabig.db' on 'ora11' succeeded

CRS-5702: Resource 'ora.orabig.db' is already running on 'ora11'

CRS-4000: Command Start failed, or completed with errors.

[oracle@ora11 bin]$

[oracle@ora11 bin]$



[oracle@ora11 bin]$ ./sqlplus /nolog

SQL*Plus: Release 12.1.0.1.0 Production on Thu Oct 29 02:32:07 2015

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

SQL> conn / as sysdba

Connected.

SQL> exit



[oracle@ora11 bin]$ ./crsctl stat res -t -init

--------------------------------------------------------------------------------

Name Target State Server State details

--------------------------------------------------------------------------------

Local Resources

--------------------------------------------------------------------------------

ora.DATA.dg

ONLINE ONLINE ora11 STABLE

ora.LISTENER.lsnr

ONLINE ONLINE ora11 STABLE

ora.asm

ONLINE ONLINE ora11 Started,STABLE

ora.ons

OFFLINE OFFLINE ora11 STABLE

--------------------------------------------------------------------------------

Cluster Resources

--------------------------------------------------------------------------------

ora.cssd

1 ONLINE ONLINE ora11 STABLE

ora.diskmon

1 OFFLINE OFFLINE STABLE

ora.evmd

1 ONLINE ONLINE ora11 STABLE

ora.oraafi.db

1 ONLINE ONLINE ora11 Open,STABLE

ora.orabig.db

1 ONLINE ONLINE ora11 Open,STABLE

ora.oradb.db

1 ONLINE ONLINE ora11 Open,STABLE

--------------------------------------------------------------------------------

[oracle@ora11 bin]$







 

Thursday, October 15, 2015

USE_SID_AS_SERVICE_listener_name


Unable To Access EM Express For Non-CDB


Transport Database Over Network


Transportable Database


SQL Management Base Stores Plan Rows too


Solution To Performance Issue With In-database Archiving


Plug in 12c Non-CDB As PDB


Performance Issue With In-database Archiving


Enhancements To Partition Exchange Load


PDB cannot share CDB’s temporary tablespace


Optimizer_dynamic_sampling = 11


Improve Backup Performance Using In-database Archiving


In-database Archiving


Does PDB have an SPfile?


Display CDB/PDB Name In SQL Prompt

Display CDB/PDB Name In SQL Prompt

DDL Log Does Not Identify The Source PDB


Connecting To PDB’s With Same Name


Connecting to CDB/PDB – Set Container vs Connect


Clone An Existing PDB as Non-Sys User


Access Objects Of A Common User Non-existent In Root



In a multitenant environment, a common user is a database user whose identity and password are known in the root and in every existing and future pluggable database (PDB). Common users can connect to the root and perform administrative tasks specific to the root or PDBs. There are two types of common users :
  • All Oracle-supplied administrative user accounts, such as SYS and SYSTEM
  •  User created common users- Their names  must start with C## or c##.
When a PDB having a user created common user is plugged into another CDB and the target CDB does not have  a common user with the same name, the common user in a newly plugged in PDB becomes a locked account.
To access such common user’s objects, you can do one of the following:
  • Leave the user account locked and use the objects of its schema.
  • Create a common user with the same name as the locked account


 

Sunday, October 11, 2015

Standby Database in READ ONLY Mode


Standby Database in Read Only mode
----------------------------------------------


Purpose:

As explained before, a physical standby database can be toggled between recovery and read-only mode. If the database is currently in managed recovery mode, in order to open it for reporting, cancel the recovery and open it as read-only.


First of all we have to cancel the recover mode of standby database.

SQL> alter database recover managed standby database cancel;
Database altered.


Open the standby database in read only mode.

SQL> alter database open read only;
Database altered.


Once you finished your reporting u have to shutdown the standby database.


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

Start up the database in mount mode.



SQL> startup mount
ORACLE instance started.
Total System Global Area 7348420608 bytes
Fixed Size                  2150272 bytes
Variable Size            1201614976 bytes
Database Buffers         6006243328 bytes
Redo Buffers              138412032 bytes
Database mounted.


You can start recovery mode again using below command.



SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT;



You can monitor the archive log files.



SQL> SELECT SEQUENCE#,FIRST_TIME,NEXT_TIME FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;

 

Monday, October 5, 2015

ORA-01102 cannot mount database in exclusive




The Oracle docs note this on the ora-01102 error:
ORA-01102 cannot mount database in EXCLUSIVE mode
 
Cause: Some other instance has the database mounted exclusive or shared.
Action: Shut down the other instance or mount in a compatible mode.
 
 
 
 
 
POSSIBLE SOLUTION:
 

      Verify that the database was shutdown cleanly by doing the following:

1. Verify that there is not a "sgadef<sid>.dbf" file in the directory
"ORACLE_HOME/dbs".

% ls $ORACLE_HOME/dbs/sgadef<sid>.dbf

If this file does exist, remove it.

% rm $ORACLE_HOME/dbs/sgadef<sid>.dbf

2. Verify that there are no background processes owned by "oracle"

% ps -ef | grep ora_ | grep $ORACLE_SID

If background processes exist, remove them by using the Unix
command "kill". For example:

% kill -9 <Process_ID_Number>

3. Verify that no shared memory segments and semaphores that are owned
by "oracle" still exist

% ipcs -b

If there are shared memory segments and semaphores owned by "oracle",
remove the shared memory segments

% ipcrm -m <Shared_Memory_ID_Number>

and remove the semaphores

% ipcrm -s <Semaphore_ID_Number>

NOTE: The example shown above assumes that you only have one
database on this machine. If you have more than one
database, you will need to shutdown all other databases
before proceeding with Step 4.

4. Verify that the "$ORACLE_HOME/dbs/lk<sid>" file does not exist

5. Startup the instance

Solaris 10/Oracle: Fixing ORA-27102: out of memory Error

Solaris 10/Oracle: Fixing ORA-27102: out of memory Error
Symptom:

As part of a database tuning effort you increase the SGA/PGA sizes; and Oracle greets with an ORA-27102: out of memory error message. The system had enough free memory to serve the needs of Oracle.
SQL> startup
ORA-27102: out of memory
SVR4 Error: 22: Invalid argument

Diagnosis
$ oerr ORA 27102
27102, 00000, "out of memory"
// *Cause: Out of memory
// *Action: Consult the trace file for details

Not so helpful. Let's look the alert log for some clues.
% tail -2 alert.log
WARNING: EINVAL creating segment of size 0x000000028a006000
fix shm parameters in /etc/system or equivalent

Oracle is trying to create a 10G shared memory segment (depends on SGA/PGA sizes), but operating system (Solaris in this example) responded with an invalid argument (EINVAL) error message. There is a little hint about setting shm parameters in /etc/system.

Prior to Solaris 10, shmsys:shminfo_shmmax parameter has to be set in /etc/system with maximum memory segment value that can be created. 8M is the default value on Solaris 9 and prior versions; where as 1/4th of the physical memory is the default on Solaris 10 and later. On a Solaris 10 (or later) system, it can be verified as shown below:
% prtconf | grep Mem
Memory size: 32760 Megabytes

% id -p
uid=59008(oracle) gid=10001(dba) projid=3(default)

% prctl -n project.max-shm-memory -i project 3
project: 3: default
NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
project.max-shm-memory
        privileged      7.84GB      -   deny                                 -
        system          16.0EB    max   deny                                 -

Now it is clear that the system is using the default value of 8G in this scenario, where as the application (Oracle) is trying to create a memory segment (10G) larger than 8G. Hence the failure.

So, the solution is to configure the system with a value large enough for the shared segment being created, so Oracle succeeds in starting up the database instance.

On Solaris 9 and prior releases, it can be done by adding the following line to /etc/system, followed by a reboot for the system to pick up the new value.

set shminfo_shmmax = 0x000000028a006000
However shminfo_shmmax parameter was obsoleted with the release of Solaris 10; and Sun doesn't recommend setting this parameter in /etc/system even though it works as expected.

On Solaris 10 and later, this value can be changed dynamically on a per project basis with the help of resource control facilities . This is how we do it on Solaris 10 and later:
% prctl -n project.max-shm-memory -r -v 10G -i project 3

% prctl -n project.max-shm-memory -i project 3
project: 3: default
NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
project.max-shm-memory
        privileged      10.0GB      -   deny                                 -
        system          16.0EB    max   deny                                 -

Note that changes made with the prctl command on a running system are temporary, and will be lost when the system is rebooted. To make the changes permanent, create a project with projadd command and associate it with the user account as shown below:
% projadd -p 102  -c 'eBS benchmark' -U oracle -G dba  -K 'project.max-shm-memory=(privileged,10G,deny)' OASB
% usermod -K project=OASB oracle

Finally make sure the project is created with projects -l or cat /etc/project commands.
% projects -l
...
...
OASB
        projid : 102
        comment: "eBS benchmark"
        users  : oracle
        groups : dba
        attribs: project.max-shm-memory=(privileged,10737418240,deny)

% cat /etc/project
...
...
OASB:102:eBS benchmark:oracle:dba:project.max-shm-memory=(privileged,10737418240,deny)

With these changes, Oracle would start the database up normally.
SQL> startup
ORACLE instance started.

Total System Global Area 1.0905E+10 bytes
Fixed Size                  1316080 bytes
Variable Size            4429966096 bytes
Database Buffers         6442450944 bytes
Redo Buffers               31457280 bytes
Database mounted.
Database opened.

ORA-01031: insufficient privileges



ORA-01031: insufficient privileges


Cause: An attempt was made to change the current username or password without the appropriate privilege. This error also occurs if attempting to install a database without the necessary operating system privileges. When Trusted Oracle is configure in DBMS MAC, this error may occur if the user was granted the necessary privilege at a higher label than the current login.

Action: Ask the database administrator to perform the operation or grant the required privileges. For Trusted Oracle users getting this error although granted the appropriate privilege at a higher label, ask the database administrator to re-grant the privilege at the appropriate label. 
 


I resolved this issue to add oinstall group in /etc/group in solaris and oracle user part of this group.

 

Thursday, September 17, 2015

How to Remove Oracle 12c EM Express



How to Remove 12c EM Express


SQL> exec DBMS_XDB_CONFIG.sethttpsport(0);
or
SQL> exec DBMS_XDB_CONFIG.sethttpsport(null);


But this Functionality currently is not working Due to Bug 17535882 : DBMS_XDB_CONFIG.SETHTTPSPORT(0): ORA-30952: ILLEGAL CONFIGURATION OF HTTP/HTTPS ,

Which was closed as Duplicate of unpublished Bug 17213197 : ORA-44718: PORT CONFLICT IN XDB CONFIGURATION FILE LEADS TO INSTANCE CRASH
which will be Fixed in 12.1.0.2.0 Patchset and 12.2 Base Release.
Please Apply Patch 17213197 if available or upgrade to the Patchset where Bug 17213197 is fixed .

or You can use any of the following workarounds to unset the HTTPS port :

1- Remove The <sid>XDB Dispatcher setting :


SQL> alter system set dispatchers='';

System altered.

SQL> select name from V$DISPATCHER;

NAME
----
D000

SQL> ALTER SYSTEM SHUTDOWN 'D000';

System altered.

The Dispatcher stops accepting new connections and will wait until all of the sessions it handles are disconnected before shutting down.

SQL> ALTER SYSTEM SHUTDOWN IMMEDIATE 'D000';

System altered.

The IMMEDIATE keyword stops the Dispatcher from accepting new connections and immediately terminates all existing connections through that Dispatcher. After all sessions are cleaned up, the Dispatcher process shuts down.

2- Block the Current used Port from the OS level
.

Oracle 12c EM Express Configuration




Configure EM Express Port


SQL> select dbms_xdb_config.gethttport from dual;   (for http)

(0)

SQL> select dbms_xdb_config.gethttsport from dual;  (for https)

(0)



SQL> exec DBMS_XDB_CONFIG.setHTTPsport(5500);




SQL> exec DBMS_XDB_CONFIG.setHTTPport(1200);





SQL> select dbms_xdb_config.gethttport from dual;   (for http)

(1200)

SQL> select dbms_xdb_config.gethttsport from dual;  (for https)

(5500)



https://ora12.5500/em
http://ora12.1200/em



 

Wednesday, September 16, 2015

Authentication Refused: Bad Ownership or Modes for Directory /ora/oracle





I trying to install Oracle 12c RAC on Oracle Linux 6.


While configure SSH on both nodes getting error below

# /var/log/secure


Authentication Refused: Bad Ownership or Modes for Directory /ora/oracle



# chown oracle:oinstall /ora
# chown oracle:oinstall /ora/oracle

$ chmod go-w /ora
$ chmod go-w /ora/oracle
$ chmod 700   /ora/oracle/.ssh
$ chmod 600  /ora/oracle/.ssh/authorized_keys


# service ssh restart


$ ssh rac01 date
Thu sep 17 01:56:11 AST 2015
$ssh rac02 date
Thu sep 17 01:56:11 AST 2015


$ ssh rac02 date
Thu sep 17 01:56:11 AST 2015
$ssh rac01 date
Thu sep 17 01:56:11 AST 2015

Monday, August 3, 2015

ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below



RMAN> run {

2> allocate channel ch00 type 'SBT_TAPE';

3> send 'NB_ORA_CLIENT=lh-ora-rs';

4> recover database;

5> release channel ch00;

6> }

allocated channel: ch00

channel ch00: sid=1987 devtype=SBT_TAPE

channel ch00: Veritas NetBackup for Oracle - Release 7.6 (2014102721)

sent command to channel: ch00

Starting recover at 03-AUG-15

starting media recovery

Oracle Error:

ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below

ORA-01194: file 1 needs more recovery to be consistent

ORA-01110: data file 1: '/ora_dat/ssaerp/system01.dbf'

released channel: ch00

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of recover command at 08/03/2015 14:06:59

RMAN-06053: unable to perform media recovery because of missing log

RMAN-06025: no backup of log thread 1 seq 105266 lowscn 3956325323 found to rest ore

RMAN-06025: no backup of log thread 1 seq 105265 lowscn 3956321064 found to rest ore



I moved archive log files from production to Development server and try to recover database.


RMAN> run {

2> allocate channel t1 type disk;

3> recover database;

4> release channel t1;

5> }

allocated channel: t1

channel t1: sid=1987 devtype=DISK

Starting recover at 03-AUG-15

starting media recovery

archive log thread 1 sequence 105265 is already on disk as file /ora_dat/ssaerp/ archive1/1_105265_694624922.dbf

archive log thread 1 sequence 105266 is already on disk as file /ora_dat/ssaerp/ archive1/1_105266_694624922.dbf

Oracle Error:

ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below

ORA-01194: file 1 needs more recovery to be consistent

ORA-01110: data file 1: '/ora_dat/ssaerp/system01.dbf'

released channel: t1

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of recover command at 08/03/2015 14:13:32

RMAN-06053: unable to perform media recovery because of missing log

RMAN-06102: no channel to restore a backup or copy of log thread 1 seq 105264 lo wscn 3956321028

RMAN-06102: no channel to restore a backup or copy of log thread 1 seq 105263 lo wscn 3956315146

RMAN-06102: no channel to restore a backup or copy of log thread 1 seq 105262 lo wscn 3956283401

RMAN> run {

2> allocate channel t1 type disk;

3> recover database;

4> release channel t1;

5> }

allocated channel: t1

channel t1: sid=1987 devtype=DISK

Starting recover at 03-AUG-15

starting media recovery

archive log thread 1 sequence 105262 is already on disk as file /ora_dat/ssaerp/archive1/1_105262_694624922.dbf

archive log thread 1 sequence 105263 is already on disk as file /ora_dat/ssaerp/archive1/1_105263_694624922.dbf

archive log thread 1 sequence 105264 is already on disk as file /ora_dat/ssaerp/archive1/1_105264_694624922.dbf

archive log thread 1 sequence 105265 is already on disk as file /ora_dat/ssaerp/archive1/1_105265_694624922.dbf

archive log thread 1 sequence 105266 is already on disk as file /ora_dat/ssaerp/archive1/1_105266_694624922.dbf

archive log filename=/ora_dat/ssaerp/archive1/1_105262_694624922.dbf thread=1 sequence=105262

archive log filename=/ora_dat/ssaerp/archive1/1_105263_694624922.dbf thread=1 sequence=105263

archive log filename=/ora_dat/ssaerp/archive1/1_105264_694624922.dbf thread=1 sequence=105264

archive log filename=/ora_dat/ssaerp/archive1/1_105265_694624922.dbf thread=1 sequence=105265

archive log filename=/ora_dat/ssaerp/archive1/1_105266_694624922.dbf thread=1 sequence=105266

archive log filename=/ora_dat/ssaerp/archive1/1_105267_694624922.dbf thread=1 sequence=105267

archive log filename=/ora_dat/ssaerp/archive1/1_105268_694624922.dbf thread=1 sequence=105268

archive log filename=/ora_dat/ssaerp/archive1/1_105269_694624922.dbf thread=1 sequence=105269

archive log filename=/ora_dat/ssaerp/archive1/1_105270_694624922.dbf thread=1 sequence=105270

archive log filename=/ora_dat/ssaerp/archive1/1_105271_694624922.dbf thread=1 sequence=105271

archive log filename=/ora_dat/ssaerp/archive1/1_105272_694624922.dbf thread=1 sequence=105272

archive log filename=/ora_dat/ssaerp/archive1/1_105273_694624922.dbf thread=1 sequence=105273

archive log filename=/ora_dat/ssaerp/archive1/1_105274_694624922.dbf thread=1 sequence=105274

archive log filename=/ora_dat/ssaerp/archive1/1_105275_694624922.dbf thread=1 sequence=105275

archive log filename=/ora_dat/ssaerp/archive1/1_105276_694624922.dbf thread=1 sequence=105276

archive log filename=/ora_dat/ssaerp/archive1/1_105277_694624922.dbf thread=1 sequence=105277

archive log filename=/ora_dat/ssaerp/archive1/1_105278_694624922.dbf thread=1 sequence=105278

unable to find archive log

archive log thread=1 sequence=105279

released channel: t1

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of recover command at 08/03/2015 14:25:51

RMAN-06054: media recovery requesting unknown log: thread 1 seq 105279 lowscn 3956590616





RMAN> alter database open resetlogs;

database opened

RMAN>