Friday, November 30, 2007

ORA-01102: and ORA-16014:

SQL> startup pfile='/u01/app/oracle/product/10.2.0/db_1/dbs/initorcl.ora';
ORACLE instance started.
Total System Global Area 83886080 bytes
Fixed Size 1217836 bytes
Variable Size 75500244 bytes
Database Buffers 4194304 bytes
Redo Buffers 2973696 bytes
ORA-01102: cannot mount database in EXCLUSIVE mode
Cause:
Can be that you are trying to startup second instance with privously opened database.
If you have only one database and gets this error then that means you are trying to open an opened database!.


2.
Total System Global Area 83886080 bytes
Fixed Size 1217836 bytes
Variable Size 75500244 bytes
Database Buffers 4194304 bytes
Redo Buffers 2973696 bytes
Database mounted.ORA-16014: log 1 sequence# 188 not archived, no available destinationsORA-00312: online log 1 thread 1: '/u01/app/oracle/pkstg102/redo01.log'

Cause: you archives are of size equal to your database parameter DB_RECOVERY_FILE_DEST_SIZE. get rid of this error just increase this parameter's value.

SQL> alter system set DB_RECOVERY_FILE_DEST_SIZE = 6g;
System altered.
SQL> alter database open;
Database altered.

Thursday, November 29, 2007

Automatic Oracle 10g export using cron job.

Hi,
Today, I want to share shell script and steps for automatic export using Oracle 10g datapump.
As Oracle says that datapump is fater than imp/exp 45%. and I admit as I experienced it.
Agenda: automatic export (Oracle says it "logical backup") On Unix/Linux Machine.
Steps:
1. Make directory in oracle (it is mendatory for impdp/expdp).
2. Give read, write privileges on directoy to user.
3. Shell script.
4. Configurations.

1.
connect to oracle as "as sysdba"


I will complete it on monday hopefully....

StatsPack Installation and Use.

Hi,

Today I have installed statpack on a customer production machine for performance checking.
Here are steps.
1. Create tablespace for perfstat user. (optional)

CREATE TABLESPACE perfstat DATAFILE ' path_for_datafile_&_datafile_name.dbf ' SIZE 400M ;

2. Install statspack
$ cd $ORACLE_HOME/rdbms/admin$ sqlplus "/ as sysdba"
SQL> @spcreate.sql
*It will prompt you for perfstat user password, its default tablespace, its temporary tablespace.
** At the end you will receive
No errors.
NOTE:SPCPKG complete. Please check spcpkg.lis for any errors.
*** If there are some errors, then go for spcpkg.lis file.

3. Now time to take snap!
SQL> execute statspack.snap;

PL/SQL procedure successfully completed.

* After 10minutes take another snap!

SQL> execute statspack.snap;

PL/SQL procedure successfully completed.

4. Now get the Report!
SQL> @spreport.sql
* You will get

Listing all Completed Snapshots
SnapInstance DB Name Snap Id Snap Started Level Comment
------------ ------------ --------- ----------------- ----- --------------------
ORCL ORCL 1 29 Nov 2007 02:40 5
2 29 Nov 2007 02:49 5

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

*At the end you will name the report.
*Now Take report n enjoy.