Showing posts with label invalid. Show all posts
Showing posts with label invalid. Show all posts

Wednesday, 6 April 2016

Panaya ETL Extraction error message

While extraction process of panaya etl, we encountered below error messages, but the extraction got completed.

* ad_bugs.csvError writing data to ad_bugs.csv: ORA-00904: "SUCCESS_FLAG": invalid identifier
* fast_formulas.csvError writing data to fast_formulas.csv: ORA-08103: object no longer exists
* ad_bugs.csvError writing data to ad_bugs.csv: ORA-00904: "SUCCESS_FLAG": invalid identifier
* profiles.csvError writing data to profiles.csv: ORA-00942: table or view does not exist

And as per the panaya support team, these temporary errors did not seem to affect the processing of the ETL, it seems to have been created anyway, recommend to upload the output to Panaya site.

Saturday, 14 March 2015

Database Startup & Shutdown

   Database Startup & Shutdown 
Startup :
The database is open and ready for use after being created. Once the Operating system is shutdown, or the database is shutdown, it must be started and opened before it can be accessed. 
There are three main modes to start the database:
1) NOMOUNT:
 The NOMOUNT mode is used to create a SGA or to create a control file.
2) MOUNT:
 The MOUNT mode reads the control files but does not access any other datafiles. The MOUNT mode is typically used for restoring the database or for moving database datafiles. 
3) OPEN:
The OPEN mode makes the database available to other users. At this point, all database datafiles are opened for access. 
Other modes are RESTRICT, RECOVER, and MIGRATE.
 The RESTRICT mode is used to fully open the database but only those users with the RESTRICTED SESSION system privilege will be able to connect to the database. This mode lets you perform database maintenance tasks while ensuring your application users cannot access the database.
 The RECOVER mode is used to automatically start recovery of the database. Alternatively, you could startup the database in MOUNT mode and issue the ALTER DATABASE RECOVER command. 
The MIGRATE mode is required starting with Oracle 9i to migrate the database from one version to another. If you do not start in MIGRATE mode, the upgrade scripts will not run. 
To startup a database using SQL*Plus use the following procedure. The command used is the STARTUP command; its format follows. 
STARTUP  [RESTRICTED] [FORCE] [PFILE=filename or SPFILE=filename]
         [EXCLUSIVE or PARALLEL]
         [MOUNT or OPEN] dbname
         [NOMOUNT] [RECOVER] [MIGRATE]
1. Log in to SQL*Plus as a user with SYSDBA (or SYSOPER) privileges. Prior to Oracle 9i, you could additionally sign on as the INTERNAL user or SYS, but INTERNAL is deprecated in 9i.
2. Issue one of the following commands:
1. STARTUP OPEN dbname PFILE=filename 

This command starts the instance, opens the database named dbname using the parameter file specified by the filename following the PFILE= clause. This starts up the database in the default, EXCLUSIVE mode.
2. STARTUP RESTRICT SPFILE=filename 

This command starts the instance, opens the database using the specified server parameter file following the SPFILE= clause. This starts up the database in the restricted only mode (only users with RESTRICTED SESSION privilege can log in).
3. STARTUP NOMOUNT 

This command starts the instance, but leaves the database dismounted and closed. Cannot be used with EXCLUSIVE, MOUNT or OPEN.
4. STARTUP MOUNT 

This command starts the instance and mounts the database, but leaves it closed.
5. STARTUP OPEN dbname PARALLEL 
This command starts the instance, opens the database and puts the database in PARALLEL mode for multi-instance use in pre-Oracle 8 versions. As of Oracle 8 simply setting the initialization parameter PARALLEL_SERVER to TRUE starts the instance in parallel server (shared) mode. PARALLEL is obsolete as of Oracle 8. Cannot be used with EXCLUSIVE or NOMOUNT or if the INIT.ORA parameter SINGLE_PROCESS is set to TRUE. The SHARED parameter is also obsolete as of Oracle 8. 
6. STARTUP OPEN dbname EXCLUSIVE 

This command is functionally identical to "a" above. Cannot be specified if PARALLEL or NOMOUNT is also specified in pre-Oracle 8 versions. EXCLUSIVE is obsolete as of Oracle 8. If PARALLEL_SERVER is FALSE the database defaults to EXCLUSIVE.
7. The FORCE parameter can be used with any of the above options to force a shutdown and restart of the database into that mode. This is not normally done and is only used for debugging and testing.
8. The RECOVER option can be used to immediately start recovery of the database on startup if desired. 
9. The MIGRATE option is used to start the database to upgrade to a new version. This option is required to migrate to Oracle 9i and above. 
Shutdown:
The databases should be shutdown before system shutdowns, before full backups and anytime system operations require it to be shutdown. 
To perform a manual shutdown, perform the following procedure. 
1. Log in to SQL*Plus as the SYS user.
2. Issue the appropriate SHUTDOWN command.
1. No option means SHUTDOWN NORMAL -
                                       the database waits for all users to disconnect, prohibits new connects, then closes and dismounts the database, then shuts down the instance.
2. SHUTDOWN IMMEDIATE -
                           cancels current calls like a system interrupt, and closes and dismounts the database, then shuts down the instance. PMON gracefully shuts down the user processes. No instance recovery is required on startup.
3. SHUTDOWN ABORT - 
                        This doesn't wait for anything. It shuts the database down now. Instance recovery will probably be required on startup. You should escalate to this by trying the other shutdowns first. 
4. SHUTDOWN TRANSACTIONAL:
                                 cancels current calls like a system interrupt, and closes and dismounts the database, then shuts down the instance. PMON gracefully shuts down the user processes. No instance recovery is required on startup.

Oracle Database User Management

CREATING THE USER:
create user <USERNAME> identified by <PASSWORD> 
default tablespace <TABLESPACE NAME> 
temporary tablespace <TABLESPAC NAME> 
quota 30m on <TABLESPACE NAME>; 
Eg:
create user <John> identified by <John> 
default tablespace <users> 
temporary tablespace <temp> 
quota 30m on <users>; 
Above command creates a user chandra with password chandra. Consider the tablespace you have in which chandra will store his data is "USERS". The tablespace used for storing temporary segments will be "TEMP" and the amount of space which the user chandra can use on "USERS" tablespace is 30M.
DROPING THE USER:

            SQL> DROP USER John CASCADE;
 
ALTERING/UNLOCKING ACCOUNT: 
SQL> alter user john identified by john account unlock;

The above command alters or unlocks the "john" user with password "john".
SQL> select username, account_status, default_tablespace, 
temporary_tablespace, profile from dba_users 
where username = 'john';
SQL> select * from dba_ts_quotas where username = 'john'; 
GRANTING AND REVOKING PRIVILEGES:
Syntax:
SQL>GRANT <PRIVILAGE> TO <USERNAME>
SQL>REVOKE <PRIVILAGE> FROM <USERNAME>
Eg:
SQL> GRANT create table to john;‎ 
SQL> GRANT create session to john;
SQL> GRANT create any table, create tablespace to john;
SQL> REVOKE create any table from john;
SQL> REVOKE create tablespace from john;
SQL> GRANT select, insert, update, delete on <TABLENAME> to john;
SQL> REVOKE update,delete on USERS.PAY_PAYMENT_MASTER from john;
 
ROLES:
Creating Roles
Create Role
CREATE ROLE <role_name>;
CREATE ROLE read_only;
Create Password Protected Role
CREATE ROLE <role_name> IDENTIFIED BY <password>;
CREATE ROLE dba IDENTIFIED BY "johnny";

Assigning Privileges And Roles To Roles
Assign Privilege To A Role
GRANT <privilege_name> TO <role_name>;
GRANT create session TO read_only
Create A Role Heirarchy
GRANT <role_name> TO <role_name>;
CREATE ROLE ap_clerk;

GRANT read_only TO ap_clerk;
GRANT select ON general_ledger TO ap_clerk;
GRANT insert ON ap_master TO ap_clerk;
GRANT update ON ap_master TO ap_clerk;
GRANT insert ON ap_detail TO ap_clerk;
GRANT update ON ap_detail TO ap_clerk;
Add Another Layer To The Heirarchy
GRANT <roles and privileges> TO <role_name>;
CREATE ROLE ap_manager IDENTIFIED BY appwd;

GRANT ap_clerk TO ap_manager;
GRANT delete ON ap_master TO ap_manager;
GRANT delete ON ap_detail TO ap_manager;
GRANT select any table TO ap_manager;

Assigning Roles
Assigning Roles To Users
GRANT <roles_name> TO <user_name>;
GRANT read_only TO jbiden;

GRANT ap_clerk TO jstough;
GRANT ap_clerk TO ckeizer;
GRANT ap_clerk TO rallen;

GRANT ap_manager TO escott;

Revoking Privileges From Roles
Revoke Privilege
REVOKE <privilege_name> FROM <role_name>;
REVOKE select any table FROM ap_manager;

Revoking Roles
Revoke a role from a user
REVOKE <role_name> FROM <user_name>;
REVOKE ap_manager FROM escott;
Revoke A Role And Drop Any Invalidated Constraints
REVOKE ALL ON <table_name>
FROM <schema_name> 
CASCADE CONSTRAINTS;
REVOKE ALL ON invoices
FROM abc 
CASCADE CONSTRAINTS;

Activating & Decactivating Roles
Activating A Role
SET ROLE <role_name>;
SET ROLE ap_clerk;
Activating A Password Protected Role
SET ROLE <role_name> IDENTIFIED BY <role_password>;
SET ROLE ap_manager IDENTIFIED BY appwd;
Activating All Roles
SET ROLE all;
Activating All Roles Except One
SET ROLE all EXCEPT <role_name>;
SET ROLE all EXCEPT ap_manager;
Deactivating A Role
Can not be done on an indiviDUAL basis
Deactivating All Roles
SET ROLE none;

Drop Role
Dropping A Role 
DROP ROLE <role_name>;
DROP ROLE manager_role;