* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download ORACLE LECTURE SERIES
Survey
Document related concepts
Microsoft Access wikipedia , lookup
Microsoft SQL Server wikipedia , lookup
Entity–attribute–value model wikipedia , lookup
Extensible Storage Engine wikipedia , lookup
Open Database Connectivity wikipedia , lookup
Functional Database Model wikipedia , lookup
Concurrency control wikipedia , lookup
Microsoft Jet Database Engine wikipedia , lookup
Ingres (database) wikipedia , lookup
Relational model wikipedia , lookup
Clusterpoint wikipedia , lookup
Database model wikipedia , lookup
Transcript
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 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. SYSTEM INSTALLATION Windows User and Group Setup. SYSTEM INSTALLATION Windows Environmental Variables. SYSTEM INSTALLATION UNIX Environmental and User Variables. SYSTEM INSTALLATION Layout the file system structure using the Oracle Flexible Architecture. ORACLE FLEXIBLE ARCHITECTURE O R AC LE_BASE A D M IN TEM P RBS U SER PRO DUCT V E R S IO N N U M B E R O R A C L E _ S ID O R A C L E _ S ID O R A C L E _ S ID O R A C L E _ S ID O R AC LE_H O M E P F IL E CDUMP BDUMP UDUMP Copyright System Managers LLC 2003 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. SYSTEM INSTALLATION UNIX Kernel Settings 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. MANUAL DATABASE CREATION Creating 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 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. MANUAL DATABASE CREATION Starting 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 Manual Database Create 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; 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) 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. SYSTEM INSTALLATION SOME ORACLE DATA DICTIONARY TABLES/VIEWS: Table/View Name V$DATABASE V$SESSION V$SYSSTAT V$CONTROLFILE V$LOGFILE V$BACKUP V$DATAFILE V$INSTANCE Description/Useage Database name, log mode, creation date List of who is logged into the database Performance statistics Location of database control files Location of database log files Information on database backups Information about database data files 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. SYSTEM INSTALLATION SOME ORACLE DATA DICTIONARY TABLES/VIEWS: Table/View Name DBA_DATA_FILES DBA_USERS DBA_CATALOG DBA_TABLES DBA_INDEXES DBA_TABLESPACES DBA_SYNONYMS DBA_VIEWS Description/Useage Data file to tablespace map Names of all users of the database Names of all database objects List of all tables in the database List of all indexes in the database Descriptions of all database tablespaces List of all synonyms in the database 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 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? 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. 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. 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.