1.手动配置数据库监听器,完成默认端口1521和非默认端口1621的配置并同时启动(动态注册)
2.防止出现ORA-01555
3.数据库会话连接不超过200,job作业不超过20
4.创建表空间
5.添加日志文件组成员
6.添加一个控制文件
7.对表进行分析
1.
vim $ORACLE_HOME/network/admin/listener.ora
http://docs.oracle.com/cd/B19306_01/network.102/b14213/listener.htm#NETRF008
shows a listener.ora file for a listener named LISTENER, which is the default name of the listener,and a named LISTENER2,which is at the port 1621.
LISTENER=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=ocm01)(PORT=1521))
(ADDRESS=(PROTOCOL=ipc)(KEY=extproc))))
LISTENER2=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=ocm01)(PORT=1621))
(ADDRESS=(PROTOCOL=ipc)(KEY=extproc))))
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=ocmdb)
(ORACLE_HOME=/oracle10g)
(SID_NAME=ocmdb))
(SID_DESC=
(SID_NAME=plsextproc)
(ORACLE_HOME=/oracle10g)
(PROGRAM=extproc)))
--动态注册可以没有listener.ora --??
vim $ORACLE_HOME/network/admin/tnsnames.ora
http://docs.oracle.com/cd/B19306_01/network.102/b14213/tnsnames.htm#NETRF007
ocmdb1521=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=ocm01)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=ocmdb)))
ocmdb1621=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=ocm01)(PORT=1621))
(CONNECT_DATA=
(SERVICE_NAME=ocmdb)))
listener2=
(ADDRESS=(PROTOCOL=tcp)(HOST=ocm01)(PORT=1621))
export ORACLE_SID=ocmdb
sqlplus / as sysdba
alter system set local_listener='LISTENER2'; --see the fuction of the parameter http://blog.csdn.net/hughwang1216/article/details/23884619
show parameter local_listener
lsnrctl start LISTENER
lsnrctl status LISTENER
lsnrctl start LISTENER2
lsnrctl status LISTENER2
alter system register
2.
alter system set undo_retention=6000;
alter tablespace UNDOTBS retention guarantee;
ora-01555
12点查询A员工的工资,由于语句较大需要执行2分钟,但是在语句执行一分钟的时候
B经理修改了A员工工资并commit,在这种情况下,语句执行后,(在返回用户之前)
数据库会check 数据块的scn,如果发现scn在查询之后发生,就会去undo段中查询修改
后的A员工工资,但是在commit后,undo段中的数据可能被覆盖,一旦覆盖就会无法找
到修改后的A员工工资,此时就会发生ora-01555错误。
--增大undo的保存时间,设置undo的guarantee功能,保证undo数据在时间里不被覆盖
3.
alter system set processes=200 scope=spfile;
alter system set job_queue_processes=20;
4.
create temporary tablespace t2 tempfile '/u01/oracle/oradata/ocmdb/disk1/t102.dbf' size 10m autoextend on tablespace group t_group
alter database default temporary tablespace t_group;
create bigfile tablespace example datafile '/u01/oracle/oradata/ocmdb/disk1/example.dbf' size 50m autoextend on next 1m maxsize 500G extent management local uniform size 1m;
create tablespace ocmdbindex datafile '/u01/oracle/oradata/ocmdb/disk1/ocmdbindex01.dbf' size 80m;
--索引单独建立表空间,不同的磁盘的话可以,存储公用的话就没必要给索引单独建立表空间
create tablespace users datafile '/u01/oracle/oradata/ocmdb/disk1/users01.dbf' size 60m;
alter database default tablespace users;
alter database add logfile member '/u01/oracle/oradata/ocmdb/disk2/redo01.log' to group 1,'/u01/oracle/oradata/ocmdb/disk2/redo02.log' to group 2,'/u01/oracle/oradata/ocmdb/disk2/redo03.log' to group 3
select group#,member from v$logfile;
6.
create pfile from spfile;
shutdown immediate
modify initsid.ora
create spfile from pfile;
startup
show parameter control_files
7.
exec dbms_stats.gather_table_stats(ownname=>'hugh',tabname=>'T1',method_opt=>'for all indexed columns size 254',cascade=>true);
olap
统计报表,决策支撑,一定要保证执行计划正确,定期对表进行数据统计
oltp
日常交易系统,b-tree擅长单条数据,几条数据定位,如果没有特殊要求基本走索引就
可以了,不太需要对表进行数据统计,依赖动态抽样统计就可以了。
2.防止出现ORA-01555
3.数据库会话连接不超过200,job作业不超过20
4.创建表空间
5.添加日志文件组成员
6.添加一个控制文件
7.对表进行分析
1.
vim $ORACLE_HOME/network/admin/listener.ora
http://docs.oracle.com/cd/B19306_01/network.102/b14213/listener.htm#NETRF008
shows a listener.ora file for a listener named LISTENER, which is the default name of the listener,and a named LISTENER2,which is at the port 1621.
LISTENER=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=ocm01)(PORT=1521))
(ADDRESS=(PROTOCOL=ipc)(KEY=extproc))))
LISTENER2=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=ocm01)(PORT=1621))
(ADDRESS=(PROTOCOL=ipc)(KEY=extproc))))
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=ocmdb)
(ORACLE_HOME=/oracle10g)
(SID_NAME=ocmdb))
(SID_DESC=
(SID_NAME=plsextproc)
(ORACLE_HOME=/oracle10g)
(PROGRAM=extproc)))
--动态注册可以没有listener.ora --??
vim $ORACLE_HOME/network/admin/tnsnames.ora
http://docs.oracle.com/cd/B19306_01/network.102/b14213/tnsnames.htm#NETRF007
ocmdb1521=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=ocm01)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=ocmdb)))
ocmdb1621=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=ocm01)(PORT=1621))
(CONNECT_DATA=
(SERVICE_NAME=ocmdb)))
listener2=
(ADDRESS=(PROTOCOL=tcp)(HOST=ocm01)(PORT=1621))
export ORACLE_SID=ocmdb
sqlplus / as sysdba
alter system set local_listener='LISTENER2'; --see the fuction of the parameter http://blog.csdn.net/hughwang1216/article/details/23884619
show parameter local_listener
lsnrctl start LISTENER
lsnrctl status LISTENER
lsnrctl start LISTENER2
lsnrctl status LISTENER2
alter system register
2.
alter system set undo_retention=6000;
alter tablespace UNDOTBS retention guarantee;
ora-01555
12点查询A员工的工资,由于语句较大需要执行2分钟,但是在语句执行一分钟的时候
B经理修改了A员工工资并commit,在这种情况下,语句执行后,(在返回用户之前)
数据库会check 数据块的scn,如果发现scn在查询之后发生,就会去undo段中查询修改
后的A员工工资,但是在commit后,undo段中的数据可能被覆盖,一旦覆盖就会无法找
到修改后的A员工工资,此时就会发生ora-01555错误。
--增大undo的保存时间,设置undo的guarantee功能,保证undo数据在时间里不被覆盖
3.
alter system set processes=200 scope=spfile;
alter system set job_queue_processes=20;
4.
create temporary tablespace t2 tempfile '/u01/oracle/oradata/ocmdb/disk1/t102.dbf' size 10m autoextend on tablespace group t_group
alter database default temporary tablespace t_group;
create bigfile tablespace example datafile '/u01/oracle/oradata/ocmdb/disk1/example.dbf' size 50m autoextend on next 1m maxsize 500G extent management local uniform size 1m;
create tablespace ocmdbindex datafile '/u01/oracle/oradata/ocmdb/disk1/ocmdbindex01.dbf' size 80m;
--索引单独建立表空间,不同的磁盘的话可以,存储公用的话就没必要给索引单独建立表空间
create tablespace users datafile '/u01/oracle/oradata/ocmdb/disk1/users01.dbf' size 60m;
alter database default tablespace users;
alter database add logfile member '/u01/oracle/oradata/ocmdb/disk2/redo01.log' to group 1,'/u01/oracle/oradata/ocmdb/disk2/redo02.log' to group 2,'/u01/oracle/oradata/ocmdb/disk2/redo03.log' to group 3
select group#,member from v$logfile;
6.
create pfile from spfile;
shutdown immediate
modify initsid.ora
create spfile from pfile;
startup
show parameter control_files
7.
exec dbms_stats.gather_table_stats(ownname=>'hugh',tabname=>'T1',method_opt=>'for all indexed columns size 254',cascade=>true);
olap
统计报表,决策支撑,一定要保证执行计划正确,定期对表进行数据统计
oltp
日常交易系统,b-tree擅长单条数据,几条数据定位,如果没有特殊要求基本走索引就
可以了,不太需要对表进行数据统计,依赖动态抽样统计就可以了。