随笔分类 - Oracle.DBA
摘要:【创建用户test1005】 create user test1005 identified by 1234; grant create session to test1005; grant create table to test1005; grant drop any table to test
阅读全文
摘要:【需求】 在Oracle19上创建用户c##luna后,需要为其扩容以进行大表实验。 【步骤】 1.查用户所在表空间 SQL select default_tablespace from dba_users where username=upper('c##luna') 执行: SQL> selec
阅读全文
摘要:【BINXXXX" to before drop 来恢复被删除的当事表; 如果用drop table XXX purge来删除表,是不会在回收站留下痕迹的,只有drop table XXX会。 【如何
阅读全文
摘要:【需求】 确定一张11字段500万记录的表大致消耗多少M空间 【建表语句】 create table emp76( id number(12), f01 nvarchar2(20), f02 nvarchar2(20), f03 nvarchar2(20), f04 nvarchar2(20), f
阅读全文
摘要:下文来自:http://blog.itpub.net/23502881/viewspace-742135/ 当数据库进行索引重建,或者大量数据导入导出时,会使得temp表空间暴增,很可能撑满数据文件,因为数据库安装的时候,temp表空间默认很自由一个数据文件并且数据库中单个数据文件最大只能自增到32
阅读全文
摘要:select * from
(
select rownum as sn,a.* from
(
select table_name,num_rows
from user_tables
where num_rows is not null
order by num_rows desc
) a
) b
where b.sn<11;
阅读全文
摘要:今天在创建一张大表时遭遇到了如下错误: ORA-01653: 表 LUNA.EMP615_30 无法通过 1024 (在表空间 USERS 中) 扩展 通关查询资料并测试,发现如下三步骤可以应对此错误: 1.查看ORacle表空间: SQL: SELECT UPPER(F.TABLESPACE_NA
阅读全文
摘要:conn /as sysdba
alter user luna identified by 123456
conn luna/123456@orcl
阅读全文
摘要:1.确认服务名是orcl还是其它,如不确定到Net Manager中查看,可以用命令show parameter service在sql plus中查看,具体如下: SQL> show parameter service; NAME TYPE VALUE service_names string o
阅读全文
摘要:实验表: create table dupo( id int, name nvarchar2(20), create_time timestamp default sysdate, primary key(id)); 实验数据: insert into dupo(id,name) values(1,
阅读全文
摘要:以前做过一个一千六百万大表增添字段实验https://www.cnblogs.com/xiandedanteng/p/12323537.html,实验证明表无论大小增添字段都很快,或者说增添字段的耗时与表规模无关。 但上次表字段有点少,于是这次把表增加到了21字段再实验。 表结构: create t
阅读全文
摘要:用system/pswd登陆sql plus,执行下面命令: 请输入用户名: system 输入口令: 连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partiti
阅读全文
摘要:首先看看这表里数据量: SQL> select count(*) from tb_qianwan_final; COUNT(*) 16000000 然后是添加一个备注字段: SQL> alter table tb_qianwan_final add remark nvarchar2(60); 表已更
阅读全文
摘要:有一张一千六百万数据的大表包含id,name,sal三个字段,字段类型如下: id number(9,0) primary key, name nvarchar2(20), sal number(5,0) 查一下看看数据多少: SQL> select count(*) from tb_qianwan
阅读全文
摘要:如果不慎把表drop掉了,并非一定要跑路,也许下面的文字能打救你。 比如现在有个testtb表,里面有一百万数据: SQL> select count(*) from testtb; COUNT(*) 1000000 然后删除掉这个表: SQL> drop table testtb; 表已删除。 看
阅读全文
摘要:请输入用户名: system 输入口令: 连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Re
阅读全文
摘要:SQL> select table_name from user_tables order by table_name; TABLE_NAME BIGTABLE COURSE EMP HY_MILLION HY_MILLION2 SCORE SMALLTABLE STUDENT TB_100MILL
阅读全文
摘要:输入select * from vversion; BANNER Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64
阅读全文
摘要:create user ufo identified by 1234; grant create session to ufo; grant create tablespace to ufo; grant create table to ufo; grant drop any table to uf
阅读全文