Dropping the full schema in an Oracle database
You can run the init-db-cleanup.sql script to drop the OpenPages® database schema. The script drops the objects that the op-database-dba-install.sh|.bat and op-database-product-install.sh|.bat scripts created. You can also choose to drop or keep the OpenPages schema owner that was created by op-database-sysdba-install.sql.
Procedure
- Log on to the Oracle database server as a user with administrative privileges.
- Go to the /OP_<version>_Main/OP_<version>_Configuration/Database/ORACLE/INSTALL_SCRIPTS directory.
- Verify that you have execute permission on the files in the INSTALL_SCRIPTS directory. If not, change the permission on the file by using the chmod command.
-
In SQL*Plus, run the AuroraDbDelete.sql script as the OpenPages database user.
sqlplus openpage/<password>@OP @AuroraDbDelete.sqlFor more information, see Dropping OpenPages schema objects in an Oracle database.
-
In SQL*Plus, run the init-db-cleanup.sql script as a user with SYSDBA
privileges, for example
SYS.Syntax:sqlplus /nolog @sql-wrapper init-db-cleanup.sql <log_file> <oracle_tns_alias> <sysdba_user> <sysdba_password> <op_user> <keepuser|x>Table 1. Parameters of the init-db-cleanup.sql script for Oracle databases Parameter Description <log_file> Optional: The path and name of a log file <oracle_tns_alias> The TNS alias of the Oracle database instance <sysdba_user> A user with SYSDBA privileges <sysdba_password> The password of the SYSDBA user If the password contains special characters, surround the password in quotation marks:-
Windows:
"password" -
Linux®:
'password'
<op_user> The OpenPages schema owner <keepuser|x> Use one of the following values: -
x: Delete the schema owner -
keepuser: Do not delete the schema ownerUse this option if you plan to re-run the op-database-dba-install.sh|.bat and op-database-product-install.sh|.bat scripts. Otherwise, you'll need to re-run the op-database-sysdba-install.sql script.
Examples:-
Windows:
sqlplus /nolog @sql-wrapper.sql init-db-cleanup.sql log_file.txt OP system openpages "openpages" keepusersqlplus /nolog @sql-wrapper.sql init-db-cleanup.sql log_file.txt OP system openpages "openpages" x -
Linux:
sqlplus /nolog @sql-wrapper.sql init-db-cleanup.sql log_file.txt OP system openpages 'openpages' keepusersqlplus /nolog @sql-wrapper.sql init-db-cleanup.sql log_file.txt OP system openpages 'openpages' x
-
Windows:
What to do next
Run the database schema creation scripts in a clean database environment. See OpenPages database schema creation for Oracle.