Saturday 4 March 2017

PRCD-1120 : The resource for database RAC could not be found.

:While trying to start  the Oracle database for the first time in Rac cluster (11gR2) getting below error.:


$ srvctl start database -d racdb
PRCD-1120 : The resource for database racdb could not be found.
PRCR-1001 : Resource ora.racdb.db does not exist

Cause: The database and its instance is not registered with CRS . 

Solution: Register the Database and instance in CRS . Follow the below steps to register with CRS

$ srvctl add database -d racdb -o /u01/app/oracle/product/11.2.0.4/dbhome_2
$ srvctl config database -d racdb
Database unique name: racdb
Database name:
Oracle home: /u01/app/oracle/product/11.2.0.4/dbhome_2
Oracle user: oracle
Spfile:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: racdb
Database instances:
Disk Groups:
Mount point paths:
Services:
Type: RAC
Database is administrator managed

Now try to bring up the Database.

 $ srvctl start database -d racdb

PRKO-3119 : Database racdb cannot be started since it has no configured instances.

 $ srvctl add instance -d racdb -i racdb1 -n node1
 $ srvctl add instance -d racdb -i racdb2 -n node2

 $ srvctl config database -d racdb
Database unique name: racdb
Database name:
Oracle home: /u01/app/oracle/product/11.2.0.4/dbhome_2
Oracle user: oracle
Spfile:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: racdb
Database instances: racdb1,racdb2
Disk Groups:
Mount point paths:
Services:
Type: RAC
Database is administrator managed

$ srvctl start database -d racdb

$ srvctl status database -d racdb

Instance racdb1 is running on node node1

Instance racdb2 is running on node node2

Tuesday 14 February 2017

Agent is out-of-sync with repository. This most likely means that the agent was reinstalled or recovered.


Check the status of the agent

$<AGENT_HOME>/bin>./emctl status  agent


---------------------------------------------------------------------------------------------------
Last successful upload                       : (none)
Last attempted upload                        : 2016-12-31 07:38:38
Total Megabytes of XML files uploaded so far : 0
Number of XML files pending upload           : 4
Size of XML files pending upload(MB)         : 0
Available disk space on upload filesystem    : 95.31%
Collection Status                            : Collections enabled
Heartbeat Status                             : Agent is blocked
Blocked Reason         : Agent is out-of-sync with repository. This most likely means that the agent was reinstalled or recovered. Please contact an EM administrator to unblock the agent by performing an agent resync from the console.
Last attempted heartbeat to OMS              : 2017-02-01 08:05:31
Last successful heartbeat to OMS             : (none)
Next scheduled heartbeat to OMS              : 2017-02-01 08:08:31

---------------------------------------------------------------
Agent is Running and Ready


1. Stop the agent in  target server.
<AGENT_HOME>/bin>./emctl stop agent

2. Ensure that there are no emagent processes on the target  server

$ps -ef|grep emagent

If you see any process, please kill all of them.
Kill -9 <PID>

3. Login to the repository database as SYSMAN user and execute the following query to clean up the old agent:

SQL>exec mgmt_admin.cleanup_agent('<hostname.domainname>:<port>');

4. After cleaning up the agent from repository,
   Please remove the files in target server (Don't delete  anything in Repository server)from the following locations:
  
    AGENT_HOME/sysman/emd/state/
    AGENT_HOME/sysman/emd/recv/
    AGENT_HOME/sysman/emd/upload/
    AGENT_HOME/sysman/log/

5. Start the agent:

<AGENT_HOME>/bin>./emctl start agent

6. Secure the Agent

<AGENT_HOME>/bin>./emctl secure agent
Please provide password 



Tuesday 3 January 2017

ORA-32771: cannot add file to bigfile tablespace



Bigfile Tablespaces:
 A bigfile tablespace is a tablespace with only a single datafile which can grow upto terabytes based on Tablespace block size. Traditional small file tablespaces contain multiple datafiles, but the files cannot be as large.


Benefits of Bigfile Tablespaces:
  • Bigfile tablespaces can significantly increase the storage capacity of an Oracle database. Smallfile tablespaces can contain up to 1024 files but bigfile tablespaces contain only one file that can be 1024 times larger than a smallfile tablespace. The total tablespace capacity is the same for smallfile tablespaces and bigfile tablespaces. However, because there is limit of 64K datafiles for each database, a database can contain 1024 times more bigfile tablespaces than smallfile tablespaces, so bigfile tablespaces increase the total database capacity by 3 orders of magnitude. In other words, 8 exabytes is the maximum size of the Oracle database when bigfile tablespaces are used with the maximum block size (32 k).

  • Bigfile tablespaces simplify management of datafiles in ultra large databases by reducing the number of datafiles needed. You can also adjust parameters to reduce the SGA space required for datafile information and the size of the control file.

  • They simplify database management by providing datafile transparency.
Considerations with Bigfile Tablespaces
  • Bigfile tablespaces are intended to be used with Automatic Storage Management or other logical volume managers that support dynamically extensible logical volumes and striping or RAID.
  • Avoid creating bigfile tablespaces on a system that does not support striping because of negative implications for parallel execution and RMAN backup parallelization.
  • Avoid using bigfile tablespaces if there could possibly be no free space available on a disk group, and the only way to extend a tablespace is to add a new datafile on a different disk group.
  • Using bigfile tablespaces on platforms that do not support large file sizes is not recommended and can limit tablespace capacity. Refer to your operating system specific documentation for information about maximum supported file sizes.
  • Performance of database opens, checkpoints, and DBWR processes should improve if data is stored in bigfile tablespaces instead of traditional tablespaces. However, increasing the datafile size might increase time to restore a corrupted file or create a new datafile.


Creating a Bigfile Tablespace:

SQL> CREATE BIGFILE TABLESPACE BIGTBS DATAFILE '/u02/oracle/data/bigtbs01.dbf' SIZE 50G;

Add space to Bigfile tablespace:

SQL > ALTER TABLESPACE BIGTBS RESIZE 100G;

Common Errors:

SQL> ALTER TABLESPACE bigtbs
           ADD DATAFILE '/u02/oracle/data/bigtbs02.dbf' size 30G;
      ALTER TABLESPACE bigtbs
      *
      ERROR at line 1:
      ORA-32771: cannot add file to bigfile tablespace
 
SQL> ALTER DATABASE DATAFILE ‘/u02/oracle/data/bigtbs01.dbf' resize 100G;
    
       ERROR at line 1:
      ORA-XXXX: cannot resize data file for bigfile tablespace
 

Note: A Bigfile tablespace contain only onc datafile so you can only resize the existing datafile by mentioning tablespace name only ,not the datafile . Please find below the example.

SQL > ALTER TABLESPACE BIGTBS RESIZE 100G;

Identifying a Bigfile Tablespace:
   
DBA_TABLESPACES view provide information if a tablespace is Bigfile Tablespace.

SQL> select TABLESPACE_NAME, BIGFILE from DBA_TABLESPACES;

     TABLESPACE_NAME                BIGFILE
     -----------------------------        - ---------
     ...
     USERS                                SMALLFILE
     BIGTBS                                BIGFILE






References:
http://docs.oracle.com/cd/E11882_01/server.112/e25494/tspaces.htm#ADMIN13316