Welcome to plsql4all.blogspot.com SQL, MYSQL, ORACLE, TERADATA, MONGODB, MARIADB, GREENPLUM, DB2, POSTGRESQL.

Tuesday 15 November 2016

Quote of the Day

'I judge people by their own principles – not by my own.'- Martin Luther King

Monday 31 October 2016

Business in A.P and Telangana

Ease of Doing Business: A.P., Telangana top in 2016 all-India ranking: http://www.thehindu.com/business/ease-of-doing-business-andhra-pradesh-telangana-tops-2016-allindia-ranking/article9288074.ece

Sunday 30 October 2016

Thought of the day

Saturday 29 October 2016

How can I achieve Peaceful mind?

      Yes, you are aware of all stereotypical methods to get peaceful mind, but here is available some non-conventional methods. That is "Ignore", if you simply ignore what other people think about you, you can have 99℅ chances to achieve peace.

       Also do not try to impress everybody since it's very tough job to satisfy and win everyone, for that you need to waste time,money or both in some cases. If you no more required to impress others you are saving that time. Do some useful work with that time.

       Make yourself busy with something to avoid some talkative people and non sense debates on politics and movies and especially on third person.

Thursday 27 October 2016

Thought of the Day

It's better to follow your own path imperfectly, than following others path perfectly. - Bagavad Gita.

Monday 17 October 2016

How to find table wise list of column in Teradata

There may be requirement that you need to find list of the columns of a table or tables. To find this you need to query DBC.COLUMNS data dictionary view.

Example:-

SELECT  * FROM DBC.COLUMNS;

Above query will show all the tables and their columns.

If you know the table or view name then you can specify that in the where condition.

Example:-

SEKECT  * FROM SBC.COLUMNS
WHERE TABLENAME = 'TABLE_NAME';

Thursday 13 October 2016

Grant privileges to user in Teradata

While accessing or modifying any table in Teradata we have to have appropriate privileges to do that. For example if you want to SELECT data from a table in Teradata you have to have SELECT privileges. Let's see how we can provide the privileges.

To give privileges you should have administrator rights.

Syntax:-

GRANT SELECT ON TABLE_NAME TO USER-NAME;

Example:-

Let's say your table name is EMPLOYEE and user name is DBUSER.

GRANT SELECT ON EMPLOYEE TO DBUSER;

Saturday 8 October 2016

How to know Oracle Client / Server is install on your machine

If you are new to Oracle and want to know whether Oracle client is install on your computer then type SQLPLUS in command prompt if Oracle client is install on your computer then command prompt will prompt you for user id else it will say command is not recognized as internal or external command.

 

How to know whether Teradata Utilities are install on your compauter

If you are new to Teradata and don't know if Teradata is install on your computer then you can execute Teradata utilities commands. Below is the sample BTEQ command. Go to the command prompt and type BTEQ, MLOAD and FLOAD etc.

Sample BTEQ is:-

 

Thursday 8 September 2016

How many LOB columns Teradata allows?

Teradata allows 32 LOB columns.

Saturday 3 September 2016

How many view / micro we can have as nested in Teradata?

We can have 8 View / Macro nesting levels.

How many columns we can have as Foreign & Parent Key?

We can have 16 Columns in Foreign & Parent key.

How many tables can refer a table in Teradata?

We can have 64 Tables that can reference a table.

How many per table referencail constraints we can have in Teradata?

We can have 64 Referential constraints per table.

How many per table constratints per table we can have in Teradata?

We can have 100 Table level constraints per table.

How many seconday / join indexes we can have in Teradata?

We can have 32 Secondary / Join indexes per table.

How many per index column we can have in Teradata?

We can have 62 Number of columns per index.

What is the maximum length of the column name or table name in Teradata?

We can have 30 Characters as Column / Table name length.
 

Here are 5 frequently asked questions (FAQs) about the maximum length of column names or table names in Teradata:-

1. What is the maximum length of a column name in Teradata?
   - The maximum length of a column name in Teradata is 30 characters. Column names exceeding this length will result in an error when attempting to create or modify a table.

2. What is the maximum length of a table name in Teradata?
   - Similarly, the maximum length of a table name in Teradata is also 30 characters. Table names that exceed this length will generate an error during table creation or renaming operations.

3. Why does Teradata impose a maximum length for column and table names?
   - Teradata imposes a maximum length for column and table names for compatibility and efficiency reasons. Keeping names within a reasonable length helps ensure interoperability with various client applications, tools, and standards. Additionally, shorter names contribute to better performance and readability in SQL queries and metadata.

4. Can I use special characters or spaces in column or table names to bypass the length restriction?
   - No, Teradata does not allow the use of special characters or spaces in column or table names. Names must consist of alphanumeric characters and underscores only, and they must begin with a letter. Attempting to use special characters or spaces will result in an error, regardless of length.

5. What should I do if I need longer column or table names in Teradata?
   - If you require longer and more descriptive names for columns or tables, consider using abbreviations or alternative naming conventions that convey the necessary information within the 30-character limit. Additionally, you can use comments or metadata annotations to provide additional context for columns and tables without sacrificing readability or compatibility.

These FAQs should provide a clear understanding of the maximum length limitations for column names and table names in Teradata and how to work within those constraints effectively.

What is the maximum size of LOB data type in Teradata table?

We can have 2 GB LOB size.

How many columns we can have per view in Teradata?

We can have 512 Columns per View.

How many LOB columns we can have in a single Teradata table?

We can have 32 LOB columns per table.

How many columns we can have in a single Teradata table?


We can have 2048 Columns per table.

How many journal we can have in Teradata database?


We can have 1 Journal tables per database.

How many tables we can have in Teradata database?

We can have 32,000  Tables per database.

Saturday 27 August 2016

Remove password for excel file

Below are the steps which removes the password protection of the excel:-

1.       Use the password to open the document.



2.       Click the Microsoft Office Button image, point to Prepare, and then click Encrypt Document.


3.       In the Encrypt Document dialog box, in the Password box, delete the encrypted password, and then click OK.



4.       Save the file. 

Set password for excel file

To set password for excel file you need to perform below steps:-


1.       Click the Microsoft Office Button  point to Prepare, and then click Encrypt Document.



2.       In the Encrypt Document dialog box, in the Password box, type a password, and then click OK.



3.       In the Confirm Password dialog box, in the Reenter password box, type the password again, and then click OK.


4.       To save the password, save the file. 

Saturday 23 July 2016

ORA-00252:

ORA-00252: log string of thread string is empty, cannot archive.

Cause: A log must be used for redo generation before it can be archived. The specified redo log was not been used since it was introduced to the database. However it is possible that instance death during a log switch left the log empty.


Action: Empty logs do not need to be archived. Do not attempt to archive the redo log file.

Tuesday 17 May 2016

ORA-00282

ORA-00282: UPI string call not supported, use ALTER DATABASE RECOVER.

Cause: The given UPI call is no longer supported.


Action: Use the ALTER DATABASE RECOVER command for all recovery actions.

ORA-00281

ORA-00281: media recovery may not be performed using dispatcher.

Cause: An attempt was made to use a dispatcher process for media recovery. Memory requirements disallow this recovery method.


Action: Connect to the instance via a dedicated server process to perform media recovery.

ORA-00280

ORA-00280: change string for thread string is in sequence #string.

Cause: This message helps to locate the redo log file with the specified change number requested by other messages.


Action: Use the information provided in this message to specify the required archived redo log files for other errors.

ORA-00279

ORA-00279: change string generated at string needed for thread string.

Cause: The requested log is required to proceed with recovery.


Action: Please supply the requested log with "ALTER DATABASE RECOVER LOGFILE <file_name>" or cancel recovery with "ALTER DATABASE RECOVER CANCEL".

ORA-00278

ORA-00278: log file 'string' no longer needed for this recovery.

Cause: The specified redo log file is no longer needed for the current recovery.


Action: No action required. The archived redo log file may be removed from its current location to conserve disk space, if needed. However, the redo log file may still be required for another recovery session in the future.

ORA-00277

ORA-00277: illegal option to the UNTIL recovery flag string.

Cause: Only CANCEL, CHANGE, CONSISTENT and TIME can be used with the UNTIL keyword.


Action: Correct the syntax.

ORA-00276

ORA-00276: CHANGE keyword specified but no change number given.

Cause: The CHANGE keyword was specified on the command line, but no change number was given.


Action: Retry the command using a valid change number after the CHANGE keyword.

ORA-00275

ORA-00275: media recovery has already been started.

Cause: An attempt was made to start a second media recovery operation in the same session.


Action: Complete or cancel the first media recovery session or start another session to perform media recovery.

ORA-00274

ORA-00274: illegal recovery option string.

Cause: An illegal option was specified for a recovery command.


Action: Correct the syntax and retry the command.

ORA-00273

ORA-00273: media recovery of direct load data that was not logged.

Cause: A media recovery session encountered a table that was loaded by the direct loader without logging any redo information. Some or all of the blocks in this table are now marked as corrupt.


Action: The table must be dropped or truncated so that the corrupted blocks can be reused. If a more recent backup of the file is available, try to recover this file to eliminate this error.

ORA-00272

ORA-00272: error writing archive log string.

Cause: An I/O error occurred while archiving a redo log file.


Action: Check that the output device is still available and correct any device errors that may have occurred. Also, make certain that sufficient space for archiving is available on the output device.

ORA-00271

ORA-00271: there are no logs that need archiving.

Cause: An attempt was made to archive the unarchived redo log files manually, but there are no files that need to be archived.


Action: No action required.

ORA-00270

ORA-00270: error creating archive log string.

Cause: An error was encountered when either creating or opening the destination file for archiving.


Action: Check that the archive destination is valid and that there is sufficient space on the destination device.

ORA-00269

ORA-00269: specified log file is part of thread string not string.

Cause: The given redo log file is not part of the given thread


Action: Check that the thread of the redo log file matches the thread on the command line. If not, use a redo log file from the appropriate thread. Retry the command after correcting the error.

ORA-00268

ORA-00268: specified log file does not exist 'string'.

Cause: The given redo log file does not exist.

        Action: Check the spelling and capitalization of the filename and retry the command.

ORA-00267

ORA-00267: name of archived log file not needed.

Cause: During media recovery, the name of an archived redo log file was entered, but no name was requested.


Action: Continue media recovery, but do not enter a new log name.

ORA-00266

ORA-00266: name of archived log file needed.

Cause: During media recovery, the name of an archived redo log file was requested, but no name was entered.


Action: Mount the correct redo log file and enter its name when it is requested.

ORA-00265

ORA-00265: instance recovery required, cannot set ARCHIVELOG mode.

Cause: The database either crashed or was shutdown with the ABORT option. Media recovery cannot be enabled because the online logs may not be sufficient to recover the current datafiles.


Action: Open the database and then enter the SHUTDOWN command with the NORMAL or IMMEDIATE option.

ORA-00264:

ORA-00264: no recovery required.

Cause: An attempt was made to perform media recovery on files that do not // need any type of recovery.


Action: Do not attempt to perform media recovery on the selected files. Check to see that the filenames were entered properly. If not, retry the command with the proper filenames.

ORA-00263

ORA-00263: there are no logs that need archiving for thread string.

Cause: An attempt was made to manually archive the unarchived logs in this thread but no logs needed archiving.


Action: No action required.

ORA-00262

ORA-00262: current log string of closed thread string cannot switch.

Cause: The log cannot be cleared or manually archived because it is the current log of a closed thread, and it is not possible to switch logs so another log is current. All other logs for the thread need to be archived, or cleared, and cannot be reused.


Action: Archive another log in the same thread first, or complete the clearing. See attached errors for the reason the switch cannot be completed.

ORA-00261

ORA-00261: log string of thread string is being archived or modified.

Cause: The log is either being archived by another process or an administrative command is modifying the log. Operations that modify the log include clearing, adding a member, dropping a member, renaming a member, and dropping the log.


Action: Wait for the current operation to complete and try again.

ORA-00260:

ORA-00260: cannot find online log sequence string for thread string.

Cause: The log sequence number supplied to the archival command does not match any of the online logs for the thread. The log might have been reused for another sequence number, it might have been dropped, the sequence number might be greater than the current log sequence number, or the thread might not have any logs.


Action: Check the ARCHIVE statement, then specify a valid log sequence number. Specify a valid log sequence number.

ORA-00259

ORA-00259: log string of open instance string (thread string) is the current log, cannot archive

Cause: An attempt was made to archive the current log of an open thread. This is not allowed because the redo log file may still be in use for the generation of redo entries.


Action: Force a log switch in the instance where the thread is open. If no instances are open, open the database so that instance recovery can recover the thread.

ORA-00258

ORA-00258: manual archiving in NOARCHIVELOG mode must identify log

Cause: The database is in NOARCHIVELOG mode and a command to manually archive a log did not specify the log explicitly by sequence number, group number or filename.


Action: Specify log by filename, by group number or by thread and sequence number.

ORA-00257

ORA-00257: archiver error. Connect internal only, until freed.

Cause: The archiver process received an error while trying to archive a redo log. If the problem is not resolved soon, the database will stop executing transactions. The most likely cause of this message is the destination device is out of space to store the redo log file.


Action: Check archiver trace file for a detailed description of the problem. Also verify that the device specified in the initialization parameter ARCHIVE_LOG_DEST is set up properly for archiving.

ORA-00256

ORA-00256: cannot translate archive destination string string

Cause: The destination specified by an ALTER SYSTEM ARCHIVE LOG START TO command could not be translated.


Action: Check the accompanying message stack for more detailed information. Then, retry the ALTER SYSTEM command using a different string.

ORA-00255

ORA-00255: error archiving log string of thread string, sequence # string

Cause: An error occurred during archiving.


Action: Check the accompanying message stack for more detailed information. If the online log is corrupted, then the log can be cleared using the UNARCHIVED option. This will make any existing backups useless for recovery to any time after the log was created, but will allow the database to generate redo.

ORA-00254

ORA-00254: error in archive control string 'string'.

Cause: The specified archive log location is invalid in the archive command or the LOG_ARCHIVE_DEST initialization parameter.


Action: Check the archive string used to make sure it refers to a valid online device.

ORA-00253

ORA-00253: character limit string exceeded by archive destination string string.

Cause: The destination specified by an ALTER SYSTEM ARCHIVE LOG START TO command was too long.


Action: Retry the ALTER SYSTEM command using a string shorter than the limit specified in the error message.

ORA-00252

ORA-00252: log string of thread string is empty, cannot archive

Cause: A log must be used for redo generation before it can be archived. The specified redo log was not been used since it was introduced to the database. However it is possible that instance death during a log switch left the log empty.


Action: Empty logs do not need to be archived. Do not attempt to archive the redo log file.

ORA-00251

ORA-00251: LOG_ARCHIVE_DUPLEX_DEST cannot be the same destination as string string.

Cause: The destination specified by the LOG_ARCHIVE_DUPLEX_DEST parameter is the same as the destination specified by an ALTER SYSTEM ARCHIVE LOG START TO command.


Action: Specify a different destination for parameter LOG_ARCHIVE_DUPLEX_DEST, or specify a different destination with the ALTER SYSTEM command.

ORA-00250

ORA-00250: archiver not started.

Cause: An attempt was made to stop automatic archiving, but the archiver process was not running.


Action: No action required.

ORA-00240

ORA-00240: control file enqueue held for more than string seconds.

Cause: The current process did not release the control file enqueue within the maximum allowed time.


Action: Reissue any commands that failed and contact Oracle Support Services with the incident information.

ORA-00239

ORA-00239: timeout waiting for control file enqueue: held by 'string' for more than string seconds

Cause: The specified process waited the maximum allowed time for the control file enqueue.


Action: Restart the blocking instance indicated in the incident trace file or reboot the blocking node.

ORA-00238

ORA-00238: operation would reuse a filename that is part of the database.

Cause: The filename supplied as a parameter to the ALTER DATABASE BACKUP CONTROLFILE command or to cfileSetSnapshotName matches the name of a file that is currently part of the database.


Action: Retry the operation with a different filename.

ORA-00237

ORA-00237: snapshot operation disallowed: control file newly created.

Cause: An attempt to invoke cfileMakeAndUseSnapshot with a currently mounted control file that was newly created with CREATE CONTROLFILE was made.


Action: Mount a current control file and retry the operation.

ORA-00236

ORA-00236: snapshot operation disallowed: mounted control file is a backup.

Cause: Attempting to invoke cfileSetSnapshotName, cfileMakeAndUseSnapshot, or cfileUseSnapshot when the currently mounted control file is a backup control file.


Action: Mount a current control file and retry the operation.
Please provide your feedback in the comments section above. Please don't forget to follow.