Oracle dba_ts_quotas

本文介绍了如何在Oracle数据库中修改用户bpx1的表空间配额,使用SQL语句查看和设置用户配额,并通过实例演示了创建表、分配表空间以及插入数据的过程。

修改用户表空间配额

用户bpx1默认表空间是bpx1
select default_tablespace from dba_users where username in (‘BPX1’);
在这里插入图片描述
SQL> alter user bpx1 quota unlimited on ycy;

User altered.

select * from dba_ts_quotas;
在这里插入图片描述
The SQL statement select * from dba_ts_quotas is used to retrieve information about the tablespace quotas assigned to users in the database. It will return a result set containing the following columns:

  • USERNAME: The name of the user.
  • TABLESPACE_NAME: The name of the tablespace.
  • BYTES: The amount of space allocated to the user in bytes.
  • MAX_BYTES: The maximum amount of space that can be allocated to the user in bytes.
  • BLOCKS: The number of blocks allocated to the user.
  • MAX_BLOCKS: The maximum number of blocks that can be allocated to the user.

By executing this query, you can view the tablespace quotas for all users in the database and their corresponding limits.

模拟操作

ALTER SESSION SET CURRENT_SCHEMA = username;

CREATE TABLE employees
(
  employee_id NUMBER(5) PRIMARY KEY,
  first_name VARCHAR2(50),
  last_name VARCHAR2(50),
  hire_date DATE,
  salary NUMBER(10, 2)
)
TABLESPACE YCY;


-- 使用多个INSERT语句
INSERT INTO employees (employee_id, first_name, last_name, hire_date, salary)
VALUES (1, 'John', 'Doe', TO_DATE('2022-01-01', 'YYYY-MM-DD'), 5000);

INSERT INTO employees (employee_id, first_name, last_name, hire_date, salary)
VALUES (2, 'Jane', 'Smith', TO_DATE('2022-02-01', 'YYYY-MM-DD'), 6000);


-- 使用单个INSERT语句和多个VALUE子句
INSERT INTO employees (employee_id, first_name, last_name, hire_date, salary)
VALUES 
  (1, 'John', 'Doe', TO_DATE('2022-01-01', 'YYYY-MM-DD'), 5000),
  (2, 'Jane', 'Smith', TO_DATE('2022-02-01', 'YYYY-MM-DD'), 6000);

SELECT OWNER, TABLESPACE_NAME,TABLE_NAME
FROM DBA_TABLES
WHERE TABLESPACE_NAME = 'YCY';
select * from bpx1.employees;
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值