日常信息收集
/*PRODUCT SUMMARY INFOMATION ABOUT ORACLE DATABASE*/
--NAME: DB_INFO.SQL
--AUTHOR:
--DATE: 2008/09/28
--SAVE THE LOG
SPOOL D:db_info.txt;
查看全文/*PRODUCT SUMMARY INFOMATION ABOUT ORACLE DATABASE*/
--NAME: DB_INFO.SQL
--AUTHOR:
--DATE: 2008/09/28
--SAVE THE LOG
SPOOL D:db_info.txt;
查看全文1、用户及组
#groupadd –g 1001 dba
# useradd –u 10001 -d /export/home/oracle -g dba –G dba –s /usr/bin/bash oracle
# passwd oracle
# mkdir /export/home/oracle
2、系统核心参数
vi /etc/system
set semsys:seminfo_semmni=100
set semsys:seminfo_semmsl=256
set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmmni=100
3、用户环境变量
vi .profile
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
# Select the appropriate ORACLE_BASE
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH; export PATH
1、检查硬件信息:
检查内容 最小值 检查命令参考
物理内存 512M # grep MemTotal /proc/meminfo
交换空间 1.0 GB或者2倍内存大小 # grep SwapTotal /proc/meminfo
/tmp 空间 400 MB # df -k /tmp
软件所需空间 2.5 GB # df -k (空间越大越好)
数据库文件 1.2 GB # df -k (空间越大越好)
2、下载Oracle Database 10g Release 2 (10.2.0.1) Software
3、解压包 unzip 10201_database_linux32.zip,目录为:db/Disk1
4、使用root编辑/etc/hosts加上一行:
<IP-address> <fully-qualified-machine-name> <machine-name>
--创建数据库,oracle_size=db1
--1、建立相关目录
D:Oracleadmindb1
D:Oracleadmindb1adhoc
D:Oracleadmindb1bdump
D:Oracleadmindb1cdump
D:Oracleadmindb1create
D:Oracleadmindb1exp
D:Oracleadmindb1pfile
D:Oracleadmindb1udump
D:Oracleoradatadb1
--2、创建密码文件
d:oracleora92binorapwd.exe file=d:oracleora92databasePWDdb1.ora
password=change_on_install
--3、通过oradim.exe命令,在服务里生成一个新的实例管理服务,启动方式为手工
set oracle_sid=db1
d:oracleora92binoradim.exe -new -sid db1 -startmode m -pfile 'd:oracleadmindb1
pfileinitdb1.ora'
查看全文术语:
(UR)UNDO_RETENTION 每秒
(UPS)每秒的重做块
(DBS)db_block_size
UndoSpace = [UR * (UPS * DBS)] + (DBS * 24)
--查看UR及DBS参数设置
SQL> select name,value from v$parameter where name= 'db_block_size'
2 union all
3 select name,value from v$parameter where name = 'undo_retention';
NAME VALUE
------------------------- ----------
db_block_size 8192
undo_retention 108000
--取两个时间段范围进行计算
SQL> select (to_date('20060704 10:23:09','yyyymmdd hh24:mi:ss') - to_date('20060704 8:53:38','yyyymmdd hh24:mi:ss'))
2 *24*3600 from dual;
(TO_DATE('2006070410:23:09','Y
------------------------------
5371
--计算每秒多少重做块UPS
SQL> select sum(undoblks)/5371 from v$undostat where begin_time>=to_date('20060704 8:53:38','yyyymmdd hh24:mi:ss')
2 and end_time<=to_date('20060704 10:23:09','yyyymmdd hh24:mi:ss');
SUM(UNDOBLKS)/5375
------------------
1.31274418604651
--计算表空间大小
SQL> select (108000*(1.31*8192) + 8192*24)/1024/1024 m from dual;
M
----------
1105.5
《转》
ORACLE的多国语言设置最主要的两个特性就是国家语言设置与字符集设置,国家语言设置决定了界面或提示使用的语言种类,字符集决定了数据库保存与字符集有关数据(如文本)时候的编码规则。环境变量NLS_LANG的不同,导致EXP帮助发生变化,这就是多国语言设置的作用(NLS_LANG包含国家语言设置与字符集设置,这里起作用的是国家语言设置,而不是字符集)。
查看全文一、Considerations Before Creating the Database
1、Planning for Database Creation
1)、Plan the database tables and indexes and estimate the amount of space they will require.
2)、Plan the layout of the underlying operating system files your database will comprise.
3)、Consider using Oracle-managed files and Automatic Storage Management to create and manage the operating system files that make up your database storage.
4)、Select the global database name by setting both the DB_NAME and DB_DOMAIN initialization parameters.
5)、Familiarize yourself with the initialization parameters contained in the initialization parameter file.spfile(server parameter file)
6)、Select the database character set.
7)、Consider what time zones your database must support.
8)、Select the standard database block size.
9)、Determine the appropriate initial sizing for the SYSAUX tablespace.
10)、Plan to use a default tablespace for non-SYSTEM users to prevent inadvertent saving of database objects in the SYSTEM tablespace.
11)、Plan to use an undo tablespace to manage your undo data.
12)、Develop a backup and recovery strategy to protect the database from failure.
13)、Familiarize yourself with the principles and options of starting up and shutting down an instance and mounting and opening a database.
2、Meeting Creation Prerequisites
1)、The desired Oracle software must be installed. This includes setting various environment variables unique to your operating system and establishing the directory structure for software and database files.
2)、You must have the operating system privileges associated with a fully operational database administrator.
3)、Sufficient memory must be available to start the Oracle Database instance.
4)、Sufficient disk storage space must be available for the planned database on the computer that runs Oracle Database.
1、dba
Installing and upgrading the Oracle Database server and application tools
Allocating system storage and planning future storage requirements for the database system
Creating primary database storage structures (tablespaces) after application developers have designed an application
Creating primary objects (tables, views, indexes) once application developers have designed an application
Modifying the database structure, as necessary, from information given by application developers
Enrolling users and maintaining system security
Ensuring compliance with Oracle license agreements
Controlling and monitoring user access to the database
Monitoring and optimizing the performance of the database
Planning for backup and recovery of database information
Maintaining archived data on tape
Backing up and restoring the database
Contacting Oracle for technical support
2、secutity officers
enrolls users,controls and monitors user access to the database,
and maintains system security.
3、network administrators
administers oracle networking products,such as oracle net services.
4、application developers
Application developers design and implement database applications:
Designing and developing the database application
Designing the database structure for an application
Estimating storage requirements for an application
Specifying modifications of the database structure for an application
Relaying this information to a database administrator
Tuning the application during development
Establishing security measures for an application during development
5、application administrators
to administer a particular application
6、Database users
Entering, modifying, and deleting data, where permitted
Generating reports from the data
Powered by pLog