Dienstag, 26. Oktober 2010

Install Oracle 11g on Ubuntu

Please note that Ubuntu is NOT supported by Oracle 11g Release 2. This tutorial is not guaranteed to work.

I recommend that you install Oracle 11g on Oracle Enterprise Linux in Virtualbox on Ubuntu.
See this post http://oracleabc.com/b/?p=739 for more details.

The following or later versions of the operating system are required for Oracle Database 11g Release 2 (11.2):
Asianux 2 Update 7
Asianux 3
Oracle Enterprise Linux 4 Update 7
Oracle Enterprise Linux 5 Update 2
Red Hat Enterprise Linux 4 Update 7
Red Hat Enterprise Linux 5 Update 2
SUSE Linux Enterprise Server 10 SP2
SUSE Linux Enterprise Server 11

1. Install JRE or JDK 1.6

2. Install the required packages (please follow the Oracle installation guide)
# apt-get install gcc
Do the same for other packages
make binutils lesstif2 rpm libmotif3 libaio gawk alien ksh

3.create the directories

# mkdir -p /u01/app/oracle

4. Create user and groups

Add the user and change groups to make the installer more comfortable.

# groupadd oinstall
# groupadd dba
# groupadd nobody
# useradd -g oinstall -G dba -p password -d /home/oracle -s /bin/bash oracle
# usermod -g nobody nobody

The usermod command is needed since because when running, the installer looks for a user called nobody which is part of a group named nobody (in Ubuntu, the user nobody it’s assigned to nogroup by default).

5. Make some symlinks.

Apparently, the installer uses absolute paths, so it must find the binaries in the right places.

# ln -s /usr/bin/awk /bin/awk
# ln -s /usr/bin/rpm /bin/rpm
# ln -s /usr/bin/basename /bin/basename

6. Set shared memory parameters

There is a file called /etc/sysctl.conf and it should have these lines on it:

fs.file-max = 65535
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144

7. Reload the config file:

# sysctl -p

8.Modify limits.conf

Add these lines to /etc/security/limits.conf, letting the oracle user use more resources than the defaults allowed.

oracle soft nproc 2047
oracle hard nproc 16383
oracle soft nofile 1023
oracle hard nofile 65535

Make sure the limits.conf is being interpreted as the oracle user logs in by adding these lines to /etc/pam.d/login. You will want to make sure that is actually happening, since the defaults are way lower and you may get all sorts of problems.

session required /lib/security/pam_limits.so
session required pam_limits.so

9. Unpack and prepare the installation.

# cd /path/to/zipfile
# unzip linux_11gR1b5_database.zip

# chown -R oracle:oinstall database
# chown -R oracle:oinstall /u01/app/oracle

10.Turn on the display

# sudo -i
xhost +

# su – oracle

# DISPLAY=:0.0; export DISPLAY

11. Start the installer as the oracle user

# su – oracle
$ cd /path_to_extracted_files
$ ./runInstaller

12. run scripts as root

When the installation is complete, it will ask you to run some commands as root.

$ sudo -s
Password:

# /u01/app/oracle/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oracle/oraInventory to 770.
Changing groupname of /u01/app/oracle/oraInventory to oinstall.
The execution of the script is complete

# /u01/app/oracle/product/11.1.0/db_1/root.sh
Running Oracle 11g root.sh script…

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.1.0/db_1

After these scripts finish their execution (the errors seem to be ignorable), hit the OK button and you’ll have a window that (probably) will look like this one:

By default, the SGA is about 750MB. You can follow this page to reduce the memory target if you are installing Oracle 11g on your laptop or a VM.

http://oracleabc.com/b/?p=96

Montag, 4. Oktober 2010

SQL Script um die Log-Datei auf dem SQL-Server zu verkleinern

1. BACKUP LOG TestDB TO DISK='C:\TestDB1.bak'

2. USE [Database]
GO
DBCC SHRINKDATABASE('Database', 10, TRUNCATEONLY)

3. Nachdem sollte die Logdatei kleiner sein.

Wenn nicht kann es auch an der Art der der Backupeinstellung liegen. (Bei mir war es "einfach" und klappt damit)

Windows Server 2008 / R2 Zeitsynchronisierung

Auf dem PDC-Emulator muss folgender befehl abgesetzt werden, damit von Extern die Zeit abgefragt werden kann.
Dazu natürlich an der Firewall UDP-Port 123 freischalten.


w32tm /config /manualpeerlist:"ptbtime1.ptb.de ptbtime2.ptb.de ptbtime3.ptb.de" /syncfromflags:manual /reliable:yes /update