删除 Oracle 10g 中创建的所有内容
是否有一个命令可以删除 Oracle 10g 中创建的所有内容,以便我可以重新开始?
Is there a command that can delete everything ever created in Oracle 10g so I can start again?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
清除模式的最简单方法是以 DBA 身份登录并删除用户:
但如果您确实只想删除对象,则需要部署一些动态 SQL。
在大多数情况下,这应该会强制删除架构中的每个对象。但它有可能会失败(例如,如果其他会话锁定了某个对象)。此外,它不处理由于 TYPE 继承而导致的依赖关系。因此,有明显的方法可以改进它:自动重新运行、异常处理等。但它提供了十个启动器。
在现实世界中,与学术界的象牙塔相反,不应该需要这样的程序。每个数据库构建脚本都应该有一个相等且相反的回归脚本。遗憾的是,情况往往并非如此。
模式是用户拥有的所有对象。它与用户没有区别,因为它们共享相同的名称,并且当我们创建用户时会隐式创建一个空模式。然而,严格来说它们是两个不同的东西。 了解更多。
The easiest way to clear out a schema would be to log in as a DBA and drop the user:
But if you really want to just drop the objects, you'll need to deploy some dynamic SQL.
This should force the dropping of every object in your schema in most scenarios. But there is a possibility that it will fail (say if some other session has a lock on an object). Also it doesn't handle dependencies due to TYPE inheritance. So there are obvious ways it can be improved: automatic re-running, excpetion handling, etc. But it provides a starter for ten.
In the real world, as opposed to the ivory towers of Academe, there should be no need for a procedure like this. Every database build script should have an equal and opposite regression script. Sadly this is frequently not the case.
A schema is all the objects owned by a user. It is indistinguishable from the user in that they share the same name and an empty schema is implicitly created when we create a user. However, strictly they are two different things. Find out more.
在 Mac 10.5.8 上,要删除与 Oracle 10g 数据库实例相关的每个文件,请删除以下目录:
- oracle(安装过程生成的目录)
- oraInventory(系统上所有 oracle 安装的公共目录)
- /var/opt/oracle(包含设置 oraInventory 目录位置的文件)
- db(是从oracle网站下载安装文件解压后的目录)
- db.zip(从 oracle 站点下载用于安装的文件)
现在您可以在 Mac 上全新安装新的 oracle 数据库。至少,这对我有用。
我在此处和<找到了有用的信息一个href="http://blog.rayapps.com/2009/04/12/how-to-install-oracle-database-10g-on-mac-os-x-intel/" rel="nofollow">此处< /a>.
On a mac 10.5.8, to delete each and every file regarding oracle 10g db instance delete these dirs:
- oracle (the dir generated from the installation procedure)
- oraInventory (common directory for all oracle installation on your system)
- /var/opt/oracle (contains the file that sets the oraInventory dir location)
- db (is the dir unzipped from the file downloaded from oracle site for installation)
- db.zip (the file downloaded from oracle site for intallation)
Now you can fresh install a new oracle database on your mac. At least, this worked for me.
I found useful information here and here.