Home  >  Article  >  Database  >  记录一次删除/创建APEX的Workspace经历

记录一次删除/创建APEX的Workspace经历

WBOY
WBOYOriginal
2016-06-07 15:28:461407browse

时间过去的稍微有些久远,无法记得当时是如何操作的了。这里只对重点内容进行记述。 命令行删除Workspace 官方参考文档 实验的时候创建很多Workspace,所以想要一次性全部删除,具体的删除操作可以参考文档: http://docs.oracle.com/cd/E17556_01/doc/admin

时间过去的稍微有些久远,无法记得当时是如何操作的了。这里只对重点内容进行记述。

命令行删除Workspace

官方参考文档

实验的时候创建很多Workspace,所以想要一次性全部删除,具体的删除操作可以参考文档:

http://docs.oracle.com/cd/E17556_01/doc/admin.40/e15521/adm_mg_wrkspc.htm#CHDHBEFI

删除的具体操作步骤与说明

To delete a workspace in a runtime development environment:

Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS. For example:

On Windows:
<strong>SYSTEM_DRIVE:\ sqlplus /nolog
connect sys as sysdba</strong>
On UNIX and Linux:
<strong>$ sqlplus /nolog
connect sys as sysdba</strong>
When prompted enter the appropriate password.

Run the following statement:

<strong>ALTER SESSION SET CURRENT_SCHEMA = APEX_040000
</strong>Run the following statement:

<strong>BEGIN
APEX_INSTANCE_ADMIN.REMOVE_WORKSPACE(WORKSPACE_NAME, DROP_USER, DROP_TABLESPACE)
END;</strong>
Where:

WORKSPACE_NAME is the name of the workspace.
DROP_USER is either Y or N. The default is N.
DROP_TABLESPACE is either Y or N. The default is N.
在决定CURRENT_SCHEMA的时候,可以先查看本地安装的数据库内容和具体的APEX版本。

查看APEX版本

SQL> select version_no from apex_release;
VERSION_NO
--------------------------------------------------------------------------------
4.0.2.00.09

查看数据库中的schema情况

SQL> select username from all_users;

USERNAME
------------------------------------------------------------
XS$NULL
APEX_040000
APEX_PUBLIC_USER
FLOWS_FILES
MDSYS
ANONYMOUS
XDB
CTXSYS
OUTLN
SYSTEM
SYS

已选择11行。

GUI删除Workspace

访问GUI管理界面

通过http://127.0.0.1:8080/apex/apex_admin可以进入APEX后台管理GUI。用户名为Admin,初始密码记不清了,按照官方文档的指导,可以轻松重置密码。

重置GUI管理密码

通过官方指南http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21673/otn_install.htm#BABDEAFD,可以很容易地重置密码。首先需要进入脚本所在目录。

C:\oraclexe\app\oracle\product\11.2.0\server\apex>dir
 驱动器 C 中的卷没有标签。
 卷的序列号是 3CCF-056C

 C:\oraclexe\app\oracle\product\11.2.0\server\apex 的目录

2014-01-14  22:05    <DIR>          .
2014-01-14  22:05    <DIR>          ..
2011-08-27  10:00             1,687 <strong>apxchpwd.sql</strong>
2011-08-27  10:00             3,005 apxconf.sql
2011-08-27  10:00             4,537 apxremov.sql
2011-08-27  10:00             1,625 apxxepwd.sql
2011-08-27  10:00            10,626 gen_inst.sql
               5 个文件         21,480 字节
               2 个目录 19,138,473,984 可用字节
然后运行上面粗体文件即可,命令如下:
SYSTEM_DRIVE:\ sqlplus /nolog
SQL> CONNECT SYS as SYSDBA
Enter password: SYS_password

@apxchpwd

创建Workspace

GUI创建Workspace

GUI创建Workspace有两种途径,一种是面向开发人员的http://hostname:port/apex,还有一种就是面向APEX管理员的http://127.0.0.1:8080/apex/apex_admin。

异常处理

如果在创建的过程中出现了下面的错误,那可能是之前删除Workspace时没有清除所有相关数据,所以我们需要继续手工删除这些数据。

ORA-00001: unique constraint (APEX_040000.WWV_FLOW_PROV_COMPANY_NAME) violated

用下面命令删除相关数据后,就可以解决上面的约束冲突问题(冲突是由表中的一个索引引起的)。
SQL> DELETE FROM apex_040000.WWV_FLOW_PROVISION_COMPANY;

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:CentOS6.5上安装MariaDBNext article:java调存储过程