查询oracle的dbLink select owner,object_name from dba_objects where object_type='DATABASE LINK';#查询出dba用户下的dblink select * from user_objects t where t.object_type='DATABASE LINK' #查询当前用户下的dblink --查询所有的表 select * from user_tab_comments --查询表的字段信息 select column_name,data_type,data_length,nullable from user_tab_columns where Table_Name='I_SIGN_SITUATION_DETAILS' --查询字段的注释 select column_name,comments from user_col_comments where TABLE_NAME='I_SIGN_SITUATION_DETAILS' --工作中的点滴积累 SELECT l.session_id sid, s.serial#, l.locked_mode 锁模式, l.oracle_username 登录用户, l.os_user_name 登录机器用户名, s.machine 机器名, s.terminal 终端用户名, o.object_name 被锁对象名, s.logon_time 登录数据库时间 FROM v$locked_object l, all_objects o, v$session s WHERE l.object_id = o.object_id AND l.session_id = s.sid ORDER BY sid, s.serial#; --解锁引号中'sid,serial' ALTER system kill session '60,4111';
--当上一句sql解决不了的时候执行
ALTER system kill session '146,2906'immediate; 批量解决锁表 declare cursor mycur is select s.sid,s.serial# from v$locked_object l, all_objects o, v$session s WHERE l.object_id = o.object_id AND l.session_id = s.sid and object_name='WM_BIN_ALLOCATE' ORDER BY sid, s.serial#; begin for cur in mycur loop execute immediate ( 'alter system kill session '''||cur.sid || ','|| cur.SERIAL# ||''' '); end loop; end; --查看表空间 select * from dba_tablespaces; --查看表空间文件路径 select tablespace_name,file_id,bytes/1024/1024,file_namefrom dba_data_files order by file_id; --查看用户和默认表空间的关系 select username,default_tablespace from dba_users; --查询oracle数据库实例sql select instance_name from v$instance; --创建临时表空间 CREATE TEMPORARY TABLESPACE BGDATA_TEMP TEMPFILE '/data/app/oracle/oradata/orcl/temp02.dbf ' SIZE 512M REUSE AUTOEXTEND ON NEXT 50M MAXSIZE UNLIMITED; --创建数据表空间 CREATE TABLESPACE BGDATA DATAFILE '/data/app/oracle/oradata/orcl/bg_data.dbf' SIZE 50M REUSE AUTOEXTEND ON NEXT 50M MAXSIZE UNLIMITED; --删除表空间 DROP TABLESPACE BGDATA INCLUDING CONTENTS AND DATAFILES; 创建用户及授权 -- Create the user create user bg identified by cms2018 default tablespace BGDATA temporary tablespace BGDATA_TEMP; -- Grant/Revoke role privileges grant connect to bg; grant resource to bg; grant dba to bg; 输入命令taskkill /pid 进程号 -f 终止相应进程即可
批量结束同一个进程
taskkill /f /im nginx.exe
进入命令提示符窗口后,输入“netstat -ano”并按下回车执行,之后就会显示电脑上运行的所有端口了;
输入“tasklist|findstr “端口号””并按下回车,假设查询端口为2720的进程名称;