数据库启动和停止
停止
orcale/oracle7
// 停止
1.ps -ef|grep smon
2.export ORACLE_SID=cbsdba(cbsdba是实例名)
3. sqlplus / as sysdba
4.shutdown immediate;
启动
1.ps -ef|grep smon
2.export ORACLE_SID=cbsdba
3. sqlplus /as sysdba
4.startup;
5.alter pluggable database all open;
闪回
--查询数据
SELECT * FROM VOUCHER_ACC AS OF TIMESTAMP TO_TIMESTAMP('2023-07-14 20:00:00',' yyyy-mm-dd hh24:mi:ss');
--开启行移动功能
alter table VOUCHER_ACC enable row movement;
--闪回数据
flashback table VOUCHER_ACC to timestamp TO_TIMESTAMP('2023-07-14 20:00:00',' yyyy-mm-dd hh24:mi:ss');
锁表处理
根据下面sql语句查询对应的锁表信息
SELECT object_name, machine, s.sid, s.serial#
FROM gv$locked_object l, dba_objects o, gv$session s
WHERE l.object_id = o.object_id
AND l.session_id = s.sid;
-- 根据查询出来的sid,和serial释放SESSION SQL:
--alter system kill session 'sid, serial#';
--例如下列语句
--ALTER system kill session '23, 1647';
创建DB_LINK
DROP PUBLIC DATABASE LINK "JSBV.RB_UP_LINK";
CREATE PUBLIC DATABASE LINK "JSBV.RB_UP_LINK"
CONNECT TO B_UPRIGHT1
IDENTIFIED BY <PWD>
USING '(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.1.1)(PORT=1521))
)
(CONNECT_DATA=(SERVER=DEDICATED)
(SERVICE_NAME=UPRDB))
)';
标签:闪回,--,锁表,object,00,DBLINK,session,LINK,sid From: https://blog.51cto.com/u_16190206/6768251