Bookmark and Share
Oracle DBA
Display: 21 - 26 of 26, Total Pages: 3
<< < 1 2 3
[Blog] 怎样计算oracle表中一个row的长度,如何知道CLOB的长度 [Original] 2005-11-1 3:15pm

很简单啦。

SQLPLUS> analyze table XXX compute statistics;

SQLPLUS>select AVG_ROW_LEN from user_tables where table_name='XXX';

如果是要计算CLOB长度:

SQLPLUS>select length(C230000010) from t166;

或者用dbms_lob.getlength(LOB type);

如果要计算VARCHAR的长度用length(trim(Column name)) 。

Read Full Article...

Section:Oracle DBA | Read:9440 | Comment:29 | Rating:0%

[Blog] Oracle CLOB datatype [Original] 2005-11-1 3:14pm

在定义CLOB时有两种方式,一种是in-row, 另一种是out-row。如果是out-row,那只有CLOB locator存放在row中,一般使用这种方式来定义CLOB。例子:

CREATE TABLE T166

(

...

C230000010 CLOB NULL,
...

)

LOB (C230000010) STORE AS
( TABLESPACE USERS
DISABLE STORAGE IN ROW
CHUNK 8192
PCTVERSION 10
NOCACHE
NOLOGGING)

如果想定义为in-row,那就把disable改为enable就可以啦。

Read Full Article...

Section:Oracle DBA | Read:5515 | Comment:0 | Rating:0%

[Blog] Oracle character set [Original] 2005-10-14 1:32pm

--检查Oracle数据库使用了什么character set:

SQL>select * from nls_session_parameters where parameter like 'NLS_LANG%' or parameter like 'NLS_TERR%';

SQL>select * from nls_database_parameters where parameter like 'NLS_CHAR%';

--设置Linux 或者 unix 环境变量

export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK" 

export NLS_LANG="FRENCH_FRANCE.WE8ISO8859P1"

Read Full Article...

Section:Oracle DBA | Read:9391 | Comment:28 | Rating:0%

[Blog] 怎样查看Oracle数据库中tablespace的大小? [Original] 2005-8-9 2:22pm

下面是一个script, 可以查看数据库中所有tablespace(表空间)的大小,我也是从网络上查来的,虽然只有几行语句,但是经常用到,对于喜欢command lines的朋友们很有用。

rem -----------------------------------------------------------------------
rem Purpose:    Show Used/free space in Meg by tablespace name
rem -----------------------------------------------------------------------

tti "Space Usage for Database in Meg"

SELECT Total.name "Tablespace Name",
       nvl(Free_space, 0) Free_space,
       nvl(total_space-Free_space, 0) Used_space,
       total_space
FROM
  (select tablespace_name, sum(bytes/1024/1024) Free_Space
     from sys.dba_free_space
    group by tablespace_name
  ) Free,
  (select b.name,  sum(bytes/1024/1024) TOTAL_SPACE
     from sys.v_$datafile a, sys.v_$tablespace B
    where a.ts# = b.ts#
    group by b.name
  ) Total
WHERE Free.Tablespace_name(+) = Total.name
ORDER BY Total.name
/

tti off

--------------------------------------

Sample output:

Tue Aug 09                                                             page    1
                        Space Usage for Database in Meg

Tablespace Name                FREE_SPACE     USED_SPACE     TOTAL_SPACE
----------------------------------     -------------------  --------------- ------------------------------------------------
CWMLITE                                    10.625             9.375                      20
DRSYS                                      10.3125           9.6875                      20
EXAMPLE                                      .3125        137.8125              138.125
INDX                                          22.875             2.125                      25

Read Full Article...

Section:Oracle DBA | Read:22517 | Comment:5 | Rating:0%

[Blog] 如何改变Oracle当前用户的日期显示格式? [Original] 2005-8-4 3:24pm

SQL>alter session set NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS";

SQL>alter session set NLS_DATE_FORMAT="MM/DD/YYYY HH:MI:SS AM";

查看系统日期:

SQL>select sysdate from dual;

Read Full Article...

Section:Oracle DBA | Read:16053 | Comment:0 | Rating:0%

[Blog] 怎样确定Oracle数据库中的字符集? [Original] 2005-7-6 2:36pm

在SQLPLUS中运行如下命令:

SQL>select SYS.PROPS$.VALUE$ from SYS.PROPS$ where ((SYS.PROPS$.NAME ='NLS_CHARACTERSET')) ;

SQL> select * from nls_database_parameters where parameter like 'NLS_CHAR%';

这一般是和环境变量NLS_LANG配合着使用的,比如说中文是:

$export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"

字符集一般是在安装Oracle时确定的,一旦确定之后,想改变数据库的字符集就需要重新按照Oracle数据库。

Read Full Article...

Section:Oracle DBA | Read:4237 | Comment:0 | Rating:0%

<< < 1 2 3
Tags
No Records
Latest Comments
eozzrixrlo

on line..
- By admin, 2008-4-24 2:34am
rvaqlckrdu

free nud..
- By admin, 2008-4-24 2:33am
xndfjmwcpj

- By admin, 2008-4-5 1:02pm
vsjblsgatm

somali p..
- By admin, 2008-4-5 1:01pm
jknsdsmvyi

- By admin, 2008-3-12 1:48am
fkgyuchizk

tramadol..
- By admin, 2008-3-12 1:48am
wnniqpohsg

- By admin, 2008-4-24 2:32am
unxnmahoya

in phent..
- By admin, 2008-4-24 2:29am
bkgulrjbtt

- By admin, 2008-3-12 1:47am