From Technical Knowledge to IT Service Management

Posts Tagged ‘oracle’

Lister et arreter un job Oracle

Un petite question posée par mail il y a peu:

Pour lister les jobs

SQL> connect system/xxx
SQL> select job, schema_user, next_date, what from dba_jobs;


JOB    SCHEMA_USER    NEXT_DATE     WHAT
------ -------------- ---------     --------------------
1      SYSMAN         19-OCT-08     EMD_MAINTENANCE.EXECUTE_EM_DBMS_JOB_PROCS();
100    CRM            19-OCT-08     CRM_PROCS();
101    STAT           19-OCT-08     STAT_JOB_PROCS();

Pour supprimer un job

SQL> exec dbms_job.remove(215);
PL/SQL procedure successfully completed.

Générer un rapport AWR

J’ai recu une demande pour savoir comment générer un rapport AWR sous Oracle.

Voici un petit exemple pour se connecter à la base et générer un AWR en mode test


[root@nuxora01 ~]# su - oracle
[oracle@nuxora01 ~]$ export ORACLE_SID=nuxodb
[oracle@nuxora01 ~]$ sqlplus system@nuxodb
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Aug 31 08:40:22 2008
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Enter password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning and Data Mining options
SQL> @$ORACLE_HOME/rdbms/admin/awrrpt.sql
Current Instance
~~~~~~~~~~~~~~~~
   DB Id    DB Name      Inst Num Instance
----------- ------------ -------- ------------
  731622690 NUXODB              1 nuxodb

Specify the Report Type
~~~~~~~~~~~~~~~~~~~~~~~
Would you like an HTML report, or a plain text report?
Enter 'html' for an HTML report, or 'text' for plain text
Defaults to 'html'
Enter value for report_type: text
Type Specified:  text

Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   DB Id     Inst Num DB Name      Instance     Host
------------ -------- ------------ ------------ ------------
* 731622690         1 NUXODB       nuxodb       nuxora01
Using  731622690 for database Id
Using          1 for instance number

Specify the number of days of snapshots to choose from
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Entering the number of days (n) will result in the most recent
(n) days of snapshots being listed.  Pressing <return> without
specifying a number lists all completed snapshots.

Enter value for num_days: 1
Listing the last day's Completed Snapshots
                                                        Snap
Instance     DB Name        Snap Id    Snap Started    Level
------------ ------------ --------- ------------------ -----
nuxodb       NUXODB            1510 29 Aug 2008 06:26      1
                               1511 29 Aug 2008 06:45      1
                               1512 29 Aug 2008 07:00      1
                               1513 29 Aug 2008 07:15      1
                               1514 29 Aug 2008 07:30      1
                               1515 29 Aug 2008 07:45      1

Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 1514
Begin Snapshot Id specified: 1514
Enter value for end_snap: 1515
End   Snapshot Id specified: 1515

Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrrpt_1_1514_1515.txt.  To use this name,
press <return> to continue, otherwise enter an alternative.
Enter value for report_name:
Using the report name awrrpt_1_1514_1515.txt
WORKLOAD REPOSITORY report for
DB Name         DB Id    Instance     Inst Num Release     RAC Host
------------ ----------- ------------ -------- ----------- --- ------------
NUXODB         731622690 nuxodb              1 10.2.0.1.0  NO  nuxora01
              Snap Id      Snap Time      Sessions Curs/Sess
            --------- ------------------- -------- ---------
Begin Snap:      1514 29-Aug-08 07:30:23        18       2.1
  End Snap:      1515 29-Aug-08 07:45:24        18       2.1
   Elapsed:               15.01 (mins)
   DB Time:                0.01 (mins)
Cache Sizes
~~~~~~~~~~~                       Begin        End
                             ---------- ----------
               Buffer Cache:       180M       180M  Std Block Size:         8K
           Shared Pool Size:        76M        76M      Log Buffer:     7,000K
Load Profile
~~~~~~~~~~~~                            Per Second       Per Transaction
                                   ---------------       ---------------
                  Redo size:                694.24              7,269.72
              Logical reads:                 27.06                283.31
              Block changes:                  2.05                 21.42
             Physical reads:                  0.07                  0.78
            Physical writes:                  0.48                  5.06
                 User calls:                  0.10                  1.05
                     Parses:                  1.88                 19.67
                Hard parses:                  0.35                  3.64
                      Sorts:                  1.50                 15.74
                     Logons:                  0.03                  0.35
                   Executes:                  4.53                 47.49
               Transactions:                  0.10
  % Blocks changed per Read:    7.56    Recursive Call %:    99.79
 Rollback per transaction %:    0.00       Rows per Sort:     7.74
Instance Efficiency Percentages (Target 100%)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            Buffer Nowait %:  100.00       Redo NoWait %:  100.00
            Buffer  Hit   %:   99.73    In-memory Sort %:  100.00
            Library Hit   %:   83.14        Soft Parse %:   81.50
         Execute to Parse %:   58.57         Latch Hit %:  100.00
Parse CPU to Parse Elapsd %:   83.33     % Non-Parse CPU:   35.22
 Shared Pool Statistics        Begin    End
                              ------  ------
             Memory Usage %:   82.16   82.43
    % SQL with executions>1:   63.84   78.55
  % Memory for SQL w/exec>1:   84.04   90.26
Top 5 Timed Events                                         Avg %Total
~~~~~~~~~~~~~~~~~~                                        wait   Call
Event                                 Waits    Time (s)   (ms)   Time Wait Class
------------------------------ ------------ ----------- ------ ------ ----------
CPU time                                              1          92.7
os thread startup                        16           1     42   90.3 Concurrenc
control file parallel write             299           1      2   90.1 System I/O
log file parallel write                 111           0      2   27.2 System I/O
db file sequential read                  17           0      3    7.5   User I/O
          -------------------------------------------------------------
......
          -------------------------------------------------------------
End of Report
Report written to awrrpt_1_1514_1515.txt
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning and Data Mining options
[oracle@nuxora01 ~]$ ll
total 100
-rw-r--r--  1 oracle dba 95022 Aug 31 08:40 awrrpt_1_1514_1515.txt
[oracle@nuxora01 ~]$

				

Startup and Shutdown Options

When everything is ok, you should do like that:

startup
STARTUP OPEN PFILE=%ORACLE_BASE%\admin\nuxoradb\pfile\init.ora

shutdown
CONNECT system/manager@nuxoradb AS SYSDBA
SHUTDOWN NORMAL

The OPEN option starts the instance, reads the control file, attaches the database, and then opens it.
The OPEN option is the default option, it is not mandatory to write it.

The NORMAL option will wait for users to log out and then it will close the database and shutdown the instance.

Oracle logs, such as alert log file are very useful and give a good status about the databse and can explain many things, and help you to choose between different options.

Depending your needs, the situation you are facing, many options are available to start a database:

startup MOUNT
CONNECT system/manager@nuxoradb AS SYSDBA
STARTUP MOUNT PFILE=%ORACLE_BASE%\admin\nuxoradb\pfile\init.ora

The MOUNT option, starts the instance, reads the control file, and attaches the database, but does not open it.

To open and use the database:

ALTER DATABASE OPEN;

You have to do that because MOUNT option does’nt open your database

startup NOMOUNT
CONNECT system/manager@nuxoradb AS SYSDBA
STARTUP NOMOUNT PFILE=%ORACLE_BASE%\admin\nuxoradb\pfile\init.ora


The NOMOUNT option starts the instance without mounting the database. It means that only the memory structure and background processes are set up.

To open and use the database, you’ll have then to MOUNT it and OPEN it:

ALTER DATABASE MOUNT;
ALTER DATABASE OPEN;

startup READONLY
CONNECT system/manager@nuxoradb AS SYSDBA
STARTUP OPEN READ ONLY PFILE=%ORACLE_BASE%\admin\nuxoradb\pfile\init.ora

In the READ ONLY mode, You can only read, and no modification is possible, insert, update, or delete, create, later or drop are impossible to use.

And off course many options to shutdown oracle:

shutdown IMMEDIATE

CONNECT system/manager@nuxoradb AS SYSDBA
SHUTDOWN IMMEDIATE

The IMMEDIATE option won’t wait a user’s logoff either uncommitted rollback, it will shutdown the instance and close the database immediatly.

shutdown TRANSACTIONAL
SHUTDOWN TRANSACTIONAL
CONNECT system/manager@nuxoradb AS SYSDBA

The TRANSACTIONAL option tells oracle not to wait for a user to log off, but wait for the client to end the transaction that is in progress, then shut down the instance and close the database.

shutdown ABORT
CONNECT system/manager@nuxoradb AS sysdba
SHUTDOWN ABORT

The ABORT option shutdown the instance (no roll back, user sessions are killed).

And then you have a special option, in case of emergency:

shutdown ans startup FORCE
CONNECT system/manager@nuxoradb AS sysdba
STARTUP FORCE PFILE=%ORACLE_BASE%\admin\nuxoradb\pfile\init.ora

Oracle got a Wiki

All is said in the post title, Oracle has launched a wiki.

This official public oracle wiki will permit to share content, information dealing with oracle technologies, with a very collaboratively tool, just try it [Oracle's WiKi]

Oracle Database 11g Launch

Oracle is going to launch today Oracle Database 11g

On Oracle website you can join a live webcast about this new version. it will be at 10 a.m. ET

We had to wait 4 long years to have these 482 new features with data compression for example or hot patching (that sounds great) or new RAC possibilities:

Oracle11g High Availability & RAC new features

Oracle continues to enhanced Real Application Clusters in Oracle11g and we see some exciting new features in RAC manageability and enhanced performance:

  • Oracle 11g RAC parallel upgrades - Oracle 11g promises to have a rolling upgrade features whereby RAC database can be upgraded without any downtime. Ellison first promised this feature in 2002, and it is a very challenging and complex 11g new feature.

  • Oracle RAC load balancing advisor - Starting in 10gr2 we see a RAC load balancing advisor utility. Oracle says that the 11g RAC load balancing advisor is only available with clients which use .NET, ODBC, or the Oracle Call Interface (OCI).

  • ADDM for RAC – Oracle will incorporate RAC into the automatic database diagnostic monitor, for cross-node advisories.

  • Optimized RAC cache fusion protocols - moves on from the general cache fusion protocols in 10g to deal with specific scenarios where the protocols could be further optimized. Source: Mark Rittman

  • Oracle 11g RAC Grid provisioning - The Oracle grid control provisioning pack allows you to “blow-out” a RAC node without the time-consuming install, using a pre-installed “footprint”. Oracle 11g OEM has have easy server blade installs where a binary footprint is tar’ed to the server blade and configured, without a cumbersome install process.

  • Hot patching - Zero downtime patch application.

  • Data Guard - Standby snapshot – The new standby snapshot feature allows you to encapsulate a snapshot for regression testing. You can collect a standby snapshot and move it into your QA database, ensuring that your regression test uses real production data.

  • Quick Fault Resolution - Automatic capture of diagnostics (dumps) for a fault.

Don’t miss the live webcast -> Click here to view the live Webcast on July 11, 2007.

Oracle 11g will be launched the 11 July

It’s now official, Oracle has announced the release of Oracle 11g on 11th July 2007.

Since last October and the OpenWorld conference, Oracle was anouncing this new version. A lots of new features will be avalaible in this 11g version. That will be detailed on a future post.

Of course i’m sure you notice that 11g will be launched 11 july (and “g” is the 7th letter of the alphabet and july the 7th month of the year) Oracle 11g should be a lucky version even if it will not be launched th 7th July (07/07/07)

>> www.oracle.com

Oracle’s Certification Matrices

Because i didn’t find it quickly, i’d just want to publish this very useful link to publish this access to the Certify – Oracle’s Certification Matrices:
http://www.oracle.com/technology/support/metalink/index.html

    —°°°— 

Une petite info pratique que je souhaite publié parce que je ne l’ai pas trouvé rapidemment. Voici le lien pour acceder aux matrices de compatibilté Oracle:
http://www.oracle.com/technology/support/metalink/index.html

List installed oracle components

If you want to know which components were installed on your server:

$ORACLE_HOME/OPatch/opatch lsinventory -detail