随笔分类 -  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 阅读全文
posted @ 2022-10-05 14:05 逆火狂飙 阅读(380) 评论(0) 推荐(0) 编辑
摘要:【需求】 在Oracle19上创建用户c##luna后,需要为其扩容以进行大表实验。 【步骤】 1.查用户所在表空间 SQL select default_tablespace from dba_users where username=upper('c##luna') 执行: SQL> selec 阅读全文
posted @ 2022-08-28 09:30 逆火狂飙 阅读(349) 评论(1) 推荐(0) 编辑
摘要:【BINXXXXflashbacktable"BINXXXX" to before drop 来恢复被删除的当事表; 如果用drop table XXX purge来删除表,是不会在回收站留下痕迹的,只有drop table XXX会。 【如何 阅读全文
posted @ 2022-07-11 16:46 逆火狂飙 阅读(186) 评论(0) 推荐(0) 编辑
摘要:【需求】 确定一张11字段500万记录的表大致消耗多少M空间 【建表语句】 create table emp76( id number(12), f01 nvarchar2(20), f02 nvarchar2(20), f03 nvarchar2(20), f04 nvarchar2(20), f 阅读全文
posted @ 2022-07-06 16:24 逆火狂飙 阅读(337) 评论(0) 推荐(0) 编辑
摘要:下文来自:http://blog.itpub.net/23502881/viewspace-742135/ 当数据库进行索引重建,或者大量数据导入导出时,会使得temp表空间暴增,很可能撑满数据文件,因为数据库安装的时候,temp表空间默认很自由一个数据文件并且数据库中单个数据文件最大只能自增到32 阅读全文
posted @ 2022-07-06 11:05 逆火狂飙 阅读(516) 评论(0) 推荐(0) 编辑
摘要: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; 阅读全文
posted @ 2022-06-22 18:31 逆火狂飙 阅读(608) 评论(0) 推荐(0) 编辑
摘要:今天在创建一张大表时遭遇到了如下错误: ORA-01653: 表 LUNA.EMP615_30 无法通过 1024 (在表空间 USERS 中) 扩展 通关查询资料并测试,发现如下三步骤可以应对此错误: 1.查看ORacle表空间: SQL: SELECT UPPER(F.TABLESPACE_NA 阅读全文
posted @ 2022-06-15 06:38 逆火狂飙 阅读(560) 评论(0) 推荐(0) 编辑
摘要:conn /as sysdba alter user luna identified by 123456 conn luna/123456@orcl 阅读全文
posted @ 2022-04-27 21:09 逆火狂飙 阅读(122) 评论(1) 推荐(0) 编辑
摘要:1.确认服务名是orcl还是其它,如不确定到Net Manager中查看,可以用命令show parameter service在sql plus中查看,具体如下: SQL> show parameter service; NAME TYPE VALUE service_names string o 阅读全文
posted @ 2021-11-03 18:48 逆火狂飙 阅读(41) 评论(0) 推荐(0) 编辑
摘要:END 阅读全文
posted @ 2021-09-25 19:03 逆火狂飙 阅读(319) 评论(0) 推荐(0) 编辑
摘要:实验表: create table dupo( id int, name nvarchar2(20), create_time timestamp default sysdate, primary key(id)); 实验数据: insert into dupo(id,name) values(1, 阅读全文
posted @ 2021-09-07 17:16 逆火狂飙 阅读(252) 评论(0) 推荐(0) 编辑
摘要:以前做过一个一千六百万大表增添字段实验https://www.cnblogs.com/xiandedanteng/p/12323537.html,实验证明表无论大小增添字段都很快,或者说增添字段的耗时与表规模无关。 但上次表字段有点少,于是这次把表增加到了21字段再实验。 表结构: create t 阅读全文
posted @ 2020-04-11 18:42 逆火狂飙 阅读(454) 评论(0) 推荐(0) 编辑
摘要:用system/pswd登陆sql plus,执行下面命令: 请输入用户名: system 输入口令: 连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partiti 阅读全文
posted @ 2020-03-24 21:16 逆火狂飙 阅读(160) 评论(5) 推荐(0) 编辑
摘要:首先看看这表里数据量: SQL> select count(*) from tb_qianwan_final; COUNT(*) 16000000 然后是添加一个备注字段: SQL> alter table tb_qianwan_final add remark nvarchar2(60); 表已更 阅读全文
posted @ 2020-02-17 20:47 逆火狂飙 阅读(2841) 评论(1) 推荐(0) 编辑
摘要:有一张一千六百万数据的大表包含id,name,sal三个字段,字段类型如下: id number(9,0) primary key, name nvarchar2(20), sal number(5,0) 查一下看看数据多少: SQL> select count(*) from tb_qianwan 阅读全文
posted @ 2020-02-16 14:56 逆火狂飙 阅读(1363) 评论(0) 推荐(0) 编辑
摘要:如果不慎把表drop掉了,并非一定要跑路,也许下面的文字能打救你。 比如现在有个testtb表,里面有一百万数据: SQL> select count(*) from testtb; COUNT(*) 1000000 然后删除掉这个表: SQL> drop table testtb; 表已删除。 看 阅读全文
posted @ 2020-02-12 20:40 逆火狂飙 阅读(263) 评论(1) 推荐(0) 编辑
摘要:请输入用户名: system 输入口令: 连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Re 阅读全文
posted @ 2020-02-06 19:14 逆火狂飙 阅读(316) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2020-01-29 13:06 逆火狂飙 阅读(789) 评论(0) 推荐(0) 编辑
摘要:输入select * from vversion;.Sqlplus:SQL>selectfromvversion; BANNER Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64 阅读全文
posted @ 2019-11-29 11:35 逆火狂飙 阅读(1315) 评论(1) 推荐(1) 编辑
摘要: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 阅读全文
posted @ 2019-11-09 15:31 逆火狂飙 阅读(389) 评论(1) 推荐(0) 编辑

生当作人杰 死亦为鬼雄 至今思项羽 不肯过江东
点击右上角即可分享
微信分享提示