I'm trying to recover the volume that a user uses in my database. But I can not find how to do it. Here is my code:
FUNCTION EspaceUtilise (v_user IN VARCHAR2) RETURN NVARCHAR2 AS requetes NVARCHAR2(4000);
BEGIN
DECLARE
unused_bytes NUMBER;
total_bytes NUMBER;
CURSOR c_infosUser IS SELECT * FROM all_users where USER_ID = v_user;
v_rqt NVARCHAR2(4000);
BEGIN
OPEN c_infosUser;
FETCH c_infosUser INTO v_rqt;
WHILE c_infosUser%FOUND LOOP
-- Get user volume here
FETCH c_infosUser INTO v_rqt;
END LOOP;
CLOSE c_infosUser;
RETURN ;
END;
END;
I tried to use the method "SUM" and "DBMS_SPACE" but I can not properly use it.