Apr 26, 2009

ORA - 16179

ORA - 16179 : incremental changes to "log_archive_dest_1" not allowed with spfile

SQL> alter system set log_archive_dest_1='d:\archive\' scope=spfile; 
alter system set log_archive_dest_1='d:\ora\' scope=spfile 
* 
ERROR at line 1: ORA-32017: failure in updating SPFILE ORA-16179: 
incremental changes to "log_archive_dest_1" not allowed with SPFILE

When i try to enable Archivelog mode in production server, i faced this ORA-16179. 
production server is version 10.1.0.2 and host is solaris sparc 64bit.

Cause:
Incremental changes to a log_archive_dest_n parameter cannot be made when using an SPFILE. 

Solution: 
Specify either LOCATION or SERVICE plus all other attributes to  be set in one ALTER SYSTEM/SESSION SET command.

Action :
SQL> ALTER SYSTEM SET log_archive_dest_1 = 'LOCATION=/db1/archive';

System altered.


Reff: Metalink Doc ID: 194494.1


Apr 12, 2009

EM : Policy violation

Policy rule 1 : Insufficient Number of Control Files

Cause : there is only one control file in the database

Solution : Control file multiplexed..

Action : Shutdown immediate;

Startup mount;

alter system set control_files='/path/control01.ctl','/path/newcontrol02.ctl' scope=spfile;

shutdown immediate;

startup;

Policy rule 2 : Insufficient Number of Redo Logs

cause : i have two groups in my database, but each group has only one member.

Solution : Log member multiplexed

Action : Using EM control log members added...

Policy rule 3 : EXECUTE UTL_FILE privileges to PUBLIC

Cause : bydefault 'UTL_FILE' privilege grant to PUBLIC profile.

Action : Revoke execute utl_file from public;

But still policy violation still shown.
Reason, there are many other polices are set to public profile ( UTL_SMTP, UTL_TCP, UTL_HTTP and DBMS_RANDOM).

Apr 11, 2009

EM- java.lang.Exception:UnknownHostException


Environment : Windows XP sp3, Oracle 10.2.0.4.0

Problem : When i connect to EM console, with SYS user. it thrown an exception error message

Error : java.lang.Exception: UnknownHostException sending request :: naachi-514ccc13

Cause : Recently I was changed the server hostname. previously it was "naachi-514ccc13", now it is "naachi".

Solution : d:\> emca -config dbcontrol db -repose recreate

The following action will be performed automatically by the above single line.

>>> Stop the database control
>>> Drop the database control
>>> Create the database control
>>> Start the database control

Status : successfully problem solved.



Apr 5, 2009

Clone using Export Dump

create a new database or clone a existing database or recover using oracle export Dump.

1. You must have full backup dump

2. List the content from export dump

Imp file=’/dump/xyz.dmp’ log=’/dump/imp.log’ full=y show=y
It will list all sql statement in log (imp.log)

c. Open the imp.log file, search and find the tablespace and users sql statements

i. Create tablespace .......
ii. Create users ....
iii. Create index..
iv. And what every you want

d. Copy and past it in a file.sql. now u will the script for creating a database.

e. Copy and save ‘create user.. ‘ is seperate file and ‘create tablespace..’ in sepereate sql file.

3. Create required folders (bdump,udump, also oradata)

4. Edit the pfile, use it from backup, if not. copy it from old db alert log or statspack report if u have.
5. Create oracle service

Windows : oradim –new –sid xxx
Solaris : export oracle_sid= xxx

6. Startup the database

Sqlplus “/as sysdba”
Startup nomount pfile=’/pfile.ora’

7. Run the script

$> @ file.sql
It will create all tablespaces

8. Open the database

Alter database mount;
Alter database open;

9. Create the users

Run the script to create users
@users.sql’

10. Import the datas

Imp file=’/dump/xyz.dmp’ log=’/dump/imp.log’ full=y

After import data, update the database metrics using analyze command..

Mar 14, 2009

Oracle EM Console 10g


Introduction

OEM is a set of system management tool for managing, monitoring and automate tasks
of oracle database environment. database control was first introduced in oracle 10g.

For windows/Unix you can follow the same method to configure EM console

1. Pre-Reuestits

a. Password file is required.
b. Set remote_login_passwordfile is set to EXCLUSIVE or SHARED.
c. Increase the job_queue_processes more that 1.
d. Unlock sysman and dbsnmp user account if already exist.
e. Emca is located in $ORACLE_HOME/bin


2. Create the repository for OEM console

emca –repos create

3. Configure the database control

emca –config dbcontrol db

4. Connect to the database control

http://hostname:portnumber/em

5. Commands to Star, Stop and check the Status of dbConsole

Emctl start dbconsole
Emctl status dbconsole
Emctl stop dbconsole


6. Commands to start, stop and check status of EM Agent

Emctl start agent
Emctl status agent
Emctl stop agent

7. how to Drop the database consol

Emca –deconfig dbcontrol db

8. What are the file Files and Folders create for your db console. lets check.

Local Configuration files

ORACLE_HOME/hostname_sid

Port Number

ORACLE_HOME/install/protlist

Log location

ORACLE_HOME/cfgtoollogs/emca/sid

9. Services

In windows you can check the services is services.msc
service like : OracleDBConsole

10. Add OS user in "Log on as a batch job" for windows

Windows user must add their name in batch job in user policies folder

Control panel -> Admin Tool -> Local security Policy -> Local Policies -> User Right Assignment
-> Log on as a batch job -> Local security setting

11. How does it work

WebBrowser <--> Http/Https <--> J2EE (OC4J) AppServer <-- Thin JDBC --> Sysman schema.

OEM create a sysman schema to store dbconsole metadata and statistics.

12. Management Packs

Oracle Congfiguration management pack

1. Track h/w and s/w configuration for hosts and database.
2. Cloning for database instance and oracle home for deployments.

Oracle Change management pack

1. Changes to support new application requirements
2. Eliminate error or data loss when making changes and minimize downtime.

Oracle Diagnostics pack and tuning pack

1. Reduce the complex performance tasks.