Custom Search

Sunday, March 18, 2012

Auto startup and shutdown oracle database in linux

Auto startup and shutdown oracle database in linux
==================================================

1)

First create(with oracle user) two "start_db" and "stop_db" script

in your $ORACLE_HOME/bin that starts and stop the db.
scripts are below... be careful about copy/paste.try to write it

with your own hand in linux.



-------------------start_db script

#!/bin/bash
# Start the Oracle Database and listeners
su - oracle<lsnrctl start
sqlplus /nolog<connect / as sysdba
startup
EOS
#emctl start dbconsole
#isqlplusctl start
EOO




---------------stop_db script


#!/bin/bash
# Stop the Oracle Database and linteners
su - oracle<lsnrctl stop
sqlplus /nolog<connect / as sysdba
shutdown immediate
EOS
#emctl stop dbconsole
#isqlplusctl stop
EOO



2) (with root user)

add to the /etc/rc3.d/S99local script something like:


#!/bin/sh
case "$1" in
'start') su - oracle -c start_db ;;
'stop') su - oracle -c stop_db ;;
esac



3) for test your script with root user

-----------------------------
#!/bin/sh
case "$1" in
'start') su - oracle -c start_db ;;
'stop') su - oracle -c stop_db ;;
esac
--------------------------------

(note: make a script with above code name in
"/etc/init.d/db_start_stop"


#sh /etc/init.d/db_start_stop start
#sh /etc/init.d/db_start_stop stop








----------------extra---for--me--only----------------------

note : for Associating the db_start_stop service with the appropriate run levels and set it to auto-start using the following command.

chmod 750 /etc/init.d/db_start_stop

chkconfig --add db_start_stop

Sunday, February 26, 2012

Heap size K exceeds notification threshold (2048K)

Memory Notification: Library Cache Object loaded into SGA
Heap size 2294K exceeds notification threshold (2048K)
-------------------------------------------------------------
These are warning messages that should not cause the program responsible for these errors to fail. They appear as a result of new event messaging mechanism and memory manager in 10g Release 2.

The meaning is that the process is just spending a lot of time in finding free memory extents during an allocate as the memory may be heavily fragmented. Fragmentation in memory is impossible to eliminate completely, however, continued messages of large allocations in memory indicate there are tuning opportunities on the application.


[ Note:- Set _kgl_large_heap_warning_threshold to a reasonable high value or zero to prevent these warning messages. Value needs to be set in bytes.
The default threshold in 10.2.0.1 is 2MB. So these messages could show up frequently in some application environments.
In 10.2.0.2, the threshold was increased to 50MB after regression tests, so this should be a reasonable and recommended value.
]

Friday, February 10, 2012

How can i delete oracle Database?

Solution:-

Dropping a database involves removing its datafiles, redo log files, control files, and initialization parameter files.

1) Use DBCA to Delete spacific Database.

2) Use "SQL> DROP DATABASE" Command .

The DROP DATABASE statement first deletes all control files and all other database files listed in the control file. It then shuts down the database instance.

To use the DROP DATABASE statement successfully, the database must be mounted in exclusive and restricted mode.

The DROP DATABASE statement has no effect on archived log files, nor does it have any effect on copies or backups of the database. It is best to use RMAN to delete such files. If the database is on raw disks, the actual raw disk special files are not deleted.

If you used the Database Configuration Assistant to create your database, you can use that tool to delete (drop) your database and remove the files.

Tuesday, January 31, 2012

Where is the location of alert log file in oracle 11g ?

I got many question about this. its nothing different from oracle 10g.
just show the value of "background_dump_dest"


example:-


SQL>
SQL>
SQL> select * from v$version ;

BANNER
--------------------------------------------------------------------------------

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

SQL>
SQL>
SQL> show parameter background_dump_dest

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
background_dump_dest string g:\oracle11gr2\app\administrat
or\diag\rdbms\halimdb1g\halimd
b1g\trace
SQL>


so i will get my alert log in this loacation.

g:\oracle11gr2\app\administrator\diag\rdbms\halimdb1g\halimd b1g\trace

Sunday, January 8, 2012

How to recover oracle database if the archive log/redo log file is missing ?

steps are below ....

1) Set _ALLOW_RESETLOGS_CORRUPTION=TRUE in init.ora file.
2) Startup Mount
3) Recover database
4) Alter database open resetlogs.
5) reset undo_management to "manual" in init.ora file.
6) startup database

after then

I) perform a full-database export,
II) create a brand new and separate database, and finally
III) import the export dump.


7) Create new undo tablespace
changed undo_management to "AUTO" and undo_tablespace to "New undo tablespace"

9) restart the database.

My Blog List