clicksor ad

Wednesday, February 15, 2006

Oracle 10g database on linux all versions

Installing Linux

RHEL4

Oracle Database 10g Release 2 is certified to run the base release of RHEL4 (Advanced Server and Enterprise Server) without updates.

The easiest and fastest way to apply the updates for a fresh install of Linux is to perform the install by using the update CDs. If Linux is already installed or you don't have the updates on CDs, they can be applied through RHN. Because this guide is designed for a fresh Linux install, you'll use the update CDs.

1. Boot the server using the first CD.

o You may need to change your BIOS settings to allow booting from the CD.

2. The boot screen appears with the boot: prompt at the bottom of the screen.

o Select Enter to continue with a graphical install on the console.

o The installer scans your hardware, briefly displays the Red Hat splash screen, and then begins a series of screen prompts.

3. Language Selection

o Accept the default.

4. Keyboard Configuration

o Accept the default.

5. Welcome Screen

o Click on Next.

6. Disk Partitioning Setup

o A thorough treatment of disk partitioning is beyond the scope of this guide, which assumes that you are familiar with disk partitioning methods.

(WARNING: Improperly partitioning a disk is one of the surest and fastest ways to wipe out everything on your hard disk. If you are unsure how to proceed, stop and get help, or you will risk losing data!)

This guide uses the following partitioning scheme, with ext3 for each filesystem:

The 9GB disk on the first controller (/dev/sda) will hold all Linux and Oracle software and contains the following partitions:
- 100MB /boot partition
-1,500MB swap partition—Set this to at least twice the amount of RAM in the system but to no more than 2GB. (Thirty-two-bit systems do not support swap files larger than 2GB.) If you need more than 2GB of swap space, create multiple swap partitions.
-7,150MB root partition—This partition will be used for everything, including /usr, /tmp, /var, /opt, /home, and more. This approach is purely to simplify installation for the purposes of this guide. A more robust partitioning scheme would separate these directories onto separate filesystems.

7. Boot Loader Configuration

o Accept the default.

8. Network Configuration

o It is usually best to configure database servers with a static IP address. To do so, click on Edit .

o A pop-up window appears. Uncheck the Configure using DHCP box, and enter the IP Address and Netmask for the server. Be sure that Activate on boot is checked, and click on OK .

o In the Hostname box, select manually and enter the hostname.

o In the Miscellaneous Settings box, enter the remaining network settings.

9. Firewall Configuration

o For the purposes of this walk-through, no firewall is configured. Select No firewall

o Select Disabled on the "Enable SELinux" drop down list.

o Click on Proceed when the "Warning - No Firewall" window appears.

10. Additional Language Support

o Accept the default.

11. Time Zone Selection

o Choose the time settings that are appropriate for your area. Setting the system clock to UTC is usually a good practice for servers. To do so, click on System clock uses UTC.

12. Set Root Password

o Enter a password for root, and enter it again to confirm.

13. Package Installation Defaults

o Select Customize software packages to be installed.

14. Package Group Selection

o Select only the package sets shown here and leave all others unselected.

o Desktop

§ X Window System

§ Gnome

o Applications

§ Graphical Internet (optional)

o Servers

§ Do not select anything in this group.

o Development

§ Development Tools

o System

§ Administration Tools

§ System Tools

§ Add the package 'sysstat' by clicking on the Details link and selecting "sysstat - The sar an iostat system monitoring commands." from the Optional Packages list.

o Miscellaneous

§ Do not select anything in this group.

o Click on Next to proceed.

15. Installing Packages

o Software will be copied to the hard disk and installed. Change disks as prompted.

16. Congratulations

o Remove the installation media from the system, and click on Reboot .

17. The system automatically reboots and presents a new welcome screen.

o Click on Next.

18. License Agreement

o Read the license agreement. If you agree to the terms, select Yes, I agree to the License Agreement and click on Next.

19. Date and Time

o Set the Date and Time.

o If you want to use an NTP server (recommended), select Enable Network Time Protocol and enter the name of the NTP server.

20. Display

o Accept the defaults or change as required.

21. Red Hat Login

o Enter your Red Hat Network login and password or create a new one.

22. System User

o Create an account for yourself.

o Do not create an account for oracle at this time. Creating the oracle account is covered later in this section.

23. Additional CDs

o Click on Next.

24. Finish Setup

o Click on Next.

25. A graphical login screen appears.

26. Congratulations! Your RHEL4 software is now installed.

Verifying Your Installation

Required kernel version: 2.6.9-5.0.5.EL This kernel, or any of the kernels supplied in updates, works with Oracle Database 10g Release 2 .

Check your kernel version by running the following command:

uname -r

Ex:

# uname -r

2.6.9-22.ELsmp

Once you've completed the steps above, all of the packages required for Oracle Database 10g Release 2 will have been installed. Verify this using the example below.

Required package versions (or later):

  • binutils-2.15.92.0.2-10.EL4
  • compat-db-4.1.25-9
  • control-center-2.8.0-12
  • gcc-3.4.3-9.EL4
  • gcc-c++-3.4.3-9.EL4
  • glibc-2.3.4-2
  • glibc-common-2.3.4-2
  • gnome-libs-1.4.1.2.90-44.1
  • libstdc++-3.4.3-9.EL4
  • libstdc++-devel-3.4.3-9.EL4
  • make-3.80-5
  • pdksh-5.2.14-30
  • sysstat-5.0.5-1
  • xscreensaver-4.18-5.rhel4.2
  • libaio-0.3.96
  • openmotif21-2.1.30-11.RHEL4.2 (Required only to install Oracle demos. Installation of Oracle demos is not covered by this guide.)

To see which versions of these packages are installed on your system, run the following command:

rpm -q binutils compat-db control-center gcc gcc-c++ glibc glibc-common
gnome-libs libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio openmotif21
Ex:

# rpm -q binutils compat-db control-center gcc gcc-c++ glibc glibc-common
> gnome-libs libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio openmotif21

binutils-2.15.92.0.2-15

compat-db-4.1.25-9

control-center-2.8.0-12.rhel4.2

gcc-3.4.4-2

gcc-c++-3.4.4-2

glibc-2.3.4-2.13

glibc-common-2.3.4-2.13

gnome-libs-1.4.1.2.90-44.1

libstdc++-3.4.4-2

libstdc++-devel-3.4.4-2

make-3.80-5

pdksh-5.2.14-30.3

sysstat-5.0.5-1

xscreensaver-4.18-5.rhel4.9

libaio-0.3.103-3

openmotif21-2.1.30-11.RHEL4.4




SLES9


1. Boot the server, using the SLES9 CD.

o You may need to change your BIOS settings to allow booting from the CD.

2. The Novell SLES installation screen appears.

o Select Installation.

o The installer scans your hardware and presents the YaST interface.

3. Language Selection

o Accept the license agreement.

o Accept the default, English (US).

4. Installation Settings

o Select New Installation.

5. Partitioning

o A thorough treatment of disk partitioning is beyond the scope of this guide, which assumes that you are familiar with disk partitioning methods.

(WARNING: Improperly partitioning a disk is one of the surest and fastest ways to wipe out everything on your hard disk. If you are unsure how to proceed, stop and get help, or you will risk losing data!)

This guide uses the following partitioning scheme, with ext3 for each filesystem:

The 9GB disk on the first controller (/dev/sda) will hold all Linux and Oracle software and contains the following partitions:
- 100MB /boot partition
-1,500MB swap partition—Set this to at least twice the amount of RAM in the system but to no more than 2GB. (Thirty-two-bit systems do not support swap files larger than 2GB.) If you need more than 2GB of swap space, create multiple swap partitions.
-7,150MB root partition—this partition will be used for everything, including /usr, /tmp, /var, /opt, /home, and more. This approach is purely to simplify installation for the purposes of this guide. A more robust partitioning scheme would separate these directories onto separate filesystems.

6. Software

o Click on the link for Software.

o The Software Selection screen appears.

o Click on Detailed Selection.

o The left-hand window displays a list of software selections. Click on the box next to each selection to select/deselect it.

o Select the following software (this is the recommended set; all others should be deselected):
- Basis Runtime System
- YaST
- Linux Tools
- Help & Support Documentation
- Graphical Base System
- GNOME System
- C/C++ Compiler and Tools
- Analyzing Tools

o It is recommended that the following items not be installed, as they may conflict with Oracle products providing the same service:
- Simple Webserver
- Authentication Server (
NIS, LDAP, Kerberos)

7. Time Zone

o Set your time zone.

8. Click on Accept.

9. A warning box appears. Click on Yes, install when ready to proceed.

10. Change CDs as prompted by the installer.

11. Confirm Hardware Detection

o Network Cards – Click on OK.

12. Password for "root." the system administrator.

o Enter the root password and repeat to confirm.

13. Configure your network interface(s), and click on Next when ready to proceed.

o Static IP addresses are recommended for servers.

o There is no need to configure printers, modems, ISDN adapters, or sound in order to build a database.

14. Test Internet Connection

o There is no need to connect to the Internet to download release notes or Linux updates. Select No, Skip This Test.

15. Service Configuration

o There is no need to configure CA Management or OpenLDAP Server. Select Skip Configuration.

16. User Authentication Method

o Select Local(/etc/passwd).

17. Add a New Local User

o Create an account for yourself. Do not create the oracle account at this time; we'll do that later.

18. Release Notes

o Click on Next

19. Hardware Configuration

o Confirm Hardware Detection – Graphics Cards – click on Continue.

o There is no need to configure sound cards for a database – click on Skip.

o If the graphics card and monitor have been successfully detected, click on Next. Otherwise, click on the Graphics Cards link and enter the correct information.

20. Installation Completed

o Click on Finish.

21. Congratulations! Your SLES9 software is now installed.

Verifying Your Installation

If you've completed the steps above, you should have all the packages and updates required for Oracle Database 10g Release 2. However, you can take the steps below to verify your installation.

Required kernel version: 2.6.5-7.97 (or later)

Check your kernel version by running the following command:

uname -r


Ex:

# uname -r

2.6.5-7.97-smp

Other required package versions (or later):

  • binutils-2.15.90.0.1.1-32.5
  • gcc-3.3.3-43.24
  • gcc-c++-3.3.3-43.24
  • glibc-2.3.3-98.28
  • gnome-libs-1.4.1.7-671.1
  • libstdc++-3.3.3-43.24
  • libstdc++-devel-3.3.3-43.24
  • make-3.80-184.1
  • pdksh-5.2.14-780.1
  • sysstat-5.0.1-35.1
  • xscreensaver-4.16-2.6
  • libaio-0.3.98

To see which versions of these packages are installed on your system, run the following command as root:

rpm -q binutils gcc gcc-c++ glibc gnome-libs libstdc++ libstdc++-devel make
pdksh sysstat xscreensaver libaio



Ex:

# rpm -q binutils gcc gcc-c++ glibc gnome-libs libstdc++ libstdc++-devel make
> pdksh sysstat xscreensaver libaio

binutils-2.15.90.0.1.1-32.10

gcc-3.3.3-43.34

gcc-c++-3.3.3-43.34

glibc-2.3.3-98.47

gnome-libs-1.4.1.7-671.1

libstdc++-3.3.3-43.34

libstdc++-devel-3.3.3-43.34

make-3.80-184.1

pdksh-5.2.14-780.7

sysstat-5.0.1-35.4

xscreensaver-4.16-2.6

libaio-0.3.102-1.2

Configuring Linux for Oracle

Verifying System Requirements

To verify that your system meets the minimum requirements for an Oracle Database 10g Release 2 database, log in as root and run the commands below.

To check the amount of RAM and swap space available, run this:

grep MemTotal /proc/meminfo

grep SwapTotal /proc/meminfo



Ex:

# grep MemTotal /proc/meminfo

MemTotal: 1034680 kB

# grep SwapTotal /proc/meminfo

SwapTotal: 1534196 kB

The minimum RAM required is 1024MB, and the minimum required swap space is 1GB. Swap space should be twice the amount of RAM for systems with 2GB of RAM or less and between one and two times the amount of RAM for systems with more than 2GB.

You also need 2.5GB of available disk space for the Oracle Database 10g Release 2 software and another 1.2GB for the database. The /tmp directory needs at least 400MB of free space. To check the available disk space on your system, run the following command:

df -h

Ex:

# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/sda3 6.8G 1.3G 5.2G 20% /

/dev/sda1 99M 17M 77M 18% /boot

The example shows that the /tmp directory does not have its own filesystem. (It's part of the root filesystem for this guide.) With 5.2 GB available, the root filesystem has just enough space for the installation (2.5 + 1.2 + 0.4 = 4.1GB) with a little room left over.

Create the Oracle Groups and User Account

Next, create the Linux groups and user account that will be used to install and maintain the Oracle Database 10g Release 2 software. The user account will be called oracle, and the groups will be oinstall and dba. Execute the following commands as root:

/usr/sbin/groupadd oinstall

/usr/sbin/groupadd dba

/usr/sbin/useradd -m -g oinstall -G dba oracle

id oracle



Ex:

# /usr/sbin/groupadd oinstall

# /usr/sbin/groupadd dba

# /usr/sbin/useradd -m -g oinstall -G dba oracle

# id oracle

uid=501(oracle) gid=502(oinstall) groups=502(oinstall),503(dba)

Set the password on the oracle account:

passwd oracle



Ex:

# passwd oracle

Changing password for user oracle.

New password:

Retype new password:

passwd: all authentication tokens updated successfully.

Create Directories

Now create directories to store the Oracle Database 10g Release 2 software and the database files.

The following assumes that the directories are being created in the root filesystem. This is done for the sake of simplicity and is not recommended as a general practice. These directories would normally be created as separate filesystems.

Issue the following commands as root:

mkdir -p /u01/app/oracle

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

chmod -R 775 /u01/app/oracle



Ex:

# mkdir -p /u01/app/oracle

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

# chmod -R 775 /u01/app/oracle

Configuring the Linux Kernel Parameters

Oracle Database 10g Release 2 requires the kernel parameter settings shown below. The values given are minimums, so if your system uses a larger value, don't change it.

kernel.shmall = 2097152

kernel.shmmax = 536870912

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

fs.file-max = 65536

net.ipv4.ip_local_port_range = 1024 65000

net.core.rmem_default=262144

net.core.wmem_default=262144

net.core.rmem_max=262144

net.core.wmem_max=262144

If you're following along and have just installed Linux, the kernel parameters will all be at their default values and you can just cut and paste the following commands while logged in as root.

cat >> /etc/sysctl.conf <> /etc/sysctl.conf < kernel.shmall = 2097152

> kernel.shmmax = 536870912

> kernel.shmmni = 4096

> kernel.sem = 250 32000 100 128

> fs.file-max = 65536

> net.ipv4.ip_local_port_range = 1024 65000

> EOF

# /sbin/sysctl -p

net.ipv4.ip_forward = 0

net.ipv4.conf.default.rp_filter = 1

net.ipv4.conf.default.accept_source_route = 0

kernel.sysrq = 0

kernel.core_uses_pid = 1

kernel.shmall = 2097152

kernel.shmmax = 536870912

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

fs.file-max = 65536

net.ipv4.ip_local_port_range = 1024 65000

net.core.rmem_default = 262144

net.core.wmem_default = 262144

net.core.rmem_max = 262144

net.core.wmem_max = 262144

Run the following commands as root to verify your settings:

/sbin/sysctl -a  grep shm

/sbin/sysctl -a grep sem

/sbin/sysctl -a grep file-max

/sbin/sysctl -a grep ip_local_port_range

/sbin/sysctl -a grep rmem_default

/sbin/sysctl -a grep rmem_max

/sbin/sysctl -a grep wmem_default

/sbin/sysctl -a grep wmem_max



Ex:

# /sbin/sysctl -a grep shm

kernel.shmmni = 4096

kernel.shmall = 2097152

kernel.shmmax = 536870912

kernel.shm-use-bigpages = 0

# /sbin/sysctl -a grep sem

kernel.sem = 250 32000 100 128

# /sbin/sysctl -a grep file-max

fs.file-max = 65536

# /sbin/sysctl -a grep ip_local_port_range

net.ipv4.ip_local_port_range = 1024 65000

# /sbin/sysctl -a grep rmem_default

net.core.rmem_default = 262144

# /sbin/sysctl -a grep rmem_max

net.core.rmem_max = 262144

# /sbin/sysctl -a grep wmem_default

net.core.wmem_default = 262144

# /sbin/sysctl -a grep wmem_max

net.core.wmem_max = 262144

For Novell SUSE Linux releases, use the following to ensure that the system reads the /etc/sysctl.conf file at boot time:

/sbin/chkconfig boot.sysctl on

Setting Shell Limits for the oracle User

Oracle recommends setting limits on the number of processes and open files each Linux account may use. To make these changes, cut and paste the following commands as root:

cat >> /etc/security/limits.conf <> /etc/pam.d/login <

For RHEL4, use the following:

cat >> /etc/profile < if [ \$SHELL = "/bin/ksh" ]; then

ulimit -p 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

umask 022

fi

EOF



cat >> /etc/csh.login < limit maxproc 16384

limit descriptors 65536

umask 022

endif

EOF

For SLES 9, use the following:

cat >> /etc/profile.local < if [ \$SHELL = "/bin/ksh" ]; then

ulimit -p 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

umask 022

fi

EOF



cat >> /etc/csh.login.local < limit maxproc 16384

limit descriptors 65536

umask 022

endif

EOF


Part III: Installing Oracle

Use the graphical login to log in as oracle.

Create a directory to contain the Oracle Database 10g Release 2 distribution:

mkdir 10gR2_db

Unzip and extract the file:

cd 10gR2_db

unzip 10201_database_linux32.zip

Install the Software and Create a Database

Log in using the oracle account.

Change directory to the location where you extracted the Oracle Database 10g Release 2 software.

Ex:

$ cd $HOME/10gR2_db

Change directory to Disk1.

Ex:

$ cd database

Start the Oracle Universal Installer.

$ ./runInstaller

1. Select Installation Method

o Select Basic Installation

o Oracle Home Location: /u01/app/oracle/product/10.2.0/db_1

o Installation Type: Enterprise Edition (1.3GB)

o UNIX DBA Group: oinstall

o Make sure Create Starter Database is checked

o Global Database Name: demo1

o Enter the Database Password and Confirm Password

o Click on Next

2. Specify Inventory Directory and Credentials

o Inventory Directory: /u01/app/oracle/oraInventory

o Operating System group name: oinstall

o Click on Next

3. Product-specific Prerequisite Checks

o If you've been following the steps in this guide, all the checks should pass without difficulty. If one or more checks fail, correct the problem before proceeding.

o Click on Next

4. Summary

o A summary of the products being installed is presented.

o Click on Install.

5. Configuration Assistants

o The Oracle Net, Oracle Database, and iSQL*Plus configuration assistants will run automatically

6. Execute Configuration Scripts

o At the end of the installation, a pop up window will appear indicating scripts that need to be run as root. Login as root and run the indicated scripts.

o Click on OK when finished.

7. End of Installation

o Make note of the URLs presented in the summary, and click on Exit when ready.

8. Congratulations! Your new Oracle Database 10g Release 2 database is up and ready for use.


Configuring Storage

Partition the Disks

In order to use either file systems or ASM, you must have unused disk partitions available. This section describes how to create the partitions that will be used for new file systems and for ASM.

WARNING: Improperly partitioning a disk is one of the surest and fastest ways to wipe out everything on your hard disk. If you are unsure how to proceed, stop and get help, or you will risk losing data.

This example uses /dev/sdb (an empty SCSI disk with no existing partitions) to create a single partition for the entire disk (36 GB).

Ex:

# fdisk /dev/sdb

Device contains neither a valid DOS partition table, nor Sun, SGI or
OSF disklabel

Building
a new DOS disklabel. Changes will remain in memory only,

until you decide to write them. After that, of course, the previous

content won't be recoverable.





The number of cylinders for this disk is set to 4427.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

(e.g., DOS FDISK, OS/2 FDISK)



Command (m for help): p



Disk /dev/sdb: 255 heads, 63 sectors, 4427 cylinders

Units = cylinders of 16065 * 512 bytes



Device Boot Start End Blocks Id System



Command (m for help): n

Command action

e extended

p primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-4427, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-4427, default 4427):

Using default value 4427



Command (m for help): w

The partition table has been altered!



Calling ioctl() to re-read partition table.



WARNING: If you have created or modified any DOS 6.x

partitions, please see the fdisk manual page for additional

information.

Syncing disks.

Now verify the new partition:

Ex:

# fdisk -l /dev/sdb



Disk /dev/sdb: 36.4 GB, 36420075008 bytes

255 heads, 63 sectors/track, 4427 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes



Device Boot Start End Blocks Id System

/dev/sdb1 * 1 4427 35559846 83 Linux

Repeat the above steps for each disk to be partitioned. The following section on Filesystems uses a single disk partition, /dev/sdb1. The ASM example uses three partitions on three disks: /dev/sdb1, /dev/sdc1, and /dev/sdd1

Filesystems

Filesystems are the most widely used means of storing data file, redo logs, and control files for Oracle databases. Filesystems are easy to implement and require no third-party software to administer.

In most cases, filesystems are created during the initial installation of Linux. However, there are times when a new filesystem must be created after the initial installation, such as when a new disk drive is being installed.

This section describes building a new filesystem and using it in an Oracle database. Unless otherwise noted, all commands must be run as root.

Create the Filesystem

Use ext3 to create this new filesystem. Other filesystems work just as well, but ext3 offers the fastest recovery time in the event of a system crash.

Ex:

# mke2fs -j /dev/sdb1

mke2fs 1.26 (3-Feb-2002)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

4447744 inodes, 8889961 blocks

444498 blocks (5.00%) reserved for the super user

First data block=0

272 block groups

32768 blocks per group, 32768 fragments per group

16352 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632,

2654208, 4096000, 7962624



Writing inode tables: done

Creating journal (8192 blocks): done

Writing superblocks and filesystem accounting information: done



This filesystem will be automatically checked every 23 mounts or

180 days, whichever comes first. Use tune2fs -c or -i to override.

Create the Mount Point

A filesystem must have a mount point, which is simply an empty directory where the new filesystem "attaches" to the system's directory tree.

Because you have already created the /u01 directory in Part I, use /u02 for this example.

Ex:

# mkdir /u02

Add the New Filesystem to /etc/fstab

So that the new filesystem will be mounted automatically when the system boots, you need to add a line to the /etc/fstab file that describes the new filesystem and where to mount it. Add a line similar to the one below to /etc/fstab, using a text editor.

/dev/sdb1 /u02 ext3 defaults 1 1

Mount the New Filesystem

Mounting the filesystem makes it available for use. Until the filesystem is mounted, files cannot be stored in it. Use the following commands to mount the filesystem and verify that it is available.

mount /u02

df -h /u02



Ex:

# mount /u02

# df -h /u02

Filesystem Size Used Avail Use% Mounted on

/dev/sdb1 33G 33M 31G 1% /u02

Create Oracle Directories and Set Permissions

Now you create a directory to store your Oracle files. The directory name used in the example follows the OFA standard naming convention for a database with ORACLE_SID=demo1.

mkdir -p /u02/oradata/demo1

chown -R oracle:oinstall /u02/oradata

chmod -R 775 /u02/oradata

Create a New Tablespace in the New Filesystem

The new filesystem is ready for use. Next you create a new tablespace in the filesystem to store your database objects. Connect to the database as the SYSTEM user, and execute the CREATE TABLESPACE statement, specifying the data file in the new filesystem.

Ex:

$ sqlplus



SQL*Plus: Release 10.2.0.1.0 - Production on Sun Nov 27
15:50:50 2005



Copyright (c) 1982, 2005, Oracle. All rights reserved.



Enter user-name: system

Enter password:



Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options



SQL> create tablespace data1

2 datafile '/u02/oradata/demo1/data1_01.dbf' size 100m

3 extent management local

4 segment space management auto;



Tablespace created.

Now you can use the new tablespace to store database objects such as tables and indexes.

Ex:

SQL> create table demotab (id number(5) not null primary key,

2 name varchar2(50) not null,

3 amount number(9,2))

4 tablespace data1;



Table created.


Accessing the Database with SQL*Plus

Log into Linux as oracle. Set the environment.

Set the Oracle environment variables:

$ . oraenv

ORACLE_SID = [oracle] ? demo1

Run SQL*Plus:

$ sqlplus



SQL*Plus: Release 10.2.0.1.0 - Production on Sun Nov 27
15:40:29 2005



Copyright (c) 1982, 2005, Oracle. All rights reserved.



Enter user-name: / as sysdba



Connected to:

Oracle Database 10g
Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options



SQL>

Using Oracle Enterprise Manager 10g Database Control

In a Web browser, connect to the URL provided during the installation.

Ex:
http://ds1.orademo.org:1158/em (You may have to use the IP address instead of the host name if your database server isn’t in your DNS.)

User Name: SYS
Password:
Connect As: SYSDBA

Click on

Welcome to the world of Oracle Enterprise Manager 10g Database Control!

Starting and Stopping Oracle Enterprise Manager Database Control:

$ emctl start dbconsole

$ emctl stop dbconsole

Accessing the Database Using iSQL*Plus

iSQL*Plus is a Web-based version of the venerable SQL*Plus interactive tool for accessing databases. To use iSQL*Plus, click on the iSQL*Plus link in the Related Links section of the OEM console or point your browser to the iSQL*Plus URL provided during installation.

Ex:
http://ds1.orademo.org:5560/isqlplus (You may have to use the IP address instead of the host name if your database server isn’t in your DNS.)

User Name: SYSTEM
Password:

Click on .

Enter SQL commands in the Workspace box, and click on Execute.

Starting and Stopping iSQL*Plus:

$ isqlplusctl start

$ isqlplusctl stop

Starting and Stopping the Listener:

The listener accepts connection requests from clients and creates connections to the database once the credentials have been authenticated. Before you can use OEM or iSQL*Plus, the listener must be up.

$ lsnrctl start

$ lsnrctl stop

Starting and Stopping the Database:

The easiest way to start and stop the database is from the OEM Console. To do that from the command line, use SQL*Plus while logged in as oracle, as follows:

Startup:

$ sqlplus



SQL*Plus: Release 10.2.0.1.0 - Production on Sun Nov 27
15:39:27 2005



Copyright (c) 1982, 2005, Oracle. All rights reserved.



Enter user-name: / as sysdba

Connected to an idle instance.



SQL> startup

ORACLE instance started.



Total System Global Area 285212672 bytes

Fixed Size 1218968 bytes

Variable Size 96470632 bytes

Database Buffers 180355072 bytes

Redo Buffers 7168000 bytes

Database mounted.

Database opened.



SQL> exit

Shutdown:

$ sqlplus



SQL*Plus: Release 10.2.0.1.0 - Production on Sun Nov 27
15:40:29 2005



Copyright (c) 1982, 2005, Oracle. All rights reserved.



Enter user-name: / as sysdba



Connected to:

Oracle Database 10g
Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options



SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.


SQL> exit

This is oracle documention and can be found at http://otn.oracle.com

No comments: