APPSINFODB – Information Technology Group

Finding Solutions for DBA's to smile…….!!!!!!! DBA its just not Administration, its core of customer’s data integrity

  • Blog Stats

    • 38,065 hits
  • Visitors

    free counters
  • Vistors Access

  • Calendar

    November 2017
    M T W T F S S
    « Dec    
     12345
    6789101112
    13141516171819
    20212223242526
    27282930  
  • Archives

  • Authors

Archive for the ‘Oracle 11g Database’ Category

Oracle database upgrade from 10g to 11g

Posted by appsinfo on August 20, 2012

Install Oracle 11g database software in different ORACLE_HOME from source Database

SOURCE

$ pwd
/u01/app/oracle/product/11.1/rdbms/admin
$ ls -lt utlu111i.sql
-rw-r–r– 1 oracle oinstall 138636 2009-07-20 09:01 utlu111i.sql
$ pwd
/u01/app/oracle/product/11.1/rdbms/admin
$ sqlplus /nolog
SQL*Plus: Release 10.2.0.4.0
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
SQL> spool utlu111_20_July_2009.lst

SQL> @utlu111i.sql
Oracle Database 11.1 Pre-Upgrade Information Tool 04-27-2009 09:29:25
.
**********************************************************************
Database:
**********************************************************************
–> name:dev
–> version: 10.2.0.4.0
–> compatible: 10.2.0.3.0
–> blocksize: 8192
–> platform: Linux x86 64-bit
–> timezone file: V4
.
**********************************************************************
Tablespaces: [make adjustments in the current environment]
**********************************************************************
–> SYSTEM tablespace is adequate for the upgrade.
…. minimum required size: 727 MB
…. AUTOEXTEND additional space required: 247 MB
–> UNDOTBS1 tablespace is adequate for the upgrade.
…. minimum required size: 473 MB
…. AUTOEXTEND additional space required: 443 MB
–> SYSAUX tablespace is adequate for the upgrade.
…. minimum required size: 425 MB
…. AUTOEXTEND additional space required: 175 MB
–> TEMP tablespace is adequate for the upgrade.
…. minimum required size: 61 MB
…. AUTOEXTEND additional space required: 41 MB
–> EXAMPLE tablespace is adequate for the upgrade.
…. minimum required size: 69 MB
.**********************************************************************
Update Parameters: [Update Oracle Database 11.1 init.ora or spfile]
**********************************************************************
WARNING: –> “sga_target” needs to be increased to at least 672 MB
.**********************************************************************
Renamed Parameters: [Update Oracle Database 11.1 init.ora or spfile]
**********************************************************************
— No renamed parameters found. No changes are required.
.**********************************************************************
Obsolete/Deprecated Parameters: [Update Oracle Database 11.1 init.ora or spfile]
**********************************************************************
–> “background_dump_dest” replaced by “diagnostic_dest”
–> “user_dump_dest” replaced by “diagnostic_dest”
–> “core_dump_dest” replaced by “diagnostic_dest”
.**********************************************************************
Components: [The following database components will be upgraded or installed]
**********************************************************************
–> Oracle Catalog Views [upgrade] VALID
–> Oracle Packages and Types [upgrade] VALID
–> JServer JAVA Virtual Machine [upgrade] VALID
–> Oracle XDK for Java [upgrade] VALID
–> Oracle Workspace Manager [upgrade] VALID
–> OLAP Analytic Workspace [upgrade] VALID
–> OLAP Catalog [upgrade] VALID
–> EM Repository [upgrade] VALID
–> Oracle Text [upgrade] VALID
–> Oracle XML Database [upgrade] VALID
–> Oracle Java Packages [upgrade] VALID
–> Oracle interMedia [upgrade] VALID
–> Spatial [upgrade] VALID
–> Data Mining [upgrade] VALID
–> Expression Filter [upgrade] VALID
–> Rule Manager [upgrade] VALID
–> Oracle OLAP API [upgrade] VALID
.
**********************************************************************
Miscellaneous Warnings
**********************************************************************
WARNING: –> Database contains stale optimizer statistics.
…. Refer to the 11g Upgrade Guide for instructions to update
…. statistics prior to upgrading the database.
…. Component Schemas with stale statistics:
…. SYS
…. OLAPSYS
…. SYSMAN
…. CTXSYS
…. XDB
…. MDSYS
WARNING: –> Database contains INVALID objects prior to upgrade.
…. USER PUBLIC has 1 INVALID objects.
…. USER SYS has 2 INVALID objects.
WARNING: –> Database contains schemas with objects dependent on network
packages.
…. Refer to the 11g Upgrade Guide for instructions to configure Network ACLs.
WARNING: –> EM Database Control Repository exists in the database.
…. Direct downgrade of EM Database Control is not supported. Refer to the
…. 11g Upgrade Guide for instructions to save the EM data prior to upgrade.

PL/SQL procedure successfully completed.

SQL> select * from v$timezone_file;
Note:
If time zone file version is less than 4 then apply time zone patch 5632264 manually

SQL> select object_name, owner, object_type from all_objects where status like ‘INVALID’;

SQL> select comp_name,version, status from dba_registry

COMP_NAME VERSION STATUS
————————————————– —————————— ——————————————–
Oracle Database Catalog Views                              10.2.0.4.0                VALID
Oracle Database Packages and Types                     10.2.0.4.0                VALID
Oracle Workspace Manager                                    10.2.0.4.3                VALID
JServer JAVA Virtual Machine                              10.2.0.4.0                VALID
Oracle XDK 10.2.0.4.0 VALID
Oracle Database Java Packages                               10.2.0.4.0                VALID
Oracle Expression Filter                                          10.2.0.4.0                VALID
Oracle Data Mining                                                 10.2.0.4.0                VALID
Oracle Text                                                              10.2.0.4.0                VALID
Oracle XML Database                                            10.2.0.4.0                VALID
Oracle Rules Manager                                             10.2.0.4.0                VALID
Oracle interMedia                                                    10.2.0.4.0                VALID
OLAP Analytic Workspace                                    10.2.0.4.0                VALID
Oracle OLAP API                                                  10.2.0.4.0                VALID
OLAP Catalog                                                        10.2.0.4.0                VALID
Spatial                                                                     10.2.0.4.0                VALID
Oracle Enterprise Manager                                      10.2.0.4.0                VALID

17 rows selected.

If you database using spfile, create pfile

SQL> create pfile from spfile ;
pfile will be created in 10g $ORACLE_HOME/dbs/init[SID].ora

a) Remove *.background_dump_dest, *.core_dump_dest, *.user_dump_dest and add
*.diagnostic_dest=’/11g_base’ (11g Base Directory)
b) Change
*.compatible=’10.2.0.1.0′
to
*.compatible=’11.1.0′
dev.__db_cache_size=377487360
dev.__java_pool_size=4194304
dev.__large_pool_size=4194304
dev.__shared_pool_size=142606336
dev.__streams_pool_size=0
*.control_files=’/u01/app/oracle/datafile/dev/control01.ctl’,’/u01/app/oracle/datafile/dev/control02.ctl’,’/u01/app/oracle/datafile/dev/control03.ctl’
*.db_block_size=8192
*.db_domain=’apt-amd-02′
*.db_file_multiblock_read_count=16
*.db_name=’dev’
*.dispatchers='(PROTOCOL=TCP) (SERVICE=devXDB)’
*.job_queue_processes=10
*.nls_language=’AMERICAN’
*.nls_territory=’AMERICA’
*.open_cursors=300
*.pga_aggregate_target=199229440
*.processes=150
*.remote_login_passwordfile=’EXCLUSIVE’
*.sga_target=536870912
*.undo_management=’AUTO’
*.undo_tablespace=’UNDOTBS1′
*.compatible=’11.1.0′
*.diagnostic_dest=’/u01/app/oracle/admin/dev/diagnostic’

$ mkdir -p /u01/app/oracle/admin/dev/diagnostic
$ cd /u01/app/oracle/admin/dev/
$ ls -lrt

total 8
drwxr-xr-x 2 oracle oinstall 6 2009-04-27 09:43 diagnostic
drwxr-x— 2 oracle oinstall 4096 2009-04-27 09:29 adump
drwxr-x— 2 oracle oinstall 4096 2009-04-27 09:20 udump
drwxr-x— 2 oracle oinstall 141 2009-04-27 09:20 bdump
drwxr-x— 2 oracle oinstall 35 2009-04-26 13:26 pfile
drwxr-x— 2 oracle oinstall 6 2009-04-26 13:20 cdump
drwxr-x— 2 oracle oinstall 6 2009-04-26 13:20 dpdump

Step 2: Upgrade Database

1. ***Shut down source database (10g) – Your downtime starts here ***

SQL> connect sys/sys as sysdba
Connected.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

2. Set your environment variables to Oracle Database 11g Release 1 (11.1):

export ORACLE_HOME=/u01/oracle/11gbase/11.1.0
export ORACLE_SID=TEST
export PATH=$ORACLE_HOME/bin:$PATH

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.1
export ORACLE_SID=dev
export PATH=$ORACLE_HOME/bin:$PATH:.
export LIBXCB_ALLOW_SLOPPY_LOCK=1
export TZ=GMT

3. Start Upgrade
$pwd
/home/oracle
$sqlplus / as sysdba

SQL*Plus: Release 11.1.0.6.0 – Production on Tue Apr 27 09:50:25 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to an idle instance.

SQL> startup upgrade pfile=’/tmp/initdev.ora’;
ORACLE instance started.

Total System Global Area 534462464 bytes
Fixed Size 2146112 bytes
Variable Size 150995136 bytes
Database Buffers 377487360 bytes
Redo Buffers 3833856 bytes
Database mounted.
Database opened.

Note: Check shared_pool & java_pool size, to set new values

SQL> spool upgrade_20July2009.log
SQL> @?/rdbms/admin/catupgrd.sql

Note: After upgrade <<catupgrd.sql>> the database will shutdown.

SQL> startup pfile=’/tmp/initdev.ora’;
ORACLE instance started.
Total System Global Area 534462464 bytes
Fixed Size 2146112 bytes
Variable Size 150995136 bytes
Database Buffers 377487360 bytes
Redo Buffers 3833856 bytes
Database mounted.
Database opened.

SQL> spool on utlu111s_20July2009.sql

SQL> @?/rdbms/admin/utlu111s.sql

Oracle Database 11.1 Post-Upgrade Status Tool 04-27-2009 12:11:48
Component Status Version HH:MM:SS
Oracle Server
. VALID 11.1.0.6.0 00:42:49
JServer JAVA Virtual Machine
. VALID 11.1.0.6.0 00:20:34
Oracle Workspace Manager
. VALID 10.2.0.4.3 00:00:01
OLAP Analytic Workspace
. VALID 11.1.0.6.0 00:00:55
OLAP Catalog
. VALID 11.1.0.6.0 00:01:40
Oracle OLAP API
. VALID 11.1.0.6.0 00:00:26
Oracle Enterprise Manager
. ORA-06550: line 5, column 35:
. PL/SQL: ORA-00942: table or view does not exist
. ORA-06550: line 5, column 1:
. PL/SQL: SQL Statement ignored
. ORA-00001: unique constraint (SYSMAN.PARAMETERS_PRIMARY_KEY) violated
. ORA-06512: at “SYSMAN.MGMT_TIME_SYNC”, line 108
. ORA-06512: at “SYSMAN.MGMT_TIME_SYNC”, line 166
. ORA-06512: at line 2
. VALID 11.1.0.6.0 00:20:30
Oracle XDK
. VALID 11.1.0.6.0 00:01:37
Oracle Text
. VALID 11.1.0.6.0 00:01:41
Oracle XML Database
. VALID 11.1.0.6.0 00:13:43
Oracle Database Java Packages
. VALID 11.1.0.6.0 00:00:42
Oracle Multimedia
. VALID 11.1.0.6.0 00:09:04
Spatial
. VALID 11.1.0.6.0 00:06:41
Oracle Expression Filter
. VALID 11.1.0.6.0 00:00:15
Oracle Rules Manager
. VALID 11.1.0.6.0 00:00:13
Gathering Statistics
. 00:05:25
Total Upgrade Time: 02:06:28

PL/SQL procedure successfully completed.

SQL>spool off
SQL> SET SERVEROUTPUT OFF
SQL> SET VERIFY ON

The above errors does not result in any data loss. Therefore, you can ignore these errors, however you can apply Patch 7449757

$cd /u02/patch
$ unzip p7449757_111070_Generic.zip
$cd 7449757
$pwd

/home/oracle/7449757
$ /u01/app/oracle/product/11.1/OPatch/opatch apply
SQL> @?/rdbms/admin/catuppst.sql
SQL> @?/rdbms/admin/utlrp.sql
SQL> create spfile from pfile=’/tmp/initdev.ora’;

SQL> select count(*) from dba_objects where status like ‘INVALID’;
SQL>select comp_name,version, status from dba_registry;
SQL> select comp_name,version, status from dba_registry

COMP_NAME                                                    VERSION                             STATUS
—————————————-                           —————————— —————
Oracle Enterprise Manager                                11.1.0.6.0                              VALID
OLAP Catalog                                                      11.1.0.6.0                              VALID
Spatial                                                                   11.1.0.6.0                              VALID
Oracle Multimedia                                              11.1.0.6.0                              VALID
Oracle XML Database                                       11.1.0.6.0                              VALID
Oracle Text                                                           11.1.0.6.0                              VALID
Oracle Data Mining                                             11.1.0.6.0                              VALID
Oracle Expression Filter                                      11.1.0.6.0                              VALID
Oracle Rules Manager                                        11.1.0.6.0                              VALID
Oracle Workspace Manager                              10.2.0.4.3                              VALID
Oracle Database Catalog Views                       11.1.0.6.0                              VALID
Oracle Database Packages and Types            11.1.0.6.0                              VALID
JServer JAVA Virtual Machine                         11.1.0.6.0                              VALID
Oracle XDK                                                          11.1.0.6.0                              VALID
Oracle Database Java Packages                      11.1.0.6.0                              VALID
OLAP Analytic Workspace                               11.1.0.6.0                              VALID
Oracle OLAP API                                                11.1.0.6.0                              VALID

17 rows selected.

Configure the tnsnames.ora, listener.ora sqlnet.ora. this finish your upgrade

Advertisements

Posted in Oracle 11g Database | Tagged: | 2 Comments »

Automatic Memory Management(AMM) on 11g

Posted by appsinfo on February 7, 2010

System Global Area (SGA)?

The SGA is a group of shared memory structures, known as SGA components that contain data and control information for one Oracle Database instance. The SGA is shared by all server and background processes.

Program Global Area (PGA)?

A PGA is a memory region that contains data and control information for a server process. It is nonshared memory created by Oracle Database when a server process is started. Access to the PGA is exclusive to the server process. There is one PGA for each server process. Background processes also allocate their own PGAs. The total PGA memory allocated for all background and server processes attached to an Oracle Database instance is referred to as the total instance PGA memory and the collection of all individual PGAs is referred to as the total instance PGA, or just instance PGA.

It contains global variables and data structures and control information for a server process. Example of such information is the runtime area of a cursor. Each time a cursor is executed, a new runtime area is created for that cursor in the PGA memory region of the server process executing that cursor.
 

Oracle Database 11g

Automatic Memory Management is being introduced in 11g. This enables automatic tuning of PGA and SGA with use of two new parameters named MEMORY_MAX_TARGET and MEMORY_TARGET.

The most important SGA components are the following:

Oracle Database 11g

Automatic Memory Management is being introduced in 11g. This enables automatic tuning of PGA and SGA with use of two new parameters named MEMORY_MAX_TARGET and MEMORY_TARGET.

The most important SGA components are the following:

Component Description Parameter
Database Buffer Cache The database buffer cache is the portion of the SGA that holds copies of data blocks read from datafiles. All users concurrently connected to the instance share access to the database buffer cache. DB_CACHE_SIZE
DB_KEEP_CACHE_SIZE
DB_RECYCLE_CACHE_SIZE
DB_nK_CACHE_SIZE
Redo Log Buffer The redo log buffer is a circular buffer in the SGA that holds information about changes made to the database. This information is stored in redo entries. Redo entries contain the information necessary to reconstruct, or redo, changes made to the database by INSERT, UPDATE, DELETE, CREATE, ALTER, or DROP operations. Redo entries are used for database recovery, if necessary. LOG_BUFFER
Shared Pool The shared pool portion of the SGA contains the library cache, the dictionary cache, the result cache, buffers for parallel execution messages, and control structures. SHARED_POOL_SIZE
SHARED_POOL_RESERVED_SIZE
RESULT_CACHE_SIZE *
Large Pool Used for allocating session memory for shared server, Oracle XA, or parallel query buffers or for RMAN. LARGE_POOL_SIZE
Java Pool Java pool memory is used in server memory for all session-specific Java code and data within the JVM. JAVA_POOL_SIZE
Streams Pool The streams pool is used exclusively by Oracle Streams. The Streams pool stores buffered queue messages, and it provides memory for Oracle Streams capture processes and apply processes.

Supports various memory management methods, which are chosen by initialization parameter settings.

****Oracle recommends that you enable the automatic memory management method

  • Automatic Memory Management – For Both the SGA and Instance PGA
  • Automatic Shared Memory Management – For the SGA
  • Manual Shared Memory Management – For the SGA
  • Automatic PGA Memory Management – For the Instance PGA
  • Manual PGA Memory Management – For the Instance PGA

 Automatic Memory Management – For Both the SGA and Instance PGA

 Beginning with Oracle Database 11g, Oracle Database can manage the SGA memory and instance PGA memory completely automatically. You designate only the total memory size to be used by the instance, and Oracle Database dynamically exchanges memory between the SGA and the instance PGA as needed to meet processing demands. This capability is referred to as automatic memory management. With this memory management method, the database also dynamically tunes the sizes of the individual SGA components and the sizes of the individual PGAs.

To achieve this, two new parameters have been introduced named MEMORY_MAX_TARGET and MEMORY_TARGET. To do so (on most platforms), you set only a target memory size initialization parameter (MEMORY_TARGET) and optionally a maximum memory size initialization parameter (MEMORY_MAX_TARGET).

Switching to Automatic Memory Management

1) Check the current values configured for SGA_TARGET and PGA_AGGREGATE_TARGET.

SQL>SHOW PARAMETER TARGET

NAME TYPE VALUE
—————————— ———– —————-
archive_lag_target integer 0
db_flashback_retention_target integer 1440
fast_start_io_target integer 0
fast_start_mttr_target integer 0
memory_max_target big integer 0
memory_target big integer 0
pga_aggregate_target big integer 200M
sga_target big integer 500M

Add the values of pga_aggregate_target and sga_target. In our case it would sum to 700 M.

2) Decide on a maximum amount of memory that you would want to allocate to the database which will determine the maximum value for the sum of the SGA and instance PGA sizes. In our case we decide to set to 808M

3) Change the parameter in initialization parameter file.

Using Spfile
========

SQL>ALTER SYSTEM SET MEMORY_MAX_TARGET = 808M SCOPE = SPFILE;
SQL>ALTER SYSTEM SET MEMORY_TARGET = 808M SCOPE = SPFILE;
SQL>ALTER SYSTEM SET SGA_TARGET =0 SCOPE = SPFILE;
SQL>ALTER SYSTEM SET PGA_AGGREGATE_TARGET = 0 SCOPE = SPFILE;

Using Pfile
=======
If you have started the instance with Pfile, then edit the pfile and set the parameters manually

MEMORY_MAX_TARGET = 808M
MEMORY_TARGET = 808M
SGA_TARGET =0
PGA_AGGREGATE_TARGET = 0

In case you do not specify any value for MEMORY_MAX_TARGET and only use MEMORY_TARGET then database automatically sets MEMORY_MAX_TARGET to the value of MEMORY_TARGET.

If you omit the line for MEMORY_TARGET and include a value for MEMORY_MAX_TARGET, the MEMORY_TARGET parameter defaults to zero. After startup, you can then dynamically change MEMORY_TARGET to a non-zero value, provided that it does not exceed the value of MEMORY_MAX_TARGET.

MEMORY_MAX_TARGET is a static parameter i.e it cannot be changed Dynamically and Instance has to be bounced for modifying the value. So ensure that you have set it to appropriate value.

4) Shutdown and startup the database

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

Total System Global Area 845348864 bytes
Fixed Size 1303188 bytes
Variable Size 469765484 bytes
Database Buffers 369098752 bytes
Redo Buffers 5181440 bytes
SQL> show parameter target

NAME TYPE VALUE
———————————— ———– ——————————
archive_lag_target integer 0
db_flashback_retention_target integer 1440
fast_start_io_target integer 0
fast_start_mttr_target integer 0
memory_max_target big integer 808M
memory_target big integer 808M
pga_aggregate_target big integer 0
sga_target big integer 0

Monitoring and Tuning Automatic Memory Management

The dynamic performance view V$MEMORY_DYNAMIC_COMPONENTS shows the current sizes of all dynamically tuned memory components, including the total sizes of the SGA and instance PGA.
The view V$MEMORY_TARGET_ADVICE provides tuning advice for the MEMORY_TARGET initialization parameter.

SQL> select * from v$memory_target_advice order by memory_size;

You can also use V$MEMORY_RESIZE_OPS which has a circular history buffer of the last 800 SGA resize requests.

For More Information you can refer to: Automatic Memory Management(AMM) on 11g [ID 443746.1]

Posted in Oracle 11g Database | Leave a Comment »