Tuesday, April 29, 2008

ORA-06512: on 9i SE

Hi,


When an Oracle 10G Standard Edition database has been installed, I have got the following error in the alert log file of this database:

ORA-00604: error occurred at recursive SQL level 1
ORA-06521: PL/SQL: Error mapping function
ORA-06512: at "SYS.OLAPIHISTORYRETENTION", line 1
ORA-06512: at line 13

I have found that for fixing that error we need to shut down the Oracle OLAP functionality using the following commands.

ALTER TRIGGER SYS.OLAPISTARTUPTRIGGER DISABLE;
ALTER TRIGGER SYS.OLAPISHUTDOWNTRIGGER DISABLE;


Thanks,
Sergey.


How to reset an oracle parameter.

Hello,

Recently I mistakenly set up the log_archive_start=TRUE parameter on a 10g database when switched it into archive log mode. This parameter is obsolete in the 10g.

To erase this parameter from an spfile we can use the following command:
ALTER SYSTEM RESET log_archive_start SCOPE=SPFILE SID='*';


Thanks,
Sergey.

Sunday, April 13, 2008

Creating an oracle 9i database.

Hi Everyone,

To create a new oracle database we need to complete the following steps:

1. As root create the oracle directory under the /u01 volume, which created in the last posting.
And change the owner to the oracle:oinstall account

[root@cent4 ~]# cd /u01/ [root@cent4 u01]# mkdir oracle [root@cent4 u01]# chown oracle:oinstall ./oracle
2. Change the current ID to oracle and create an oradata directory.
[root@cent4 ~]# su - oracle [oracle@cent4 ~]$ cd /u01/oracle [oracle@cent4 ora]$ mkdir oradata
3. In the parallel terminal window as root execute the xhost command:
[root@cent4 ~]# xhost + access control disabled, clients can connect from any host
4. And in the oracle window run the dbca command:
[oracle@cent4 oradata]$ cd $ORACLE_HOME/bin [oracle@cent4 bin]$ ./dbca
5.1. In the "Database Configuration Assistant: Welcome" just click ("Next").
5.2. In the "Database Configuration Assistant, Step 1 of 8: Operations"
choose "Create a database" and then click ("Next").
5.3. In the "Database Configuration Assistant, Step 2 of 8: Database Templates"
choose "General Purpose" and then click ("Next").
5.4. In the "Database Configuration Assistant, Step 3 of 7: Database Identification"(It is strange that there is 7 instead of 8) set up the following values for those fields:
Global Database Name: test.ssl.world
SID: test
(Obviously you can set up any name what you want in these fields.) then click (“Next”).
5.5. In the "Database Configuration Assistant, Step 4 of 7: Database Configuration Options" choose: "Dedicated Server Mode" then click ("Next").
5.6. In the "Database Configuration Assistant, Step 5 of 7: Initialization Parameters" stay all parameters as default then click (“Next”).
5.7. In the "Database Configuration Assistant, Step 6 of 7: Database Storage" replace all {ORACLE_BASE} variables to /u01/oracle for control files, Datafiles, Redo Log Groups then click ("Next").
5.8. In the "Database Configuration Assistant, Step 7 of 7: Creation Options" stay a default value "Create Database" and click ("Finish").
5.9. In the following window set up your favorite passwords for sys and system accounts. So, the database has been successfully created. Now you can startup or shutdown it using the following commands under the oracle linux account:
[oracle@cent4 ~]$ . oraenv
ORACLE_SID = [test1] ? test
[oracle@cent4 ~]$ sqlplus /nolog

SQL> connect / as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area 236000356 bytes
Fixed Size 451684 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>

In the next article I am planning to upgrade this database to the Oracle 10G version.

Thanks,
Sergey.

How to add a new virtual disk to a linux vmware machine.

1. Shutdown the virtual linux by: shutdown –h now
2. Click on "Edit virtual machine settings" in the "Commands" section of vmware for our virtual machine.
3. Click on "Add…" button of "Virtual Machine Settings" window.
4. Choose the "Hard Disk" and click "Next".
5. Choose the "Create a new virtual disk" option and click "Next".
6. In the "Virtual disk type" section choose SCSI and click "Next".
7. In the "Disk capacity" chose 20GB for the "Disk size" and mark "Split disk" into 2GB files. Then click "Next".
8. Click "Finish" in the next window.
9. Now we can see a new disk on the "Hardware" tab. Click "Ok".
10. Click on "Start this virtual machine" link.
11. Login and open a terminal window as root.
12. Execute: fdisk /dev/sdb
We run /dev/sdb because this is the second disk on our linux system (first one is /dev/sda).
In the fdisk utility complete the following commands:
12.1. Press "n" to add a new partition
12.2. Press "p" for a primary partition (1-4)
12.3. Enter "1" to set up the first partition.
12.4. Enter the default values for first and last cylinders.
12.5. Enter "w" for writing this information.
13. For formatting the new partition enter: mkfs -t ext3 /dev/sdb1
14. Create the /u01 directory for mounting the new disk: mkdir /u01
15. Mount this new disk to this directory: mount -t ext3 /dev/sdb1 /u01
16. Check by df –k that this disk is mounted.
[root@cent4 ~]# df -k /u01
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sdb1 20635700 77888 19509576 1% /u01
17. In the /etc/fstab file add the following entry:
/dev/sdb1 /u01 ext3 defaults 1 1
I have chosen these parameters because I have the same ones for my root partition:
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
So probably it makes sense.
That’s it. Now, if we reboot our virtual machine the /u01 volume will be mounted automatically.
In the next article we will use this volume for our new oracle database.

Thanks,
Sergey.