/dev/shm 介绍 --转载
默认系统就会加载/dev/shm ,它就是所谓的tmpfs,有人说跟ramdisk(虚拟磁盘),但不一样。象虚拟磁盘一样,tmpfs 可以使用您的 RAM,但它也可以使用您的交换分区来存储。而且传统的虚拟磁盘是个块设备,并需要一个 mkfs 之类的命令才能真正地使用它,tmpfs 是一个文件系统,而不是块设备;您只是安装它,它就可以使用了。tmpfs有以下优势:1。动态文件系统的大小,2。tmpfs 的另一个主要的好处是它闪电般的速度。因为典型的 tmpfs 文件系统会完全驻留在 RAM 中,读写几乎可以是瞬间的。3。tmpfs 数据在重新启动之后不会保留,因为虚拟内存
mysql can't start dues to the disk space is full
use ./mysqld_safe --user=mysql &start mysql.The mysql can not start. There are much mysql restart info show on the screen always. And can not find the /var/lib/mysql/mysql.sock file.The reason:Then find the space is full. So the mysql can not start naturally. Delete some log info, then the mysql start correctly.The big log files are two:1. Our application log2. The /var/log/audit.d在/var/log/audit.d目录下的文件是由Linux审计子系统(Linux Audit Subsystem,简称LAuS)产生的。 为了安全目的,LAuS在启
umask side-effect
When we deploy production today, a strange problem comes out.When accessing the url, tell Can't locate loadable object for module DBI in @INC. First, we think it is the DBI install problem, but after install several time, it has no use.Then we find the umask is 077, so when we install, the dir will be 700, so it can not be access by regular user through http. So we should change umask to 022 before we install.[@more@]
mysql can't connect error about privilege----not root user
mysql -uuser -ppass dbERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)when use root user,It is ok.Obviously, it is privilege problem.Try to check the mysql.sock privelege. If it is ok, then check its father dir to check.[@more@]
mysql drop key
It is easy.alter table TABLE_NAME drop key KEY_NAME;[@more@]
the "in" use in mysql
use in in mysql,if the field is indexed,the index is still useful,but when the data quantity is small relative to the param in "in" parentheses,mysql optimizer will use ALL TABLE SCAN instead.[@more@]
例子
第1步,用standby ==> active standby, 或者backup & restore ==> apply archive log 第2步,single instance ==> RAC总体down 机时间应该可以控制在 5 min 之内这个,Tom_Zhang 在 39楼已经说了……quote: 最初由 Tom_Zhang 发布[B]这个就更简单了,大致的过程是,迁移完毕后,在目标机第一个第一个上...与数据库有关的操作基本上是:1)修改参数文件,增加RAC的相关参数,比如 *.cluster_database = TRUE *.cluster_database_instances = 2 *.undo_management=AUTOSID1.thread=1SID2.thread=2SID1.instance_
block的分配
我创建了一个表,CREATE TABLE TEST(A VARCHAR2(10 BYTE))TABLESPACE USERSPCTUSED 40PCTFREE 10INITRANS 1MAXTRANS 255STORAGE (INITIAL 64KPCTINCREASE 0)初始extend大小是64K,oracle的块大小为8k.那就应该是8块SQL> select blocks,empty_blocks from user_tables where table_name = 'TEST';BLOCKS EMPTY_BLOCKS---------- ------------1 6怎么加起来只有7块。请问oracle中block的具体分配segment header一个blcok[@more@]
安装oracle+php+apache出现的新问题
首先安装ora10解压cpio: cpio -idmv < 文件名rpm -Uvh --force rpm包hehe,Note:169706.1 is very good, you can check it by yourself. Linux x86_64 EM64T AMD64 Patches/ PackagesRed Hat Enterprise Linux 4.0: binutils-2.15.92.0.2-13.0.0.0.2.x86_64 Download here or you can install binutils-2.15.92.0.2-18.x86_64.rpm from RHEL4 Update 3. compat-db-4.1.25-9 control-center-2.8.0-12 gcc-3.4.3-22.1 gcc-c++-3.4.3-22.1 glibc-2.3.4-2 glibc-common-2.3.4-2 gnome-libs-1.4.1.2.90-44.1.x86_64 libstdc++-3.4.3-22.1.x
裸设备
使用逻辑卷作为裸设备添加到tablespace中的方法----举例说明:>0)lvcreate -L2g -n VolGroup00-datafileX VolGroup00>1)AS root>chown oracle:dba /dev/mapper/VolGroup00-datafileX>raw /dev/raw/rawX /dev/mapper/VolGroup00-datafileX>chown oracle:dba /dev/raw/rawX>2) AS oracle>ln -s /dev/raw/rawX /opt/ora9/oradata/big9/vgdatafileX>3) AS oracle>sqlplus "/as sysdba">alter tablespace users add>datafile '/opt/ora9/oradata/big9/vgdatafileX' size 2040M reuse[@more@]
v$parameter--网上抄来
v$parameter,v$system_parameter及v$spparameter v$parameter,v$system_parameter及v$spparameter Oracle9i引入spfile后,许多参数可以动态的修改而不必重启数据库了,对DBA来说,这是天大的好事。v$parameter显示的是session级的参数,也就是当前session的参数信息。如果没有使用alter session单独设置当前session的参数值,那么默认和system级的参数应该是一样的。v$system_parameter显示的是system级的参数,保存的是使用alter system修改的值(scope=both或者scope=memory)。上面两个都是当前已经生效的参数值。对于使用spfile的库,
表空间基本操作
create tablespace usersdatafile '/opt/ora9/oradata/big58/users01.dbf' size 26M autoextend onEXTENT MANAGEMENT LOCAL AUTOALLOCATE//这样的表空间段空间是手动管理的drop tablespace users including contents and datafiles;连物理文件一起删除。create tablespace usersdatafile '/opt/ora9/oradata/big58/users01.dbf' size 26M autoextend onEXTENT MANAGEMENT LOCAL AUTOALLOCATEalter tablespace users add2 datafile '/opt/ora9/oradata/big58/users02.dbf' size 20M;alter tablespace users offline;//在操作系统下删除user
ORA-00600: internal error code, arguments: [kokle_lob2lob13:input mismatch], [1]
erroe解释 Errors in file /opt/ora10/admin/SID/bdump/SID_m000_3570.trc:ORA-00600: internal error code, arguments: [kokle_lob2lob13:input mismatch], [1], [], [], [], [], [], []在log中有这个错误查询该错误为This is the generic internal error number for Oracle program exceptions. It indicates that a process has encountered a low-level, unexpected condition请问这个错误具体是什么,由什么引起的?metalink:一个bug:Bug No.4292049Filed07-APR-2005Updated03-APR-2006ProductOracle Server - Enterprise EditionPro
使用exp8来对ora10做导出compress参数问题
使用exp8来对ora10做导出,如果参数compress设置成N,则导出时报 EXP-00003: no storage definition found for segment(12, 4134299) compress参数会影响导出到文件中的storage子句[@more@]
在oracle10中使用低版本exp
以ora8的exp为例,拷贝exp8至$ORACLE_HOME的bin,libclntsh.so.8.0和libwtc8.so两个库文件拷贝至lib32,同时整个拷贝oracle8的ocommon。Oracle 10g 关于 NLS 的环境变量发生了一点变化:For RDBMS 7.2.x version the variable is called ORA_NLS. For version 7.3.x the variable is called ORA_NLS32.For Oracle 8, 8i and 9 variable is called ORA_NLS33.For Oracle 10g the variable is called ORA_NLS10.ORA_NLS33 的设置值:ORA_NLS33 = $ORACLE_HOME/ocommon/nls/admin/data而 ORA_NLS10 只需要设置:ORA_NLS10 = $ORACLE_HOME/nls/data
oracle9,10修改字符集--简单方法
步骤:查看变量:show parameter nlsselect * from nls_database_parameters where parameter like '%CHARACTERSET%';select * from v$nls_parameters where parameter like '%CHARACTERSET%';修改:update props$ set value$ = 'ZHS16GBK' where name = 'NLS_CHARACTERSET'shutdown immediatestartup这样就把核心字符集修改成'ZHS16GBK' 了。方法简单实用。存在问题:做exp导出时失败,提示找不到字符集的错误,不知怎么解决?[@more@]
估计表中行的平均长度
假设行有3列估计表中行的平均长度:数据不多:select AVG(NVL(VSIZE(column1),0))+AVG(NVL(VSIZE(column2),0))+AVG(NVL(VSIZE(column3),0)) Avg_row_lengthfrom TABLENAME;表较大:analyze table TABLENAME compute statistics;表更大:analyze table TABLENAME estimate statistics;然后可从数据字典中选择统计值:select Avg_Row_Len from USER_TABLES where Table_Name = 'TABLENAME'[@more@]
用存储过程动态建立表
CREATE OR REPLACE PROCEDURE gsmplm_roam (Year_Month in varchar2)astable_name varchar2(20);create_sql varchar2(200);BEGIN --select to_char(sysdate,'yyyy-mm-dd') into tmpVar from dual; table_name:='roam_'||Year_Month; create_sql:='create table '||table_name||'(dd varchar2(20))'; DBMS_OUTPUT.PUT_LINE(table_name); DBMS_OUTPUT.PUT_LINE(create_sql); execute immediate create_sql; --using table_name;END gsmplm_roam ;/[@more@]
话单sql
要求:统计一个月中每个星期都有通话记录的号码Select count(Distinct z.mobile_number) From (Select Distinct substr(a.CALLINGPARTYNUMBER,3,11) mobile_number From gsmplm_msoriginating aWhere Not Exists(Select b.MSISDN_H From hdu_temp b Where substr(a.CALLINGPARTYNUMBER,3,7)=b.msisdn_h) And a.subarea_date Between to_date('2006-4-1','yyyy-mm-dd')And to_date('2006-4-7','yyyy-mm-dd')) z,(Select Distinct substr(a.CALLINGPARTYNUMBER,3,11) mobile_number From gsmplm_msoriginating aWhere Not Exists(Select b.M