Top Banner
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.
24

INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

Dec 17, 2015

Download

Documents

Hector Gordon
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

INTRODUCTION TO ORACLE

Lynnwood BrownSystem Managers LLC

Installation – Lecture 2

Copyright System Managers LLC 2007 all rights reserved.

Page 2: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

SYSTEM INSTALLATION

• Oracle Environmental Variables: ORACLE_HOME, ORACLE_SID, PATH

• In the Windows environmental variables are set by the installer on UNIX they are set manually

• Choose a directory that will contain the distribution. This directory will be pointed to by the environmental variable ORACLE_HOME.

• Choose an instance identifier for your database. This will be the known as the ORACLE_SID

Page 3: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

SYSTEM INSTALLATION

• Create an end user account that will own the installation

• The end user account must be in the DBA group (UNIX) or the ORA_DBA group (Windows)

• On UNIX use the value of ORACLE_HOME to create an OFA directory structure

• On Windows the OFA directory structure is created by the installer

Copyright System Managers LLC 2007 all rights reserved.

Page 4: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

SYSTEM INSTALLATION

Windows User and Group Setup.

Page 5: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

SYSTEM INSTALLATION

Windows Environmental Variables.

Page 6: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

SYSTEM INSTALLATION

UNIX Environmental and User Variables.

Page 7: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

SYSTEM INSTALLATION

Layout the file system structure using the Oracle Flexible Architecture.

ORACLE FLEXIBLE ARCHITECTURE

ORACLE_BASE

ADMIN TEMP RBS USER PRODUCT

VERSION NUMBER

ORACLE_HOME

ORACLE_SID

ORACLE_SID

ORACLE_SID ORACLE_SID

PFILE CDUMP BDUMP UDUMP

Copyright System Managers LLC 2003 all rights reserved.

Page 8: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

SYSTEM INSTALLATION: UNIX Only

• Configure the UNIX kernel by setting the values for NPROC, MAXUPRC, SEMMNS and SHMMAX (there may be others refer to the Oracle ICG)

• On UNIX: Set the environmental variable LD_LIBRARY_PATH – pointer to shared object libraries

• On UNIX: Mount the CD/unZip the media and start the Oracle installation utility RunInstaller.

Page 9: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

SYSTEM INSTALLATION

UNIX Kernel Settings

Page 10: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.
Page 11: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

Software Installation cont.

• The installation process will install the RDBMS software and create a starter database.

• The software is installed under the directory referred to as ORACLE_HOME.

• Choosing the “Install Software Only” option allows the DBA to created the database manually.

• The installer will create the Oracle database users SYS and SYSTEM.

Page 12: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

MANUAL DATABASE CREATIONCreating the Instance

C:\> ORADIM -NEW  -SID  <YOUR_SID>  -INTPWD  <password>  -STARTMODE <mode>-PFILE  <pfile>

• <YOUR_SID> - Database SID

• <password> - Password for database administrative user

• <mode> - Startup mode for the services, either AUTO or MANUAL

• <pfile> - Path and name of the INIT<sid>.ORA file

Page 13: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

MANUAL DATABASE CREATION

Deleting the Instance

C:\> ORADIM  -DELETE  -SRVC  <service_name>

NOTE: SERVICE_NAME = SID

            ORADIM ERRORS ARE IN THE DIRECTORY:

<ORACLE_HOME> \DATABASE\ORADIM.LOG

Copyright System Managers LLC 2007 all rights reserved.

Page 14: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

MANUAL DATABASE CREATIONStarting The Instance

• Ensure that the environmental variables have been set and the services have been started (NT/2003).

• Log into SQL*PLUS as the system user with administrative privileges

C:\> sqlplus “/ as sysdba”

SQL> startup nomount – Start the Oracle instance but do not mount or open the database. On UNIX this starts the Oracle processes and allocates the SGA

         Other startup options include MOUNT and EXCLUSIVE

Page 15: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

Manual Database Create

Page 16: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

Creating Additional Tablespaces

Creating And Enlarging Tablespaces

Automatically increase tablespace sizes using “AUTOEXTEND”

CREATE TABLESPACE DATA DATAFILE '/u01/oracle/rbdb1/users01.dbf' SIZE 300M REUSE AUTOEXTEND ON NEXT 5M MAXSIZE 1500M;

Add another data file if not using AUTOEXTEND

SQL > alter tablespace DATA add datafile '/u01/oracle/rbdb1/users02.dbf' size 20M;

Page 17: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

MANUAL DATABASE CREATION

Shutting Down the Database

Must be the administrative user:

SQL> shutdown normal            Other SHUTDOWN options include:

• IMMEDIATE – Allow transactions to complete and then log off all users

• ABORT – Log off all users (no grace period)

Page 18: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

SYSTEM POST-INSTALLATION

• The data dictionary is a collection of tables and views that are are used by the RDBMS to keep track of system performance and all database activities

• Owned by the Oracle user “SYS”• All data dictionary objects reside in the system

tablespace.• The tables and views in the data dictionary should

never be modified.

Page 19: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

SYSTEM INSTALLATION

SOME ORACLE DATA DICTIONARY TABLES/VIEWS:

Table/View Name Description/Useage V$DATABASE Database name, log mode, creation dateV$SESSION List of who is logged into the databaseV$SYSSTAT Performance statisticsV$CONTROLFILE Location of database control filesV$LOGFILE Location of database log filesV$BACKUP Information on database backupsV$DATAFILE Information about database data filesV$INSTANCE Information about the instance

There are many other tables/views in the Oracle data dictionary. Refer to the Oracle8 Administrators Guide for a complete list/description

Copyright System Managers LLC 2007 all rights reserved.

Page 20: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

SYSTEM INSTALLATION

SOME ORACLE DATA DICTIONARY TABLES/VIEWS:

Table/View Name Description/Useage DBA_DATA_FILES Data file to tablespace mapDBA_USERS Names of all users of the databaseDBA_CATALOG Names of all database objectsDBA_TABLES List of all tables in the databaseDBA_INDEXES List of all indexes in the databaseDBA_TABLESPACES Descriptions of all database tablespacesDBA_SYNONYMS List of all synonyms in the databaseDBA_VIEWS List of all views in the database

There are many other tables/views in the Oracle data dictionary. Refer to the Oracle Administrators Guide for a complete list/description

Page 21: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

Solving Installation Errors (Windows)

• Review the installation log file and the database alert log.

• Check that all environmental variables have been set.

• Check the directory write permissions

• Check the Windows patch level

• Do we have enough RAM and disk?

Page 22: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

Solving Installation Errors (UNIX)

• Check that all environmental variables have been set.• Use Oracle utility “oerr” to look up cause/solutions for

errors.• Check ownership and permissions on the Oracle

executable “oracle“ (4755).• Check that shared memory has been allocated: ipcs –b• Check that the correct version of the “C” compiler and

utilities such as “make” and “ld” are installed on the system.

• Check that the “make” utility is accessible.• Check software pre-requisites.

Page 23: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

Database Maintenance Best Practices

• Check the DBA Alert log file daily and watch for any unusual errors(eg: especially ORA-600's and Ora-7445's) and/or any resource constraint ORA errors.

• Revoke access to default oracle accounts.• All patches should first be introduced on a test instance and

validated prior to moving to development instance• Multiplex the online redo logs

• Maintain multiple concurrent backups of the control file

• Take frequent backups of physical datafiles and store them in a safe place, making multiple copies if possible.

• Periodically doing a complete restore to test diaster recovery procedures.

Page 24: INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.

Getting Help

Oracle Technical Support

• Web access through MetalLink• Log a service request (SR) using Technical Assistance Report (TAR)

system.

Types of TARs:

Severity 1 - Complete loss of service for mission critical operations where work cannot reasonably continue.

Severity 2 - Significant or degraded loss of service or resources. Severity 3 - Minor loss of services or resources. Severity 4 - No work being impeded at the time - information is

requested or reported.