表空间2
来源:互联网 发布:淘宝上开网店要钱吗 编辑:程序博客网 时间:2024/06/04 19:41
4、 删除表空间
DROP TABLESPACE IBA_HOME INCLUDING CONTENTS AND DATAFILES;
drop tablespace 表空间名 including contents and datafiles cascade constraints;
drop tablespace SAGDB including contents and datafiles CASCADE CONSTRAINTS
--删除空的表空间,但是不包含物理文件
drop tablespace tablespace_name;
--删除非空表空间,但是不包含物理文件
drop tablespace tablespace_name including contents;
--删除空表空间,包含物理文件
drop tablespace tablespace_name including datafiles;
--删除非空表空间,包含物理文件
drop tablespace tablespace_name including contents and datafiles;
--如果其他表空间中的表有外键等约束关联到了本表空间中的表的字段,就要加上CASCADE CONSTRAINTS
drop tablespace tablespace_name including contents and datafiles CASCADE CONSTRAINTS搜索;
5、查看表空间名字:
select distinct TABLESPACE_NAME from tabs;
select b.tablespace_name tbs_name,
round(b.bytes / 1024 / 1024 / 1024, 2) tbs_size,
round((b.bytes - sum(nvl(a.bytes, 0))) / 1024 / 1024 / 1024, 2) tbs_used, round(substr((b.bytes - sum(nvl(a.bytes, 0))) / (b.bytes) * 100,
1,
5),
2) || '%' tbs_rate
from dba_free_space a, dba_data_files b
where a.file_id(+) = b.file_id
group by b.tablespace_name, b.file_name, b.bytes
order by b.tablespace_name;
6、查看几个表空间:
select count(distinct TABLESPACE_NAME) from tabs
7、查看表空间创建语句
select dbms_metadata.get_ddl('TABLESPACE','MDSP_CDR') from dual;
8、数据库用户变更密码限制,设置无限制—sys用户
alter profile default limit password_verify_function null;
9、表空间一般的位置
/opt/oracle/oradata—规范常用位置在此或此目录下子目录下(也可以自己设置目录)
11、 查看临时表空间
select tablespace_name,file_name,bytes/1024/1024 file_size,autoextensible from dba_temp_files;--临时表空间
7.13 查看和设置数据实例变量及数据库名称
echo $ORACLE_SID
env |grep ORA
export ORACLE_SID=ora11g
ps -ef |grep oracle
export ORACLE_SID=sagdb
find /opt/oracle -type f |grep ora11g |xargs rm
find /opt/oracle -type d |grep ora11g |xargs rm –rf
source .cshrc--使环境变量生效
select instance_name from v$instance;--查看实例名
select name from v$database;--数据库名
可通过以oracle用户登录数据库所在服务器,执行sqlplus / as sysdba命令进入SQL编辑器,执行show parameters db_name命令查询数据库名称,执行show parameters instance_name命令查询数据库实例名。
DROP TABLESPACE IBA_HOME INCLUDING CONTENTS AND DATAFILES;
drop tablespace 表空间名 including contents and datafiles cascade constraints;
drop tablespace SAGDB including contents and datafiles CASCADE CONSTRAINTS
--删除空的表空间,但是不包含物理文件
drop tablespace tablespace_name;
--删除非空表空间,但是不包含物理文件
drop tablespace tablespace_name including contents;
--删除空表空间,包含物理文件
drop tablespace tablespace_name including datafiles;
--删除非空表空间,包含物理文件
drop tablespace tablespace_name including contents and datafiles;
--如果其他表空间中的表有外键等约束关联到了本表空间中的表的字段,就要加上CASCADE CONSTRAINTS
drop tablespace tablespace_name including contents and datafiles CASCADE CONSTRAINTS搜索;
5、查看表空间名字:
select distinct TABLESPACE_NAME from tabs;
select b.tablespace_name tbs_name,
round(b.bytes / 1024 / 1024 / 1024, 2) tbs_size,
round((b.bytes - sum(nvl(a.bytes, 0))) / 1024 / 1024 / 1024, 2) tbs_used, round(substr((b.bytes - sum(nvl(a.bytes, 0))) / (b.bytes) * 100,
1,
5),
2) || '%' tbs_rate
from dba_free_space a, dba_data_files b
where a.file_id(+) = b.file_id
group by b.tablespace_name, b.file_name, b.bytes
order by b.tablespace_name;
6、查看几个表空间:
select count(distinct TABLESPACE_NAME) from tabs
7、查看表空间创建语句
select dbms_metadata.get_ddl('TABLESPACE','MDSP_CDR') from dual;
8、数据库用户变更密码限制,设置无限制—sys用户
alter profile default limit password_verify_function null;
9、表空间一般的位置
/opt/oracle/oradata—规范常用位置在此或此目录下子目录下(也可以自己设置目录)
11、 查看临时表空间
select tablespace_name,file_name,bytes/1024/1024 file_size,autoextensible from dba_temp_files;--临时表空间
7.13 查看和设置数据实例变量及数据库名称
echo $ORACLE_SID
env |grep ORA
export ORACLE_SID=ora11g
ps -ef |grep oracle
export ORACLE_SID=sagdb
find /opt/oracle -type f |grep ora11g |xargs rm
find /opt/oracle -type d |grep ora11g |xargs rm –rf
source .cshrc--使环境变量生效
select instance_name from v$instance;--查看实例名
select name from v$database;--数据库名
可通过以oracle用户登录数据库所在服务器,执行sqlplus / as sysdba命令进入SQL编辑器,执行show parameters db_name命令查询数据库名称,执行show parameters instance_name命令查询数据库实例名。
0 0
- 表空间2
- oracle表空间原理2
- 表空间
- 表空间
- 表空间
- 表空间
- 表空间
- 表空间
- 表空间
- 表空间
- 表空间
- 表空间
- 表空间
- 表空间
- 表空间
- 表空间
- 表空间
- 表空间
- c#的DateTime.Now函数详解
- ReactNative js判断android还是ios
- UniversalImageLoader源码解读07-内存泄漏和bug
- Swift HTTP GET请求例子
- tomcat发布项目如何去掉项目名称
- 表空间2
- ios开发-无界面设计文件开发
- java中的Serializable接口的作用
- 表空间
- 面试笔试题5--大整数表示问题?
- BZOJ3523: [Poi2014]Bricks
- PHP5+nginx+yii2.0高级+composer+mongodb
- nginx upstream使用及源码解析
- iOS相册选图实现