Category: Database

  • Oracle Database 12c is now GA… (Finally!!)

    Oracle Database 12c is released today [June 25]… there is a wealth of new features in 12c database, most major ones were discussed by Oracle speakers in conferences since OOW 2012… The major feature is the introduction of container databases and pluggable databases.

    Database 12c software is available for download at OTN. Documentation is also available on OTN.

    Documentaion link:
    http://www.oracle.com/pls/db121/portal.portal_db?selected=1&frame=#new_to_oracle_database_12c

    Software download link:
    http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html

    I was lucky to be part of the Oracle12c Database beta program… In the coming weeks I will be sharing new feature information in this blog [after making sure they are the same in the GA release as well 🙂 ]. Stay tuned…

    A good place to start knowing Oracle Database 12c features and changes is Oracle Documentation… Start with the  new features guide at
    http://docs.oracle.com/cd/E16655_01/server.121/e17906/chapter1.htm#NEWFTCH1

    Enjoy DB12C…

     

     

  • Registering a Database in Server Control (srvctl)

    Even if you are managing a non-RAC database, in 11g, it is recommended to use “srvctl” commands to start and stop the database. But, if the database is not created using DBCA or not upgraded using DBUA, the database will not be registered in the “Oracle Restart” configuration automatically.

    Oracle Restart monitors the services registered and restarts if there is an abnormal end or can stop and start the databases during server reboot. Please read Oracle Documentation to learn more about Oracle Restart.

    When the database is not configured in Oracle Restart, and if you attempt to start or query the configuration using srvctl, you will see this error.

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

    You may add the database to Oracle Restart configuration using the minimal set of parameters. For complete set of options and various srvctl options, please refer to Oracle Documentation. Here adding the database information with database name (-d option), the Oracle home location (-o option) and database parameter file (-p option). In the examples below, variables like $ORACLE_HOME, $TNS_ADMIN are used, they are setup prior. If the variables are not defined, use full path of the directory or name.

    $ srvctl add database -d myowndb -o $ORACLE_HOME -p $ORACLE_HOME/dbs/spfile$ORACLE_SID.ora

    To query the configuration use the following command. You may use the “srvctl modify” option to change any of the configuration item you see below. 

    $ srvctl config database -d $ORACLE_SID
    
    Database unique name: myowndb
    Database name:
    Oracle home: /u01/app/oracle/myowndb/11.2.0.3
    Oracle user: oracle
    Spfile: /u01/app/oracle/myowndb/11.2.0.3/dbs/spfilemyowndb.ora
    Domain:
    Start options: open
    Stop options: immediate
    Database role: PRIMARY
    Management policy: AUTOMATIC
    Database instance: myowndb
    Disk Groups:
    Services:

    When registering database, it would be appropriate to register the listener also. My recommendation is to register all the services in “Oracle Restart”. See here for all the components that can be registered with using “srvctl”.

    Below, listener is registered with Oracle Restart using the listener name (-l option), the port number (-p option) and the Oracle home location (-o option).

    $ srvctl add listener -l myowndb_myserver -p TCP:1525 -s -o $ORACLE_HOME

    Similar to the database configuration query, the listener configuration can be queried using “srvctl config” command.

    $ srvctl config listener -l myowndb_myserver
    
    Name: MYOWNDB_MYSERVER
    Home: /u01/app/oracle/myowndb/11.2.0.3
    End points: TCP:1525

    If you are not using the default location for listener.ora file, set the TNS_ADMIN value using the “setenv” option.

    $ srvctl setenv listener -l myowndb_myserver -T TNS_ADMIN=$TNS_ADMIN

    Similarly, if the database requires any special environment variable to be set before starting, using the “setenv” for database as well.

    $ srvctl setenv database -d $ORACLE_SID -T ORA_NLS10=$ORA_NLS10

    The “getenv” option shows the environment variables defined for the component.

     $ srvctl getenv listener -l myowndb_myserver
    
    MYOWNDB_MYSERVER:
    TNS_ADMIN=/u01/app/common_tns/myowndb_myserver

     

    $ srvctl getenv database -d $ORACLE_SID
    
    myowndb:
    ORA_NLS10=/u01/app/oracle/myowndb/11.2.0.3/nls/data/9idata