Hi,
I need to extract the table name from an oracle control file which comes as the last word in the third line.
Ex:
LOAD DATA
INFILE '/home/user/files/scott.dat'
INTO TABLE SCOTT.EMP_SAL
FIELDS TERMINATED BY..........
what i want to to is write the table name SCOTT.EMP_SAL to a... (2 Replies)
Hi all,
i have a list of files that contains some PC hostname, then i need to enumerate every hostname and check if there's a table with same name of the hosts in MySQL database XYZ.
I need this because have to decide automatically if i have to make a create table or a insert into an existent... (2 Replies)
Hi,
Pls check that '|' and '+' present in Step-1 are not copied to log file in Step-3.
Pls suggest how to get the exact output from Step-1 (i.e. with out losing '|' and '+') in to a log file
~Thanks
Step-1: Execute command
> mysql -utest -ptest -htesthost testdb -e "select * from... (3 Replies)
I need to extract the data from oracle table and written the below code.
But it is not working.There is some problem with the query and output is shown is No rows selected" . If I run the same query from sql developer there is my required output.
And if I run the shell script with simple sql... (7 Replies)
I want to extract a table from an HTML file. the table starts with
<table class="tableinfo"
and ends with next closing table tag
</table>
how can I do this with awk/sed...
---------- Post updated at 04:34 PM ---------- Previous update was at 04:28 PM ----------
also I want to... (4 Replies)
Hi All,
I am writing a shell script to extract oracle table into a pipe dilemited flat file. Below is my code and I have attached two files that I have abled to generate so far.
1. Table.txt ==> database extract file
2. flat.txt ==> pipe delimited after some manipulation of the original db... (5 Replies)
I need to sort out table in a file to a format below:
Input:
this is a test
example
Cat Bee Dat
1 2 3
more Example
date
data
Bet Cla Blaa Dat
A 6 T
data..
Output:
this is a test (10 Replies)
Hi,
Below is my code to execute mysql statement , how to save the output to a file ?
#!/usr/bin/bash
#Script to run automated sql queries
#Declaring mysql DB connection
MASTER_DB_USER='root'
MASTER_DB_PASSWD='root'
MASTER_DB_PORT=3306
MASTER_DB_HOST='localhost'... (1 Reply)
I have below 2 requirements for parameterize the generate the extract file from Oracle table using Shell Script. Could you please help me by
modifying the script and show me how to execute it.
First Requirement:
I have a requirement where I need to parameterize to generate one... (0 Replies)
Discussion started by: hareshvikram
0 Replies
LEARN ABOUT SUSE
alter_database
ALTER DATABASE(7) SQL Commands ALTER DATABASE(7)NAME
ALTER DATABASE - change a database
SYNOPSIS
ALTER DATABASE name [ [ WITH ] option [ ... ] ]
where option can be:
CONNECTION LIMIT connlimit
ALTER DATABASE name RENAME TO newname
ALTER DATABASE name OWNER TO new_owner
ALTER DATABASE name SET TABLESPACE new_tablespace
ALTER DATABASE name SET configuration_parameter { TO | = } { value | DEFAULT }
ALTER DATABASE name SET configuration_parameter FROM CURRENT
ALTER DATABASE name RESET configuration_parameter
ALTER DATABASE name RESET ALL
DESCRIPTION
ALTER DATABASE changes the attributes of a database.
The first form changes certain per-database settings. (See below for details.) Only the database owner or a superuser can change these set-
tings.
The second form changes the name of the database. Only the database owner or a superuser can rename a database; non-superuser owners must
also have the CREATEDB privilege. The current database cannot be renamed. (Connect to a different database if you need to do that.)
The third form changes the owner of the database. To alter the owner, you must own the database and also be a direct or indirect member of
the new owning role, and you must have the CREATEDB privilege. (Note that superusers have all these privileges automatically.)
The fourth form changes the default tablespace of the database. Only the database owner or a superuser can do this; you must also have
create privilege for the new tablespace. This command physically moves any tables or indexes in the database's old default tablespace to
the new tablespace. Note that tables and indexes in non-default tablespaces are not affected.
The remaining forms change the session default for a run-time configuration variable for a PostgreSQL database. Whenever a new session is
subsequently started in that database, the specified value becomes the session default value. The database-specific default overrides
whatever setting is present in postgresql.conf or has been received from the postgres command line. Only the database owner or a superuser
can change the session defaults for a database. Certain variables cannot be set this way, or can only be set by a superuser.
PARAMETERS
name The name of the database whose attributes are to be altered.
connlimit
How many concurrent connections can be made to this database. -1 means no limit.
newname
The new name of the database.
new_owner
The new owner of the database.
new_tablespace
The new default tablespace of the database.
configuration_parameter
value Set this database's session default for the specified configuration parameter to the given value. If value is DEFAULT or, equiva-
lently, RESET is used, the database-specific setting is removed, so the system-wide default setting will be inherited in new ses-
sions. Use RESET ALL to clear all database-specific settings. SET FROM CURRENT saves the session's current value of the parameter
as the database-specific value.
See SET [set(7)] and in the documentation for more information about allowed parameter names and values.
NOTES
It is also possible to tie a session default to a specific role rather than to a database; see ALTER ROLE [alter_role(7)]. Role-specific
settings override database-specific ones if there is a conflict.
EXAMPLES
To disable index scans by default in the database test:
ALTER DATABASE test SET enable_indexscan TO off;
COMPATIBILITY
The ALTER DATABASE statement is a PostgreSQL extension.
SEE ALSO
CREATE DATABASE [create_database(7)], DROP DATABASE [drop_database(7)], SET [set(7)], CREATE TABLESPACE [create_tablespace(7)]
SQL - Language Statements 2010-05-14 ALTER DATABASE(7)