|
导读数据库,简而言之可视为电子化的文件柜——存储电子文件的处所,用户可以对文件中的数据进行新增、截取、更新、删除等操作。所谓“数据库”是以一定方式储存在一起、能与多个用户共享、具有尽可能小的冗余度、与应... 数据库,简而言之可视为电子化的文件柜——存储电子文件的处所,用户可以对文件中的数据进行新增、截取、更新、删除等操作。所谓“数据库”是以一定方式储存在一起、能与多个用户共享、具有尽可能小的冗余度、与应用程序彼此独立的数据集合。 对数据表要进行备份可以在同一表空间里新建一张表:CREATE TABLE T_BAK AS SELECT * FROM T 如果要对某些表或视图建立同义词可以通过语句执行: Oracle代码 select 'create or replace public synonym '||table_name||' for user.'||table_name||';' from user_tables select 'create or replace public synonym '||view_name||' for user.'||view_name||';' from user_views select 'create or replace public synonym '||sequence_name||' for user.'||sequence_name||';' from user_sequences 同样可以利用这个语句执行删除: Oracle代码 select 'drop table '||table_name||';' from user_tables where table_name like '%T%' select 'drop PUBLIC SYNONYM '||table_name||';' from user_tables where table_name like '%T%' 要导出用户下的表的方法: Oracle代码 exp user/password@Database file="D:\orcl.dmp" log="D:\orcl.log" 要导入用户下的某些表的方法: Oracle代码 imp user/password@Database file=D:\backup\oracle\tablebak.dmp fromuser = user1 tables=t_XXX touser=user 新建sequence 你首先要有CREATE SEQUENCE或者CREATE ANY SEQUENCE权限。 Oracle代码 CREATE SEQUENCE emp_sequence INCREMENT BY 1 -- 每次加几个 START WITH 1 -- 从1开始计数 NOMAXvalue -- 不设置最大值 NOCYCLE -- 一直累加,不循环 CACHE 10; --设置缓存cache个序列,如果系统down掉了或者其它情况将会导致序列不连续,也可以设置为---------NOCACHE 更改表索引的表空间: Oracle代码 select 'alter index '||index_name||' rebuild tablespace T_INDEX;' from user_indexes where owner='×××' and table_name in ('×××', '×××'); 全新的路由器不仅让你更稳定快速地连接无线网络,更可以让家中的智能设备连接在一起。 |
温馨提示:喜欢本站的话,请收藏一下本站!