exp-00024 issue
re-execute $ORACLE_HOME/rdbms/admin/catexp.sql[@more@]
Difference between connection and session
Connection and session are closely related to user process but are very different in meaning.[@more@]A connection is a communication pathway between a user process and an Oracle instance. A communication pathway is established using available interprocess communication mechanisms (on a computer that runs both the user process and Oracle) or network software (when different computers run the database application and Oracle, and communicate through a network).A session is a specific connection of
session与process之间的关系
ORACLE的连接数(sessions)与其参数文件中的进程数(process)有关,它们的关系如下: sessions=(1.1*process+5)[@more@]
Something about rownum
rownum是ORACLE按记录插入的先后顺序分配给记录的序号顺序跟rowid相同只能用在 rownum=1 或 rownum<n可以通过子查询来改变结果中rownnum的顺序(子查询中使用分组)[@more@]
oracle9i切换undotbs
CREATE undo TABLESPACE UNDOTBS1 DATAFILE '/disk1/oradata/test/undotbs1.dbf' SIZE 2000M reuse AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED;alter system set undo_tablespace=undotbs1 scope=both;前提:启用spfile[@more@]
oracle9i启用spfile
CREATE SPFILE='$ORACLE_HOME/dbs/spfilesid.ora'FROM PFILE='$ORACLE_HOME/dbs/initsid.ora'; 重启。[@more@]
因数据文件丢失导致ORA-01157错误
start up数据库的时候报错:ORA-01157: cannot identify/lock data file 5 - see DBWR trace file ORA-01110: data file 5: '/disk3/oradata/test.dbf' 因为不需要恢复此数据文件,所以将它删除即可。解决方法:在数据库mount的状态下,alter database datafile '/disk3/oradata/test.dbf' offline drop;然后打开数据库:alter database open;删除表空间:select name from v$tablespace where ts# in(select ts# from v$datafile where name = '/disk3/oradata/test.dbf');drop tablespace NAME including contents;[@more@]
sql语句中字符串内单引号的问题
希望输出 'test'语句: select '''test''' from dual;即:字符串内包含单引号的时候,在sql中需要用两个单引号代替。双引号不变。[@more@]
用sqlplus '/as sysdba'跟用户组有关系
新建的用户oracle,组定义为oinstall,用sqlplus '/as sysdba'登陆报权限不够,用usermod将组改为dba后解决。[@more@]
SQL*PLUS报表功能
SQL*PLUS的一些基本格式命令 column deptno heading department column ename heading name column sal heading salary column sal format $99,999.00 ttitle sample report for|hitech corp btitle strictly confidential break on deptno compute sum of sal on deptno run [@more@]表头和表尾 ttitle sample report for|hitech corp btitle right strictly confidential “|”表示换行,结尾不必加分号 选项有三种:left right center 使用TTITLE,系统将自动地在每页的顶部显示日期和页号。 TTITLET和BTITLE命令有效,
oracle9i中修改列名
alter table table_name rename column XXX to XXX [@more@]
dba_sequences中cache_size的含义
每次取出cache_size个值,放在cache里。last_number每次增加的值=INCREMENT_BY*CACHE_SIZE[@more@]
ORA-01123: cannot start online backup; media recovery not enabled
Problem:SQL> alter tablespace xxxxxxx begin backup;alter tablespace xxxxxxxx begin backupORA-01123: cannot start online backup; media recovery not enabledSQL> archive log listDatabase log mode No Archive ModeAutomatic archival EnabledArchive destination /disk01/archive/xxxxxOldest online log sequence 84Current log sequence 86[@more@]Solution:SQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.SQL> star
oracle sql 函数
说明:在括号中注明(数值)的为数值型函数;注明为(字符)的为字符函数;注明为日期的为日期型函数;注明为(转换)的为转换型函数;注明是(聚组)的为聚组型函数;不注明的为其他函数。[@more@]函数名:说明abs(x)(数值)返回x的绝对值add_months(x,y)(日期)返回值为日期x加上y个月ascii(x)(字符)返回字符x的十进字表示avg([distinct|all]x](聚组)返回x列的平均值ceil(x)(字符)返回大于或等于x的最小整数chartorowid(x)(转换)将字符串x转换成rowid类型chr(x)(字符)返回对应于数x的字符集中的字符concat(x,y
tar gzip on the fly(extension)
to unpack on the fly... gunzip < FILE.tar.gz | tar xvf - to pack on the fly... tar cvf - FILE-LIST | gzip -c > FILE.tar.gz[@more@]
使用数据连接出现ORA-02085
如果被连接对方的GLOBAL_NAMES参数设置成了TRUE,那么要求数据库连接与对方实例名有相同的名称。可以通过下面3中的任意一种方法来解决:1.修改对方的GLOBAL_NAMES参数为FALSE2.将对方的GLOBAL_NAME设置成与数据库连接相同的名称3.将数据库连接删掉重新创建成与对方实例名相同的数据库连接。[@more@]
What is nearline?
常用的传统存储构架是两级平台:在线存储和离线海量存储。在线存储又称工作级的存储,是高速数据存储设备,可满足计算平台对数据访问的速度要求。一般在线存储有磁盘阵列等,价格相对昂贵。离线海量存储主要是用于对在线存储的数据进行备份,以防范可能发生的数据灾难,因此又称备份级的存储。离线海量存储的典型产品就是磁带库,价格相对低廉。[@more@] 近线存储就是近似在线的存储,其特点是数据访问的速度接近在线存储,但在价格上接近离线海量存储。 近线存储就必须采用不同的实现技术来克服离线海量存储的缺点。最早的近线
ls 列表排序
按日期升序排列:ls -l|sort +5按日期降序排列:ls -lt按名称升序排列:ls -ln[@more@]
9i关闭RAC功能
需要建立一个独立的INSTANCE,源文件是从一个RAC的其中一个节点上CLONE出来的。在目标主机上解包、relink(这一步缺了几个lib,从源主机上获得后解决)后,启动oracle到nomount状态,报如下错误:[@more@]SQL> startup nomount pfile="$ORACLE_HOME/dbs/init<sid>.ora";ORA-27504: IPC error creating OSD context在metalink上获知此问题是因源主机是RAC的节点造成的,故需在新主机上关闭RAC功能。步骤如下:cd $ORACLE_HOME/rdbms/libmake -f ins_rdbms.mk rac_offmake -f ins_rdbms.mk ioracle如果要重新开启racORAC
工作中用到的东西
查看oracle位数:file $ORACLE_HOME/bin/oracle 查看solaris的补丁安装情况:pkginfo -i SUNWxwfnt[@more@]