Oralce data import appears (SYSTEM. Proc_audit) Problem handling method _oracle

Source: Internet
Author: User
When the username user's data for a data is exported and then imported into the username in the B database, the following problems occur when the table data query is executed under the username user:
ORA-06550: Line 1th, column 7th:
PLS-00201: Must declare identifier ' SYSTEM. Proc_audit '
ORA-06550: Line 1th, column 7th:
Pl/sql:statement ignored
This problem occurs because the a database opens the audit, and when imported to the B database, the B database audit is not opened, the database does not have System.proc_audit objects, causing the above problems.

The problem resolution process is as follows:
1 Login to SYSDBA database:
D:\users\administrator>sqlplus/as SYSDBA

2 Display current audit parameters:
Sql> Show parameter audit;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
Audit_file_dest string J:\APP\ADMINISTRATOR\ADMIN\ORC
L\adump
Audit_sys_operations Boolean FALSE
Audit_trail string DB

3) Enable auditing.
Sql> alter system set AUDIT_SYS_OPERATIONS=TRUE Scope=spfile;
The system has changed.

4 Check the new status, or show the audit operation is not open, you need to restart the database:
Sql> Show parameter audit;
NAME TYPE VALUE
------------------------------------ ----------- --------------------------
Audit_file_dest string J:\APP\ADMINISTRATOR\ADMIN
L\adump
Audit_sys_operations Boolean FALSE
Audit_trail string DB

5) Restart the database
sql> shutdown Immediate
The database has been closed.
The database has been unloaded.
The ORACLE routine has been closed.
Sql> Startup
The ORACLE routine has started.
Total System Global area 3056513024 bytes
Fixed Size 2179656 bytes
Variable Size 1644170680 bytes
Database buffers 1392508928 bytes
Redo buffers 17653760 bytes
Database loading complete.
The database is already open.

6 Review Audit status, Audit opened.
Sql> Show parameter audit;
NAME TYPE VALUE
------------------------------------ ----------- --------------------------
Audit_file_dest string J:\APP\ADMINISTRATOR\ADMIN
L\adump
Audit_sys_operations Boolean TRUE
Audit_trail string DB
Sql> Conn Username/pwdxxxxxx;
is connected.

7 query table data, error still, but the error replaced System.proc_audit invalid:
Sql> select * from Corporationhot;
SELECT * FROM Corporationhot
*
Line 1th Error:
ORA-06550: Line 1th, column 14th:
PLS-00905: Object SYSTEM. Invalid Proc_audit
ORA-06550: Line 1th, column 7th:
Pl/sql:statement ignored

8 Authorize the object System.proc_audit to username.
Sql> Grant execute on SYSTEM. Proc_audit to USERNAME;
The authorization was successful.

9)Once again, log in as a username, execute a datasheet query, and prompt the object SYSTEM. Proc_audit is invalid because the object has been authorized, this condition may be an object error.
Sql> Conn Username/pwdxxxxxx;
is connected.
Sql> SELECT * FROM TableName;
SELECT * FROM TableName *
Line 1th Error:
ORA-06550: Line 1th, column 14th:
PLS-00905: Object SYSTEM. Invalid Proc_audit
ORA-06550: Line 1th, column 7th:
Pl/sql:statement ignored

Ten)Found System.proc_audit stored procedures, found that there is a compilation error, prompted Sys.v_$sql,v$sql_bind_capture,sys.v_$session for no
The validity identifier, because the object is present and can be queried, is suspected to be a permission setting issue and is authorized as follows:
Sql> Conn/as sysdba;
is connected.
Sql> Grant all on Sys.v_$sql to system
2;
The authorization was successful.
Sql> Grant all on v$sql_bind_capture to system;
The authorization was successful.
Sql> Grant all on sys.v_$session to system;
The authorization was successful.

One )SYSTEM. Proc_audit after compiling, to username login to the database, view the table data back to normal, problem resolution.
To verify that the audit was open when the error was exported, the audit was not opened at the time of the import, and the audit was closed again:
Sql> alter system set AUDIT_SYS_OPERATIONS=FALSE Scope=spfile;
The system has changed.
sql> Restart;
sp2-0042: Unknown Command "Restart"-the remaining lines are ignored.
sql> shutdown immediate;
The database has been closed.
The database has been unloaded.
The ORACLE routine has been closed.
Sql> startup;
The ORACLE routine has started.
Total System Global area 3056513024 bytes
Fixed Size 2179656 bytes
Variable Size 1644170680 bytes
Database buffers 1392508928 bytes
Redo buffers 17653760 bytes
Database loading complete.
The database is already open.

12 After the database restart, to username user login query data normal.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.