ITeye博客

oracle

共 10 篇文章

修改表的空间

一、修改单个表空间的方法 alter table TABLE_NAME move tablespace TABLESPACENAME 二、批量修改表空间的方法 1、查询当前用户所有的表,并拼接成修改表空间的SQL语句 spool c:\move.sql; select 'alter table '|| table_name ||' move tablespace tablespacename;' from user_all_tables; spool off; 2、在机器c盘找move.sql文件打开后 拷贝到 sqlplus中执行即可全部修改所有表对应的表空间。 三、修改单个表的索引的空间…

2011-07-02 16:52 · oracle

查看表空间是否为自动扩展

select file_id,file_name,tablespace_name,autoextensible,increment_by from dba_data_files order by file_id desc;

2011-07-02 16:42 · oracle

查看表空间的使用率

select a.tablespace_name,a.bytes/1024/1024 "Sum MB",(a.bytes-b.bytes)/1024/1024 "Used MB",b.bytes/1024/1024 "Free MB",round(((a.bytes-b.bytes)/a.bytes)*100,2) "Percent_userd" from (select tablespace_name,sum(bytes) bytes from dba_data_files group by tablespace_name) a,(select tablespace_name,sum(by…

2011-07-02 16:42 · oracle

windows下oracle自动备份脚本

@echo off REM ########################################################### REM # Windows Server 2008下Oracle数据库自动备份批处理脚本 REM ########################################################### REM 取当前系统时间,可能因操作系统不同而取值不一样 set CURDATE=%date:~0,4%%date:~5,2%%date:~8,2% set CURTIME=%time:~0,2% REM 小时数如果小于10,则在前面…

2011-07-02 16:38 · oracle

修改oracle10g和oracle11g数据库字符集

工作需要,安装装了oracle 11g,在导入其他机器上的备份数据的时间,发生一个错误: IMP-00019: 由于 ORACLE 错误 12899 而拒绝行 IMP-00003: 遇到 ORACLE 错误 12899 ORA-12899: 列 "ZHENG"."D_DIC"."DICEXPLAIN" 的值太大 (实际值: 140, 最大值: 100) 这个数据表结构是直接注入的,根本不会这样子的啊。后来在网上查了才知道原来是字符集的问题: 在日志文件里,开始导入时候有这样一个提示:" 已经完成 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集中的导入 导入服务器使用 AL…

2010-12-22 14:12 · oracle · SQL Server · 数据结构 · SQL · XP · Oracle

查看oracle数据库的连接数以及用户

1、查询oracle的连接数 select count( ) from v$session; 2、查询oracle的并发连接数 select count( ) from v$session where status='ACTIVE'; 3、查看不同用户的连接数 select username,count(username) from v$session where username is not null group by username; 4、查看所有用户: select * from all_users; 5、查看用户或角色系统权限(直接赋值给用户或角色的系统权限): select *…

2010-07-23 16:35 · oracle · Oracle

oracle用户授所有权限

grant alter system to linder; grant audit system to linder; grant create session to linder; grant alter session to linder; grant restricted session to linder; grant debug connect session to linder; grant create tablespace to linder; grant alter tablespace to linder; grant manage tablespace to linde…

2010-05-19 15:10 · oracle · SQL · Access · Oracle

oracle中创建用户和表

--创建临时表空间 create temporary tablespace tour_temp tempfile 'd:\OracleData\tour_temp.dbf' size 10m autoextend on next 10m maxsize unlimited extent management local; --创建数据表空间 create tablespace tour_data logging datafile 'd:\OracleData\tour_data.dbf' size 20m autoextend on next 20m maxsize unlimited ex…

2010-04-23 11:17 · oracle · C · C++ · C# · Oracle

创建表空间、用户、用户授权

ORACLE中,表空间是数据管理的基本方法,所有用户的对象要存放在表空间中,也就是用户有空间的使用权,才能创建用户对象.否则是不充许创建对象,因为就是想创建对象, 如表,索引等,也没有地方存放,Oracle会提示:没有存储配额. 因此,在创建对象之前,首先要分配存储空间. 分配存储,就要创建表空间: 创建表空间示例如下: create tablespace knowledgeuserspace logging datafile 'F:\OracleData\knowledge_data.dbf' size 20m autoextend on next 20m maxsize unlimite…

2010-04-02 09:16 · oracle · SQL · F# · Oracle

oralce 数据库备份与还原

1、数据库备份 在开始运行中输入cmd进入dos命令窗口, 然后输入相应的备份命令即可, 命令为:exp 用户名/密码@全局数据库名 file='文件路径+文件名' owner=(用户名) 例如:exp abc/abc@linder file='f:\abc.dmp' owner=(abc) 2、数据库的还原 第一步:创建对应的用户的abc和表空间,并给用户授权 第二步,在开始运行中输入cmd进入dos命令窗口 第三步,输入imp命令 第四步,输入对应的用户名和密码 第五步,输入要还原的文件名 abc.dmp 第六步,输入插入缓冲区大小,采用默认值即可,直接按回车键 第七步,只列出导入文件的…

2010-03-30 09:06 · oracle · F# · DOS