Posts

Showing posts with the label 11g new feature

rename column example in 11g database

SQL> desc emp; Name Null? Type ----------------------------------------- -------- EMPNO NOT NULL NUMBER(4) ENAME VARCHAR2(10) JOB VARCHAR2(9) MGR NUMBER(4) HIREDATE DATE SAL NUMBER(7,2) COMM NUMBER(7,2) DEPTNO NUMBER(2) SQL> alter table emp rename column sal to salary; Table altered. SQL> desc emp; Name Null? Type ----------------------------------------- -------- ------------------------ EMPNO NOT NULL NUMBER(4) ENAME VARCHAR2(10) JOB VARCHAR2(9) MGR NUMBER(4) HIREDATE DATE SALARY NUMBER(7,2) COMM NUMBER(7,2) DEPTNO NUMBER(2) SQL>

sshUserSetup.sh in 11gr2 (Setup ssh for RAC)

Image
I was just exploring the 11g software CD and found very interesting script. sshUserSetup.sh , While RAC installation to create the user equivalence this script will be very useful. running keygen and scp is a boring task. This script makes your life easy. cd -mount-/oracle/sshsetup sshUserSetup.sh -hosts "host1 host2" -user oracle -advanced ========================================================================== Script Location [root@rac1 database]# ls -ltr total 36 -rwxr-xr-x 1 root root 3226 Aug 15 2009 runInstaller drwxr-xr-x 2 root root 4096 Aug 15 2009 rpm drwxr-xr-x 4 root root 4096 Aug 15 2009 install drwxr-xr-x 14 root root 4096 Aug 15 2009 stage drwxrwxr-x 2 root root 4096 Aug 15 2009 sshsetup drwxrwxr-x 2 root root 4096 Aug 15 2009 response drwxr-xr-x 12 root root 4096 Aug 17 2009 doc -rw-r--r-- 1 root root 5402 Aug 17 2009 welcome.html [root@rac1 database]# pwd /data3/database [root@rac1 database]# cd sshsetup [root@rac1 sshsetup]# ls ssh...

Oracle Enterprise Manager 11g : Step by Step clone using 11g DB console.

Image
11g OEM (I tested with DB console ) has made the cloning very easy. You can achieve this in only 6 steps. Oracle Database 11g extends the well-known duplicate database command  to let you duplicate a database over the network without any need for prior backups of the source database. This feature is called active database duplication or networkaware database duplication. Using the active duplication method, you can duplicate a live or active database, with a minimal network and CPU overhead. You can perform the duplication on the same or a different server in your network. You don’t need to make any copies of the source database, which saves you time and storage space. You can use active database duplication techniques to clone a database or create a standby database. We can use RMAN to achieve this. with RMAN we need to write a lot of commands.on rman , Best is to use OEM. Command line option: RMAN> duplicate database to dupdb  from active database  ..........

QUIESCE / SUSPEND vs startup restrict

We can QUIESCE and SUSPEND the database , This helps in performing the maintainance oprations. You nee need to restart the database to open it in restricted mode. QUIESCE:quiescing the database. Pre-req enable the Database Resource Manager RESOURCE_MANAGER_PLAN : Defined in init.ora SQL> alter system quiesce restricted; System altered. - Only current command completed. - No new connections allowed. -New queries or attempted logins will appear to hang until you unquiesce the database. - select Active_State from V$INSTANCE; --This will tell you the status. The Active_State NORMAL (unquiesced), QUIESCING (active non- DBA sessions are still running), QUIESCED To unquiesce the database: SQL> alter system unquiesce; system altered. This will be logged in alert_log file. 2010-04-11 11:25:55.146000 +01:00 Database in quiesce mode 2010-04-11 11:28:07.898000 +01:00 Database out of quiesce mode Suspending the database: -A suspended database performs no ...

Few Important init.ora parameters for 11g database

Important init.ora parameters for 11g database. Two new memory-related parameters— memory_target and memory_max_target —provide support for the new automatic memory management /*IMP: If you also set the sga_target and the pga_aggregate_target parameters, the database will consider them the minimum values for the SGA and PGA allocations of memory. The memory_target parameter can take a value anywhere between the sum of SGA and PGA to the high value set by the memory_max_target parameter. /* The plsql_code_type parameter lets you turn on PL/SQL native compilation : PL/SQL native compilation is very faster mechanism as compared to older. The diagnostic_dest parameter lets you set the ADR base directory.This parameter replaces the traditional background_dump_dest, user_ dump_dest, and core_dump_dest parameters. The diagnostic_dest parameter’s value defaults to $ORACLE_BASE. The diagnostic_dest parameter is recommended but not mandatory. If you do set this parameter, the data...

Oracle Configuration Manager is optional in 11gr2

Image
Oracle Configuration Manager The Oracle Configuration Manager, which gathers software configuration information, is integrated with the Oracle Universal Installer as an optional component. The Oracle Configuration Manager was previously called the Customer Configuration Repository (CCR). Its an optional component: you need to provide some information if you want to activate this for your database: If you donot provide the information: you will get a warning: Oracle provides Oracle Configuration Manager (OCM) with some of its programs. The OCM is a tool that assists in the collection and transmission of your configuration data to Oracle to enable us to respond more efficiently to your service requests. The OCM tool will connect to Oracle over the internet. You may not receive a separate notice upon connection. You may turn the OCM tool off, however we strongly discourage this as it impedes our ability to provide services to you. More information on the tool is available at...

11g r2 3 additional patches on AIX 5 and 3 addition on AIX 6

Image
I was trying to 11gr2 on AIX 5 (64bit) and found that we need to apply 3 additional patches for the installation. This is how can we check if the 11gr2 required patches on AIX. /usr/sbin/instfix -i -k "IZ42940 IZ49516 IZ52331 " If not installed you will get an output like this. 11g/app/product/11.1.0/db_1>/usr/sbin/instfix -i -k "IZ42940 IZ49516 IZ52331 " There was no data for IZ42940 in the fix database. There was no data for IZ49516 in the fix database. There was no data for IZ52331 in the fix database. The install guide talks about this. AIX http://download.oracle.com/docs/cd/E11882_01/install.112/e10854/pre_install.htm#BABFDGHJ Authorized Problem Analysis Reports (APARs) for AIX 5L: IZ42940 IZ49516 IZ52331 Authorized Problem Analysis Reports (APARs) for AIX 6L: IZ41855 IZ51456 IZ52319 In order to apply these patches you can download from http://www-933.ibm.com/support/fixcentral/ Additional information if you are trying...

11g Downgrading a Database

Downgrading a Database You can easily downgrade a database back to the release from which you upgraded it to the Oracle Database 11g release. Here are the steps: 1. Shut down the database and start it up in the downgrade mode. SQL> startup downgrade 2. Spool the results of the downgrade script. SQL> spool downgrade.log 3. Execute the downgrade script, called catdwgrd.sql. SQL> @catdwgrd.sql 4. After the catdwgrd.sql script finished executing, shut down the database cleanly. SQL> shutdown immediate5. Start up the database in the upgrade mode, from the pre-upgrade ORACLE_ HOME environment. SQL> startup upgrade 6. Reload the old PL/SQL packages and data dictionary views. SQL> @catrelod.sql 7. After the reloading of the old packages and views, shut down the database and restart it. SQL> shutdown immediate SQL> startup 8. Run the utlrp.sql script to recompile any packages, procedures, and types that became invalid during the downgrading of the dat...

11g , Upgrading Using the Manual Method : Scripts explained

You use Oracle-supplied pre- and postupgrade scripts to upgrade to Oracle Database 11g. You can find all these scripts in the ORACLE_HOME/rdbms/admin directory. There is a different set of upgrade scripts you must use, depending on the release number of the database you’re upgrading from. In this example, I’m upgrading from an Oracle Database 10g release database to Oracle Database 11g and would need to use the scripts utlu111i.sql, catupgrd.sql,utilu111s.sql, catuppst.sql, and utlrp.sql to perform the manual upgrade. Following is a summary of the functions performed by each of the upgrade scripts: ■ utlu111i.sql This script, also known as the Pre-Upgrade Information Tool,gathers information from the database and analyzes it to make sure that it meets all the upgrade requirements, such as whether the database already contains the SYSAUX tablespace or not. As you know, a pre–Oracle Database 10g database doesn’t have a SYSAUX tablespace; therefore, the Pre-Upgrade Information Tool w...

11g Upgrade path

Image
Depending on your current database release, you may or may not be able to directly upgrade to the Oracle Database 11g Release 1 (11.1) version ■ 7.3.3 (or lower) => 7.3.4 => 9.2.0.8 => 11.1 ■ 8.0.5 (or lower) => 8.0.6 => 9.2.0.8 => 11.1 ■ 8.1.7 (or lower) => 8.1.7.4 => 9.2.0.8 => 11.1 ■ 9.0.1.3 (or lower) => 9.0.1.4 => 9.2.0.8 => 11.1 ■ 9.2.0.3 (or lower) => 9.2.0.8 => 11.1    

Flash Cache 11g new feature

Image
A transparent extension of the database buffer cache using solid-state disk (SSD) technology Consider adding the flash cache when all of the following are true: Your database is running on the Solaris or Oracle Enterprise Linux operating systems. The flash cache is supported on these operating systems only. The Buffer Pool Advisory section of your Automatic Workload Repository (AWR) report or STATSPACK report indicates that doubling the size of the buffer cache would be beneficial. db file sequential read is a top wait event. You have spare CPU. How it works : Flash Cache in an Oracle Real Applications Clusters Environment You must configure a flash cache on either all or none of the instances in an Oracle Real Application Clusters environment. Install Flash Drive in the Host Server Set two init.ora parameters: db_flash_cache_file = Specifies the path to the flash disk db_flash_cache_size= Specifies the amount of flash disk to use

System Partitioning in 11g

SQL> create table test (c1 number,c2 integer) 2 partition by system 3 (partition p1, partition p2,partition p3); Table created. SQL> select table_name,partition_name from dba_tab_partitions where table_name='TEST'; TABLE_NAME PARTITION_NAME ----------------------------- ------------------------------ TEST P1 TEST P2 TEST P3 SQL> alter table test merge partitions p1,p2 into partition p; Table altered. SQL> select table_name,partition_name from dba_tab_partitions where table_name='TEST'; TABLE_NAME PARTITION_NAME ----------------------------- ------------------------------ TEST P3 TEST P SQL> alter table test merge partitions p,p3 into partition p; Table altered. SQL> select table_name,partition_name from dba_tab_partitions where table_name='TEST'; TABLE_NAME PARTITION_NAME ------------------------------ ------------------------------ TEST P SQL> insert into test values ('ABC','123'); insert into tes...

Oracle Enterprise Manager 11g

Representing years of research, planning, and development, Oracle Enterprise Manager 11g is set to be unveiled on April 22 by Oracle President Charles Phillips. If you are in the New York area, join Oracle President Charles Phillips and Oracle Senior Vice President Richard Sarwal for the launch of Oracle Enterprise Manager 11g. You can register here: http://bit.ly/bqUskZ It's also possible to show your interest or even if your attending at this LinkedIn event. http://events.linkedin.com/Oracle-Enterprise-Manager-11g-Launch-New/pub/258070 If you're not able to attende the Live event, don't worry about that, we will be live broadcasting it. You can register for that live webcast from this page: http://bit.ly/9Qnh5f More information can be found at    LinkedIn Group: Official Oracle Enterprise Manager group The official, made by Oracle, Oracle Enterprise Manager group, where you can find all the news around Enterprise Manager and connect with peers

ORA-01466: unable to read data - table definition has changed

I was testing "TOTAL RECALL" in 11g release 2 and found very interesting thing.... addition of any constraint on a table (e.g Primary Key)  will cause you to be unable to automatically read the historical data. I am working on 11gr2 and I am able to drop a column for a table which is being tracked in Total Recall. SQL> select TABLE_NAME,OWNER_NAME from DBA_FLASHBACK_ARCHIVE_TABLES; TABLE_NAME OWNER_NAME ------------------------------ ------------------------------ T RECALL Elapsed: 00:00:00.37 SQL> alter table recall.t drop column status; Table altered. Elapsed: 00:02:32.61 SQL> Bug or expected behaviour ? flashback data archive example of ORA-01466 SQL> create tablespace recall; Tablespace created. SQL> select FILE_NAME,BYTES/1024/1024 from dba_data_files where tablespace_name='RECALL'; FILE_NAME BYTES/1024/1024 ------------------------------------------------------------ --------------- +DATA/rac1db/datafile/recall.27...

root.sh after 11gr2 grid infrastructure install on standalone server

[root@rac1 grid]# ./root.sh Running Oracle 11g root.sh script... The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/product/11.2.0/grid Enter the full pathname of the local bin directory: [/usr/local/bin]: The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y Copying dbhome to /usr/local/bin ... The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y Copying oraenv to /usr/local/bin ... The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y Copying coraenv to /usr/local/bin ... Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root.sh script. Now product-specific root actions will be performed. 2010-03-27 18:41:34: Checking for super user privileges 2010-03-27 18:41:34: User has super user privileges 2010-03-27 18:41:...

How to check if the provided patch is an online patch. (rdbms patch)

How to check if the provided patch is an online patch. (rdbms patch) This can be applied while your database is running. cd $ORACLE_HOME/Opatch/opatch query is_online_patch 'dir' You will get the output . .. .. Patch is a online patch : True If this is true you can go ahead and do opatch apply

Transparent Data Encryption (TDE) is NOT about access control.

Transparent Data Encryption (TDE) is NOT about access control. This is to protect the data access from OS files. If someone has access to OS datafiles, with some utilities DBFs data can be read in text format. Transparent Data Encryption (TDE) : in 10g  :We need to configure encryption on a column-by-column basis. in 11g: We can do Tablespace encryption  instead of column-by-column. Encryption algorithm can have one of the following values: 3DES168, AES128,AES192,AES256 The key lengths are included in the names of the algorithms themselves. If no encryption algorithm is specified, the default encryption algorithm is used. The default encryption algorithm is AES128. 1)We cannot use Tablespace encryption  for SYSTEM, SYSAUX, UNDO and TEMP tablespaces 2)We need to create new tablespace for encrption as Existing tablespace cannot be encrypted 3)An issue with any encryption method is the negative impact on performance. 4)SELECT  encrypted FROM dba_tablesp...

Shrinking a Locally Managed Temporary Tablespace

in 11g database, You can shrink the temporary tablespace by command alter tablespace temp shrink space; Earlier, large sort operations by Oracle database were causing the temporary table space to grow to a higher value and space once allocated was not being released. in 11g we can shrink the temporary tablespace. Also, we can limit the size of temporary tablespace by KEEP command. ALTER TABLESPACE temp SHRINK SPACE KEEP 200M; OR shrink the tempfile. ALTER TABLESPACE temp SHRINK TEMPFILE '/sandeep/dbfs/temp.dbf';

alter index abc rebuild online;

11g new feature : index rebuild online. In Oracle Database 11g, the online rebuild is truly online: it does not hold an exclusive lock. The DMLs are not affected.  It does so by tracking which blocks are being accessed and at the end merging these blocks with the newly built index.

Read-Only Tables in 11g

We can now make a table read only in database (11g new feature). ALTER TABLE ABC READ ONLY; If someone try any DML on ABC table he will get this error ORA-12081: update operation not allowed on table SCHEMA.ABC. To check if the table is read only , select read_only from user_tables where table_name='ABC'; ALTER TABLE ABC READ WRITE;  --> this will change the readonly mode of table and DML can be performed on this now.   No need to worry about who has select,insert,update,delete on table, If you want to make sure that data is read only, You can make the table readonly.   Enjoy...I am sure this is a great feature...and will help DBA/developers a lot to protect the data (Like refrence data)