1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
| disql SYSDBA/SYSDBA@192.168.0.107:5236
commit;
select * from dba_roles;
SELECT USERNAME,* FROM DBA_USERS;
select * from dab_role_privs;
create user <用户名> identified by <密码> limit connect_time 3 DEFAULT TABLESPACE 表空间名称;
grant public,resource,dba to dm;
select username from user_users; select user();
select username,user_id,account_status from dba_users;
conn mkcks_test
select name from v$database;
select tablespace_name,* from dba_tablespaces;
select tablespace_name,file_name,status from dba_data_files order by 1;
CREATE TABLESPACE BOOKSHOP DATAFILE 'BOOKSHOP.DBF' size 150;
drop tablespace “VSPACE”;
alter tablespace test rename to testNew;
SELECT DISTINCT object_name FROM ALL_OBJECTS WHERE OBJECT_TYPE = 'SCH'; SELECT USERNAME FROM DBA_USERS; SET SCHEMA DMHR; SELECT SYS_CONTEXT ('userenv', 'current_schema') FROM DUAL; CREATE SCHEMA TEST AUTHORIZATION SYSDBA;
select * from user_tables; select * from ALL_TABLES; select * from DBA_TABLES; select TABLE_NAME from ALL_TABLES where TABLESPACE_NAME='MAIN'; SELECT * FROM DBA_TABLES WHERE OWNER='SYSSSO'
select * from user_tab_columns; select * from user_tab_columns where Table_Name='STU' AND OWNER='SYSDBA'; select * from all_tab_columns where Table_Name='DEPARTMENT'; select * from dba_tab_columns where Table_Name='STU' AND OWNER='SYSDBA';
select * from user_tab_comments select * from user_col_comments select * from user_indexes; select * from user_constraints;
select dbms_metadata.get_ddl('TABLE',<表名称>,<模式名称>);
|