Hi everyone,
Can anyone help me in question below?
I want to cron a job to add partition every month but get the error sed: command garbled: s/YYYYMM/ .
> echo $YYYYMON_NEW
201304
> echo $YYYYMON_OLD
201208
> echo $YYYY_MM_NEW
2013-05
This is my base script:
ALTER TABLE STS.ADMIN ADD PARTITION ADMIN_TABLE_YYYYMM VALUES LESS THAN (TO_DATE('XXYYYY_MMXX-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS')) TABLESPACE ADMIN_TBSP;
Command that I use to replace the substitude the variable and the error that i get:
> sed "s/YYYYMM/$YYYYMON_NEW/g;s/XXYYYY-MMXX/$YYYY_MM_NEW/g" crt_partition_base.sql > $SQL_FILE
sed: command garbled: s/YYYYMM/
This is my os version:-
SunOS portal-db-1a 5.10 Generic_142909-17 sun4u sparc SUNW,Sun-Fire-V440