HA

oracle

测试方法 @BeforeEach 备份表 执行方法 @AfterEach 从备份表恢复数据并删除备份表 示例代码: { @Autowired private JdbcTemplate jdbcTemplate; @BeforeEach public void before() { // 备份表 String today = LocalDate.now().format(DateTimeFormatter.ofPattern("uuMMdd")); template.execute(String.format("create table test_table_%s as select * from test_table", today)); } @AfterEach public void after() { String today = LocalDate.now().format(DateTimeFormatter.ofPattern("uuMMdd")); template.execute(String.format("insert
在线执行环境,缺点是需要注册 Oracle live SQL http://sqlfiddle.com/ 创建用户 alter session set "_ORACLE_SCRIPT"=true; CREATE USER TOM IDENTIFIED BY a12345678; GRANT CONNECT, RESOURCE, DBA TO TOM; GRANT select on tom.contacts TO TOM; REVOKE DBA FROM TOM; REVOKE select on tom.contacts FROM TOM; DROP USER TOM; -- 同时删除用户下的所有对象