Catproc and Catalog Executed as non-sys user

One of my friend executed the above packages from a non-sys user schema.
That schema is also important.
Now how to clean up these objects?
Just re-running the above packages as sys schema is enough?
Thanks

Excerpts from the note 1015902.4:
Shutdown your database with 'shutdown immediate'. If this hangs for an
extended period of time, then use 'shutdown abort'. This must be done
as 'internal'.
Start up your database with 'startup', or 'startup restrict'.
The following script should be run as 'sys' or 'internal' from SQL*Plus
(this is important for formatting the script that it creates). This script
will create another script called file.sql. If you do not run the following
script from SQL*Plus, you will need to edit the resulting script to make sure
file.sql will run properly.
----------------------------- <script start> --------------------------
set echo off
set pagesize 0
set feedback off
spool drop.sql
SELECT 'drop '||OBJECT_TYPE||' '||OWNER||'.'||object_name||';'
FROM all_objects
WHERE OWNER != 'SYS' AND OBJECT_TYPE != 'SYNONYM'
AND OBJECT_NAME IN
(SELECT OBJECT_NAME FROM ALL_OBJECTS
WHERE OWNER = 'SYS')
ORDER BY object_type, object_name;
spool off
set feedback on
set echo on
---------------------------- <script end> -----------------------------
Run the script created from above script as either internal or sys.
The script will contain sql commands like:
DROP PACKAGE SYSTEM.DBMS_SHARED_POOL;
DROP VIEW SYSTEM.DBA_OBJECTS;
SQL> @drop.sql
You may alternately find the user who owns 'sys' objects, and drop that
user.
SQL> drop user xxxx cascade;
This may hang. If it does, use shutdown abort, and rerun script. When the
script completes, 'shutdown immediate' your database. Startup and run
catalog.sql and catproc.sql as either 'sys' or 'internal'. You may then
run pupbld.sql as the 'system' user. If you have replication installed,
you may also need to run catrep.sql as 'sys'.
Hints for running the catalog, catproc and catrep scripts:
1. Check for available freespace in system tablespace, you will probably
want at least max(bytes) at least 4M, and sum(bytes) of 10M:
SQL> select max(bytes) from dba_free_space where tablespace_name = 'SYSTEM';
SQL> select sum(bytes) from dba_free_space where tablespace_name = 'SYSTEM';
2. Make system tablespace datafile autoextend:
SQL> alter database datafile 'path\filename' autoextend on
next 5m maxsize 100m;
View dba_data_files for file names
SQL> select * From dba_data_files where tablespace_name = 'SYSTEM';
3. Make rollback_data tablespace datafile autoextend:
SQL> alter database datafile 'path\filename' autoextend on
next 5m maxsize 200m;
4. Prior to running data dictionary scripts, spool to file
SQL> spool file.log
5. Check file.log and alert<SID>.log after execution for errors.
Solution Explanation:
=====================
When CATALOG.SQL or CATPROC.SQL were run as SYSTEM or another schema owner,
this created some valid and invalid objects owned by SYSTEM (in view
DBA_OBJECTS) that should be owned by SYS only. Comparing those object owned
by SYS with objects owned by other schemas and deleting the duplicate
objects removes the duplicate objects.

Similar Messages

  • Dequeuing the message using Non Sys user

    Hi all,
    I've implemented Advanced Queuing in one Schema(Say "temp") which has AQ privileges. My requirement is Asynchronous Communication between two programs.
    In One program i've DBMS_AQ.ENQUEUE to put the message onto the queue. The user "temp" enqueued the message.
    I've a anonymous PL/SQL callback procedure registered to dequeue the message. but while dequeuing the message, the user is "SYS". Immediately after dequeuing the message, i've a call to the second program which uses some views. In my application we have dba policies applied to these views. So only temp user can access those views where SYS user doesnt have any access to these views.
    we already have one solution i.e., giving access to SYS user also but this will result in some other security concerns for the application
    Another solution could be dequeuing the message with "temp" user (NON sys user).
    So i would like to know whether it is possible to dequeue the message with NON-SYS user ? i've tried searching the dequeue options and message properties but couldn't get anything..
    can anyone help me in solving this problem??

    Hi paul,
    Thanks for the response :). I've tried this already but still the dequeue user id "SYS". i'll explain you in detail with the code.
    I've create queue table and queue with the following code :
    create or replace TYPE temp_msg_type as object (seq_no NUMBER(10),
    req_type varchar2(6))
    begin
    dbms_aqadm.create_queue_table(
    queue_table => 'test_queue_tab',
    queue_payload_type => 'temp_msg_type',
    multiple_consumers => true);
    dbms_aqadm.create_queue(
    queue_name => 'test_queue',
    queue_table => 'test_queue_tab');
    dbms_aqadm.start_queue(
    queue_name => 'test_queue');
    end;
    After this an Agent is subscribed to this queue.
    begin
    dbms_aqadm.add_subscriber(
    queue_name => 'test_queue',
    subscriber => sys.aq$_agent('recipient', null, null));
    end;
    Then registered an PL/SQL callback procedure to this queue.
    begin
    dbms_aq.register(aq$_reg_info_list(
    aq$_reg_info('test_queue:RECIPIENT',
    DBMS_aq.NAMESPACE_AQ,
    'plsql://notifyCB_prd',
    HEXTORAW('FF')) ) ,
    1);
    end;
    The follwing procedure will enqueue the message. in the below code before i enqueue it i am inserting the current sessions' user, it got printed as "SCOTT".
    create or replace procedure enqueue_msg_prd( O_status_code IN OUT varchar2 )
    as
    enqueue_options dbms_aq.enqueue_options_t;
    message_properties dbms_aq.message_properties_t;
    message_handle RAW(16);
    message temp_msg_type;
    begin
    --enqueue_options.visibility := DBMS_AQ.IMMEDIATE;
    message := temp_msg_type(112, user);
    O_status_code := 'S';
    dbms_aq.enqueue(queue_name => 'test_queue',
    enqueue_options => enqueue_options,
    message_properties => message_properties,
    payload => message,
    msgid => message_handle);
    end;
    The following procedure will dequeue the message. this procedure will be automatically triggered when i commit the enqueue transaction since there is anonymous callback procedure registered for this queue. In the below code after i dequeue it i am inserting the sessions' user, it got printed as "SYS".
    create or replace
    procedure notifyCB_prd( context raw,
    reginfo aq$_reg_info,
    descr aq$_descriptor,
    payload raw,
    payloadl number)
    as
    dequeue_options dbms_aq.dequeue_options_t;
    message_properties dbms_aq.message_properties_t;
    message_handle raw(16);
    message temp_msg_type;
    begin
    dequeue_options.msgid := descr.msg_id;
    dequeue_options.consumer_name := descr.consumer_name;
    --execute immediate 'conn  session set current_user= scott';
    DBMS_AQ.DEQUEUE(
    queue_name => descr.queue_name,
    dequeue_options => dequeue_options,
    message_properties => message_properties,
    payload => message,
    msgid => message_handle);
    insert into temp values(message.seq_no,user);
    commit;
    end;
    Even i queried the aq$test_queue_Tab view. in this view, value in deq_user_id is "SYSS"
    is there any way to get the users session as 'SCOTT' ??

  • I have an phone 4s from cricket and when i text non iphone users such as android or and other phone brand they receive my text message but when they reply i wont get there message. send imessages is working its just my text message that is not working.

    i have an phone 4s from cricket and when i text non iphone users such as android or and other phone brand they receive my text message but when they reply i wont get there message. send imessages is working its just my text message that is not working.

    You use Restore to get the latest firmware build, not the Update button. You can only use the Update button, if there is an iOS update, say iOS 5.1.
    this link talks about updating to 9A406 to fix the "No Service" issue with iPhone 4S:
    http://iphone-and-i.blogspot.com/2011/12/fixing-iphone-4s-signal-problem.html

  • How can I repair and/or access a non-launching User account?

    [Rats, I just posted this but I can't see it. So I have to rewrite it...]
    I started another thread about this but maybe a more general User Acc't question is in order.
    If a User won't launch, what can you do?
    My old admin wouldn't launch. All other users would. So I used the hack that is easily googled and created a 2nd admin. I then could see the old admin folders in my new admin's Users folder. But I couldn't access anything. All the folders had a red/slash/circle on their little icons. I changed the old admin status to Standard but the little red/slash/circles remain. I copied a folder to my new desktop -- still no access. I can change permissions for each folder but there are jillions of them!
    Is there a way to globally change permissions to all folders within a folder?
    Is there  a way to fix a User so it will launch?
    Thanks!

    PS: I googled a bit and solved one of my questions myself: Niel's advice in the other thread is incomplete if you run into the problem that I did. You need to go to the little gear icon at the bottom of the Permissions pane in the Comm-I window. There you can select 'include enclosed' or something like that -- then all folders within a folder will also get their permission changed. I didn't know to do that until after an hour of further googling. So now I can access those files from the new admin.
    I'd still REALLY like to know if it's possible to "revive" a User Acc't that isn't launching.
    THANKS!

  • Report Builder Wizard and Parameter Creation with values from other data source e.g. data set or views for non-IT users or Business Analysts

    Hi,
    "Report Builder is a report authoring environment for business users who prefer to work in the Microsoft Office environment.
    You work with one report at a time. You can modify a published report directly from a report server. You can quickly build a report by adding items from the Report Part Gallery provided by report designers from your organization." - As mentioned
    on TechNet. 
    I wonder how a non-technical business analyst can use Report Builder 3 to create ad-hoc reports/analysis with list of parameters based on other data sets.
    Do they need to learn TSQL or how to add and link parameter in Report Builder? then How they can add parameter into a report. Not sure what i am missing from whole idea behind Report builder then?
    I have SQL Server 2012 STD and Report Builder 3.0  and want to train non-technical users to create reports as per their need without asking to IT department.
    Everything seems simple and working except parameters with list of values e.g. Sales year List, Sales Month List, Gender etc. etc.
    So how they can configure parameters based on Other data sets?
    Workaround in my mind is to create a report with most of columns and add most frequent parameters based on other data sets and then non-technical user modify that report according to their needs but that way its still restricting users to
    a set of defined reports?
    I want functionality like "Excel Power view parameters" into report builder which is driven from source data and which is only available Excel 2013 onward which most of people don't have yet.
    So how to use Report Builder. Any other thoughts or workaround or guide me the purpose of Report Builder, please let me know. 
    Many thanks and Kind Regards,
    For quick review of new features, try virtual labs: http://msdn.microsoft.com/en-us/aa570323

    Hi Asam,
    If we want to create a parameter depend on another dataset, we can additional create or add the dataset, embedded or shared, that has a query that contains query variables. Then use the option that “Get values from a
    query” to get available values. For more details, please see:http://msdn.microsoft.com/en-us/library/dd283107.aspx
    http://msdn.microsoft.com/en-us/library/dd220464.aspx
    As to the Report Builder features, we can refer to the following articles:http://technet.microsoft.com/en-us/library/hh213578.aspx
    http://technet.microsoft.com/en-us/library/hh965699.aspx
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Not receiving texts from iPhone contacts when I'm not connected to wifi or cell data. I can't send and receive regular SMS texts with non iMessage users but iMessage users message are not being converted to text when I don't have internet connect

    I can send and receive to any non iPhone user. I can send a message as a text to an iPhone user but if I'm not connected to cellular data or wifi I do not receive messages from iPhone contacts. From what I understand these message should automatically send to me as texts instead of iMessages but since the update it's not functioning properly. Please help. I've tried turning iMessage off and I still don't receive the messages until after I reconnect to wifi.

    I have the same problem! Before the upgrade, if I wasn't connected to the internet, any messages sent to me from an iphone would convert automatically to a text message. I have payg tarriff, so I turn cell data off, as it costs too much to use it. I have wifi at home and work, but if I'm out and about, I don't receive texts from iphone users until I'm on wifi. I get them ok from non iphone users. There was never any problem until ios7

  • Non-admin users and Time Machine

    We have a 1-1 laptop program with 7th and 8th grade students. The students are not admins of their own laptops.
    This year we gave each student an external hard drive and had them use Time Machine to back-up their accounts. The problem was when a student needed to restore from Time Machine, we needed to enter the administrator's password.
    We'll be switching to Lion over the summer, and by default, a non-admin user cannot even turn on Time Machine without an adminsitrator's password, which makes Time Machine useless. I don't want to have our students go back to manually dragging and dropping all of their school data (and movies and music) to back it all up (what a messy process).
    Is there any way around the need for an admin password to use Time Machine?

    Time Machine (the application) is already allowed. That's not the problem.
    In order to set-up Time Machine the first time, users have to open the Time Machine Preference, and that is locked. When a user tries to unlock it, they need to enter an administrator's password, but our students are only standar users.
    We don't want to have to enter that password for 250 machines each time students need to access that preference.
    In addition, an administrator's password is needed to restore anything from a Time Machine drive, and we'd like a way around that too.

  • Sql developer 1.2.1  failed sys user login

    Setting up a connection with the sys user in sql developer connections return invalid username/pw.
    I have the role set to sysdba.
    I can connect as non sys users with sql developer.
    I can connect via sqlplus with the sys user and pw.
    What would cause me not to be able to connect with the sys user with sql developer?
    Thanks

    This is the Oracle Designer forum. Not the SQL Developer forum.
    Please repost in the proper forum.

  • [SOLVED]Xorg won't work for my non root user

    I installed Arch Linux 2009.08 x86_64 Core inside Sun VirtualBox 3.0.8 and got up to the part of the Beginners' Guide that tells me to test X and it can never work for my non root user. Funny thing is, I tried running it as root and it worked even though my root user has no ~/.xinitrc file. Running startx or xinitrc as my non root user I get a small (maybe 400x600) white terminal but can't use my mouse or keyboard.
    After looking over the guide and doing a step I forgot and adding in all of the extra stuff the guide says might help I can use my mouse and keyboard in my non root users' small white terminal but X still won't start properly with xterm even though I put 'exec exterm' in my non root users' ~/.xinitrc file. Please help. Thanks for any help guys.
    Last edited by keiichi (2009-10-23 12:34:50)

    schuay wrote:
    keiichi wrote:After looking over the guide and doing a step I forgot and adding in all of the extra stuff the guide says might help I can use my mouse and keyboard in my non root users' small white terminal....
    I don't get it .. this sounds like xterm is starting up successfully (xterm is a small white terminal). Easiest way to get X up and running (imo) is
    sudo pacman -S gnome gdm xorg xf86-input-evdev
    sudo /etc/rc.d/hal start
    sudo /etc/rc.d/gdm start
    I didn't know that's what xterm was, thanks for telling me. Noob mistake.

  • Restricting SYS user to View other schema's Tables

    Hi All,
    Oracle DB Version - 10R2
    O/S - UNIX
    Could anyone share docs or steps to prevent SYS user to view other schema's tables;
    Thanks,
    Deepak

    Dear Deepak_DBA,
    If you revoke every privilege and role from the SYS user i presume the SYS will continue to select any table from the relevant schema. SYS is a special user and not like the others.
    For instance if you want to revoke the SYSDBA and the SYSOPER from the SYS user;
    SQL> revoke sysdba, sysoper from sys;
    revoke sysdba, sysoper from sys
    ERROR at line 1:
    ORA-01998: REVOKE failed: user SYS always has SYSOPER and SYSDBAI have never seen such documentation that describes how to revoke everything or at least the SELECT ANY TABLE privilege from the SYS user.
    Please see more about the SYS and the SYSTEM users;
    SYS and SYSTEM Users;
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10897/users_secure.htm#ADMQS12003
    Regards.
    Ogan

  • Sys user unable to do anything

    Hi,
    the setup is oracle 10g running on solaris 10.
    Recently, we faced a issue where no user was able to establish connection to the database, this we found to be due to a parameter processes=150, however even sys user was not able to perform any operations like 'select', 'shutdown of the database', etc etc. Finally i did kill the pmon process and then restarted the db and set processes=200.
    My Query is if there was a better way to handle the above situation, where there sys user can just login, but cannot perform any query/actions.

    the setup is oracle 10g running on solaris 10.
    Recently, we faced a issue where no user was able to establish connection to the database, this we found to be due to a parameter processes=150, however even sys user was not able to perform any operations like 'select', 'shutdown of the database', etc etc. Finally i did kill the pmon process and then restarted the db and set processes=200.
    My Query is if there was a better way to handle the above situation, where there sys user can just login, but cannot perform any query/actions.I think it is possible to start a new session and do such operation using sys user using a BEQUETH session. Login to your host server. Set the oracle_sid and connect as sysdba provided the user through which you logged in should be a member of dba group.
    Regdards.

  • Why can't i send text messages to non iphone users but have no problem sending them to people that have iphones?

    why can i not send sms and picture messages to non iphone users but have no trouble sending them to people who have iphones? help???

    .legoman. wrote:
    why can i not send sms and picture messages to non iphone users but have no trouble sending them to people who have iphones? help???
    Most likely your carrier has not enabled texting on your phone.

  • Running catproc.sql and catalog.sql scripts

    hi there,
    what is the need to run catproc.sql and catalog.sql scripts after creating the database manually?
    please write me the answer.
    thanks in advance.

    CATALOG.SQL script create data dictionary views,
    synonyms, tables in your sys/system schemas like
    (USER_XXX , DBA_XXXX, ALL_XXXX, V$XXXX .....)
    CATPROC.SQL script creates all packages including
    their procedures and functions in sys schema.
    Both must be run through SYS schema.Apart for this
    These scripts executes many Create View statements as well as series of other scripts.
    Catproc.sql makes call to several other scripts like
    standard.sql: to create datatypes and in-built SQL functions
    catexp: to create views used by Import/Export utilities
    catldr: to create views used by SQL*Loder utilities
    and there many other scripts called too.
    Similarly, catproc.sql makes call to .sql and .plb encrypted scripts like dbmsutil.sql and dbmssql.sql to create procedural options and PL/SQL utilities.

  • Catproc.sql and catalog.sql files

    I am using oracle 10g recently i have runned two files catproc.sql and catalog files by connecting to sys
    after running those files in sys when i select
    select * from tab;
    no rows were returned
    1) these files will show any eeect on data base
    2)From toad when i connect to data base in toad it is showing all the tables in sys user
    is there any effect of running those files

    933900 wrote:
    I am using oracle 10g recently i have runned two files catproc.sql and catalog files by connecting to sys
    after running those files in sys when i select
    select * from tab;
    no rows were returned
    1) these files will show any eeect on data base
    2)From toad when i connect to data base in toad it is showing all the tables in sys user
    is there any effect of running those filesHave you created database newly? so you ran catalog.sql & catproc.sql?
    Of course you can able to see from TOAD but not from SQL, its weird.
    Can you post
    SQL> select * from dba_registry;
    Also any errors from alert log file, when you ran These scripts? if so post here.

  • Security about SYSTEM and SYS users

    Guys,
    Just curiosity,
    1) What happens if I logged with a user that have DBA role or DROP USER privilege and to drop the SYSTEM or SYS user ? This is possible ? If yes, how can protect them ?
    2) I know that the SYS is owner of the dictionary and catalog, but what is the objective of the SYSTEM user to exists ?
    Tank you.

    Hi,
    As you say, SYS is the owner of the database and the owner of the data dictionary.
    But SYS has the SYSDBA privilege which SYSTEM doesn't. This makes it possible for SYS to become a very very powerful user. In addition, never ever create objects in the SYS schema. SYSTEM is a privileged administration user, and typically owns Oracle provided tables other than the dictionary.
    Making a test.
    oracle@linux:~> sqlplus
    SQL*Plus: Release 9.2.0.4.0 - Production on Thu Dec 7 08:55:51 2006
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    Enter user-name: / as sysdba
    Connected to an idle instance.
    SQL> startup
    ORACLE instance started.
    Total System Global Area 126948772 bytes
    Fixed Size 452004 bytes
    Variable Size 104857600 bytes
    Database Buffers 20971520 bytes
    Redo Buffers 667648 bytes
    Database mounted.
    Database opened.
    As Frederic showed
    SQL> drop user sys cascade;
    drop user sys cascade
    ERROR at line 1:
    ORA-01031: insufficient privileges
    SQL> drop user system cascade;
    User dropped.
    SQL> shutdown immediate
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> startup
    ORACLE instance started.
    Total System Global Area 126948772 bytes
    Fixed Size 452004 bytes
    Variable Size 104857600 bytes
    Database Buffers 20971520 bytes
    Redo Buffers 667648 bytes
    Database mounted.
    Database opened.
    SQL>
    If you like to protect it, you can do this below:
    eg:
    create table secured_objects(object_name varchar2(30));
    Table created.
    SQL> insert into secured_objects values ('SYSTEM');
    1 row created.
    SQL> select * from secured_objects;
    OBJECT_NAME
    SYSTEM
    1 rows selected.
    create or replace trigger check_beforedrop
    before drop on database
    declare
    oname char(30);
    begin
    select object_name into oname from secured_objects
    where upper(object_name)=ora_dict_obj_name;
    if sql%found then
    RAISE_APPLICATION_ERROR(-20001,'You have not permission to drop this object.');
    end if;
    exception
    when no_data_found
    then dbms_output.put_line('This object was dropped.');
    end;
    SQL> drop user system cascade;
    drop user system
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-20001: You have not permission to drop this object.
    ORA-06512: at line 7
    Reference: http://www.adp-gmbh.ch/ora/misc/sys_system_internal.html
    Cheers

Maybe you are looking for