ORACLE——表
在 SQL ORACLE 中输入代码创建新表后,如果我要注销 SQL 会话,更改会被保存吗?
After entering code to create a new table in SQL ORACLE, would the changes be saved if I was to log out of the SQL Session?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
是的,您的表定义已保存; Oracle DDL 具有隐式事务*。其他数据库,例如 PostrgreSQL,确实有事务性 DDL,但对于 Oracle,它是自动的,所以要小心。
* Oracle 事务管理:如果当前事务包含任何DML语句,Oracle首先提交该事务,然后运行 DDL 语句并将其作为新的单语句事务提交。
Yes, your table definitions are saved; Oracle DDL has an implicit transaction*. Other databases, such as PostrgreSQL, do have transactional DDL, but with Oracle, it is automatic, so be careful.
* Oracle Transaction Management: If the current transaction contains any DML statements, Oracle first commits the transaction, and then runs and commits the DDL statement as a new, single statement transaction.
正确的答案是Oracle DDL 使用隐式事务——事务没有机会返回,它会立即提交。
The correct answer is that Oracle DDL uses an implicit transaction - there's no opportunity to the transaction back, it's immediately committed.
简而言之,“是”。 DDL 语句在执行后立即提交。如果您的脚本还包含 INSERT 语句来填充这些表,那么如果没有自己的提交,这些表将不会被保存。
In short, "yes". DDL statements are committed immediately after execution. If your script also includes INSERT statements to populate those tables, then those would not be saved without a commit of their own.
嗯,什么?是的,对数据和表结构的所有更改都会立即保存(除非事务的一部分,它会等到事务结束才能永久保存)
取决于您的会话的是会话变量和会话设置。
Umm, what? Yes all changes to Data and Table structures are immediately saved (unless part of a transaction, which waits till the end of the transaction to permanently save)
The things that are dependent upon your Session are session variables and session settings.